CS Atlas GATE 2027
Computer Networks course
0 / 90 complete

Computer Networks/Phase 4 · Transport Layer (TCP)

Lesson 4.3.5 · Item 71 of 90

TCP congestion control: cwnd, Slow Start, AIMD, Tahoe vs Reno

Read at your own pace. Try the questions before opening the answers.

On this page

Recall warm-up

  1. What is the difference between flow control and congestion control?
    Stuck? Peek at 4.3.4 TCP timeout estimation: EWMA, Jacobson’s algorithm & Karn’s rule
    • EWMA: Est_new = (1 − α)·Est_old + α·Sample = Est_old + (Sample − Est_old)·α (default α = 1/8).
    • Deviation & RTO: Dev_new = (1 − β)·Dev_old + β·|Sample − Est| (default β = 1/4); RTO = Est + 4·Dev.
    • Karn's rule: ignore RTT samples from retransmitted segments; double RTO on each timeout.

    Read lesson 4.3.4

  2. If a sender knows both the receiver’s advertised window rwnd and its own congestion window cwnd, how much unacknowledged data can it have in flight?
    Stuck? Peek at 4.3.3 TCP flow control (rwnd), sequence wrap-around time & window scaling
    • Flow control: rwnd = RcvBuffer − (LastByteRcvd − LastByteRead); sender keeps BytesInFlight ≤ rwnd.
    • Zero window (`rwnd = 0`): sender runs Persist Timer and sends 1-byte Zero-Window Probes.
    • Wrap-around time: T_wrap = (2³² × 8) / B seconds (34.36 s at 1 Gbps).
    • Window scaling: True rwnd = HeaderWindow × 2ˢ (S ≤ 14, negotiated in SYN).

    Read lesson 4.3.3

  3. Which is a milder sign of network congestion: a Retransmission Timeout (RTO) or receiving 3 Duplicate ACKs?
    Stuck? Peek at 1.2.2 Packet switching: store-and-forward, datagrams, statistical multiplexing
    • Packet switching: packets with headers; no reservation; full link rate while sending.
    • Store-and-forward: receive whole packet → buffer/queue → forward; full buffer → loss.
    • Datagram: each packet routed independently; may reorder; robust to failures.
    • Statistical multiplexing: share capacity on demand; P(exactly k of n) = C(n,k)pᵏ(1−p)ⁿ⁻ᵏ.

    Read lesson 1.2.2

The Hook

Suppose the receiver has a huge 10 MB buffer (rwnd = 10 MB), so flow control says "send at full blast!" If 1,000 senders immediately dump 10 MB into a bottleneck router with a 64 KB queue, almost every packet is dropped, everyone times out and retransmits, and throughput collapses to near zero (congestion collapse).

How does a TCP sender probe the network's unknown capacity without any router telling it the link rate? By maintaining a Congestion Window (cwnd) and running a brilliant state machine: Slow Start, Congestion Avoidance (AIMD), and Fast Retransmit / Fast Recovery (Tahoe vs Reno)!

Predict First

Why is TCP's initial phase called "Slow Start" when it actually doubles cwnd every RTT (exponential growth: 1 → 2 → 4 → 8 → 16 MSS)?

,

Because before Slow Start was invented by Van Jacobson in 1988, a new TCP connection immediately dumped an entire rwnd worth of segments (e.g., 64 KB = 44 segments) into the network in RTT 1! Starting at 1 MSS was "slow" compared to dumping 44 segments at once — even though it probes upward exponentially!

Core Concept

Effective Window: W = min(cwnd, rwnd)

A TCP sender maintains two window limits simultaneously: the receiver's advertised window rwnd (flow control) and its own Congestion Window cwnd (congestion control), plus a threshold variable called the Slow Start Threshold (ssthresh):

Effective Sending Window & Throughput:
• Effective Window W = min(cwnd, rwnd) (in bytes or MSS).
• Maximum rate at which the sender can inject data = min(Link Rate B, W / RTT).
Flow Control (rwnd)
Advertised by the RECEIVER in TCP header Window field. Protects receiver buffer.
Congestion Control (cwnd)
Computed locally by the SENDER based on ACKs/losses. Protects network routers.
The sender never allows unacknowledged bytes in flight to exceed min(cwnd, rwnd).

Phase 1 & 2: Slow Start (Exponential) vs Congestion Avoidance (AIMD Linear)

