Beruflich Dokumente
Kultur Dokumente
Transport Layer
Computer Networking:
A Top Down Approach
4th edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2007.
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
connection setup
unreliable, unordered
network
data link
physicalnetwork
delivery to app: UDP data link
physical
no-frills extension of network
data link
best-effort IP
application
physical network transport
data link network
services not available:
physical data link
physical
delay guarantees
bandwidth guarantees
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
P3 P1
P1 P2 P4 application
application application
host 2 host 3
host 1
Transport Layer 3-7
How demultiplexing works:
General for TCP and UDP
32 bits
host receives IP datagrams
each datagram has source, source port # dest port #
destination IP addresses
each datagram carries 1 other header fields
transport-layer segment
each segment has source,
destination port numbers
application
host uses IP addresses & port
data
numbers to direct segment to (message)
appropriate socket, process,
application
TCP/UDP segment format
P2 P1
P1
P3
P1 P4 P5 P6 P2 P1P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
send receive
side side
U L/R .008
sender
= = = 0.00027
RTT + L / R 30.008 microsec
onds
1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link
network protocol limits use of physical resources!
U L/R .008
sender
= = = 0.00027
RTT + L / R 30.008 microsec
onds
Increase utilization
by a factor of 3!
U 3*L/R .024
sender
= = = 0.0008
RTT + L / R 30.008 microsecon
ds
Transport Layer 3-38
Go-Back-N
Sender:
k-bit seq # in pkt header
window of up to N, consecutive unacked pkts allowed
receiver sees no
difference in two
scenarios!
incorrectly passes
duplicate data as new
in (a)
Q: what relationship
between seq # size
and window size?
(check hwk), (try applet) Transport Layer 3-46
performance:
- selective repeat:
- error-free case:
- if the window is w such that the pipe is fullU=100%
- otherwise U=w*Ustop-and-wait=w/(1+2a)
- in case of error:
- if w fills the pipe U=1-p
- otherwise U=w*Ustop-and-wait=w(1-p)/(1+2a)
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
overwhelm receiver
door door
TCP TCP
send buffer receive buffer
segment
application
data
(variable length)
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)
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
Seq=92 timeout
timeout
X
loss
Sendbase
= 100
Seq=92 timeout
SendBase
= 120
SendBase
= 100 SendBase
= 120 premature timeout
time time
lost ACK scenario
Transport Layer 3-61
TCP retransmission scenarios (more)
Host A Host B
timeout
X
loss
SendBase
= 120
time
Cumulative ACK scenario
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
speed-matching
service: matching the
send rate to the
receiving apps drain
rate
app process may be
slow at reading from
buffer
Transport Layer 3-65
TCP Flow control: how it works
Rcvr advertises spare
room by including value
of RcvWindow in
segments
Sender limits unACKed
(Suppose TCP receiver data to RcvWindow
discards out-of-order guarantees receive
segments) buffer doesnt overflow
spare room in buffer
= RcvWindow
= RcvBuffer-[LastByteRcvd -
LastByteRead]
application
data
(variable length)
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
seq. #s no data
close
client closes socket:
clientSocket.close();
timed wait
Step 2: server receives
FIN, replies with ACK.
Closes connection, sends
FIN. closed
timed wait
Note: with small
closed
modification, can handle
simultaneous FINs.
closed
TCP server
lifecycle
TCP client
lifecycle
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
Congestion:
informally: too many sources sending too much
data too fast for network to handle
different from flow control!
manifestations:
lost packets (buffer overflow at routers)
long delays (queueing in router buffers)
a top-10 problem!
receivers
one router,
Host B unlimited shared
output link buffers
infinite buffers
no retransmission
large delays
when congested
maximum
achievable
throughput
Transport Layer 3-75
Causes/costs of congestion: scenario 2
R/3
lout
lout
lout
R/4
a. b. c.
costs of congestion:
more work (retrans) for given goodput
unneeded retransmissions: link carries multiple copies of pkt
Transport Layer 3-77
Causes/costs of congestion: scenario 3
four senders
Q: what happens as l
multihop paths in
and l increase ?
timeout/retransmit in
Host A lout
lin : original data
l'in : original data, plus
retransmitted data
Host B
H
o
s
t
B
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
24 Kbytes
Saw tooth
behavior: probing
16 Kbytes
for bandwidth
8 Kbytes
time
time
RTT
first loss event:
double CongWin every
RTT
done by incrementing
CongWin for every ACK
received
Summary: initial rate
is slow but ramps up
exponentially fast time
Implementation:
Variable Threshold
At loss event, Threshold is
set to 1/2 of CongWin just
before loss event
1.22 MSS
RTT L
L = 210-10 Wow
New versions of TCP for high-speed
TCP connection 1
bottleneck
TCP
router
connection 2
capacity R
Connection 1 throughput R