Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Appendix B - Networking & Kernel Notation

Every number and unit used in the book, defined once, with the reasoning behind each one. These are the figures you will quote when someone asks “how fast is this really?” - and the units that keep you honest when you answer.

Rates, sizes and units

SymbolMeaningNotes
1 Gb/s10^9 bits per secondEthernet line rates are decimal
ppspackets per secondthe honest measure for network software
Mpps / Gpps10^6 / 10^9 packets per secondXDP territory starts around 1 Mpps/core
B / bbyte / bitMb is a million bits; MB is a million bytes
KiB / MiB2^10 / 2^20 bytesmemory and map sizes are binary
64 Btypical minimum Ethernet frame payload+14 B header, 4 B CRC, 20 B inter-frame gap
14 BEthernet header (ethhdr)dst MAC 6 B, src MAC 6 B, ethertype 2 B
20 BIPv4 header without options (iphdr)
20 BTCP header without options (tcphdr)data_offset says how many 4-byte words
8 BUDP header (udphdr)

The per-packet budget

The single most useful number in the book. For a machine with C cores running at F GHz, the time available per packet at R Mpps is:

cycle budget per packet = (C * F * 10^9) / (R * 10^6)   cycles/packet

Examples at 4 GHz total (e.g. a 4-core slice):

RateCycles per packetWhat fits
1 Mpps4000full XDP parse + map lookup + redirect
5 Mpps800tc filter with one map lookup
25 Mpps160minimal XDP drop (DDoS filter)

Latency ladder (typical Linux numbers)

OperationOrder of magnitudeNotes
L1 / L2 / L3 cache~1 / ~4 / ~12 nsmap lookups live here
bpf() syscall~1-3 usloading is a control-plane op, not data-plane
epoll_wait wake + copy~2-10 usthe socket receive path (Chapter 7)
softirq → stack → socket~5-15 uskernel default path with copies
XDP drop / redirect~0.1-1 usbefore the stack, no skb allocation
sockmap redirect~0.5-3 usin-kernel socket-to-socket, no userspace

Kernel machinery you will see in logs

TermMeaning
NAPIthe kernel’s polled receive path; disables per-packet IRQs
GRO / GSOGeneric Receive/Segmentation Offload: merge/split packets
RSS / RPSNIC-side / software receive-side scaling across queues
softirqdeferred interrupt processing; where the stack runs
skbstruct sk_buff, the kernel’s packet buffer
qdiscqueueing discipline: tc’s attach point for egress
clsactthe modern tc attach class for egress and ingress
conntrackconnection tracking, the nf_conntrack table
CT (Cilium)Cilium’s own conntrack in BPF maps
BPF ring bufferlock-free BPF_MAP_TYPE_RINGBUF, the modern event path

Time notation

  • ktime_get_ns - kernel monotonic clock in nanoseconds; the clock BPF programs use (Chapter 13).
  • CLOCK_MONOTONIC - the userspace twin; immune to wall-clock jumps.
  • p50 / p99 / p999 - percentile latency; network systems are judged on p99+ because tail latency is what users feel.

Use this appendix as your cheat sheet while reading; every claim in the book is stated so it can be checked against one of these rows.