18 November 2026 · Kryptonservers engineering
Dropping a 2-million-packet SYN flood in the network card, without failing a real client
How an XDP SYN cookie with a TC hand-off answered a random-source SYN flood at 2 Mpps while a real client from 150 addresses saw zero errors.
A SYN flood is the oldest trick in the book and still the most common thing thrown at a busy panel: millions of connection requests a second, each from a forged address, each asking the server to remember a half-open connection. The classic defences either fall over at volume or slow down every real client. Here is how KryptonProxy deals with it, and what we measured.
Answer in the driver, remember nothing
The kernel’s own SYN cookies help, but only after the packet has been through the network stack: allocated, parsed, looked up. At two million packets a second that work alone fills cores.
So we answer earlier. An XDP program, which runs in the network card’s driver before the kernel allocates anything, replies to every SYN on a protected port with its own SYN-ACK. The sequence number in that reply is a cookie: a keyed hash of the connection’s addresses and ports, the client’s initial sequence number and the current minute, with the client’s MSS, window scale and SACK packed into it. Nothing is stored. A forged source never answers, so a flood costs us one reply per packet and no memory at all.
Hand the real ones to the listener
When a real client answers, its ACK arrives with the cookie. A small TC program checks it and, if it is ours and fresh, hands the connection straight to the listening socket with the options the client asked for. The application never sees a half-open connection; it only gets clients that completed the handshake.
Two details matter for real users:
- Window scaling survives. A naive cookie drops the client’s window scale when it has no TCP timestamps, and Windows clients usually have none. A stream that should run at 20 Mbps falls to about 5 over a 100 ms path. Our cookie carries the window scale and SACK itself; the same stream measured 19,938 kbps out of 20,000.
- Data can overtake the ACK. Under load, a client’s first data packet sometimes reaches the server before the ACK that completes the handshake. The XDP program remembers valid cookies for two seconds, so that packet is not taken for an attack.
What we measured
On a pair of dual Xeon E5-2690 v4 servers with Intel 82599 cards on a private VLAN, twelve generators sent a SYN flood from random sources at 2.0 million packets a second, then an ACK flood at 1.9 million. At the same time a legitimate client opened connections from 150 addresses.
- XDP answered every SYN and dropped every unmatched ACK at the driver, using 2.7 and 2.2 cores of softirq time.
- The legitimate client finished every request: zero errors through both floods.
- Outside a flood, XDP costs 367 ns per packet on established traffic and 874 ns on new connections, about 1 % and 3 % of the node.
What it does not do
A filter in the network card cannot drop a flood bigger than the link it arrives on. A 10 Gbps port saturated by attack traffic is saturated before any software runs. That is why the hosted proxy exists: your service sits behind our network instead of behind one server’s uplink.
If you want the raw numbers or the method, ask us on Telegram; the full write-ups are on the technology page.