Lecture22 Congestion Control
Lecture22 Congestion Control
Lecture22 Congestion Control
Computer Networks:
Architecture and Protocols
Lecture 22
More TCP Conges1on Control
Rachit Agarwal
Recap: Transmission Control Protocol (TCP)
• Reliable, in-order delivery
• Ensures byte stream (eventually) arrives intact
• In the presence of corruption, delays, reordering, loss
• Connection oriented
• Explicit set-up and tear-down of TCP session
• Flow control
• Ensures the sender does not overwhelm the receiver
• Congestion control
• Dynamic adaptation to network path’s capacity
Recap: Basic Components of TCP
• Segments, Sequence numbers, ACKs
• TCP uses byte sequence numbers to identify payloads
• ACKs referred to sequence numbers
• Window sizes expressed in terms of # of bytes
• Retransmissions
• Can’t be correct without retransmitting lost/corrupted data
• TCP retransmits based on timeouts and duplicate ACKs
• Timeouts based on estimate of RTT
• Flow Control
• Congestion Control
Recap: Loss with Cumulative ACKs
• Sender sends packets with 100B and seqnos
• 100, 200, 300, 400, 500, 600, 700, 800, 900
1 1
Timeout
RTT RTT
1
Timeout
Timeout too long -> inefficient Timeout too short -> duplicate packets
Recap: Flow Control (Sliding Window)
• Advertised Window: W
• Can send W bytes beyond the next expected byte
• Multiplicative decrease
• On loss of packets by DupACKs, divide congestion window by half
• Special case: when timeout, reduce congestion window to one MSS
Recap: AIMD
• ACK: CWND -> CWND + 1/CWND
• When CWND is measured in MSS
• Note: after a full window, CWND increase by 1 MSS
• Thus, CWND increases by 1 MSS per RTT
• If timer expires
• Set SSHTHRESH <- CWND/2 (“Slow Start Threshold”)
• Set CWND <- 1 (MSS)
• Retransmit first lost packet
• Execute Slow Start until CWND > SSTHRESH
• After which switch to Additive Increase
TCP Time Diagram (with timeouts)
Window
• Events at sender
• ACK (new data)
• dupACK (duplicate ACK for old data)
• Timeout
Remains in congestion
avoidance after fast
retransmission
Time Diagram
Window
• TCP Reno
• CWND = 1 on timeout Our default assumption
• CWND = CWND/2 on triple dupACK
• TCP-newReno
• TCP-Reno + improved fast recovery
• TCP-SACK
• Incorporates selective acknowledgements
Any Questions?
TCP and fairness guarantees
Consider A Simple Model
• Flows ask for an amount of bandwidth ri
• In reality, this request is implicit (the amount they send)
• Note:
• This is fair share per link. This is not a global fair share
• C = 20
• Requests: r1 = 6, r2 = 5, r3 = 4
• Solution
• a1 = 6, a2 = 5, a3 = 4
• C = 12
• Requests: r1 = 6, r2 = 5, r3 = 4
• One solution
• a1 = 4, a2 = 4, a3 = 4
• Everyone gets the same
• C = 14
• Requests: r1 = 6, r2 = 5, r3 = 4
• Property:
• If you don't get full demand, no one gets more than you
Computing Max-Min Fairness
• Assume demands are in increasing order…
• Repeat
• Intuition: all flows requesting less than fair share get their request.
Remaining flows divide equally
Example
• Assume link speed C is 10Mbps
• Requests: r1 = 8, r2 = 6, r3 = 2
• C/2 = 4
• Can’t service all for r1 or r2
• So hold them to the remaining fair share: f = 4
f = 4:
8 10
4 min(8, 4) = 4
6 4 min(6, 4) = 4
2 min(2, 4) = 2
2
Max-Min Fairness
• Max-min fairness the natural per-link fairness
600 Mbps
2 Gbps
1 Gbps
• Problem
• Turns out that RED does not guarantee fairness
(2) Non-Congestion-Related Losses?
• For instance, RED drops packets intentionally
• TCP would think the network is congested
• Advantages
• Doesn’t confuse corruption with congestion
(3) Sawtooth Behavior Uneven
100 ms
A1 B1
Bottleneck Link
A2 B2
200 ms
Possible Solutions
• Make additive constant proportional to RTT
• Another problem:
• Starting with small window size leads to high latency
Possible Solutions?
• Larger initial window?
• Google proposed moving from ~4KB to ~15KB
• Covers ~90% of HTTP Web
• Decreases delay by 5%
86
• Send M (distinct) ACKs for one MSS RTT ACK 4
C K 9 73
A
• Growth factor proportional to M 461
A C K 1
Data 1
461:29
21
Data 2
921:43
81
Data 4
381:58
41
Data 5
841:73
01
Cheating #2: Increasing CWND Faster (source)
• TCP Rule: increase window by one MSS for each valid ACK received
A x B
y
D E
• Assume
• A start 10 connections to B
• D starts 1 connection to E
• Each connection gets about the same throughput
• Cheating