UDP Header

The UDP header is very simple, it contains a 16-bit source and destination port, a message length field and a checksum. The message length field is 16 bits, it provides for a datagram of up to 65,535 bytes, including the UDP datagram header and data area. The creation of the checksum is not obvious and will not be covered in these notes.

An application will send its data as part of a UDP datagram, selecting a source port and identifying the destination IP address and port. This UDP message is encapsulated in the data field of an IPv4 packet for carrying across networks. At its destination, it will be carried in the data field of an Ethernet frame across the local LAN.

Last updated