Transport Layer
Transport Layer
Transport
Layer
Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Transport Layer: 3-1
Chapter 3: roadmap
Transport-layer services
Connectionless transport: UDP
Principles of reliable data transfer
Connection-oriented transport: TCP
Principles of congestion control
TCP congestion control
log
ica
le
transport protocols actions in end
n d-
systems:
e nd
local or
tra
• sender: breaks application messages regional ISP
nsp
into segments, passes to network layer
ort
home network content
• receiver: reassembles segments into provider
network
messages, passes to application layer application
transport
datacenter
network
network
Sender:
application is passed an application- app. msg
application
layer message
transport
determines segment TTh htransport
app. msg
header fields values
network (IP)
creates segment network (IP)
link
passes segment to IP link
physical physical
Receiver:
application receives segment from IP application
checks header values
app. msg
transport extracts application-layer transport
message
network (IP) demultiplexes message up network (IP)
physical physical
Th app. msg
log
• congestion control
ica
le
• flow control
n d-
e nd
• connection setup local or
tra
regional ISP
UDP: User Datagram Protocol
nsp
ort
home network
• unreliable, unordered delivery content
provider
network
• no-frills extension of “best-effort” IP application
transport
datacenter
network
network
application application
transport transport
(UDP) (UDP)
link link
physical physical
network (IP)
creates UDP segment network (IP)
link
passes segment to IP link
physical physical
network
UDP h SNMP(IP)
msg message network (IP)
demultiplexes message up
link to application link
physical physical
data to/from
UDP segment format application layer
sending receiving
process process
application data data
transport
reliable channel
Note arrows through reliable data transfer channel is just one way – reliably send from sender to receiver
transport
network
unreliable channel
sending receiving
process process
application data data
transport
sender-side of receiver-side
Complexity of reliable data reliable data
transfer protocol
of reliable data
transfer protocol
transfer protocol will depend
(strongly) on characteristics of transport
network
unreliable channel (lose, unreliable channel
corrupt, reorder data?)
reliable service implementation
sending receiving
process process
application data data
transport
sender-side of receiver-side
reliable data of reliable data
Sender, receiver do not know transfer protocol transfer protocol
the “state” of each other, e.g.,
was a message received? transport
network
unless communicated via a unreliable channel
message
reliable service implementation
Sender process wants to make sure a segment got through. But it can just
somehow magically look through curtain to see if receiver got it. It will be
up to the receiver to let the sender KNOW that it (the receiver) has
correctly received the segment.
How will the sender and receiver do that – that’s the PROTOCOL.
Transport Layer: 3-22
Chapter 3: roadmap
Transport-layer services
Connectionless transport: UDP
Principles of reliable data transfer
Connection-oriented transport: TCP
Principles of congestion control
TCP congestion control
options (variable
C, E: congestion notification length)
TCP options
application data sent by
RST, SYN, FIN: connection data application into
management (variable length) TCP socket
window size
Acknowledgements: N
User types‘C’
Seq=42, ACK=79, data = ‘C’
host ACKs receipt of‘C’,
echoes back ‘C’
Seq=79, ACK=43, data = ‘C’
The key thing to note here is that the ACK
host ACKs receipt number (43) on the B-to-A segment is one
of echoed ‘C’ more than the sequence number (42) on the
Seq=43, ACK=80
A-toB segment that triggered that ACK
SendBase=92
Seq=92, 8 bytes of data Seq=92, 8 bytes of data
timeout
timeout
Seq=100, 20 bytes of data
ACK=100
X
ACK=100
ACK=120
SendBase=120
=100
timeout
ACK
CK =100
A
= 10 0
Receipt of three duplicate ACKs ACK
TCP
code
Network layer
delivering IP datagram
payload into TCP
IP
socket buffers code
from sender
TCP
code
Network layer
delivering IP datagram
payload into TCP
IP
socket buffers code
from sender
TCP
code
receive window
flow control: # bytes
receiver willing to accept IP
code
from sender
TCP
flow control code
application application
network network
router
may indicate congestion level or
explicitly set sending rate
TCP ECN, ATM, DECbit protocols
Transport Layer: 3-47
Chapter 3: roadmap
Transport-layer services
Connectionless transport: UDP
Connection-oriented transport: TCP
Principles of congestion control
TCP congestion control
AIMD sawtooth
behavior: probing
for bandwidth
Why AIMD?
AIMD – a distributed, asynchronous algorithm – has been
shown to:
• optimize congested flow rates network wide!
• have desirable stability properties
TCP versions
1- Taho TCP (treated both events similarly). Transport Layer: 3-52
TCP slow start
Host A Host B
when connection begins,
increase rate exponentially
until first loss event:
one s e gm
ent
RTT
• initially cwnd = 1 MSS two segm
en ts
• double cwnd every RTT
• done by incrementing cwnd
for every ACK received four segm
ents
Implementation:
variable ssthresh
on loss event, ssthresh is set to
1/2 of cwnd just before loss event
* Check out the online interactive exercises for more examples: h ttp://gaia.cs.umass.edu/kurose_ross/interactive/
Transport Layer: 3-54
Summary: TCP congestion control
New
New ACK!
ACK! new ACK
duplicate ACK
dupACKcount++ new ACK .
cwnd = cwnd + MSS (MSS/cwnd)
dupACKcount = 0
cwnd = cwnd+MSS transmit new segment(s), as allowed
dupACKcount = 0
L transmit new segment(s), as allowed
cwnd = 1 MSS
ssthresh = 64 KB cwnd > ssthresh
dupACKcount = 0
slow L congestion
start timeout avoidance
ssthresh = cwnd/2
cwnd = 1 MSS duplicate ACK
timeout dupACKcount = 0 dupACKcount++
ssthresh = cwnd/2 retransmit missing segment
cwnd = 1 MSS
dupACKcount = 0
retransmit missing segment
timeout
New
ACK!
ssthresh = cwnd/2
cwnd = 1 New ACK
dupACKcount = 0
cwnd = ssthresh dupACKcount == 3
dupACKcount == 3 retransmit missing segment dupACKcount = 0
ssthresh= cwnd/2 ssthresh= cwnd/2
cwnd = ssthresh + 3 cwnd = ssthresh + 3
retransmit missing segment
retransmit missing segment
fast
recovery
duplicate ACK
cwnd = cwnd + MSS
transmit new segment(s), as allowed
source destination
application application
TCP TCP
network network
link link
physical physical
packet queue almost
never empty, sometimes
overflows packet (loss)
ECN=10 ECN=11
IP datagram
Transport Layer: 3-60