G27
Self-checkedTier 1 7 min readcn.tcp-congestion-control

TCP congestion control

How TCP avoids overloading the network: the congestion window cwnd, slow start (doubling per round trip up to ssthresh), congestion avoidance (additive increase of one segment per round trip), the reaction to loss - timeout (ssthresh = cwnd/2, cwnd = 1) and three duplicate acknowledgements (Tahoe restarts in slow start, Reno uses fast retransmit and fast recovery) - the AIMD sawtooth with average window 3W/4 and the throughput 1.22 MSS / (RTT sqrt(p)); the per-round tables come from a round-based model checked against a per-ACK model and the rules checked on random event sequences.

Why it exists

If all senders transmit as fast as their receivers allow, the routers' queues overflow, packets are lost, and the retransmissions make it worse (congestion collapse). IP gives no feedback, so TCP senders themselves must slow down when they sense congestion and speed up again when the network seems free. The mechanism is the congestion window cwnd\text{cwnd}, a limit on the outstanding data computed by the sender (flow control, the receiver's limit, is on the previous page).

Prerequisites

You need TCP's window mechanism (TCP flow control) and cumulative acknowledgements (TCP basics).

Precise definitions

The sender may have at most min⁡(cwnd,rwnd)\min(\text{cwnd}, \text{rwnd}) bytes outstanding. Measure cwnd in segments (units of MSS). In one round (one round-trip time) the sender sends cwnd segments and receives their acknowledgements. The sender infers loss from the absence of acknowledgements:

  • a timeout (no acknowledgement for a segment within the timer): serious, probably many segments lost;
  • three duplicate acknowledgements (four identical acknowledgements): one segment was lost but later segments are arriving, so the network still delivers.

The algorithm has two phases, separated by the slow start threshold ssthresh\text{ssthresh}:

  1. Slow start (cwnd<ssthresh\text{cwnd} < \text{ssthresh}): cwnd starts at 11 segment and grows by 11 segment for every acknowledgement received, which doubles it every round: 1,2,4,8,…1, 2, 4, 8, \dots (exponential growth despite the name). In the round-based model it stops at ssthresh: cwnd←min⁡(2 cwnd,ssthresh)\text{cwnd} \leftarrow \min(2\,\text{cwnd}, \text{ssthresh}).
  2. Congestion avoidance (cwnd≥ssthresh\text{cwnd} \ge \text{ssthresh}): cwnd grows by 11 segment per round (1/cwnd1/\text{cwnd} per acknowledgement): additive increase.

Reaction to loss (the model of this site):

eventTCP TahoeTCP Reno
timeoutssthresh=max⁡(⌊cwnd/2⌋,2)\text{ssthresh} = \max(\lfloor\text{cwnd}/2\rfloor, 2), cwnd=1\text{cwnd} = 1, slow startsame
three duplicate ACKssame as timeout (after fast retransmit of the lost segment)ssthresh=max⁡(⌊cwnd/2⌋,2)\text{ssthresh} = \max(\lfloor\text{cwnd}/2\rfloor, 2), cwnd=ssthresh\text{cwnd} = \text{ssthresh} (fast recovery), congestion avoidance

Since the window is halved at a loss and grows by one per round otherwise, the behaviour is AIMD (additive increase, multiplicative decrease); the window plotted against time is a sawtooth.

How it works

Slow start and the threshold

Slow start: rounds to reach the threshold: start

Computed by a script, not typed
thresholdround in which cwnd = ssthreshsegments sent before that roundnumber of doublings2^k - 1
ssthresh 4
ssthresh 8
ssthresh 16
ssthresh 32
ssthresh 64

Step 0

cwnd = 2^(r-1) in round r while below the threshold.

0 / 5
computed by script: protocols are simulated slot by slot or round by round, sequence numbers use 32-bit arithmetic. python3 scripts/gen-cn4-traces.py

Starting from 11, the window doubles every round; it reaches a threshold 2k2^k in round k+1k + 1, after kk doublings, having sent 2k−12^k - 1 segments in the earlier rounds. For example with ssthresh =16= 16 the windows are 1,2,4,8,161, 2, 4, 8, 16 in rounds 11 to 55 (3131 segments in total up to and including round 55, 1515 before it), and then 17,18,…17, 18, \dots (one more each round).

Tahoe and Reno side by side

TCP Tahoe and Reno: window per round: start

Computed by a script, not typed
round (one RTT)Tahoe cwndTahoe ssthreshReno cwndReno ssthreshevent at the end of the round
round 1
round 2
round 3
round 4
round 5
round 6
round 7
round 8
round 9
round 10
round 11
round 12
round 13
round 14
round 15
round 16
round 17
round 18
round 19
round 20
round 21
round 22

Step 0

