Module 1 · FundamentalsLesson 8 of 887 minBeginner
The OSI model in plain words
Networking is built in layers. Each one solves one problem and trusts the layers below it.
Play the message and watch each layer add its own wrapping on the way down, then remove it on the way up.
The OSI model splits networking into seven layers. Real systems don't follow it perfectly, but it gives everyone shared words, like "that's a layer 4 load balancer".
The seven layers, top to bottom
| # | Layer | Job | Examples |
|---|---|---|---|
| 7 | Application | What the app wants to say | HTTP, DNS, SMTP |
| 6 | Presentation | Formatting and encryption | TLS, JSON, compression |
| 5 | Session | Keeping a conversation going | Sessions, reconnects |
| 4 | Transport | Getting data between programs | TCP, UDP, ports |
| 3 | Network | Getting packets between machines | IP addresses, routers |
| 2 | Data link | Getting frames to the next device | Ethernet, Wi-Fi, MAC addresses |
| 1 | Physical | Moving bits | Cables, fibre, radio |
Wrapping and unwrapping
On the way down, each layer wraps the data with its own header: TCP adds port numbers, IP adds addresses, Ethernet adds the next device's address. At the other end, each layer removes its own wrapper and passes the rest up.
The magic is separation. HTTP doesn't care whether you're on Wi-Fi or fibre. Wi-Fi doesn't care whether you're loading a web page or a video call.
Why system designers care
You'll hear layers mentioned when choosing infrastructure:
- A layer 4 load balancer only looks at IP addresses and ports. It's very fast but can't read URLs.
- A layer 7 load balancer reads the HTTP request, so it can route
/apito one set of servers and/imagesto another. - Firewalls, VPNs and CDNs are often described by the layer they work at.
In practice most people use a simpler four-layer version (the TCP/IP model): application, transport, internet, link. Same idea, fewer boxes.