CS 372 Lecture #14
The Transport Layer:
• Introduction • Multiplexing
v
Note: Many of the lecture slides are based on presentations that accompany Computer Networking: A Top Down Approach, 6th edition,
by Jim Kurose & Keith Ross, Addison-Wesley, 2013.
Or•egon State University
Transport services and protocols
o Transport protocols
o provide logical communication between application processes running on different hosts
o run on end systems
application
transport
network data link physical
‘iii
\~
application
transport
network data link physical
Transport services and protocols #2
sender protocol:
o accepts messages from
application socket
o breaks messages into data blocks
o encapsulates blocks/ports into segments
o passes segments/addresses to network layer
receiver protocol:
o accepts segments from network
layer
o re-assembles data blocks into messages
o passes messages to sockets at application layer
application
transport
network data link physical
‘iii
\~
application
transport
network data link physical
The Transport Layer requires some Network Layer services:
otransport layer: logical communication between processes
onetwork layer: logical communication between hosts oPacket addressing
oRoute computation
oPacket forwarding
oMore later on the network layer …
Multiplexing / demultiplexing
oMultiplexing at sending hosts:
ogathering data from multiple sockets, creating segments, encapsulating segments with header (later used for demultiplexing)
oDemultiplexing at receiving host:
odelivering received segments to correct socket
How demultiplexing works
ohost receives IP datagrams
o each datagram has source IP address, destination IP address
o each datagram encapsulates one transport-layer segment
o each segment has source, destination port number
ohost uses IP addresses & port numbers to direct segment to appropriate socket
32 bits
source port #
dest port #
other header fields
application data (payload)
TCP/UDP segment format
Connectionless demultiplexing
oUDP socket identified by destination (IP address, port
number)
oWhen host receives UDP segment:
ochecks destination port number in segment
odirects UDP segment to socket with that port number
• IP datagrams with different source IP addresses and/or source port numbers might be directed to same socket
Connection-oriented demultiplexing
oTCP socket identified by osource IP address osource port number odestination IP address odestination port number
oreceiving host uses all four values to direct segment to appropriate socket
• Server host may support many simultaneous TCP sockets:
• each socket identified by its own 4-tuple
• Web servers have different sockets for each connecting client
• non-persistent HTTP will have different socket for each request
Demultiplexing: example
multi-threaded server
application
P4 P5 P6
transport
network
link
physical
application
CP3)
transport
network
link
physical
application
P2 P3 transport
network link
physical
host: IP address A
. f.________.
source IP,port: B,80 dest IP,port: A,9157
server: IP address B
source IP,port: C,5775 dest IP,port: B,80
source IP,port: C,9157 dest IP,port: B,80
.________, . source IP,port: A,9157
dest IP, port: B,80
three segments, all destined to IP address: B,
dest port: 80 are demultiplexed to different sockets
Summary Lecture #14
oDefinitions osegment
omultiplexing odemultiplexing
oTransport layer oinputs, outputs oresponsibilities osockets