Networking is organized into layers so each piece of software only has to worry about its own job: the code that renders a web page never has to know how bits move across a fiber-optic cable, and the code pushing those bits never has to know what a URL is. Each layer only talks to the layer directly above and below it, through a well-defined interface — and has no idea what happens further up or down the stack.
Two numbering schemes are common: the theoretical 7-layer OSI model and the practical 4-layer TCP/IP model. Below, explore what each of the 7 OSI layers does, then watch a message get wrapped in headers as it travels down one stack and unwrapped as it climbs back up the other.
Step through what happens when your browser sends a request: the data picks up a header at each layer on the way out, travels across the wire, then gets unwrapped one layer at a time on the other end.
Presentation and Session (L5–L6) don't add their own header in this simplified view — they hand data straight to Transport. Also, in reality, if the finished frame is bigger than the link's MTU, it has to be split into multiple packets before it can be sent — a process called fragmentation.
The Internet was actually built on the 4-layer TCP/IP model. The 7-layer OSI model came from a separate, mostly unimplemented standardization effort — but its terminology stuck because it's more granular and easier to teach layer-by-layer.
| OSI (7 layers) | TCP/IP (4 layers) |
|---|---|
| 7. Application | Application |
| 6. Presentation | |
| 5. Session | |
| 4. Transport | Transport |
| 3. Network | Internet |
| 2. Data Link | Network Access |
| 1. Physical |