Professional Documents
Culture Documents
Cs/ee 143 Communication Networks Chapter 4 Transport: Text: Walrand & Parakh, 2010 Steven Low CMS, EE, Caltech
Cs/ee 143 Communication Networks Chapter 4 Transport: Text: Walrand & Parakh, 2010 Steven Low CMS, EE, Caltech
Chapter 4 Transport
Text: Walrand & Parakh, 2010
Steven Low
CMS, EE, Caltech
This week
Internetworking
Routing across LANs, layer2-layer3
DHCP
NAT
Transport layer
Connection setup
Error recovery: retransmission
Congestion control
Protocol stack
Network mechanisms implemented as
protocol stack
Each layer designed separately, evolves
asynchronously
application
transport
network
Routing (IP)
link
physical
Transport services
UDP
Datagram service
No congestion control
No error/loss recovery
Lightweight
TCP
Connection oriented service
Congestion control
Error/loss recovery
Heavyweight
UDP
1 ~ 65535 (216-1)
UDP header
65535 Bytes 8 Bytes (UDP header) 20 Bytes (IP header)
Usually smaller to avoid IP fragmentation (e.g., Ethernet MTU 1500 Bytes)
TCP
TCP header
4-way handshake
1 2
time
ACKs
data
Destination
1 2
1 2
1 2
time
Selective repeat
TCP
Sender & receiver negotiate whether
or
not to use Selective Repeat (SACK)
Can ack up to 4 blocks of contiguous
bytes that receiver got correctly
Window control
Limit the number of packets in the
network to window W
W MSS
Source rate =
bps
RTT
If W too small then rate capacity
If W too big then rate > capacity
=> congestion
TCP Tahoe
(Jacobson 1988)
window
time
SS
CA
: Slow Start
: Congestion Avoidance
: Threshold
Slow Start
Start with cwnd = 1 (slow start)
On each successful ACK increment cwnd
cwnd cnwd + 1
Exponential growth of cwnd
each RTT: cwnd 2 x cwnd
Enter CA when cwnd >= ssthresh
Congestion Avoidance
Starts when cwnd ssthresh
On each successful ACK:
cwnd
cwnd + 1/cwnd
Linear growth of cwnd
each RTT: cwnd cwnd + 1
Packet Loss
Assumption: loss indicates congestion
Packet loss detected by
Retransmission TimeOuts (RTO timer)
Duplicate ACKs (at least 3) (Fast Retransmit)
Packets
Acknowledgements
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
TCP Reno
(Jacobson 1990)
SS
CA
(AI)
(MD)
Fast recovery
Idea: each dupACK represents a packet
having left the pipe (successfully
received)
Enter FR/FR after 3 dupACKs
Set ssthresh max(flightsize/2, 2)
Retransmit lost packet
Set cwnd ssthresh + ndup (window
inflation)
Wait till W=min(awnd, cwnd) is large
enough; transmit new packet(s)
On non-dup ACK, set cwnd ssthresh
(window deflation)
Enter CA
Example: FR/FR
S 1 2 3 4 5 6 7 8
9 10 11
time
Exit FR/FR
0 0 0 0 0 0 0
cwnd
8
ssthresh
7
4
time
8
9
4
11
4
4
4
Fast retransmit
Retransmit on 3 dupACKs
Fast recovery
Inflate window while repairing loss to fill pipe
Summary: Reno
Basic ideas
dupACKs: halve W and avoid slow start
dupACKs: fast retransmit + fast recovery
Timeout: slow start
dupACKs
congestion
avoidance
FR/FR
timeout
slow start
retransmit
S 1 2 3 4 5 6 7 8 9 0
D
1
0
0
8
2
9
time
time
timeout
8 unackd pkts
New Reno
Model: Reno
f or
{
f or
{
x i ( t ) (1 q i ( t ) )
wi
w i(t)
xi(t)qi(t)
2
Model: Reno
f or
{
f or
{
throughput
x i ( t ) (1 q i ( t ) )
w i(t)
window size
w i(t)
xi(t)qi(t)
2
qi(t)
round-trip
loss probability
R li p l ( t )
l
link loss
probability
Model: Reno
f or
{
f or
{
x i ( t ) (1 q i ( t ) )
w i(t)
xi
xx
1) 2
qi(t)
i ( t i (t)
Ti
2
! ## " # #$
1
Steady state:
F i x i ( t2
),qi ( t)
xi
Ti qi
Fair? Unfair?
w i(t)
xi(t)qi(t)
2
U ses:
w i(t)
xi(t)
Ti
qi(t) 0
time
SS
CA
Congestion avoidance
Each source estimates number of its own
packets in pipe from RTT
Adjusts window to maintain estimate #
of packets in queues between and
for every RTT
{
if W/RTTmin W/RTT < RTTmin then W ++
if W/RTTmin W/RTT > RTTminthen W -}
for every loss
W := W/2
Implications
Congestion measure = end-to-end
queueing delay
At equilibrium
Zero loss
Stable window at full utilization
Nonzero queue, larger for more sources
Convergence to equilibrium
Converges if sufficient network buffer
Oscillates like Reno otherwise
Summary
UDP header/TCP header
TCP 3-way/4-way handshake
ARQ: Go-back-N/selective repeat
Tahoe/Reno/New Reno/Vegas/FAST
-- useful details for your project
Simply model of AIMD
40