<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC5905 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5905.xml">
<!ENTITY RFC2827 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2827.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2434 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2434.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY I-D.narten-iana-considerations-rfc2434bis SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.narten-iana-considerations-rfc2434bis.xml">
]>
<?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"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- 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 category="std" docName="draft-stenn-ntp-ipv6-refid-hash-00" ipr="trust200902">
  <!-- category values: std, bcp, info, exp, and historic
     ipr values: full3667, noModification3667, noDerivatives3667
     you can add the attributes updates="NNNN" and obsoletes="NNNN" 
     they will automatically be output with "(if approved)" -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title abbrev="Network Time Protocol IPv6 REFID Hash">Network Time
    Protocol IPv6 REFID Hash</title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <!-- Another author who claims to be an editor -->

    <author fullname="Harlan Stenn" initials="H." surname="Stenn">
      <organization>Network Time Foundation</organization>

      <address>
        <postal>
          <street>P.O. Box 918</street>

          <!-- Reorder these if your country does things differently -->

          <city>Talent, OR</city>

          <region/>

          <code>97540</code>

          <country>US</country>
        </postal>

        <phone/>

        <email>stenn@nwtime.org</email>

        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>

<!-- other authors -->

    <date month="March" year="2016"/>

    <!-- If the month and year are both specified and are the current ones,
         xml2rfc will fill in the current day for you. If only the current
         year is specified, xml2rfc will fill in the current day and month
         for you. If the year is not the current one, it is necessary to
         specify at least a month (xml2rfc assumes day="1" if not specified
         for the purpose of calculating the expiry date).  With drafts it is
         normally sufficient to specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working
         Group", which is used by the RFC Editor as a nod to the history of
         the IETF. -->

    <keyword>NTP</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t><xref target="RFC5905">RFC 5905</xref>, section 7.3, "Packet Header
      Variables", defines the value to be used as the REFID for network
      associations.  For IPv4 associations the IPv4 address is used, and for
      IPv6 associations four octets of the MD5 hash of the IPv6 are used.
      Often, the REFID is simplistically and incorrectly used to identify
      upstream servers.  While this works in an IPv4 network, it doesn't
      work for IPv6 associations and may have other problems in an
      environment with mixed use of IPv4 and IPv6.  Specifically, the NTP
      Project has received a report where the generated IPv6 hash decoded to
      the IPv4 address of a different machine on the system peer's
      network.</t>
      <t>This proposal offers a way for a system to generate a REFID for a
      system peer that communicates over IPv6 that does not conflict with a
      valid IPv4-based REFID.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC5905">RFC 5905</xref>, section 7.3, "Packet Header
      Variables", defines the value to be used as the REFID for network
      associations.  It says: <list><t>If using the IPv4 address family, the
      identifier is the four-octet IPv4 address.  If using the IPv6 family,
      it is the first four octets of the MD5 hash of the IPv6
      address. ...</t></list> Often, the REFID is simplistically and
      incorrectly used to identify upstream servers.  While this works in an
      IPv4 network, it doesn't work for IPv6 associations and may have other
      problems in an environment with mixed use of IPv4 and IPv6.
      Specifically, the NTP Project has received a report where the
      generated IPv6 hash decoded to the IPv4 address of a different machine
      on the system peer's network.</t>
      <t>This proposal offers a way for a system to generate a REFID for a
      system peer that communicates over IPv6 that does not conflict with a
      valid IPv4-based REFID.</t>

      <section title="Requirements Language">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
        document are to be interpreted as described in <xref
        target="RFC2119">RFC 2119</xref>.</t>
      </section>
    </section>

    <section title="Augmenting the IPv6 REFID Hash">
      <t>When generating a REFID based on a network system peer, the NTPv4
      specification says:</t>

        <t><list><t>If using the IPv4 address family, the identifier is the
      four-octet IPv4 address.  If using the IPv6 family, it is the first
      four octets of the MD5 hash of the IPv6 address. ...</t></list></t>

      <t>This means that the IPv4 representation of the IPv6 hash would be:
      b1.b2.b3.b4 .  The proposal is that the system MAY also use
      255.b2.b3.b4 as its REFID.</t>

      <t>When using the REFID to check for a timing loop for an IPv6
      association, if the code that checks the first four-octets of the hash
      fails to match then the code must check again, using 0xFF as the
      first octet of the hash.</t>
    </section>

    <section title="Potential Problems">
      <t>There is a 1 in 16,777,216 chance that the REFID hashes of two IPv6
       addresses will be identical, producing a false-positive loop
       detection.  With a sufficient number of servers, the risk of this
       problem becomes a non-issue.  The use of the "REFID Suggestion"
       extension field is also a way to mitigate this potential
       situation.</t>

      <t>Unrealistically, if only two instances of NTP are communicating via
      IPv6 and one side implements this new IPv4 REFID hash and the other
      side does not, the "other side" will not be able to detect this loop
      condition.  In this case, the two machines will slowly increase their
      Stratum until they reach S16 and become unsynchronized.  This
      situation is considered to be unrealistic because the only current way
      this could happen would be for there to only be these two instances of
      NTP available as time sources in a misconfigured "orphan mode" setup.
      There is no risk of this happening in an NTP network with 3 or more
      time sources, or in a properly-configured "time island" setup.</t>
    </section>

    <section title="Questions">
      <t>Should we ask IANA to allocate a pseudo Extension Field Type of
      0xFFFF (for example) so the proposed "I-Do" exchange can report
      whether or not the "IPv6 REFID Hash" is supported?</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The author wishes to acknowledge Dan Mahoney (and perhaps others)
      for suggesting the idea of using an "impossible" first-octet value to
      indicate an IPv6 refid hash.  The author wishes to acknowledge the
      contributions of Joey Saccadonuts.</t>
    </section>

    <!-- Possibly a 'Contributors' section ... -->

    <section anchor="IANA" title="IANA Considerations">
      <t>This memo makes no requests of IANA.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Additional information TBD</t>
    </section>
  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->

      &RFC2119;

      <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.5905.xml"?-->

      &RFC5905;

    </references>

    <!-- Here we use entities that we defined at the beginning. -->

    <!-- SW: Except that we're not really using these...

    <references title="Informative References">
      &RFC3552;

      &I-D.narten-iana-considerations-rfc2434bis;
 
    </references> 
     -->

    <!--
    <section anchor="app-additional" title="Additional Stuff">
      <t>This becomes an Appendix.</t>
    </section>
-->

    <!-- Change Log

v00 2016-03-NN  HMS Initial Submission   
                                                                                        -->
  </back>
</rfc>
