Transport-Layer Protocols.pptx
Transport-Layer Protocols.pptx
27-11-2025
Basics
• 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.
Position of transport-layer protocols in
the TCP/IP protocol suite
Services
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.
Port Numbers
Port numbers provide end-to-end addresses at the transport layer and
allow multiplexing and demultiplexing at this layer
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.
• UDP is a very simple protocol using a minimum of overhead.
• 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).
• The first two fields define the source and destination port numbers.
• The third field defines the total length of the user datagram, header
plus data.
UDP Services
• Process-to-Process Communication
• Connectionless Services
• Flow Control - UDP is a very simple protocol. There is no flow
control
• 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: a pseudoheader, the UDP header, and the data
coming from the application layer.
Continued…
• 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.
Pseudoheader for checksum calculation
Continued…
• Congestion Control - UDP assumes that the packets sent are
small and cannot create congestion in the network.
• Encapsulation and Decapsulation - To send a message from
one process to another, the UDP protocol encapsulates and
decapsulates messages.
• Multiplexing and Demultiplexing
• Queuing – In UDP, queues are associated with ports.
• 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.
Typical Applications
• 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 some route updating protocols such as Routing
Information Protocol (RIP).
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.
• To achieve this goal, TCP uses checksum (for error detection),
retransmission of lost or corrupted packets, cumulative and
selective acknowledgments, and timers.
TCP Services
• Process-to-Process Communication – 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. Neither IP nor UDP
recognizes any relationship between the datagrams.
• 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.
• TCP creates an environment in which the two processes seem
to be connected by an imaginary “tube” that carries their bytes
across the Internet.
Continued…
Sending and Receiving Buffers
• 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.
• These buffers are also necessary for flow- and error-control
mechanisms used by TCP.
• One way to implement a buffer is to use a circular array of
1-byte locations.
• For simplicity, the figure in the next slide shows two buffers of
20 bytes each. Normally the buffers are hundreds or thousands
of bytes, depending on the implementation.
• The figure shows the movement of the data in one direction. At
the sender, the buffer has three types of chambers.
• The white section contains empty chambers that can be filled by
the sending process (producer).
• The colored area holds bytes that have been sent but not yet
acknowledged.
• The TCP sender keeps these bytes in the buffer until it receives
an acknowledgment.
• The shaded area contains bytes to be sent by the sending TCP.
Sending and receiving buffers
Continued…
• The operation of the buffer at the receiver is simpler. The
circular buffer is divided into two areas (shown as white and
colored).
• The white area contains empty chambers to be filled by bytes
received from the network.
• The colored sections contain received bytes that can be read by
the receiving process.
• When a byte is read by the receiving process, the chamber is
recycled and added to the pool of empty chambers.
TCP segment format
• 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.
• The sequence number tells the destination which byte in this sequence
is the first byte in the 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.
• If the receiver of the segment has successfully received byte
number x from the other party, it returns x + 1 as the
acknowledgment number.
• 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
• Window size. This field defines the window size of the sending
TCP in bytes. Note that the length of this field is 16 bits, which
means that the maximum size of the window is 65,535 bytes.
• Checksum. This 16-bit field contains the checksum. The
calculation of the checksum for TCP follows the same
procedure as the one described for UDP.
Pseudoheader added to the TCP
datagram
• Urgent pointer. This 16-bit field, which is valid only if the urgent
flag is set, is used when the segment contains urgent data.