← All chapters
Chapter 13· 7 min read · illustrated

UDP — The Fast Protocol

Connectionless, no guarantees, tiny overhead — and perfect for the right jobs

We enter the transport layer, which delivers data between applications. There are two big choices here: UDP and TCP. UDP is the minimalist — it does almost nothing, and that is precisely why it is fast.

01

What is UDP?

UDP (User Datagram Protocol) is the "just send it" transport. There is no connection setup, no tracking, no acknowledgements. You hand it a datagram and it fires it off. Its data unit is called a datagram.

Tap to enlarge
02

Connectionless

UDP is connectionless — no handshake happens before data flows. If a datagram is lost on the way, UDP does not notice and does not resend it. That is the application’s problem to handle (or ignore).

Tap to enlarge
03

No guarantees

UDP makes no promises: datagrams may be lost, duplicated, or arrive out of order, and it will not fix any of that. What it offers in return is raw speed and simplicity.

Guaranteed delivery
No.
Ordering
No.
Retransmission
No.
Speed & low overhead
Yes — this is the whole point.
Tap to enlarge
04

Tiny header, low overhead

A UDP header is just 8 bytes, compared with TCP’s 20+ bytes and its handshake and state-tracking. Less bookkeeping means less latency — ideal when you cannot afford to wait for retransmissions.

Tap to enlarge
05

Where UDP shines

UDP is perfect when speed matters more than perfection, or when the app handles reliability itself:

  • Voice/video calls (VoIP) — a dropped frame is better than a laggy one.
  • Online gaming — the latest position matters, not an old lost one.
  • DNS — a single small query and reply.
  • Live streaming — keep playing, do not stall to resend.
Tap to enlarge
06

UDP vs TCP at a glance

The trade-off in one line: UDP is fast but makes no promises; TCP is reliable and ordered but slower and heavier. Neither is "better" — you choose based on whether losing data occasionally is acceptable.

Next: Next we open up the UDP datagram and label every field in its 8-byte header.

Tap to enlarge