Initial ssthresh = 16 segments, cwnd = 1. Three duplicate ACKs at the end of round 9, a timeout at the end of round 15. Round model: slow start doubles cwnd up to ssthresh, congestion avoidance adds 1 per round.

0 / 22
computed by script: protocols are simulated slot by slot or round by round, sequence numbers use 32-bit arithmetic. python3 scripts/gen-cn4-traces.py

Initial ssthresh 1616. Slow start for rounds 11 to 55 (cwnd 1→161 \to 16), then congestion avoidance (17,18,19,2017, 18, 19, 20). At the end of round 99, when the window is 2020, three duplicate acknowledgements arrive. Tahoe: ssthresh =10= 10, cwnd =1= 1 and slow start again (1,2,4,81, 2, 4, 8, then 1010 and 1111). Reno: ssthresh =10= 10 and cwnd =10= 10 at once, then additive increase (11,12,13,…11, 12, 13, \dots). At the end of round 1515 a timeout occurs: both restart from cwnd =1= 1; Tahoe has cwnd 1111 so ssthresh =5= 5, Reno has 1515 so ssthresh =7= 7.

Reno is better after duplicate acknowledgements because the network is still delivering packets (the duplicates themselves prove it), so there is no reason to fall back to one segment.

The sawtooth and the average rate

The AIMD sawtooth: start

Computed by a script, not typed
cyclewindow rangerounds per cyclesegments per cycleaverage window3W/4
peak window 20
peak window 40
peak window 100

Step 0

Additive increase of 1 per round, multiplicative decrease by half at each loss. Average throughput = (3/4) W MSS / RTT.

0 / 3
computed by script: protocols are simulated slot by slot or round by round, sequence numbers use 32-bit arithmetic. python3 scripts/gen-cn4-traces.py

If the peak window at which loss occurs is WW segments, the window falls to W/2W/2 and rises by 11 per round: a cycle lasts W/2W/2 rounds, the window rises from W/2W/2 to WW and its average is 3W/43W/4. Hence the average throughput is

34 W⋅MSSRTT.\frac{3}{4}\,\frac{W \cdot \text{MSS}}{\text{RTT}} .

One cycle sends about 3W28\frac{3W^2}{8} segments and ends with one loss, so the loss probability per segment is p≈83W2p \approx \frac{8}{3W^2}, i.e. W=8/(3p)W = \sqrt{8/(3p)}, and

throughput≈3483p  MSSRTT=1.22 MSSRTTp.\text{throughput} \approx \frac{3}{4}\sqrt{\frac{8}{3p}}\;\frac{\text{MSS}}{\text{RTT}} = \frac{1.22\,\text{MSS}}{\text{RTT}\sqrt{p}} .

(A simulation with random losses gave a constant of about 1.281.28; the formula is approximate.) The throughput falls with the round-trip time and with the square root of the loss rate. TCP is fair in the sense that connections with equal RTT sharing a bottleneck converge to equal shares (quoted textbook argument).

Worked examples

EX 1Slow start rounds

Easy

Initial cwnd 11, ssthresh 3232, no loss. cwnd per round: 1,2,4,8,16,321, 2, 4, 8, 16, 32, then 33,34,35,…33, 34, 35, \dots. Round 66 has cwnd 32=32 = ssthresh. Segments sent in rounds 11 to 55: 3131.

EX 2A timeout

Medium

ssthresh =16= 16, loss by timeout at the end of the round with cwnd =24= 24. New ssthresh =12= 12, cwnd =1= 1. The following rounds: 1,2,4,8,12,13,14,…1, 2, 4, 8, 12, 13, 14, \dots (slow start up to 1212 and then additive increase).

EX 3Duplicate acknowledgements, Tahoe and Reno

Medium

cwnd =20= 20 when three duplicate ACKs arrive, then no further loss. Both versions have ssthresh =10= 10. Tahoe restarts at cwnd =1= 1: the windows of the next five rounds are 1,2,4,8,101, 2, 4, 8, 10. Reno continues at cwnd =10= 10: 10,11,12,13,1410, 11, 12, 13, 14. Reno is ahead by the whole slow start phase.

EX 4Typical questions

GATE level

(a) "What is the window after the sender's timeout?" 11 MSS. (b) "After a timeout with cwnd =40= 40 what is ssthresh?" 2020. (c) "The window is 88 segments and all are acknowledged; in slow start what is it next?" 1616 (bounded by ssthresh). (d) "In congestion avoidance cwnd =12= 12: next?" 1313. (e) "Average window of a sawtooth with peak 4040?" 3030 (3W/43W/4). (f) "Which version does fast recovery?" Reno. (g) "What triggers fast retransmit?" Three duplicate ACKs.

Cheat box

