User Datagram Protocol (UDP) is a connectionless transport layer protocol defined in RFC 768 that sends independent messages with minimal overhead, making it the default choice for DNS queries and DHCP address assignments where low latency and reduced server state are critical operational requirements. UDP trades reliability and ordered delivery for speed by eliminating connection setup, acknowledgments, and retransmission at the transport layer, leaving error handling to applications. Operationally, UDP failures manifest as silent packet loss and timeouts rather than explicit errors, requiring careful network monitoring and firewall configuration to avoid intermittent DNS resolution failures and security vulnerabilities such as reflection amplification attacks.
How UDP works
UDP wraps application data in a small datagram and hands it to IP. There is no connection setup, no acknowledgment and no retransmission at the transport layer.
- Application builds a message: The application, such as a DNS resolver, creates a complete request that fits in one datagram.
- UDP adds a header: UDP prepends an 8-byte header containing the source port, destination port, length and checksum.
- IP delivers the datagram: The datagram travels as an IP packet. Each datagram is routed independently and may be lost, duplicated or reordered.
- Receiver passes data to the application: The receiving host uses the destination port, for example 53 for DNS, to hand the payload to the right service.
- Application handles loss: If no reply arrives, the application decides what to do, usually a timeout followed by a retry, possibly to another server.
UDP does not provide congestion control, ordering or guaranteed delivery. DNS falls back to TCP when a response is truncated or when a transfer such as a zone transfer needs reliable delivery. DHCP uses UDP because a client without an address cannot hold a TCP connection.
Common UDP issues
A rule that permits only TCP 53 lets zone transfers work while ordinary lookups time out. Clients show intermittent resolution failures, and packet captures show queries leaving with no response.
Responses larger than the UDP payload size the client advertises are truncated and the client must retry over TCP. If TCP 53 is blocked, large answers such as DNSSEC-signed records fail while small ones succeed.
Large UDP datagrams that exceed the path MTU are fragmented, and many firewalls and middleboxes drop fragments. The symptom is that only certain queries time out, often those with big responses.
Firewalls and NAT devices track UDP flows with short idle timers. A slow upstream answer can arrive after the mapping expires and be discarded, so the client sees a timeout.
UDP gives no delivery feedback, so congestion or a full interface queue shows up only as application retries and latency. Engineers must check interface drop counters and server logs rather than expect transport errors.