Photo: Scott Rodgerson on Unsplash
TCP vs UDP: what is the difference?
In short: TCP sets up a connection, numbers data and resends anything lost, so it suits web pages, email and file transfers. UDP just sends without checks, which suits DNS, voice, video and gaming where speed matters more.
TCP vs UDP in one sentence
TCP makes sure every piece of data arrives in order, while UDP sends data as fast as possible without checking it arrived.
Side-by-side comparison
| Feature | TCP | UDP |
|---|---|---|
| Connection | Yes, three-way handshake (SYN, SYN-ACK, ACK) | No, connectionless |
| Reliability | Acknowledges and resends lost data | No resends |
| Order | Data arrives in order | May arrive out of order |
| Speed and overhead | Slower, 20-byte header and more | Faster, 8-byte header |
| Flow control | Yes (window size) | No |
| Typical uses | Web (HTTP/HTTPS), email, SSH, file transfer | DNS, VoIP, video calls, streaming, gaming, DHCP |
| Example ports | 22, 25, 80, 443 | 53, 67/68, 123, 161 |
What is TCP?
Transmission Control Protocol starts each conversation with a handshake, numbers every byte and waits for acknowledgements. Missing data is sent again, and the receiver puts everything back in order. That reliability is why web pages and downloads arrive complete.
What is UDP?
User Datagram Protocol simply sends each message, called a datagram, with no handshake and no resends. For a live call, a late packet is useless anyway, so it is better to skip it than wait. Applications that need some reliability on UDP add it themselves; for example, QUIC (used by HTTP/3) runs over UDP.
Which one should you use?
You rarely choose; the application does. As a rule: if every byte must arrive (files, web pages, email), it uses TCP. If speed and low delay matter more than the odd lost packet (voice, video, games, quick lookups like DNS), it uses UDP. When troubleshooting firewalls, always check whether a service needs TCP, UDP or both.
Common mistakes and myths
- "UDP is unreliable, so it is bad." It is a design choice, perfect for real-time traffic.
- Forgetting that DNS also uses TCP 53 for large answers and zone transfers.
- Assuming HTTPS is always TCP: HTTP/3 uses QUIC over UDP 443.
Learn more
Key takeaways
- TCP is connection-based and reliable; UDP is connectionless and fast.
- TCP suits web, email and files; UDP suits DNS, voice, video and games.
- HTTP/3 uses QUIC over UDP 443.
- Firewall rules must match the right protocol.
© 2026 FM TecHub. Original content written for FM TecHub. Share the link freely; please don't copy the text elsewhere without permission.