Skip to content

Congestion Control in TCP

Congestion control ensures the sender doesn't overwhelm the network (routers, links) — unlike flow control which protects the receiver.

The Problem

Many Senders ---- too much data ----> Router
                (buffer overflow → packets dropped → network collapse)

Congestion Window (cwnd)

  • Sender-side limit on unacknowledged data in flight.
  • Sender controlled (unlike rwnd which is receiver controlled).
  • Not advertised — sender calculates it internally.

How TCP Detects Congestion

SignalMeaningSeverity
Packet loss (timeout)Severe congestionHigh
3 Duplicate ACKsMild congestionLow
  • Timeout — no ACK received in time → severe
  • 3 Dup ACKs — receiver got out-of-order packet, keeps ACKing last good one → mild

TCP Congestion Control Algorithms

1. Slow Start

  • Begins when connection starts or after timeout.
  • cwnd starts at 1 MSS (Maximum Segment Size).
  • Doubles every RTT (exponential growth).
  • Continues until ssthresh (slow start threshold) is reached.
  • Despite the name, slow start is actually fast (exponential). "Slow" refers to starting from 1 MSS instead of full speed.

2. Congestion Avoidance

  • After reaching ssthresh.
  • cwnd grows linearly — increases by 1 MSS per RTT.
  • Probes network carefully for available bandwidth.

3. Fast Retransmit

  • On receiving 3 duplicate ACKs.
  • Sender immediately retransmits lost packet.
  • Doesn't wait for timeout (timeout is slow).

4. Fast Recovery

  • After Fast Retransmit (3 dup ACKs).
  • Does NOT go back to Slow Start.
  • Instead: ssthresh = cwnd / 2 ; cwnd = ssthresh + 3 ; continue with Congestion Avoidance.

Slow Start Example

RTT 1: cwnd = 1 MSS
RTT 2: cwnd = 2 MSS
RTT 3: cwnd = 4 MSS
RTT 4: cwnd = 8 MSS  ← hits ssthresh → switch to Congestion Avoidance

Congestion Avoidance Example

RTT 1: cwnd = 8 MSS
RTT 2: cwnd = 9 MSS
RTT 3: cwnd = 10 MSS
RTT 4: cwnd = 11 MSS  ← congestion detected!

Fast Retransmit Example

Sender receives: ACK5, ACK5, ACK5 (3 dup ACKs)
→ Immediately resend packet 6 without waiting for timeout

TCP Tahoe vs TCP Reno

EventTCP TahoeTCP Reno
Timeoutcwnd=1, go to Slow Startcwnd=1, go to Slow Start
3 Dup ACKscwnd=1, go to Slow StartFast Recovery (cwnd = ssthresh+3)
  • Tahoe — treats all loss the same (harsh)
  • Reno — distinguishes between mild and severe congestion (smarter)
  • Modern TCP uses Reno or newer (CUBIC, BBR)

cwnd over Time (Conceptual Sawtooth)

cwnd
 |            /
 |           /   Congestion
 |          /    Avoidance
 |         /   /
 |        /  --/----x  (3 dup ACKs)
 |       /  /      \
 |      /  / ssthresh \----/
 |     /  /             \
 |    /SS/                \  SS again (timeout)
 |---------------------------------------→ time

SS = Slow Start (exponential)
/  = Congestion Avoidance (linear)
x  = congestion detected

AIMD (Additive Increase Multiplicative Decrease)

  • Additive Increase — grow cwnd by 1 MSS per RTT (slow, careful).
  • Multiplicative Decrease — cut cwnd by half on congestion (aggressive reduction).
  • This creates the sawtooth pattern typical of TCP throughput.
No congestion → cwnd + 1 MSS (per RTT)
Congestion    → cwnd / 2

Modern Congestion Control

AlgorithmUsed ByApproach
CUBICLinux defaultCubic function for window growth
BBRGoogleMeasures bandwidth & RTT directly
QUICHTTP/3UDP-based, own congestion control

Congestion Control vs Flow Control (Summary)

Congestion ControlFlow Control
ProtectsNetworkReceiver
Windowcwnd (sender)rwnd (receiver)
Controlled bySenderReceiver
SignalPacket loss / dup ACKsrwnd in ACK
AlgorithmSlow start, AIMDSliding window