Basic Prerequisites: Low-Latency Systems Architecture (the end-to-end systems view this folder sits under) and High-Performance C++ for Trading (the user-space hot path that consumes these packets). Working knowledge of Linux, sockets, and the memory hierarchy. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

This folder is about the OS-and-wire layer of the tick-to-trade path: turning a stock Linux box into a deterministic, microsecond-grade execution platform. The C++ folder owns the CPU cycles inside your process; this folder owns everything between the wire and your first line of strategy code - the kernel network stack, the NIC, the interrupt/PTP clock plane, and how you prove to yourself that it is fast.

The objective is one measurable thing: shrink the latency and the jitter of the market-data-to-application path, then prove both with trustworthy measurement. A fast mean is not the goal; a small tail is - because in a race you do not lose on the average, you lose on the 1-in-1000 packet that arrived late.

The one-sentence essence. “Linux is tuned for throughput, fairness, and safety; a low-latency trading host is tuned for the opposite - one core, one job, no interrupts, no copies, no surprises - and every trick in this folder is a way to make the kernel get out of the way of a packet on its way to your pinned application core.”

The three first principles (each is physics/OS behaviour, not opinion):

  1. Latency is a sum, but jitter is a variance - and variance adds. Total latency is the sum of independent stage costs, so the slowest stage dominates the mean. But the tail is driven by the stage with the largest variance: one jittery stage (an interrupt, a scheduler wake, a TLB miss) corrupts every percentile above the median. Killing the jitter of one stage is worth more than shaving the mean of all of them.
  2. The kernel network path is ~24× slower than it needs to be. The Linux TCP/UDP path raises an interrupt, context-switches into the kernel, copies into kernel memory, runs protocol layers, copies to user space, and wakes your thread - roughly 10–25 µs and multi-µs of jitter. Kernel bypass (DPDK, Solarflare/Onload) and busy-polling remove almost all of it for ~1 µs and near-zero jitter. This is the cheapest microsecond in the whole stack.
  3. You cannot tune what you cannot measure. Latency measurement is itself subject to measurement error (timer overhead, coarse histogram bins, clock asymmetry). Everything you “know” about your latency comes from a histogram and a clock - if those are wrong, the tuning is theatre.

Scope note (what lives here vs. siblings). The silicon end of the same problem - parsing feeds in FPGA, the FPGAs-vs-CPU-vs-GPU tradeoff - lives in Hardware Acceleration & FPGA, which this folder cross-links rather than duplicates. The economic/architectural frame (is the speed worth building, the nano-to-milli hierarchy, ring buffers) is Low-Latency Systems Architecture. The clock-plane math (PTP offset estimation, oscillator drift) is 04 · Clock Synchronization. This folder is the Pillar 8 / Linux practitioner treatment: the concrete sysctls, the NIC tuning, the bypass mechanics, and the measurement discipline.


2. Mathematical Ground Truth & Lookups

