0% found this document useful (0 votes)
13 views30 pages

Unit 5

The transport layer provides essential services for data transmission, including process-to-process delivery, end-to-end connections, multiplexing, congestion control, and error correction. It utilizes protocols like TCP for reliable connections and UDP for lightweight, connectionless communication. Key features include flow control mechanisms, addressing, and various congestion control algorithms such as the Leaky Bucket and Token Bucket methods.

Uploaded by

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

Unit 5

The transport layer provides essential services for data transmission, including process-to-process delivery, end-to-end connections, multiplexing, congestion control, and error correction. It utilizes protocols like TCP for reliable connections and UDP for lightweight, connectionless communication. Key features include flow control mechanisms, addressing, and various congestion control algorithms such as the Leaky Bucket and Token Bucket methods.

Uploaded by

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

UNIT-5

TRANSPORT LAYER
THE TRANSPORT LAYER
Services provided to the upper layers
 The ultimate goal of the transport layer is to provide efficient, reliable, and
cost-effective data transmission service to its users, normally processes in
the application layer.
 To achieve this, the transport layer makes use of the services provided by
the network layer
 The software and/or hardware within the transport layer that does the
work are called the transport entity.
 Just as there are two types of network service, connection-oriented and
connectionless, there are also two types of transport service.
 The connection-oriented transport service is similar to the connection-
oriented network service in many ways. In both cases, connections have
three phases: establishment, data transfer, and release. Addressing and flow
control are also similar in both layers
The network, transport, and
application layers
Responsibilities of a Transport Layer
1. The Process to Process Delivery
2. End-to-End Connection between
Hosts
3. Multiplexing and Demultiplexing
4. Congestion Control
5. Data integrity and Error correction
6. Layer
1. Transport Flow control
requires a Port number to correctly deliver the segments of
data to the correct process amongst the multiple processes running on a
particular host. A port number is a 16-bit address used to identify any client-
server program uniquely.
2. The transport layer is also responsible for creating the end-
to-end Connection between hosts for which it mainly uses
TCP and UDP. TCP is a secure, connection-orientated protocol
that uses a handshake protocol

 3.Multiplexing(many to one) is when data is acquired


from several processes from the sender and merged into
one packet along with headers and sent as a single packet
 Demultiplexing(one to many) is required at the receiver
side when the message is distributed into different
processes. Transport receives the segments of data from the
network layer distributes and delivers it to the appropriate
4.Congestion is a situation in which too many sources
over a network attempt to send data and the router buffers
start overflowing due to which loss of packets occurs.
It uses open-loop congestion control to prevent congestion
and closed-loop congestion control to remove the congestion
in a network once it occurred

Leaky Bucket Congestion Control


Technique
5.The transport layer checks for errors in the messages
coming from the application layer by using error detection
codes, and computing checksums, it checks whether the
received data is not corrupted and uses the ACK and NACK
services to inform the sender if the data has arrived or not
and checks for the integrity of data.
6.The transport layer provides a flow control mechanism
between the adjacent layers of the TCP/IP model. TCP also
prevents data loss due to a fast sender and slow receiver by
imposing some flow control techniques

Elements of Transport Protocols


 Addressing
 Connection Establishment
 Connection Release
 Flow Control and Buffering
 Multiplexing
 Crash Recovery
Addressing
 Application Process is connected to the TSAP (Transport Service
Access Point)
 Entity connects to the NSAP. ( Network Service Access
Points )
 There are multiple processes running within the host
 The relationship between the NSAPs, the TSAPs, and a
transport connection.
 Application processes, both clients and servers, can
attach themselves to a local TSAP to establish a
connection to a remote TSAP.
 These connections run through NSAPs on each host.
 The purpose of having TSAPs is that in some networks,
each computer has a single NSAP, so some way is
needed to distinguish multiple transport endpoints that
share that NSAP.
Connection Establishment

 Establishing a connection sounds easy, but it is actually


surprisingly tricky
 One transport entity to just send a CONNECTION REQUEST
segment to the destination and wait for a CONNECTION
ACCEPTED reply.
 The problem occurs when the network can lose, delay,
 Imagine
