Professional Documents
Culture Documents
L-4 TCP
TCP Basics
TCP reliability
Congestion control basics
TCP congestion control
Assigned reading
Srinivasan
L -4; 10-7-
Sequence numbers
Srinivasan
L -4; 10-7-
Overview
TCP modeling
Srinivasan
L -4; 10-7-
Introduction to TCP
Communication abstraction:
Reliable
Ordered
Point-to-point
Byte-stream
Full duplex
Flow and congestion controlled
Fate sharing
Srinivasan
L -4; 10-7-
Evolution of TCP
1984
Nagels algorithm
to reduce overhead
of small packets;
predicts congestion
collapse
1975
Three-way handshake
Raymond Tomlinson
In SIGCOMM 75
1983
BSD Unix 4.2
supports TCP/IP
1974
TCP described by
Vint Cerf and Bob Kahn
In IEEE Trans Comm
1986
Congestion
collapse
observed
1982
TCP & IP
RFC 793 & 791
1975
1980
Srinivasan
1987
Karns algorithm
to better estimate
round-trip time
1985
L -4; 10-7-
1990
4.3BSD Reno
fast retransmit
delayed ACKs
1988
Van Jacobsons
algorithms
congestion avoidance
and congestion control
(most implemented in
4.3BSD Tahoe)
1990
1993
TCP Vegas
(Brakmo et al)
real congestion
avoidance
1993
1994
ECN
(Floyd)
Explicit
Congestion
Notification
1994
Srinivasan
1996
SACK TCP
(Floyd et al)
Selective
Acknowledgement
1996
Hoe
Improving TCP
startup
1996
FACK TCP
(Mathis et al)
extension to SACK
1996
L -4; 10-7-
Variable RTT
Reordering
Transmission rate
Srinivasan
L -4; 10-7-
Timeout-based Recovery
Wait at least one RTT before retransmitting
Importance of accurate RTT estimators:
Spurious timeouts
Srinivasan
L -4; 10-7-
Srinivasan
L -4; 10-7-
10
Key observation:
Solution:
Srinivasan
L -4; 10-7-
11
Retransmission Ambiguity
B
Original tran
sm
retran
s
missio
n
B
Original tran
sm
ission
RTO
Sample
RTT
RTO
Sample
RTT
ission
ACK
retran
sm
ission
ACK
Srinivasan
L -4; 10-7-
12
Srinivasan
L -4; 10-7-
13
Timestamp Extension
Srinivasan
L -4; 10-7-
14
Timer Granularity
Many TCP implementations set RTO in
multiples of 200,500,1000ms
Why?
Srinivasan
L -4; 10-7-
15
Delayed ACKS
Problem:
Solution:
Srinivasan
L -4; 10-7-
16
Overview
TCP modeling
Srinivasan
L -4; 10-7-
17
TCP Flavors
Tahoe, Reno, Vegas differ in data-driven
reliability
TCP Tahoe (distributed with 4.3BSD Unix)
Slow start
Congestion avoidance
Fast retransmit
Srinivasan
L -4; 10-7-
18
Fast Retransmit
Srinivasan
L -4; 10-7-
19
Fast Retransmit
X
Sequence No
Retransmission
Duplicate Acks
Time
Srinivasan
L -4; 10-7-
20
Multiple Losses
X
X
X
X
Sequence No
Now what?
Retransmission
Duplicate Acks
Time
Srinivasan
L -4; 10-7-
21
Tahoe
X
X
X
X
Sequence No
Time
Srinivasan
L -4; 10-7-
22
Delayed acks
Header prediction
Srinivasan
L -4; 10-7-
23
Reno
X
X
X
X
Sequence No
Time
Srinivasan
L -4; 10-7-
24
NewReno
The ack that arrives after retransmission
(partial ack) should indicate that a second
loss occurred
When does NewReno timeout?
Srinivasan
L -4; 10-7-
25
NewReno
X
X
X
X
Sequence No
Time
Srinivasan
L -4; 10-7-
26
SACK
Srinivasan
L -4; 10-7-
27
SACK
X
X
X
X
Sequence No
Time
Srinivasan
L -4; 10-7-
28
Performance Issues
Need 3 dupacks/sacks
Not great for small transfers
Srinivasan
L -4; 10-7-
29
Overview
TCP modeling
Srinivasan
L -4; 10-7-
30
Congestion
10 Mbps
1.5 Mbps
100 Mbps
31
Srinivasan
L -4; 10-7-
32
Srinivasan
L -4; 10-7-
33
Congestion Collapse
Undelivered packets
Srinivasan
L -4; 10-7-
34
Fragments
Control traffic
Srinivasan
L -4; 10-7-
35
Srinivasan
L -4; 10-7-
36
A mechanism which:
Srinivasan
L -4; 10-7-
37
Overview
TCP modeling
Srinivasan
L -4; 10-7-
38
Objectives
Simple router behavior
Distributedness
Efficiency: Xknee = xi(t)
Fairness: (xi)2/n(xi2)
Power: (throughput/delay)
Convergence: control system must be
stable
Srinivasan
L -4; 10-7-
39
Srinivasan
L -4; 10-7-
40
Linear Control
Increase/decrease additively
Increased/decrease multiplicatively
Which of the four combinations is optimal?
Srinivasan
L -4; 10-7-
41
Phase plots
User 2s
Allocation
x2
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
42
Phase plots
What are desirable properties?
What if flows are not equal?
Fairness Line
Overload
User 2s
Allocation
x2
Optimal point
Underutilization
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
43
Additive Increase/Decrease
T1
User 2s
Allocation
x2
T0
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
44
Multiplicative Increase/Decrease
T1
User 2s
Allocation
x2
T0
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
45
Convergence to Efficiency
Fairness Line
xH
User 2s
Allocation
x2
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
46
a=0
b=1
Fairness Line
xH
User 2s
Allocation
x2
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
47
Convergence to Fairness
Fairness Line
xH
User 2s
Allocation
x2
xH
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
48
Fairness Line
xH
User 2s
Allocation
x2
xH
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
49
Increase
Fairness Line
User 2s
Allocation
x2
xL
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
50
Constraints
Distributed efficiency
ai > 0 & bi 1
Similarly, ad < 0 & bd 1
a & bs must be 0
ai/bi > 0 and ad/bd 0
Full constraints
Srinivasan
L -4; 10-7-
51
x1
User 2s
Allocation
x2
x0
x2
Efficiency Line
User 1s Allocation x1
Srinivasan
L -4; 10-7-
52
Overview
TCP modeling
Srinivasan
L -4; 10-7-
53
Srinivasan
L -4; 10-7-
54
Reaching equilibrium
Slow start
Accurate RTO estimation
Fast retransmit
Congestion avoidance
Srinivasan
L -4; 10-7-
55
AIMD
Packet conservation
Reaching steady state quickly
ACK clocking
Srinivasan
L -4; 10-7-
56
AIMD
Factor of 2
Rate
Srinivasan
L -4; 10-7-
Time
57
Implementation Issue
Srinivasan
L -4; 10-7-
58
Congestion Avoidance
Implements AIMD
Srinivasan
L -4; 10-7-
59
Sequence No
Packets
Acks
Srinivasan
Time
L -4; 10-7-
60
Packet loss
+ Timeout
Srinivasan
Cut
Congestion
Window
and Rate
L -4; 10-7-
Grabbing
back
Bandwidth
Time
61
Packet Conservation
Srinivasan
L -4; 10-7-
62
Receiver
As
Srinivasan
Ab
L -4; 10-7-
Ar
63
Srinivasan
L -4; 10-7-
64
Initialize cwnd = 1
Upon receipt of every
ack, cwnd = cwnd + 1
Implications
Window actually
increases to W in RTT *
log2(W)
Can overshoot window
and cause packet loss
Srinivasan
L -4; 10-7-
65
1R
2
3
2R
4
5
3R
6
7
5
8
9
Srinivasan
10
11
12
13
14
15
L -4; 10-7-
66
Sequence No
Packets
Acks
Srinivasan
Time
L -4; 10-7-
67
Srinivasan
L -4; 10-7-
68
Initial
Slowstart
Srinivasan
Timeouts
may still
occur
Slowstart
to pace
packets
Fast
Retransmit
and Recovery
L -4; 10-7-
Time
69
Srinivasan
L -4; 10-7-
70
Fast Recovery
Each duplicate ack notifies sender that
single packet has cleared network
When < cwnd packets are outstanding
Behavior
Srinivasan
L -4; 10-7-
71
Fast Recovery
Sequence No
Srinivasan
Time
L -4; 10-7-
72
NewReno Changes
Srinivasan
L -4; 10-7-
73
Sequence No
Srinivasan
Time
L -4; 10-7-
74
Srinivasan
L -4; 10-7-
75
Overview
TCP modeling
Srinivasan
L -4; 10-7-
76
TCP Modeling
Loss rate
RTT
RTO
MSS
Srinivasan
L -4; 10-7-
77
Window
Time
Srinivasan
L -4; 10-7-
78
Fixed RTT
No delayed ACKs
Srinivasan
L -4; 10-7-
79
Srinivasan
L -4; 10-7-
80
TCP Friendliness
Srinivasan
L -4; 10-7-
81
TCP Performance
Srinivasan
L -4; 10-7-
82
If an ACK is received:
If a packet is lost:
Source
Wmax
W W+1/W
W W/2
Dest
Window size
Wmax
2
Srinivasan
L -4; 10-7-
83
Srinivasan
L -4; 10-7-
84
Minimum window
for full utilization
Srinivasan
L -4; 10-7-
85
TCP Performance
Srinivasan
L -4; 10-7-
86
TCP Performance
Srinivasan
L -4; 10-7-
87
Srinivasan
L -4; 10-7-
88
Buffer
Srinivasan
L -4; 10-7-
89
Example
10Gb/s linecard
Memory technologies
Srinivasan
L -4; 10-7-
90
Rule-of-thumb
Srinivasan
L -4; 10-7-
91
max
Wmax
2
Wmax
Wmax
2
Srinivasan
L -4; 10-7-
92
Buffer Size
Srinivasan
L -4; 10-7-
Probability
Distribution
93
1
n
1
Buffer size should also decreases with n
Bn 1 2T C
B
n
n
Srinivasan
L -4; 10-7-
94
2T C
n
Simulation
Srinivasan
L -4; 10-7-
95
Important Lessons
Srinivasan
L -4; 10-7-
96
Next Lecture
Srinivasan
L -4; 10-7-
97