Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
16 views9 pages

Unit 4 Transport Layer

The Transport Layer is the fourth layer of the OSI model, responsible for providing communication services between application processes on different hosts. It facilitates process-to-process communication, multiplexing, flow control, data integrity, and congestion avoidance, utilizing protocols such as TCP and UDP. TCP ensures reliable, ordered delivery of data, while UDP offers a faster, connectionless service, each with distinct advantages and disadvantages in data transmission.

Uploaded by

Shifa Naqvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views9 pages

Unit 4 Transport Layer

The Transport Layer is the fourth layer of the OSI model, responsible for providing communication services between application processes on different hosts. It facilitates process-to-process communication, multiplexing, flow control, data integrity, and congestion avoidance, utilizing protocols such as TCP and UDP. TCP ensures reliable, ordered delivery of data, while UDP offers a faster, connectionless service, each with distinct advantages and disadvantages in data transmission.

Uploaded by

Shifa Naqvi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

What is transport Layer?

 Transport Layer is the fourth layer from the top in OSI Model which provide
communication services to the application processes that was running on different
hosts.
 Transport Layer provides the services to the session layer and it receives the services
from network layer.
Services provided by Transport Layer
1. Process to Process Communication
Transport Layer is responsible for delivery of message to appropriate process.
Transport Layer uses a port number to deliver the segmented data to the correct process
amongst the multiple processes that are running on a particular host. A port number is a 16-bit
address used by transport layer to identify any client-server program.
2. Multiplexing and Demultiplexing
The transport layer provides the multiplexing service to improve transmission efficiency in
data communication. At the receiver side, demultiplexing is required to collect the data coming
from different processes. Transport Layer provides Upward and Downward Multiplexing:
3. Flow Control
 Flow control makes sure that the data is transmitted at a rate that is accept table for both
sender and receiver by managing data flow.
 The transport layer provides a flow control service between the adjacent layers of the
TCP/IP model. Transport Layer uses the concept of sliding window protocol to provide
flow control.
4. Data integrity
Transport Layer provides data integrity by:
 Detecting and discarding corrupted packets.
 Tracking of lost and discarded packets and re-transmit them.
 Recognizing duplicate packets and discarding them.
 Buffering out of order packets until the missing the packets arrive.
5. Congestion avoidance
 In network, if the load on network is greater than the network load capacity, then the
congestion may occur.
 Congestion Control refers to the mechanisms and techniques to control the congestion
and keep the load below the capacity.
 The transport layer recognizes overloaded nodes and reduced flow rates and take proper
steps to overcome this.
Example of Transport Layer
Let us understand transport layer with the help of example. Let us take an example of sending
email.
When we send an email then the email then in OSI model each layer communicates to the
corresponding layer of the receiver.
So when the mail will come at transport layer on sender side then the email is broken down in
to small segments. Then that broken segments are sent to network layer and transport layer also
specifies the source and destination port.
At the receiver side, transport layer reassembles all the segment to get the data and use port
number to identify the application to deliver data.
Working of Transport Layer
The transport layer receives the services from the network layer and then give services to the
session layer.
At the sender’s side: At the sender's end, transport layer collect data from application layer i.e
message and performs segementation to divide the message into segments and then adds the
port number of source and destination in header and send that message to network layer.
At the receiver’s side: At the receiver's end, transport layer collects data from network layer
and then reassembles the segmented data and identifies port number by reading its header to
send that message to appropriate port in the session layer.
Refer to the image below to see the working of Transport Layer.

Transport Layer Protocols


 UDP (User Datagram Protocol)
 TCP(Transmission Control Protocol)

Transmission Control Protocol-


TCP is short for Transmission Control Protocol.
It is a transport layer protocol.
It has been designed to send data packets over the Internet.
It establishes a reliable end to end connection before sending any data.
Characteristics Of TCP-
Point-01:

TCP is a reliable protocol.

This is because-
 It guarantees the delivery of data packets to its correct destination.
 After receiving the data packet, receiver sends an acknowledgement to the sender.
 It tells the sender whether data packet has reached its destination safely or not.
 TCP employs retransmission to compensate for packet loss.

Point-02:

TCP is a connection oriented protocol.

This is because-
 TCP establishes an end to end connection between the source and destination.
 The connection is established before exchanging the data.
 The connection is maintained until the application programs at each end finishes
exchanging the data.
Point-03:

TCP handles both congestion and flow control.


 TCP handles congestion and flow control by controlling the window size.
 TCP reacts to congestion by reducing the sender window size.

Point-04:

TCP ensures in-order delivery.

 TCP ensures that the data packets get deliver to the destination in the same order they are
sent by the sender.

TCP Header | TCP Header Format


 Transmission Control Protocol is a transport layer protocol.
 It continuously receives data from the application layer.
 It divides the data into chunks where each chunk is a collection of bytes.
 It then creates TCP segments by adding a TCP header to the data chunks.
 TCP segments are encapsulated in the IP datagram.
TCP segment = TCP header + Data chunk
TCP Header-

The following diagram represents the TCP header format-

 Source port address is a 16 bit field that defines port number of application program
that is sending the segment.
 Destination port address is a 16 bit field that defines port number of application
program that is receiving the segment.
 Sequence number is a field of 32 bit that will define the number assigned to data first
byte contained in segment.
 Acknowledgement number is a 32 bit field that describe the next byte that receiver is
