Unit - Iv: Transport Layer
Unit - Iv: Transport Layer
TRANSPORT LAYER
Introduction to Transport Layer
• The transport layer in the TCP/IP suite is located
between the application layer and the network layer.
• It provides services to the application layer and
receives services from the network layer.
• The transport layer acts as a liaison between a client
program and a server program, a process-to-process
connection.
• The transport layer is the heart of the TCP/IP protocol
suite; it is the end-to-end logical vehicle for
transferring data from one point to another in the
Internet.
Transport-Layer Services
• Process-to-Process Communication
The first duty of a transport-layer protocol is to provide
process-to-process communication.
A process is an application-layer entity (running
program) that uses the services of the transport layer.
• Encapsulation and Decapsulation
To send a message from one process to another, the
transport-layer protocol encapsulates and decapsulates
messages. Encapsulation happens at the sender site.
Decapsulation happens at the receiver site.
• Multiplexing and Demultiplexing
Whenever an entity accepts items from more
than one source, this is referred to as
multiplexing (many to one); whenever an
entity delivers items to more than one
source, this is referred to as demultiplexing
(one to many).
The transport layer at the source performs
multiplexing; the transport layer at the
destination performs demultiplexing
Flow Control
• If the items are produced faster than they can be
consumed, the consumer can be overwhelmed and
may need to discard some items.
• If the items are produced more slowly than they can
be consumed, the consumer must wait, and the
system becomes less efficient. Flow control is related
to the first issue.
• Pushing or Pulling
Delivery of items from a producer to a consumer can
occur in one of two ways: pushing or pulling.
• If the producer delivers the items after the
consumer has requested them, the delivery is
referred to as pulling.
• If the sender delivers items whenever they are
produced ⎯ without a prior request from the
consumer ⎯ the delivery is referred to as
pushing.
Error Control
Error control at the transport layer is
responsible for
1. Detecting and discarding corrupted
packets.
2. Keeping track of lost and discarded
packets and resending them.
3. Recognizing duplicate packets and
discarding them.
4. Buffering out-of-order packets until the
missing packets arrive.
Congestion Control
• Congestion control refers to the
mechanisms and techniques that control the
congestion and keep the load below the
capacity.
• Congestion happens in any system that
involves waiting.
• Congestion at the transport layer is actually
the result of congestion at the network layer,
which manifests itself at the transport layer.
Connectionless and Connection-
Oriented Protocols
• A transport-layer protocol, like a network-layer
protocol, can provide two types of services:
connectionless and connection-oriented.
• Connectionless service at the transport layer
means independency between packets;
connection-oriented means dependency.
Connectionless Service
• In a connectionless service, the source process
(application program) needs to divide its
message into chunks of data of the size
acceptable by the transport layer and deliver
them to the transport layer one by one.
• The transport layer treats each chunk as a
single unit without any relation between the
chunks. When a chunk arrives from the
application layer, the transport layer
encapsulates it in a packet and sends it.
Transport-Layer Protocols
• The transport layer in the TCP/IP suite is located
between the application layer and the network layer.
It provides services to the application layer and
receives services from the network layer.
• The transport layer acts as a liaison between a client
program and a server program, a process-to-process
connection.
• The transport layer is the heart of the TCP/IP protocol
suite; it is the end-to-end logical vehicle for
transferring data from one point to another in the
Internet.
INTRODUCTION
Figure shows the position of transport layer
protocols in the TCP/IP protocol suite.
Services
Each protocol provides a different type of service and
should be used appropriately.
• UDP
UDP is an unreliable connectionless transport-layer
protocol used for its simplicity and efficiency in
applications where error control can be provided by the
application-layer process.
• TCP
TCP is a reliable connection-oriented protocol that can
be used in any application where reliability is
important.
• SCTP
SCTP is a new transport-layer protocol that combines
the features of UDP and TCP.
USER DATAGRAM PROTOCOL
• The User Datagram Protocol (UDP) is a
connectionless, unreliable transport protocol.
• It does not add anything to the services of IP
except for providing process-to-process
communication instead of host-to-host
communication.
• If a process wants to send a small message and
does not care much about reliability, it can use
UDP. Sending a small message using UDP takes
much less interaction between the sender and
receiver than using TCP.
User Datagram
UDP packets, called user datagrams, have a
fixed-size header of 8 bytes made of four
fields, each of 2 bytes (16 bits). Figure shows
the format of a user datagram.
UDP Services
• Process-to-Process Communication
UDP provides process-to-process communication
using socket addresses, a combination of IP
addresses and port numbers.
• Connectionless Services
UDP provides a connectionless service. This means
that each user datagram sent by UDP is an
independent datagram.
There is no relationship between the different user
datagrams even if they are coming from the same
source process and going to the same destination
program. The user datagrams are not numbered.
Flow Control
• UDP is a very simple protocol. There is no flow
control, and hence no window mechanism.
• The receiver may overflow with incoming
messages.
Error Control
• There is no error control mechanism in UDP
except for the checksum. This means that the
sender does not know if a message has been lost
or duplicated.
• When the receiver detects an error through the
checksum, the user datagram is silently discarded.
Checksum
• UDP checksum calculation includes three
sections:
1. Pseudoheader,
2. UDP header,
3. The data coming from the application layer.
• The pseudoheader is the part of the header of
the IP packet in which the user datagram is to
be encapsulated with some fields filled with
0s.
Congestion Control
• UDP is a connectionless protocol, it does not
provide congestion control.
• UDP assumes that the packets sent are small
and sporadic and cannot create congestion in
the network.
• This assumption may or may not be true today,
when UDP is used for interactive real-time
transfer of audio and video.
Encapsulation and Decapsulation
• To send a message from one process to another, the
UDP protocol encapsulates and decapsulates
messages.
Queuing
• At the client site, when a process starts, it requests a
port number from the operating system.
• Some implementations create both an incoming and
an outgoing queue associated with each process.
• Other implementations create only an incoming
queue associated with each process.
Multiplexing and Demultiplexing
• In a host running a TCP/IP protocol suite, there
is only one UDP but possibly several processes
that may want to use the services of UDP.
• To handle this situation, UDP multiplexes and
demultiplexes.
UDP Applications
The following shows some typical applications that can benefit more from the
services of UDP than from those of TCP.
• UDP is suitable for a process that requires simple request-response
communication with little concern for flow and error control. It is not usually
used for a process such as FTP that needs to send bulk data .
• UDP is suitable for a process with internal flow- and error-control mechanisms.
For example, the Trivial File Transfer Protocol (TFTP) process includes flow
and error control. It can easily use UDP.
• UDP is a suitable transport protocol for multicasting. Multicasting capability is
embedded in the UDP software but not in the TCP software.
• UDP is used for management processes such as SNMP .
• UDP is used for some route updating protocols such as Routing Information
Protocol (RIP) .
• UDP is normally used for interactive real-time applications that cannot tolerate
uneven delay between sections of a received message.
TRANSMISSION CONTROL PROTOCOL