← all topics

5 · TCP congestion control: slow start, AIMD, Reno vs Tahoe ★

Slides 3-77 → 3-83 · HW4 P40, P41 · Sample midterm page 3 (the P40 graph, parts a–h)

AIMD: the basic idea (3-78)

cwnd: what the sender is allowed to send (3-79)

Slow start (3-80)

Congestion avoidance (CA)

When to switch: ssthresh (3-82)

Reacting to loss (3-81)

Loss signalRenoTahoe
Timeout (bad: nothing is getting through)ssthresh = cwnd/2, cwnd = 1 MSS, slow start againsame
3 duplicate ACKs (milder: some segments still arrive)ssthresh = cwnd/2, cwnd = ssthresh + 3 MSS, then congestion avoidance (fast recovery)ssthresh = cwnd/2, cwnd = 1 MSS, slow start

The FSM summary (3-83)

start:  cwnd = 1 MSS, ssthresh = 64 KB, dupACKcount = 0  →  SLOW START

SLOW START
  new ACK        : cwnd += MSS, dupACKcount = 0, send new segments
  dup ACK        : dupACKcount++
  cwnd ≥ ssthresh: → CONGESTION AVOIDANCE
  timeout        : ssthresh = cwnd/2, cwnd = 1 MSS, retransmit  (stay in SS)
  dupACKcount==3 : ssthresh = cwnd/2, cwnd = ssthresh + 3 MSS,
                   retransmit missing segment → FAST RECOVERY

CONGESTION AVOIDANCE
  new ACK        : cwnd += MSS·(MSS/cwnd), dupACKcount = 0
  dup ACK        : dupACKcount++
  timeout        : ssthresh = cwnd/2, cwnd = 1 MSS → SLOW START
  dupACKcount==3 : ssthresh = cwnd/2, cwnd = ssthresh + 3 MSS → FAST RECOVERY

FAST RECOVERY
  dup ACK        : cwnd += MSS
  new ACK        : cwnd = ssthresh → CONGESTION AVOIDANCE
  timeout        : ssthresh = cwnd/2, cwnd = 1 MSS → SLOW START

Average throughput (book 3.7)

How to solve: the cwnd-vs-round graph (HW4 P40)

Q (HW4 P40; sample midterm page 3 is parts a–h): Consider Figure 3.61 (cwnd in segments vs. transmission round). Assuming TCP Reno is the protocol experiencing this behavior, answer the following questions, giving a short justification for each.

  1. (a) Identify the intervals of time when TCP slow start is operating.
  2. (b) Identify the intervals of time when TCP congestion avoidance is operating.
  3. (c) After the 16th transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?
  4. (d) After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?
  5. (e) What is the initial value of ssthresh at the first transmission round?
  6. (f) What is the value of ssthresh at the 18th transmission round?
  7. (g) What is the value of ssthresh at the 24th transmission round?
  8. (h) During what transmission round is the 70th segment sent?
  9. (i) Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, what will be the values of the congestion window size and of ssthresh?
  10. (j) Suppose TCP Tahoe is used (instead of TCP Reno), and assume that triple duplicate ACKs are received at the 16th round. What are the ssthresh and the congestion window size at the 19th round?
  11. (k) Again suppose TCP Tahoe is used, and there is a timeout event at the 22nd round. How many packets have been sent out from the 17th round till the 22nd round, inclusive?
  1. Read off cwnd for every round and write it in a table. Do this first.
  2. Slow start = rounds where cwnd doubles (1, 2, 4, 8, …).
  3. Congestion avoidance = rounds where cwnd goes up by 1.
  4. Initial ssthresh = the cwnd where doubling stops and +1 begins.
  5. Drop to 1 → the loss was a timeout.
  6. Drop to about half (half, or half + 3) → triple duplicate ACK (Reno).
  7. New ssthresh = half the cwnd in the round where the loss happened (round down).
  8. "Which round sends segment N?" Keep a running total of cwnd. Round r sends segments (total through r−1) + 1 up to (total through r). Find the round whose range contains N.
  9. Tahoe "what if" questions: after any loss, restart at cwnd = 1, double each round, and cap at the new ssthresh. Then switch to +1.

Step 1: the cwnd table from Figure 3.61

RoundcwndWhat's happening
1–61, 2, 4, 8, 16, 32Doubling → slow start
7–1633, 34, …, 42+1 per round → CA
17–2224, 25, …, 29Dropped to 21 + 3 = 24, then +1 → CA
23–261, 2, 4, 8Back to 1, doubling → slow start

Parts a–g