corrupt,a network
and duplicate
that is sopackets.
congestedThis
that behavior causes
acknowledgements
seriousever
hardly complications.
get back in time and each packet times out and is
retransmitted two or three times.
 Suppose that the network uses datagrams inside and that every
packet follows a different route.
 Some of the packets might get stuck in a traffic jam inside the
network and take a long time to arrive.
 That is, they may be delayed in the network and pop out much
 The problem can be attacked in various ways, none of them
very satisfactory.
 One way is to use throwaway transport addresses.
 In this approach, each time a transport address is needed, a
new one is generated. When a connection is released, the
address is discarded and never used again. Delayed duplicate
packets then never find their way to a transport process and
can do no damage.
 However, this approach makes it more difficult to connect with
a process in the first place.
 Another possibility is to give each connection a unique
identifier i.e., a sequence number incremented for each
connection established) chosen by the initiating party and put
in each segment
Connection Release
 As we mentioned earlier, there are two styles of terminating a
connection: asymmetric release and symmetric release.

 Asymmetric release is the way the telephone system works:


when one party hangs up, the connection is broken.
 Symmetric release treats the connection as two separate
unidirectional connections and requires each one to be
 released
Asymmetricseparately.
release is abrupt and may result in data loss.
After the connection is established, host 1 sends a
segment that arrives properly at host 2.
 Then host 1 sends another segment. Unfortunately, host 2
issues a DISCONNECT before the second segment arrives.
 The result is that the connection is released and data are
lost.
Flow Control

1.A frame carries an error-detecting code (e.g., a CRC or


checksum)
that is used to check if the information was correctly
received.

2. A frame carries a sequence number to identify itself and is


retransmitted
by the sender until it receives an acknowledgement of
successful receipt from the receiver. This is called ARQ
(Automatic Repeat request).

3. There is a maximum number of frames that the sender will


allow to
be outstanding at any time, pausing if the receiver is not
acknowledging
If hosts and routers are subject to crashes or connections are
long-lived (e.g.,
large software or media downloads), recovery from these
crashes becomes an
TCP
•TCP stands for Transmission Control Protocol.
•It provides full transport layer services to applications.
•It is a connection-oriented protocol means the connection established
between both the ends of the transmission. For creating the connection, TCP
generates a virtual circuit between sender and receiver for the duration of a
transmission.
Features of TCP protocol
Stream data transfer: TCP protocol transfers the data in the form of contiguous
stream of bytes.
Flow Control: When receiving TCP sends an acknowledgement back to the
sender indicating the number the bytes it can receive without overflowing its
internal buffer
Reliability: TCP assigns a sequence number to each byte transmitted and expects
a positive acknowledgement from the receiving TCP
TCP Segment Format
Leaky Bucket algorithm
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.
There are two types of Congestion control algorithms
Leaky Bucket Algorithm
Token Bucket Algorithm
Leaky Bucket Algorithm mainly controls the total amount and the rate of
the traffic sent to the network.
Step 1 − Let us imagine a bucket with a small hole at the bottom where the
rate at which water is poured into the bucket is not constant and can vary but
it leaks from the bucket at a constant rate.
Step 2 − So (up to water is present in the bucket), the rate at which the water
leaks does not depend on the rate at which the water is input to the bucket.
Step 3 − If the bucket is full, additional water that enters into the bucket that
spills over the sides and is lost.
Step 4 − Thus the same concept applied to packets in the network. Consider
that data is coming from the source at variable speeds. Suppose that a source
sends data at 10 Mbps for 4 seconds. Then there is no data for 3 seconds.
The source again transmits data at a rate of 8 Mbps for 2 seconds. Thus, in a
time span of 8 seconds, 68 Mb data has been transmitted.
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.

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.
 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 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.
What is User Datagram Protocol?
User Datagram Protocol (UDP) is one of the core protocols of the Internet
Protocol (IP) suite. It is a communication protocol used across the internet for
time-sensitive transmissions such as video playback or DNS lookups. Unlike
Transmission Control Protocol (TCP), UDP is connectionless and does not
guarantee delivery, order, or error checking, making it a lightweight and
efficient option for certain types of data transmission.

