DEV Community

Cover image for TCP SYN Floods: Why Servers Need Stateless SYN Cookies
Binary Dose
Binary Dose

Posted on Originally published at binarydose.in

TCP SYN Floods: Why Servers Need Stateless SYN Cookies

TCP SYN Floods & SYN Cookies

The classic TCP 3-Way Handshake has an inherent asymmetry that attackers exploit for denial-of-service.

⚡ The Half-Open Vulnerability

Every incoming SYN allocates a socket structure in the kernel's SYN queue. If ACKs never arrive, the queue fills and all new connections drop.

🛡️ The Cryptographic Fix: SYN Cookies

By setting:

ISN = Hash(s_ip, d_ip, s_port, d_port, counter) + MSS index
Enter fullscreen mode Exit fullscreen mode

the server remains completely stateless until the client sends the final ACK!

Explore the space-time protocol ladder on Binary Dose.

Top comments (0)