I don't expect to can see a perfect DoS solution in my lifetime;-) As we known, there are tons of commercial gateway-level boxes can mitigate the DoS attack in some ways. But I prefer the combination of x86+GNU/Linux, like the most old school guys. Why? My answer is simple: It's the fuc*ing cheapest solution we have. SYNPROXY is one of new features of linux kernel 3.13. It's based on netfilter framework and connection tracking. If I understand correctly, SYPROXY should mark the initial SYN packet as UNTRACKED and redirecting them into iptables's action "SYNPROXY"( like ACCEPT, DROP, NF_QUEUE, etc). SYNPROXY would be acting like a network gateway device( router?) to performing the regular TCP x-way handshakes. The original packet will be passing into the dst when handshake process is finished. The contributor Jesper Dangaard Brouer gave us a free speech at DEVCON last month. According to his slide's test result, these numbers are really looking good. I did a little test with my colleague today.
Platform: Debian, SLES-12-beta2
Hardware: Laptop, Server, 100Mbps Switch
Tools: hping3, metasploit
root@d6-test:/home/shawn# iptables -t raw -A PREROUTING -i eth0 -p tcp --dport 8888 --syn -j NOTRACK
root@d6-test:/home/shawn# iptables -A INPUT -i eth0 -p tcp --dport 8888 -m state --state UNTRACKED,INVALID -j SYNPROXY --sack-perm --timestamp --mss 1480 --wscale 7 --ecn
echo 0 > /proc/sys/net/netfilter/nf_conntrack_tcp_loose
Result:
Without SYNPROXY: ksoftirq is around 8%-9%
With SYNPROXY: ksoftirq is less than 3%
btw: This result may not be very accurate. Anyway, SYNPROXY works.
Just keep your mind open and suck in the experience.And if it hurts,it's probably worth it.God is Love!
Showing posts with label netfilter. Show all posts
Showing posts with label netfilter. Show all posts
Wednesday, March 19, 2014
Thursday, July 07, 2011
Hacking the wholism of GNU/Linux net*
hi guys,
I have written an article[1] for newbies who are willing to learn networking stuff in linux kernel. I hope this introduction-level article can help you understand the mechanism of netfilter and NIC driver.
For this article, any critical comments are welcomed!
[1] http://hfg-resources.googlecode.com/files/hacking_the_wholism_of_linux_net.txt
I have written an article[1] for newbies who are willing to learn networking stuff in linux kernel. I hope this introduction-level article can help you understand the mechanism of netfilter and NIC driver.
For this article, any critical comments are welcomed!
[1] http://hfg-resources.googlecode.com/files/hacking_the_wholism_of_linux_net.txt
Subscribe to:
Posts (Atom)