When throwing away TCP's guarantees is the right call — DNS, live video, games — and the trade-off that makes UDP fit them.
When to Use UDP
In brief
Objectives
- Contrast TCP and UDP guarantees
- Pick the right protocol for a job
- Explain the on-time-beats-complete idea
TCP guarantees delivery and order, at the cost of the handshake and retransmissions. UDP throws that away: it fires packets and does not care if they arrive. That sounds worse, but for the right job it is exactly right.
| TCP | UDP | |
|---|---|---|
| Guarantees delivery | Yes | No |
| Ordered | Yes | No |
| Overhead | Higher | Minimal |
| Good for | Web, files, mail | DNS, video calls, games |
Note
A dropped frame in a video call is better ignored than re-sent a second too late. That is the whole argument for UDP — sometimes on-time beats complete.
Recap
- UDP drops TCP's guarantees for minimal overhead
- Use it for DNS, live video and games
- Sometimes on-time matters more than complete