How the Internet works

Transport, chapter 20 of 36

UDP: Eight Bytes of Header

Since 1980 nobody has found anything to fix in RFC 768, three pages that still define UDP.

Before the SYN, the laptop sends the ISP's resolver a 75-byte frame. Behind the IPv4 header sit eight bytes of transport header (two port numbers, a length, and a checksum) and then a question about www.example.net. No handshake announced the frame and nothing will acknowledge it. If it is lost, the only thing that notices is a timer in the resolver library, which asks again.

1980
the date of RFC 768, three pages by Jon Postel that were never obsoleted
0x8920
our query's checksum, which also covers 12 octets that never cross the wire
51,200
amplification that Cloudflare reported in February 2018, from 15-byte memcached requests to responses of about 750 kB

Twelve octets that never travel

The checksum of our DNS query, summed in 16-bit words with the field taken as zero, once at the sender and once at the receiver. Change the network, the sender, the receiving host, or one octet of the message, and watch the verdict.

Why has RFC 768 never been replaced?

RFC 768 is three pages by Jon Postel, dated 28 August 1980, and nobody has found anything in it to fix. When the host requirements of 1989 went through the protocols one by one, the UDP walk-through took one sentence: "There are no known errors in the specification of UDP" (RFC 1122, Section 4.1.2).

The debugging had happened before the RFC. IEN 88 of May 1979 still gave the minimum length as four for a header of eight octets, and of the IP header its checksum covered only the two addresses. RFC 768 corrected the minimum to eight and added the protocol and the UDP length to the pseudo-header.

What does the pseudo-header protect?

The checksum covers twelve octets that never cross the wire, the eight octets of header, and the data. The pseudo-header carries both addresses and the protocol number, which RFC 768 justifies as "protection against misrouted datagrams". A datagram that reaches the wrong host fails the check. The length enters the sum twice, and RFC 8085, Section 3.4 adds that it catches truncation and padding.

IPv4 already has a header checksum, but every router writes a new one, and a router that computes it afresh hides a header it damaged itself. The price is a layer violation: a NAT that rewrites an address must patch the UDP checksum as well.

May a sender switch the checksum off?

Over IPv4 it may, because RFC 768 reserves the zero value for a sender that generated no checksum. RFC 1122, Section 4.1.3.4 tightened this in 1989. Generation must be on by default, and a datagram with a nonzero, wrong checksum must be discarded silently.

IPv6 has no header checksum, so a receiver must discard a datagram whose UDP checksum is zero (RFC 8200, Section 8.1). Tunnel builders objected that an outer checksum over packets with their own inner checksums looked like "an unwarranted burden" (RFC 6935, Section 1). RFC 6935 and RFC 6936 (April 2013) allow a zero-checksum mode for tunnel encapsulations, enabled per port and never globally.

How did the laptop pick port 53124?

An off-path attacker who wants to inject a forged answer must match the five values of the transport tuple, and of those the client's port is the only one to guess (RFC 6056, Section 1). A DNS answer must also match the 16-bit query ID and the question (RFC 5452, Section 9.1).

If the resolver library leaves the choice to the kernel, Linux binds the socket when the library first calls connect() or sends, before it looks at the destination, and udp_lib_get_port() starts at a random point in 32768 to 60999 [Linux2026]. Port 53124 is then one of 28,232 equally likely values, about 14.8 bits. Chromium's own DNS client binds a random port from 1024 to 65535 instead [Chromium2026].

What stops a datagram from lying about its sender?

UDP has no defense of its own, and a server answers the source address of the request. A request with a forged source sends the reply to the owner of that address, and if the reply is larger than the request, the attacker has an amplifier. In 2014 Christian Rossow measured an average factor of 556.9 for NTP [Rossow2014].

RFC 4732, Section 3.2 draws the design rule: no significantly larger responses without a handshake that validates the client's address. The transport side answers with that handshake. QUIC sends at most three times the bytes it has received to an unvalidated address (RFC 9000, Section 8).

Can eight bytes grow options?

