<?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 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-suggest-refid-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 Suggest REFID">Network Time
    Protocol Suggest REFID Extension Field</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>NTP has been widely used through several revisions, with the latest
      being <xref target="RFC5905">RFC 5905</xref>.  A core component of the
      protocol and the algoritms is the Reference ID, or REFID, which is
      used to identify the source of time used for synchronization.
      Traditionally, when the source of time was another system the REFID
      was the IPv4 address of that other system.  The purpose of the REFID
      is to prevent a one-degree timing loop, where if A has several timing
      sources that include B, if B decides to get its time from A we don't
      want A then deciding to get its time from B.  The REFID is considered
      to be "public data" and is a vital core-component of the base NTP
      packet.  If a system's REFID is the IPv4 address of its system peer,
      an attacker can try to use that information to send spoofed time
      packets to either or both the target or the target's server,
      attempting to cause a disruption in time service.  This proposal is a
      backward-compatible way for a time source to tell its peers or clients
      "If you use me as your system peer, use this nonce as your REFID."
      This nonce SHOULD not be traceable to the original system, and if it
      is used as the REFID this type of attack is prevented.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>NTP has been widely used through several revisions, with the latest
      being <xref target="RFC5905">RFC 5905</xref>.  A core component of the
      protocol and the algoritms is the Reference ID, or REFID, which is
      used to identify the source of time used for synchronization.
      Traditionally, when the source of time was another system, the REFID
      was the IPv4 address of that other system.  If the remote system was
      using IPv6 for its connection, a 4 octet digest value of the IPv6
      address was used. The purpose of the REFID is to prevent a one-degree
      timing loop, where if A has several timing sources that include B, if
      B decides to get its time from A we don't want A then deciding to get
      its time from B. The REFID is considered to be "public data" and is a
      vital core-component of the base NTP packet.  If a system's REFID is
      the IPv4 address of its system peer, an attacker can try to use that
      information to send spoofed time packets to either or both the target
      or the target's server, attempting to cause a disruption in time
      service.  This proposal is a backward-compatible way for a time source
      to tell its peers or clients "If you use me as your system peer, use
      this nonce as your REFID."  This nonce, a Suggested REFID, SHOULD not
      be traceable to the sending system.  If the receiving system uses this
      Suggested REFID nonce instead of the IPv4 address as its REFID, this
      type of attack and information disclosure is prevented.</t>

      <t>The NTP protocol was designed with a mechanism that allowed for a
      depth-1 loop detection to avoid a simple "time loop".  Recently, this
      mechanism was discovered to be a potential vulnerability exploit.  The
      best way to mitigate this vulnerability is to decouple the IPv4
      address of the server from its REFID.  But there is no current way
      for a potential time source to tell the other party any other
      alternative to use as the REFID.  This proposal creates an extension
      field to accomplish this.</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="The REFID">
      <t>The core reason for the REFID in the NTP Protocol is to prevent a
      timing loop of degree 1.  Put another way, if servers A and B are
      exchanging time with each other and server B decides to follow A as
      its system peer, the REFID that B will use must be able to identify
      server A.  The interpretation of a REFID is based on the stratum, as
      documented in <xref target="RFC5905">RFC 5905</xref>, section 7.3,
      "Packet Header Variables".  At Stratum 2+, which will be the case if
      servers A and B are exchanging packets over IPv4, if server B follows
      A, then B will have A's IPv4 address as its REFID.  When A asks B for
      its time, A will see that B is synchronized to A because B will tell A
      that its REFID is A's IPv4 address, so when A sees its IP address as
      B's REFID, A knows that if it were to follow B for its time then there
      would be a timing loop.  In this case, A will not select B as a
      potential source of time.</t>
    </section>

    <section title="The Suggested REFID Extension Field">
      <t>Since there is no way in the base NTP packet for "this" instance of
      an NTP server to tell the "other" instance what REFID it should use if
      the "other" instance decides to use "this" instance as its system
      peer, the best available way to convey this information is via an
      extension field.</t>

      <t>If an incoming packet contains an unrecognized extension field,
      one of two things will happen.  Either that extension field will be
      ignored, or the entire packet will be dropped.  If an extension
      field is present there ordinarily SHOULD be a MAC following the
      extension field.  Some extension fields are unable to be "signed" by a
      MAC, regardless of whether or not that MAC is a traditional MAC or an
      extension field MAC.</t>

      <t>The following paragraph is included for informational purposes.
      Another proposal is on its way that addresses and clarifies extension
      fields, perhaps in the form of an errata to
      https://datatracker.ietf.org/doc/draft-ietf-ntp-extension-field .</t>

      <t>To assist in the validation of an NTP packet that contains
      extension fields, if the Field Type has the 0x2000 bit set in it,
      there MAY be a MAC after this extension field.  If the Field Type does
      not have the 0x2000 bit set in it, there SHOULD be a MAC after this
      extension field.</t>

      <t><figure title="NTP Extension Field: REFID Suggestion">
          <artwork name="NTP Extension Field: REFID Suggestion"><![CDATA[ 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+---------------+---------------+-------------------------------+ 
|          Field Type           |        Field Length           | 
+-------------------------------+-------------------------------+ 
|                        Suggested REFID                        | 
+---------------------------------------------------------------+]]></artwork>
        </figure></t>

      <t>Field Type: TBD (Recommendation for IANA: 0x0006 (Suggested REFID,
      MAC required), 0x2006 (Suggested REFID, MAC OPTIONAL))</t>
      <t>Field Length: 0x0008</t>
      <t>Suggested REFID: The 4 octets of the suggested REFID.
	This value SHOULD be 0xFDxxxxxx, where the bottom 3 octets SHOULD be
	random values.</t>
      <t>Examples: When decoded as an IPv4 address, suggested REFIDs would
	decode as 253.0.0.0 thru 253.255.255.255.</t>
    </section>

    <section title="Generating and Sending the Suggested REFID Extension Field">
      <t>A system that decides to send a Suggested REFID extension field
      SHOULD generate a new Suggested REFID for each new association.  It
      MAY generate a new Suggested REFID for any association in any
      response.  In addition to remembering the IP-based REFID, the sender
      should also remember the Suggested REFID.</t>

      <t>Since the core NTPv4 and earlier protocols do not contain any way
      to tell the recipient what to use as a REFID
      and <xref target="RFC5905">RFC 5905</xref> uses the IPv4 address of
      the sender as the REFID if the association is effected over an IPv4
      connection, this means that an attacker can simply send an NTP client
      request to a server knowing that server's system peer will be returned
      as the REFID in the response packet.  At this point, an attacker can,
      if that REFID is an IPv4 address, begin to launch attacks at the
      target forging the putative <!-- HMS: Not the best word --> IP of the
      target's time source, or the attacker can start forging packets to the
      putative time server claiming to be from the target, in an attempt to
      cause the time server to limit or deny time service to the target.</t>

      <t>Using a nonce for the REFID that is only recognized by the sending
      machine effectively prevents this type of attack.</t>

      <t>If servers S1, S2, and S3 are all exchanging time with each other,
      there is a 1 in 16,777,216 (2^24) chance that two different servers in
      the same group will happen to choose the same nonce, and that would
      produce a false-positive timing loop detection.  If the Suggested
      REFID is never changed, this false-positive condition will occur for
      potentially a long time.  This small risk can be reduced by
      periodically generating a new Suggested REFID.</t>
    </section>

    <section title="Receiving a Suggested REFID Extension Field">
      <t>An NTP server keeps track of the IP address it uses to talk to a
      client.  If an NTP server chooses to send a Suggested REFID to an
      association, it MUST remember this value.  When checking for a timing
      loop, the Suggested REFID must also be included in the list of tested
      values.</t>

      <t></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The author wishes to acknowledge the contributions of
      Martin Burnicki and Sam Weiler.</t>
    </section>

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

    <section anchor="IANA" title="IANA Considerations">
      <t>This memo requests IANA to allocate NTP Extension Field Types
      0x0006 (Suggested REFID, MAC required), 0x2006 (Suggested REFID, MAC
      OPTIONAL) for this purpose.</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;

      <?rfc include='reference.RFC.7384'?>
    </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>
