TCP·Lesson 1 of 13
TCP — Transmission Control Protocol
What TCP Is
When you open a web page, send a chat message, or download a file, the data has to arrive complete, in the right order, with nothing missing. is the set of rules that makes that happen. It's one of the core s of the internet, and its whole job is to turn a messy, unreliable network into something that behaves like a clean, orderly pipe between two programs.
The one-line summary
TCP gives two programs a reliable, in-order, two-way pipe: whatever you put in one end comes out the other end complete and in the same order — even though the network underneath drops and reorders data all the time.
A phone call, not a postcard
TCP is like a phone call. First you dial and the other person picks up — you both confirm you can hear each other before saying anything important. Then you talk, and if a word gets garbled you say 'sorry, repeat that.' A postcard, by contrast, is just dropped in the mailbox with no confirmation it ever arrived. TCP is the phone call: set up first, checked throughout, and closed politely at the end.
The Problem TCP Solves
TCP runs on top of a lower protocol called (Internet Protocol), which does the actual job of carrying chunks of data called s across the internet. IP is fast but careless: packets can be lost, arrive out of order, get duplicated, or turn up corrupted. TCP sits on top and cleans all of that up, so the application never has to deal with the mess. The chunk of data TCP hands to IP is called a .
The Guarantees TCP Makes
Everything TCP does comes down to a handful of promises it keeps for the application using it. Here are the big ones — each gets its own lesson later in this topic:
Connection-oriented
Both sides set up a connection with a handshake before any data is sent.
Guaranteed delivery
Lost data is detected and re-sent, so nothing goes missing for good.
In-order delivery
Data arrives in the exact order it was sent, even if packets take different paths.
Error checking
A checksum catches corrupted data so the bad copy is thrown away and re-sent.
Flow control
TCP keeps a fast sender from overwhelming a slower receiver.
Congestion control
TCP backs off when the network is overloaded so it doesn't make jams worse.
TCP vs the Simpler Alternative
TCP isn't the only transport option. There's a much simpler protocol called (User Datagram Protocol) that skips the handshake and the guarantees — it just fires data off and hopes for the best. That sounds worse, but for things like live video or online games, being fast matters more than being perfect. Here's how the two compare at a glance:
| TCP | UDP | |
|---|---|---|
| Connection | Set up first (handshake) | None — just send |
| Reliability | Guaranteed — lost data re-sent | Best-effort — no guarantee |
| Ordering | Data arrives in order | May arrive out of order |
| Speed / overhead | Slower, more overhead | Faster, very little overhead |
| Typical use | Web, email, file transfer | Live video, gaming, voice calls |
Where You Meet TCP Every Day
You rely on TCP constantly without noticing. Any time correctness matters more than raw speed, TCP is almost certainly underneath:
Everyday things built on TCP
- Loading web pages (HTTP and HTTPS)
- Sending and receiving email (SMTP, IMAP, POP3)
- Transferring files (FTP)
- Secure remote access to servers (SSH)
“"TCP means packets are never lost on the network."”
Q:What does it mean to say TCP is 'connection-oriented and reliable'?
A: Connection-oriented means the two sides establish a connection with a handshake before exchanging any data, agreeing on starting parameters first. Reliable means TCP guarantees that all the data arrives, uncorrupted and in the original order — it numbers the data, waits for acknowledgments, and re-sends anything that goes missing. Together they turn the unreliable, best-effort IP layer into a dependable stream between two programs.
Quick Revision Cheat Sheet
TCP: Transmission Control Protocol
Layer: Transport layer (Layer 4)
Runs on top of: IP, which is fast but unreliable
Data unit: Segment
Key traits: Connection-oriented, reliable, ordered, error-checked
Also provides: Flow control and congestion control
Compared to UDP: Slower but reliable; UDP is faster but best-effort