Skip to main content
UDP

User Datagram Protocol

Active

Connectionless transport protocol that provides best-effort delivery of independent datagrams across IP networks.

Transport LayerRFC 7681980Internet Standard

In one line

UDP is a connectionless protocol that sends independent datagrams without guarantees of delivery, ordering, or error recovery. Defined in RFC 768, it trades reliability for speed – with only an 8-byte header, no handshake, and no retransmission, it is the foundation of DNS, video streaming, VoIP, and online gaming where low latency matters more than guaranteed delivery.

Quick Reference

FieldSizeDescription
Source Port16 bitsPort number of the sending application (optional)
Destination Port16 bitsPort number of the receiving application (required)
Length16 bitsLength of UDP header + data (min 8 bytes)
Checksum16 bitsError-checking of header and data (optional in IPv4)
DataVariableApplication data (payload)

Key Characteristics

Connectionless datagrams

No handshake or connection setup. Each datagram is independent. One send() = one recv() on the other end if it arrives – datagram boundaries are preserved by the network, unlike TCP's byte stream.

Best-effort delivery

No delivery guarantee. Packets may be lost, duplicated, or reordered without notification. Applications that need reliability must implement it (sequence numbers, ACKs, retransmission) – as QUIC does.

Application-owned reliability

UDP places responsibility for reliability, ordering, and congestion control at the application layer. QUIC (RFC 9000) demonstrates that per-stream reliability, TLS, and congestion control can be built on top of UDP without TCP's head-of-line blocking.

No retransmission

Lost packets are not retransmitted by the transport. For real-time applications (video, gaming, VoIP), this is intentional – a stale frame is worthless. For QUIC-based protocols, retransmission is handled at the QUIC layer per stream.

Implementations

linuxsince Kernel 0.99built-in
freebsdbuilt-in
windowsbuilt-in
macosbuilt-in
androidbuilt-in
iosbuilt-in

Edge cases

  • Packets may be lost, duplicated, or arrive out of order.
  • Checksum is optional in IPv4, but mandatory in IPv6.
  • UDP has no built-in congestion control.
  • Large datagrams may be fragmented at the IP layer.

History

UDP was defined in RFC 768 by David P. Reed in 1980 as a minimal transport protocol to complement TCP. It was designed for applications that do not require reliable delivery.