Skip to content
kryptonservers

How DDoS protection works: from the network card to the request

What a DDoS attack does to a server, and how filtering in the network card, a SYN challenge and an L7 guard stop it, with the numbers we measured.

Updated 20 November 2026

A DDoS attack does not need to fill your network link to take a server down. It only needs to make the server spend its time on junk instead of on your users. Protection, then, is about one thing: throwing junk away as early and as cheaply as possible, before it costs anything.

What an attack actually uses up

Every packet a server receives costs work. The network card copies it into memory, the kernel allocates a buffer, the TCP stack looks up a connection, and your application reads and parses whatever arrives. Attacks aim at whichever step is cheapest for the attacker and most expensive for you:

  • Volumetric floods (UDP, amplified DNS or NTP replies) try to fill the link or the network card’s queues.
  • Protocol floods (SYN, ACK, fragments) make the kernel do bookkeeping for connections that will never exist.
  • Application floods (HTTP requests, login attempts, API calls) look like real traffic and make your application do real work.

A filter that only works at one layer leaves the others open. That is why protection is built as layers, each throwing away what the next one should never see.

Layer 1: drop it in the network card

The earliest place software can act on a packet is the network driver. On Linux, an XDP program runs there, before the kernel has allocated anything. It can read the packet’s headers and decide in a few hundred nanoseconds whether it passes.

Our XDP program drops malformed packets, fragments that do not add up, traffic to ports nothing listens on, and every packet from addresses already banned. It also applies per-source rate limits, so one address cannot flood on its own. On our lab servers it dropped a UDP flood of 11.3 million packets a second at the driver while using less than one CPU core, and on established traffic it costs about 367 nanoseconds per packet.

Layer 2: make every new connection prove itself

A SYN flood sends the first packet of a TCP handshake from millions of forged addresses. The server answers each one and keeps a half-open connection, until it runs out of room for real ones.

The answer is a SYN challenge: instead of remembering the connection, the server replies with a cryptographic cookie and forgets about it. Only a real client, at a real address, can send the cookie back. Forged addresses never answer, so they never cost anything.

We answer the challenge in XDP itself, so even the kernel’s TCP stack does not see the flood, and hand verified connections straight to the listening proxy. In the lab, a random-source SYN flood at two million packets a second was answered entirely in the driver while a real client kept connecting from 150 addresses without a single failed request.

Layer 3: read the requests

What passes the first two layers is real TCP from real addresses. It can still be an attack: a botnet sending valid HTTP requests, a script trying a million passwords, a scanner walking every URL.

This is where an L7 guard reads each request and scores each address: request rate, error rate, failed logins, paths that only scanners ask for. On IPTV panels it also knows the panel’s own API calls, so it can see MAC-address cracking and one account shared by a hundred addresses. An address that crosses its threshold is banned, and the ban moves down into XDP, so the next packet from it is dropped in the driver. We measured 0.24 seconds from the first request of a flood to the ban being enforced in the network card.

Layer 4: hide the origin

All of the above protects the machine that receives the traffic. If attackers know your server’s real address, they can skip the filter and hit it directly. With a reverse proxy, your domain points at the filtering nodes, and your origin accepts connections only from them. Lock the origin’s firewall to the proxy’s addresses and there is nothing left to attack.

What protection cannot do

Software filtering has an honest ceiling: the capacity of the link in front of it. A filter on a 10 Gbps port cannot drop a 100 Gbps flood, because the flood never fits through the port. Providers who promise “unlimited” protection either have very large upstream capacity, filter at their upstream, or are not telling you the whole story. Ask what happens above the stated capacity: is the address null-routed, and for how long?

Questions to ask any provider

  • Is protection always on, or switched on after an attack is detected?
  • Does it filter TCP only, or UDP too, and how does it treat game traffic?
  • Is there an L7 layer, and can you see why an address was banned?
  • What is the capacity, and what happens above it?
  • Is attack traffic billed?

Our answers are on the technology page, with the method behind every number.

Questions about your own setup?

Message @kryptonservers