DEV Community

Khushi Nandwani
Khushi Nandwani

Posted on

Seven Layers That Explain Almost Every Network Problem 🌐

Before the OSI Model

In the early days of computer networking, different vendors often developed their own networking technologies and protocols.
An IBM mainframe might use IBM’s networking stack, while a DEC system used DEC’s protocols and a Xerox system followed Xerox’s approach. Each system could work well on its own, but getting systems from different vendors to communicate with each other was much more difficult.
The problem was not that networking itself was impossible. The problem was that there was no common framework that clearly defined how different networking responsibilities should work together.
This created vendor dependency. If an organization invested heavily in one vendor’s networking technology, adding equipment from another vendor could require significant additional engineering to make the systems communicate.

The Problem, Simply Explained

The underlying problem was a lack of standardization.
There was no widely accepted way to separate networking responsibilities.
For example:

  • Who should handle physical transmission?
  • Who should handle addressing?
  • Who should decide where packets should go?
  • Who should handle lost or corrupted data?
  • How should applications communicate across the network?

Without clear boundaries, vendors could build complete networking systems in different ways, making interoperability more difficult.
What was needed was a common way to organize and describe the different responsibilities involved in network communication.

Why OSI Was Introduced

In 1984, the International Organization for Standardization (ISO) published the OSI (Open Systems Interconnection) reference model. The OSI Model was not a networking protocol, but a conceptual framework for understanding how network communication could be divided into separate responsibilities. Instead of treating networking as one large process, it divided communication into seven layers, with each layer responsible for a specific function and interacting with the layers above and below it.

This separation made networking easier to design, standardize, understand, and troubleshoot. For example, an application does not need to know whether the underlying network uses Ethernet, Wi Fi, or fiber, just as the physical network does not need to understand what application data is being transmitted. This separation of responsibilities is one of the most important ideas behind the OSI Model.

The OSI Model: Seven Layers from Sender to Receiver

THE OSI MODEL

The Seven Layers of the OSI Model

Physical Layer

The Physical Layer is responsible for transmitting raw bits, represented as electrical signals, light pulses, or radio signals. It deals with physical components such as cables, connectors, and wireless signals.

Data unit: Bits

Data Link Layer

The Data Link Layer handles communication between devices on the same local network. It uses MAC addresses and organizes data into frames. Technologies such as Ethernet and Wi Fi primarily operate at this layer.

Data unit: Frame

Network Layer

The Network Layer is responsible for IP addressing and routing. It determines how packets move from one network to another, often passing through multiple routers before reaching their destination.

Data unit: Packet

Transport Layer

The Transport Layer provides communication between applications running on different systems. TCP provides reliable and ordered delivery, while UDP provides a simpler connectionless communication method. Ports are also used at this layer to identify specific services or applications.

Protocols: TCP, UDP
Data unit: Segment for TCP, Datagram for UDP

Session Layer

The Session Layer manages communication sessions between applications. It is responsible for establishing, maintaining, and terminating sessions. In modern networks, these responsibilities are often handled by protocols at other layers, so this layer is not always visible as a separate component.

Presentation Layer

The Presentation Layer is concerned with how data is represented and understood by different systems. It can handle tasks such as data formatting, encryption, decryption, compression, and character encoding.

Application Layer

The Application Layer is closest to the applications that use network communication. It includes protocols such as HTTP, HTTPS, DNS, SSH, and SMTP, which allow applications to communicate over a network.
The application itself is not the OSI Application Layer. Rather, the layer represents the network protocols and services used by applications.

OSI Layers and Their Common Protocols

Layer Name Common Protocols / Technologies
7 Application HTTP, HTTPS, DNS, DHCP, FTP, SSH, SMTP, SNMP
6 Presentation TLS/SSL, JPEG, PNG, JSON, XML
5 Session RPC, NetBIOS, SMB, SIP
4 Transport TCP, UDP
3 Network IPv4, IPv6, ICMP, IPsec, OSPF
2 Data Link Ethernet, Wi-Fi, PPP, HDLC
1 Physical USB, Bluetooth, Fiber

From Layers to Data Transfer

Now that we understand what each OSI layer is responsible for, the next question is: how do these layers actually work together when data is sent across a network?

When one device sends data to another, the data moves down through the layers on the sender’s side. Each layer adds the information needed for its role before passing the data to the layer below it. At the receiving end, the process happens in reverse, with each layer processing the information intended for it.

This process is known as encapsulation and decapsulation, and understanding it helps connect the individual OSI layers to what actually happens when data travels across a network.

Encapsulation and Decapsulation

Encapsulation and Decapsulation

When data travels from one computer to another, it changes as it moves through the OSI layers

Encapsulation happens on the sender’s side. As data moves down the layers, each relevant layer adds information required for communication. The application starts with data, the Transport Layer adds its header to create a segment, the Network Layer adds an IP header to create a packet, and the Data Link Layer adds a frame header and trailer to create a frame. Finally, the Physical Layer converts it into bits for transmission.

Data → Segment → Packet → Frame → Bits

At the receiving computer, the reverse process takes place. This is called decapsulation. Each layer processes and removes the information added by the corresponding layer until the original data reaches the application.

Bits → Frame → Packet → Segment → Data

In simple terms, encapsulation prepares and wraps the data for transmission, while decapsulation unwraps and delivers the data to the receiving application.

If modern networking doesn't actually follow seven clean layers, why am I learning this?

Modern networks do not strictly follow all seven OSI layers. The Internet primarily uses the TCP/IP model, with some OSI layers combined or handled differently in practice.

However, the OSI Model remains useful for understanding and troubleshooting networks. When something goes wrong, thinking in layers helps you identify where the problem is, whether it is related to DNS, TCP, IP, or the application itself. The real value of OSI is not memorizing the seven layers, but using them as a structured way to troubleshoot network problems.

Wrapping Up

The OSI Model gives us a structured way to understand how network communication works, from physical signals to application level protocols. More importantly, it provides a useful framework for identifying and troubleshooting network problems.

Top comments (0)