Transport Layer
Transport Layer
Transport Layer
Layer
Raj Jain
Washington University in Saint Louis
Saint Louis, MO 63130
Jain@wustl.edu
Audio/Video recordings of this lecture are available on-line at:
http://www.cse.wustl.edu/~jain/cse473-09/
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-1
Overview
Transport Layer Design Issues:
Multiplexing/Demultiplexing
Flow control
Error control
UDP
TCP
Header format, connection management, checksum
Slow Start Congestion Control
Note: This class lecture is based on Chapter 3 of the textbook
(Kurose and Ross) and the figures provided by the authors.
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-2
Overview
Transport Layer Design Issues
1. Transport Layer Functions
2. Multiplexing and Demultiplexing
3. Error Detection: Checksum
4. Flow Control
5. Efficiency Principle
6. Error Control: Retransmissions
Internetwork IP
Host to
Ethernet Point-to-Point Wi-Fi
Network
wraparound 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1
sum 1 1 0 1 1 1 0 1 1 1 0 1 1 1 1 0 0
checksum 1 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
At receiver the checksum is zero.
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-8
Flow Control
Flow Control Goals:
1. Sender does not flood the receiver,
2. Maximize throughput
Stop and Wait Flow Control Window Flow Control
Sender Receiver Sender Receiver
Pkt 1
Ack
Pkt 2
Ack
Pkt 3
Ack Large RTT
⇒ Low Thruput
L/R W L/R
Throughput = Throughput =
RTT+L/R RTT+L/R
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-9
Sliding Window Diagram
L/R tframe 1
U = = =
RTT + L / R 2tprop+tframe 2α + 1
Here, α = tprop/tframe
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-11
Sliding Window Protocol Efficiency
W tframe
U=
2tprop+tframe
tframe Data
tprop W
= 2α+1
1 if W>2α+1
Ack
Here, α = tprop/tframe
Note: The textbook uses RTT in place of tprop and L/R for tframe
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-13
Effect of Window Size
α
Larger window is better for larger α
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-14
Efficiency Principle
For all protocols, the maximum utilization (efficiency)
is a non-increasing function of α.
Not Possible
Best
Max possible
Utilization Protocol 1
Protocol 2
α
tprop Distance/Speed of Signal
α= =
tframe Bits Transmitted /Bit rate
Distance × Bit rate
=
Bits Transmitted × Speed of Signal
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-15
Error Control: Retransmissions
Retransmit lost packets ⇒ Automatic Repeat reQuest (ARQ)
0
1
2
3
4
Timeout 5
6
7
Ack
0
U=
1
W/(2α+1) { W> 2α+1
W< 2α+1
Stop and Wait ARQ: U = (1-P)/(1+2α)
Go-back-N ARQ: P = Probability of Loss
U= { (1-P)/(1+2αP)
W(1-P)/[(2α+1)(1-P+WP)] W< 2α+1
W> 2α+1
U=
(1-P)
{
W(1-P)/(2α+1)
W> 2α+1
W< 2α+1
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-20
Performance Comparison
1.0
W= 127 Selective-repeat
Utilization
0.6
0.2
0.0
0.1 1 10 100 1000
α More bps or longer distance
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-21
Transport Layer Design Issues
Check-
Window Urgent Options Pad Data
sum
16 16 16 x y Size in bits
Data
350
300
250
RTT (milliseconds)
200
150
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
Probability
Very low probability
of false timeout
Value
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-37
Research on Congestion Control
1Mbps 1Mbps 1Mbps 1Mbps 10Mbps 1Mbps Bit in header
Time=6 minutes Time=6 hours
Early 1980s Digital Equipment Corporation (DEC) introduced Ethernet
products
Noticed that throughput goes down with a higher-speed link in middle
(because no congestion mechanisms in TCP)
Results:
1. Timeout ⇒ Congestion
⇒ Reduce the TCP window to one on a timeout [Jain 1986]
2. Routers should set a bit when congested (DECbit).
[Jain, Ramakrishnan, Chiu 1988]
3. Introduced the term “Congestion Avoidance”
4. Additive increase and multiplicative decrease (AIMD principle)
[Chiu and Jain 1989]
There were presented to IETF in 1986.
⇒ Slow-start based on Timeout and AIMD [Van Jacobson 1988]
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-38
AIMD Principle
Additive Increase, Multiplicative
Efficient Fair
Decrease
W1+W2 = Capacity
⇒ Efficiency,
W1=W2 ⇒ Fairness C
(W1,W2) to (W1+DW,W2+DW)
⇒ Linear increase (45° line)
(W1,W2) to (kW1,kW2)
W2
⇒ Multiplicative decrease W1 Capacity
(line through origin)
Ref: D. Chiu and Raj Jain, "Analysis of the Increase/Decrease Algorithms for
Congestion Avoidance in Computer Networks," Journal of Computer
Networks and ISDN, Vol. 17, No. 1, June 1989, pp. 1-14,
http://www.cse.wustl.edu/~jain/papers/cong_av.htm
Washington University in St. Louis CSE473S ©2009 Raj Jain
3-39
ATM Networks
PBX PBX
1 3 5 2 3
Receiver Window
Congestion Timeout
Window SSThresh Idle
CWND Interval
1
Washington University in St. Louis CSE473S Time ©2009 Raj Jain
3-43
Slow Start (Cont)
At the beginning, SSThresh = Receiver window
After a long idle period (exceeding one round-trip
time), reset the congestion window to one.
Exponential growth phase is also known as “Slow
start” phase
The linear growth phase is known as “congestion
avoidance phase”
Set SSTHRESH=CWND/2
eout
Timeout
CWND=1
ouTim Ssthresh=CWND/2
Ssthresh=64kB/MSS
CWND=1MSS
t
DupAckCount=0
DupAckCount=0
e
Tim
30
25
20
15
10
5
0
0 5 10 15 20 25 30
Transmission Round