TCP guesses the link's capacity with a congestion window: ramp up fast, probe gently, and halve on loss — the AIMD sawtooth.
Nothing ever tells TCP how fast the network actually is — capacity changes constantly as other traffic comes and goes. So TCP *guesses*, and corrects. It keeps a congestion window (`cwnd`): the amount of unacknowledged data it's willing to have in flight. Send too little and the link sits idle; send too much and routers' queues overflow and drop packets. Congestion control is the feedback loop that hunts for the sweet spot.
cwnd doubles every round trip (exponential), quickly filling an empty pipe.cwnd reaches `ssthresh` (the slow-start threshold), TCP switches to congestion avoidance: cwnd grows by just one per round trip (linear), probing gently near the suspected limit.cwnd sharply — classically halving it — and sets ssthresh to the new lower value before climbing again.The steady-state behavior is AIMD: *Additive Increase, Multiplicative Decrease*. Add a little when things are fine (+1 per RTT), but multiply down hard the instant a packet is lost (×½). Plotting cwnd over time draws a sawtooth: a gentle linear climb, a sudden drop, climb again — hovering right around the link's true capacity.