UDP is a Layer 4 transport protocol that uses port numbers to address application services and multiplex sessions. It sends independent datagrams without first establishing a connection. section 22.0 section 22.2.2
UDP provides no acknowledgments, retransmissions, sequencing, or flow control. Its checksum detects errors, but corrupted messages are discarded rather than retransmitted. The UDP header is only 8 bytes, reducing data, processing, and time overhead compared with TCP. section 22.2.2 section 22.2.3
Choose UDP when speed or efficiency matters more than guaranteed delivery and ordered data.
- Treat each datagram as a self-contained unit; its boundaries correspond to discrete chunks of data. section 22.2.2
- Expect possible loss or reordering because UDP does not restore missing or out-of-order messages. section 22.2.2
- Use UDP-based communication for scenarios such as VoIP, live video streaming, and simple DNS exchanges. section 4.3.1 section 22.2.3
- Compare UDP with TCP by remembering: UDP is connectionless, unreliable, unordered, and lacking flow control, but has less overhead. section 22.2.3
A simple DNS exchange
A client can use UDP for a DNS request and response when resolving a name such as google.com. After learning the IP address, it can use HTTPS to access the website. The exchange illustrates UDP’s low-overhead, send-and-forget behavior before a separate application connection. section 22.2.3 section 4.3.1
Figure 22.11 The UDP header. Compared to the TCP header, the UDP header is very lightweight, being only 8 bytes in size.
Inspect the compact UDP header and its 8-byte size, a key contrast with TCP’s larger header. section 22.2.2
Table 22.2 Comparing TCP and UDP (view table figure)
| TCP |
UDP |
|---|---|
| Connection-oriented |
Not connection-oriented |
| Data sequencing |
No data sequencing |
| Reliable |
Unreliable |
| Flow control |
No flow control |
| More overhead |
Less overhead |
| Preferred in situations where data integrity is critical and delivery of all segments is required |
Preferred in situations where speed or efficiency is a priority and some packet loss is acceptable |
Use the comparison table to review connection behavior, sequencing, reliability, flow control, overhead, and preferred use cases. section 22.2.3




