User Datagram Protocol
ActiveConnectionless transport protocol that provides best-effort delivery of independent datagrams across IP networks.
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
| Field | Size | Description |
|---|---|---|
| Source Port | 16 bits | Port number of the sending application (optional) |
| Destination Port | 16 bits | Port number of the receiving application (required) |
| Length | 16 bits | Length of UDP header + data (min 8 bytes) |
| Checksum | 16 bits | Error-checking of header and data (optional in IPv4) |
| Data | Variable | Application 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
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.