UDP is a “no frills”, “bare bones” internet transport protocol.
- “best effort” service - UDP segments can be lost or delivered out-of-order to app
- UDP is connectionless
- No handshake between UDP sender/receiver
- UDP segments are handled independently of others
- UDP exists for several reasons:
- no connection establishment to add delay
- simple - no connection state at sender or receiver
- smaller header size
- no congestion control - can send data as fast as desired
UDP use cases include:
- streaming multimedia apps (loss sensitive + rate sensitive)
- DNS
- SNMP
- HTTP/3
Reliable transfer can be added (e.g. for HTTP/3) at the application level.
Similarly, flow/congestion control can be added if desired at the application level.
The UDP protocol is defined in RFC 768.

UDP Checksum
The goal of the UDP checksum is to detect errors (i.e. flipped bits) in the transmitted segment.
- From sender side:
- Contents of UDP segment (including UDP header, IP addresses) are treated as sequences of 16 bit integers
- Checksum is the sum (one’s complement sum) of segment content - flip bits
- Checksum value is placed in UDP checksum
- From receiver side:
- Compute checksum of received segment
- check if computed checksum = checksum field value
- Not equal ⇒ error
- Equal ⇒ no error detected, though we could still have an error