map / networking
Pillar 01 · 6 principles
Networking.
Every request is a chain of round trips.
Most production mysteries are network mysteries in disguise. If you can narrate what happens between curl and the first byte — and where the milliseconds go — you can debug almost anything.
Packets & layers
Each layer wraps the one above it, so every problem lives at a specific layer — find the layer, and you’ve halved the search.
An HTTP request being wrapped into TCP segments, IP packets, and frames.
DNS resolution
DNS is a cached, hierarchical lookup; most DNS incidents are really caching (TTL) incidents.
Stub → recursive resolver → root → TLD → authoritative, with cache hits short-circuiting the path.
TCP handshake & congestion
TCP spends one round trip to open a connection and then ramps up its sending window, so new connections are slow by design.
SYN / SYN-ACK / ACK on a timeline, then slow start growing the congestion window.
TLS
TLS adds a handshake on top of TCP (one round trip in TLS 1.3, two in 1.2) before any application data flows.
Handshake messages laid over the TCP timeline, with session resumption as a shortcut.
L4 vs L7 load balancing
An L4 balancer routes connections without reading them; an L7 balancer parses requests, which buys smarter routing at the cost of more work per request.
The same traffic split by connection vs by request, with a long-lived connection pinning one backend.
Latency budgets
Light in fiber travels roughly 200 km per millisecond, so distance sets a floor on every round trip that no code can beat.
“What happens when you curl a URL”: DNS → TCP → TLS → request → response, each step costed in round trips.
How it shows up in interviews
- “A request is slow / failing — walk me through how you’d find out why.”
- Reading
dig,curl -v,ss, andtcpdumpoutput out loud. - Choosing L4 vs L7 load balancing and explaining the trade-off.