7 Network Working Group M. Crawford
8 Request for Comments: 2673 Fermilab
9 Category: Standards Track August 1999
12 Binary Labels in the Domain Name System
16 This document specifies an Internet standards track protocol for the
17 Internet community, and requests discussion and suggestions for
18 improvements. Please refer to the current edition of the "Internet
19 Official Protocol Standards" (STD 1) for the standardization state
20 and status of this protocol. Distribution of this memo is unlimited.
24 Copyright (C) The Internet Society (1999). All Rights Reserved.
26 1. Introduction and Terminology
28 This document defines a "Bit-String Label" which may appear within
29 domain names. This new label type compactly represents a sequence of
30 "One-Bit Labels" and enables resource records to be stored at any
31 bit-boundary in a binary-named section of the domain name tree.
33 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
34 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
35 document are to be interpreted as described in [KWORD].
39 Binary labels are intended to efficiently solve the problem of
40 storing data and delegating authority on arbitrary boundaries when
41 the structure of underlying name space is most naturally represented
46 Up to 256 One-Bit Labels can be grouped into a single Bit-String
47 Label. Within a Bit-String Label the most significant or "highest
48 level" bit appears first. This is unlike the ordering of DNS labels
49 themselves, which has the least significant or "lowest level" label
50 first. Nonetheless, this ordering seems to be the most natural and
51 efficient for representing binary labels.
58 Crawford Standards Track [Page 1]
60 RFC 2673 Binary Labels in the Domain Name System August 1999
63 Among consecutive Bit-String Labels, the bits in the first-appearing
64 label are less significant or "at a lower level" than the bits in
65 subsequent Bit-String Labels, just as ASCII labels are ordered.
70 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 . . .
71 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-//+-+-+-+-+-+-+
72 |0 1| ELT | Count | Label ... |
73 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+//-+-+-+-+-+-+-+
75 (Each tic mark represents one bit.)
78 ELT 000001 binary, the six-bit extended label type [EDNS0]
79 assigned to the Bit-String Label.
81 Count The number of significant bits in the Label field. A Count
82 value of zero indicates that 256 bits are significant.
83 (Thus the null label representing the DNS root cannot be
84 represented as a Bit String Label.)
86 Label The bit string representing a sequence of One-Bit Labels,
87 with the most significant bit first. That is, the One-Bit
88 Label in position 17 in the diagram above represents a
89 subdomain of the domain represented by the One-Bit Label in
90 position 16, and so on.
92 The Label field is padded on the right with zero to seven
93 pad bits to make the entire field occupy an integral number
94 of octets. These pad bits MUST be zero on transmission and
97 A sequence of bits may be split into two or more Bit-String Labels,
98 but the division points have no significance and need not be
99 preserved. An excessively clever server implementation might split
100 Bit-String Labels so as to maximize the effectiveness of message
101 compression [DNSIS]. A simpler server might divide Bit-String Labels
102 at zone boundaries, if any zone boundaries happen to fall between
105 3.2. Textual Representation
107 A Bit-String Label is represented in text -- in a zone file, for
108 example -- as a <bit-spec> surrounded by the delimiters "\[" and "]".
109 The <bit-spec> is either a dotted quad or a base indicator and a
110 sequence of digits appropriate to that base, optionally followed by a
114 Crawford Standards Track [Page 2]
116 RFC 2673 Binary Labels in the Domain Name System August 1999
119 slash and a length. The base indicators are "b", "o" and "x",
120 denoting base 2, 8 and 16 respectively. The length counts the
121 significant bits and MUST be between 1 and 32, inclusive, after a
122 dotted quad, or between 1 and 256, inclusive, after one of the other
123 forms. If the length is omitted, the implicit length is 32 for a
124 dotted quad or 1, 3 or 4 times the number of binary, octal or
125 hexadecimal digits supplied, respectively, for the other forms.
127 In augmented Backus-Naur form [ABNF],
129 bit-string-label = "\[" bit-spec "]"
131 bit-spec = bit-data [ "/" length ]
132 / dotted-quad [ "/" slength ]
134 bit-data = "x" 1*64HEXDIG
138 dotted-quad = decbyte "." decbyte "." decbyte "." decbyte
142 length = NZDIGIT *2DIGIT
144 slength = NZDIGIT [ DIGIT ]
150 If a <length> is present, the number of digits in the <bit-data> MUST
151 be just sufficient to contain the number of bits specified by the
152 <length>. If there are insignificant bits in a final hexadecimal or
153 octal digit, they MUST be zero. A <dotted-quad> always has all four
154 parts even if the associated <slength> is less than 24, but, like the
155 other forms, insignificant bits MUST be zero.
157 Each number represented by a <decbyte> must be between 0 and 255,
160 The number represented by <length> must be between 1 and 256
163 The number represented by <slength> must be between 1 and 32
170 Crawford Standards Track [Page 3]
172 RFC 2673 Binary Labels in the Domain Name System August 1999
175 When the textual form of a Bit-String Label is generated by machine,
176 the length SHOULD be explicit, not implicit.
180 The following four textual forms represent the same Bit-String Label.
187 The following represents two consecutive Bit-String Labels which
188 denote the same relative point in the DNS tree as any of the above
189 single Bit-String Labels.
193 3.3. Canonical Representation and Sort Order
195 Both the wire form and the text form of binary labels have a degree
196 of flexibility in their grouping into multiple consecutive Bit-String
197 Labels. For generating and checking DNS signature records [DNSSEC]
198 binary labels must be in a predictable form. This canonical form is
199 defined as the form which has the fewest possible Bit-String Labels
200 and in which all except possibly the first (least significant) label
201 in any sequence of consecutive Bit-String Labels is of maximum
204 For example, the canonical form of any sequence of up to 256 One-Bit
205 Labels has a single Bit-String Label, and the canonical form of a
206 sequence of 513 to 768 One-Bit Labels has three Bit-String Labels of
207 which the second and third contain 256 label bits.
209 The canonical sort order of domain names [DNSSEC] is extended to
210 encompass binary labels as follows. Sorting is still label-by-label,
211 from most to least significant, where a label may now be a One-Bit
212 Label or a standard (code 00) label. Any One-Bit Label sorts before
213 any standard label, and a 0 bit sorts before a 1 bit. The absence of
214 a label sorts before any label, as specified in [DNSSEC].
226 Crawford Standards Track [Page 4]
228 RFC 2673 Binary Labels in the Domain Name System August 1999
231 For example, the following domain names are correctly sorted.
237 bravo.\[b10].foo.example
242 A One-Bit Label never matches any other kind of label. In
243 particular, the DNS labels represented by the single ASCII characters
244 "0" and "1" do not match One-Bit Labels represented by the bit values
249 A Count of zero in the wire-form represents a 256-bit sequence, not
250 to optimize that particular case, but to make it completely
251 impossible to have a zero-bit label.
253 6. IANA Considerations
255 This document defines one Extended Label Type, termed the Bit-String
256 Label, and requests registration of the code point 000001 binary in
257 the space defined by [EDNS0].
259 7. Security Considerations
261 All security considerations which apply to traditional ASCII DNS
262 labels apply equally to binary labels. he canonicalization and
263 sorting rules of section 3.3 allow these to be addressed by DNS
282 Crawford Standards Track [Page 5]
284 RFC 2673 Binary Labels in the Domain Name System August 1999
289 [ABNF] Crocker, D. and P. Overell, "Augmented BNF for Syntax
290 Specifications: ABNF", RFC 2234, November 1997.
292 [DNSIS] Mockapetris, P., "Domain names - implementation and
293 specification", STD 13, RFC 1035, November 1987.
295 [DNSSEC] Eastlake, D., 3rd, C. Kaufman, "Domain Name System Security
296 Extensions", RFC 2065, January 1997
298 [EDNS0] Vixie, P., "Extension mechanisms for DNS (EDNS0)", RFC 2671,
301 [KWORD] Bradner, S., "Key words for use in RFCs to Indicate
302 Requirement Levels," BCP 14, RFC 2119, March 1997.
312 Phone: +1 630 840-3461
313 EMail: crawdad@fnal.gov
338 Crawford Standards Track [Page 6]
340 RFC 2673 Binary Labels in the Domain Name System August 1999
343 10. Full Copyright Statement
345 Copyright (C) The Internet Society (1999). All Rights Reserved.
347 This document and translations of it may be copied and furnished to
348 others, and derivative works that comment on or otherwise explain it
349 or assist in its implementation may be prepared, copied, published
350 and distributed, in whole or in part, without restriction of any
351 kind, provided that the above copyright notice and this paragraph are
352 included on all such copies and derivative works. However, this
353 document itself may not be modified in any way, such as by removing
354 the copyright notice or references to the Internet Society or other
355 Internet organizations, except as needed for the purpose of
356 developing Internet standards in which case the procedures for
357 copyrights defined in the Internet Standards process must be
358 followed, or as required to translate it into languages other than
361 The limited permissions granted above are perpetual and will not be
362 revoked by the Internet Society or its successors or assigns.
364 This document and the information contained herein is provided on an
365 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
366 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
367 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
368 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
369 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
373 Funding for the RFC Editor function is currently provided by the
394 Crawford Standards Track [Page 7]