a) Slow start:  rounds [1,6] and [23,26]          (cwnd doubles)
b) CA:          rounds [6,16] and [17,22]         (cwnd +1 per round)
c) After 16:    42 → 24, about half, not 1       → TRIPLE DUPLICATE ACK
d) After 22:    29 → 1                           → TIMEOUT
e) Initial ssthresh: doubling stops at 32        → 32
f) ssthresh at 18: loss at round 16 had cwnd 42  → 42/2 = 21
g) ssthresh at 24: loss at round 22 had cwnd 29  → 29/2 = 14.5 → 14

Part h: which round sends segment 70?

RoundcwndRunning totalSegments sent
1111
2232–3
3474–7
48158–15
5163116–31
6326332–63
7339664–96 ← 70 is here

Answer: round 7.

Part i: triple dup ACK after round 26 (Reno)

cwnd at round 26 = 8
ssthresh = 8/2       = 4
cwnd     = 4 + 3 MSS = 7

ssthresh = 4, cwnd = 7.

Part j: Tahoe, triple dup ACK at round 16. ssthresh and cwnd at round 19?

ssthresh = 42/2 = 21
Tahoe: cwnd = 1 at round 17, then slow start
  round 17: 1
  round 18: 2
  round 19: 4

ssthresh = 21, cwnd = 4.

Part k: Tahoe. Segments sent in rounds 17–22?

round 17:  1
round 18:  2
round 19:  4
round 20:  8
round 21: 16
round 22: 21   ← doubling would give 32, but ssthresh = 21 caps it
total = 1 + 2 + 4 + 8 + 16 + 21 = 52

52 segments. (All answers match the official HW4 solution.)

How to solve: AIAD vs AIMD fairness (HW4 P41)

Q (HW4 P41): Refer to Figure 3.56, which illustrates the convergence of TCP's AIMD algorithm. Suppose that instead of a multiplicative decrease, TCP decreased the window size by a constant amount. Would the resulting AIAD algorithm converge to an equal share algorithm? Justify your answer using a diagram similar to Figure 3.56.

  1. Draw connection 1's throughput on the x-axis and connection 2's on the y-axis.
  2. Draw the equal-share line x = y and the full-bandwidth line x + y = R.
  3. Additive increase: both gain 1 per RTT, so the point moves up-right at 45°. The gap x − y stays the same.
  4. Additive decrease (subtract a constant from both): the point moves back down-left at 45°. The gap x − y still stays the same. The point bounces along one 45° segment forever and never reaches x = y.
  5. Multiplicative decrease (halve both): the point moves toward the origin, so the gap is halved at every loss. Repeated losses push it onto x = y.
 conn 2
   R |\
     | \  full-bandwidth line x + y = R
     |  \         / equal-share line x = y
     |   \      /
     |    \   /
     |     \/        AIAD: bounces along one 45° segment, gap fixed
     |    / \        AIMD: halving pulls the point toward x = y
     |  /    \
     |/_______\______ conn 1
                R

Worked numbers: R = 20, losses happen when x + y reaches 20, start at (12, 6)

StepAIAD (−4 each on loss)AIMD (halve on loss)
AI to the line(13, 7), gap 6(13, 7), gap 6
Loss(9, 3), gap 6(6.5, 3.5), gap 3
AI to the line(13, 7), gap 6(11.5, 8.5), gap 3
Loss(9, 3), gap 6(5.75, 4.25), gap 1.5
Long runRepeats forever. Not fair.Gap 0.75, 0.375, … → 0. Converges to (10, 10).

Answer: AIAD does not converge to an equal share. Increases and decreases are equal for both connections, so the difference between them never changes. The official solution also notes that if the linear decreases are unequal (2:1), one connection is eventually driven to 0.

