Beruflich Dokumente
Kultur Dokumente
Transport Layer
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
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-8
How demultiplexing works
host receives IP datagrams
each datagram has source 32 bits
IP address, destination IP
address source port # dest port #
P2 P1
P1
P3
P1 P4 P5 P6 P2 P1P3
SP: 5775
DP: 80
S-IP: B
D-IP:C
P1 P4 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
Sender: Receiver:
treat segment contents compute checksum of
as sequence of 16-bit received segment
integers check if computed checksum
checksum: addition (1’s equals checksum field value:
complement sum) of NO - error detected
segment contents YES - no error detected.
sender puts checksum But maybe errors
value into UDP checksum nonetheless? More later
field ….
1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
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
Transport Layer 3-19
Chapter 3 outline
3.1 Transport-layer 3.5 Connection-oriented
services transport: TCP
3.2 Multiplexing and segment structure
demultiplexing reliable data transfer
flow control
3.3 Connectionless
connection management
transport: UDP
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
send receive
side side
sender receiver
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
rdt_rcv(rcvpkt) &&
notcorrupt(rcvpkt)
extract(rcvpkt,data)
deliver_data(data)
udt_send(ACK)
extract(rcvpkt,data)
deliver_data(data)
sndpkt = make_pkt(ACK, chksum)
udt_send(sndpkt)
U L/R .008
sender
= = = 0.00027
RTT + L / R 30.008 microsec
onds
U sender: utilization – fraction of time sender busy sending
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-42
Go-Back-N
Sender:
k-bit seq # in pkt header
“window” of up to N, consecutive unack’ed 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?
Transport Layer 3-51
Chapter 3 outline
3.1 Transport-layer 3.5 Connection-oriented
services transport: TCP
3.2 Multiplexing and segment structure
demultiplexing reliable data transfer
flow control
3.3 Connectionless
connection management
transport: UDP
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
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-64
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 app’s drain
rate
app process may be
slow at reading from
buffer
Transport Layer 3-70
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 doesn’t overflow
spare room in buffer
= RcvWindow
= RcvBuffer-[LastByteRcvd -
LastByteRead]
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-79
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-81
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
16 Kbytes
8 Kbytes
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 = 2·10-10 Wow
New versions of TCP for high-speed needed!
TCP connection 1
bottleneck
TCP
router
connection 2
capacity R
Connection 1 throughput R
First case:
WS/R > RTT + S/R: ACK for
first segment in window
returns before window’s
worth of data sent
Second case:
WS/R < RTT + S/R: wait
for ACK after sending
window’s worth of data
sent
P min {Q, K 1}
• O/R to transmit
object
first window
object
= S/R
R
= 2S/R
third window
= 4S/R
P
O
delay 2 RTT idleTime p fourth window
= 8S/R
R p 1
P
O S S
2 RTT [ RTT 2 k 1 ]
R k 1 R R object
complete
transmission
delivered
O S S
2 RTT P[ RTT ] (2 P 1) time at
R R R time at
client
server
How do we calculate K ?
K min {k : 20 S 21 S 2 k 1 S O}
min {k : 20 21 2 k 1 O / S}
O
min {k : 2 1 }
k
S
O
min {k : k log 2 ( 1)}
S
O
log 2 ( 1)
S
Calculation of Q, number of idles for infinite-size object,
is similar (see HW).