Skip to content
We areTOP 1%

Explain TCP congestion control: slow start, congestion avoidance, fast retransmit and fast recovery.

HardConceptFlow & Congestion Control
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

TCP congestion control lets each sender discover how much the network can carry by increasing its rate until loss occurs, then backing off. The sender keeps a congestion window (cwnd, counted here in segments) and a threshold, ssthresh, where cautious growth begins.

  • Slow start: cwnd starts small (1 segment in textbooks, about 10 in modern systems) and grows by one segment per ACK, which doubles it every RTT until it reaches ssthresh.
  • Congestion avoidance: above ssthresh, cwnd grows by only about one segment per RTT, a linear (additive) increase.
  • Fast retransmit: three duplicate ACKs signal that one segment was lost but later ones arrived, so the sender resends it without waiting for a timeout.
  • Fast recovery (TCP Reno): ssthresh = cwnd / 2 and cwnd continues from that halved value, not from 1. A timeout is treated as more serious: ssthresh = cwnd / 2, cwnd = 1, and slow start begins again.

Example: ssthresh = 16, starting from cwnd = 1:

RTT:   1  2  3  4   5   6   7   8 | 3 dup ACKs | 9  10
cwnd:  1  2  4  8  16  17  18  19 | ssthresh=9 | 9  10

Growth is exponential up to 16, then linear. At cwnd = 19, three duplicate ACKs set ssthresh = 9 (19 ÷ 2, rounded down), and linear growth resumes from 9.

More in Flow & Congestion Control

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account