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.

Try 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

#LayerJobExamples
7ApplicationWhat the app wants to sayHTTP, DNS, SMTP
6PresentationFormatting and encryptionTLS, JSON, compression
5SessionKeeping a conversation goingSessions, reconnects
4TransportGetting data between programsTCP, UDP, ports
3NetworkGetting packets between machinesIP addresses, routers
2Data linkGetting frames to the next deviceEthernet, Wi-Fi, MAC addresses
1PhysicalMoving bitsCables, 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 /api to one set of servers and /images to 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.

Quick check

At which layer do TCP and UDP work?