TCP Congestion Control Simulator: Slow Start, AIMD, Tahoe and Reno

When senders push more traffic than a bottleneck link can carry, the router's buffer fills and drops packets. TCP reacts by shrinking its congestion window: slow start doubles it every round trip, congestion avoidance adds one segment per round trip, and a loss cuts it.

About this simulator

When senders push more data than a bottleneck link can carry, router buffers overflow and packets are dropped. TCP reacts by changing its congestion window cwnd: it doubles every round trip in slow start, grows by one in congestion avoidance and shrinks after a loss. Change the link capacity and buffer to see the famous sawtooth.

How it works

  1. Slow start: cwnd\text{cwnd} doubles each RTT until it reaches ssthresh\text{ssthresh}. Congestion avoidance: cwnd\text{cwnd} grows by 1 per RTT.
  2. The link carries C packets per RTT and the buffer holds B more. Sending more than C+BC + B packets in one round drops packets.
  3. Tahoe restarts from cwnd=1\text{cwnd} = 1 after a loss; Reno halves cwnd\text{cwnd} (fast recovery). Both set ssthresh=cwnd/2\text{ssthresh} = \text{cwnd}/2.

Formulas used

  • Loss when cwnd>C+B\text{cwnd} > C + B
  • ssthresh=⌊cwnd/2⌋\text{ssthresh} = \lfloor \text{cwnd} / 2 \rfloor after a loss
  • Tahoe: cwnd=1\text{cwnd} = 1 Reno: cwnd=ssthresh\text{cwnd} = \text{ssthresh}
  • Utilization=min⁡(cwnd,C)C\text{Utilization} = \dfrac{\min(\text{cwnd}, C)}{C}

Worked example

With link capacity C=20C = 20 and buffer B=10B = 10 packets per RTT and ssthresh=16\text{ssthresh} = 16, cwnd\text{cwnd} grows 1,2,4,8,161, 2, 4, 8, 16 (slow start) and then 17,18,…,3117, 18, \ldots, 31 (congestion avoidance). At cwnd=31\text{cwnd} = 31 more than C+B=30C + B = 30 packets are sent, so one is dropped in RTT 20. ssthresh\text{ssthresh} becomes ⌊31/2⌋=15\lfloor 31 / 2 \rfloor = 15; Tahoe restarts at cwnd=1\text{cwnd} = 1, Reno continues from 15.

Enter these numbers in the simulator above to see every step.

When to use it

  • Understanding slow start, congestion avoidance and fast recovery for networks exams.
  • Comparing TCP Tahoe and TCP Reno.
  • Seeing how buffer size changes loss and utilisation.

Frequently asked questions

What is the difference between TCP Tahoe and Reno?

After a loss Tahoe sets cwnd to 1 and restarts slow start. Reno halves cwnd (fast recovery) and continues in congestion avoidance, so it recovers faster.

What is ssthresh?

The slow-start threshold: below it cwnd doubles every RTT; above it cwnd grows by 1 per RTT. After a loss it is set to half of the window at the time of loss.

Why does TCP's congestion window look like a sawtooth?

It grows slowly until a loss, drops sharply, then grows again — the additive-increase, multiplicative-decrease (AIMD) pattern.