You are on page 1of 13

Computer and

Communication Networks
EE-357 -TE-54
By Dr Mir Yasir Umair
Assistant Professor, MCS, NUST
Transport Layer
Multiplexing and Demultiplexing
Chapter 3 outline
3.1 transport-layer services 3.5 connection-oriented
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 congestion
3.4 principles of reliable
control
data transfer
3.7 TCP congestion control

Transport Layer 3-3


In the world of sockets……
• Socket() – Endpoint for communication
• Bind() - Assign a unique telephone number.
• Listen() – Wait for a caller.
• Connect() - Dial a number.
• Accept() – Receive a call.
• Send(), Recv() – Talk.
• Close() – Hang up.
Multiplexing/demultiplexing
multiplexing at sender:
handle data from multiple demultiplexing at receiver:
sockets, add transport header use header info to deliver
(later used for demultiplexing) received segments to correct
socket

application

application P1 P2 application socket


P3 transport P4
process
transport network transport
network link network
link physical link
physical physical

Transport Layer 3-5


How demultiplexing works
❖host receives IP datagrams 32 bits
▪ each datagram has source IP address, source port # dest port #
destination IP address
▪ each datagram carries one transport-
layer segment other header fields
▪ each segment has source, destination
port number
application
❖host uses IP addresses & data
port numbers to direct (payload)
segment to appropriate
socket TCP/UDP segment format

Transport Layer 3-6


Ports
• A 16 bits address that identifies a specific process/ network service
• Well-Known Ports (0 – 1023)
Used by system processes for providing network services.
• Registered ports (1024 - 49151)
Registered but not assigned/ controlled by IANA - used by game servers
• Dynamic/ private ports (49152 – 65535)
Can be used by any process temporarily

25 SMTP
Port 5257
Client Port 50257
80 Web Server
Port 56403
Connectionless demultiplexing
❖ When creating datagram to send into UDP socket, it must
specify
▪ destination IP address
▪ destination port #

❖ when host receives UDP IP datagrams with same


segment: dest. port #, but different
▪ checks destination port # in source IP addresses
segment and/or source port
▪ directs UDP segment to socket numbers will be directed
with that port # to same socket at dest

Transport Layer 3-8


Connectionless MUX/demux: example
DatagramSocket serverSocket
= new DatagramSocket
DatagramSocket (6428);
DatagramSocket
mySocket2 = new mySocket1 = new
DatagramSocket DatagramSocket
(9157); application
(5775);
application application
P1
P3 P4
transport
transport transport
network
network link network
link physical link
physical physical

source port: 6428 source port: ?


dest port: 9157 dest port: ?

source port: 9157 source port: ?


dest port: 6428 dest port: ?
Transport Layer 3-9
Connection-oriented Mux/demux
❖ TCP socket identified ❖ server host may support
by 4-tuple: many simultaneous TCP
▪ source IP address sockets:
▪ source port number ▪ each socket identified by its
▪ dest IP address own 4-tuple
▪ dest port number
❖ web servers have
❖ demux: receiver uses different sockets for
all four values to direct each connecting client
segment to
appropriate socket

Transport Layer 3-10


Connection-oriented mux/demux: example
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

host: IP source IP,port: B,80 host: IP


address A dest IP,port: A,9157 source IP,port: C,5775 address C
dest IP,port: B,80
source IP,port: A,9157
dest IP, port: B,80
source IP,port: C,9157
dest IP,port: B,80
three segments, all destined to IP address: B,
Transport Layer dest port: 80 are demultiplexed to different sockets 3-11
Connection-oriented mux/demux: example
threaded server
application
application application
P4
P3 P2 P3
transport
transport transport
network
network link network
link physical link
physical server: IP physical
address B

host: IP source IP,port: B,80 host: IP


address A dest IP,port: A,9157 source IP,port: C,5775 address C
dest IP,port: B,80
source IP,port: A,9157
dest IP, port: B,80
source IP,port: C,9157
dest IP,port: B,80

Transport Layer 3-12


Thank you

EE 451 Mobile Communications

You might also like