Professional Documents
Culture Documents
Chapter 3 V7.01-Short
Chapter 3 V7.01-Short
Transport Layer
Computer
They obviously represent a lot of work on our part. In return for use, we only
ask the following:
If you use these slides (e.g., in a class) that you mention their source
(after all, we’d like people to use our book!)
Networking: A Top
If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this
Down Approach
material.
7th Edition, Global Edition
Thanks and enjoy! JFK/KWR
Jim Kurose, Keith Ross
All material copyright 1996-2016 Pearson
J.F Kurose and K.W. Ross, All Rights Reserved April 2016
Transport Layer 2-1
Chapter 3: Transport Layer
our goals:
understand principles learn about Internet
behind transport transport layer protocols:
layer services: • UDP: connectionless
• multiplexing, transport
demultiplexing • TCP: connection-oriented
• reliable data transfer reliable transport
• flow control • TCP congestion control
• congestion control
provide logical
transport
network
data link
communication between app physical
processes running on
different hosts
lo
gi
ca
transport protocols run in end
enl
d
systems
-e
nd
• send side: breaks app
tra
ns
messages into segments,
po
rt
passes to network layer
• rcv side: reassembles
application
transport
network
segments into messages, data link
physical
passes to app layer
more than one transport
protocol available to apps
• Internet: TCP and UDP
Transport Layer 3-4
Transport vs. network layer
network layer:
logical
communication
between hosts
transport layer:
logical
communication
between processes
• relies on, enhances,
network layer
services
lo
data link physical
gi
physical
• flow control
ca
network
le
data link
nd
• connection setup physical
-en
network
d
unreliable, unordered
tra
data link
physical
ns
delivery: UDP
po
network
rt
data link
physical
• no-frills extension of network
data link application
“ best-effort” IP physical
network
data link
transport
network
data link
services not available: physical
physical
• delay guarantees
• bandwidth guarantees
application
application P1 application
P3 P4
transport
transport transport
network
network link network
link physical link
physical physical
application
application P4 P5 P6 application
P3 P2 P3
transport
transport transport
network
network link network
link physical link
physical server: IP physical
address B
length checksum
why is there a UDP?
no connection
application establishment (which can
data add delay)
(payload) simple: no connection state
at sender, receiver
small header size
no congestion control: UDP
UDP segment format
can blast away as fast as
desired
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
characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)
characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)
characteristics of unreliable channel will determine complexity of reliable data transfer protocol (rdt)
if RTT=30 msec, 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
U 3L / R .0024
sender = = = 0.00081
RTT + L / R 30.008
User
types
‘C’
Seq=42, ACK=79, data = ‘C’
host ACKs
receipt of
‘C’, echoes
Seq=79, ACK=43, data = ‘C’ back ‘C’
host ACKs
receipt
of echoed
‘C’ Seq=43, ACK=80
350
300
(milliseconds)
RTT
250
RTT (milliseconds)
200
sampleRTT
150
EstimatedRTT
100
1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106
time (seconnds)
time (seconds) Transport Layer 3-50
SampleRTT Estimated RTT
TCP round trip time, timeout
timeout interval: EstimatedRTT plus “ safety margin”
• large variation in EstimatedRTT -> larger safety margin
estimate SampleRTT deviation from EstimatedRTT:
DevRTT = (1-)*DevRTT +
*|SampleRTT-EstimatedRTT|
(typically, = 0.25)
SendBase=92
Seq=92, 8 bytes of data Seq=92, 8 bytes of data
timeo
ACK=100
ut
ut
X
ACK=100
ACK=120
SendBase=120
X
ut
ACK=120
cumulative ACK
Transport Layer 3-56
TCP ACK generation [RFC 1122, RFC 2581]
event at receiver TCP receiver action
arrival of in-order segment with delayed ACK. Wait up to 500ms
expected seq #. All data up to for next segment. If no next segment,
expected seq # already ACKed send ACK
ACK=100
ACK=100
timeo
ut
ACK=100
ACK=100
Seq=100, 20 bytes of data
IP
flow control code
receiver controls sender, so
sender won’t overflow receiver’s
buffer by transmitting too much, from sender
too fast
receiver protocol stack
application application
network network
LAST_ACK
FINbit=1, seq=y
TIMED_WAIT can no longer
send data
ACKbit=1; ACKnum=y+1
timed wait
for 2*max CLOSED
segment lifetime
CLOSED
TCP server
lifecycle
TCP client
lifecycle
time
Transport Layer 3-72
TCP Congestion Control: details
sender sequence number space
cwnd TCP sending rate:
roughly: send cwnd
bytes, wait RTT for
last byte last byte ACKS, then send more
ACKed sent, not-
yet ACKed
sent bytes
(“in-flight”)
cwnd
sender limits transmission: rate ~
~ bytes/sec
RTT
LastByteSent- < cwnd
LastByteAcked
cwnd is dynamic, function of
perceived network congestion
RTT
• initially cwnd = 1 MSS two segm
ents
• double cwnd every RTT
• done by incrementing
cwnd for every ACK four segm
ents
received
summary: initial rate is
slow but ramps up
exponentially fast time
Implementation:
variable ssthresh
on loss event, ssthresh
is set to 1/2 of cwnd just
before loss event