ELE539A: Optimization of Communication Systems Lecture 9: NUM and TCP Congestion Control
ELE539A: Optimization of Communication Systems Lecture 9: NUM and TCP Congestion Control
Professor M. Chiang
Electrical Engineering Department, Princeton University
• Reverse engineering
• How to choose step size: diminishing and constant step size rules
Network Utility Maximization
Basic NUM:
P
maximize s Us (xs )
subject to Rx c
x0
Lagrangian decomposition:
0 1
X X X
L(x, λ) = Us (xs ) + λl @cl − xs A
s l s:l∈L(s)
2 0 1 3
X X X
= 4Us (xs ) − @ λl A xs 5 + cl λl
s l∈L(s) l
X X
s
= Ls (xs , λ ) + cl λl
s l
Dual problem:
minimize g(λ) = L(x∗ (λ), λ)
subject to λ0
Dual-based Distributed Algorithm
Source algorithm:
Application Message
MSS
TCP Segment
TCP hdr TCP data
IP Packet 20 bytes
IP hdr IP data
Ethernet Frame 20 bytes
Applications Simple/Robust
Robustness against failure
TCP/IP Robustness against technological
evolutions
Transmission Provides a service to applications
Doesn’t tell applications what to do
Ethernet, ATM, POS, WDM, …
TCP Protocol
End-to-end control
Session initiation and termination
In-order recovery of packets
Flow control / congestion control
…
Why Congestion Control
• End-to-end
Window Flow Control
RTT
Source 1 2 W 1 2 W
time
data ACKs
Destination 1 2 W 1 2 W
time
Effects of congestion:
• Packet loss
• W = min(cwnd, awnd)
window
time
SS CA
3
4
5
6
7
8
ACK
2 1 RTT
Packets
1 2 3 4 5 6 7
Acknowledgements
1 2 3 3 3 3
Fast Retransmit
Wait for a timeout is quite long
Immediately retransmits after 3 dupACKs
without waiting for timeout
Adjusts ssthresh
flightsize = min(awnd, cwnd)
ssthresh ← max(flightsize/2, 2)
Enter Slow Start (cwnd = 1)
Summary: Tahoe
Basic ideas
Gently probe network for spare capacity
Drastically reduce rate on congestion
Windowing: self-clocking
Other functions: round trip time estimation, error
recovery
for every ACK {
if (W < ssthresh) then W++ (SS)
else W += 1/W (CA)
}
for every loss {
ssthresh = W/2
W = 1
}
TCP Reno (Jacobson 1990)
window
time
SS CA
window
time
SS CA
Converges, no retransmission
… provided buffer is large enough
Vegas CA algorithm
for every RTT
{ if W/RTTmin – W/RTT < α then W ++
if W/RTTmin – W/RTT > β then W -- }
for every loss
W := W/2 queue size
Queue Buffer Processes
At intermediate links:
• Drop tail updates packet loss as measure of congestion for Reno and
feeds back to sources
f
where τli is forward transmission delay
Each link updates congestion measure (shadow price) pl (t). Each source
has access to aggregate price along its route (end-to-end):
X
b
qi (t) = Rli pl (t − τli )
l
Goals: To characterize
• Fairness
Limitations:
• Average behavior
• Equilibrium properties
Utility Maximization and Equilibrium Properties
b and τ f set to 0.
At equilibrium: y ∗ = Rx∗ , q ∗ = RT p∗ . τli li
Construct source utility function Ui such that Ui′ (xi ) = fi−1 (xi ) (thus
increasing and concave)
Since (1 − qi (t))xi (t) of ACK are positive, each incrementing window size
by 1/wi (t), and qi (t)xi (t) are negative, each halfing the window, using
xi (t) = wi (t)/τi , we have
1 − qi (t) 1 2
ẋi = − qi (t)xi (t)
τi2 2
At equilibrium:
2
qi∗ =
2 + (τi x∗i )2
Using Ui′ (x∗i ) = qi∗ , utility function for TCP Reno
√
2 τ x
i i
Ui (xi ) = tan−1 √
τi 2
TCP Vegas
Window size ws
ws (t)
Propagation delay ds . Expected rate ds
ws (t)
Queuing delay qs and total delay Ds . Actual rate Ds
Source algorithm:
ws (t) ws (t)
1
w (t) + if − < αs
s Ds (t) ds Ds (t)
1 ws (t) ws (t)
ws (t + 1) = ws (t) − Ds (t)
if ds
− Ds (t)
> αs
ws (t) else.
Us (xs ) = αs ds log xs
b∗
since p∗l = l
cl
(dual variable is queuing delay)
TCP Vegas: Source-Link Algorithms
αs ds
Equilibrium: x∗s = qs
∗
TCP Reno and Vegas
Average Sending Rate for Class 4a (rtt: 30 ms) PF Average Sending Rate for Class 5a (rtt: 40 ms) PF
2000 2000
TCP Vegas Sending Rate (KB/s)
1800 1800
1600 1600
1400 1400
1200 1200
1000 1000
800 800
600 600
400 400
200 theoretical optimal rate 200 theoretical optimal rate
actual rate actual rate
0 0
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time (second) Time (second)
Numercal Example: General Cases
Average Window Size for Class 2a (rtt: 15 ms) WPF Average Window Size for Class 3a (rtt: 20 ms) WPF
25 50
45
TCP Vegas cwnd Size (KB)
Average Window Size for Class 4a (rtt: 30 ms) WPF Average Window Size for Class 5a (rtt: 40 ms) WPF
60 90
80
TCP Vegas cwnd Size (KB)
50
70
40 60
50
30
40
20 30
20
10
theoretical optimal window 10 theoretical optimal window
actual window actual window
0 0
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
Time (second) Time (second)
Stability and Dynamics
48%
Average
utilization
95%
1G
27%
16%
19%
Linux TCP Linux TCP FAST Linux TCP Linux TCP FAST
Three Meanings of the Course Title