It's complicated about simple things. Transport layer (L4) of the OSI model

Greetings, colleagues! My name is ProstoKirReal , and today we will continue our journey through the OSI model by discussing the transport layer (L4). This layer plays a key role in ensuring reliable data transfer. Previous parts: It's complicated about simple things. Physical la

Editor's Context

This article is an English adaptation with additional editorial framing for an international audience.

  • Terminology and structure were localized for clarity.
  • Examples were rewritten for practical readability.
  • Technical claims were preserved with source attribution.

Source: original publication

Illustration for It's complicated about simple things. Transport layer (L4) of the OSI model

Greetings, colleagues! My name is ProstoKirReal, and today we will continue our journey through the OSI model by discussing the transport layer (L4). This layer plays a key role in ensuring reliable data transfer.

Previous parts:


  • It's complicated about simple things. Physical layer (L1) of the OSI model
  • It's complicated about simple things. Link layer (L2) of the OSI model
  • It's complicated about simple things. Network layer (L3) of the OSI model

All seven layers of the OSI model can be divided into two categories:

  • Media Layers (environment levels);
  • Host Layers.

Media Layers


These layers (L1 - L3) focus on transmitting data over various media, be it cable or wireless networks. They are used by network devices such as switches and routers and provide physical and logical communication between devices.

Host Layers


These layers (L4 - L7) operate directly on end devices such as computers and mobile devices. They process data and run applications.

The Transport Layer is the link between Host Layers and Media Layers, although it is closer to Host Layers. Its main task is to transport data packets, ensuring the reliability and integrity of data transfer between applications on different devices.

What is the transport layer?


The Transport Layer is the fourth layer in the seven-layer open systems interconnection model. It is responsible for providing reliable and efficient data transfer between network nodes. The transport layer serves as a link between the lower layers, which deal with the physical transfer of data, and the upper layers, which ensure the operation of applications.

Main tasks of the transport layer


1. Data segmentation and assembly


  • Segmentation: Data received from upper layers is broken down into smaller pieces called segments to facilitate transmission across the network. Each segment is provided with a header containing information about the segment number and its place in the general data stream.
  • Assembly: At the receiving end, the transport layer assembles the segments into the original data stream using information from the segment headers.

2. Data flow control


  • Baud rate control: The transport layer regulates the data transfer rate to prevent network congestion and data loss. This process is called flow control.
  • Sliding windows: To control data flow, TCP uses sliding windows, which determine the amount of data that can be sent before receiving an acknowledgment from the recipient.

3. Error control


  • Error detection: segments are equipped with a checksum, which allows you to detect errors that occur during data transmission.
  • Bug fixes: If an error is detected, the segment may be resent. The TCP protocol uses acknowledgment (ACK) mechanisms to inform the sender that the segment has been received without errors.

4. Reliable data transfer


  • Acknowledgment of receipt (ACK): Transport layer protocols such as TCP provide reliable data transmission by sending acknowledgments when segments have been received. If segments are lost or damaged, the sender retransmits the segments.
  • Three-way handshake: The connection setup process in TCP involves the exchange of three packets to establish communication between the sender and the recipient, ensuring synchronization and reliability.

5. Multiplexing


  • Channel Separation: The transport layer allows multiple applications to use the same network channel by assigning each application a unique port. This is called multiplexing and demultiplexing.
  • Ports: Each port identifies a specific application or process, allowing the transport layer to direct data to the desired application.

Ports? What are the differences with the ports on a computer?


Ports on the computer


Physical ports on a computer are connectors into which you can connect various devices. For example:

  • USB port for connecting flash drives, mice and keyboards.
  • HDMI port for connecting a monitor or TV.
  • Audio port for connecting headphones or speakers.
  • Each of these ports has its own purpose and helps connect the device to the computer so that it can perform its function.

Ports at the transport layer


Now imagine that inside your computer there are many doors, they are designed for programs. These doors are called ports at the transport layer. They help direct data to the desired program inside the computer or server.

  • Port 80: it is the door to the web browser through which web pages come.
  • Port 25: this is the door for the email program through which letters arrive.
  • Port 21: this is the door to the file transfer program (FTP).
  • Thus, ports at the transport layer and physical ports on a computer have a similar function: they provide the correct connection and transfer of information, but they do this in different worlds - software and physical.

image

Basic transport layer protocols


TCP (Transmission Control Protocol)


TCP is one of the most common transport layer protocols. It provides reliable, connection-oriented data transmission. Main characteristics of TCP:

  • Compound: TCP establishes a connection before transmitting data through a three-way handshake.
  • Reliability: TCP ensures that data is delivered without loss and in the correct order. Uses acknowledgment (ACK) and lost segment retransmission mechanisms.
  • Flow control: TCP regulates the data transfer rate to avoid network congestion.
  • Error control: TCP uses checksums to detect errors and retransmission mechanisms to correct them.

