The User Datagram Protocol (UDP), defined by
IETF RFC768, provides a simple, but unreliable message service for
transaction-oriented services. Each UDP header carries both a source port
identifier and destination port identifier, allowing high-level protocols to
target specific applications and services among hosts.

The UDP header structure is shown as follows:

16

32 bits

Source port

Destination port

Length

Checksum

Data

UDP header structure

Source portSource port is an optional field. When used, it
indicates the port of the sending process and may be assumed to be the port to
which a reply should be addressed in the absence of any other information. If
not used, a value of zero is inserted.

Destination portDestination port has a meaning within the context
of a particular Internet destination address.

LengthThe length in octets of this user datagram,
including this header and the data. The minimum value of the length is eight.

ChecksumThe 16-bit oneís complement of the oneís
complement sum of a pseudo header of information from the IP header, the UDP
header and the data, padded with zero octets at the end (if necessary) to make a
multiple of two octets.