Knowledge graphSettings

Updated: June 23, 2026 at 8:31 AM

UDP protocol

medium

Connectionless datagram transport: low latency, compact header, MTU and NAT effects, and application-level compensation for loss, jitter, and reordering.

This chapter matters because it shows that a fast transport is not automatically better. It becomes useful when data freshness matters more than perfect delivery.

In day-to-day engineering, that helps you design media flows, telemetry, and gaming paths where loss, delay variation, and packet ordering have to be compensated for at the application layer.

In interviews and architecture discussions, it gives you a clear way to explain why minimal guarantees can still be the right engineering choice.

Practical value of this chapter

Latency-first design

Helps choose UDP when minimal delay matters more than strict delivery guarantees.

App-level reliability

Guides acknowledgments, reordering logic, and recovery behavior at the application layer.

Usage boundaries

Clarifies where realtime, streaming, and telemetry-heavy traffic patterns actually fit.

Interview trade-offs

Provides a clear way to explain how weaker UDP guarantees can be compensated for in service design.

RFC

RFC 768 (UDP)

Baseline UDP specification: header format, delivery semantics, and checksum.

Перейти на сайт

UDP is interesting not because it is “faster than TCP,” but because it removes connection setup and built-in recovery on purpose. That empty space is where the application gets to build exactly the reliability the scenario needs — no more, no less.

Core UDP properties

No connection setup

There is no handshake — a datagram leaves for the network immediately, with no round-trip before the first useful byte.

Delivery without guarantees

The protocol promises nothing about delivery, ordering, or loss recovery. Those decisions belong to the application.

Compact header

Just 8 bytes of overhead per datagram, so transport cost barely shows up next to the payload.

Message boundaries stay intact

The receiver sees discrete messages, not a byte stream that has to be re-framed by hand.

Reliability moves upward

Acknowledgments, retries, buffering, and error correction become part of the application protocol — and its latency budget.

How the UDP datagram header is structured

Eight bytes of header is the entire transport contract. No sequence numbers, no windows, no retries — anything resembling reliability has to be invented on top.

UDP datagram header

8 bytes + payload

Source Port

16 bits

Destination Port

16 bits

Length

16 bits

Checksum

16 bits

Payload (variable length)

32 bits

The UDP header is always 8 bytes. Transport overhead stays small — but the cost of reliability is simply pushed up to the application layer.

UDP exchange lifecycle

Datagram creation

The application assembles a message and hands it to a socket with the destination address and port — no negotiation with the other side.

Transit across the IP network

From here it is plain IP forwarding: the packet may be delayed, dropped, or reordered, and the network will not tell anyone about it.

Receiver-side handling

What to do with loss, jitter, and reordering is the application's call. There is no transport layer underneath waiting to fix things for it.

How UDP exchange works

There is no connection — every message leaves as its own datagram. It may arrive quickly, vanish without a trace, or show up after the next one. The sender will not find out until the application asks.

How UDP exchange works

UDP sends datagrams without connection setup and without acknowledgments.

SenderNetwork pathReceivers
Client
UDP datagram
Service A
Service B
Service C
No handshake or acknowledgments, so transmission starts immediately.

UDP delivery under real load

Step through how loss, delay variation, and packet reordering change delivery quality.

StepInterval 1 (1 of 7)
Usable by app (%)Loss (%)Delay variation (ms)

Phase

Stable route

Usable by app

99.7%

Send rate

180 kpps

Loss

0.2%

Delay variation

3 ms

Packet reordering

0.4%

Application strategy: No recovery

What is happening: The path is stable: packets flow with minimal loss and only minor delay variation.

Abbreviations

  • kpps (kilo packets per second) — thousands of packets per second.
  • Delay variation shows how uneven the spacing between neighboring packets becomes.

What the metrics mean

  • Delay variation between packets is especially painful for voice, video, and interactive games.
  • Packets arrive in a different order than they were sent, which requires buffering or reordering logic.
  • Share of packets usable by the application without expensive recovery.

Related chapter

IPv4 and IPv6: evolution of IP addressing

How routing, MTU, and network properties change UDP delivery quality.

Open chapter

How the network changes delivery quality

Delay variation and queues

Voice, video, and interactive events do not break on average loss — they break on queueing, when the packet arrives but is already useless.

Short loss bursts

Clustered loss hurts more than uniform loss because it is harder to mask. The remedies are FEC, concealment, or dropping the bitrate.

Path changes and asymmetry

ECMP and divergent forward/return paths shuffle packets and push reordering onto the receiver to untangle.

State timeout in NAT and load balancers

Stateful devices forget idle flows without warning. Without explicit keep-alive, return traffic will one day simply stop.

MTU and fragmentation

Oversized datagrams fragment, and losing one fragment kills the whole datagram. Cheaper to split messages in the app than to trust the network.

Broadcast and multicast in UDP

UDP can do broadcast: the sender writes a datagram to a broadcast address and every node in the local segment receives it. In practice this works only inside a local network and usually requires explicit permission on the socket — routers typically drop such packets. For one-to-many delivery beyond the segment, the options are multicast where the network supports it, or application-level fan-out through a server.

Where UDP fits best

  • Realtime media (VoIP, video calls, streaming)
  • Online games and interactive applications
  • DNS and other short queries
  • Telemetry and metrics
  • Broadcast and multicast delivery

Related chapter

TCP protocol

Reliable delivery, connection setup, and flow/congestion control at the transport layer.

Open chapter

TCP vs UDP comparison

TCP

  • Reliable delivery and order
  • Connection before transmission
  • Flow and congestion control
  • More overhead

UDP

  • Delivery without built-in guarantees
  • No connection setup, send immediately
  • Minimal overhead
  • Fits latency-sensitive workloads

Why this matters in System Design

  • In gaming, voice, and live media, fresh data matters more than perfect delivery — and UDP is designed around exactly that trade-off.
  • Reliability moves into the application protocol: acknowledgments, FEC, retries, and rate control have to be designed deliberately, not bolted on after launch.
  • Without metrics for loss, delay variation, and reordering, degradation reaches the user before it reaches the dashboard.
  • Choosing between TCP and UDP is not a matter of taste — it shows up in UX, traffic cost, and how the service behaves under load.

Common mistakes

Expecting TCP behavior from UDP without putting recovery and channel adaptation into the application yourself.

Tracking only average packet loss. Delay variation and reordering hide real degradation until the first user-visible incident.

Sending oversized datagrams without accounting for MTU across the segments traffic actually crosses.

Skipping sender-side rate control and creating self-inflicted congestion the service then has to live with.

Related chapters

Enable tracking in Settings