UDP Explained: Datagrams, Ports and Headers
UDP sends independent datagrams between applications. It has a small header and does not establish a TCP-style connection before sending.
Published by Protocol Explorer · Reviewed
What a UDP datagram contains
The eight-byte UDP header contains source and destination ports, length and checksum. Ports identify application endpoints. The length covers the UDP header and its data; the checksum protects the datagram and a pseudo-header containing selected IP information.
Delivery and ordering
UDP itself does not guarantee delivery, ordering or duplicate suppression. Applications that need these properties must provide them at another layer. A UDP datagram preserves a message boundary for the receiving application.
UDP compared with TCP
TCP provides an ordered byte stream with retransmission and flow control. UDP provides datagrams without those TCP services. The choice depends on the application: DNS commonly uses UDP, while QUIC builds reliable encrypted connections over UDP.
Read a UDP packet
Start with the destination port and length, then inspect the checksum and payload. Compare request and response datagrams rather than looking for a SYN or an ACK flag; those are TCP concepts.
Follow an example step by step
- Find the IP protocol or next-header value identifying UDP.
- Read source and destination ports and compare the UDP length with the packet payload.
- Pair request and response using application data when the application provides a suitable identifier.
Common interpretation mistake
UDP does not contain a TCP-style handshake or sequence-number field.
Key point to remember
Some applications implement retries and ordering above UDP; QUIC is one example.
Try the interactive lesson
Open Protocol Explorer and select UDP to follow the exchange packet by packet. The UDP lesson is free and does not require an account. Pro is a one-time $4.99 purchase for the full library; an account is required to buy and restore it.
Open Protocol Explorer · Free and Pro access
Primary reference
RFC 768: User Datagram Protocol
Related protocol lessons
TCP · HTTP · HTTPS · How to read a packet