Cheat box

  • Slow start: cwnd doubles per round until ssthresh; then congestion avoidance: +1+1 per round.
  • Timeout: ssthresh =cwnd/2= \text{cwnd}/2, cwnd =1= 1 (Tahoe and Reno).
  • Three duplicate ACKs: Tahoe as timeout; Reno ssthresh =cwnd/2= \text{cwnd}/2, cwnd =ssthresh= \text{ssthresh}.
  • AIMD sawtooth: average 3W/43W/4; throughput ≈1.22 MSS/(RTTp)\approx 1.22\,\text{MSS}/(\text{RTT}\sqrt{p}).
  • Effective window =min⁡(cwnd,rwnd)= \min(\text{cwnd}, \text{rwnd}).

Traps and GATE patterns

Connections

The window is the sliding window of sliding window protocols; the receiver's limit is flow control; the connection and acknowledgement numbers are from TCP basics. The bound throughput ≤\le window / RTT of performance metrics applies to the congestion window as well.

PYQs

10 previous year questions from your book. I re-solved each one myself (8 by running or simulating, 2 by reasoning only); the book's key is shown next to my answer. All PYQs

GATE 2026 · MCQQ3 · page 547 of the book
A TCP sender successfully establishes a connection
with a TCP receiver and starts the transmission of
segments.
The
TCP
congestion
control
mechanism's slow-start threshold is set to 10000
segments. Assume that the round-trip time is fixed
at 1 millisecond. Assume that the sender always has
data to send, the segments are numbered from 1,
and no segment is lost.

Let t denote the time (in milliseconds) at which the
transmission of segment number 2000 starts.

Which one of the following options is correct?
  • (a)9 ≤ t < 10
  • (b)10 ≤ t < 11
  • (c)11 ≤ t < 12
  • (d)12 ≤ t < 13
GATE 2026 · NATQ6 · page 547 of the book
Consider a new TCP connection between a sender
and a receiver. The receiver advertised window is
constant at 48 KB, the maximum segment size (MSS)
is 2 KB, and the slow start threshold (ssthresh) is 16
KB.

Assume there are no timeouts or duplicate
acknowledgements. The number of rounds of
transmission required for the congestion control

COMPUTER NETWORK
algorithm to reach the congestion avoidance phase
is ______.

Note: 1K = 210
GATE 2024 · NATQ16 · page 549 of the book
Consider a TCP connection operating at a point of
time with the congestion window of size 12 MSS
(Maximum Segment Size), when a timeout occurs
due to packet loss. Assuming that all the segments
transmitted in the next two RTTs (Round Trip Time)
are acknowledged correctly, the congestion window
size (in MSS) during the third RTT will be
___________.
GATE 2020 · NAT · 2 marksQ37 · page 553 of the book
Consider a TCP connection between a client and a
server with the following specifications: the round
trip time is 6 ms, the size of the receiver advertised
window is 50 KB, slow-start threshold at the client is
32 KB, and the maximum segment size is 2 KB. The
connection is established at time t = 0. Assume that
there are no timeouts and errors during transmission.
Then the size of the congestion window (in KB) at
time t + 60 ms after all acknowledgments are
processed is __________.

COMPUTER NETWORK
GATE 2018 · MCQ · 1 markQ45 · page 555 of the book
Consider the following statements regarding the
slow start phase of the TCP congestion control
algorithm. Note the cwnd stands for the TCP
congestion window and MSS denotes the
Maximum Segment Size.

(i) The cwnd increases by 2 MSS on every
successful acknowledgment.
(ii) The cwnd approximately doubles on every
successful acknowledgment.
(iii) The cwnd increases by 1 MSS every round
trip time.
(iv) The cwnd approximately doubles every round
trip time.

Which one of the following is correct?
  • (a)Only (ii) and (iii) are true
  • (b)Only (i) and (iii) are true
  • (c)Only (iv) is true
  • (d)Only (i) and (iv) are true
GATE 2016 · NATQ50 · page 555 of the book
For a host machine that uses the token bucket
algorithm for congestion control, the token bucket has
a capacity of 1 megabyte and the maximum output
rate is 20 megabytes per second. Tokens arrive at a
rate to sustain output at a rate of 10 megabytes per
second. The token bucket is currently full and the
machine needs to send 12 megabytes of data. The

COMPUTER NETWORK
minimum time required to transmit the data is
______ seconds.
GATE 2014 · NATQ70 · page 559 of the book
Let the size of the congestion window of a TCP
connection be 32 KB when a timeout occurs. The
round trip time of the connection is 100 msec and
the maximum segment size used is 2 KB. The time
taken (in msec) by the TCP connection to get back
to 32 KB congestion window is __________.
GATE 2012 · MCQ · 1 markQ72 · page 559 of the book
Consider an instance of TCP's Additive Increase
Multiplicative Decrease (AIMD) algorithm where
the windows size at the start of the slow start phase
is 2 MSS and the threshold at the start of the first
transmission is 8 MSS. Assume that a time-out
occurs during the fifth transmission. Find the
congestion window size at the end of the tenth
transmission.
  • (a)8 MSS
  • (b)14 MSS
  • (c)7 MSS
  • (d)12 MSS
