Transport Layer in OSI Model

Last Updated : 9 Jan, 2026

The Transport Layer is the OSI Layer 4 responsible for providing reliable, efficient, and ordered end-to-end communication between applications on different hosts.

  • Operates at Layer 4 (Transport Layer) of the OSI model
  • Enables process-to-process communication using port numbers
  • Ensures reliability through error control, sequencing, and retransmission
  • Supports flow control to prevent receiver overload
  • Uses protocols like TCP, UDP, and SCTP for different application needs
28
Transport Layer in OSI Model

Functions of Transport Layer

The Transport Layer is responsible for end-to-end communication of data packets. It provides a number of important functions that are responsible for reliable, efficient, and organized data transfer between host systems in a networked environment.

The primary functions of the Transport Layer are:

  • Provides end-to-end data delivery
  • Ensures reliable and ordered data transfer
  • Performs error detection and recovery
  • Controls data flow to prevent receiver overload
  • Supports multiplexing and demultiplexing using port numbers

To read in detail about services offered by transport layer, refer to Transport Layer Services

Working of Transport Layer

The Transport Layer provides logical communication between processes on different hosts meaning that even though data travels across various physical networks, the communicating applications perceive a direct, reliable link.

Working of Transport-layer

  • Implemented only in end systems, not in intermediate routers.
  • Uses port numbers to identify sending and receiving applications.
  • Supports process-to-process delivery, enabling multiple applications to share a single network connection.
  • Performs multiplexing and demultiplexing using port numbers to direct data to the correct process.
  • Divides data from upper layers into segments (TCP) or datagrams (UDP) and adds necessary headers.
  • Handles error detection, retransmission, and sequencing to maintain reliable communication.
  • Coordinates flow control to ensure the receiver is not overloaded.
  • Communicates with the Network Layer, which handles addressing and routing, to send data across networks.
  • At the receiving end, it removes headers, reassembles data, and passes it to the appropriate application.

3-Way Handshake

The 3-Way Handshake ensures both client and server are ready before data transmission begins:

Step 1: SYN (Client -> Server)

  • Client sends a TCP segment with SYN=1, including its ISN (Initial Sequence Number).
  • Marks the request to initiate a connection

Step 2: SYN‑ACK (Server -> Client)

  • Server replies with SYN=1 & ACK=1, containing its own ISN and ACK = client_ISN + 1.
  • Confirms receipt of client’s SYN and initiates its own sync

Step 3: ACK (Client -> Server)

  • Client sends an ACK=1 segment with ACK = server_ISN + 1.
  • Completes synchronization; connection enters ESTABLISHED state

Why not just two steps?

With only SYN and SYN-ACK, neither the client nor the server can be sure that the other has successfully received the messages. The third ACK provides mutual confirmation, ensuring both sides are ready before data transfer begins.

Transport Layer Protocols

Transport Layer Protocol uses different protocol for the better communication between two ends uses of protocol may differ from specifications. Below mention are some protocols used in Transport Layer

1. Transmission Control Protocol(TCP)

  • TCP is connection-oriented Protocol.
  • TCP is reliable protocol.
  • As TCP is connection-oriented protocol, so first the connection is established between two ends and then data is transferred and then the connection is terminated after all data being sent.

2. User Datagram Protocol (UDP)

  • UDP is not reliable protocol
  • The protocol UDP is connectionless.
  • When speed and size are more important than security and dependability, this kind of protocol is employed.
  • The data from the higher layer is supplemented with transport-level addresses, checksum error control, and length information by UDP, an end-to-end transport level protocol.
  • A user datagram is the packet that the UDP protocol generates.

3. Stream Control Transmission Protocol (SCTP)

  • Many Internet applications use SCTP to perform transport layer duties, similar to User Datagram Protocol (UDP) and Transmission Control Protocol (TCP).
  • On top of a connectionless packet network like IP, SCTP is a dependable transport protocol that facilitates data transfer over the network in scenarios involving one or more IP addresses.

Difference Between TCP and UDP at Transport Layer

Choosing between TCP and UDP depends on the application's need for reliability versus speed and efficiency.

transport_layer_protocols
TCP vs UDP

TCP

UDP

TCP is a connection-oriented protocol

UDP is the connection-less protocol

TCP supports error-checking mechanisms. 

UDP has only the basic error-checking mechanism using checksums.

An acknowledgment segment is present.

No acknowledgment segment.

TCP is slower than UDP

UDP is faster, simpler, and more efficient than TCP.

Retransmission of lost packets is possible in TCP, but not in UDP.

There is no retransmission of lost packets in the User Datagram Protocol (UDP)

TCP has a (20-60) bytes variable length header.

The header length is fixed of 8 bytes.

Comment

Explore