Common UDP Use Cases and Applications
You'll learn when and why real-world applications choose UDP over TCP.
Now that you understand UDP's characteristics—unreliable delivery, no connection setup, minimal overhead, and low latency—let's see where these traits become advantages rather than drawbacks.
When UDP Shines
UDP is the protocol of choice when speed matters more than perfect reliability or when the application can handle occasional losses gracefully.
DNS Queries
Domain Name System lookups use UDP because they're simple request-response exchanges. If a DNS query gets lost, the client just resends it—faster than establishing a TCP connection would be. A single UDP datagram typically contains the entire query and response.
Streaming Media
Live video and audio streams (like video calls or broadcasts) benefit from UDP's low latency. If a few video frames or audio samples get lost, it's better to skip them and continue than to pause for retransmission. Your brain fills in brief gaps naturally, but buffering pauses ruin the experience.
Online Gaming
Multiplayer games need real-time position updates. If your opponent's location packet from 100ms ago arrives late, who cares? A newer packet is already coming. TCP's retransmissions would create stuttering and lag that make games unplayable.
VoIP (Voice over IP)
Phone calls over the internet prioritize immediacy. A brief audio glitch beats awkward delays in conversation. UDP's minimal overhead keeps voice latency low—critical for natural dialogue.
Broadcast and Multicast
UDP naturally supports sending the same data to multiple recipients simultaneously. TCP's connection-oriented nature requires separate connections to each recipient, making it impractical for broadcasts.
The Pattern
Notice the theme: these applications either tolerate data loss, implement their own reliability layer, or need multicast capabilities. They value timeliness over completeness.
Key Takeaway: Use UDP for latency-sensitive applications where occasional data loss is acceptable (streaming, gaming, VoIP) or for simple query-response protocols (DNS) and broadcast scenarios where TCP's overhead provides no benefit.