wire / wire-format / udp-header

UDP header

The UDP header is a fixed 8 bytes: 16-bit source port, 16-bit destination port, 16-bit length (header + data), and 16-bit checksum. There is no sequencing, acknowledgement, or connection state — UDP is a thin, connectionless datagram wrapper over IP.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: UDP datagram header · User Datagram Protocol header

wire format

spec: RFC 768

An 8-byte connectionless header. Length covers the header plus data; the checksum is optional in IPv4 (zero means not computed) but mandatory in IPv6.

fieldsizemeaning
Source Port16 bitsSending port; may be zero if no reply is expected.
Destination Port16 bitsReceiving port.
Length16 bitsLength in bytes of the UDP header plus data (minimum 8).
Checksum16 bitsOnes-complement checksum over a pseudo-header, the UDP header, and data. Optional in IPv4 (0 = unused); required in IPv6.

example:

00 35 00 35 00 1C 00 00

src port 0x0035 = 53 (DNS), dst port 53, length 0x001C = 28 bytes (8 header + 20 data), checksum 0x0000 (not computed).

see: wire-format/dns-message


provenance

see also

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/udp-header or /wire-format/udp-header.json