<?xml version="1.0"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<?rfc tocappendix="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="3"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<?rfc comments="no" ?>
<?rfc inline="yes" ?>
<rfc category="exp" docName="draft-muks-dnsop-dns-squash-00" ipr="trust200902">

  <front>

    <title>DNS squash</title>

    <author fullname="Mukund Sivaraman" initials="M." surname="Sivaraman">
      <organization>Internet Systems Consortium</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <code>94063</code>
          <region>CA</region>
          <country>US</country>
        </postal>
        <email>muks@mukund.org</email>
        <uri>https://www.isc.org/</uri>
      </address>
    </author>

    <date/>

    <!-- Meta-data Declarations -->

    <area>Operations and Management Area</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- <keyword>dns</keyword> -->

    <abstract>
      <t>This document attempts to specify current DNS protocol in
      squashed form in a single document.</t>
    </abstract>

  </front>

  <middle>

    <section title="About this document">
      <t>Current DNS protocol is spread over several RFCs and drafts
      dating back to 1987 (beginning from <xref target="RFC1033" />,
      <xref target="RFC1034" />, <xref target="RFC1035" />). There is no
      structure and order to be found in the publication of these
      RFCs. The early DNS RFCs are insufficiently specified and some
      parts of intermediate RFCs are obsolete. The internet has changed
      significantly since 1987 and there are several security
      considerations when implementing public-facing DNS. Learning the
      DNS protocol pedantically for the purpose of implementing it is
      very very difficult, and navigating the RFCs without any
      consistent ordering or rationale is at best confusing to a
      newcomer.</t>

      <t>This document attempts to provide a single structured reference
      of the current "core" DNS protocol, squashing together the
      contents and errata of the various DNS RFCs and drafts. It also
      attempts to clarify DNS protocol where ambiguity exists.</t>

      <t>It is expected that implementors and anybody who is interested
      in protocol behavior will consult this document.</t>

      <t>Following the robustness principle ("Be conservative in
      what you do, be liberal in what you accept from others"), an
      implementation that follows the behavior in this document is
      expected to be compatible when talking with current
      implementations of DNS.</t>

      <t>As everything is described here, this document need not
      contain any normative references to older DNS RFCs and drafts, but
      for the sake of citation, the source of requirements (where
      applicable) is provided.</t>

      <t>This document does not attempt to describe aspects such as the
      history of DNS, operating system functions and API for DNS
      operations, DNS utilities, etc. It is meant to be a pedantic
      network protocol description only.</t>

      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
      NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
      "MAY", and "OPTIONAL" in this document are to be interpreted as
      described in BCP14 <xref target="RFC2119" /> <xref
      target="RFC8174" /> when, and only when, they appear in all
      capitals, as shown here.</t>
    </section>

    <section title="Introduction to DNS">
      <t>TBD.</t>
    </section>

    <section title="Data structure">
      <t>The domain name space is a tree data structure that maps DNS
      names to some resource data about that name. Each node and leaf in
      the tree corresponds to a key-value pair, where the key is a DNS
      name and the value is resource data (which may be empty). The tree
      is used to lookup resource data corresponding to a DNS name. The
      DNS makes no distinctions between the uses of the interior nodes
      and leaves, and this document uses the term "node" to refer to
      both.</t>

      <t>Each node stores a label, which MUST be 1 to 63 octets in
      length for all nodes except the root node for which the label MUST
      be empty.  Sibling nodes (sharing the same parent) MUST NOT have
      the same label, although the same label can be used for nodes
      which are not siblings.</t>

      <t>The DNS name of a node is the sequence of the labels on the
      path from the node to the root of the tree.</t>

      <t>A DNS name is printed as a concatenation left to right of the
      individual labels on the path from the node to the root, each
      label trailing with an ASCII period '.' character. Thus a complete
      printed DNS name ends with a period character. See (TBD: link to
      proper DNS name presentation formatting).</t>

      <t>In wire format, a DNS name is represented as a concatenation
      left to right of the individual labels on the path from the node
      to the root, where each label is represented starting with the
      label length as a single unsigned integer octet with values 0-63,
      and followed by the octets of the label itself. Thus, the
      following octets represent a DNS name "example.org." ("example"
      node followed by root node):</t>

      <figure>
        <artwork>
{ 0x07, 'e', 'x', 'a', 'm', 'p', 'l', 'e', 0x00 }
        </artwork>
      </figure>

      <t>The total number of octets that represent a DNS name in wire
      format (i.e., the sum of all label lengths and label octets) MUST
      NOT be larger than 255. This requirement, and the other
      requirement that a label be between 0 to 63 octets, limit the DNS
      names that may be represented in the domain name space.</t>

      <t>An example of a domain name space is given below:</t>

      <t>TBD: Add tree figure from RFC 1034 section 3.4 replacing names
      there with modern examples from current time; describe items in
      the tree</t>

      <t>The octets that make up a label may contain any 8-bit value. In
      DNS name comparisons, when the highest-order bit of an octet of a
      label is 0, the value of that octet for comparison purposes is
      assumed to be a 7-bit ASCII character and MUST be compared without
      character case-sensitivity (i.e., the corresponding operand of the
      octet comparison operator must be transformed to ASCII lowercase
      first and then compared). When the highest-order bit of an octet
      of a label is 1, it MUST be compared directly without any
      character case transformations.</t>

      <t>This means that tree operations are not case-sensitive, and a
      tree may contain a node with label "example", or a node with label
      "EXAMPLE", but not both as siblings (sharing the same parent). The
      node could be referred to either as "example", "EXAMPLE" or
      "ExAmPlE" as they all corespond to the same node.</t>

      <t>A node in the domain name space MUST preserve the character
      case of the octets of a label as they are entered into the tree,
      even though tree operations are not case-sensitive.</t>

      <t>A domain in the DNS is identified by a DNS name, and consists
      of that part of the domain name space that is at or below the DNS
      name which identifies it.</t>

      <t>A DNS name is a sub-domain of another DNS name if it is
      contained within the latter. This relationship can be tested by
      seeing if the sub-domain's DNS name ends with the containing DNS
      name.  For example, "sub.example.org." is a sub-domain of
      "example.org.".</t>
    </section>

    <section title="Service operation">
      <t>TBD.</t>
    </section>

    <section title="Wire protocol">
      <section title="DNS messages">
        <t>TBD.</t>
      </section>
    </section>

    <section title="Acknowledgements">
      <t>TBD.</t>
    </section>

  </middle>

  <back>

    <references title="Normative references">
      <?rfc include="reference.RFC.1033.xml"?>
      <?rfc include="reference.RFC.1034.xml"?>
      <?rfc include="reference.RFC.1035.xml"?>
      <?rfc include="reference.RFC.2119.xml"?>
      <?rfc include="reference.RFC.8174.xml"?>
    </references>

    <section title="ChangeLog">
      <t>
        <list style="symbols">

          <t>
          draft-muks-dnsop-dns-squash-00
          <vspace/>
          Initial draft.
          </t>

        </list>
      </t>
    </section>

  </back>
</rfc>
