knaxuslearn · build · ship

Roadmaps / Fundamentals / Phase 4

Phase 4 of 4 · Study weeks 13-16

Networking and failure

This phase makes the last checkpoint possible: a server that behaves under slow clients, resets and load, and that you can explain from a capture.

Topics every week

  1. Week 138 h
    • TCP: handshake, windows, retransmission and congestion
    • Sockets and buffers
    • Nagle and delayed acknowledgements
    • Reading a capture

    Hand inAn annotated capture of a connection from open to close

  2. Week 148 h
    • Framing and partial reads
    • Timeouts, keepalive and half-open connections
    • Resets and TIME_WAIT
    • Slow clients

    Hand inTests for a slow consumer, a half-open connection and a partial frame

  3. Week 158 h
    • DNS, TLS and HTTP at the level a server engineer needs
    • Proxies and load balancers
    • Connection limits and file descriptors

    Hand inA note on what a proxy changes for your server and a TLS handshake capture

  4. Week 168 h
    • Load testing and percentiles
    • Capacity planning
    • Failure drills
    • A diagnosis playbook
    • Review

    Hand inCheckpoint 4, the load report and the diagnosis playbook

Practice projects

  • Practice 1, the annotated capture (Week 13): capture one publish and one reset. Done when: every packet is labelled and you explain why the reset happened.
  • Practice 2, the slow consumer (Week 14): connect 10 consumers that read one byte a second. Done when: the server stays responsive for others, memory is bounded and a test proves it.
  • Practice 3, the load run (Week 16): run 5 minutes at 20,000 messages a second. Done when: a table reports p50, p99 and spread over three runs and the memory at the end.
  • Optional, a proxy in front: put a reverse proxy in front of the server. Done when: you list three behaviours that changed (timeouts, connection reuse, client addresses).

GitHub repos to study

Existence and last commit were checked on 22 Nov 2026 by shallow clone. Every repository below had a commit in the last 12 months.

RepoWhat to readWeek
wireshark/wiresharkThe TCP dissector and the analysis flags13
envoyproxy/envoyHow a proxy handles connections, timeouts and buffers15

Milestone checkpoint

Run Checkpoint 4. Write the three failure tests and the load script first. Raise the connection limit to 10,000 and fix what breaks. Capture a reset and annotate it. Run the load test three times. Write the diagnosis playbook from what you learned. Hand in the capture, the tests, the load report with spread, ADR-7 (the limits and timeouts) and the playbook.

Check yourself

Answer each question in your head first, then open it to check.

  1. What does TCP guarantee, and what does it not?
    It delivers bytes in order and without duplicates, or reports an error. It does not keep message boundaries, bound delay or tell you the peer processed the data.
  2. What is a half-open connection, and how do you detect one?
    One side thinks the connection is open and the other does not, for example after a crash or a dropped route. Use application timeouts and keepalive probes.
  3. Why do you need your own framing on top of TCP?
    TCP is a stream, so one read can return half a message or two. You need a length prefix or a delimiter.
  4. What does TIME_WAIT protect against, and when does it hurt?
    It stops late packets from an old connection being mistaken for a new one. It hurts when a client opens thousands of short connections and runs out of ports.
  5. How do you tell whether slowness is in the server, the network or the client?
    Compare timestamps: when the request left the client, arrived at the server, finished processing and returned. A capture on each side shows where the time goes.