Professional Documents
Culture Documents
Transport Layer: A Note On The Use of These PPT Slides
Transport Layer: A Note On The Use of These PPT Slides
Transport Layer
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
lo
gi
ca
transport protocols run in
le
nd
end systems
-e
nd
send side: breaks app
tr
a
messages into segments,
ns
po
passes to network layer
rt
rcv side: reassembles application
transport
segments into messages, network
data link
passes to app layer physical
lo
network
physical
gi
data link
flow control
ca
physical
le
connection setup
nd
-e
nd
unreliable, unordered network
tr
data link
a
physicalnetwork
delivery: UDP
ns
data link
po
physical
rt
no-frills extension of network
data link
application
“best-effort” IP physical network
data link
transport
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-8
How demultiplexing works
host receives IP datagrams
each datagram has source IP
address, destination IP address 32 bits
each datagram carries 1
source port # dest port #
transport-layer segment
each segment has source,
destination port number other header fields
host uses IP addresses & port
numbers to direct segment to
appropriate socket
application
data
(message)
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 received
as sequence of 16-bit segment
integers check if computed checksum
checksum: addition (1’s equals checksum field value:
complement sum) of NO - error detected
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
3.3 Connectionless flow control
connection management
transport: UDP
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
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-25
Pipelining Protocols
Go-back-N: big picture: Selective Repeat: big pic
Sender can have up to Sender can have up to
N unacked packets in N unacked packets in
pipeline pipeline
Rcvr only sends Rcvr acks individual
cumulative acks packets
Doesn’t ack packet if Sender maintains
there’s a gap timer for each
Sender has timer for unacked packet
oldest unacked packet When timer expires,
If timer expires, retransmit only unack
retransmit all unacked packet
packets
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
Seq=9 Seq=9
2, 8 b 2, 8 b y te
y te s d a s data
ta Seq=
Seq=92 timeout
1 00, 2
0 by t
es da
timeout
t a
=100
ACK 0
10
X CK=
A AC K = 120
loss
Seq=9 Seq=9
2, 8 b
2, 8 b
y t es da Sendbase y t es da
ta
ta
= 100
Seq=92 timeout
SendBase
= 120 = 120
0 K
=10 AC
ACK
SendBase
= 100 SendBase
= 120 premature timeout
time time
lost ACK scenario
Transport Layer 3-40
TCP retransmission scenarios (more)
Host A Host B
Seq=9
2, 8 byte
s data
=100
timeout
Seq=1 A CK
00, 20
bytes
data
X
loss
SendBase C K =120
A
= 120
time
Cumulative ACK scenario
X
timeout
resen
d 2 nd s
egme
nt
time
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-45
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
timed wait
ACK
replies with ACK. Closes
connection, sends FIN.
closed
closed
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!
3.6 Principles of
3.4 Principles of
reliable data transfer congestion control
3.7 TCP congestion
control
2 4 K b y te s
Saw tooth
behavior: probing
1 6 K b y te s
for bandwidth
8 K b y te s
time
tim e
RTT
first loss event:
two segm
double CongWin every ents
RTT
done by incrementing
CongWin for every ACK four segm
ents
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
TCP connection 1
bottleneck
TCP
router
connection 2
capacity R
Connection 1 throughput R