OSI Model

Table of contents
- 🧠 The OSI Model
- 🎮 Imagine This:
- 📚 OSI Layers Mnemonic:
- 🔼 Layer 7: Application Layer – “Let’s Play!”
- 🎨 Layer 6: Presentation Layer – “Graphics, Sounds, and Security”
- 🔌 Layer 5: Session Layer – “Let’s Connect”
- 📦 Layer 4: Transport Layer – “Send It Reliably”
- 🛰️ Layer 3: Network Layer – “Find the Way”
- 🔗 Layer 2: Data Link Layer – “Local Delivery”
- 🧱 Layer 1: Physical Layer – “The Real Wires”
- 🔄 Software vs Hardware in OSI Model
- 🧵 Final Summary: Gaming the OSI Model
🧠 The OSI Model
OSI (Open Systems Interconnection) Model is a framework that standardizes how data is transferred between two systems over a network.
It has 7 layers, each with a specific role in ensuring smooth, secure, and reliable communication.
🎮 Imagine This:
Two friends, A and B, are playing a multiplayer online game from different countries.
Let’s use this scenario to understand how the OSI Model works.
📚 OSI Layers Mnemonic:
All People Seem To Need Data Processing
(Application → Physical)
🔼 Layer 7: Application Layer – “Let’s Play!”
This is where A and B run the actual game app (e.g., PUBG, Fortnite).
This is the interface between the user and the network.
They use a browser or mobile app.
Protocols: HTTP, HTTPS, FTP, SMTP
💡 In DevOps, you work with these protocols while managing servers and web apps.
🎨 Layer 6: Presentation Layer – “Graphics, Sounds, and Security”
A and B are seeing graphics, using keyboard, listening to game sounds, and the data is encrypted.
It manages how the data is presented: format, encoding, encryption.
It converts data to be readable by the receiver.
Also responsible for SSL/TLS encryption (important in HTTPS).
🛡️ Think of this as the syntax and security formatting of the data.
🔌 Layer 5: Session Layer – “Let’s Connect”
Before playing, a connection is established between A and B (like a game lobby).
This layer establishes, maintains, and ends communication sessions.
Responsible for authentication and session management.
🔧 Examples:
API sessions: when apps talk to each other (e.g., payment gateways).
Sockets: used for real-time communication like chat, games, etc.
👉 API: Bridge between two apps (e.g., Google Maps inside Zomato app)
👉 Socket: Real-time data channel (e.g., online multiplayer game, live chat)
📦 Layer 4: Transport Layer – “Send It Reliably”
The game data like movements, actions, chat is now broken into packets and sent between A and B.
- Responsible for reliable delivery, error checking, and flow control.
Protocols:
TCP (Transmission Control Protocol) – Reliable, connection-based
UDP (User Datagram Protocol) – Faster but no guarantee (used in live games, video calls)
🧪 You’ll hear this in DevOps when setting up ports, firewalls, or troubleshooting connection issues.
🛰️ Layer 3: Network Layer – “Find the Way”
A and B’s data has to travel across the globe. So it needs routing.
Responsible for IP addressing and routing.
It finds the best path for data.
Protocol: IP (Internet Protocol)
📍 Example: Your request goes from India to the US via routers using IPs.
You can trace this using:
traceroute google.com # Linux/macOS
tracert google.com # Windows
🔗 Layer 2: Data Link Layer – “Local Delivery”
Now the data is being transferred within the same local network (e.g., from your laptop to your WiFi router).
Deals with MAC addresses, frames, and error detection.
Ensures data is sent to the right device on a local network.
👀 You can check your MAC address using:
ip link show
🧱 Layer 1: Physical Layer – “The Real Wires”
Finally, all of this data flows through real hardware – like fiber optic cables, network cards, or WiFi signals.
- Transmits 0s and 1s (binary data) over physical medium (cables, radio waves).
Includes: Cables, Switches, Hubs, Connectors, NICs.
💡 Without this, the internet wouldn’t exist physically.
🔄 Software vs Hardware in OSI Model
Layer | Handled By |
Application to Session (7–5) | Software (Apps, APIs, OS services) |
Transport to Physical (4–1) | Hardware + OS + Network tools |
🧵 Final Summary: Gaming the OSI Model
Layer | Game Analogy | Real Function |
7. Application | Running the Game | Interface for user apps |
6. Presentation | Graphics & Encryption | Data formatting, encryption |
5. Session | Connection Setup | Session control (API/Sockets) |
4. Transport | Sending Actions | Reliable data delivery (TCP/UDP) |
3. Network | Global Routing | IP addressing and routing |
2. Data Link | Local Network | MAC address & local delivery |
1. Physical | Hardware/Signals | Cables, NICs, electrical signals |
✅ Ready for DevOps?
OSI is more than theory. You’ll use it when:
Configuring ports (Layer 4)
Understanding IP routing and DNS (Layer 3)
Managing VPNs and proxies
Debugging with ping, traceroute, netstat, tcpdump, etc.
Subscribe to my newsletter
Read articles from Prashant Gohel directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Prashant Gohel
Prashant Gohel
DevOps & Cloud Enthusiast | Exploring Linux, AWS, CI/CD & Automation | Sharing hands-on notes, tips, and real-world learning as I grow into a DevOps Engineer