Master the fundamental concepts of tcp/ip from scratch through this focused micro-challenge.
TCP congestion control prevents senders from overwhelming shared links. The congestion window (cwnd) starts at 1 MSS and doubles each RTT during slow start. For example: RTT 0 sends 1 segment, RTT 1 sends 2, RTT 2 sends 4, RTT 3 sends 8.
Once cwnd reaches ssthresh, growth switches to linear (+1 MSS per RTT) in congestion avoidance.
Additive Increase, Multiplicative Decrease:
cwnd on loss (cwnd = cwnd / 2)Three duplicate ACKs trigger fast recovery (Reno): set ssthresh = cwnd / 2, retransmit, then resume. A full timeout is worse: reset cwnd to 1 MSS and restart slow start.
The sender's real limit is min(cwnd, rwnd) where rwnd is the receiver's advertised window. Linux defaulted to Reno until CUBIC replaced it; Google's BBR uses a model-based approach for high-bandwidth-delay links.
This task asks you to simulate congestion control with printed cwnd changes. Every video call and file download rides on one of these algorithms deciding, packet by packet, how hard to push the network. Reno was the Linux default until CUBIC replaced it in 2006; Google's BBR takes a model-based approach for high-bandwidth-delay paths where AIMD's sawtooth pattern wastes capacity.
Implement a simulation of TCP congestion control.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github