A UDP datagram is used in Network File System (NFS), DNS, SNMP, TFTP etc. and has no
handshaking, flow control or windowing capability, it is a fire and forget type protocol. The segment
looks like this:
The checksum field includes a 12-byte 'pseudo header' that includes the source and destination IP addresses,
the 8-bit reserved field containing 0, the 8-bit protocol ID and the 16-bit UDP length field. The
pseudo header is useful to check that the IP datagram arrived at the correct station.
UDP is ideal for applications that want to send datagrams one at a time and for applications that perform
their own error recovery. There is no sequencing with UDP so you do not want UDP datagrams to become
fragmenting therefore the MTU of the LLC needs to be larger than that taken up by the UDP datagram including
the UDP and IP headers and the data.
An application can use a UDP port number and another application can use the same port number for a TCP session
from the same IP address. Very often the port numbers in
RFC1700 are the same for TCP and UDP. The advantages
of UDP over TCP are that it does not have to wait for acknowledgements, keep packets in memory for re-ordering
purposes or perform handshaking, it is therefore quicker and has less overhead than TCP.