When you send an email, a file or make a video call, there's a postman carrying your data to the other side. That postman is TCP or UDP.
Why TCP and UDP exist
To send mail between computers there's a protocol called SMTP. For transferring files there's FTP. There are lots of protocols like these, and they all need one common thing: getting data from one device to another.
So that nobody has to write that delivery code again and again, TCP and UDP were built. The people who built SMTP only had to prepare the mail the way mail should look; the job of getting it to the other side is handed to TCP. FTP works the same way.
The difference
TCP sends the data and then asks: did it arrive properly? If something didn't, it sends it again. That makes TCP reliable, but all that checking and resending makes it a bit slower.
UDP doesn't do any of that. It sends the data, and whether it arrived is not its problem. It never looks back. That makes UDP fast.
| TCP | UDP | |
|---|---|---|
| Checks delivery? | Yes, and resends lost data | No |
| Speed | Slower | Faster |
| Sets up a connection first? | Yes, the 3-way handshake (next lesson) | No |
| Used for | Websites, email (SMTP), file transfer (FTP), SSH | Video calls, online games, live streams, DNS lookups |
Which one, when?
In a video call, if one or two frames get lost, there's no point sending them again: that moment has passed. Speed matters more, so UDP fits. When you send an email, you need to be sure every part arrived. There, TCP is the safer choice.
For hackers: scanners treat the two differently. A TCP port answers clearly whether it's open; a UDP port often stays silent, which is why UDP scans are slower and less certain.
Key takeaways
- TCP and UDP are the "postmen" other protocols hand their data to.
- TCP checks delivery and resends lost data: reliable, slower.
- UDP sends without checking: fast, no guarantee.
- Email, websites and files use TCP; video calls and games use UDP.
Quick quiz
Pick an answer to check yourself. Answer both to mark this lesson done.
1. Who do protocols like SMTP and FTP hand the job of delivering data to?
- A) MAC address
- B) TCP / UDP
- C) Modem
- D) Wi-Fi password
Show answer
Answer: B. SMTP and FTP prepare the data; the postman's job of delivering it is done by TCP and UDP.
2. Why is UDP good for video calls?
- A) It's more secure
- B) It checks every packet arrived
- C) It's fast, and a lost frame or two doesn't need resending
- D) It was built for email
Show answer
Answer: C. In a video call speed matters. UDP sends without checking, and losing a frame or two is fine.
Frequently asked questions
What is the main difference between TCP and UDP?
TCP checks that data arrived and resends what was lost, so it is reliable but slower. UDP sends without checking, so it is faster but gives no guarantee.
Is DNS TCP or UDP?
Ordinary DNS lookups use UDP on port 53 because they are small and need to be fast. DNS switches to TCP for large responses.
Does email use TCP or UDP?
Email protocols like SMTP run on TCP, because every part of the message must arrive.