Congestion Control In The Congestion Control In The Internet Internet
JY Le Boudec Fall 2009
1
Congestion Control In The Congestion Control In The Internet - - PDF document
Congestion Control In The Congestion Control In The Internet Internet JY Le Boudec Fall 2009 1 Plan of This Module Plan of This Module 1. Congestion control: theory 2. Application to the Internet 2 Theory of Congestion Control Theory of
1
2
3
4
5
6
We can solve in close form the symmetric case (all links and sources the same) If λ < c/2 there is no loss: Else:
7
λi λi’ λi’’
8
9
2 4 6 8 10 12 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97
This is congestion collapse ! Take home message
Sources should limit their rates to adapt it to the network condition Otherwise inefficiency or congestion collapse may occur Congestion collapse means: as the offered load increases, the total throughput decreases
10
11
12
13
14
15
If we start from this allocation and increase the rate of source s, then we must decrease the rate of some other (less rich) source s’
16
1. 2.
17
X1 X2
18
If it exists, the max-min fair allocation is unique There exists one max-min fair allocation if the set of feasible rates is convex (this is the case for networks, we have linear constraints)
19
Step 1:
Rate t to all sources Increase t until t = c/10 Freeze the values for sources that use a link that is fully used x0 = c/10 x2 = c/10
Step 2
Rate t to all non frozen sources x1 = t Increase t until t = 9c/10 Freeze the values for sources that use a link that is fully used x1 = 9c/10
20
21
Relative shares matter, not absolute Global effect
22
1. 2.
23
X1 X2
24
The proportionally fair allocation exists and is unique It is obtained by maximizing over all feasible allocations:
25
26
27
28
U(x) = ln (x): proportional fairness U(x) = 1- (1/x)m: m large => ~ max min fairness
This is called “congestion control”
E.g. max-min fairness or proportional fairness
29
30
31
32
Rate xi(t) Feedback y(t)
33
34
35
36
37
38
39
40
AIMD’s fairness can be improved if we know that one source gets much less than some other
For example, if initial condition is a small value We can increase more rapidly the rate of a source that we know is below its fair share
Slow Start is one algorithm for this
Set initial value to the Additive Increase v0 Increase the rate multiplicatively until a target rate is reached or negative feedback is received Apply multiplicative decrease to target rate if negative feedback is received Exit slow start when target rate is received
41
target rate
42
3 sources u1 = 0.5, v1 =0, u0 = 0, v0 = 0.01 (unit: Mb/s) 3rd source starts with rate v0 Source 1 Source 1
time time rate (all 3 sources) Source 3 Source 3
43
44
in addition to what was shown: a TCP source adjusts its window to the congestion status of the Internet (slow start, congestion avoidance) this avoids congestion collapse and ensures some fairness
use to reduce the sending rate
use for long lived sessions (ex: RealAudio) is a threat: congestion collapse UDP sources should imitate TCP : “TCP friendly”
45
W = min (cwnd, OfferedWindow)
negative feedback = loss, positive feedback = ACK received Additive Increase (1 MSS), Multiplicative Decrease (0.5) Slow start with increase factor = 2
Loss detected by timeout => slow start Loss detected by fast retransmit or selective Ack => no slow start
46
47
created from data from: IEEE Transactions on Networking, Oct. 95, “TCP Vegas”, L. Brakmo and L. Petersen
twnd cwnd A B C 1 2 3 4 5 6 7 8 9 60 30 Bytes seconds
48
created from data from: IEEE Transactions on Networking, Oct. 95, “TCP Vegas”, L. Brakmo and L. Petersen
twnd cwnd congestion avoidance slow start congestion avoidance A B C B C 1 2 3 4 5 6 7 8 9 60 30 Bytes seconds
Multiplicative decrease (on loss detection by timeout)
twn twnd = d = 0 0.5 .5 × curren rent_w t_win indow dow twn twnd = d = m max ax (tw (twnd nd, 2 , 2 × MS MSS) S)
Additive increase
twn twnd = d = t twnd wnd + + MS MSS S × MS MSS / S / twnd wnd This is equivalent in packets to twn twnd = d = m min in (tw (twnd nd, m , max- ax-si size) ze) (6 (64K 4KB) B)
49
twnd = 1 MSS 3 2 4
non dupl. ack received non dupl. ack received during slow start -> during slow start ->
cw cwnd nd = cw cwnd nd + MSS (i (in by n bytes) (1) if if cw cwnd = tw nd = twnd nd th then en tr tran ansition to to co cong nges esti tion av avoi
dance
50
3 2 5 cwnd = 1 seg 4 6 7 8
51
ad addi diti tive in incr crea ease ad addi diti tive in incr crea ease multipli plica cati tive ve de decr crea ease se sl slow
start lo loss ss lo loss ss Congesti stion
avoida idance nce Congesti stion
avoida idance nce
52
exponential increase for cwnd until cwnd = twnd Slow Start additive increase for twnd, cwnd = twnd Congestion Avoidance
cwnd = twnd retransmission timeout:
decrease for twnd
retransmission timeout:
decrease for twnd
connection opening: twnd = 65535 B cwnd = 1 seg notes this shows only 2 states out of 3 twnd = target window
initial phase, major change guessed by timeout expiration
target window is halved but temporary window size increase is allowed to help recover losses
when a loss occurs, the sending rate is no longer approximated by the W/RTT
53
assume cwnd = 4 when P4 is sent fast recovery increases window and allows to send P7 at time t2, cwd is set to 2
54
P1 P2 P3 P4 P5 P6 P3 P7 A1 A2 A2 A2 A2 A? t1 t2
Multiplicative decrease
twnd = 0.5 × current-size twnd = max (twnd, 2 × MSS)
Fast Recovery
cwnd = twnd + 3 × MSS (exp. increase) cwnd = min (cwnd, 64K) retransmission of the missing segment (n)
For each duplicated ACK
cwnd = cwnd + MSS (exp. increase) cwnd = min (cwnd, 64K) send following segments
55
56
twnd cwnd 1 2 3 4 5 6 60 30 Bytes seconds E F A B C D E F A-B, E-F: fast recovery C-D: slow start
57
Slow Start
increase Congestion Avoidance
increase Fast Recovery
increase beyond twnd new connection:
cwnd = twnd:
expected ack received: fast retransmit: fast retransmit:
58
(proof: see lecture notes)
to max-min fairness)
59
60
61
Example network with two TCP sources
link capacity, delay
limited queues on the link (8 segments)
NS simulation
10 Mb/s, 20 ms 1 Mb/s 10 ms 10 Mb/s, 60 ms 8 seg. 8 seg.
62
it uses more resources (≈ proportional fairness) – desired bias it has a longer RTT – undesired bias
63
this is called “Tail Drop”
buffers fill, then drop -> buffers are full most of the time
produces large average delays large queuing delay => large RTT => smaller TCP throughput
also: produces very irregular behaviour but buffers are needed to amortize bursts
active queue management (AQM)
drop packets before buffer is full, based on estimation of traffic load
64
queue estimates its average queue length avg ← a × measured + (1 - a) × avg
incoming packet is dropped with a probability that depends on avg roughly speaking. drop proba is read from the curve below + uniformization procedure
65
66
different link delays limited queues on the link (20 packets)
2 Mb/s, 10 ms 2 Mb/s 100 ms 2 Mb/s, 60 ms 2 Mb/s, 100 ms 20 seg. 20 seg.
67
68
69
70
RTT T segment size L average packet loss ratio q constant C = 1.22
71
10 Mb/s, 20 ms 1 Mb/s 10 ms 10 Mb/s, 60 ms 8 seg. 8 seg.
solution
RTP/UDP flow sending video/audio data
application determines the sending rate feedback - amount of lost packets, loss ratio sending rate = rate of a TCP flow experiencing the same loss ratio
72
73
sender increases its sending window until loss occurs, then decreases
additive increase (no loss) multiplicative decrease (loss)
slow start, congestion avoidance, fast recovery
Congestion control aims at avoiding congestion collapse in the network With TCP/IP, performed in end-systems, mainly with TCP TCP TCP Cong Congestion co estion control su rol summary mmary Principle: sender increases its sending window until losses occur, then decrease target window: additive increase (no loss), multiplicative decrease (loss) 3 phases: slow start slow start: starts with 1, exponential increase up to twnd congestion avoidance congestion avoidance:additive increase until loss or no increase fast recove fast recovery ry: fast retransmission of one segment slow start entered at setup or after retransmission timeout fast recovery entered at fast retransmit
74
additive increase additive increase multiplicative decrease slow start loss loss
75
76
router destination
10 Mb/s, 20 ms 1 Mb/s 10 ms 10 Mb/s, 60 ms 8 seg. 8 seg.
S1 S2
back