Quiz Entry - updated: 2026.07.14
What is TCP and what does it provide on top of IP?
TCP turns the unreliable, packet-based IP layer into a reliable, ordered, application-to-application byte stream.
What IP gives you:
- Best-effort packet delivery between IP addresses
- No guarantee of order, no guarantee of arrival, no flow control
What TCP adds:
| Feature | What it solves |
|---|---|
| Ports | Multiplex multiple apps on one IP (port 80 for web, 25 for mail, 443 for HTTPS, …) |
| Sequence numbers | Reorder packets that arrive scrambled |
| Acknowledgments | Retransmit lost packets |
| Flow control | Sender doesn't overwhelm slow receiver (window size) |
| Congestion control | Sender adapts to network capacity |
| Connection state | Three-way handshake, four-way teardown |
Where TCP lives:
Application ← Your HTTP, SMTP, FTP, SSH
Transport ← TCP (or UDP) ← provides ports, reliability
Network ← IP ← provides packet delivery
Link ← Ethernet ← provides frame delivery
The mental model:
IP is like the postal service — it delivers individual letters with no guarantee of arrival or order. TCP is like a manager who:
- Numbers each letter
- Asks the recipient to confirm each one
- Re-sends lost ones
- Pauses if the recipient says "I'm overwhelmed"
TCP vs UDP:
| TCP | UDP | |
|---|---|---|
| Reliable? | Yes | No |
| Ordered? | Yes | No |
| Connection? | Yes (handshake) | No |
| Overhead | Higher | Minimal |
| Use cases | HTTP, SSH, FTP, email | DNS, DHCP, VoIP, gaming |
Tip: When choosing between TCP and UDP for a new protocol, ask: "Is reliability my problem to solve, or the transport's?" Real-time audio/video accept loss in exchange for low latency → UDP. File transfer cannot tolerate loss → TCP.
Go deeper:
Transmission Control Protocol (Wikipedia) — segment header, flags, flow/congestion control, and the full connection lifecycle.