Theory
One big job, split into seven
Getting data from your laptop to a website involves an enormous amount of work: turning data into signals, addressing it, routing it across networks, ensuring it arrives, and presenting it to the right program. Trying to think about all of that at once is overwhelming.
The OSI model (Open Systems Interconnection) tames it by splitting the job into seven layers, each with a single, well-defined responsibility. This is the conceptual backbone of the whole subject: once you know the seven layers and what each does, everything else, devices, protocols, addresses, snaps into place. Learn this lesson well.
Theory
What the OSI model is
The OSI model is a reference model: a standard way of describing how network communication is organised, developed so that different systems could interwork. It does not name specific products; it describes seven layers of function, stacked from the physical medium at the bottom (layer 1) to the user's application at the top (layer 7).
The power of layering is that each layer only has to do its own job and talk to the layers directly above and below it. A layer uses the services of the layer beneath it and provides services to the layer above. This separation lets each part be designed, understood, and changed independently.
At a glance
| Layer | Name | Its job |
|---|---|---|
| 7 | Application | Network services to the user's programs (HTTP, email, FTP) |
| 6 | Presentation | Data translation, encryption, and compression (format conversion) |
| 5 | Session | Establishes, manages, and ends sessions (dialogues) between applications |
| 4 | Transport | End-to-end delivery, splitting into segments, reliability (TCP, UDP; ports) |
| 3 | Network | Logical addressing (IP) and routing packets between networks (routers) |
| 2 | Data Link | Frames and physical (MAC) addressing between adjacent nodes; error detection (switches) |
| 1 | Physical | Raw bits as signals over the medium (cables, hubs) |
Formula
Remember the order, bottom to top
The layers have a fixed order, and it is worth memorising: from the bottom up, Physical, Data Link, Network, Transport, Session, Presentation, Application (layers 1 to 7).
A classic mnemonic for the bottom-to-top order is 'Please Do Not Throw Sausage Pizza Away' (Physical, Data link, Network, Transport, Session, Presentation, Application). Keep the order straight and you can always reason about which layer a task belongs to, the single most useful skill this topic gives you.
Theory
Data travels down, then up
When you send data, it starts at the top (your application) and moves down the layers on your machine: each layer adds its own information (a process called encapsulation), wrapping the data with what that layer needs, an address, a check, a header.
The bits then cross the physical medium, and on the receiving machine the data moves up the layers, each one removing and acting on the information its counterpart added. So the transport layer on your side talks, in effect, to the transport layer on the other side, and so on. Data goes down the sender's stack and up the receiver's, layer to matching layer.
Quiz
In the OSI model, which layer is responsible for logical addressing (IP addresses) and routing packets between different networks?
- The Physical layer (1), because it moves the data
- The Network layer (3), which handles IP addressing and routing packets between networks
- The Application layer (7), because that is where the user is
- The Data Link layer (2), because it uses IP addresses
Show the answer
The Network layer (3), which handles IP addressing and routing packets between networks
The Network layer (layer 3) handles logical addressing with IP addresses and routes packets between different networks, which is exactly the router's job. Option A is wrong: the Physical layer (1) deals with raw bits as signals over the medium, it has no concept of IP addresses or routing. Option C is wrong: the Application layer (7) provides services to user programs (like HTTP), not addressing and routing. Option D contains a common confusion: the Data Link layer (2) uses MAC (hardware) addresses between adjacent nodes, NOT IP addresses, IP logical addressing lives at the Network layer. Anchor it: MAC and frames at layer 2 (Data Link), IP and routing at layer 3 (Network).
Think first
Why divide networking into layers at all?
Why not just build one big system that does everything? What does the seven-layer split buy you? Then tap.
Show the answer
Layering brings MODULARITY: each layer solves one part of the problem independently, which makes the whole system easier to design, understand, change, and mix-and-match. Because each layer has a single clear job and communicates only through defined interfaces with its neighbours, engineers can work on one layer without needing to understand the internals of the others, the person improving the physical cabling does not need to know how encryption works, and the person writing a web application does not need to know whether the data travels over copper or fiber. This separation also allows SUBSTITUTION: you can swap the physical layer (copper for fiber, wired for Wi-Fi) without changing anything above it, because the layer above only cares about the SERVICE ('deliver these bits'), not how it is done. It enables INTEROPERABILITY too: as long as different systems agree on what each layer does, products from different vendors can work together. And it makes TROUBLESHOOTING systematic, you can ask 'which layer is failing?' and isolate the problem (is it the physical connection, the IP routing, or the application?). This is the same 'separate concerns, each part does one thing' principle you have met throughout computing, applied to networks. The seven layers turn an impossibly tangled problem into seven manageable ones. Divide the job, and each piece becomes tractable.
Summary
Key takeaways
- The OSI model is a reference model that splits network communication into seven layers, each with one clear job.
- Bottom to top: 1 Physical, 2 Data Link, 3 Network, 4 Transport, 5 Session, 6 Presentation, 7 Application.
- Physical moves raw bits; Data Link handles frames and MAC addressing; Network does IP addressing and routing.
- Transport gives end-to-end delivery (TCP/UDP, ports); Session manages dialogues; Presentation does translation/encryption; Application serves user programs.
- Each layer uses the one below and serves the one above; data is encapsulated going down the sender and stripped going up the receiver.
- Mnemonic for the bottom-to-top order: 'Please Do Not Throw Sausage Pizza Away'.
- Memory hook: seven layers, physical at the bottom, application at the top; IP and routing live at layer 3.