Visual RFC.
ALL RFCs / RFC 7830
Read the RFC ↗
RFC 7830 / EDNS PADDING

Decode the Padding option exactly

02

Two 16-bit fields precede a variable data region, and zero data bytes is legal.

RFC 7830 · § 3EXAMPLE
4 / 4
Decode the Padding option exactlyA selected OPT RDATA would contain two code12 Padding options. The local builder stops before encoding the duplicate, without asserting a universal RFC7830 receiver error response.Read the Padding option bytesOne OPT RDATA contains:Padding(code12) · Padding(code12)At most ONE Padding optionChosen builder stops before the duplicateNo specific RFC7830 error packet is inventedRFC7830 · chapter 2 · state 4 · fictional examples
04
Prevent a duplicate option

The chosen builder stops before encoding a second Padding option; no universal RFC receiver error is asserted.

Source for this drawing: RFC 7830 · Read RFC section 3 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Count data bytes separately from the four-byte header, and accept any received padding value.

  • The option lives inside the RDATA of the OPT record. Its OPTION-CODE is 12, encoded as 00 0c. OPTION-LENGTH is the number of following PADDING octets, excluding the two code octets and two length octets. A chosen length-three zero-filled option is 00 0c 00 03 00 00 00: seven octets in total (§3).
  • The minimum data length is zero. Thus 00 0c 00 00 is a present Padding option that still occupies four octets. Presence must not be detected by testing whether its data length is nonzero (§3). This distinction also matters when a zero-length request option triggers the response rule.
  • Padding octets SHOULD be 0x00. Other values MAY be used, for example when compression before encryption is a concern. Received PADDING octets of any value MUST be accepted. A nonzero body is not by itself a malformed Padding option; changing SHOULD into a mandatory all-zero receiver check would be wrong (§3).
  • The Padding option MUST occur at most once per OPT record and therefore at most once per DNS message (§3). RFC 6891 §6.1.1 permits only one OPT record in a message. The chosen builder rejects a duplicate Padding option before serialization. This is a local input disposition, not a claim that RFC 7830 mandates a particular receiver error packet.
  • OPT RDLEN counts all option headers and data in its RDATA. Its 16-bit bound, the overall message budget and any other options all constrain what can fit; a 16-bit Padding length alone does not mean 65535 data octets fit into a whole message. The selected parser never reads past the declared RDATA boundary, and its incomplete/error statuses are local buffer policies (RFC 6891 §6.1.2).
DETAILS

Fictional offline DNS messages, local bounded parsing and chosen padding policies. Length figures describe DNS messages before transport overhead. No DNS traffic, encryption, anonymity measurement or production protocol stack is implemented.

Read the RFC section ↗

All chapters in RFC 7830

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