What is Transport Layer?

Learn via video courses
Topics Covered

Overview

The transport layer is one of the seven OSI (Open Systems Interconnection) model layers, which manages end-to-end communication in computer networks. It sits above the network layer and below the session layer and manages end-to-end communication between devices in a network.

What is the transport layer?

The transport layer in computer networks is a crucial component of the networking stack responsible for ensuring reliable and efficient communication between two devices over a network. Its primary function is to manage end-to-end data transmission, offering services such as segmentation, error checking, flow control, and multiplexing to enable secure and efficient data transfer. It sits above the network layer and below the session layer and manages end-to-end communication between devices in a network.

What is the transport layer

Let's take a simple example to understand the role of transport layer in computer networks.

  • Imagine a computer as a large corporation with multiple sections and data packets as letters.
  • The network layer functions similarly to the Postal Service in delivering letters to the correct company address.
  • The transport layer is similar to a company's mailroom. It gets the letters and does an initial inspection.
  • Any letters damaged in transit or delivered to the wrong address are reported to the sender.
  • It then classifies the letters by department, arranges them chronologically from oldest to newest, and distributes them to the appropriate department within the organization.
  • The department, or application in this scenario, then reads the letters to construct a knowledge of the back-and-forth correspondence and conduct whatever work is required from the letter.

Working of Transport Layer

The transport layer acts as an intermediary, receiving services from the Application layer while providing services to the Network layer.

  • On the sender's side: The transport layer takes data (messages) from the Application layer and proceeds to segment it. It breaks down the original message into smaller segments, incorporates the source and destination port numbers into the segment's header, and dispatches the segmented data to the Network layer.
  • On the receiver's side: The transport layer receives data from the Network layer, reconstructs the segmented information, inspects the header to determine the port number, and then routes the message to the proper port within the Application layer.

Transport layer services

Transport layer protocols offer services that can be categorized into five distinct groups:

 Transport layer services

End-to-end delivery

In computer networking, just as the Data Link Layer relies on MAC addresses to ensure precise frame delivery and the Network Layer uses IP addresses for effective packet routing, the Transport Layer also depends on port numbers. Port numbers are essential for accurately directing data segments to the appropriate process among several concurrently running on a single host. These 16-bit addresses serve as unique identifiers for client-server programs, ensuring that data is correctly delivered to the intended destination process.

Addressing

Addressing involves the capability to establish communication with the precise application running on a computer. This addressing procedure commonly employs network ports to allocate distinct port numbers to both the sending and receiving applications residing on a machine. The combination of the IP address utilized in the network layer and the port number within the transport layer results in a unique address for each application, ensuring precise identification and communication.

Reliable delivery

Reliability in the context of network data transmission refers to the system's capability to address potential errors that may occur during data transfer. If data undergoes unintended alterations during transit, error correction mechanisms and checksums are in place to identify and rectify these issues. If a data packet is lost during transmission, it is recognized, and the system initiates a retransmission process. Furthermore, if a single packet is inadvertently duplicated, it can be detected and subsequently discarded. Additionally, the system can transmit acknowledgments upon successfully receiving packets to ensure guaranteed data delivery. Some protocols even include mechanisms to notify the sender if a packet is either missing or corrupted.

Flow control

Flow control within the transport layer refers to its capability to prevent the transmission of data beyond what the network can reliably handle. This involves buffering both outgoing and incoming data until sufficient network capacity is available for smooth transmission. In cases where the receiver's buffer reaches its capacity, the sending rate is adjusted downward to avoid overwhelming the recipient.

Flow control

Additionally, flow control encompasses congestion control mechanisms. In the event of excessive retransmission messages flooding the network, which could lead to network saturation and hinder recovery, congestion control steps in. It achieves this by employing dynamic retransmission timers and employing a gradual "slow start" approach to control the flow of data, ensuring network stability and preventing congestion-related issues.

Multiplexing

Multiplexing, often described as a many to one process, involves consolidating data from multiple sender processes into a single packet, which includes appropriate headers. This consolidated packet is then transmitted as a unified entity. Multiplexing enables the concurrent utilization of various processes on a host within a network environment, with each process being distinguished by its unique port number.

Conversely, at the receiver's end, there is a need for demultiplexing, referred to as a one to many operation. Demultiplexing becomes essential when incoming messages must be distributed to various recipient processes. Within this framework, the transport layer plays a vital role by receiving data segments from the network layer and effectively distributing and delivering them to the corresponding processes running on the receiver's machine.

Protocols of Transport Layer

UDP and TCP are the two most widely used transport layer protocols.

UDP (User Datagram Protocol) is a simple and high-speed transport protocol designed for connectionless transmissions. Its reliability is lower because it lacks acknowledgments and retransmission mechanisms, potentially leading to packet loss. UDP is best suited for scenarios where speed of delivery takes precedence over reliability, such as video conferencing, where real-time data transfer is critical.

TCP (Transmisson Control Protocol), in contrast, is a more feature-rich transport protocol. It operates in a connection-oriented manner, employing synchronization and acknowledgment messages to guarantee data delivery. TCP is capable of retransmitting and rearranging packets as needed and can negotiate transmission rates. While TCP offers higher reliability, it tends to be slower than UDP. Nevertheless, TCP remains the most prevalent protocol on the internet due to its versatility and comprehensive functionality.

Conclusion

  • The transport layer is one of the seven OSI (Open Systems Interconnection) model layers, which manages end-to-end communication in computer networks.
  • The transport layer sits above the network layer and below the session layer and manages end-to-end communication between devices in a network.
  • The primary function of transport layer is to manage end-to-end data transmission, offering services such as segmentation, error checking, flow control, and multiplexing to enable secure and efficient data transfer.
  • UDP and TCP are the two most widely used transport layer protocols.