Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Littles Law
Average
g population
p p
= (average delay) x
(throughput)
average delay 1
N
delayi
i1
throughput N/T
Time t
average population 1 T0 n(t)dt
T
Source:
P1
Sender
a1 a
acknowledged
P2
Receiver
Sink
0
unacknowledged
next expected
received
:
1
s1 s
r + RW 1
r
delivered
RW receive window size
SW send window size (s - a SW)
receive window
Source:
P1
Sender
a1 a
acknowledged
s1 s
unacknowledged
r+3
next expected
Sink:
P2
Receiver
r + RW 1
r
delivered
receive window
TCP Congestion Control (Simon Lam)
Source:
P1
Sender
a1 a
s1 s
acknowledged
next expected
Sink:
P2
Receiver
r + RW 1
r
delivered
receive window
1 2
1 2
time
ACKs
data
Destination
1 2
1 2
time
Throughput
W
RTT
packets/sec
W MSS
RTT
bytes/sec
Clarifications
Average number in the send buffer is typically
average delay is
(1 p) RTT p TO
(1 p ) throughput
th
h t
Effect of Congestion
W too big for each of many flows -> congestion
Packet loss -> transmissions on links prior to packet
load
10
cwnd:
congestion window
Sender sets W = min (cwnd, rwnd)
TCP Congestion Control (Simon Lam)
11
sends
Size of rwnd indicates available space in
receive buffer
12
network congestion
Congestion indications
timeout (loss)
dupACK (loss likely)
queueing delay
mark (needs ECN)
13
xi(t)
14
Others
15
Slow Start
Start with cwnd = 1
On each successful ACK, increment cwnd
cwnd cwnd + 1
16
Slow Start
sender
receiver
cwnd
1
1 RTT
2
data packet
ACK
3
4
5
6
7
8
17
Congestion Avoidance
sender
receiver
cwnd
1
cwnd ssthresh
data packet
ACK
CA starts when
1 RTT
On each successful
ACK:
cwnd cwnd + 1/cwnd
each RTT:
cwnd cwnd + 1
TCP Congestion Control (Simon Lam)
18
Packet Loss
Assumption: loss indicates congestion
Packet
P k t loss
l
detected
d t t db
by
Packets
Acknowledgements
19
Fast Retransmit
A timeout is quite long (> RTT)
Upon
p receiving
g 3 dupACKs,
p
, immediately
y
Adjusts ssthresh
ssthresh max(flightsize/2, 2)
where
h
flightsize
fli htsiz is numb
number of
f outstanding
utst ndin p
packets,
ck ts
which may be less than W = min(rwnd, cwnd)
Enter Slow Start (cwnd = 1)
TCP Congestion Control (Simon Lam)
20
10
TCP Tahoe
(Jacobson 1988)
cwnd
SS
time
(in RTTs)
CA
21
Successive Timeouts
When there is another timeout, double the
timeout value
Keep doing so for each additional lossretransmission
Exponential backoff up to
max timeout value equal
to 64 times initial timeout
value
22
11
Summary: Tahoe
Basic ideas
Probe network for spare capacity during SS and
CA and increase send rate
Drastically reduce rate on congestion indication
Self-clocking
Error recovery by retransmission
Round trip time estimation (to get TO value)
for every ACK {
if (W < ssthresh) then W++
(SS)
else W += 1/W
(CA)
}
for every loss indication {
ssthresh = W/2
W = 1
}
TCP Congestion Control (Simon Lam)
TCP Tahoe
23
(Jacobson 1988)
cwnd
SS
time
CA
24
12
TCP Reno
(Jacobson 1990)
cwnd
SS
time
CA
25
3 dupACKs
halved
Initial slow start
26
13
successfully received.
received Therefore,
Therefore no need for
very drastic action
Enter FR/FR after 3 dupACKs
Enter CA
TCP Congestion Control (Simon Lam)
27
Example: FR/FR
S 1 2 3 4 5 6 7 8
9 10 11
time
Exit FR/FR
cwnd 8
ssthresh
7
4
time
0 0 0 0 0 0 0
9
4
11
4
4
4
4 are received;
i d dupACKs
d ACK with
i h seq. no. 0 returned
d
Fast retransmit
Retransmit on 3 dupACKs
Fast recovery
Inflate window such that new packets 9, 10, and 11 can be
sent while repairing loss
28
14
Summary: Reno
Basic ideas
Fast recovery avoids slow start
dupACKs: fast retransmit + fast recovery
Timeout: fast retransmit + slow start
dupACKs
congestion
avoidance
FR/FR
timeout
slow start
retransmit
TCP Congestion Control (Simon Lam)
29
multiplicative decrease:
cut cwnd in half after
3 dupACKs
congestion
window
24 Kbytes
16 Kbytes
8 Kbytes
time
30
15
throughput =
W
packets/sec
RTT
W changes with the arrival of each
congestion indication
To calculate
l l
(average)
(
) send
d rate, we need
d
the average value of W
Q: W is a function of what parameter?
TCP Congestion Control (Simon Lam)
31
First approximation
connection
Independent identically distributed periods
Each packet may be lost with probability p
32
16
Geometric Distribution
ibi i (1 p)i1 p
i 1
i 1
p i (1 p )i 1
i 1
d
d
(1 p )i p
dp i 1
dp
d
1
1
p
p 2
dp 1 1 p
p
1/ p
p
(1 p)
i 0
33
W 1 W 3 2
W
2 2 2 8
Average number of
packets
k
sent per period
i d
(incl. loss at the end) is
1/p
Equating the two and
solving for W, we get
8
3p
1/ p
1
2 RTT
RTT
3p
3 2
W
8
W
RTT
2
3
2p
34
17
Event at Receiver
Arrival of out
out-of-order
of order segment
higher-than-expect seq. # .
Gap detected
35
Send rate is
1
RTT
i
is
1
RTT
3
4p
3
2bp
TCP Congestion Control (Simon Lam)
36
18
Modeling
M
d li TCP Throughput:
Th
h t A Si
Simple
l
Model and its Empirical Validation,
Proc. ACM SIGCOMM, 1998
Jitendra Padhye, Victor Firoiu,
D Towsley,
Don
T
l
and
d Jim
Ji Kurose
K
Motivation
Previous formulas not so accurate when
38
19
Objectives
More accurate steady-state throughput
39
40
20
Start of round
time
Approximation: For
b > 1, ACK is not
received
immediately after
one RTT, but it is so
assumed in the
analysis
End of round
space
41
window size
42
21
B lim Bt lim
t
N t E[Yi ] E[Y ]
t
E[ Ai ] E[ A]
43
when ACK of
last packet is
received
b packets (b = 2 in above
figure) -> linear increase has a slope of 1/b packet per
RTT
Number of rounds is Xi +1
One ACK after receiving
44
22
Loss assumptions
A7. Losses in different rounds are
independent
approximation
45
E[ ] 1/ p
E[r] RTT
E[Y ] E[ ] E[W ] 1
From Wi
1
1 E[W ]
p
Wi1 Xi
, we have
b
2
b
E[ X ] E[W ]
2
b
E[ A] (E[ X ] 1)E[r] ( E[W ] 1)RTT
2
1
1 E[W ]
E[Y ]
p
send rate B
E[ A] ( b E[W ] 1)RTT
2
46
23
X i / b 1
Wi 1
k )b i
2
k 0
XW
X X
i i 1 i ( i 1) i
2
2 b
X
W
i (Wi i 1 1) i
2
2
W
Let E[ ] be E[ ] and we have
2
E[ X ]
E[W ]
E[Y ]
( E[W ]
1) E[ ]
2
2
bE[W ]
E[W ]
W
( E[W ]
1) E[ ]
4
2
2
Yi
47
1
1 E [W ]
p
b E [W ]
E [W ]
W
( E [W ]
1) E [ ]
4
2
2
E [Y ]
E [W ]
2b
3b
se n d ra te
8(1 p )
2b 2
)
(
3b p
3b
1 p
E [W ]
p
B( p)
E [ A]
48
24
E[W ]
8
o(1/ p )
3bp
b
2b
E[ X ] E[W ]
o(1/ p )
2
3p
send rate B( p)
1/ p o(1/ p)
1
3
o(1/ p )
2b
RTT 2bp
o(1/ p )
RTT
3p
49
AIMD with TO
50
25
Assumption of
Markov
regenerative
process again.
E[ S ] E[n]E[ A] E[ Z TO ]
E[ M ]
E[n]E[Y ] E[ R]
send rate B
E[ S ] E[n]E[ A] E[ Z TO ]
E[Y ] Q E[ R]
B
E[ A] Q E[ Z TO ]
1
where Q
<- Probability
P b bilit th
thatt a
E[n]
given loss
1
E[ R]
indication is a TO
1 p
with Q and E[ Z TO ] to be determined
TCP Congestion Control (Simon Lam)
51
52
26
(1 p ) k p
A( w, k )
1 (1 p ) w
C (k , m ) (1 p ) m p,
m k 1
C (k , m ) (1 p ) m ,
mk
( w) 1
Q
if w 3
53
Q is
( w)]
E[Q
Q Q ( E[W ]) min(1,
E[W ]
) min(1,3
54
27
for k 1, 2,...
for k 6
for k 7
<- duration of k
TOs in a row
1 p 2 p 2 4 p 3 8 p 4 16 p 5 32 p 6
1 p
f ( p)
<- approximation
TO
T0 (1 32 p 2 )
1 p
E[Y ] Q E[ R ]
sendd rate B ( p )
E[ A] Q E[ Z TO ]
1 p
( E[W ]) 1
E[W ] Q
p
1 p
B( p)
( E[W ])T f ( p )
RTT ( E[ X ] 1) Q
O
1 p TCP Congestion Control (Simon Lam)
E[ Z TO ] TO
55
2b
3bp
2
RTT
min 1,3
(1 32 p )T0
3
p
8
1
<-Eq. (29)
2bp
3bp
2
most wellRTT
min 1,3
p(1 32 p )T0
known version
3
8
of throughput
formula
TCP Congestion Control (Simon Lam)
56
28
1 p
( E[W ]) 1
E[W ] Q
p
1 p
B( p)
if E[W] <Wmax,
( E[W ])T f ( p)
RTT ( E[ X ] 1) Q
O
1 p
1 p
(W ) 1
Wmax Q
otherwise, use Wmax for
max
p
1 p
E[W] and recompute
B( p)
b
1 p
f ( p)
E[X]
2) Q(Wmax )TO
RTT ( Wmax
8
1 p
pWmax
(derivation omitted)
TCP Congestion Control (Simon Lam)
57
B( p ) min(
Wmax
,
RTT
1
2bp
3bp
2
RTT
min 1,3
p (1 32 p )T0
8
3
58
29
sender
p computed
from dividing
total no. of loss
indications by
total number of
packets sent
RTT and TO
values are
averaged over
entire 1-hour
trace
TCP Congestion Control (Simon Lam)
59
60
30
61
Wmax = 33
Wmax=44
TCP Congestion Control (Simon Lam)
62
31
Wmax=8
Wmax=48
TCP Congestion Control (Simon Lam)
63
64
32
Average errors
ave. error
N predicted N observed
N observed
no. of observations
observations
65
Conclusions
A much more rigorous analysis than the one by
Mathis et al.
Numerous assumptions and approximations used
but (almost) all of them are explicitly stated
Large amount of experimental measurements on
the Internet to validate accuracy of the full model
(less for the approximate model)
Throughput formula accounts for loss indications
due to TO as well as rwnd restriction
Using
U
i the
h formula
f
l requires
i
accurate measurements of
f
loss rate and RTT values (which could be tricky)
For TCP Reno and drop-tail router
66
33
RTT p
Example: 1500-byte segments, 100ms RTT,
67
68
The End
34