Overview
Every distributed system, API call, and latency mystery bottoms out in the network stack: how TCP establishes and paces a connection, what TLS adds, how HTTP evolved from one request per connection to multiplexed streams over QUIC, and how DNS resolves the name in the first place. Fluency here pays off twice — in designing systems honestly (the network is not reliable) and in debugging them (reading a packet capture beats guessing).
Key points
- The layered model in practice: IP (routing, best-effort) → TCP (ordered, reliable, connection-oriented; three-way handshake, flow & congestion control — slow start, CUBIC/ BBR) vs. UDP (datagrams; the base for DNS, QUIC, media).
- TLS: handshake (key exchange, certificates, SNI), TLS 1.3's one-RTT improvement, where certificate validation actually happens; mTLS for service-to-service identity.
- HTTP's arc: 1.1 (keep-alive, head-of-line blocking) → 2 (binary framing, multiplexing — but TCP HoL remains) → 3 (QUIC over UDP, 0-RTT); content negotiation, caching headers, chunked transfer.
- DNS: recursive vs. authoritative resolution, record types (A/AAAA, CNAME, SRV, TXT), TTLs and their role in failover, split-horizon; DNS as a load-balancing and service-discovery mechanism.
- The performance vocabulary: latency vs. bandwidth, RTT, bandwidth-delay product, Nagle vs. delayed ACK interactions, connection pooling and keep-alive as the practical fixes.
- On-the-wire tooling:
tcpdump/Wireshark,dig,curl -v,mtr,ss; reading a capture of one HTTPS request end-to-end is the single best exercise. - To explore: NAT and its traversal, BGP at the internet scale, load-balancer L4 vs. L7 behavior, service mesh as networking moved into the platform.
Practice
- Beej's Guide to Network Programming (source) — write TCP and UDP socket clients and servers from scratch; feel the difference below the abstractions.
- Build a DNS resolver (exercise) — a recursive resolver from raw UDP datagrams, walking from the root servers to an authoritative answer; closes with this note's "single best exercise" — the annotated capture of one HTTPS request end to end.
- Build Your Own Load Balancer (source) — L7 forwarding with health checks and connection reuse — the keep-alive and pooling vocabulary made real.
- Protohackers ladder (exercise) — network servers against black-box specs, from TCP echo to a chat server to a MITM proxy — socket programming sustained across a whole project.
Related
- Linux system deep dive — the kernel side: sockets, epoll, netfilter.
- System design fundamentals — the design consequences of these constraints.
- API design — the contract layer riding on top.
- WebSockets & bidirectional protocols — the push mechanisms built on these protocols.
- TLS/HTTPS & certificate management — the handshake and trust architecture in full.