Chapter 4 Transport Layer
Chapter 4 Transport Layer
Chapter 4
Transport Layer
DR. SHUVABRATA BANDOAPDHAYA
Transport Layer
Transport layer residing between the application and network layers
Transport layer protocols are implemented in the end systems but not
in network routers.
BANASTHALI 2
BANASTHALI 3
Concept of Logical communication
Although the communicating application processes are not physically connected
to each other, from the applications' viewpoint, it is as if they were physically
connected.
BANASTHALI 4
What Transport layer does:
At sending side:
The application messages are broken into smaller chunks.
To each chunk of data, a transport-layer header is added to create 4-PDUs (Packet data unit).
The transport layer then passes the 4-PDUs to the network layer, where each 4-PDU is
encapsulated into a 3-PDU.
At the receiving side:
The transport layer receives the 4-PDUs from the network layer,
Removes the transport header from the 4-PDUs,
Reassembles the messages and passes them to a receiving application process.
BANASTHALI 5
Types of transport layer protocols
1. UDP (User Datagram Protocol): provides an unreliable, connectionless service to
the invoking application.
BANASTHALI 6
Multiplexing and Demultiplexing
At the transmitting end, the multiplexing process includes:
1. gathering data at the source host from different application processes,
2. enveloping the data with header information to create segments, and
3. passing the segments to the network layer.
The header information will later be used in demultiplexing at receiver end.
At the receiving end, the demultiplexing process includes:
1. examining this field to determine the correct receiving process, and
2. then directing the segment to that application process.
BANASTHALI 7
UDP and TCP perform the demultiplexing and multiplexing jobs by including two special fields in the
segment headers:
1. the source port number field and
2. the destination port number field
The port number is a 16-bit number, ranging from 0 to 65535.
The port numbers ranging from 0 - 1023 are called well-known port numbers as they are reserved for
use by well-known application protocols such as HTTP and FTP.
When we develop a new application, we must assign the application a port number.
BANASTHALI 8
Unreliable Network
BANASTHALI 9
UDP
It is a Connectionless unreliable transport services best suited for the applications which:
1. can tolerate a small fraction of packet loss, so that reliable data transfer is not absolutely
critical for the success of the application
2. But overhead and corresponding delay degrades the system performance
Examples of such applications are:
i. Internet phone
ii. Real-time video conferencing
iii. Streaming of stored audio and video
iv. Name translation using DMS
v. Routing update using RIP protocol
vi. Network management using SNMP protocol
BANASTHALI 10
Why UDP is better than TCP in time-sensitive
applications?
i. No connection establishment
BANASTHALI 11
Transmission Control Protocol (TCP)
It is a transport layer protocol resides between application layer and
network/ internet layer
• It is a transport layer protocol that facilitates
the transmission of packets from source to
destination.
• The main functionality of the TCP is to take
the data from the application layer.
• Then it divides the data into a several
packets, provides numbering to these
packets, and finally transmits these packets
to the destination.
• The TCP, on the other side, will reassemble
the packets and transmits them to the
application layer.
Features of TCP protocol
Connection-oriented data service:
A TCP connection between source and destination is being established before data
transmission.
To ensure reliable data delivery, congestion control, error detection and flow control
mechanism has been introduced.
Stream-oriented data service
TCP allows the sending process to deliver data as a stream of bytes and allows
the receiving process to obtain data as a stream of bytes.
2. The gray area holds bytes that have been sent but not yet acknowledged. TCP keeps
these bytes in the buffer until it receives an acknowledgment.
The TCP segment is then encapsulated into an Internet Protocol (IP) datagram, and exchanged
with peers.
Segment header contains 10 mandatory fields (2 bytes each), and an optional extension field
The header is 20 bytes if there are no options and up to 60 bytes if it contains options.
The data section follows the header and is the payload data carried for the application.
Source port (16 bits): Identifies the sending port.
Acknowledgment number (32 bits): If the ACK flag is set then the value of this field is the next sequence
number that the sender of the ACK is expecting.
Data offset (4 bits): Specifies the number of 32-bit words of data in the TCP header.
Checksum (16 bits): The 16-bit checksum field is used for error-checking of the TCP header, the
payload and an IP pseudo-header (source IP address + destination IP address +protocol number
+length of the TCP headers and payload in bytes).
Urgent pointer (16 bits): If the URG flag is set, then this 16-bit field is an offset from the
sequence number indicating the last urgent data byte.
1) Establish connection
• Once the computers are done with the handshake, they're ready to receive packets
containing actual data.
Reliable Data transfer:
When a packet of data is sent over TCP, the recipient must always acknowledge what
they received.
1. The first computer sends a packet with data and a sequence number.
2. The second computer acknowledges it by setting the ACK bit and increasing the
acknowledgement number
Connection Termination
Either computer can close the connection when they no longer want to send or
receive data.
1) A computer initiates closing the connection by sending a packet with the FIN bit set
to 1 (FIN = finish).
2) The other computer replies with an ACK and another FIN.
3) After one more ACK from the initiating computer, the connection is closed.
Error detection
Error control in TCP is mainly done through the use of three simple techniques:
1) Checksum – Every segment contains a checksum field which is used to find corrupted
segments. If the segment is corrupted, then that segment is discarded by the
destination TCP and is considered lost.