Skip to content

UPD Datagram Header

UDP

  • Source port number
    • This field identifies the sender's port when used and should be assumed to be the port to reply to if needed. If not used, it should be zero. If the source host is the client, the port number is likely to be an ephemeral port. If the source host is the server, the port number will likely be a well-known port from 0 to 1023.
  • Destination port number
    • This field identifies the receiver's port and is required. Similar to the source port number, if the client is the destination host, the port number will likely be an ephemeral port number, and if the destination host is the server, then the port number will likely be a well-known port number.
  • Length
    • This field specifies the length of the UDP header and UDP data in bytes. The minimum length is 8 bytes, the length of the header. The field size sets a theoretical limit of 65,535 bytes (8-byte header + 65,527 bytes of data) for a UDP datagram. However, the actual limit for the data length, which is imposed by the underlying IPv4 protocol, is 65,507 bytes (65,535 bytes − 8-byte UDP header − 20-byte IP header).
    • Using IPv6 jumbograms, it is possible to have UDP datagrams of size greater than 65,535 bytes. The length field is zero if the length of the UDP header plus UDP data exceeds 65,535.
  • Checksum
    • The checksum field may be used to error-check the header and data. This field is optional in IPv4 and mandatory in most cases in IPv6. The field carries all-zeros if unused.