When two computers communicate over a network, many different things happen behind the scenes. Data needs to be prepared, transmitted, routed, delivered, and finally understood by the receiving application.
To make this complex process easier to understand, networking is divided into seven different layers. This layered structure is called the OSI Model.
OSI stands for Open Systems Interconnection.
The OSI Model is a seven-layer reference model that explains how data moves from one device to another over a network.
Why Do We Need the OSI Model?
Without layers, understanding network communication would be quite confusing. The OSI model divides networking responsibilities into separate layers, with each layer handling a specific job.
This helps us:
Understand how network communication works
Design and develop networking technologies
Troubleshoot network problems
Understand where different protocols and devices operate
Create a common framework for networking
Think of it like sending a parcel. One part handles the package, another handles addressing, another handles transportation, and finally the receiver gets and opens it. Each part has a different responsibility.
Seven Layers of the OSI Model
The OSI model has 7 layers:
Layer | Name | Main Function |
|---|---|---|
7 | Application | Provides network services to applications |
6 | Presentation | Handles data format, encryption, and compression |
5 | Session | Manages communication sessions |
4 | Transport | Provides end-to-end data delivery |
3 | Network | Handles IP addressing and routing |
2 | Data Link | Handles frames and local delivery |
1 | Physical | Transmits raw bits |
A simple way to visualize them is:
7. Application
6. Presentation
5. Session
4. Transport
3. Network
2. Data Link
1. Physical
Let's understand each layer in simple terms.
1. Physical Layer
The Physical Layer is the lowest layer of the OSI model. It deals with the actual transmission of raw bits (0s and 1s) through a communication medium.
It deals with things such as:
Network cables
Connectors
Radio signals
Electrical signals
Optical signals
Transmission speed
For example, when data is transmitted through an Ethernet cable, the Physical Layer is concerned with how the bits are physically represented and transmitted.
In simple words:
👉 How are bits physically sent from one device to another?
2. Data Link Layer
The Data Link Layer is responsible for reliable communication between devices on the same local network.
It works with frames and uses MAC addresses to identify devices on the local network.
This layer also provides error detection for data transmitted over the local link.
Technologies such as Ethernet and Wi-Fi are associated with this layer.
In simple words:
👉 How should data be delivered across the local network?
Example
If your laptop sends data to another computer connected to the same Wi-Fi network, the Data Link Layer helps handle that local delivery.
3. Network Layer
The Network Layer is responsible for logical addressing and routing.
This is where IP addresses are used to identify devices and networks.
Routers primarily operate at this layer. They examine the destination IP address and determine where a packet should be forwarded.
In simple words:
👉 Where should the data go?
Example
When you access a website hosted on another network, routers use IP addressing and routing information to move your packets toward the destination.
4. Transport Layer
The Transport Layer provides end-to-end communication between applications running on different devices.
It can provide services such as:
Reliable delivery
Error recovery
Flow control
Segmentation and reassembly
Two important transport protocols are:
TCP
TCP (Transmission Control Protocol) provides reliable and ordered delivery of data.
UDP
UDP (User Datagram Protocol) is simpler and has lower overhead, but it does not provide the same reliability and ordering guarantees as TCP.
In simple words:
👉 How should data be delivered between applications?
5. Session Layer
The Session Layer manages communication sessions between applications.
It can help:
Establish a session
Maintain a session
Synchronize communication
Terminate a session
Think of a session as an ongoing conversation between two applications.
In simple words:
👉 How should a communication session be managed?
6. Presentation Layer
The Presentation Layer focuses on the format and representation of data.
Its responsibilities can include:
Data translation
Encryption and decryption
Compression and decompression
For example, if two systems represent data differently, the Presentation Layer provides a way to transform the data into a suitable format.
In simple words:
👉 How should the data be represented or formatted?
7. Application Layer
The Application Layer is the top layer and is closest to the user.
It provides network-related services that applications can use.
Some protocols associated with this layer include:
HTTP/HTTPS – Web communication
DNS – Domain name resolution
FTP – File transfer
SMTP – Email transfer
For example, when you open a website in your browser, protocols such as HTTP or HTTPS are involved at the Application Layer.
In simple words:
👉 What network service does the application need?
How Data Moves Through the OSI Model
Let's say you open a website on your computer.
When your computer sends a request, the data moves down through the OSI layers:
Application
↓
Presentation
↓
Session
↓
Transport
↓
Network
↓
Data Link
↓
Physical
The data is processed by each layer before being transmitted over the network.
When the receiving computer gets the data, it moves up through the layers until the application receives the information.
Sending Device Receiving Device
Application ─────────→ Application
Presentation ─────────→ Presentation
Session ─────────→ Session
Transport ─────────→ Transport
Network ─────────→ Network
Data Link ─────────→ Data Link
Physical ─────────→ Physical
In reality, the layers on the two devices don't directly send data to their matching layer. Data travels through the actual network, while the layered model helps us understand what each layer is responsible for.
Data Units in the OSI Model
As data moves through the layers, different names are commonly used for the data:
OSI Layer | Data Unit |
|---|---|
Application | Data |
Presentation | Data |
Session | Data |
Transport | Segment / Datagram |
Network | Packet |
Data Link | Frame |
Physical | Bits |
For example:
Data → Segment → Packet → Frame → Bits
This process is called encapsulation.
At the receiving side, the process happens in reverse and is called decapsulation.
OSI Model and Network Devices
Different network devices primarily operate at different OSI layers.
Device | Commonly Associated Layer |
|---|---|
Hub | Physical |
Switch | Data Link |
Router | Network |
This is useful when troubleshooting.
For example, if a router is having a problem, you would look closely at things related to the Network Layer, such as IP addressing and routing.
Easy Way to Remember the OSI Layers
Remembering seven layers can be difficult at first. A commonly used mnemonic from Layer 7 to Layer 1 is:
A P S T N D P
You can remember it as:
All People Seem To Need Data Processing
That gives you:
A → Application
P → Presentation
S → Session
T → Transport
N → Network
D → Data Link
P → Physical
Why Is the OSI Model Important?
The OSI model is important because it gives us a standard way to understand network communication.
For example, suppose your computer cannot access a website. Instead of randomly checking everything, you can troubleshoot layer by layer:
Physical: Is the cable or wireless connection working?
Data Link: Is the local network functioning?
Network: Is the IP configuration and routing correct?
Transport: Is the connection between applications working?
Application: Is the required network service working?
This makes troubleshooting much more organized.
Conclusion
The OSI Model divides network communication into seven layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.
Each layer has a specific responsibility, and together they provide a structured way to understand how data travels between devices.
You don't need to memorize everything immediately. First understand the main idea:
Physical → moves bits → Data Link → handles local delivery → Network → routes packets → Transport → manages end-to-end delivery → Session → manages sessions → Presentation → formats data → Application → provides network services.