INTERNET FUNDAMENTALSAI-REVIEWED

What is UDP?

Useful first: IP addresses · optional, not a requirement

Choose your depth

Stay with the essentials, or look closer.

Simple explanation
2 min read · estimate

YOUR GOALUnderstand a datagram and why an application may care more about a fresh update than a missing old one.

Send a message without a delivery promise.

A message carried over IP

UDP sends individual messages called datagrams over IP. Think of separate notes rather than one continuous conversation transcript. Sending a note does not prove that it arrived.

UDP does not automatically recover a lost datagram or put received datagrams back into their original order. That limited service can be useful when the application has its own rules about what to keep.

[1] [2]

Sometimes the newest update matters most

Imagine a game sending a player's current position. If an old position update is lost but a newer one arrives, the game may prefer showing the newer position to waiting for history. This is an application design choice, not a rule UDP enforces.

UDP itself has no connection-opening handshake, but a game or security protocol built on it can still require setup. Less built-in machinery does not guarantee a faster or smoother experience on a busy network.

[3] [4]
THE IDEA TO KEEP

UDP carries separate messages; the application decides what missing or late messages mean.

ONE THING TO WATCH OUT FOR

Choosing UDP guarantees that a game will have less lag.

Network conditions and the application's design still matter. UDP alone promises neither a delivery time nor a speed advantage.

A QUICK CHECK, NOT A TEST
A game receives a current position update after an older update was lost. What does UDP itself do?
Show the explanation

Deliver the received datagram without automatically recovering the missing one. UDP has no built-in retransmission or deadline guarantee. The game decides whether it needs the old update.

Progress is saved only in this browser.

KEEP EXPLORINGTCP
Was this explanation clear?
Report a mistake by email
Basic explanation
2 min read · estimate

YOUR GOALDistinguish a UDP message from a TCP stream and recognize which ordering information an application must add.

Keep message boundaries and handle imperfect delivery.

Ports and messages are different from stream chunks

UDP has an eight-byte header containing source port, destination port, length and checksum fields. A destination port helps the receiving host direct the datagram to an endpoint; it is not a separate IP address.

If RED and BLUE are sent as two UDP datagrams, UDP preserves those message boundaries when they are delivered. This differs from TCP's byte stream, where read boundaries need not match writes. Preserving boundaries does not promise both messages will arrive.

[1] [2] [8]

Numbering updates is an application rule

Suppose a position app labels updates 41, 42 and 43. It receives 43, then 41, then another 43. Those labels are fields the app invented, not UDP sequence numbers.

For this example, the app keeps the newest numbered position and ignores the older and repeated updates. Missing 42 may be acceptable for positions, but an operation that must happen exactly once needs a different protocol design. UDP does not supply that guarantee.

[2] [4]
THE IDEA TO KEEP

Message boundaries survive UDP delivery; useful ordering and duplicate handling require additional rules.

ONE THING TO WATCH OUT FOR

A datagram's position in the receive queue proves when it was sent.

Datagrams can arrive out of order. Applications need their own ordering information if order matters.

A QUICK CHECK, NOT A TEST
The example app keeps only the newest numbered position. It receives 43, then 41, then 43 again. Which update should determine the displayed position?
Show the explanation

43, with the old and duplicate updates ignored by the app. The example's numbering policy selects 43. UDP itself neither adds those numbers nor filters the updates this way.

Progress is saved only in this browser.

KEEP EXPLORINGTCP
Was this explanation clear?
Report a mistake by email
Advanced explanation
3 min read · estimate

YOUR GOALSeparate congestion response, datagram sizing and security from the service that UDP itself provides.

Evaluate the whole protocol above UDP.

No congestion control is a responsibility, not a shortcut

UDP has no built-in congestion control. An Internet application using it must still manage how much traffic it sends so it does not overwhelm a path. Adding retries without controlling the extra traffic can worsen congestion.

For the position app, sending more updates is not automatically an improvement. Its protocol needs a congestion response; the correct rate cannot be inferred just from choosing UDP.

[4]

Fit the path, not just the send buffer

A datagram that is too large for the path can require IP fragmentation or fail to get through. The useful size depends on the path and the headers it carries; a large local send buffer does not establish that size.

Datagram Packetization Layer Path MTU Discovery, described in RFC 8899, uses probes and delivery confirmation to find a workable unfragmented size. In a simplified example, if a confirmed path limit allows 1,280-byte IP packets and the combined IP/UDP headers take 48 bytes, the payload budget is 1,232 bytes. Extra headers would reduce it. This is arithmetic for that example, not a universal UDP limit.

[4] [5]

UDP underneath does not define every feature above it

A UDP checksum is not encryption or proof of the sender's identity. UDP alone provides no communication security.

QUIC demonstrates what another layer can add: it carries packets in UDP datagrams while providing reliable, ordered byte streams, cryptographic protection and mechanisms for congestion control. Ordering is within each stream, not one global order across all streams. HTTP/3 uses QUIC; that does not turn UDP itself into a reliable stream protocol.

[4] [6] [7]
THE IDEA TO KEEP

Choose the complete transport design: UDP alone does not solve congestion, sizing, reliability or security.

ONE THING TO WATCH OUT FOR

A protocol using UDP cannot deliver reliable, ordered data.

A higher layer can add those features. QUIC supplies reliable ordered streams while using UDP underneath.

A QUICK CHECK, NOT A TEST
A QUIC stream recovers missing data and delivers its bytes in order. What explains this despite QUIC using UDP?
Show the explanation

QUIC provides the extra mechanisms above UDP. UDP transports QUIC's packets. QUIC supplies stream ordering, recovery and protection; they are not built-in UDP features.

Progress is saved only in this browser.

KEEP EXPLORINGTCP
Was this explanation clear?
Report a mistake by email
GO STRAIGHT TO THE SOURCE

Keep asking. Check the details.

Source-checked using AI (OpenAI Codex) on . The checks covered sources, examples, and quizzes for this article version.

No human review is claimed. AI review can miss errors; check the original sources below.

  1. RFC 768 — User Datagram Protocol and header format
  2. MDN — UDP and datagram delivery
  3. Cloudflare Learning Center — UDP use cases
  4. RFC 8085 — UDP application responsibilities and limitations
  5. RFC 8899 — Datagram packetization and path MTU discovery
  6. RFC 9000 — QUIC transport, streams and reliability
  7. RFC 9114 — HTTP/3 over QUIC
  8. RFC 9293 — TCP segmentation and application message boundaries
How explanations are prepared