RFC 9868 (October 2025), by Joe Touch, finds the room in a redundancy. The UDP length usually equals the IP payload length, but nothing requires it to. If it is smaller, the octets between the end of the UDP data and the end of the IP payload form a surplus area for options (RFC 9868, Section 7).

A legacy receiver must deliver exactly the UDP data and ignore the rest, and Linux does: udp_rcv() trims the packet to the UDP length before it verifies the checksum [Linux2026]. As for why UDP has its own length field at all, RFC 9868, Section 4 says that "the real reason remains unknown".

attackermemcached :11211victim 15 B request, source = victimup to 750 kB, never requested
From the book: Reflection with amplification: the answer goes to the forged source

The book keeps asking

This chapter has 5,733 words and 12 questions. These 6 are answered only in the book and the audiobook.

  • What does the laptop send?
  • What happened to UDP-Lite?
  • Who decides what port 53 means?
  • Why do new transports travel inside UDP?
  • How does an application read the ECN bits?
  • What does a datagram cost the kernel?

Open the sources

  • RFC 768 User Datagram Protocol 1980, Internet Standard, STD 6
  • RFC 1122 Requirements for Internet Hosts - Communication Layers 1989, Internet Standard, STD 3
  • RFC 6335 Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry 2011, Best Current Practice, BCP 165
  • RFC 6056 Recommendations for Transport-Protocol Port Randomization 2011, Best Current Practice, BCP 156
  • RFC 8085 UDP Usage Guidelines 2017, Best Current Practice, BCP 145
  • RFC 6936 Applicability Statement for the Use of IPv6 UDP Datagrams with Zero Checksums 2013, Proposed Standard
  • RFC 9868 Transport Options for UDP 2025, Proposed Standard
  • [Linux2026] Linux kernel source tree, v7.4-rc1 (commit 6628e7d4c6b2, 1 November 2026) 2026, free

All 51 documents this chapter cites, each with a link to its publisher and a copy kept here.

Transport, chapter 21 of 36

TCP: The Connection

Transport, chapter 22 of 36

Congestion Control: From Collapse to BBR

Transport, chapter 23 of 36

Beyond TCP: SCTP, DCCP, and Multipath

Names and Trust, chapter 24 of 36

DNS: The Namespace and the Wire Format

Names and Trust, chapter 25 of 36

Resolvers, DNSSEC, and Encrypted DNS

Names and Trust, chapter 26 of 36

TLS 1.3: The Handshake

Names and Trust, chapter 27 of 36

Certificates and the Web PKI

Applications, chapter 28 of 36

HTTP: Semantics and HTTP/1.1

Applications, chapter 29 of 36

HTTP/2: Multiplexing over One Connection

Applications, chapter 30 of 36

QUIC: A Transport in Userspace

Applications, chapter 31 of 36

HTTP/3: The Web on QUIC

Applications, chapter 32 of 36

Mail: SMTP and Forty Years of Patches

Applications, chapter 33 of 36

Time, Shells, and Files: NTP, SSH, Telnet, and FTP

The Whole Path, chapter 34 of 36

Measuring and Debugging the Path

The Whole Path, chapter 35 of 36

The Whole Journey, Byte by Byte

The Whole Path, chapter 36 of 36

Ossification and What Comes Next

You have reached the server. The book goes further.

Everything on this site is a short version. Follow the Packet is the long one: 36 chapters and about 280,000 words, with every protocol fact traced to the section of the standard that defines it, every byte dump built by a script you can run, and a directory of more than a thousand cited documents. It comes as a printable book and as an audiobook.

Hear how chapter 1 opens. 70 seconds, narrated by a synthetic voice.

Get the book or the audiobook Read the start of chapter 1 Browse every source

Cover of Follow the Packet: How the Internet Works, Layer by Layer, from ARPANET to QUIC, by Wolfgang Kerschbaumer

The signup uses double opt-in. Every message includes an unsubscribe link.

Published by Sysinit Press. The public addresses, AS numbers and names of the scenario come from ranges reserved for documentation, and the home network uses private addresses, so the site describes no real network. RFC texts are copied unchanged from the RFC Editor.