Connectionless, unreliable, datagram service. Note that unreliable does not refer to the presence of undetected errors (data integrity is guaranteed, but delivery and sequence is not). A very thin veneer on top of IP. Lower overhead both for header and for time (no connection set-up).
UDP is a good match to applications that don't need reliability, for example SNMP, DNS. Or for those in which the environment is clean and small (LAN) so that errors are quite unlikely.
UDP packets may be corrupted in transit, lost due to congestion in a router, lost due to buffer overrun in the receiver's buffer. In all cases their is no indication given to the sending process. Packets just disappear.
| source port | destination port | length | checksum | data payload |
| 16 bits | 16 bits | 16 bits | 16 bits | |
| ids the source process | ids the dest process | includes both header and data payload | covers entire packet; may be turned off | up to 64k - 8 bytes, in practice often smaller |
Some notes:
The UDP checksum calculation is peformed (on both ends) for the datagram + the pseudo-header + some padding bytes. Thus checking the checksum also confirms that the datagram was delivered to the correct host.
Since the UDP checksum includes the IP source and destination addresses, these must both be known by UDP to calculate the checksum for the UDP datagram. The destination address is known by UDP, but the source address depends on the route chosen by the IP layer, so can't be known to UDP. How can the checksum be calculated without violating the purity of the layer model? It can't. UDP and IP are tightly integrated, so either UDP makes an IP packet and passes that, or IP tells UDP the source address to use for the checksum calculation.
When UDP was a small part of network traffic this was ok. But with the
increasing popularity of video and audio over the net, more and more traffic
is UDP based. This can be a problem for ISPs and backbone routers on the
net, since congestion isn't handled by the sources of the data (the transport
layer of the sender).