A new connection starts with cwnd = 1 MSS and a high initial ssthresh:

  1. Slow Start (when cwnd < ssthresh):
    • Every individual ACK that acknowledges new data increases cwnd by +1 MSS.
    • Therefore, after one full RTT in which all k segments are ACKed, cwnd doubles: cwnd ← min(2 · cwnd, ssthresh)!
  2. Congestion Avoidance (when cwnd ≥ ssthresh):
    • Once cwnd reaches ssthresh, doubling is too aggressive! TCP switches to Additive Increase: each individual ACK increases cwnd by MSS × (MSS / cwnd), so after one full RTT of ACKs, cwnd increases linearly by +1 MSS: cwnd ← cwnd + 1 MSS!
GATE Clamping Convention at ssthresh:
When Slow Start doubling would jump past ssthresh (for example, cwnd = 4 MSS and ssthresh = 6 MSS), GATE clamps the next RTT to cwnd = min(2 · cwnd, ssthresh) = 6 MSS, and then switches to linear +1 MSS per RTT from there!
Start: cwnd = 1 MSS
cwnd < ssthresh?
Slow Start: +1 MSS per ACK (doubles per RTT!)
cwnd reaches ssthresh
clamp at ssthresh
cwnd ≥ ssthresh
Congestion Avoidance: +1 MSS per RTT (linear)
Transition from exponential Slow Start to linear Congestion Avoidance at ssthresh.

Reaction to Loss: Timeout vs 3 Duplicate ACKs (TCP Tahoe vs TCP Reno)

When a segment is lost, TCP detects it in one of two ways: either the Retransmission Timeout (RTO) expires (severe congestion), or 3 Duplicate ACKs arrive before timeout (mild congestion — later segments are still reaching the receiver, triggering Fast Retransmit!). In both cases, TCP first cuts the threshold in half (Multiplicative Decrease):

Step 1 (Always on any loss event):
ssthresh ← max(1, ⌊cwnd / 2⌋) (half of the cwnd at the moment of loss).

Step 2 (How cwnd is reset — Tahoe vs Reno):
• On a Timeout (BOTH Tahoe and Reno): reset cwnd ← 1 MSS and re-enter Slow Start!
• On 3 Duplicate ACKs in TCP Tahoe: treats 3 dup ACKs just like a timeout → resets cwnd ← 1 MSS (Slow Start).
• On 3 Duplicate ACKs in TCP Reno (Fast Recovery): halves the window instead of resetting to 1! Under GATE's textbook convention, sets cwnd ← ssthresh and continues directly in Congestion Avoidance (+1 MSS per RTT)!
GATE Convention — TCP Reno on 3 Duplicate ACKs:
On GATE (and Forouzan / Kurose problem sets), when TCP Reno receives 3 duplicate ACKs at window cwnd, it sets ssthresh = ⌊cwnd / 2⌋ and cwnd = ssthresh (and then adds +1 MSS per subsequent RTT in Congestion Avoidance). Note: RFC 5681 temporarily inflates cwnd = ssthresh + 3 MSS during Fast Recovery and deflates it to ssthresh when the new ACK arrives — producing the exact same post-recovery window cwnd = ssthresh! Always use cwnd = ssthresh = ⌊cwnd / 2⌋ unless a question explicitly mentions temporary window inflation.
RTT #Phase / Event (ssthresh₀ = 8)Reno cwnd (MSS)Reno ssthreshTahoe cwnd (MSS)Tahoe ssthresh
1Slow Start1818
2Slow Start (×2)2828
3Slow Start (×2)4848
4Reaches ssthresh → CA8888
5Congestion Avoidance (+1)9898
6CA (+1) → 3 Dup ACKs!10 (3dup!)8 → 510 (3dup!)8 → 5
7After 3 Dup ACKs5 (Fast Rec / CA)51 (Slow Start!)5
8Next RTT6 (CA +1)52 (SS ×2)5
9Next RTT → Timeout!7 (Timeout!)5 → 34 (Timeout!)5 → 2
10After Timeout (both → 1)1 (Slow Start)31 (Slow Start)2
11Next RTT2 (SS ×2)32 (reaches sst=2)2
Complete RTT-by-RTT trace computed by code, comparing TCP Reno vs TCP Tahoe.

Putting it together

  • A TCP sender caps unacknowledged data in flight at W = min(cwnd, rwnd).
  • Slow Start grows cwnd exponentially (+1 MSS per ACK, doubling per RTT) up to ssthresh; Congestion Avoidance grows cwnd linearly (+1 MSS per RTT).
  • Any loss sets ssthresh = ⌊cwnd/2⌋; a timeout resets cwnd = 1 MSS in both Tahoe and Reno, whereas 3 duplicate ACKs reset cwnd = 1 MSS in Tahoe but cwnd = ssthresh in Reno.

Visual

