Title: Transport Layer PART II
1Transport LayerPART II
2How Multiplexing/Demultiplexing Work
- Transport layer multiplexing requires-
- The sockets have unique identifiers
- Special fields in the segment that indicate the
dedicated socket. - What are these special fields ?
- Source port number field
- Destination port number field
- How many port numbers a host can have ?
- 0 -65535
- 0- 1023 are called-well known port numbers
3How Multiplexing/Demultiplexing Work
- When a segment arrives, the transport layer
examines the destination port number and directs
the segment to the corresponding socket
4How Multiplexing/Demultiplexing In UDP
- UDP socket is identified by two-tuple
- Destination IP address
- Destination Port Number
- When a UDP socket is created, the transport layer
assigns a port number to the socket
5How Multiplexing/Demultiplexing In UDP
- The segment contains source port number (12222)
and destination port number (13333) - When the segment arrives at the destination, the
host directs the segment to socket identified by
13333
6How Multiplexing/Demultiplexing In UDP
- What happen if two UDP segments have different
source IP address /Port number, but have the
same destination IP address and destination port
number? - The segments will be directed to the same
destination socket - Why?
7How Multiplexing/Demultiplexing In TCP
- TCP segment is identified by 4-tuple
- Source IP address
- Source Port number
- Destination IP address
- Destination Port number
8How Multiplexing/Demultiplexing In TCP
- What happen if two TCP segments have different
source IP address /Port number, but have the
same destination IP address and destination port
number? - They will be directed two different sockets
- Why?
9How Multiplexing/Demultiplexing In TCP
struct sockaddr_in server, client server.sin_fam
ily AF_INET server.sin_addr.s_addr
INADDR_ANY server.sin_addr.sin_port
htons(13333)
Port number 13333 is a welcoming socket waits
for connection-establishment requests from TCP
client
10How Multiplexing/Demultiplexing In TCP
- When the receiving host receives the incoming
connection-request segment with destination
13333, it locates the server socket (sd). - The server process then creates a new socket
(nsd) for a connection - This socket (nsd) inherits the original socket
(sd)
11How Multiplexing/Demultiplexing In TCP
nsd accept (sd, (struct sockaddr ) client,
client_len)
The newly created socket (nsd) is identified by
Source IP address Source Port
number Destination IP address Destination Port
number
12How Multiplexing/Demultiplexing In TCP
Subsequent arriving segments whose source port,
source IP address, destination port and
destination IP address matches to the 4-tuples
will be demultiplxed to the newly created socket
int read (int nsd, char buf, int buflen)
How about web servers and TCP?
13Connectionless Transport UDP
- no frills, bare bones Internet transport
protocol - best effort service, UDP segments may be
- lost
- delivered out of order to application
- connectionless
- no handshaking between UDP sender and UDP
receiver
14Connectionless Transport UDP
- Why is there a UDP?
- no connection establishment (which can add delay)
- simple no connection state at sender, receiver
can support many more active clients
15Connectionless Transport UDP
- Why is there a UDP?
- small segment header
- TCP 20 bytes
- UDP 8 bytes
- no congestion control UDP can blast away as fast
as desired