Kernel Bypass Networking Explained
Kernel bypass moves packet handling into user space, removing the context switches and copies a normal socket stack imposes on every market data message.
Kernel bypass networking replaces the operating system's normal socket stack with a user space path that talks to the network card directly, and it exists because the standard stack was designed for generality and safety rather than for latency. A conventional socket read involves a network interrupt, a context switch into the kernel, a copy of the packet from a kernel buffer into user space, and a second context switch back, and each of those steps adds latency and jitter that a trading system processing thousands of market data messages a second cannot absorb.
When a packet arrives under a conventional stack, the network card raises an interrupt, the kernel's driver handles it, the data is copied into a kernel-owned socket buffer, and the application thread, which may not even be scheduled to run at that exact moment, is woken up to read the data out with a further copy into its own memory. Each context switch between kernel and user mode costs on the order of a microsecond or more once scheduling effects are included, and that single microsecond is already several times the entire latency budget a market maker allocates to react to one update.
Interrupts also introduce jitter rather than just latency, because the operating system decides when to service them relative to everything else competing for the core, so the same message can arrive with a different effective delay from one instance to the next, which is precisely the kind of tail behavior covered in the piece on measuring latency properly in a trading system.
Kernel bypass technologies, including Solarflare's OpenOnload, Exablaze network cards and the DPDK framework, let a user space application map the network card's receive and transmit rings directly into its own memory and poll them continuously rather than waiting for an interrupt. There is no context switch into the kernel on the fast path at all, and the data the application needs to read is already sitting in memory it controls, so the copy from a kernel buffer disappears along with it.
Polling instead of interrupt-driven delivery is itself a deliberate trade: a polling thread spins continuously, consuming a full CPU core even when no data has arrived, in exchange for eliminating the scheduling uncertainty an interrupt introduces. Firms including XTX Markets and Virtu Financial dedicate entire cores to this kind of busy polling on their fastest paths, accepting the wasted CPU cycles as the price of deterministic latency.