OSI Model
The OSI (Open Systems Interconnection) model is a conceptual framework that splits network communication into seven layers, each responsible for one narrow job and each talking only to the layers directly above and below it. No production network stack implements all seven layers as cleanly separated code, but the model survives because it gives engineers a shared vocabulary for a question that comes up constantly: at which layer, exactly, does this problem live?
That question matters more than the trivia of naming all seven layers in order. "The API is returning a 500" is an application-layer problem; "the connection resets before any bytes arrive" is probably transport or network; "two servers can't see each other on the VPC at all" is likely down at the network or data link layer. Being able to place a symptom at the right layer is what lets you reason about the actual fix instead of guessing.
The seven layers​
| # | Layer | Job | Example |
|---|---|---|---|
| 7 | Application | What the user's software actually asks for | HTTP, DNS, SMTP |
| 6 | Presentation | Translating/encoding data (encryption, compression) | TLS, JPEG, ASCII/UTF-8 |
| 5 | Session | Opening, managing, and closing a dialogue between two hosts | Sockets, session tokens |
| 4 | Transport | End-to-end delivery between processes, reliability | TCP, UDP |
| 3 | Network | Routing packets between different networks | IP, routers |
| 2 | Data Link | Delivering frames between directly connected devices | Ethernet, Wi-Fi (802.11), MAC addresses |
| 1 | Physical | Raw bits over a physical medium | Cables, radio signals, voltages |
Each layer only needs to trust the interface the layer below it exposes, not how that layer is implemented — which is exactly the point. A web application built on HTTP doesn't need to know whether the bytes underneath are traveling over fiber, Wi-Fi, or a satellite link; that's the whole benefit of layering.
This module focuses on the three highlighted layers — Network (IP addressing and routing), Transport (TCP/UDP), and Application (HTTP/HTTPS) — because they're the ones system design interviews actually probe.
The model everyone actually builds on: TCP/IP​
In practice, the internet runs on the four-layer TCP/IP model (Application, Transport, Internet, Link), which predates OSI's seven-layer version and doesn't map onto it perfectly — OSI's Application, Presentation, and Session layers are usually collapsed into a single "Application" layer in real stacks, and nobody ships a discrete "session layer" as separate code. It's a well-known, openly acknowledged mismatch: OSI is the teaching model, TCP/IP is the deployed one. Knowing this distinction — and not treating OSI's seven layers as a literal description of how the internet is built — is itself a small signal of depth in an interview.
Why this matters in an interview​
Layer vocabulary gives you a fast, precise way to describe design decisions instead of hand-waving:
- A Layer 4 load balancer routes based on IP and port without looking at the request content; a Layer 7 load balancer can route based on the URL path or headers, at the cost of having to terminate and parse the request first (see Load Balancing).
- "DNS resolution failed" and "the TLS handshake failed" and "the server returned a 503" are three different failures at three different layers, even though a user just sees "the site is down."
- Encapsulation — each layer wraps the layer above's data in its own header before passing it down — is why adding, say, a VPN or an extra proxy hop adds real overhead: it's another header, and sometimes another full protocol stack, wrapped around every packet.
Layering: pros and cons​
Pros
- Each layer can change or be replaced without touching the others (Wi-Fi vs. Ethernet doesn't change how HTTP works)
- Gives engineers a shared vocabulary for naming exactly where a failure or design decision lives
- Encourages interoperability — any Layer 7 protocol works over any Layer 1-2 medium that supports IP
Cons
- Real protocol stacks don't cleanly separate into seven distinct layers — TCP/IP collapses several of them
- Each added layer adds header overhead and sometimes latency (encapsulation isn't free)
- Can encourage reciting layer names as trivia instead of reasoning about the actual failure
Further Reading​
- Cloudflare Learning — What is the OSI Model? — a clear, diagram-heavy walkthrough of all seven layers with real protocol examples.
- Wikipedia — OSI model — a detailed reference, including the well-documented mismatch between OSI and the deployed TCP/IP model.
Saved locally in your browser — visible in the sidebar as you go.