Professional Documents
Culture Documents
TCP Congestion Control
TCP Congestion Control
TCP Congestion Control
W MSS
= bytes/sec
(assuming no loss, MSS denotes maximum segment size)
W MSS
RTT
p
RTT
W changes with the arrival of each
congestion indication
T l l t ( ) d t d To calculate (average) send rate, we need
the average value of W
Q: W is a function of what parameter?
30
Q: W is a function of what parameter?
TCP Congestion Control (Simon S. Lam)
31
First approximation
M. Mathis, et al., The Macroscopic Behavior of the TCP Congestion
Avoidance Algorithm,ACM Computer Communicatons Review, 27(3), 1997.
No slow-start, no timeout, long-lived TCP
c nn cti n connection
Independent identically distributed periods
Three dupACKs are received in a round with Three dupACKs are received in a round with
probability p
Ave.
31 TCP Congestion Control (Simon S. Lam)
# of RTTs
32
Geometric Distribution
Ave no of transmissions to get first triple dupACKs Ave. no. of transmissions to get first triple dupACKs
1
(1 )
i
i
n ib i p p
= =
1 1
1
1
(1 )
i i
i
i
p i p
= =
=
=
1
1 0
(1 ) (1 )
i
i i
i i
d d
p p p p
dp dp
= =
= =
2
1 1
1 1
1/
d
p p
dp p p
= =
+
1/ p =
Aside: ave no of transmissions to get first success is 1/(1 p)
32
Aside: ave. no. of transmissions to get first success is 1/(1-p)
TCP Congestion Control (Simon S. Lam)
33
First approximation (cont.) F rst approx mat on (cont.)
send rate (in packets/sec)
Average number of
packets delivered in
2
3
no. of packets/period
8
timeper period
W
W
RTT
= =
| |
|
packets delivered in
one period (area under
one saw-tooth)
2 2
2
1 3
2 2 2 8
W W
W
| | | |
+ =
| |
\ . \ .
time per period
2
1/ 1 3
RTT
p
| |
|
\ .
= =
2
2
3
RTT p
RTT
p
= =
| |
|
\ .
Average number of
packets sent per period is
1/p
Equate the two and solve
f W t
33
for W, we get
TCP Congestion Control (Simon S. Lam)
8
3
W
p
=
34
TCP ACK generation [RFC 1122, RFC 2581] TCP ACK generat on [RFC , RFC 58 ]
Event at Receiver TCP Receiver action
Arrival of in-order segment with
expected seq #. All data up to
expected seq #alreadyACKed
Delayed ACK. Wait up to 500ms
for next segment. If no next segment,
sendACK expected seq #already ACKed
Arrival of in-order segment with
expected seq #. One other
send ACK
Immediately send single cumulative
ACK, ACKing both in-order segments
segment has ACK pending
Arrival of out-of-order segment
higher-than-expect seq #
Immediately send duplicate ACK,
indicating seq. #of next expected byte higher than expect seq. #.
Gap detected
Arrival of segment that
ti ll l t l fill
indicating seq. #of next expected byte
Immediate send ACK, provided that
t t t t l d f
34
partially or completely fills gap segment starts at lower end of gap
TCP Congestion Control (Simon S. Lam)
35
Receiver implements Delayed ACKs mp m D y K
Receiver sends one ACK for every two packets
received -> each saw-tooth is WxRTT wide
d h
2
-> area under a saw-tooth is
2
3 1
4
W
p
=
Send rate is
1/ 1/ 1 3
4
4/ (3 )
p p
RTT W RTT p
RTT p
= =
One ACK for every b packets received -> send rate
is
( )
p
p
1 3
2 RTT bp
35
p
TCP Congestion Control (Simon S. Lam)
36
A more detailed model
Reference:
J. Padhye, V. Firoiu, D. Towsley, and J. Kurose, Modeling TCP
Th h t A Si l M d l d it E i i l V lid ti Throughput: A Simple Model and its Empirical Validation,
Proceedings ACM SIGCOMM, 1998.
TCP Congestion Control (Simon S. Lam) 36
37
Motivation Mot vat on
Previous formulas not so accurate when Previous formulas not so accurate when
loss rates are high
TCP traces show that there are more loss m
indications due to timeouts (TO) than due
to triple dupACKs (TD)
37 TCP Congestion Control (Simon S. Lam)
38
Objectives Object ves
More accurate steady-state throughput formula y g p
as a function of loss (indication) rate and RTT by
also accounting for TO behavior of a TCP
connection connection
Formula applicable over a wider range of loss rates
E li it t t t f ti d Explicit statements of assumptions and
approximations used in derivation of throughput
formula
Formula to include the impact of a small rwnd
38 TCP Congestion Control (Simon S. Lam)
39
Many assumptions and
i ti s approximations
A1. TCP sender is saturated, i.e., source A1. TCP sender is saturated, i.e., source
application process always has a packet to
send when send window has space available
bulk transfer application
A2. Slow Start not modeled
A3. Time to send all packets in a window is
smaller than RTT
transmission rate is not too low
39 TCP Congestion Control (Simon S. Lam)
40
AIMD evolution of Window Size over time
E h TD i d i d d b TD l i di ti Each TD period is ended by a TD loss indication.
TDP
i
period has duration A
i
RTTs
A4. Duration of a round (RTT) is independent of window size
f l l poor assumption for a slow line
A5. No window inflation in Fast Recovery
A6. Assume {W
i
} to be a Markov regenerative process with
d {Y} h Y i th b f k t t i TDP
40
rewards {Y
i
}, where Y
i
is the number of packets sent in TDP
i
TCP Congestion Control (Simon S. Lam)
41
Loss assumptions Loss assumpt ons
A7. Losses in different rounds are ff
independent
A8. Losses within the same round are
l t d f ll If k t i l t correlated as follows: If a packet is lost,
all remaining packets transmitted until the
end of that round are also lost end of that round are also lost
41 TCP Congestion Control (Simon S. Lam)
42
AIMD throughput (send rate)
1/ (1/ ) 1 3
send rate ( ) (1/ )
2
2
(1/ )
p o p
B p o p
RTT bp
b
RTT
+
= ~ +
| |
|
(1/ )
3
p
RTT o p
p
+
|
\ .
42 TCP Congestion Control (Simon S. Lam)
43
AIMD with Timeouts
Let X +1 denote number of RTTs in jth period of Z
TD
Let X
ij
+1 denote number of RTTs in jth period of Z
i
TD
A9. Assume that {X
ij
} and {W
ij
} are mutually
independent i.i.d. sequences of random variables
Let Y
ij
denotes number of packets sent in jth period
of Z
i
TD
43
of Z
i
TCP Congestion Control (Simon S. Lam)
44
AIMD with Timeouts (cont.)
Let n
i
denote the number of TD periods within a cycle which
i
p y
ends in i -th TO period, R
i
denote no. of retransmissions in i-
th TO period
A10. {n
i
} form an i.i.d. sequence, independent of {Yij} and
{Aij} {Aij}
1 1
,
i i
TO
ij i ij i
n n
i i
j j
R S A Z M Y
= =
+ + = =
44 TCP Congestion Control (Simon S.
Lam)
1 1 j j
45
Throughput of AIMD with TO
[ ] [ ] [ ] [ ] E M E E Y E R + [ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]
TO
E M E n E Y E R
E S E n E A E Z
E M E n E Y E R
= +
= +
+
Assumption of Markov
regenerative process
[ ] [ ] [ ] [ ]
send rate
[ ] [ ] [ ] [ ]
TO
E M E n E Y E R
B
E S E n E A E Z
+
= =
+
again.
[ ] [ ] E Y Q E R +
<- Probability that a
[ ] [ ]
[ ] [ ]
1
h
TO
E Y Q E R
B
E A Q E Z
Q
+
=
+
Probability that a
given loss indication is
a TO
where
[ ]
Q
E n
1
[ ] E R [ ]
1
with and [ ] to be determined
TO
E R
p
Q E Z
=
1 1
[ ] ( [ ])
1
( )
p
E W Q E W
p p
B
+ +
1
( )
( )
( [ ] 1) ( [ ])
1
O
p p
B p
f p
RTT E X Q E W T
p
+ +
q ( )
more accurate
version of
throughput throughput
formula
2
0
1/
2 3
min 1,3 (1 32 )
p
b bp
RTT p T
| | | |
+ +
| |
<-Eq. (29)
0
min 1,3 (1 32 )
3 8
RTT p T
p
+ +
| |
\ . \ .
1
2 3 b b
=
| | | |
Eq. ( 9)
most well-
known version
of throughput
2
0
2 3
min 1,3 (1 32 )
3 8
bp bp
RTT p p T
| | | |
+ +
| |
\ . \ .
46
of throughput
formula
TCP Congestion Control (Simon S. Lam)
47
Impact of receivers flow control
li it ti i t d l limitationapproximate model
Using the well-known Eq. (29) from before, Using the well known Eq. (29) from before,
max
1
( ) min( , )
W
B p
RTT
b b
| | | |
2
0
2 3
min 1,3 (1 32 )
3 8
where isthemaximumwindowsizeallowedbyreceiver
RTT
bp bp
RTT p p T
W
| | | |
+ +
| |
\ . \ .
The above is Eq (32) referred to as the
max
where is the maximum window size allowed by receiver W
The above is Eq. (32) referred to as the
approximate model. The full model is Eq. (31)
in the paper.
47
in the paper.
TCP Congestion Control (Simon S. Lam)
48
Summary data from traces (1 hour)
Saturated TCP
sender
p computed
from dividing
total no of loss total no. of loss
indications by
total number of
packets sent packets sent
RTT and T
O
values are
averaged over averaged over
entire 1-hour
trace
48 TCP Congestion Control (Simon S. Lam)
49
Summary data from 100s traces mm y f m
Each row represents results of 100 traces each Each row represents results of 00 traces each
100 seconds long for same S-D pair
Totals are cumulative over 100 traces
49
RTT and T
O
are average values over 100 traces for
same S-D pair
TCP Congestion Control (Simon S. Lam)
50
Experimental comparison (1)
rwnd
p p ( )
Each point represents number of packets in 100s interval of trace
T0 ~ single TO, T1 ~ at least 1 double TO in trace, etc.
TD O l i l ti d l b M thi t l
50
TD Only is analytic model by Mathis et al.
Note: W
max
is only 6 in Figure 7
TCP Congestion Control (Simon S. Lam)
51
Experimental comparison (2)
W 33 W 44 W
max
= 33 W
max
=44
51 TCP Congestion Control (Simon S. Lam)
52
Experimental comparison (3)
W
max
=8 W
max
=48
52 TCP Congestion Control (Simon S. Lam)
53
Accuracy of approximate model
Figure 18: manic to spiff, with predictions by both full and
approximate models (W
max
=32)
53
pp
max
TCP Congestion Control (Simon S. Lam)
54
Average errors
ave error
predicted observed
observations
observed
N N
N
=
54
ave. error
no. of observations
=
TCP Congestion Control (Simon S. Lam)
55
Conclusions
A more detailed analysis than the one by Mathis et al.
Numerous assumptions and approximations used but
(almost) all of them are explicitly stated (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 to TO as well as rwnd restriction
Using the formula requires accurate measurements of loss
rate and RTT values (which could be tricky)
F TCP R d d t il t For TCP Reno and drop-tail router
Accuracy (like beauty) is in the eye of the beholder.
What do you think?
55
y
TCP Congestion Control (Simon S. Lam)
56
Challenge in the future g f
TCP average throughput (approximate) in terms of
loss (indication) rate, p
1.22 MSS
RTT p