Quand abandonner les garanties de TCP est le bon choix — DNS, vidéo, jeux — et le compromis qui rend UDP adapté.
Quand utiliser UDP
En bref
Objectifs
- Opposer les garanties TCP et UDP
- Choisir le bon protocole
- Expliquer « à l'heure vaut mieux que complet »
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.
À retenir
- UDP abandonne les garanties de TCP pour un surcoût minimal
- À utiliser pour DNS, vidéo, jeux
- Parfois à l'heure prime sur complet