0% found this document useful (0 votes)
33 views55 pages

Unit - Iv: Transport Layer

The transport layer acts as a liaison between client and server programs, providing process-to-process communication. It encapsulates and decapsulates messages, performs multiplexing and demultiplexing, and provides services like flow control, error control, and connection-oriented or connectionless communication. The main transport layer protocols are TCP, which provides reliable, connection-oriented communication, and UDP, which provides simpler, connectionless communication.

Uploaded by

Sundaram Muthu
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)
33 views55 pages

Unit - Iv: Transport Layer

The transport layer acts as a liaison between client and server programs, providing process-to-process communication. It encapsulates and decapsulates messages, performs multiplexing and demultiplexing, and provides services like flow control, error control, and connection-oriented or connectionless communication. The main transport layer protocols are TCP, which provides reliable, connection-oriented communication, and UDP, which provides simpler, connectionless communication.

Uploaded by

Sundaram Muthu
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/ 55

UNIT - IV

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

• Transmission Control Protocol (TCP) is a


connection-oriented, reliable protocol.
• TCP explicitly defines connection
establishment, data transfer, and connection
teardown phases to provide a connection-
oriented service.
• TCP uses a combination of GBN and SR
protocols to provide reliability.
TCP Services
TCP provides process-to-process communication
using port numbers.
• Stream Delivery Service
 TCP, unlike UDP, is a stream-oriented
protocol. In UDP, a process sends messages
with predefined boundaries to UDP for
delivery.
 UDP adds its own header to each of these
messages and delivers it to IP for transmission.
Each message from the process is called a user
datagram, and becomes, eventually, one IP
datagram.
• TCP, on the other hand, 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.
• Because the sending and the receiving
processes may not necessarily write or read
data at the same rate, TCP needs buffers for
storage.
• There are two buffers, the sending buffer and
the receiving buffer, one for each direction.
Segments
At the transport layer, TCP groups a number of
bytes together into a packet called a segment.
Full-Duplex Communication
TCP offers full-duplex service, where data can flow in
both directions at the same time.
Multiplexing and Demultiplexing
Like UDP, TCP performs multiplexing at the sender
and demultiplexing at the receiver.
Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented protocol.
When a process at site A wants to send to and receive
data from another process at site B, the following three
phases occur:
1. The two TCP’s establish a logical connection
between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
Reliable Service
TCP is a reliable transport protocol. It uses an
acknowledgment mechanism to check the safe
and sound arrival of data.
TCP Features
Numbering System
• There are two fields, called the sequence
number and the acknowledgment number.
• These two fields refer to a byte number and not
a segment number.
Segment
• A packet in TCP is called a segment.
Source port address.
This is a 16-bit field that defines the port number
of the application program in the host that is
sending the segment.
Destination port address.
This is a 16-bit field that defines the port number
of the application program in the host that is
receiving the segment.
Sequence number.
This 32-bit field defines the number assigned to
the first byte of data contained in this segment.
Acknowledgment number.
This 32-bit field defines the byte number that
the receiver of the segment is expecting to
receive from the other party.
Header length.
This 4-bit field indicates the number of 4-byte
words in the TCP header. The length of the
header can be between 20 and 60 bytes.
Control.
This field defines 6 different control bits or
flags, as shown in Figure.
Window size.
This field defines the window size of the
sending TCP in bytes.
Checksum.
This 16-bit field contains the checksum.
Flow Control
flow control balances the rate a producer
creates data with the rate a consumer can use
the data. TCP separates flow control from error
control.
Error Control
TCP is a reliable transport-layer protocol.
This means that an application program that
delivers a stream of data to TCP relies on TCP
to deliver the entire stream to the application
program on the other end in order, without
error, and without any part lost or duplicated.
Error control in TCP is achieved through the use of
three simple tools:
1. Checksum
2. Acknowledgment
3. time-out.
Checksum
Each segment includes a checksum field, which is
used to check for a corrupted segment.
If a segment is corrupted, as detected by an
invalid checksum, the segment is discarded by the
destination TCP and is considered as lost.
TCP uses a 16-bit checksum that is mandatory in
every segment.
Acknowledgment
TCP uses acknowledgments to confirm the
receipt of data segments.
TCP used only one type of acknowledgment:
cumulative acknowledgment.
Today, some TCP implementations also use
selective acknowledgment.
SCTP
• Stream Control Transmission Protocol
(SCTP) is a new transport-layer protocol
designed to combine some features of UDP
and TCP in an effort to create a better protocol
for multimedia communication.
SCTP Services
services offered by SCTP to the application-
layer processes.
Process-to-Process Communication
SCTP, like UDP or TCP, provides process-
to-process communication.
Multiple Streams
SCTP allows multistream service in each
connection, which is called association in
SCTP terminology.
• An SCTP association, on the other hand,
supports multihoming service.
• The sending and receiving host can define
multiple IP addresses in each end for an
association.
Full-Duplex Communication
Like TCP, SCTP offers full-duplex service, where
data can flow in both directions at the same time.
Connection-Oriented Service
Like TCP, SCTP is a connection-oriented
protocol. However, in SCTP, a connection is
called an association.
Reliable Service
SCTP, like TCP, is a reliable transport protocol. It
uses an acknowledgment mechanism to check the
safe and sound arrival of data.
Packet Format
• An SCTP packet has a mandatory general
header and a set of blocks called chunks.
• There are two types of chunks: control chunks
and data chunks.
• A control chunk controls and maintains the
association; a data chunk carries user data.
• In a packet, the control chunks come before
the data chunks.
General Header
• The general header (packet header) defines
the end points of each association to which the
packet belongs, guarantees that the packet
belongs to a particular association, and
preserves the integrity of the contents of the
packet including the header itself.
Chunks
Control information or user data are carried in
chunks.
Flow Control
Flow control in SCTP is similar to that in TCP. In TCP,
we need to deal with only one unit of data, the byte. In
SCTP, we need to handle two units of data, the byte and
the chunk.
Error Control
SCTP, like TCP, is a reliable transport-layer protocol. It
uses a SACK chunk to report the state of the receiver
buffer to the sender. Each implementation uses a
different set of entities and timers for the receiver and
sender sites.
Congestion Control
SCTP, like TCP, is a transport-layer protocol with
packets subject to congestion in the network. The SCTP
designers have used the same strategies for congestion
control as those used in TCP.
Questions
?

You might also like