Introduction
Compare delivery semantics, message boundaries, headers and application responsibilities. Elapsed time depends on loss, congestion handling, packet size, handshakes and application behavior. Omitting TCP's mechanisms means another layer must supply any reliability the task needs.
Method and concepts
UDP adds source and destination ports, a length and a checksum to a message. It requires no transport handshake. Each delivered datagram retains its boundary. An application with a receive buffer too small for a message can encounter truncation according to its socket interface.
- Select an entry to isolate the relevant case.
- Read the associated evidence and compare it with your local configuration.
UDP diagram
- Telemetry sample · 120 B
- UDP datagram · 128 B
- IPv6 packet · 168 B
- Receiver reads one sample
Worked examples
Read the Application delivery entry
- Ordered stream of bytes while the connection succeeds
- One message per delivered datagram
UDP: Size a sample and interpret its arrival
- Encode 120 bytes of sample data, including an application sequence counter. The UDP length is 8 + 120 = 128 bytes.
- Add 40 IPv6 bytes. The IP packet is 168 bytes, well within a 1280-byte path budget under these assumptions.
- At the collector, samples 41 and 43 arrive before 42. Their application counters reveal the reordering. UDP assigns no delivery deadline or recovery policy.
Reference table
| Property | TCP | UDP |
|---|---|---|
| Application delivery | Ordered stream of bytes while the connection succeeds | One message per delivered datagram |
| Loss or reordering | Sequence tracking, retransmission and reassembly | Applications can observe gaps, duplication or reordering |
| Message boundaries | Application framing is needed | Datagram boundaries are preserved |
| Flow and congestion control | Built into TCP behavior | Application or a protocol above UDP must provide suitable behavior |
| Base header | 20 bytes before options | 8 bytes |
| Timing trade-off | Missing bytes can delay delivery of subsequent bytes | A later datagram can be delivered independently |
| Example | HTTP/1.1 can use TCP | QUIC carries streams and reliability above UDP |
Reading the result
An application’s configured maximum message size should account for every header within the path MTU. Losing one IP fragment prevents successful reassembly of the complete datagram. A smaller supported message size can avoid fragmentation.
Common mistakes
- Subtracting just eight bytes from an IP MTU while forgetting the IP header.
- Treating the absence of a transport handshake as evidence that the remote application is ready.
Frequently asked questions
Will UDP always finish a transfer sooner?
Elapsed time depends on loss, congestion handling, packet size, handshakes and application behavior. Omitting TCP's mechanisms means another layer must supply any reliability the task needs.
Can UDP carry a zero-byte message?
Yes. An ordinary UDP datagram with no application data has a length of eight bytes.
Is UDP always faster than TCP?
The workloads have different requirements. If the application needs retries and ordering, those mechanisms still consume time and capacity wherever they are implemented.
Does UDP guarantee delivery or ordering?
No. UDP sends datagrams without TCP's connection setup, retransmission, or ordered byte-stream guarantees. An application can add its own reliability if needed.
Why might an application use UDP?
It may need datagram boundaries, low setup overhead, multicast behavior, or custom loss handling. The application must decide whether and how to recover missing data.
Does a UDP checksum always exist in IPv4 and IPv6?
IPv6 requires a UDP checksum except for narrowly specified tunnel cases; IPv4 permits a zero checksum for UDP. Receivers and application requirements still matter.
Can UDP use a familiar service port?
Yes. Port numbers are interpreted together with transport protocol. TCP port 53 and UDP port 53 are distinct endpoints even though both are associated with DNS use.
Does UDP preserve one send as one receive?
UDP preserves datagram boundaries when a datagram is delivered, but delivery is not guaranteed. The application must handle missing, duplicated, late, or reordered datagrams as needed.
Is QUIC carried over UDP?
Yes. QUIC uses UDP datagrams as its substrate while implementing transport features and TLS-based security above UDP. That does not make plain UDP itself reliable or encrypted.
Should every UDP application ignore congestion?
No. Applications sending sustained traffic still need appropriate congestion behavior and rate control. UDP's minimal transport service does not remove that responsibility.
Can a UDP datagram be fragmented?
An IP packet carrying UDP can encounter fragmentation or path-MTU constraints. Applications that send large datagrams should consider the path size and loss cost of fragmentation.
What does the UDP length field include?
It counts the UDP header and UDP payload. The UDP header is eight bytes, and the enclosing IP packet has its own length accounting.
Why can a large UDP datagram be risky?
It can exceed the path MTU and be fragmented or dropped. Losing one IP fragment can make the whole UDP datagram unusable, so applications often keep datagrams small.
Why might DNS switch from UDP to TCP?
A resolver can retry over TCP when a UDP response is truncated or when TCP is otherwise required. Firewall rules that permit only UDP can therefore break some DNS operations.
Does UDP checksum detect every possible corruption?
It detects many transmission errors but is not cryptographic authentication and can have a finite undetected error probability. Secure applications need appropriate cryptographic integrity protection.
Does QUIC make UDP delivery reliable?
QUIC implements its own transport reliability, congestion behavior, and encryption above UDP. Those features belong to QUIC, not to the UDP service itself.
Further learning and references
- RFC 768 — User Datagram Protocol
Reference source for the concepts and service described in this guide.
- RFC 8085 — UDP usage guidelines
- RFC 8200, section 8.1 — upper-layer checksums

