ietf-corpus

rfc-1982

Serial Number Arithmetic

R. Elz, R. Bush
date1996-08 streamIETF areaint wgdnsind statusPROPOSED STANDARD pages6 canonicalhttps://www.rfc-editor.org/rfc/rfc1982 doi10.17487/RFC1982
The DNS has long relied upon serial number arithmetic, a concept which has never really been defined, certainly not in an IETF document, though which has been widely understood. This memo supplies the missing definition. It is intended to update RFC1034 and RFC1035. [STANDARDS-TRACK]

updates

Extracted elements (18)

design-rationale §1

RFC 1034 and RFC 1035 referenced 'sequence space arithmetic' from TCP (IEN-74), but IEN-74's definition was inadequate for DNS because it provided no general comparison operator. This document supplies the missing definition rather than relying on the TCP precedent.

dns

design-rationale §6

Serial number arithmetic is defined generically (parameterised by SERIAL_BITS) so it can be reused by protocols other than DNS. Any document referencing 'Serial Number Arithmetic from RFC 1982' with a stated SERIAL_BITS value inherits the rules of sections 2–5.

dns

design-rationale §3.2

The undefined comparison case (numbers exactly half the serial space apart) was left undefined rather than arbitrarily resolved because any fixed resolution would cause s1 < s2 while simultaneously s2 < s1 when the pair is reversed, making results depend on test order. A defined-but-arbitrary resolution would also produce the counterintuitive result s1 < s2 but (s1+1) > (s2+1).

dns

interoperability-note §7

Many DNS implementations have incorrectly treated SOA serial number zero as a special case with unusual properties. Caution should be exercised before setting the serial number to zero, as unexpected behaviour from those implementations may result.

dns

interoperability-note §1

Older implementations are known to have treated the SOA serial number as a plain unsigned integer with no sequence-space arithmetic and no wrapping. No interoperability accommodation for these implementations is defined; they are considered superseded.

dns

normative-requirement §7 SHOULD

Care SHOULD be taken that the SOA serial number not be incremented, in one or more steps, by more than 2^31 - 1 within the period given by SOA.expire. Exceeding this may leave secondary servers with out-of-date zones whose serial number appears greater than the primary's.

dns

normative-requirement §7 MUST

Each increment to the SOA serial number must be treated as the start of a new sequence of increments for the SOA.expire-period accounting, as well as a continuation of all previous sequences started within that period.

dns

normative-requirement §8 MUST

RFC 1034 and RFC 1035 are to be treated as if their references to 'sequence space arithmetic' are replaced by references to serial number arithmetic as defined in this document (RFC 1982).

dns

normative-requirement §3.1 MUST

The addend n in serial number addition MUST be within [0 .. 2^(SERIAL_BITS-1) - 1]. Addition of a value outside this range is undefined and implementations must not rely on any particular outcome.

dns

protocol-element §2

A serial number is a non-negative integer drawn from a finite subset [0 .. 2^SERIAL_BITS - 1]. The parameter SERIAL_BITS defines the size of the space; no value has special significance, and every value has both a successor and a predecessor.

dns

protocol-element §4.1

Corollary 1: For any serial number s and valid addend n, (s + n) >= s; equality holds only when n == 0. This means addition of a positive n always produces a strictly greater serial number.

dns

protocol-element §4.2

Corollary 2: If s' = s + n (non-zero n) and s'' = s' + m, the relationship between s'' and s is undefined (though s'' != s). Two successive additions can yield a result whose ordering relative to the original is indeterminate.

dns

protocol-element §3.2

For pairs of serial numbers exactly 2^(SERIAL_BITS-1) apart, comparison is undefined: s1 is neither equal to, greater than, nor less than s2. Implementations may return either result or flag an error.

dns

protocol-element §3.2

s1 is greater than s2 if and only if (i1 < i2 and i2 - i1 > 2^(SERIAL_BITS-1)) or (i1 > i2 and i1 - i2 < 2^(SERIAL_BITS-1)). Equality holds iff i1 == i2.

dns

protocol-element §3.2

s1 is less than s2 if and only if (i1 < i2 and i2 - i1 < 2^(SERIAL_BITS-1)) or (i1 > i2 and i1 - i2 > 2^(SERIAL_BITS-1)), where i1, i2 are the unbounded integer equivalents of s1, s2.

dns

protocol-element §3.1

Serial number addition is defined as s' = (s + n) modulo (2^SERIAL_BITS), where n must be in the range [0 .. 2^(SERIAL_BITS-1) - 1]. Addition of a value outside this range is explicitly undefined.

dns

protocol-element §7

The DNS SOA serial number is a Serial Number with SERIAL_BITS = 32, taking values in [0 .. 4294967295]. The maximum defined single increment is 2147483647 (2^31 - 1).

dns

security-consideration §9

This document does not introduce or address any security considerations. It is not believed to add to or lessen any security issues that may exist with the DNS.

dns, security