036912123456789101112489105671212489101241288888855533Transmission Round (RTT)Window Size (MSS)
TCP Reno cwnd (MSS)TCP Tahoe cwnd (MSS)Reno ssthresh (MSS)
Sawtooth curve of TCP Reno vs TCP Tahoe: 3 Dup ACKs at RTT 6 (Reno drops to 5, Tahoe drops to 1) and Timeout at RTT 9 (both drop to 1).

Worked Examples

Easy

A TCP connection has MSS = 1 KB, initial cwnd = 1 KB, and ssthresh = 16 KB. Assuming no losses and large rwnd, list the value of cwnd (in KB) for RTT rounds 1 through 7.

Show the full solution

• Rounds 1–5 (Slow Start, doubling until ssthresh = 16 KB): 1, 2, 4, 8, 16 KB.
• Rounds 6–7 (Congestion Avoidance, +1 MSS = +1 KB per RTT): 17, 18 KB.

Medium

A TCP Reno connection with MSS = 1 KB has cwnd = 1 KB and ssthresh = 6 KB at RTT 1. Trace cwnd for RTTs 1 to 6 assuming no packet loss.

Show the full solution

• RTT 1: 1 KB (< 6, Slow Start)
• RTT 2: 2 KB (< 6, Slow Start)
• RTT 3: 4 KB (< 6, Slow Start)
• RTT 4: doubling 4 KB would give 8 KB > ssthresh, so clamp at min(8, 6) = 6 KB (reaches ssthresh!)
• RTT 5: Congestion Avoidance (+1 KB) → 7 KB
• RTT 6: Congestion Avoidance (+1 KB) → 8 KB.

GATE

A TCP Reno connection with MSS = 2 KB starts at RTT 1 with cwnd = 2 KB (1 MSS) and ssthresh = 16 KB (8 MSS). At the end of RTT 6, the sender receives 3 duplicate ACKs. What are the values of ssthresh and cwnd (in KB) in RTT 7 and RTT 8? What would they be if the sender used TCP Tahoe instead?

Show the full solution

Work in units of MSS first (where 1 MSS = 2 KB, ssthresh₀ = 8 MSS), then multiply by 2 KB at the end!
• RTT 1 to 6: 1 → 2 → 4 → 8 (reaches ssthresh) → 9 → 10 MSS (20 KB) in RTT 6.
• At end of RTT 6 (3 dup ACKs at cwnd = 10 MSS): new ssthresh = ⌊10 / 2⌋ = 5 MSS = 10 KB.
• Under TCP Reno: RTT 7 has cwnd = ssthresh = 5 MSS = 10 KB (CA); RTT 8 has cwnd = 5 + 1 = 6 MSS = 12 KB.
• Under TCP Tahoe: RTT 7 resets cwnd = 1 MSS = 2 KB (SS); RTT 8 doubles to cwnd = 2 MSS = 4 KB.

GATE Traps

  • Adding +1 KB instead of +1 MSS when MSS = 2 KB! Always divide all byte/KB values by MSS at step 0, trace in MSS, and multiply back by MSS at the end!
  • Forgetting to clamp at ssthresh when ssthresh is not a power of 2! If cwnd = 4 MSS and ssthresh = 6 MSS, the next RTT is min(8, 6) = 6 MSS, NOT 8 MSS!
  • Confusing Timeout vs 3 Duplicate ACKs in TCP Reno! On a Timeout, even TCP Reno resets cwnd = 1 MSS! Only on 3 Duplicate ACKs does Reno set cwnd = ssthresh.

Memory Hook

Work in MSS! Slow Start ×2 (clamped at ssthresh), CA +1 MSS; Loss sets ssthresh = cwnd/2; Timeout → 1 MSS, 3-Dup → 1 (Tahoe) or ssthresh (Reno)!

Connect the Dots

Let's lock in everything from Section 4.3 — TCP header, 3-way handshake, sequence/ACK numbering, wrap-around time, EWMA/Jacobson RTO, and Tahoe/Reno congestion control — in Lock-in L4.3!

Self-Test

  1. NAT

    A TCP Reno connection with MSS = 1 KB starts at RTT 1 with cwnd = 1 KB and ssthresh = 8 KB. Assuming no losses, what is cwnd (in KB) during RTT 6?

    Write your answer before opening the key.

  2. NAT

    In the previous question (cwnd = 10 KB during RTT 6, MSS = 1 KB), suppose 3 duplicate ACKs arrive at the end of RTT 6. Under TCP Reno, what is cwnd (in KB) during RTT 8 (assuming no further losses)?

    Write your answer before opening the key.

  3. NAT

    If the connection in the previous question used TCP Tahoe instead of TCP Reno (3 duplicate ACKs at the end of RTT 6 when cwnd = 10 KB, MSS = 1 KB), what would cwnd (in KB) be during RTT 8?

    Write your answer before opening the key.

  4. MCQ

    During Slow Start (cwnd < ssthresh), how much does a TCP sender increase cwnd upon receiving each individual ACK that acknowledges new data?

    1. By 1 MSS per individual ACK (which results in doubling cwnd every RTT).
    2. By 1 MSS per RTT.
    3. By MSS × (MSS / cwnd) per ACK.
    4. It keeps cwnd constant until ssthresh is reached.

