The UDP datagram and its pseudo-header

Four 2-byte fields make an 8-byte header. Change the payload and watch the Length; build the pseudo-header that the checksum also covers and that is never transmitted; follow the three levels of addressing in a host.

Payload

The application message, in bytes. UDP does not segment: one message = one datagram.

Example

Process in A (port 9157) sends to a process in C (port 6428). The IP addresses are documentation addresses (RFC 5737).

A · 203.0.113.7 : 9157
C · 198.51.100.20 : 6428

Practice

Questions on sizes, like the ones in class: the answer is hidden until you press Check.

View

The checksum is computed step by step in UDP checksum step by step.

The UDP segment in 32-bit rows (hover over or focus a field)

The pseudo-header

Three levels of addressing in a host

Three levels are needed in each host: the host address (in the IP header), the protocol address (in the IP header: 6 = TCP, 17 = UDP) and the port number (in the UDP/TCP segment header). That is why 443/TCP and 443/UDP can coexist.

Model assumptions
  • Each header field takes 16 bits (2 B): the header is 8 B. Length = header + data, in bytes: 8 ≤ L ≤ 65 535. Maximum payload: 65 535 − 8 = 65 527 B; over IPv4 (20-byte header), 65 507 B.
  • The IPv4 header is assumed to have no options (20 B); the dashed row is not used. With options (up to 60 B) the maximum data drops to 65 467 B. The IPv4 header is covered in Topic 4; only the source IP, destination IP and Protocol fields matter here.
  • The checksum value is not computed here: it is computed over the pseudo-header plus the whole segment, with the field set to 0. You will do it in the lab; the one's complement sum is in “UDP checksum step by step”.
  • A datagram that does not fit in the network MTU is fragmented by IP (Topic 4); UDP still sends a single datagram.