XDP (eXpress Data Path) lets a small, verified eBPF program decide what happens to every packet the moment the network card hands it to Linux, before the kernel has spent any work on it. For an ISP that changes the economics of the subscriber edge: a commodity server can terminate, translate, shape and filter traffic at rates that used to need dedicated hardware, without taking the NIC away from the operating system. This is how it works, and where its limits are.
Where XDP runs
An XDP program attaches to a network interface and runs in the driver’s receive path, on the raw packet buffer, before the kernel allocates its usual packet structure (the sk_buff). Skipping that allocation and everything that follows it is where most of the speed comes from.
- Native mode runs inside the driver itself. It is the fast path, and it needs driver support.
- Generic mode runs later, after the
sk_buffexists. It works on any interface but gives up most of the performance; it is for testing, not production. - Offloaded mode runs the program on the NIC, on the few cards that support it.
What a program can decide
Every packet ends with one verdict:
XDP_DROP: discard it immediately. This is why XDP is the standard tool for DDoS filtering.XDP_PASS: hand it to the normal Linux network stack, unchanged or modified.XDP_TX: send it back out of the same interface, after rewriting headers.XDP_REDIRECT: send it to another interface, another CPU or a user-space socket.XDP_ABORTED: the error path, which drops the packet and raises a trace event.
Because XDP_PASS exists, the data plane only has to handle what it is built for. ARP, control-plane traffic and anything unexpected can simply continue into Linux, where the usual tools still see it.
Why it cannot crash the kernel
Before an eBPF program is loaded, the kernel’s verifier walks every possible path through it: memory access must stay inside the packet and inside declared data structures, and loops must be bounded. A program that fails verification is refused. That is the practical difference from a kernel module, where a bad pointer takes the machine down, and it is what makes it reasonable to update the data plane on a live box.
Where the state lives: maps
XDP programs keep state in eBPF maps: hash tables, LRU tables, arrays and per-CPU variants, shared with user space. In a BNG that is where the subscriber session table, the NAT port-block allocations and the per-subscriber rate state sit. The control plane writes to the maps; the data plane reads and updates them per packet. Per-CPU maps avoid cache-line contention, which matters once every core is busy.
XDP versus kernel bypass
The other route to high packet rates is kernel bypass, such as DPDK, where a user-space process takes the NIC over and polls it from dedicated cores. It is fast, but the interface disappears from Linux, cores spin whether or not traffic arrives, and every tool you normally use for routing, monitoring and debugging has to be replaced. XDP keeps the NIC in the kernel, uses CPU only when packets arrive, and lets everything it does not handle fall through to the ordinary stack.
The trade-off is that native XDP depends on the quality of the NIC driver. When a driver misbehaves at line rate, the fix has to go into the driver, which is why driver work is part of building an XDP product rather than an afterthought.
What this means for a BNG
On BNGSOFT’s XDP data plane, PPPoE and IPoE termination, CGNAT, hierarchical QoS and ACLs run in one pass, and a single commodity server forwards 50 Mpps with all of them enabled, at about 500 ns per packet. Packets per second is the limit, so throughput follows frame size: wire bits are (frame bytes + 20) × 8, which gives 33.6 Gbps at 64-byte frames and about 144 Gbps at IMIX for the same 50 Mpps. Try it with your own traffic mix in the frame size calculator.
Where XDP is not the whole answer
- Driver support decides everything. Generic mode is not a production fallback; check that your NIC has a mature native driver.
- Programs are deliberately constrained. The verifier limits program size and complexity, so a data plane has to be designed as a pipeline of small, provable stages.
- It is a data plane, not a control plane. RADIUS, routing protocols and management still run in user space and talk to the data plane through maps.
Go deeper
- The XDP data plane: how BNGSOFT uses XDP inside the Linux kernel.
- Packet path explorer: which stages run in each deployment model.
- XDP CGNAT and vBNG / BRAS: the products built on it.
- Request a proof of concept on your own hardware.


