TCP·Lesson 1 of 13

TCP — Transmission Control Protocol

01

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.

02

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 .

03

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

Connection-oriented

Both sides set up a connection with a handshake before any data is sent.

Reliable

Guaranteed delivery

Lost data is detected and re-sent, so nothing goes missing for good.

🔢Ordered

In-order delivery

Data arrives in the exact order it was sent, even if packets take different paths.

🛡️Integrity

Error checking

A checksum catches corrupted data so the bad copy is thrown away and re-sent.

🚰Pacing

Flow control

TCP keeps a fast sender from overwhelming a slower receiver.

🚦Fairness

Congestion control

TCP backs off when the network is overloaded so it doesn't make jams worse.

04

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:

TCPUDP
ConnectionSet up first (handshake)None — just send
ReliabilityGuaranteed — lost data re-sentBest-effort — no guarantee
OrderingData arrives in orderMay arrive out of order
Speed / overheadSlower, more overheadFaster, very little overhead
Typical useWeb, email, file transferLive video, gaming, voice calls
05

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."

Packets absolutely still get lost, reordered, and corrupted down at the IP level — TCP can't prevent that. What TCP does is notice the loss and re-send, so the application on top sees a perfect, complete stream. TCP doesn't stop loss from happening; it hides it by recovering from it.

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