TCP vs UDP: Understanding Data Transfer and the Handshake


Introduction
We live in a world where data transfer happens every single second — whether you're streaming YouTube, chatting on WhatsApp, or playing an online game. But have you ever paused to think how that data actually reaches you?
Take this for example:
You're watching a live IPL match, and it streams perfectly in real-time — not even a millisecond missed.
But on a video call, you often face glitches or brief delays.
Meanwhile, sending an email or loading a website may take a moment, but it always arrives fully and correctly.
Ever wondered why?
That’s where different internet protocols step in and do their job.
To truly understand how the internet works, it's important to know the difference between TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) — the two major ways your data travels across the web.
In this section, you’ll learn:
Why TCP uses a "handshake" to ensure reliable, ordered, and error-free communication
Why UDP is faster but doesn’t bother with error-checking or acknowledgments
Real-world examples like emails (TCP) vs. live video streams (UDP)
This isn't just tech talk — it's the invisible system powering everything you do online.
Let’s decode it together.
What is TCP?
Think of this situation:
You're having a serious chat with your friends, and during a critical moment, you type —
“I” “don’t” “support” “this”
But what if your message is received as —
“I” “support” “this”
😳 Not okay, right? One missing word changes the entire meaning!
In real-time chatting, accuracy is more important than speed. Even if it takes an extra moment to deliver, the message must be complete and correct.
That’s exactly where TCP (Transmission Control Protocol) comes in.
TCP ensures that all data packets are delivered reliably, in order, and without loss.
It does this through a process called the three-way handshake, where both sender and receiver agree to communicate before any data is sent.
The TCP Handshake
Before your device and a server start talking (like sending a message, loading a website, etc.), they go through a formal handshake to make sure both sides are ready to communicate reliably.
This is called the Three-Way Handshake. Let’s understand how it works with a simple chat conversation between you and your friend:
You: “Hey, can we talk?”
This is the SYN – you’re asking to start a connection.
Friend: “Yes, I’m here and ready. Can you hear me?”
This is the SYN-ACK – they acknowledge your request and send their own.
You: “Yes, loud and clear. Let’s chat!”
This is the ACK – you confirm you're both connected.
Let’s summarize this process:
SYN (Synchronize) — SYN-ACK (Synchronize-Acknowledge) — ACK (Acknowledge)
Where exactly is TCP used?
That’s why TCP is used in places where accuracy matters more than the speed, like:
Email sending
Website loading
File downloads
What is UDP?
Now think of a different situation:
You're watching the IPL final live, and the bowler is about to deliver the final ball…
You don’t want a delay — even one second late and you’ve missed the moment.
So what if a few video frames are dropped?
No big deal — you just want to see it happen live!
That’s where UDP (User Datagram Protocol) comes into play.
UDP is fast, lightweight, and doesn’t wait for confirmation. It sends data quickly without checking if it reached perfect — because in real-time apps like live streams, video calls, and online gaming, speed is more important than perfection.
So unlike TCP, UDP says:
“I’ve sent it. Hope it gets there!”. Even if something is lost on the way, the show must go on — just like in live sports or live calls.
Unlike TCP, UDP doesn’t bother with connection setup or delivery confirmation.
There’s no “Are you there?” or “Did you get that?” — it simply throws the data packets toward the destination as fast as possible.
UDP have:
No connection establishment
No tracking of whether the data arrived
No re-sending if something is lost
You can think of UDP as shouting across a room:
You send the message, but you don’t wait to see if anyone heard it — you just keep going.
That’s why UDP is used in places where speed matters more than accuracy.
So UDP is used in:
Live video streaming
Online Gaming
Voice/video calls
TCP vs UDP: Key Differences
- | Feature | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | | --- | --- | --- | | Connection Type | Connection-oriented (3-way handshake) | Connectionless (no handshake) | | Reliability | Guaranteed delivery, checks for lost packets | No guarantee — packets may be lost | | Data Order | Ensures data arrives in the correct order | No ordering — packets may arrive out of order | | Overhead | More overhead due to tracking and confirmation | Low overhead, faster due to no tracking | | Speed | Slower compared to UDP (more checking) | Faster — no time wasted on confirmation | | Use Case | Where accuracy matters (e.g., emails, web, file transfer) | Where speed matters (e.g., video calls, streaming) | | Example Analogy | Formal conversation — “Hello, can we talk?” | Shouting a message in a crowd no matter whether anyone listening to you or not |
Conclusion
Whether you're watching a live cricket match, sending a heartfelt message, or downloading a document — behind every action, there’s a protocol working silently to deliver your data.
TCP is like a careful, trustworthy courier — it makes sure your message arrives safely and in order, even if it takes a little more time.
UDP is the speedy messenger — it doesn’t wait or double-check but gets the job done as quickly as possible, which is perfect for real-time experiences.
Both have their strengths, use-cases and both are essential for how we experience the internet every day.
So next time your video buffers or your email takes a second to send — you’ll know exactly which protocol is at work behind the scenes.
Subscribe to my newsletter
Read articles from Pinki Gupta directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
