A SYN flood is aimed at one queue and lands on every table in front of it.
The SYN flood is the oldest denial-of-service attack still in routine use, and its fix is nearly as old. SYN cookies took the listener's half-open queue out of the attack in 1996, and Linux distributions ship with them switched on.
That is why SYN flood testing so often ends in a pass that means less than it appears to. The run confirms the listener survives. It rarely asks which box actually answered the SYN, or how many stateful devices wrote the attempt down on the way there.
SYN flood testing, defined
SYN flood testing is controlled, authorised traffic that opens TCP handshakes and never completes them, sent through the real path to a service, to find the SYN rate at which each component in that path stops accepting new connections and which component gets there first.
The listening socket is one of those components. On most production paths it is not the first to go.
What other pages already cover
How the attack works and the queue it targets are in the SYN flood and TCP SYN backlog definitions, including the residence arithmetic and the kernel counters for the listener. The cookie trade-off is in SYN cookies, the inline alternative and its ceiling in SYN proxy, and the sysctls sit with the other transport-layer vectors in understanding DDoS attack vectors.
This post covers the path around the listener: which hop terminates the handshake, which hops track it without answering, and what a test that never forges a source address can and cannot show. Authorisation, ramps and stop conditions are the same as for any target, and the complete guide to DDoS testing has them.
At a glance: where a SYN gets held
| Hop | What it does with a SYN | What fills | Where to read it |
|---|---|---|---|
| CDN or reverse proxy that terminates TCP | Answers it; the origin never sees it | The proxy's own queues | The provider's or the proxy's metrics |
| Stateful firewall or cloud security group | Records it and forwards it | A connection-tracking table | Device counters, cloud allowance metrics |
| Pass-through load balancer | Forwards it, sometimes with state | A flow table | The balancer's metrics |
| Host kernel with netfilter tracking | Records it before the socket sees it | nf_conntrack | nf_conntrack_count, the kernel log |
| Listening socket | Answers it | The half-open queue, unless cookies engage | nstat, ss |
The hop that answers
A TCP handshake has exactly one counterpart. Whichever device sends the SYN-ACK is the one whose half-open queue the flood fills, and on many architectures that device is not your server.
A terminating edge moves the target
A CDN, a reverse proxy or an L7 load balancer completes the client's handshake itself and opens separate connections to the origin. The attacker's SYNs end at the edge.
The origin's queue then reads empty for the whole test. That is a correct result and says nothing about the origin. It is a measurement of the edge, whose ceiling belongs to the provider and is documented in their terms or not at all.
The origin-side question at a terminating edge is a different one: does a path to the origin exist for anyone who skips the edge? If the origin answers SYNs from the whole internet, the edge is a detour, which is the subject of origin IP exposure and CDN bypass.
A pass-through balancer hands the SYN on
A network load balancer that forwards packets without terminating them, or a Kubernetes Service implemented with address translation, delivers the attacker's SYN to a backend kernel. Now the backends answer, and their queues and cookies are the control under test.
This is the layout in which the listener result matters most. It is also the layout in which the forwarded SYN passes through the most state on its way, which is the next section.
Every listener is its own queue
The half-open queue belongs to a listening socket, not to the host. A run against port 443 says nothing about the SSH port, an admin console on 8443 or the port the health check uses, and each one was sized by whichever program called listen().
Application defaults are where this bites. nginx passes a backlog of 511 on Linux unless the listen directive says otherwise, as the NGINX and load balancer post notes, so two services on the same host can sit eight times apart.
Cookies empty one table, not the ones in front
SYN cookies stop the listener from holding state for a half-open connection. They do nothing for state held by anything else, and on a modern host something else is often tracking.
The host's own conntrack
With netfilter connection tracking loaded, every inbound SYN creates a tracking entry before the socket sees the packet. That covers any host with stateful iptables or nftables rules, most container hosts that publish ports, and Kubernetes nodes where kube-proxy relies on conntrack to translate Service addresses.
When the kernel answers with a cookie, the entry moves to SYN_RECV, and on a default kernel nf_conntrack_tcp_timeout_syn_recv keeps it for 60 seconds. The socket holds nothing. The tracking table holds one row per SYN for a minute.
So a host can log "Sending cookies", keep its listener perfectly healthy, and still drop every new flow on the box through conntrack exhaustion, SSH and the monitoring agent included. The cookie worked. The host went dark anyway.
The sizes are not chosen for floods
kube-proxy sizes the node's table at 32,768 entries per CPU core by default, with a floor of 131,072. An 8-core node gets 262,144 rows. At 60 seconds per half-open row, about 4,400 SYNs a second keeps it full.
That is a small number. At 60 bytes a packet it is roughly two megabits a second, well under anything a bandwidth alarm would notice.
Stateful hops upstream
The same holds one hop out. A stateful firewall in front of the servers records each SYN it forwards, and it usually carries a smaller table than the servers behind it, the appliance pattern the on-premise post describes.
Cloud security groups are stateful in the same way. On AWS, an instance's tracked connections count against a per-instance allowance, and the ENA driver reports conntrack_allowance_exceeded when packets are dropped because it ran out. AWS also documents the narrow conditions under which a flow is not tracked at all, rules open to every address and port in both directions among them, which shows how few SYNs escape tracking by default.
Where a SYN proxy helps
A SYN proxy answers before anything behind it records state. Linux has one built in: netfilter's SYNPROXY target, deployed with the SYN exempted from tracking in the raw table, so a SYN that is never completed creates no conntrack entry at all. Only a client that finishes the handshake earns a row.
The definition covers the proxy's own ceiling. The test question here is placement: a proxy protects the tables behind it and none of the tables in front of it.
What an unspoofed test can and cannot show
A real SYN flood usually carries forged sources. A legitimate test sends none, and its SYNs leave from machines the tester runs. That changes three readings in a SYN flood test, and the report should say how each was handled. The wider list of what a simulation leaves out by design is in DDoS simulation.
The generator can clean up its own flood
When the server's SYN-ACK reaches a real test host that never opened the connection, that host's TCP stack answers with a reset. The reset frees the half-open entry at once.
Residence time is half the arithmetic of a full queue. An entry the kernel would hold for about 63 seconds under default retries is held for one round trip instead, so at 20 milliseconds the same SYN rate keeps roughly 3,000 times fewer entries occupied.
A test that misses this reports a knee far above the real one. The test hosts must stay silent on the return path, and the report should state that they did.
Per-source limits read better than they are
A test from a few hundred real addresses sends many SYNs from each. A per-source SYN rate limit sees all of them, trips early, and the run shows a control that held.
A forged flood at the same total rate sends a handful of SYNs from each of millions of addresses, and the same limit never fires. So a per-source control is judged by arithmetic, the total rate divided by a realistic source count against the per-source threshold, and recorded in the report as not measured by the run.
The SYN-ACKs come home
One reading is better in a test than in an attack. Every SYN-ACK and every retransmission returns to the tester's own addresses, so the server's retry behaviour is visible directly: how many SYN-ACKs each SYN earned, when cookies started, and whether the retry count matches the configuration.
Reading the result hop by hop
The deliverable of a SYN flood test is a short table: each stateful hop in the path, the SYN rate at which it started dropping, and the counter that showed it. The lowest row is the layer of first failure.
Predict it before the first run
Every row follows the same arithmetic: a table fills at its size divided by how long it holds a half-open entry. Write down each hop's size and hold time, and the predicted knee falls out before a packet is sent.
With cookies off, the listener's queue is the lowest bar by a wide margin. With cookies on, it drops out of the chart, and the knee for the whole host becomes the tracking table. The test confirms which prediction is true, and a hop that fails well below its predicted rate is the finding.
The counters per hop
- Listener:
ListenOverflows,ListenDropsand theSyncookiescounters fromnstat, plus the "Possible SYN flooding" line in the kernel log. - Host tracking:
nf_conntrack_countagainstnf_conntrack_max, thedropandinsert_failedcolumns ofconntrack -S, and "table full, dropping packet" in the log. - Cloud instance: the provider's tracked-connection metric, for AWS
conntrack_allowance_exceededfromethtool -S. - Firewall or balancer: session table use and new-session rate, from the device itself.
- Terminating edge: the provider's reporting, alongside the origin's view of the connections the edge opens to it.
The number a user feels
All of those counters stand in for one figure: the share of real clients that complete a handshake during the flood, and how long it takes them. Run a known-good client population through the same path for the whole test and record handshake success and connect time.
A client whose SYN was dropped retransmits it, so connect times bunch near one, three and seven seconds on Linux clients. Those clusters in the results are the dropped SYNs, counted from the client's side.
Health checks use the same handshake
A load balancer's health check is a TCP connection like any other. If a backend's queue fills with cookies off, or its host's tracking table fills with cookies on, the health check's SYN is dropped with everyone else's and the backend is marked down.
Its traffic moves to the others, which may already be flooded. A SYN flood can empty a pool this way without the balancer itself being under any strain, so the test watches the balancer's healthy-host count alongside the backends' counters.
Running the test
Ramp SYN rate, not bandwidth
At 60 bytes a packet, 100,000 SYNs a second is under 50 megabits. Specify the ramp in packets per second and let bandwidth fall out of it; a plan written in Gbps for this vector has picked the wrong unit.
One run per listener that matters
Each listening socket has its own queue, so each one the business depends on gets its own run: the public ports, the health-check port, and the management ports reachable from wherever the flood would come from.
Cookies on is the result
Cookies on is the production state and the one the report leads with. A second run with cookies off, in staging, shows how much margin the queue alone provides, and how the cookie trade-off described in the definition affects users who connect mid-flood.
The neighbouring shapes
Plain SYNs are not the only handshake flood. SYN floods carrying payload add bandwidth to the state cost, and SYN-ACK floods test how each stateful hop treats handshake packets that belong to no connection. Each gets its own short run, with the rate caps and stop conditions in DDoS testing without disrupting production.
FAQ
What is SYN flood testing?
It is authorised traffic that opens TCP handshakes without completing them, sent through the real path to a service, to measure the SYN rate at which each stateful component stops accepting new connections. The result names the component that fails first, which is often a connection-tracking table rather than the listening socket.
Do you need spoofed traffic to test SYN flood protection?
No, and a legitimate test never uses it. SYN cookies and SYN proxies behave the same for any source that does not complete the handshake, so a test from the tester's own addresses exercises them fully, provided the test hosts do not reset the server's SYN-ACKs. Per-source limits are the one control a real-source test cannot judge against forged addresses, so they are assessed by arithmetic instead.
Are SYN cookies enough to stop a SYN flood?
They protect the listening socket. They do nothing for a connection-tracking table on the same host or on any stateful device in front of it, and those tables often fill first. A host can answer every SYN with a cookie and still drop every new flow.
Does a CDN protect the origin from SYN floods?
For traffic that goes through it, yes: the CDN terminates the handshake and the origin never sees the attacker's SYNs. It does nothing for SYNs sent straight to the origin's own address, which is why origin reachability belongs in the test.
How many SYNs per second does it take to cause an outage?
It depends on the smallest table in the path and how long it holds a half-open entry. A 4,096-entry queue with default retries fills at about 65 SYNs a second if cookies are off. A 262,144-row tracking table holding entries for 60 seconds fills at about 4,400. Both are tiny next to the bandwidth of a single server port.
Bookkeeping, not bandwidth
A SYN flood is an attack on bookkeeping. It costs the attacker almost nothing to send and costs every device that writes the attempt down a row for as long as that device is willing to wait.
The listener's part of that was solved in 1996. The tables in front of it have been added one at a time since: a stateful rule here, a container runtime there, a security group, a Service proxy, each sized for normal traffic by someone who was not thinking about half-open connections.
The fix for the queue shipped decades ago. A SYN flood test is for everything installed in front of it since.