looking forward to receive next from sender.
 Header Length (HLEN) is a field of 4 bit that specify the number of 4 byte words in
TCP header. The header length of TCP header can be between 20 to 60 bytes.
 Reserved is a field 6 bit that are reserved for future use.
 Control bits are 6 different independent control bits or flags in this field.
 There are six in control field:
1. URG: Urgent pointer
2. ACK: Acknowledgement number
3. PSH: Push request
4. RST: Reset connection
5. SYN: Sequence number Synchronization
6. FIN: Connection termination
 Window Size is a 16-bit field that defines the size of the window of sending TCP in
bytes.
 Checksum, 16-bit field contains checksum and used for error detection.
 Urgent pointer is a 16 bit field .This flag is set when there is urgent data in the data
segment.
 Options and padding can be upto 40 bytes field for optional information in TCP
header.

UDP

 Connection less protocol


 Unreliable protocol
 UDP stands for User Datagram Protocol.
 UDP is one of the simplest transport layer protocol which provides non sequenced data
transmission functionality.

 UDP is consider as connection less transport layer protocol.


 This type of protocol is referred to be used when speed and size are more important
than reliability and security.
 It is an end-to-end transport level protocol that adds transport-level addresses,
checksum error control, and length information to the data received from the upper
layer.
 User datagram is the packet constructed by the UDP protocol

Format of User Datagram

Refer to the image below to see the header of UDP packet consisting of four fields.

User datagram have a fixed size header of 8 bytes which is divided into four parts -

Source port address: It defines source port number and it is of 16 bits.

Destination port address: It defines destination port number and it is of 16 bits.

Total length: This field is used to define the total length of the user datagram which is sum of
header and data length in bytes. It is a 16-bit field.

Checksum: Checksum is also 16 bit field to carry the optional error detection data.

UDP Services

 Process to Process Communication


 Connectionless Service
 Fast delivery of message
 Checksum

Disadvantages

 UDP delivers basic functions required for the end-to-end transimission of data.
 It does not use any sequencing and does not identify the damaged packet while
reporting an error.
 UDP can identify that an error has happened, but UDP does not identify which packet
has been lost.
Congestion Control-
When too many packets are present in the network it causes packet delay and loss of packet
which degrades the performance of the system. This situation is called congestion.
The network layer and transport layer share the responsibility for handling congestions. One
of the most effective ways to control congestion is trying to reduce the load that transport layer
is placing on the network. To maintain this, the network and transport layers have to work
together.
There are two types of Congestion control algorithms, which are as follows −

 Leaky Bucket Algorithm


 Token Bucket Algorithm

Leaky Bucket Algorithm


The leaky bucket algorithm is a method of congestion control where multiple packets are stored
temporarily. These packets are sent to the network at a constant rate that is decided between
the sender and the network. This algorithm is used to implement congestion control through
traffic shaping in data networks.
To understand the algorithm, let us first discuss the analogy of a leaky bucket.
Consider a bucket with a small hole at the bottom. Now imagine that water is poured into the
bucket at random intervals. At each interval, the amount of water poured into the bucket is not
fixed. Now it does not matter how much water is inside the bucket, the water comes out at a
constant rate from the hole. Consider the image below for more clarity.

 The rate at which water leaks (called the leak rate) is independent of the amount of
water inside the bucket.
 If the bucket becomes full, the water poured will be lost.
The same idea of the leaky bucket can be applied to the data packets.
 Consider that, each network interface has a leaky bucket.
 Now, when the sender wants to transmit packets, the packets are thrown into the
bucket. These packets get accumulated in the bucket present at the network interface.
 If the bucket is full, the packets are discarded by the buckets and are lost.
 This bucket will leak at a constant rate. This means that the packets will be
transmitted to the network at a constant rate. This constant rate is known as the Leak
Rate or the Average Rate.
 In this way, bursty traffic is converted into smooth, fixed traffic by the leaky bucket.
 Queuing and releasing the packets at different intervals help in reducing network
congestion and increasing overall performance.
This design can be simulated inside the host operating system, specifically in the transport
and the network layer.

Token Bucket Algorithm

The leaky bucket algorithm enforces output patterns at the average rate, no matter how busy
the traffic is. So, to deal with the more traffic, we need a flexible algorithm so that the data is
not lost. One such approach is the token bucket algorithm.
Let us understand this algorithm step wise as given below −
 Step 1 − In regular intervals tokens are thrown into the bucket f.
 Step 2 − The bucket has a maximum capacity f.
 Step 3 − If the packet is ready, then a token is removed from the bucket, and the packet
is sent.
 Step 4 − Suppose, if there is no token in the bucket, the packet cannot be sent

Example

Let us understand the Token Bucket Algorithm with an example −

In figure (a) the bucket holds two tokens, and three packets are waiting to be sent out of the
interface.
In Figure (b) two packets have been sent out by consuming two tokens, and 1 packet is still
left.
When compared to Leaky bucket the token bucket algorithm is less restrictive that means it
allows more traffic. The limit of busyness is restricted by the number of tokens available in
the bucket at a particular instant of time.
The implementation of the token bucket algorithm is easy − a variable is used to count the
tokens. For every t seconds the counter is incremented and then it is decremented whenever a
packet is sent. When the counter reaches zero, no further packet is sent out.
This is shown in below given diagram −

You might also like