What is the OSI Model?
OSI (Open Systems Interconnection) is a reference model developed by the
International Organization for Standardization (ISO) in 1984.
It describes how data travels from an application on one computer to an
application on another computer through a network.
Instead of treating communication as one large process, the OSI Model
divides it into seven separate layers, where each layer performs a specific
task.
This layered approach makes networking:
- Easier to understand
- Easier to develop
- Easier to troubleshoot
- Easier to standardize across different vendors and technologies
Why Was the OSI Model Created?
Before standardized networking models existed, different manufacturers used
their own communication methods, making interoperability difficult.
The OSI Model was introduced to:
- Standardize network communication
- Allow devices from different vendors to communicate
- Simplify network design
- Improve troubleshooting
- Enable independent development of networking technologies
Think of the OSI Model as a blueprint for network communication.
Just as a building blueprint divides construction into electrical,
plumbing, and structural work, the OSI Model divides communication into
manageable layers.
Characteristics of the OSI Model
The OSI Model has several important characteristics:
1. Layered Architecture
The communication process is divided into seven independent layers.
Each layer:
- Performs a specific task
- Communicates with adjacent layers
- Operates independently
2. Modularity
Changes made in one layer usually do not affect other layers.
For example, a new routing protocol can be introduced without changing
application software.
3. Standardization
The OSI Model provides a common language for network engineers
worldwide.
4. Easier Troubleshooting
Network problems can be isolated to a specific layer, making diagnosis much
simpler.
Upper Layers vs Lower Layers
The OSI Model is often divided into two groups:
Upper Layers (Layers 5–7)
- Session Layer
- Presentation Layer
- Application Layer
These layers focus on user applications and software services.
Lower Layers (Layers 1–4)
- Physical Layer
- Data Link Layer
- Network Layer
- Transport Layer
These layers handle actual data transmission across networks.
The 7 Layers of the OSI Model
The OSI Model consists of the following seven layers:
Layer 1: Physical Layer
The Physical Layer is the lowest layer of the OSI Model.
It is responsible for transmitting raw bits (0s and 1s) over a physical
medium.
Functions of Physical Layer
Data Transmission
Converts data into:
- Electrical signals
- Light signals
- Radio waves
Physical Connections
Defines how devices connect physically.
Examples:
- Ethernet cables
- Fiber-optic cables
- Wireless signals
Transmission Modes
Supports:
- Simplex
- Half-Duplex
- Full-Duplex
Network Topology
Defines physical arrangements such as:
- Bus
- Star
- Ring
- Mesh
Real-World Example
When you connect your laptop to a router using an Ethernet cable, the
Physical Layer is responsible for transmitting electrical signals through
that cable.
Layer 2: Data Link Layer
The Data Link Layer ensures reliable communication between two devices on
the same network.
It converts raw bits into structured units called Frames.
Functions of Data Link Layer
Framing
Encapsulates data into frames.
Physical Addressing
Uses MAC Addresses to identify devices on a local network.
Example:
00:1A:2B:3C:4D:5E
Error Detection
Uses techniques such as:
CRC (Cyclic Redundancy Check)
to detect corrupted frames.
Flow Control
Controls transmission speed between sender and receiver.
Access Control
Determines which device can use the communication channel at a given
time.
Data Link Sublayers
Logical Link Control (LLC)
- Manages communication with Network Layer
- Performs flow control
Media Access Control (MAC)
- Controls access to transmission media
- Handles MAC addressing
Real-World Example
When your computer sends data to a nearby printer over a LAN, the Data Link
Layer uses MAC addresses to ensure the frame reaches the correct
device.
Layer 3: Network Layer
The Network Layer is responsible for logical addressing and routing.
Its main job is to determine the best path for data to travel.
Functions of Network Layer
Logical Addressing
Uses IP addresses such as:
192.168.1.10
or
2001:db8::1
Routing
Determines the best path between source and destination.
Packet Forwarding
Moves packets from one network to another.
Internetworking
Connects multiple networks together.
Common Protocols
- IPv4
- IPv6
- ICMP
Devices
- Routers
- Layer 3 Switches
Real-World Example
When you visit a website hosted in another country, routers use the Network
Layer to find the best route across the Internet.
Layer 4: Transport Layer
The Transport Layer provides end-to-end communication between
devices.
It ensures data arrives correctly and in the proper order.
Functions of Transport Layer
Segmentation
Breaks large messages into smaller segments.
Reassembly
Combines segments at the destination.
Error Recovery
Detects lost segments and retransmits them.
Flow Control
Prevents network congestion.
Port Addressing
Uses port numbers to identify applications.
Transport Layer Protocols
TCP (Transmission Control Protocol)
Features:
- Reliable
- Connection-oriented
- Error recovery
- Packet ordering
Used by:
- Web browsing
- File transfer
UDP (User Datagram Protocol)
Features:
- Faster
- Connectionless
- No acknowledgment
Used by:
- Video streaming
- Online gaming
- Voice calls
Real-World Example
When downloading a file, TCP ensures every segment arrives correctly and in
the proper sequence.
Layer 5: Session Layer
The Session Layer establishes, manages, and terminates communication
sessions between applications.
Think of it as a meeting coordinator.
Functions of Session Layer
Session Establishment
Starts communication between devices.
Session Maintenance
Keeps communication active.
Session Termination
Ends communication properly.
Synchronization
Creates checkpoints during data transfer.
If communication fails, transmission can restart from the last checkpoint
rather than from the beginning.
Real-World Example
A video conference between two users requires session management to keep
communication active throughout the meeting.
Layer 6: Presentation Layer
The Presentation Layer acts as the translator of the OSI Model.
It ensures that data sent by one system can be understood by another.
Functions of Presentation Layer
Translation
Converts data formats between systems.
Encryption
Protects sensitive information.
Examples:
SSL/TLS encryption
Secure banking transactions
Compression
Reduces data size for faster transmission.
Common in:
- Audio files
- Videos
- Images
Real-World Example
When you access a secure website using HTTPS, encryption performed by TLS
operates largely at this layer's functionality.
Layer 7: Application Layer
The Application Layer is the layer closest to the user.
It provides network services directly to applications.
Functions of Application Layer
File Transfer
Allows file sharing between systems.
Email Services
Supports email communication.
Directory Services
Provides access to distributed databases and directory information.
Network Resource Access
Allows users to access web servers, cloud services, and printers.
Real-World Example
When you open Gmail in a browser, the Application Layer provides the
services necessary for email communication.
How Data Travels Through the OSI Model
Let's understand the process using a practical example.
Imagine you send an email from New York to London.
Sender Side
Layer 7 – Application
The email application creates the message.
Layer 6 – Presentation
The message is encrypted and formatted.
Layer 5 – Session
A communication session is established.
Layer 4 – Transport
TCP divides the message into segments.
Layer 3 – Network
IP addresses are added.
Layer 2 – Data Link
Frames and MAC addresses are added.
Layer 1 – Physical
Data becomes electrical, optical, or wireless signals.
The signals travel through cables, routers, switches, and network
devices.
Receiver Side
The reverse process occurs:
- Physical Layer receives signals.
- Data Link Layer reconstructs frames.
- Network Layer processes IP packets.
- Transport Layer reassembles segments.
- Session Layer maintains communication.
- Presentation Layer decrypts data.
- Application Layer displays the email.
This process is known as Encapsulation and Decapsulation.
Advantages of the OSI Model
Standardization
Provides a universal networking framework.
Easier Troubleshooting
Problems can be isolated layer by layer.
Vendor Independence
Devices from different manufacturers can communicate.
Scalability
Supports future technologies without redesigning entire systems.
Modular Design
Each layer can evolve independently.
Limitations of the OSI Model
Although highly useful for learning, the OSI Model has some
limitations:
- It is mainly a conceptual model.
- Some layers overlap in functionality.
- Real-world networks primarily use TCP/IP.
- Not all protocols fit perfectly into the seven-layer structure.
Easy Way to Remember All Layers
Top to Bottom:
All People Seem To Need Data Processing
- Application
- Presentation
- Session
- Transport
- Network
- Data Link
- Physical
Bottom to Top:
Please Do Not Throw Sausage Pizza Away
- Physical
- Data Link
- Network
- Transport
- Session
- Presentation
- Application