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 , 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 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 :
- Slow start (): cwnd starts at segment and grows by segment for every acknowledgement received, which doubles it every round: (exponential growth despite the name). In the round-based model it stops at ssthresh: .
- Congestion avoidance (): cwnd grows by segment per round ( per acknowledgement): additive increase.
Reaction to loss (the model of this site):
| event | TCP Tahoe | TCP Reno |
|---|---|---|
| timeout | , , slow start | same |
| three duplicate ACKs | same as timeout (after fast retransmit of the lost segment) | , (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| threshold | round in which cwnd = ssthresh | segments sent before that round | number of doublings | 2^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.
Starting from , the window doubles every round; it reaches a threshold in round , after doublings, having sent segments in the earlier rounds. For example with ssthresh the windows are in rounds to ( segments in total up to and including round , before it), and then (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 cwnd | Tahoe ssthresh | Reno cwnd | Reno ssthresh | event 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.
Initial ssthresh . Slow start for rounds to (cwnd ), then congestion avoidance (). At the end of round , when the window is , three duplicate acknowledgements arrive. Tahoe: ssthresh , cwnd and slow start again (, then and ). Reno: ssthresh and cwnd at once, then additive increase (). At the end of round a timeout occurs: both restart from cwnd ; Tahoe has cwnd so ssthresh , Reno has so ssthresh .
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| cycle | window range | rounds per cycle | segments per cycle | average window | 3W/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.
If the peak window at which loss occurs is segments, the window falls to and rises by per round: a cycle lasts rounds, the window rises from to and its average is . Hence the average throughput is
One cycle sends about segments and ends with one loss, so the loss probability per segment is , i.e. , and
(A simulation with random losses gave a constant of about ; 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
EasyInitial cwnd , ssthresh , no loss. cwnd per round: , then . Round has cwnd ssthresh. Segments sent in rounds to : .
EX 2A timeout
Mediumssthresh , loss by timeout at the end of the round with cwnd . New ssthresh , cwnd . The following rounds: (slow start up to and then additive increase).
EX 3Duplicate acknowledgements, Tahoe and Reno
Mediumcwnd when three duplicate ACKs arrive, then no further loss. Both versions have ssthresh . Tahoe restarts at cwnd : the windows of the next five rounds are . Reno continues at cwnd : . Reno is ahead by the whole slow start phase.
EX 4Typical questions
GATE level(a) "What is the window after the sender's timeout?" MSS. (b) "After a timeout with cwnd what is ssthresh?" . (c) "The window is segments and all are acknowledged; in slow start what is it next?" (bounded by ssthresh). (d) "In congestion avoidance cwnd : next?" . (e) "Average window of a sawtooth with peak ?" (). (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: per round.
- Timeout: ssthresh , cwnd (Tahoe and Reno).
- Three duplicate ACKs: Tahoe as timeout; Reno ssthresh , cwnd .
- AIMD sawtooth: average ; throughput .
- Effective window .
Traps and GATE patterns
Connections
Builds on
Across subjects
No cross-subject links yet.
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 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
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
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
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 ___________.
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
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
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.
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 __________.
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
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
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 . What are the windows of the first rounds with no loss?
Show answerHide
.
Question 2
The window is when a timeout occurs. What are ssthresh and the next four windows?
Show answerHide
ssthresh ; windows (the next is ).
Question 3
Why does Reno halve the window and not restart at after three duplicate ACKs?
Show answerHide
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 per round (AIMD).
- Loss: ssthresh ; timeout cwnd ; Reno on duplicate ACKs cwnd .
- Sawtooth average ; throughput .
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
My notes (saved in this browser)