Networking stacks are layered so each level solves one problem and talks to the level above and below through well-defined interfaces. The OSI model (7 layers) is a reference framework; the TCP/IP stack (4 layers) is what the Internet actually runs. Understanding both lets you read captures, configs, and RFCs without getting lost.
OSI — seven logical layers
Click each layer — what it defines
🌐
7 Application
📋
6 Presentation
🤝
5 Session
📦
4 Transport
🧭
3 Network
🔗
2 Data Link
⚡
1 Physical
Press Next → to walk from the application layer down to the wire and back
OSI ENCAPSULATION · SENDER ↓
↓ Sender
L7 Application
Data
L6 Presentation
L5 Session
L4 Transport
L3 Network
L2 Data Link
L1 Physical
Data
GET /index.html HTTP/1.1
↓
L7 Application
Protocol:HTTP / HTTPS / DNS
+ Adds:
HTTP Header
Unit: Data
User application generates the message. HTTP adds method, URL, and headers — what developers write and read.
1 / 15
L7 adds HTTP Header → unit becomes: Data
TCP/IP — four practical layers
Hover rings from outside in — how packets are scoped
Hover rings from outside in — how packets are scoped
How OSI maps to TCP/IP
| Concern | OSI layers | TCP/IP layer |
|---|---|---|
| End-user data & APIs | 7 Application | Application (incl. 5–7) |
| Reliable / unreliable delivery | 4 Transport | Transport |
| Global paths & addresses | 3 Network | Internet |
| Local link & bits | 2 + 1 Data Link + Physical | Network Access |
Encapsulation on the wire
Click through — PDU names at each step
📄
Data
App payload
→
📨
Segment/DG
+TCP/UDP hdr
→
📬
Packet
+IP header
→
🖼️
Frame
+L2 header/trailer
→
〰️
Bits
Physical
Click the center — conceptual peers
Same host stack
🌍Application
🔀Transport
🛰️Internet
📡Link
Takeaways
Neither OSI nor TCP/IP cares about vendor hardware — they are abstract models. Troubleshooting follows the layers: physical link up? IP address and route? TCP connection? TLS and HTTP? Peeling the stack from bottom or top until you find the broken layer is the core skill.
OSI = reference, 7 layers
TCP/IP = implementation, 4 layers
Encapsulation hides details
Peer layers talk logically
Names: frame / packet / segment
ℹ️RFC 1122 and modern texts sometimes group layers differently — focus on function (who adds which header) not memorizing numbers alone.