Appearance
TCP/IP Model
The real-world model that the internet actually runs on. While OSI is conceptual/theoretical, TCP/IP is what's actually implemented in practice.
The 4 Layers
| OSI Model | TCP/IP Model |
|---|---|
| Application (L7) | |
| Presentation (L6) | → Application |
| Session (L5) | |
| Transport (L4) | → Transport |
| Network (L3) | → Internet |
| Data Link (L2) | |
| Physical (L1) | → Network Access |
| # | TCP/IP Layer | Protocols | OSI Equivalent |
|---|---|---|---|
| 4 | Application | HTTP, DNS, FTP, SMTP, SSH | L5 + L6 + L7 |
| 3 | Transport | TCP, UDP | L4 |
| 2 | Internet | IP, ICMP, ARP | L3 |
| 1 | Network Access | Ethernet, Wi-Fi, MAC | L1 + L2 |
Each Layer Explained
Layer 4 — Application
- HTTP/HTTPS → web browsing
- DNS → domain name resolution
- SMTP/IMAP → email
- SSH → secure remote access
- FTP → file transfer
Layer 3 — Transport
| TCP | UDP |
|---|---|
| Connection-oriented | Connectionless |
| Reliable (ACKs) | No guarantee of delivery |
| Ordered | No ordering |
| Slower | Faster |
| Used for: HTTP, email | Used for: video, DNS, gaming |
Layer 2 — Internet
- Core protocol: IP (Internet Protocol)
- Handles logical addressing + routing
- Every packet gets a source & destination IP here
- ICMP lives here too (used by ping)
Layer 1 — Network Access
- Combines OSI's Physical + Data Link
- Handles how bits are physically transmitted
- MAC addressing, Ethernet frames, Wi-Fi signals
Data Flow in TCP/IP
Application → [HTTP Data]
Transport → [TCP Header | HTTP Data]
Internet → [IP Header | TCP Header | HTTP Data]
Network Access → [Frame Header | IP Header | TCP Header | HTTP Data | Frame Trailer]
→ 101010110101... (bits on wire)OSI vs TCP/IP — Key Differences
| OSI | TCP/IP | |
|---|---|---|
| Layers | 7 | 4 |
| Purpose | Conceptual / reference | Practical / implemented |
| Usage | Troubleshooting, teaching | Real internet communication |
| Development | ISO standard | DARPA (built for ARPANET) |
| Protocols | Protocol-independent | Built around IP & TCP |
OSI = blueprint of a building (theoretical, clean) TCP/IP = the actual building (practical, what exists)
Common Interview Questions
Q: Why do we still learn OSI if TCP/IP is what's used? OSI gives a cleaner mental model for troubleshooting and understanding concepts layer by layer. In practice, engineers use TCP/IP but think in OSI terms.
Q: Where does TLS/HTTPS fit? TLS sits between Application and Transport — sometimes called Layer 6 in OSI terms, but in TCP/IP it is handled within the Application layer.