The UDP header can be said to contain a very basic and simplified TCP header. It
contains destination-, source-ports, header length and a checksum as seen in the
Source port - bit 0-15. This is the source port of the packet, describing where
a reply packet should be sent. This can actually be set to zero if it doesn't
apply. For example, sometimes we don't require a reply packet, and the packet
can then be set to source port zero. In most implementations, it is set to some
Destination port - bit 16-31. The destination port of the packet. This is
required for all packets, as opposed to the source port of a packet.
Length - bit 32-47. The length field specifies the length of the whole packet in
octets, including header and data portions. The shortest possible packet can be
8 octets long.
Checksum - bit 48-63. The checksum is the same kind of checksum as used in the
TCP header, except that it contains a different set of data. In other words, it
is a one's complement of the one's complement sum of parts of the IP header,
the whole UDP header, the UDP data and padded with zeroes at the end when