gw-01 — References

Protocol specs

  • RFC 9293 — Transmission Control Protocol (the consolidated TCP spec; supersedes 793). The state machine and the handshake.
  • RFC 768 — User Datagram Protocol. Short enough to read in full.
  • RFC 7413 — TCP Fast Open (handshake-latency optimization).
  • HAProxy PROXY protocol — v1 (text) and v2 (binary) spec. https://www.haproxy.org/download/2.8/doc/proxy-protocol.txt

The C10K lineage

Kernel & performance

  • Brendan Gregg, Systems Performance (2nd ed.) — the network stack, the USE method, epoll/kqueue, tcpdump/ss/bpftrace.
  • man 7 tcp, man 7 socket, man 2 epoll, man 2 splice, man 2 accept4 — read these directly; they are the spec for the code.
  • Cloudflare blog — The curious case of TIME_WAIT, SYN packet handling in the wild, How to stop running out of ephemeral ports. https://blog.cloudflare.com/
  • Marc Brooker — It's About Time and the timeouts/retries series for why connection-level timeouts must be bounded. https://brooker.co.za/blog/

Tooling to learn alongside

  • ss -lnti / ss -s — listening-socket accept-queue depth, per-socket TCP info, summary counters.
  • netstat -s / nstat — kernel TCP counters (listen overflows, SYN drops, retransmits).
  • tcpdump / Wireshark — see the handshake and FIN/RST on the wire.
  • iperf3, wrk, wrk2, vegeta — load generators for the steps.
  • bpftrace / bcc — trace accept-queue overflows and retransmits.

Cross-lab dependencies

  • Upstream: db-01 (syscalls, page cache) for the I/O intuition.
  • Downstream: gw-02 (terminate the stream), gw-03 (filter chain on top of the acceptor), gw-04 (pool the connections this lab opens), gw-05 (drain millions of them), gw-09 (where the packets actually flow in Kubernetes).