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.
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.
A visualization of the UDP datagram (Kurose and Ross §3.3, RFC 768). The segment is drawn in 32-bit rows: an 8-byte header with four 16-bit fields (source port, destination port, length and checksum) and the data; hovering over or focusing each field shows what it means. A payload slider updates the Length (header + data, between 8 and 65 535 B) and the size of the IPv4 datagram, and marks the limits: 8 B with no data, 65 527 B of data as the maximum of the Length field and 65 507 B over IPv4 because of its 20-byte header. An animation builds the 12-byte pseudo-header: the source IP, the destination IP and protocol 17 come down from the IPv4 header, a zero byte and the UDP length are added, and it is marked as not transmitted because each end rebuilds it; it also protects whom the datagram was addressed to. Computing the checksum is left to the lab. An interactive cascade shows the three levels of addressing in a host: the IP address, the Protocol field (6 = TCP, 17 = UDP) and the port number, which is why 443/TCP and 443/UDP can coexist. It includes practice questions on sizes.
Concepts: UDP datagram, UDP header, source port, destination port, Length field, UDP checksum, pseudo-header, maximum payload, protocol number, addressing levels.
Formulas:
UDP Length = 8 + data (8 ≤ L ≤ 65 535)max. data = 65 535 − 8 = 65 527 B; over IPv4, 65 535 − 20 − 8 = 65 507 Bpseudo-header = source IP (4) + destination IP (4) + 0x00 (1) + Protocol 17 (1) + UDP length (2) = 12 BNetwork Architecture I, Session 3.1 · Enrique de la Hoz, University of Alcalá · License CC BY-SA 4.0 · Source and catalogue on GitHub · DOI 10.5281/zenodo.23285664