UDP (User Datagram Protocol)



UDP is another popular transport layer protocol that differs from TCP in its simplicity and lower network load. Main characteristics of UDP:

  • Without connection establishment: UDP does not establish a connection before transmitting data, which reduces latency.
  • Unreliability: UDP does not guarantee data delivery, transmission order, or integrity. It does not use acknowledgments or segment retransmissions.
  • Simplicity and speed: UDP provides minimal latency and is used in applications where transmission speed is important rather than reliability.

image

Other transport layer protocols


SCTP (Stream Control Transmission Protocol)


SCTP is a transport layer protocol that combines features of TCP and UDP. It supports multi-threading, which allows you to transfer multiple data streams within a single connection. SCTP also provides reliable data transmission like TCP and is used for applications that require managing multiple data streams simultaneously, such as IP telephony.

DCCP (Datagram Congestion Control Protocol)


DCCP is a protocol that offers congestion control features without the reliability of TCP. It is designed for applications that require congestion control but can tolerate data loss, such as streaming media and online gaming.

RTP (Real-time Transport Protocol)


RTP is used in applications that require real-time delivery of data, such as audio and video conferencing. RTP often works in conjunction with UDP to minimize latency.

Transport Layer Issues


Despite the importance and functionality of the transport layer, there are problems that can arise at this layer:

1. Packet loss


Data packets may be lost in transit due to network congestion, routing errors, or hardware problems. TCP solves this problem by retransmitting lost packets, whereas UDP does not offer such mechanisms.

2. Network congestion


High network load can lead to delays and data loss. TCP uses congestion control algorithms such as the Slow Start algorithm and the Congestion Avoidance algorithm to adapt the data transfer rate.

3. Connection failure


In TCP, connection failures are possible, which can result in data loss or the need to re-establish the connection. Protocols must be resilient to such failures and ensure restoration of data transmission.

4.  Latency and jitter


Data delays and jitter (latency fluctuations) can negatively impact the performance of real-time applications such as IP telephony and video conferencing. RTP and SCTP were designed with these requirements in mind to minimize the impact of latency and jitter.

5. Security


The transport layer can be vulnerable to attacks such as sniffing, man-in-the-middle (MITM) attacks, and DDoS attacks. Data protection at the transport layer is carried out using security protocols such as TLS (Transport Layer Security), which provides encryption and authentication of data.

6. Packets out of sequence (Reordering)


Data packets may arrive out of order due to different routes used on the network or due to congestion on the routers. TCP solves this problem by numbering the segments and assembling them in the correct order. When out-of-sequence packets are detected, TCP uses buffering and retransmission mechanisms.

Solutions to Transport Layer Problems


To solve these problems, the transport layer uses various methods and mechanisms.

  • Retransmission of data: TCP provides retransmission of lost packets to ensure reliable delivery of data.
  • Overload management: Congestion control algorithms such as Slow Start and Congestion Avoidance help prevent network congestion and ensure stable data transmission.
  • Error control: the use of checksums and confirmation mechanisms help detect and correct errors in data transmission.
  • Buffering and data collection: TCP uses segment numbering and buffering to assemble data in the correct order and solve the problem of out-of-sequence packets.
  • Encryption and authentication: Security protocols such as TLS protect data from interception and attacks.

Examples of use


TCP


  • Web browsing: The HTTP protocol and its secure version HTTPS use TCP to reliably transfer web pages and data between the browser and the server.
  • E-mail: SMTP, IMAP, and POP3 protocols use TCP to transmit email messages.
  • File transfer: FTP (File Transfer Protocol) uses TCP to transfer files securely between devices.

UDP


  • Video conferencing: Protocols used for video conferencing, such as RTP (Real-time Transport Protocol), often use UDP to minimize latency.
  • Streaming audio and video: Media streaming applications often use UDP to provide fast data transfer.
  • DNS queries: The DNS (Domain Name System) protocol uses UDP to quickly resolve domain names into IP addresses.
  • Online games: many online games use UDP to quickly transfer game state data between servers and players.

SCTP


  • IP telephony: SCTP is used for data transmission in IP telephony, providing reliable transmission and management of multiple data streams.

DCCP


  • Streaming media: DCCP is used for streaming media applications where congestion control is important but data loss is not critical.
  • RTP
  • Audio and video conferences: RTP is used to transmit audio and video in real time, minimizing latency and ensuring data synchronization.

Why is SSL/TLS classified as layer 4 (transport) of the OSI model?


Many sources write that SSL/TLS is classified as the fourth level. Here's what I managed to find out about this, if you don't agree Welcome in the comment.

SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are cryptographic protocols that provide secure data transmission over the network. Although they can operate at different layers of the OSI model, they are often classified as the transport layer.

Encryption and security of data at the transport layer


SSL/TLS provides encryption for data sent over a network by adding a security layer on top of transport protocols such as TCP. The main purpose of SSL/TLS is to protect data from interception and tampering during transmission. Data encryption is performed at the transport layer, providing a secure channel between the client and server.

Establishing a secure connection


SSL/TLS manages the process of establishing a secure connection, which includes:

  1. Authentication: certificates are used to authenticate servers and, in some cases, clients.
  2. Encryption: both parties agree on encryption methods to protect the data being transmitted.
  3. Key exchange: creating and exchanging symmetric keys to encrypt data during a session.

Transparency for applications


SSL/TLS operates on top of the transport layer (TCP) and under the application layer (HTTP, FTP, etc.). This makes them transparent to applications that use a secure connection, but does not change their behavior based on the presence of SSL/TLS.

Example of how SSL/TLS works


When establishing a secure connection using HTTPS (HTTP over TLS).

1. Client initiates a connection to the server via TCP.
2. SSL/TLS begins the “handshake” process, during which:

  • The client and server exchange certificates for authentication.
  • The parties agree on encryption methods and keys.
  • After the handshake is successfully completed, the data between the client and server is transferred in encrypted form.

TCP header fields that may change during encryption


1. Sequence Number


  • Why it may change: The sequence number is incremented by the length of the data that was sent. When encrypted, the volume of data may increase due to the addition of overhead information (for example, TLS headers). This causes the sequence numbers to change.
  • How does this relate to encryption: Encrypted data is often larger in size than the original data due to the addition of overhead and block alignment.

2. Acknowledgment Number


  • Why it may change: The acknowledgment number indicates the next expected data sequence number from the sender. It changes in response to receiving data.
  • How does this relate to encryption: The recipient must confirm receipt of the encrypted data, which affects the change in the acknowledgment number.

3. Window Size


  • Why it may change: The window size controls how much data can be sent before an acknowledgment is received. This field may change depending on the current state of the recipient's buffer.
  • How does this relate to encryption: Data volume may increase due to encryption, which may affect flow control and window size.

4. Checksum


  • Why it may change: The checksum is recalculated for each segment to ensure data integrity.
  • How does this relate to encryption: Changes in data (encryption) require recalculation of the checksum for each segment.

SSL and TLS are critical protocols for keeping data secure on the Internet. Their work involves several layers of the OSI model, but their main role - providing a secure transport channel - belongs to the transport layer. They add encryption and authentication to TCP connections, making them transparent to applications and protecting data from eavesdropping and tampering.
 

Conclusion


The transport layer of the OSI model plays a key role in ensuring reliable and efficient data transmission in networks. It provides data segmentation and assembly mechanisms, flow control, error control, and reliable data delivery. The TCP and UDP protocols, as well as other transport layer protocols such as SCTP, DCCP and RTP, are used in a variety of applications to provide reliable and fast data transfer. Addressing problems such as packet loss, network congestion, link failures, latency, jitter, and out-of-sequence packets makes the transport layer an important component of modern network infrastructure.



📚 Read also:
  • ➤ Unknown Windows 11 23H2 build 10.0. 25398.1 based on Windows Server 23H2. For gamers and for old hardware
  • ➤ Requests and limits in Kubernetes: understanding the details
  • ➤ NAND and eMMC testing
  • ➤ My smart light: or how I developed my lighting control module
  • ➤ How "Corsairs 3" was created

News, product reviews and competitions from the Timeweb.Cloud team - in our Telegram channel

Illustration for It's complicated about simple things. Transport layer (L4) of the OSI model

Why This Matters In Practice

Beyond the original publication, It's complicated about simple things. Transport layer (L4) of the OSI model matters because teams need reusable decision patterns, not one-off anecdotes. Greetings, colleagues! My name is ProstoKirReal , and today we will continue our journey through the OSI model by discussing the transport l...

Operational Takeaways

  • Separate core principles from context-specific details before implementation.
  • Define measurable success criteria before adopting the approach.
  • Validate assumptions on a small scope, then scale based on evidence.

Quick Applicability Checklist

  • Can this be reproduced with your current team and constraints?
  • Do you have observable signals to confirm improvement?
  • What trade-off (speed, cost, complexity, risk) are you accepting?

FAQ

What is this article about in one sentence?

This article explains the core idea in practical terms and focuses on what you can apply in real work.

Who is this article for?

It is written for engineers, technical leaders, and curious readers who want a clear, implementation-focused explanation.

What should I read next?

Use the related articles below to continue with closely connected topics and concrete examples.