What is a TCP SYN Flood attack?
The SYN Flood is one of the oldest and most effective denial-of-service (DDoS) attacks. It abuses TCP's three-way handshake: the attacker floods the target with SYN packets using a spoofed source address, the server replies with SYN-ACK and reserves resources waiting for an ACK that never arrives. As thousands of half-open connections pile up, the connection table saturates and the server stops accepting legitimate traffic.
How does it work step by step?
The attacker crafts SYN packets with a spoofed source IP so the SYN-ACK replies are lost or hit third-party victims. Each half-open connection consumes memory in the operating system's backlog queue. Without defenses, a few thousand packets per second are enough to exhaust that queue and take the service down, even from a single machine with modest bandwidth.
How to mitigate a SYN Flood?
Classic defenses are SYN cookies (the server holds no state until the handshake completes), a larger backlog, shorter half-open timeouts, and filtering with firewalls and rate limiting. At high volumes you need an edge anti-DDoS (scrubbing) service that absorbs and cleans the traffic before it reaches the origin.
How SYN cookies actually work
Instead of holding the half-open connection in memory, the server encodes the information it needs inside the sequence number it sends in the SYN-ACK: a coarse timestamp, the maximum segment size and a cryptographic hash of the addresses and ports. If the client answers, the ACK returns that number incremented, and the server rebuilds the connection by validating the hash having reserved nothing at all. The cost is losing some TCP options negotiated during the handshake, which is why many systems only enable them once the backlog queue starts filling up.
How do you detect one while it is happening?
The most direct signal is a high, sustained count of connections in SYN_RECV state, visible with `ss -n state syn-recv | wc -l` or `netstat -an | grep SYN_RECV`. Add an abnormal ratio of SYN to ACK packets, source addresses that never complete the handshake and, in the kernel log, queue overflow messages. Watch that CPU is not saturated: unlike a volumetric attack, a SYN Flood can take the service down without exhausting bandwidth, which misleads anyone looking only at the traffic graph.
Why it still works after thirty years
Because it does not exploit a coding flaw that can be patched, but the design of the protocol itself: TCP needs to reserve state for a connection that is not yet confirmed. Its variants remain current — SYN-ACK flood and ACK flood against stateful firewalls, or reflection using third parties as amplifiers — and the cost to the attacker stays minimal, since the packets are small and the source IP is spoofed. That is why defense is not about eliminating it but about making it expensive and absorbing it.



