OSI Model
What is the OSI Model and Why Should You Care?
Everyone in networking mentions it. Very few people explain it clearly. Here's my attempt.
I once memorised the seven OSI layers for an exam, listed them perfectly, and still had no idea what any of it meant in the real world. Then I watched a packet travel from my laptop to a server and it finally clicked. Let me save you the confusion.
The problem it was built to solve
In the 1970s, every computer manufacturer had their own networking rules. IBM computers couldn't talk to Honeywell computers. The internet we have today simply would not exist. So the ISO created a universal reference model — 7 layers, each with a defined job — so any two devices following the same model could communicate, regardless of who made them.
Think of it like international shipping. There are rules for how you pack a box, label it, fill customs forms, move it by truck, ship it by sea. Each step has its own people, its own rules, its own job. The OSI model does the same thing, but for data.
The 7 layers — with real examples
Memorise this top-down: "All People Seem To Need Data Processing" — Application, Presentation, Session, Transport, Network, Data Link, Physical.
Layer 7 — Application
This is the layer you actually see. Your browser, email client, Slack — they all live here. When you type a URL and press Enter, Layer 7 creates an HTTP request. Protocols here: HTTP, HTTPS, FTP, SMTP, DNS.
Layer 6 — Presentation
Translates data into a format the application can understand. Encryption and compression happen here. TLS/SSL lives at this layer — it's why your data gets scrambled before it leaves your device.
Layer 5 — Session
Manages the "conversation" between two devices. When you start a video call, Layer 5 opens a session, keeps it alive while you're talking, and tears it down when you hang up.
Layer 4 — Transport
Handles end-to-end delivery. This is where TCP and UDP live. TCP guarantees delivery and order (used for web pages, email). UDP is faster but doesn't check for errors (used for video streaming, DNS, gaming).
Layer 3 — Network
Handles IP addresses and routing between networks. Routers live here. When your data needs to travel from your home Wi-Fi across the internet to a server in another country, Layer 3 figures out the path.
Layer 2 — Data Link
Handles MAC addresses and communication between devices on the same local network. Switches live here. Your laptop's Wi-Fi card has a MAC address — that's a Layer 2 identifier.
Layer 1 — Physical
The actual cables, electrical signals, light pulses, and radio waves. Your Ethernet cable is Layer 1. If this layer goes down, nothing else works.
How data actually travels — encapsulation
When you send data, it moves down the OSI stack, picking up a "wrapper" (header) at each layer. This is called encapsulation. The receiving device strips those wrappers in reverse order.
Your browser creates: [HTTP request]
Layer 6 encrypts: [TLS | HTTP]
Layer 4 adds port: [TCP header | TLS | HTTP]
Layer 3 adds IP: [IP header | TCP | TLS | HTTP]
Layer 2 adds MAC: [Ethernet frame | IP | TCP | TLS | HTTP]
Layer 1: electrical signals → sent over the wire
Receiving side does the reverse → strips each header → app gets original HTTP
Why this matters for security
Every attack targets a specific layer. ARP poisoning is Layer 2. IP spoofing is Layer 3. A SYN flood hits Layer 4. SQL injection is Layer 7. Knowing which layer is under attack tells you where to look and what defences apply. A firewall that only inspects Layers 3–4 will completely miss application-layer attacks — which is why next-generation firewalls inspect all the way to Layer 7.
💡 Try it now Open your terminal and run
traceroute google.com(Mac/Linux) ortracert google.com(Windows). You'll see every router hop your packet takes. That's Layer 3 routing happening in real time, right in front of you.
What to explore next:
- TryHackMe: Intro to Networking (free)
- Professor Messer OSI model video
- Next post: How HTTPS Actually Protects You →



