UDP·Lesson 1 of 9

UDP — User Datagram Protocol

01

The Short Answer

UDP (User Datagram Protocol) is one of the two main ways a program on one computer sends data to a program on another computer. It works at the — the part of networking whose job is to hand your data to the network and get it to the right program on the far side. UDP does that job in the simplest, fastest way possible: it just packages your data and fires it off, without setting anything up first and without checking that it arrived.

The one-line takeaway

UDP is fast and lightweight because it skips connection setup and makes no promises about delivery. It sends data and moves on — no handshakes, no acknowledgements, no retries.

02

What Problem Does UDP Solve?

When two programs on different machines want to exchange data, they need an agreed set of rules for how that data is handed to the network and delivered to the right program — a . There are two dominant transport protocols to choose from: TCP and UDP. TCP (Transmission Control Protocol) is the careful one: it sets up a connection, confirms every piece of data arrived, and puts everything back in order. UDP is the lightweight one: it does none of that extra work, which is exactly why it's faster.

📬

UDP is like dropping a postcard in the mailbox

You write the address, drop it in, and walk away. You don't call ahead, you don't get a delivery confirmation, and if it gets lost you won't know. But it's quick and takes almost no effort. TCP, by comparison, is like a tracked, signed-for parcel: slower and more work, but you know it arrived. UDP trades those guarantees for speed.

03

"Connectionless" — Just Send

UDP is called connectionless because it never sets up a connection before sending. There's no — no back-and-forth to agree "are you ready? yes, I'm ready." Each chunk of data, called a , is addressed and sent on its own, independently of every other one. The sender doesn't wait for permission and doesn't wait for a reply.

It helps to see where UDP sits in the bigger picture. Networking is organized into layers, each handling one job and passing data to the layer below. UDP lives at the transport layer, just above the layer that moves packets between networks:

Where UDP sits (TCP/IP model)

4

Application

The app and its protocol — a web browser, DNS, a video call

3

Transport

Delivers data to the right program — TCP or UDP

UDP is here
2

Internet

Moves packets between networks using IP addresses

1

Network Access

Puts the bits onto the physical wire or wireless signal

04

"Best-Effort" Delivery

UDP delivery is described as unreliable or best-effort. That sounds bad, but it's a precise technical term, not an insult. It means the network will try its best to deliver each datagram, but UDP itself makes no promises: a datagram might be lost along the way, arrive out of order, or even show up twice — and UDP won't detect or fix any of that. If that matters to your app, your app has to handle it.

🚫

"UDP is unreliable, so it's broken or low-quality."

Unreliable here is a technical label meaning no delivery guarantee, not a sign of poor quality. UDP is used every day by DNS, video calls, and online games precisely because dropping the extra guarantees makes it fast. For those jobs, speed matters more than perfect delivery.
05

Why Anyone Would Choose UDP

If UDP can lose data, why use it? Because for some jobs, being fast matters far more than being perfect. Skipping the handshake means there's no delay before the first byte is sent. Skipping acknowledgements and retries means less work and less waiting. For things like a live voice call, a fresh sound sample now is worth more than a perfect copy of a sound from two seconds ago. UDP is the right tool whenever speed and low delay beat guaranteed delivery.

Q:In one sentence, what is UDP and when would you use it?

A: UDP is a fast, connectionless transport protocol that sends independent datagrams with no setup and no delivery guarantee — ideal when low latency matters more than perfect reliability, such as DNS lookups, live video, voice calls, and online gaming.

Quick Revision Cheat Sheet

UDP: User Datagram Protocol — a fast, connectionless transport protocol

Layer: Transport layer (same layer as TCP)

Connectionless: No handshake — each datagram is sent independently

Best-effort: No guarantee of delivery, order, or no-duplicates

Why use it: Speed and low delay when perfect delivery is not essential