So, there is no need to establish a connection before data transfer. The UDP
helps to establish low-latency and loss-tolerating connections over the network.
The UDP enables process-to-process communication.
•Source Port: Source Port is a 2 Byte long field used to identify the
port number of the source.
•Destination Port: It is a 2 Byte long field, used to identify the port of the
destined packet.
•Length: Length is the length of UDP including the header and the data. It is a
16-bits field.
•Checksum: Checksum is 2 Bytes long field. It is the 16-bit one’s complement of
the one’s complement sum of the UDP header, the pseudo-header of information
from the IP header, and the data, padded with zero octets at the end (if
APPLICATION LAYER
Simple Mail Transfer Protocol
SMTP is an application layer protocol.
The client who wants to send the mail opens a TCP connection to the
SMTP server and then sends the mail across the connection. The SMTP
server is an always-on listening mode. As soon as it listens for a TCP
connection from any client, the SMTP process initiates a connection
through port 25. After successfully establishing a TCP connection the
client process sends the mail instantly.
SMTP Protocol
The SMTP model is of two types:
•End-to-End Method
•Store-and-Forward Method
The end-to-end model is used to communicate between different
organizations whereas the store and forward method is used within
an organization. An SMTP client who wants to send the mail will
contact the destination’s host SMTP directly, to send the mail to the
destination. The SMTP server will keep the mail to itself until it is
successfully copied to the receiver’s SMTP.

The client SMTP is the one that initiates the session so let us call it
the client-SMTP and the server SMTP is the one that responds to
the session request so let us call it receiver-SMTP. The client-SMTP
will start the session and the receiver SMTP will respond to the
request.
HTTP
•HTTP stands for HyperText Transfer Protocol.
•It is a protocol used to access the data on the World Wide Web (www).
•The HTTP protocol can be used to transfer the data in the form of plain
text, hypertext, audio, video, and so on.
•This protocol is known as HyperText Transfer Protocol because of its
efficiency that allows us to use in a hypertext environment where there are
rapid jumps from one document to another document.
•HTTP is similar to the FTP as it also transfers the files from one host to
another host. But, HTTP is simpler than FTP as HTTP uses only one
connection, i.e., no control connection to transfer the files.
•HTTP is used to carry the data in the form of MIME-like format.
Features of HTTP:
•Connectionless protocol: HTTP is a connectionless protocol. HTTP client
initiates a request and waits for a response from the server. When the server
receives the request, the server processes the request and sends back the
response to the HTTP client after which the client disconnects the connection.
The connection between client and server exist only during the current
request and response time only.
•Media independent: HTTP protocol is a media independent as data can be
sent as long as both the client and server know how to handle the data
content. It is required for both the client and server to specify the content
type in MIME-type header.
•Stateless: HTTP is a stateless protocol as both the client and server know
each other only during the current request. Due to this nature of the protocol,
both the client and server do not retain the information between various
requests of the web pages.
File Transfer Protocol (FTP) in
Application Layer
 FTP or File Transfer Protocol is said to be one of the earliest and also the most
common forms of transferring files on the internet. Located in the application
layer of the OSI model.
 FTP is a basic system that helps in transferring files between a client and a server.
 It is what makes the FTP unique that the system provides a reliable and efficient
means of transferring files from one system to another even if they have
different file structures and operating systems.
 Contrary to other protocols such as http that cover hypertexts and web
resources in general, ftp is dedicated to the management and the transfer of
text, binary, or image files.
What is FTP Useful For.

•Transferring Large Files: FTP can transfer large files in one shot; thus
applicable when hosting websites, backing up servers, or sharing files in
large quantities.
•Remote File Management: Files on a remote server can be uploaded,
downloaded, deleted, renamed, and copied according to the users’
choices.
•Automating File Transfers: FTP is a great protocol for the execution of
file transfers on predefined scripts and employments.
•Accessing Public Files: Anonymous FTP means that everybody
irrespective of the identity is allowed to download some files with no
permissions needed.

You might also like