XDP explained: dropping DDoS traffic before it reaches the Linux kernel

When a flood hits a server, the cost isn't only bandwidth. For every packet, the kernel allocates memory, walks the networking stack and runs firewall rules before it can decide to drop it. Under a large flood that work alone can take a server down.
What XDP is
XDP (eXpress Data Path) is a hook in the Linux network driver. A small, verified eBPF program runs on each packet the moment the network card hands it over, before the kernel builds its usual packet structures. The program returns a verdict: pass the packet on, drop it, or bounce it back. Dropping at this point costs a tiny fraction of what dropping in iptables does.
Native and generic mode
- Native mode runs inside drivers that support XDP (most modern server and cloud network cards). This is where the big performance gains are.
- Generic mode works on any interface but runs later in the stack. It's slower than native, but still cheaper than traditional firewall rules for large blocklists.
What XDP is good at
- Blocklists of any size: lookups in an eBPF hash map stay fast with hundreds of thousands of entries, so threat feeds and fleet-wide block lists don't slow the server.
- Per-source rate limits for SYN, ICMP and UDP floods.
- Staying on during restarts: the program and its maps stay attached even if the user-space agent restarts.
What XDP can't do
XDP runs on your server, so it can't help when the flood is larger than your network link: the packets have already used up the bandwidth by the time they arrive. Volumetric attacks that saturate the uplink need mitigation upstream, from your hosting provider, data center or a scrubbing service. XDP handles the floods that get through to the server, which is the large majority of everyday attacks against hosting servers.
Safety matters
Because XDP drops packets before anything else sees them, mistakes are costly. A good implementation always allows the server's own addresses and your admin ranges, expires temporary blocks automatically, and falls back to a regular ipset/iptables rule if XDP can't attach.
TurnUpSecurity Shield loads an XDP program on supported servers to drop blocked addresses and rate-limit floods, keeps an ipset fallback in place, and never blocks your own allowlisted addresses.