Traps
• Drop to 1 = timeout. Drop to about half = triple dup ACK. Don't reverse them.
• ssthresh is half the cwnd at the loss, not half the cwnd after the drop. P40f is 42/2 = 21, not 24/2.
• Round down odd halves: 29/2 → 14 (that's what the official answer uses).
• Reno after 3 dup ACKs is ssthresh + 3 (P40i: 4 + 3 = 7). That's why Figure 3.61 drops from 42 to 24, not to 21.
• Tahoe restarts at 1 even on 3 dup ACKs. Cap slow start at ssthresh (P40k: 16 → 21, not 32).
• Interval endpoints are shared: slow start [1,6] and CA [6,16] both include round 6. Write them the way the solution does.
• "Segment N": use running totals. Round r's first segment is (total through r−1) + 1. Don't forget the +1.
• Slow start adds 1 MSS per ACK (that's what doubles cwnd each RTT). CA adds 1 MSS per RTT, not per ACK.

Quick check

1. Reno: cwnd per round is 1, 2, 4, 8, 16, 20, 21, 22 (rounds 1–8), then a timeout after round 8. Initial ssthresh? Which rounds are slow start and CA? cwnd and ssthresh for rounds 9–14? Doubling stops at 20, so initial ssthresh = 20 (16 would double to 32 but is capped at 20).
Slow start [1,6], CA [6,8].
Timeout: ssthresh = 22/2 = 11, cwnd = 1.
round  9: 1
round 10: 2
round 11: 4
round 12: 8
round 13: 11   ← 16 capped at ssthresh 11
round 14: 12   ← CA, +1
2. Same graph as #1. In which round is segment 40 sent? How many segments are sent in rounds 1–8?
round 1:  1  → total  1   (1)
round 2:  2  → total  3   (2–3)
round 3:  4  → total  7   (4–7)
round 4:  8  → total 15   (8–15)
round 5: 16  → total 31   (16–31)
round 6: 20  → total 51   (32–51)  ← 40 here
round 7: 21  → total 72
round 8: 22  → total 94
Segment 40 is sent in round 6. Rounds 1–8 send 94 segments.
3. Reno: rounds 1–5 are 1, 2, 4, 8, 16; rounds 6–12 are 17 → 23; rounds 13–17 are 14 → 18; round 18 is 1. Identify both losses, initial ssthresh, and ssthresh at rounds 14 and 19. Initial ssthresh = 16 (doubling stops there).
After round 12: 23 → 14 (about half, not 1) → triple dup ACK. ssthresh = 23/2 = 11.5 → 11; cwnd = 11 + 3 = 14 ✓ matches the graph. ssthresh at round 14 = 11.
After round 17: 18 → 1 → timeout. ssthresh = 18/2 = 9 at round 19.
4. Same graph as #3. In which round is segment 50 sent?
rounds 1–5: 1+2+4+8+16 = 31   (segments 1–31)
round 6: 17 → total 48        (32–48)
round 7: 18 → total 66        (49–66)  ← 50 here
Round 7.
5. Figure 3.61 again, but TCP Tahoe with triple dup ACKs after round 16. What is cwnd at round 23, and how many segments are sent in rounds 17–23? ssthresh = 42/2 = 21. cwnd restarts at 1:
17: 1, 18: 2, 19: 4, 20: 8, 21: 16, 22: 21 (capped), 23: 22 (CA, +1)
total = 1+2+4+8+16+21+22 = 74
cwnd = 22 at round 23; 74 segments.
6. Reno, cwnd = 12 MSS when 3 dup ACKs arrive. Then two rounds later a timeout happens. Give ssthresh and cwnd after each event, and cwnd for the next 5 rounds. 3 dup ACKs: ssthresh = 12/2 = 6, cwnd = 6 + 3 = 9. CA: 9, 10, 11.
Timeout at cwnd 11: ssthresh = 11/2 = 5.5 → 5, cwnd = 1.
Next 5 rounds: 1, 2, 4, 5, 6 (8 is capped at ssthresh 5, then +1).
7. Figure 3.61: in which round is segment 100 sent? After round 6 the total is 63. Round 7 sends 33 (64–96). Round 8 sends 34 (97–130). Round 8.
8. MSS = 1500 bytes, RTT = 100 ms, losses always happen at W = 40 segments. Average throughput?
W/RTT = 40 × 1500 × 8 bits / 0.1 s = 480,000 / 0.1 = 4.8 Mbps
avg   = 0.75 × 4.8 = 3.6 Mbps
3.6 Mbps.
9. In CA with MSS = 1000 bytes and cwnd = 10,000 bytes, how much does each ACK add? How much after one RTT? Per ACK: 1000 × 1000 / 10,000 = 100 bytes. One RTT brings about 10 ACKs → about +1000 bytes = 1 MSS.
10. cwnd = 20 KB, rwnd = 12 KB, LastByteAcked = 5000. Largest allowed LastByteSent? In flight ≤ min(20 KB, 12 KB) = 12 KB = 12,288 bytes. LastByteSent ≤ 5000 + 12,288 = 17,288 (or 17,000 with KB = 1000).
11. One line: Reno vs Tahoe? Both go to cwnd = 1 on a timeout. On 3 dup ACKs, Reno sets cwnd = ssthresh + 3 and continues in CA; Tahoe sets cwnd = 1 and slow-starts.
12. Why does AIAD fail to converge to fairness, while AIMD succeeds? Adding or subtracting the same amount from both connections leaves their difference unchanged. Halving both halves the difference at every loss, so it shrinks toward 0 (equal share).

← prev · all topics · next →