tcp: congestion control (part ii)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf ·...
TRANSCRIPT
![Page 1: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/1.jpg)
TCP: Congestion Control (part II)
CS 168, Fall 2014 Sylvia Ratnasamy
http://inst.eecs.berkeley.edu/~cs168
Material thanks to Ion Stoica, Scott Shenker, Jennifer Rexford, Nick McKeown, and many other colleagues
![Page 2: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/2.jpg)
Announcements
l Midterm grades and solutions to be released soon after lecture today
l Distribution
![Page 3: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/3.jpg)
Announcements
l We will accept re-grade requests up to noon, Oct 30
l Regrade process if we made a clerical mistake: l e.g., you selected answer iii, we graded as ii, etc. l we’ll correct your score immediately
l Regrade process if you disagree with our assessment l we will re-grade your entire exam
![Page 4: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/4.jpg)
Last Lecture l TCP Congestion control: the gory details
Today l Wrap-up CC details (fast retransmit) l Critically examining TCP l Advanced techniques
![Page 5: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/5.jpg)
Recap: TCP congestion control
l Congestion Window: CWND l How many bytes can be sent without overflowing routers l Computed by the sender using congestion control algorithm
l Flow control window: AdvertisedWindow (RWND)
l How many bytes can be sent without overflowing receiver’s buffers l Determined by the receiver and reported to the sender
l Sender-side window = minimum{CWND, RWND}
![Page 6: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/6.jpg)
Recall: Three Issues
l Discovering the available (bottleneck) bandwidth l Slow Start
l Adjusting to variations in bandwidth l AIMD (Additive Increase Multiplicative Decrease)
l Sharing bandwidth between flows l AIMD vs. MIMD/AIAD…
![Page 7: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/7.jpg)
Recap: Implementation
l State at sender l CWND (initialized to a small constant) l ssthresh (initialized to a large constant)
l Events l ACK (new data) l dupACK (duplicate ACK for old data) l Timeout
![Page 8: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/8.jpg)
Event: ACK (new data)
l If CWND < ssthresh l CWND += 1
• CWND packets per RTT • Hence after one RTT
with no drops: CWND = 2xCWND
![Page 9: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/9.jpg)
Event: ACK (new data)
l If CWND < ssthresh l CWND += 1
l Else l CWND = CWND + 1/CWND
Slow start phase
• CWND packets per RTT • Hence after one RTT
with no drops: CWND = CWND + 1
“Congestion Avoidance” phase (additive increase)
![Page 10: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/10.jpg)
Event: TimeOut
l On Timeout l ssthresh ß CWND/2 l CWND ß 1
![Page 11: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/11.jpg)
Event: dupACK
l dupACKcount ++
l If dupACKcount = 3 /* fast retransmit */ l ssthresh = CWND/2 l CWND = CWND/2
![Page 12: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/12.jpg)
One Final Phase: Fast Recovery
l The problem: congestion avoidance too slow in recovering from an isolated loss
![Page 13: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/13.jpg)
Example
l Consider a TCP connection with: l CWND=10 packets l Last ACK had seq# 101
l i.e., receiver expecting next packet to have seq# 101
l 10 packets [101, 102, 103,…, 110] are in flight l Packet 101 is dropped
![Page 14: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/14.jpg)
Timeline (at sender) In flight: 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 l ACK 101 (due to 102) cwnd=10 dupACK#1 (no xmit) l ACK 101 (due to 103) cwnd=10 dupACK#2 (no xmit) l ACK 101 (due to 104) cwnd=10 dupACK#3 (no xmit) l RETRANSMIT 101 ssthresh=5 cwnd= 5 l ACK 101 (due to 105) cwnd=5 + 1/5 (no xmit) l ACK 101 (due to 106) cwnd=5 + 2/5 (no xmit) l ACK 101 (due to 107) cwnd=5 + 3/5 (no xmit) l ACK 101 (due to 108) cwnd=5 + 4/5 (no xmit) l ACK 101 (due to 109) cwnd=5 + 5/5 (no xmit) l ACK 101 (due to 110) cwnd=6 + 1/5 (no xmit) l ACK 111 (due to 101) ç only now can we transmit new packets l Plus no packets in flight so ACK “clocking” (to increase CWND)
stalls for another RTT
✗ 101
![Page 15: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/15.jpg)
Solution: Fast Recovery
Idea: Grant the sender temporary “credit” for each dupACK so as to keep packets in flight l If dupACKcount = 3
l ssthresh = cwnd/2 l cwnd = ssthresh + 3
l While in fast recovery l cwnd = cwnd + 1 for each additional duplicate ACK
l Exit fast recovery after receiving new ACK l set cwnd = ssthresh
![Page 16: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/16.jpg)
Timeline (at sender)
In flight: 101, 102, 103, 104, 105, 106, 107, 108, 109, 110 l ACK 101 (due to 102) cwnd=10 dup#1 l ACK 101 (due to 103) cwnd=10 dup#2 l ACK 101 (due to 104) cwnd=10 dup#3 l REXMIT 101 ssthresh=5 cwnd= 8 (5+3) l ACK 101 (due to 105) cwnd= 9 (no xmit) l ACK 101 (due to 106) cwnd=10 (no xmit) l ACK 101 (due to 107) cwnd=11 (xmit 111) l ACK 101 (due to 108) cwnd=12 (xmit 112) l ACK 101 (due to 109) cwnd=13 (xmit 113) l ACK 101 (due to 110) cwnd=14 (xmit 114) l ACK 111 (due to 101) cwnd = 5 (xmit 115) ç exiting fast recovery l Packets 111-114 already in flight l ACK 112 (due to 111) cwnd = 5 + 1/5 ß back in congestion avoidance
✗
![Page 17: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/17.jpg)
TCP State Machine
slow start
congstn. avoid.
fast recovery
cwnd > ssthresh
timeout
dupACK=3
timeout dupACK=3
new ACK
dupACK
new ACK
timeout new ACK dupACK
dupACK
![Page 18: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/18.jpg)
TCP State Machine
slow start
congstn. avoid.
fast recovery
cwnd > ssthresh
timeout
dupACK=3
timeout dupACK=3
new ACK
dupACK
new ACK
timeout new ACK dupACK
dupACK
![Page 19: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/19.jpg)
TCP State Machine
slow start
congstn. avoid.
fast recovery
cwnd > ssthresh
timeout
dupACK=3
timeout dupACK=3
new ACK
dupACK
new ACK
timeout new ACK dupACK
dupACK
![Page 20: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/20.jpg)
TCP State Machine
slow start
congstn. avoid.
fast recovery
cwnd > ssthresh
timeout
dupACK=3
timeout dupACK=3
new ACK
dupACK
new ACK
timeout new ACK dupACK
dupACK
![Page 21: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/21.jpg)
TCP Flavors
l TCP-Tahoe l CWND =1 on triple dupACK
l TCP-Reno l CWND =1 on timeout l CWND = CWND/2 on triple dupack
l TCP-newReno l TCP-Reno + improved fast recovery
l TCP-SACK l incorporates selective acknowledgements
Our default assumption
![Page 22: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/22.jpg)
Interoperability
l How can all these algorithms coexist? Don’t we need a single, uniform standard?
l What happens if I’m using Reno and you are using Tahoe, and we try to communicate?
![Page 23: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/23.jpg)
Last Lecture l TCP Congestion control: the gory details
Today l Wrap-up CC details (fast retransmit) l Critically examining TCP l Advanced techniques
![Page 24: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/24.jpg)
TCP Throughput Equation
![Page 25: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/25.jpg)
A
A Simple Model for TCP Throughput
Loss
time
cwnd
1
RTT
maxW
2maxW
½ Wmax RTTs between drops
Avg. ¾ Wmax packets per RTTs
![Page 26: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/26.jpg)
A
A Simple Model for TCP Throughput
Loss
time
cwnd
maxW
2maxW
A = 38Wmax
2
Packet drop rate, p =1/ A
Throughput, B = AWmax
2!
"#
$
%&RTT
=32
1RTT p
½ Wmax RTTs between drops
Avg. ¾ Wmax packets per RTTs
![Page 27: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/27.jpg)
Implications (1): Different RTTs
l Flows get throughput inversely proportional to RTT l TCP unfair in the face of heterogeneous RTTs!
Throughput = 32
1RTT p
A1
A2 B2
B1
bottleneck link
100ms
200ms
![Page 28: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/28.jpg)
Implications (2): High Speed TCP
l Assume RTT = 100ms, MSS=1500bytes, BW=100Gbps
l What value of p is required to reach 100Gbps throughput? l ~ 2 x 10-12
l How long between drops? l ~ 16.6 hours
l How much data has been sent in this time? l ~ 6 petabits
l These are not practical numbers!
Throughput = 32
1RTT p
![Page 29: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/29.jpg)
Adapting TCP to High Speed
l Once past a threshold speed, increase CWND faster l A proposed standard [Floyd’03]: once speed is past some
threshold, change equation to p-.8 rather than p-.5
l Let the additive constant in AIMD depend on CWND
l Other approaches? l Multiple simultaneous connections (hack but works today)
l Router-assisted approaches (will see shortly)
![Page 30: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/30.jpg)
Implications (3): Rate-based CC
l TCP throughput is “choppy” l repeated swings between W/2 to W
l Some apps would prefer sending at a steady rate l e.g., streaming apps
l A solution: “Equation-Based Congestion Control”
l ditch TCP’s increase/decrease rules and just follow the equation l measure drop percentage p, and set rate accordingly
l Following the TCP equation ensures we’re “TCP friendly” l i.e., use no more than TCP does in similar setting
Throughput = 32
1RTT p
![Page 31: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/31.jpg)
Other Limitations of TCP Congestion Control
![Page 32: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/32.jpg)
(4) Loss not due to congestion?
l TCP will confuse corruption with congestion
l Flow will cut its rate l Throughput ~ 1/sqrt(p) where p is loss prob. l Applies even for non-congestion losses!
l We’ll look at proposed solutions shortly…
![Page 33: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/33.jpg)
(5) How do short flows fare?
l 50% of flows have < 1500B to send; 80% < 100KB
l Implication (1): short flows never leave slow start! l short flows never attain their fair share
l Implication (2): too few packets to trigger dupACKs l Isolated loss may lead to timeouts l At typical timeout values of ~500ms, might severely impact
flow completion time
![Page 34: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/34.jpg)
(6) TCP fills up queues à long delays
l A flow deliberately overshoots capacity, until it experiences a drop
l Means that delays are large, and are large for
everyone l Consider a flow transferring a 10GB file sharing a
bottleneck link with 10 flows transferring 100B
![Page 35: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/35.jpg)
(7) Cheating
l Three easy ways to cheat l Increasing CWND faster than +1 MSS per RTT
![Page 36: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/36.jpg)
Increasing CWND Faster
Limit rates: x = 2y
C
x
y x increases by 2 per RTT y increases by 1 per RTT
![Page 37: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/37.jpg)
(7) Cheating
l Three easy ways to cheat l Increasing CWND faster than +1 MSS per RTT l Opening many connections
![Page 38: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/38.jpg)
Open Many Connections
A B x
D E y
Assume • A starts 10 connections to B • D starts 1 connection to E • Each connection gets about the same throughput Then A gets 10 times more throughput than D
![Page 39: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/39.jpg)
(7) Cheating
l Three easy ways to cheat l Increasing CWND faster than +1 MSS per RTT l Opening many connections l Using large initial CWND
l Why hasn’t the Internet suffered a congestion collapse yet?
![Page 40: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/40.jpg)
(8) CC intertwined with reliability
l Mechanisms for CC and reliability are tightly coupled l CWND adjusted based on ACKs and timeouts l Cumulative ACKs and fast retransmit/recovery rules
l Complicates evolution l Consider changing from cumulative to selective ACKs l A failure of modularity, not layering
l Sometimes we want CC but not reliability l e.g., real-time applications
l Sometimes we want reliability but not CC (?)
![Page 41: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/41.jpg)
Recap: TCP problems
l Misled by non-congestion losses l Fills up queues leading to high delays l Short flows complete before discovering available capacity l AIMD impractical for high speed links l Sawtooth discovery too choppy for some apps l Unfair under heterogeneous RTTs l Tight coupling with reliability mechanisms l Endhosts can cheat
Could fix many of these with some help from routers!
Routers tell endpoints if they’re congested
Routers tell endpoints what rate to send at
Routers enforce fair sharing
![Page 42: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/42.jpg)
Router-Assisted Congestion Control
l Three tasks for CC: l Isolation/fairness l Adjustment l Detecting congestion
![Page 43: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/43.jpg)
How can routers ensure each flow gets its “fair share”?
![Page 44: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/44.jpg)
Fairness: General Approach
l Routers classify packets into “flows” l (For now) let’s assume flows are TCP connections
l Each flow has its own FIFO queue in router
l Router services flows in a fair fashion l When line becomes free, take packet from next flow in a fair order
l What does “fair” mean exactly?
![Page 45: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/45.jpg)
Max-Min Fairness
l Given set of bandwidth demands ri and total bandwidth C, max-min bandwidth allocations are:
ai = min(f, ri) where f is the unique value such that Sum(ai) = C
r1
r2
r3
? ?
? C bits/s
![Page 46: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/46.jpg)
Example
l C = 10; r1 = 8, r2 = 6, r3 = 2; N = 3 l C/3 = 3.33 →
l But r3’s need is only 2 l Can service all of r3 l Remove r3 from the accounting: C = C – r3 = 8; N = 2
l C/2 = 4 → l Can’t service all of r1 or r2 l So hold them to the remaining fair share: f = 4
8 6 2
4 4
2
f = 4: min(8, 4) = 4 min(6, 4) = 4 min(2, 4) = 2
10
![Page 47: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/47.jpg)
Max-Min Fairness
l Given set of bandwidth demands ri and total bandwidth C, max-min bandwidth allocations are:
ai = min(f, ri) l where f is the unique value such that Sum(ai) = C
l Property: l If you don’t get full demand, no one gets more than you
l This is what round-robin service gives if all packets are the same size
![Page 48: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/48.jpg)
How do we deal with packets of different sizes?
l Mental model: Bit-by-bit round robin (“fluid flow”)
l Can you do this in practice?
l No, packets cannot be preempted
l But we can approximate it l This is what “fair queuing” routers do
![Page 49: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/49.jpg)
Fair Queuing (FQ)
l For each packet, compute the time at which the last bit of a packet would have left the router if flows are served bit-by-bit
l Then serve packets in the increasing order of their deadlines
![Page 50: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/50.jpg)
Example
1 2 3 4 5
1 2 3 4
1 2 3
1 2 4
3 4 5
5 6
1 2 1 3 2 3 4 4
5 6
5 5 6
Flow 1 (arrival traffic)
Flow 2 (arrival traffic)
Service in fluid flow
system
FQ Packet system
time
time
time
time
![Page 51: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/51.jpg)
Fair Queuing (FQ)
l Think of it as an implementation of round-robin generalized to the case where not all packets are equal sized
l Weighted fair queuing (WFQ): assign different flows different shares
l Today, some form of WFQ implemented in almost all routers l Not the case in the 1980-90s, when CC was being developed l Mostly used to isolate traffic at larger granularities (e.g., per-prefix)
![Page 52: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/52.jpg)
FQ vs. FIFO l FQ advantages:
l Isolation: cheating flows don’t benefit l Bandwidth share does not depend on RTT l Flows can pick any rate adjustment scheme they want
l Disadvantages:
l More complex than FIFO: per flow queue/state, additional per-packet book-keeping
![Page 53: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/53.jpg)
FQ in the big picture
l FQ does not eliminate congestion à it just manages the congestion
1Gbps
Blue and Green get 0.5Gbps; any excess
will be dropped
Will drop an additional 400Mbps from the green flow
If the green flow doesn’t drop its sending rate to 100Mbps, we’re wasting 400Mbps
that could be usefully given to the blue flow
![Page 54: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/54.jpg)
FQ in the big picture l FQ does not eliminate congestion à it just
manages the congestion l robust to cheating, variations in RTT, details of delay,
reordering, retransmission, etc. l But congestion (and packet drops) still occurs
l And we still want end-hosts to discover/adapt to their fair share!
l What would the end-to-end argument say w.r.t. congestion control?
![Page 55: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/55.jpg)
Fairness is a controversial goal
l What if you have 8 flows, and I have 4? l Why should you get twice the bandwidth
l What if your flow goes over 4 congested hops, and mine only goes over 1? l Why shouldn’t you be penalized for using more scarce
bandwidth?
l And what is a flow anyway? l TCP connection l Source-Destination pair? l Source?
![Page 56: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/56.jpg)
Router-Assisted Congestion Control
l CC has three different tasks: l Isolation/fairness l Rate adjustment l Detecting congestion
![Page 57: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/57.jpg)
Why not just let routers tell endhosts what rate they should use?
l Packets carry “rate field”
l Routers insert “fair share” f in packet header
l End-hosts set sending rate (or window size) to f l hopefully (still need some policing of endhosts!)
l This is the basic idea behind the “Rate Control Protocol” (RCP) from Dukkipati et al. ’07
![Page 58: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/58.jpg)
58
Flow Completion Time: TCP vs. RCP (Ignore XCP)
Flow Duration (secs) vs. Flow Size
RCP
![Page 59: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/59.jpg)
Why the improvement?
![Page 60: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/60.jpg)
Router-Assisted Congestion Control
l CC has three different tasks: l Isolation/fairness l Rate adjustment l Detecting congestion
![Page 61: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/61.jpg)
Explicit Congestion Notification (ECN)
l Single bit in packet header; set by congested routers l If data packet has bit set, then ACK has ECN bit set
l Many options for when routers set the bit l tradeoff between (link) utilization and (packet) delay
l Congestion semantics can be exactly like that of drop l I.e., endhost reacts as though it saw a drop
l Advantages: l Don’t confuse corruption with congestion; recovery w/ rate adjustment l Can serve as an early indicator of congestion to avoid delays l Easy (easier) to incrementally deploy
l Today: defined in RFC 3168 using ToS/DSCP bits in the IP header
![Page 62: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/62.jpg)
One final proposal: Charge people for congestion!
l Use ECN as congestion markers
l Whenever I get an ECN bit set, I have to pay $$
l Now, there’s no debate over what a flow is, or what fair is…
l Idea started by Frank Kelly at Cambridge l “optimal” solution, backed by much math l Great idea: simple, elegant, effective l Unclear that it will impact practice
![Page 63: TCP: Congestion Control (part II)inst.eecs.berkeley.edu/~cs168/fa14/lectures/lec14-public.pdf · Announcements ! We will accept re-grade requests up to noon, Oct 30 ! Regrade process](https://reader034.vdocuments.us/reader034/viewer/2022051909/5ffd4744d1d48128bf1668bc/html5/thumbnails/63.jpg)
Recap
l TCP: l somewhat hacky l but practical/deployable l good enough to have raised the bar for the deployment
of new, more optimal, approaches l though the needs of datacenters might change the
status quo (future lecture)