GATE 2008 · MCQ · 2 marksQ82 · page 561 of the book
In the slow start phase of the TCP congestion control
algorithm, the size of the congestion window
  • (a)does not increase
  • (b)increases linearly
  • (c)increases quadratically
  • (d)increases exponentially
GATE 2008 · MCQ · 2 marksQ84 · page 561 of the book
A computer on a 10 Mbps network is regulated by a
token bucket. The token bucket is filled at a rate of 2
Mbps. It is initially filled to capacity with 16
Megabits. What is the maximum duration for which
the computer can transmit at the full 10 Mbps?
  • (a)1.6 seconds
  • (b)2 seconds
  • (c)5 seconds
  • (d)8 seconds COMPUTER NETWORK

Self-check

Question 1

Initial ssthresh =8= 8. What are the windows of the first 88 rounds with no loss?

Show answer

1,2,4,8,9,10,11,121, 2, 4, 8, 9, 10, 11, 12.

Question 2

The window is 1818 when a timeout occurs. What are ssthresh and the next four windows?

Show answer

ssthresh =9= 9; windows 1,2,4,81, 2, 4, 8 (the next is 99).

Question 3

Why does Reno halve the window and not restart at 11 after three duplicate ACKs?

Show answer

The duplicate ACKs show that later segments are still being delivered, so congestion is mild; a timeout, which means that nothing is getting through, calls for the drastic reaction.

Revision card

One-screen revision

  • Slow start doubles to ssthresh; then +1+1 per round (AIMD).
  • Loss: ssthresh =cwnd/2= \text{cwnd}/2; timeout cwnd =1= 1; Reno on duplicate ACKs cwnd =ssthresh= \text{ssthresh}.
  • Sawtooth average 3W/43W/4; throughput ≈1.22 MSS/(RTTp)\approx 1.22\,\text{MSS}/(\text{RTT}\sqrt{p}).

References

  • ·Kurose, Ross, Computer Networking: A Top-Down Approach (8th edition), Chapter 3, Sections 3.6 and 3.7 (Principles of congestion control, TCP congestion control)
  • ·Tanenbaum, Wetherall, Computer Networks (5th edition), Chapter 6, Section 6.5.10 (TCP congestion control)
  • ·Forouzan, Data Communications and Networking (5th edition), Chapter 24, Section 24.5 (Congestion control)

Verification

scripts/enum-checks/cn_tcp_check.py: (1) the round-based model of scripts/cn_tcp.py (congestion_rounds) follows the stated rules exactly on 2000 random event sequences for Tahoe and Reno (slow start cwnd -> min(2 cwnd, ssthresh); congestion avoidance +1; timeout ssthresh = max(cwnd // 2, 2), cwnd = 1; three duplicate ACKs: Tahoe like a timeout, Reno ssthresh = cwnd // 2 and cwnd = ssthresh); cwnd never falls below 1; (2) for ssthresh = 4, 8, 16, 32, 64 the round model agrees (within 1 segment, within 3 later on) with an independent per-ACK model (cwnd + 1 per ACK in slow start, + 1/cwnd per ACK in congestion avoidance), and cwnd reaches ssthresh in round log2(ssthresh) + 1; (3) the average of a sawtooth from W/2 to W is 3W/4; (4) an idealised AIMD simulation with a random loss per segment (halve on loss, add one per round, loss probability p in 0.0005 to 0.005) gave an average window times sqrt(p) of 1.28 to 1.30, close to the idealised value 1.22 = sqrt(3/2) derived on the page: the 1.22 formula is APPROXIMATE. CONVENTIONS: this is the 'textbook round' model used in exams: the window is counted in segments per round trip and slow start stops exactly at ssthresh (the window never exceeds ssthresh in slow start); real implementations increase per ACK, may overshoot, use ssthresh = max(FlightSize / 2, 2 MSS) and, in Reno, inflate the window by three segments during fast recovery. Some books let cwnd continue to double in the round in which it crosses ssthresh, or start congestion avoidance at cwnd = ssthresh in the next round: exam questions state or imply the convention - read the question. QUOTED, not verified here: the existence and names of Tahoe, Reno, NewReno and CUBIC, the details of fast retransmit (retransmit after three duplicate ACKs without waiting for the timeout), the initial window sizes (1 MSS in the textbook model; larger in modern TCP), and that a timeout is treated as more serious than duplicate ACKs. Textbook chapter references are from memory. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (CRC remainders, binomial tail, checksums); long C programs were not re-read line by line (they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose). No defect found. Status raised to self-checked; verified needs a textbook or human check.

last verified: never