Flow control protects the receiver. But what protects the network itself? If millions of machines start blasting packets at their maximum bandwidth, the routers between them will run out of buffer space, dropping packets en masse. This causes machines to retransmit, which creates more traffic, leading to total "Congestion Collapse."
To prevent this, TCP uses a Congestion Window (cwnd). A sender can only send the minimum of the receiver's window (rwnd) and the congestion window (cwnd).
Because the sender doesn't know the capacity of the network, it has to probe for it. It starts with a very small cwnd (historically 1 packet, today usually 10) in a phase called Slow Start. For every ACK it receives, it increases cwnd by 1 packet, effectively doubling the window every round-trip. It's exponential growth.
Once it hits a threshold or experiences packet loss, it shifts to Congestion Avoidance. Here, it uses AIMD (Additive Increase, Multiplicative Decrease): it grows cwnd by just 1 packet per round-trip (additive increase), but if a packet drops, it halves the cwnd instantly (multiplicative decrease).
Click "Progress Round Trip" to watch cwnd grow. It begins in Slow Start (exponential) and then switches to Congestion Avoidance (linear) after passing the threshold. Click "Simulate Packet Loss" to trigger the multiplicative decrease.
If you keep advancing time and dropping packets, you'll see a distinct pattern: a slow climb followed by a sharp drop. This pattern is famously known as the TCP Sawtooth. It means your TCP connection is constantly probing the network, pushing just a little bit harder until the network breaks, backing off, and then pushing again.