Quick-reference lookup (job #1). Illustrative order-of-magnitude figures; re-measure on your box. These are the numbers that decide which tier you build in.

Path elementApprox. one-way latencyApprox. jitterComment
Wire, optical fibre~5 ns/metrenear-zerophysics floor; nothing software fixes
NIC RX, kernel path1–2 µs-DMA into ring buffer
Linux TCP/IP stack~10–25 µsmulti-µsinterrupts, copies, scheduler wake
Kernel bypass (DPDK/Onload/EF_VI)~1.2 µssub-µsbusy-poll, zero-copy, core-pinned
FPGA feed path~0.06–0.15 µsnear-zerosee Hardware Acceleration & FPGA

Line-rate ceiling (why a faster NIC may buy nothing). For a minimum-size frame of bytes (Ethernet 84 B) on a link of b/s, the packet ceiling is

A NIC beyond this ceiling is idle - for latency-sensitive small-message traffic the wire, not the NIC, is the bottleneck.

Per-core processing capacity. A core at frequency spends cycles per packet:

Kernel path cycles (=~870 ns at 3 GHz) ~1.15 M pkt/s; bypass cycles (=~53 ns) ~18.8 M pkt/s. Sustaining 10GbE line rate (14.88 M pkt/s) therefore needs ~12.9 cores on the kernel path vs ~0.79 of one core bypassed (verified in 03 · Kernel Bypass & NICs).

Jitter decomposition (the folder’s organising idea). Total latency is a sum of independent stage random variables, , so

Because variance adds, one stage with large variance dominates every upper percentile. From the verified model in §3: taming the jitter of one stage ( flat) drops the end-to-end p99 from 110.6 µs to 21.5 µs (p99/p50 from 7.63× to 1.50×) while barely moving the median. The mean rewards shaving every stage; the p99 rewards killing one jitter source.

Hugepages / TLB. A 48-bit virtual address is translated through page-table levels : 4 (4 KB), 3 (2 MB), 2 (1 GB). A 64 MB working set needs 16,384 4 KB pages (99.6% TLB miss, ~20 ns effective address latency) vs 32 2 MB pages (0% miss, ~4 ns) - a 5× effective hit (verified in 02 · Kernel Tuning).

Critical caveat. All figures are magnitudes, not guarantees - they depend on microarchitecture, NIC model, driver, kernel version, and NUMA placement. The whole point of 06 · Advanced Extensions is the measurement discipline that turns these into your numbers.


3. Computational Implementation - the jitter-decomposition model

This hub ships the folder’s unifying model: two end-to-end market-data paths with the same mean budget but different stage-jitter allocation, read off as percentiles. It shows why jitter, not mean, is the thing you manage. Standard library only.

The medians are essentially the same (14.5 vs 14.4 µs) but the p99 collapses 5× when the one jittery stage is tamed. That is the folder in one run: average latency is almost meaningless; tail latency is the market’s scorecard, and the tail is owned by your jitteriest stage.


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the folder’s full fault analysis lives in 05 · Failure Modes & Practice. In one line each:

  1. Configuration drift. The tuned kernel/NIC is not the running kernel/NIC: a package update, a driver reinstall, or a reboot can silently revert isolcpus, IRQ affinity, or hugepage settings - the mean stays flat, the p99 creeps up.
  2. Measurement error masquerading as latency. Timer overhead (~tens of ns), coarse histogram bins, and asymmetric clock paths each inject bias into the very percentiles you quote.
  3. Tuning for the mean. Shaving 2 µs off every stage leaves the 1-in-1000 tail untouched; the race is lost on the tail (the §3 model demonstrates the magnitude).

5. References

  • Kerrisk, Michael - The Linux Programming Interface (No Starch, 2010). The definitive syscall/socket/timer reference; the tuning vocabulary everything here uses.
  • Benvenuti, Christian - Understanding Linux Network Internals (O’Reilly, 2005). How the kernel actually processes packets (NAPI, softirqs, sk_buff)
  • Rosen, Rami - Linux Kernel Networking: Implementation and Theory (Apress, 2013). The modern-stack sibling to Benvenuti.
  • Stevens, W. Richard (Fall, Kevin) - TCP/IP Illustrated, Vol. 1: The Protocols, 2nd ed. The transport semantics your trading connection sits on.
  • Red Hat Enterprise Linux - Monitoring and Managing System Status and Performance: Tuning the Network Performance. Official sysctl/tcp_* tuning guidance.
  • Databento - Low-Latency Tuning Guide for Linux and Trading Systems. Practitioner-grade: kernel bypass, RSS/RFS, IRQ affinity, busy-polling, NUMA-local everything.
  • Cloudflare - Optimizing TCP for High WAN Throughput While Preserving Low Latency. The measured TCP-autotuning tradeoffs.
  • lowlatencysystem.com - The Complete Guide to Low-Latency Trading Systems. Layered orientation read (tick-to-trade, OS/Linux tuning, network path).
  • DPDK documentation; Solarflare/OpenOnload & EF_VI docs. Primary sources for the bypass receive path.

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05