Course contentsShow
← Computer Science
Lesson 1500 of 2,87234. Internet Protocol SuiteFree lesson

When to Use UDP: Application Scenarios

Identify applications tolerating packet loss but requiring low latency where UDP excels (streaming, gaming, DNS).

When to Use UDP: Application Scenarios

You'll learn: Which types of applications benefit most from UDP's speed-over-reliability design.

Core Idea

UDP shines in scenarios where speed and low latency matter more than perfect delivery. Some applications can tolerate occasional lost packets if it means avoiding the overhead and delays of TCP's reliability mechanisms. Think of UDP as express mail without tracking—it gets there fast, but you won't get confirmation or retries if something goes wrong.

Ideal UDP Applications

Real-Time Streaming (Video/Audio)

Live video or voice calls can't wait for retransmissions. If a packet carrying one frame of video is lost, it's better to skip it and move on than to pause the entire stream. Your brain naturally interpolates small gaps in audio/video, making occasional losses barely noticeable.

Online Gaming

Multiplayer games send frequent position updates. If a player's location packet from 50ms ago is lost, it's useless to retransmit it—the player has already moved! Games prefer receiving the latest state quickly over guaranteed delivery of old state.

DNS (Domain Name System)

DNS queries are tiny, single-request/single-response transactions. UDP's lack of connection setup overhead means you can send a query and get an answer in one round trip instead of TCP's three-way handshake plus data exchange. If the response is lost, the application simply retries the whole query.

IoT Sensor Networks

Devices sending periodic temperature readings don't need every single reading to arrive. The next reading is coming soon anyway, and the connection overhead of TCP would drain battery life quickly.

Key Takeaway:
Use UDP when your application prioritizes low latency and can tolerate occasional packet loss—streaming media, gaming, DNS lookups, and sensor data are classic examples where speed trumps guaranteed delivery.