TCP/IP Model
TCP/IP is the protocol family that forms the foundation of the internet. It's more practical than the OSI model and is what actually runs in the real world — every packet you send travels through this model.
01OSI vs TCP/IP
OSI gives better theoretical separation with 7 layers; TCP/IP is the 4-layer version used in practice.
Figure 1 · OSI → TCP/IP mapping
02TCP 3-way handshake
Before sending any data, TCP exchanges three messages. This is the foundation of reliability — both sides confirm they're ready to communicate.
Figure 2 · TCP 3-Way Handshake
03TCP vs UDP
| Feature | TCP | UDP |
|---|---|---|
| Connection | Connection-based | Connectionless |
| Reliability | Guaranteed | No guarantee |
| Ordering | Ordered | Unordered |
| Speed | Slower | Faster |
| Use cases | Web, Email, SSH | Video, Games, DNS |
04When to use which
Use TCP:
- Web pages (HTTP/HTTPS)
- Email (SMTP)
- File transfer (FTP, SSH)
Use UDP:
- Live video streaming
- Online games
- DNS queries
- VoIP
05Summary
- TCP/IP = The real 4-layer model powering the internet
- TCP = Reliable but slower (3-way handshake)
- UDP = Fast but no delivery guarantee
- The internet runs on TCP/IP, not OSI