Rule Card

  • Effective window: W = min(cwnd, rwnd). Always trace in units of MSS!
  • Slow Start (cwnd < ssthresh): +1 MSS per ACK → cwnd ← min(2·cwnd, ssthresh) per RTT.
  • Congestion Avoidance (cwnd ≥ ssthresh): +1 MSS per RTT (AIMD linear growth).
  • On Loss: ssthresh ← ⌊cwnd / 2⌋; Timeout → cwnd = 1 MSS; 3 Dup ACKs → cwnd = 1 MSS (Tahoe) or cwnd = ssthresh (Reno).

Concept Ledger

  • cwnd (Congestion Window)
  • effective window = min(cwnd, rwnd)
  • ssthresh (Slow Start Threshold)
  • Slow Start (exponential, +1 MSS per ACK)
  • Congestion Avoidance (AIMD, +1 MSS per RTT)
  • Fast Retransmit (3 duplicate ACKs)
  • Fast Recovery (TCP Reno vs TCP Tahoe)

Answer Vault

Try the questions first. Open when you are ready to check.

Warm-up answers

  1. Flow control (rwnd) protects a single receiver’s buffer from overflowing; congestion control (cwnd) protects the intermediate network routers from overflowing.
  2. Effective window W = min(cwnd, rwnd).
  3. 3 Duplicate ACKs! Because later segments are still arriving at the receiver to trigger those duplicate ACKs, whereas a timeout means nothing is getting through.

Self-test answers

  1. 10 — RTT 1..4 (SS): 1, 2, 4, 8 KB. RTT 5 (CA): 9 KB. RTT 6 (CA): 10 KB.
  2. 6 — After 3 dup ACKs at cwnd = 10 KB: ssthresh = 5 KB. In RTT 7, Reno sets cwnd = 5 KB (CA). In RTT 8, cwnd = 5 + 1 = 6 KB.
  3. 2 — Tahoe resets cwnd = 1 KB in RTT 7 (Slow Start, with ssthresh = 5 KB), then doubles to cwnd = 2 KB in RTT 8.
  4. A — In Slow Start, each new ACK increases cwnd by +1 MSS, so if k segments are sent and ACKed in one RTT, cwnd grows from k to 2k MSS.
    • B: Adding +1 MSS per RTT is Congestion Avoidance.
    • C: Adding MSS²/cwnd per ACK is Congestion Avoidance (+1 MSS per RTT).
    • D: cwnd grows exponentially in Slow Start.

Flashcards

  1. How does cwnd grow in Slow Start vs Congestion Avoidance?
    Reveal answerSlow Start (cwnd < ssthresh): +1 MSS per ACK → doubles every RTT (clamped at ssthresh). Congestion Avoidance (cwnd ≥ ssthresh): +1 MSS per RTT (linear).
  2. How do TCP Tahoe and TCP Reno differ when 3 duplicate ACKs arrive at window cwnd?
    Reveal answerBoth set ssthresh = ⌊cwnd / 2⌋. Tahoe resets cwnd = 1 MSS (Slow Start); Reno sets cwnd = ssthresh (Fast Recovery / Congestion Avoidance).
  3. What do TCP Tahoe and TCP Reno do when a Retransmission Timeout (RTO) occurs?
    Reveal answerBoth set ssthresh = ⌊cwnd / 2⌋ and reset cwnd = 1 MSS (entering Slow Start).

Exam shortcuts

  • Always convert KB to MSS first! Never apply +1 directly to KB when MSS ≠ 1 KB! In Congestion Avoidance, cwnd grows by +1 MSS per RTT (which is +2 KB if MSS = 2 KB!). Solve the entire trace in MSS, then multiply by MSS at the very last step! — avoiding the #1 GATE numerical trap in TCP congestion control.
  • Slow Start RTT Count Formula: To grow from 1 MSS to ssthresh = S MSS takes ⌈log₂(S)⌉ RTT intervals (so S is reached in round 1 + ⌈log₂(S)⌉). — quickly jumping across Slow Start without listing every round.

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.