<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-ntp-network-time-security-03.txt"
     ipr="trust200902" submissionType="IETF">
  <front>
    <title abbrev="NTS">Network Time Security</title>

    <author fullname="Dieter Sibold" initials="D." surname="Sibold">
      <organization abbrev="PTB">Physikalisch-Technische
      Bundesanstalt</organization>

      <address>
        <postal>
          <street>Bundesallee 100</street>

          <city>Braunschweig</city>

          <code>D-38116</code>

          <region/>

          <country>Germany</country>
        </postal>

        <phone>+49-(0)531-592-8420</phone>

        <facsimile>+49-531-592-698420</facsimile>

        <email>dieter.sibold@ptb.de</email>
      </address>
    </author>

    <author fullname="Stephen R&ouml;ttger" initials="S."
            surname="R&ouml;ttger">
      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>stephen.roettger@googlemail.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Kristof Teichel" initials="K." surname="Teichel">
      <organization abbrev="PTB">Physikalisch-Technische
      Bundesanstalt</organization>

      <address>
        <postal>
          <street>Bundesallee 100</street>

          <city>Braunschweig</city>

          <region/>

          <code>D-38116</code>

          <country>Germany</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>kristof.teichel@ptb.de</email>

        <uri/>
      </address>
    </author>

    <date day="19" month="March" year="2014"/>

    <area>Internet Area</area>

    <workgroup>NTP Working Group</workgroup>

    <keyword>Integrity</keyword>

    <keyword>Authentication</keyword>

    <keyword>NTP</keyword>

    <keyword>PTP</keyword>

    <keyword>Security</keyword>

    <abstract>
      <t>This document describes the Network Time Security (NTS) protocol that
      enables secure authentication of time servers using Network Time
      Protocol (NTP) or Precision Time Protocol (PTP). Its design considers
      the special requirements of precise timekeeping, which are described in
      Security Requirements of Time Protocols in Packet Switched Networks
      <xref target="I-D.ietf-tictoc-security-requirements"/>.</t>
    </abstract>

    <note 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>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Time synchronization protocols are utilized more and more to
      synchronize clocks in networked infrastructures. The reliable
      performance of such infrastructures can be degraded seriously by
      successful attacks against the time synchronization protocol. Therefore,
      time synchronization protocols applied in critical infrastructures have
      to provide security measures to defeat possible adversaries.
      Consequently, the widespread Network Time Protocol (NTP) <xref
      target="RFC5905"/> was supplemented by the autokey protocol <xref
      target="RFC5906"/> which shall ensure authenticity of the NTP server and
      integrity of the protocol packets. Unfortunately, the autokey protocol
      exhibits various severe security vulnerabilities as revealed in a
      thorough analysis of the protocol <xref target="R&ouml;ttger"/>. For the
      Precision Time Protocol (PTP), Annex K of the standard document <xref
      target="IEEE1588">IEEE 1588</xref> defines an informative security
      protocol that is still in experimental state.</t>

      <t>Because of autokey's security vulnerabilities and the absence of a
      standardized security protocol for PTP, these protocols cannot be
      applied in environments in which compliance requirements demand
      authenticity and integrity protection. This document specifies a
      security protocol which ensures authenticity of the time server via a
      Public Key Infrastructure (PKI) and integrity of the time
      synchronization protocol packets and which therefore enables the usage
      of NTP and PTP in such environments.</t>

      <t>The protocol is specified with the prerequisite in mind that precise
      timekeeping can only be accomplished with stateless time synchronization
      communication, which excludes the utilization of standard security
      protocols like IPsec or TLS for time synchronization messages. This
      prerequisite corresponds with the requirement that a security mechanism
      for timekeeping must be designed in such a way that it does not degrade
      the quality of the time transfer <xref
      target="I-D.ietf-tictoc-security-requirements"/>.</t>

      <t>Note:<list style="hanging">
          <t>The intent is to formulate the protocol to be applicable to NTP
          as well as PTP. In the current state the draft focuses on the
          application to NTP.</t>
        </list></t>
    </section>

    <section title="Security Threats">
      <t>A profound analysis of security threats and requirements for NTP and
      PTP can be found in the I-D <xref
      target="I-D.ietf-tictoc-security-requirements"/>.</t>
    </section>

    <section title="Objectives">
      <t>The objectives of the NTS specifications are as follows:<list
          style="symbols">
          <t>Authenticity: NTS enables the client to authenticate its time
          server.</t>

          <t>Integrity: NTS protects the integrity of time synchronization
          protocol packets via a message authentication code (MAC).</t>

          <t>Confidentiality: NTS does not provide confidentiality protection
          of the time synchronization packets.</t>

          <t>Modes of operation: All operational modes of NTP are
          supported.</t>

          <t>Operational modes of PTP should be supported as far as
          possible.</t>

          <t>Hybrid mode: Both secure and insecure communication modes are
          possible for NTP servers and clients, respectively.</t>

          <t>Compatibility:<list style="symbols">
              <t>Unsecured NTP associations shall not be affected.</t>

              <t>An NTP server that does not support NTS shall not be affected
              by NTS authentication requests.</t>
            </list></t>
        </list></t>
    </section>

    <section title="Terms and Abbreviations">
      <t><list style="symbols">
          <t>TESLA: Timed Efficient Stream Loss-Tolerant Authentication</t>
        </list></t>
    </section>

    <section title="NTS Overview">
      <section anchor="overview" title="Symmetric and Client/Server Mode">
        <t>Authenticity of the time server is verified once by utilization of
        X.509 certificates. Authenticity and integrity of the NTP packets are
        then ensured by a Message Authentication Code (MAC), which is attached
        to the NTP packet. The calculation of the MAC includes the whole NTP
        packet and the cookie which is shared between client and server. It is
        calculated according to:<list style="hanging">
            <t>cookie = MSB_128 (HMAC(server seed, H(public key of
            client))),</t>
          </list>with the server seed as key, where H is a hash function, and
        where the function MSB_128 cuts off the 128 most significant bits of
        the result of the HMAC function. The server seed is a 128 bit random
        value of the server, which has to be kept secret. The cookie never
        changes as long as the server seed stays the same, but the server seed
        has to be refreshed periodically in order to provide key freshness as
        required in <xref target="I-D.ietf-tictoc-security-requirements"/>.
        See <xref target="serverseedconsiderations"/> for details on the seed
        refresh and <xref target="clientinunicast"/> for the client's reaction
        to it.</t>

        <t>The server does not keep a state of the client. Therefore it has to
        recalculate the cookie each time it receives a request from the
        client. To this end, the client has to attach the hash value of its
        public key to each request (see <xref target="timerequest"/>).</t>
      </section>

      <section title="Broadcast Mode">
        <t>Just as in the case of the client server mode and symmetric mode,
        authenticity and integrity of the NTP packets are ensured by a MAC,
        which is attached to the NTP packet by the sender. The verification of
        the authenticity is based on the TESLA protocol, in particular on its
        "Not Re-using Keys" scheme, see section 3.7.2 of <xref
        target="RFC4082"/>. TESLA is based on a one-way chain of keys, where
        each key is the output of a one-way function applied on the previous
        key in the chain. The last element of the chain is shared securely
        with all clients. The server splits time into intervals of uniform
        duration and assigns each key to an interval in reverse order,
        starting with the penultimate. At each time interval, the server sends
        an NTP broadcast packet appended by a MAC, calculated using the
        corresponding key, and the key of the previous disclosure interval.
        The client verifies the MAC by buffering the packet until the
        disclosure of the key in its associated disclosure interval. In order
        to be able to verify the validity of the key, the client has to be
        loosely time synchronized to the server. This has to be accomplished
        during the initial client server exchange between broadcast client and
        server. For a more detailed description of the TESLA protocol see
        <xref target="appBroadcast"/>.</t>
      </section>
    </section>

    <section anchor="protsec" title="Protocol Messages">
      <t>Note that this section currently describes realization of the message
      format of NTS only for its utilization for NTP, in which the NTS
      specific data are enclosed in extension fields on top of NTP packets. A
      specification of NTS messages for PTP would have to be developed
      accordingly.</t>

      <t>The steps described in <xref target="assoc"/> - <xref
      target="timerequest"/> belong to the unicast mode, while <xref
      target="broadparam"/> and <xref target="broadmessage"/> explain the
      steps involved in the broadcast mode of NTS.</t>

      <section anchor="assoc" title="Association Messages">
        <t>In this step, the hash and signature algorithms that are used for
        the rest of the protocol are negotiated.</t>

        <section anchor="client_assoc"
                 title="Message type: &quot;client_assoc&quot;">
          <t>The protocol sequence starts with the client sending an
          association message, called client_assoc. This message contains
          <list style="symbols">
              <t>the version number of NTS that the client wants to use (this
              SHOULD be the highest version number that it supports),</t>

              <t>the hostname of the client,</t>

              <t>a selection of hash algorithms, and</t>

              <t>a selection of accepted algorithms for the signatures.</t>
            </list>For NTP, this message is realized as a packet with an
          extension field of type "association", which contains all this
          data.</t>
        </section>

        <section anchor="server_assoc"
                 title="Message type: &quot;server_assoc&quot;">
          <t>This message is sent by the server upon receipt of client_assoc.
          It contains <list style="symbols">
              <t>the version number used for the rest of the protocol (which
              SHOULD be determined as the minimum over the client's suggestion
              in the client_assoc and the highest supported by the
              server),</t>

              <t>the hostname of the server, and</t>

              <t>the server's choice of algorithm for the signatures and
              cryptographic hash algorithm, both of which MUST be chosen from
              the client's proposals.</t>
            </list>In the case of NTP, the data is enclosed in a packet's
          extension field, also of type "association".</t>
        </section>
      </section>

      <section anchor="cert" title="Certificate Messages">
        <t>In this step, the client receives the certification chain up to a
        trusted anchor. With the established certification chain the client is
        able to verify the server signatures and, hence, the authenticity of
        the server messages with extension fields is ensured.</t>

        <t>Discussion:<list style="hanging">
            <t>Note that in this step the client validates the authenticity of
            its immediate NTP server only. It does not recursively validate
            the authenticity of each NTP server on the time synchronization
            chain. Recursive authentication (and authorization) as formulated
            in <xref target="I-D.ietf-tictoc-security-requirements"/> depends
            on the chosen trust anchor.</t>
          </list></t>

        <section anchor="client_cert"
                 title="Message type: &quot;client_cert&quot;">
          <t>This message is sent by the client, after it successfully
          verified the content of the received server_assoc message (see <xref
          target="clientinunicast"/>). It contains<list style="symbols">
              <t>the negotiated version number,</t>

              <t>the client's hostname, and</t>

              <t>the signature algorithm negotiated during the association
              messages.</t>
            </list>It is realized as an NTP packet with extension field of
          type "certificate request" for the necessary data.</t>
        </section>

        <section anchor="server_cert"
                 title="Message type: &quot;server_cert&quot;">
          <t>This message is sent by the server, upon receipt of a client_cert
          message, if the version number and choice of methods communicated in
          that message are actually supported by the server. It contains<list
              style="symbols">
              <t>all the information necessary to authenticate the server to
              the client. This is a chain of certificates, which starts at the
              server and goes up to a trusted authority, where each
              certificate MUST be certified by the one directly following
              it.</t>
            </list>This message is realized for NTP as a packet with extension
          field of type "certificate" which holds the certification data.</t>
        </section>
      </section>

      <section anchor="cookiemessage" title="Cookie Messages">
        <t>During this step, the server transmits a secret cookie to the
        client securely. The cookie will be used for integrity protection
        during unicast time synchronization.</t>

        <section anchor="client_cook"
                 title="Message type: &quot;client_cook&quot;">
          <t>This message is sent by the client, upon successful
          authentication of the server. In this message, the client requests a
          cookie from the server. It contains <list style="symbols">
              <t>the negotiated version number,</t>

              <t>the hash algorithm H negotiated between client and server
              during the association messages,</t>

              <t>the client's public key.</t>
            </list>For NTP, an extension field of type "cookie request" holds
          the listed data.</t>
        </section>

        <section anchor="server_cook"
                 title="Message type: &quot;server_cook&quot;">
          <t>This message is sent by the server, upon receipt of a client_cook
          message. The hash of the client's public key, as included in
          client_cook, is used by the server to calculate the cookie (see
          <xref target="overview"/>). This message contains <list
              style="symbols">
              <t>a concatenated pair, encrypted with the client's public key,
              where the pair consists of<list style="symbols">
                  <t>the cookie, and</t>

                  <t>a signature of the cookie signed with the server's
                  private key.</t>
                </list></t>
            </list>In the case of NTP, this is a packet with an extension
          field of type "cookie transmit".</t>
        </section>
      </section>

      <section anchor="timerequest"
               title="Unicast Time Synchronisation Messages">
        <t>In this step, the usual time synchronization process is executed,
        with the addition of integrity protection for all messages that the
        server sends. This step can be repeated as often as the client desires
        and as long as the integrity of the server's time responses is
        verified successfully. Secure time synchronization by repetition of
        this step is the goal of a unicast run.</t>

        <section anchor="time_request"
                 title="Message type: &quot;time_request&quot;">
          <t>This message is sent by the client when it requests time
          exchange. To send this message, the client MUST have received
          server_cook and successfully verified the cookie via the server's
          signature. It contains<list style="symbols">
              <t>the negotiated version number,</t>

              <t>the time synchronization data that the client wants to
              transmit,</t>

              <t>a 128-bit nonce,</t>

              <t>the negotiated hash algorithm H,</t>

              <t>the hash of the client's public key under H.</t>
            </list>It is realized as an NTP packet with the time
          synchronization data and an additional extension field of type "time
          request" for the rest of the information.</t>
        </section>

        <section anchor="time_response"
                 title="Message type: &quot;time_response&quot;">
          <t>This message is sent by the server, after it received a
          time_request message. The server uses the hash of the client's
          public key and the transmitted hash algorithm to recalculate the
          cookie for the client. This message contains<list style="symbols">
              <t>the server's time synchronization response data,</t>

              <t>the nonce transmitted in time_request,</t>

              <t>a MAC (generated with the cookie as key) for verification of
              the above.</t>
            </list>It is realized as an NTP packet with the necessary time
          synchronization data and with a new extension field of type "time
          response". This packet has an appended MAC that is generated over
          the time synchronization data and the extension field, with the
          cookie as the key.</t>
        </section>
      </section>

      <section anchor="broadparam" title="Broadcast Parameter Messages">
        <t>In this step, the client receives the necessary information to
        execute the TESLA protocol in a secured broadcast association. The
        client can only initiate a secure broadcast association after a
        successful unicast run, see <xref target="clientinbroadcast"/>.</t>

        <t>See Appendix <xref format="counter" target="appBroadcast"/> for
        more details on TESLA.</t>

        <section anchor="client_bpar"
                 title="Message type: &quot;client_bpar&quot;">
          <t>This message is sent by the client in order to establish a
          secured time broadcast association with the server. It contains<list
              style="symbols">
              <t>the version number negotiated during association in unicast
              mode,</t>

              <t>the client's hostname, and</t>

              <t>the signature algorithm negotiated during unicast.</t>
            </list>For NTP, this message is realized as a packet with an
          extension field of type "broadcast request".</t>
        </section>

        <section anchor="server_bpar"
                 title="Message type: &quot;server_bpar&quot;">
          <t>This message is sent by the server upon receipt of a client_bpar
          message during the broadcast loop of the server. It contains<list
              style="symbols">
              <t>the one-way function used for building the one-way key
              chain,</t>

              <t>the last key of the one-way key chain, and</t>

              <t>the disclosure schedule of the keys. This contains:<list
                  style="symbols">
                  <t>time interval duration,</t>

                  <t>the disclosure delay (number of intervals between use and
                  disclosure of a key),</t>

                  <t>the time at which the next time interval will start,
                  and</t>

                  <t>the next interval's associated index.</t>
                </list></t>

              <t>The message also contains a signature signed by the server
              with its private key, verifying all the data listed above.</t>
            </list>It is realized for NTP as a packet with an extension field
          of type "broadcast parameters", which contains all the given
          data.</t>
        </section>
      </section>

      <section anchor="broadmessage" title="Broadcast Message">
        <t>In this step, the server keeps sending broadcast time
        synchronization messages to all participating clients.</t>

        <section anchor="server_broad"
                 title="Message type: &quot;server_broad&quot;">
          <t>This message is sent by the server over the course of its
          broadcast schedule. It is part of any broadcast association. It
          contains<list style="symbols">
              <t>time broadcast data,</t>

              <t>the index that belongs to the current interval (and therefore
              identifies the current, yet undisclosed key)</t>

              <t>the disclosed key of the previous disclosure interval
              (current time interval minus disclosure delay).</t>

              <t>a MAC, calculated with the key for the current time interval,
              verifying the time data</t>
            </list>The message is realized as an NTP broadcast packet with the
          time broadcast data and with an extension field of type "broadcast
          message", which contains the rest of the listed data. The NTP packet
          is then appended by a MAC verifying the time data, but not the
          extension field.</t>
        </section>
      </section>
    </section>

    <section title="Protocol Sequence">
      <section title="The client">
        <section anchor="clientinunicast" title="The client in unicast mode">
          <t>For a unicast run, the client performs the following steps: <list
              style="numbers">
              <t>It sends a client_assoc message to the server.</t>

              <t>It waits for a reply in the form of a server_assoc message.
              After receipt of the message it performs the following checks:
              <list style="symbols">
                  <t>The message MUST contain a conform version number.</t>

                  <t>The client has to verify that the server has chosen the
                  signature and hash algorithms from its proposal sent in the
                  client_assoc message.</t>
                </list>If one of the checks fails, the client MUST abort the
              run.</t>

              <t>The client then sends a client_cert message to the
              server.</t>

              <t>It awaits a reply in the form of a server_cert message and
              performs an authenticity check. If this check fails, the client
              MUST abort the run.</t>

              <t>Next, it sends a client_cook message to the server.</t>

              <t>It awaits a reply in the form of a server_cook message; upon
              receipt it executes the following actions: <list style="symbols">
                  <t>It decrypts the message with its own private key.</t>

                  <t>It checks that the decrypted message has the format of a
                  128 bit Cookie concatenated with its own signature value,
                  verifiable with the server's public key.</t>
                </list>If the check fails, the client MAY abort the run.</t>

              <t>The client sends a time_request message to the server.</t>

              <t>It awaits a reply in the form of a time_response message.
              Upon receipt, it checks: <list style="symbols">
                  <t>that the transmitted nonce belongs to the previous
                  time_request message and .</t>

                  <t>that the appended MAC verifies the time data and the
                  transmitted nonce.</t>
                </list>If the nonce is invalid, the client MUST ignore this
              time_response message. If the MAC is invalid, the client MUST do
              one of the following: abort the run or go back to step 5
              (because the cookie might have changed due to a server seed
              refresh). If both checks are successful, the client SHOULD
              continue time synchronization by going back to step 7.</t>
            </list>The client's behaviour in unicast mode is also expressed in
          <xref target="fig_flow_unicast"/>.</t>
        </section>

        <section anchor="clientinbroadcast"
                 title="The client in broadcast mode">
          <t>To establish a secure broadcast association with a broadcast
          server, the client MUST initially authenticate the broadcast server
          and securely synchronize its time to it up to an upper bound for its
          time offset in unicast mode. After that, the client performs the
          following steps: <list style="numbers">
              <t>It sends a client_bpar message to the server.</t>

              <t>It waits for a reply in the form of a server_bpar message
              after which it performs the following checks: <list
                  style="symbols">
                  <t>The message must contain all the necessary information
                  for the TESLA protocol, as listed in <xref
                  target="server_bpar"/>.</t>

                  <t>Verification of the message's signature.</t>
                </list>If any information is missing or cannot be verified as
              signed by the server, the client MUST abort the broadcast
              run.</t>

              <t>The client awaits time synchronization data in the form of a
              server_broadcast message. Upon receipt, it performs the
              following checks: <list style="numbers">
                  <t>Proof that the MAC is based on a key that is not yet
                  disclosed. This is achieved via a disclosure schedule, so
                  this is where loose time synchronization is required. If
                  verified the packet will be buffered for later
                  authentication. Otherwise, the client MUST discard it. Note
                  that the time information included in the packet will not be
                  used for synchronization until its authenticity could be
                  verified.</t>

                  <t>The client checks whether it already knows the disclosed
                  key. If so, the client SHOULD discard the packet to avoid a
                  buffer overrun. If not, the client verifies that the
                  disclosed key belongs to the one-way key chain by applying
                  the one-way function until equality with a previous
                  disclosed key is verified. If falsified, the client MUST
                  discard the packet.</t>

                  <t>If the disclosed key is legitimate the client verifies
                  the authenticity of any packet that it received during the
                  corresponding time interval. If authenticity of a packet is
                  verified it is released from the buffer and the packet's
                  time information can be utilized. If the verification fails
                  authenticity is no longer given. In this case the client
                  MUST request authentic time from the server by means of a
                  unicast time request message.</t>
                </list>See RFC 4082<xref target="RFC4082"/> for a detailed
              description of the packet verification process.</t>
            </list>The client's behaviour in broadcast mode can also be seen
          in <xref target="fig_flow_broadcast"/>.</t>
        </section>
      </section>

      <section title="The server">
        <t>The server's behaviour is not as easy to express in sequential
        terms as the client's, not even for a single association with one
        client. This is because the server does not keep state of any
        connection.</t>

        <section title="The server in unicast mode">
          <t>A broadcast server MUST also support unicast mode, in order to
          provide the initial time synchronization is a precondition for any
          broadcast association. To support unicast mode, the server MUST be
          ready to perform the following actions: <list style="symbols">
              <t>Upon receipt of a client_assoc message, the server constructs
              and sends a reply in the form of a server_assoc message as
              described in <xref target="server_assoc"/>.</t>

              <t>Upon receipt of a client_cert message, the server checks
              whether it supports the given signature algorithm. If so, it
              constructs and sends a server_cert message as described in <xref
              target="server_cert"/>.</t>

              <t>Upon receipt of a client_cook message, the server calculates
              the cookie according to the formula given in <xref
              target="overview"/>. With this, it constructs a server_cook
              message as described in <xref target="server_cook"/>.</t>

              <t>Upon receipt of a time_request message, the server
              re-calculates the cookie, then computes the necessary time
              synchronization data and constructs a time_response message as
              given in <xref target="time_response"/>.</t>
            </list>Also, it must adhere to the rule of server seed refreshing,
          as given in <eref target="I-D.ietf-tictoc-security-requirements"/>.
          More information on that can be found in <xref
          target="restartPS"/>.</t>
        </section>

        <section title="The server in broadcast mode">
          <t>To support NTS broadcast, the server MUST be ready to perform the
          following actions: <list style="symbols">
              <t>Upon receipt of a client_bpar message, the server constructs
              and sends a server_bpar message as described in <xref
              target="server_bpar"/>.</t>

              <t>The server follows the TESLA protocol in all other aspects,
              by regularly sending server_broad messages as described in <xref
              target="server_broad"/>, adhering to its own disclosure
              schedule.</t>
            </list>It is also the server's responsibility to watch for the
          expiration date of the one-way key chain and generate a new key
          chain accordingly.</t>
        </section>
      </section>

      <section anchor="restartPS" title="Server Seed Refresh">
        <t>According to the requirements in <xref
        target="I-D.ietf-tictoc-security-requirements"/> the server has to
        refresh its server seed periodically. As a consequence the cookie used
        in the time request messages becomes invalid. In this case the client
        cannot verify the attached MAC and has to respond accordingly by
        re-initiating the protocol with a cookie request (<xref
        target="cookiemessage"/>). This is true for the unicast and broadcast
        mode, respectively.</t>

        <t>Additionally, in broadcast mode the client has to restart the
        broadcast sequence with a time request message if the one-way key
        chain expires.</t>

        <t>During certificate message exchange the client reads the expiration
        date of the period of validity of the server certificate. The client
        MAY restart the protocol sequence with the association message before
        the server certificate expires.</t>
      </section>
    </section>

    <section title="Hash Algorithms and MAC Generation">
      <section anchor="hash" title="Hash Algorithms">
        <t>Hash algorithms are used at different points: calculation of the
        cookie and the MAC, and hashing of the public key. Client and server
        negotiate a hash algorithm H during the association message exchange
        (<xref target="assoc"/>) at the beginning of a unicast run. The
        selected algorithm H is used for all hashing processes in that
        run.</t>

        <t>In broadcast mode, hash algorithms are used as pseudo random
        functions to construct the one-way key chain. Here, the utilized hash
        algorithm is communicated by the server and non-negotiable.</t>

        <t>The list of the hash algorithms supported by the server has to
        fulfill the following requirements:</t>

        <t><list style="symbols">
            <t>it MUST NOT include MD5 or weaker algorithms,</t>

            <t>it MUST include SHA-256 or stronger algorithms.</t>
          </list></t>
      </section>

      <section title="MAC Calculation">
        <t>For the calculation of the MAC client and server are using a
        Keyed-Hash Message Authentication Code (HMAC) approach <xref
        target="RFC2104"/>. The HMAC is generated with the hash algorithm
        specified by the client (see <xref target="hash"/>).</t>
      </section>
    </section>

    <section anchor="serverseedconsiderations"
             title="Server Seed Considerations">
      <t>The server has to calculate a random seed which has to be kept secret
      and which MUST be changed periodically. The server MUST generate a seed
      for each supported hash algorithm.</t>

      <section title="Server Seed Algorithm">
        <t/>
      </section>

      <section title="Server Seed Live Time">
        <t/>
      </section>
    </section>

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

      <t>Note to RFC Editor: this section may be removed on publication as an
      RFC.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <section title="Initial Verification of the Server Certificates">
        <t>The client has to verify the validity of the certificates during
        the certification message exchange (<xref target="cert"/>). Since it
        generally has no reliable time during this initial communication
        phase, it is impossible to verify the period of validity of the
        certificates. Therefore, the client MUST use one of the following
        approaches:</t>

        <t><list style="symbols">
            <t>The validity of the certificates is preconditioned. Usually
            this will be the case in corporate networks.</t>

            <t>The client ensures that the certificates are not revoked. To
            this end, the client uses the Online Certificate Status Protocol
            (OCSP) defined in <xref target="RFC6277"/>.</t>

            <t>The client requests a different service to get an initial time
            stamp in order to be able to verify the certificates' periods of
            validity. To this end, it can, e.g., use a secure shell connection
            to a reliable host. Another alternative is to request a time stamp
            from a Time Stamping Authority (TSA) by means of the Time-Stamp
            Protocol (TSP) defined in <xref target="RFC3161"/>.</t>
          </list></t>
      </section>

      <section title="Revocation of Server Certificates">
        <t>According to <xref target="restartPS"/>, it is the client's
        responsibility to initiate a new association with the server after the
        server's certificate expires. To this end the client reads the
        expiration date of the certificate during the certificate message
        exchange (<xref target="cert"/>). Besides, certificates may also be
        revoked prior to the normal expiration date. To increase security the
        client MAY verify the state of the server's certificate via OCSP
        periodically.</t>
      </section>

      <section title="Usage of NTP Pools">
        <t>The certification based authentication scheme described in <xref
        target="protsec"/> is not applicable to the concept of NTP pools.
        Therefore, NTS is not able to provide secure usage of NTP pools.</t>
      </section>

      <section anchor="secBroadcast"
               title="Denial-of-Service in Broadcast Mode">
        <t>TESLA authentication buffers packets for delayed authentication.
        This makes the protocol vulnerable to flooding attacks, causing the
        client to buffer excessive numbers of packets. To add stronger DoS
        protection to the protocol client and server SHALL use the "Not
        Re-using Keys" scheme of TESLA as pointed out in section 3.7.2 of
        <xref target="RFC4082">RFC 4082</xref>. In this scheme the server
        never uses a key for the MAC generation more than once. Therefore the
        client can discard any packet that contains a disclosed key it knows
        already, thus preventing memory flooding attacks.</t>

        <t>Note, an alternative approach to enhance TESLA's resistance against
        DoS attacks involves the addition of a group MAC to each packet. This
        requires the exchange of an additional shared key common to the whole
        group. This adds additional complexity to the protocol and hence is
        currently not considered in this document.</t>
      </section>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank David Mills and Kurt Roeckx for
      discussions and comments on the design of NTS. Also, thanks to Harlan
      Stenn for his technical review and specific text contributions to this
      document.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.6277'?>

      <reference anchor="IEEE1588">
        <front>
          <title>IEEE standard for a precision clock synchronization protocol
          for networked measurement and control systems</title>

          <author fullname="IEEE Instrumentation and Measurement Society TC-9 Sensor Technology">
            <organization>IEEE Instrumentation and Measurement Society. TC-9
            Sensor Technology</organization>
          </author>

          <date year="2008"/>
        </front>
      </reference>

      <?rfc include='reference.RFC.3161'?>

      <?rfc include='reference.RFC.5905'?>

      <?rfc include='reference.RFC.4082'?>

      <?rfc include='reference.RFC.2104'?>

      <?rfc include='reference.RFC.5906'?>
    </references>

    <references title="Informative References">
      <reference anchor="R&ouml;ttger">
        <front>
          <title>Analysis of the NTP Autokey Procedures</title>

          <author fullname="Stephen R&ouml;ttger" initials="S"
                  surname="R&ouml;ttger">
            <organization/>
          </author>

          <date day="8" month="February" year="2012"/>
        </front>
      </reference>

      <?rfc include='reference.I-D.draft-ietf-tictoc-security-requirements-05'?>
    </references>

    <section title="Flow Diagrams of Client Behaviour">
      <t/>

      <figure anchor="fig_flow_unicast"
              title="The client's behaviour in NTS unicast mode.">
        <artwork><![CDATA[                     +---------------------+
                     |Association Messages |
                     +----------+----------+
                                |
                                v
                     +---------------------+
                     |Certificate Messages |
                     +----------+----------+
                                |
+------------------------------>o
|                               |
|                               v
|                       +---------------+
|                       |Cookie Messages|
|                       +-------+-------+
|                               |
|                               o<------------------------------+
|                               |                               |
|                               v                               |
|                     +-------------------+                     |
|                     |Time Sync. Messages|                     |
|                     +---------+---------+                     |
|                               |                               |
|                               v                               |
|                            +-----+                            |
|                            |Check|                            |
|                            +--+--+                            |
|                               |                               |
|            /------------------+------------------\            |
|           v                   v                   v           |
|     .-----------.      .-------------.        .-------.       |
|    ( MAC Failure )    ( Nonce Failure )      ( Success )      |
|     '-----+-----'      '------+------'        '---+---'       |
|           |                   |                   |           |
|           v                   v                   v           |
|    +-------------+     +-------------+     +--------------+   |
|    |Discard Data |     |Discard Data |     |Sync. Process |   |
|    +-------------+     +------+------+     +------+-------+   |
|           |                   |                   |           |
|           |                   |                   v           |
+-----------+                   +------------------>o-----------+]]></artwork>
      </figure>

      <figure anchor="fig_flow_broadcast"
              title="The client's behaviour in NTS broadcast mode.">
        <artwork><![CDATA[                         +-----------------------------+
                         |Broadcast Parameter Messages |
                         +--------------+--------------+
                                        |
                                        o<--------------------------+
                                        |                           |
                                        v                           |
                         +-----------------------------+            |
                         |Broadcast Time Sync. Message |            |
                         +--------------+--------------+            |
                                        |                           |
+-------------------------------------->o                           |
|                                       |                           |
|                                       v                           |
|                             +-------------------+                 |
|                             |Key and Auth. Check|                 |
|                             +---------+---------+                 |
|                                       |                           |
|                      /----------------*----------------\          |
|                     v                                   v         |
|                .---------.                         .---------.    |
|               ( Verified  )                       ( Falsified )   |
|                '----+----'                         '----+----'    |
|                     |                                   |         |
|                     v                                   v         |
|              +-------------+                        +-------+     |
|              |Store Message|                        |Discard|     |
|              +------+------+                        +---+---+     |
|                     |                                   |         |
|                     v                                   +---------o
|             +---------------+                                     |
|             |Check Previous |                                     |
|             +-------+-------+                                     |
|                     |                                             |
|            /--------*--------\                                    |
|           v                   v                                   |
|      .---------.         .---------.                              |
|     ( Verified  )       ( Falsified )                             |
|      '----+----'         '----+----'                              |
|           |                   |                                   |
|           v                   v                                   |
|    +-------------+   +-----------------+                          |
|    |Sync. Process|   |Discard Previous |                          |
|    +------+------+   +--------+--------+                          |
|           |                   |                                   |
+-----------+                   +-----------------------------------+]]></artwork>
      </figure>
    </section>

    <section title="Extension fields">
      <t>In <xref target="protsec"/>, some new extension fields for NTP
      packets are introduced. They are listed here again, for reference.</t>

      <texttable align="center" style="full">
        <ttcol>name</ttcol>

        <ttcol>used in</ttcol>

        <c>"association"</c>

        <c>client_assoc</c>

        <c/>

        <c>server_assoc</c>

        <c/>

        <c/>

        <c>"certificate request"</c>

        <c>client_cert<?xxe-remark teiche04
2014-02-11T10:32:08Z
Ist das Feld anders als "association"??></c>

        <c/>

        <c/>

        <c>"certificate"</c>

        <c>server_cert</c>

        <c/>

        <c/>

        <c>"cookie request"</c>

        <c>client_cook</c>

        <c/>

        <c/>

        <c>"cookie transmit"</c>

        <c>server_cook</c>

        <c/>

        <c/>

        <c>"time request"</c>

        <c>time_request</c>

        <c/>

        <c/>

        <c>"time response"</c>

        <c>time_response</c>

        <c/>

        <c/>

        <c>"broadcast request"</c>

        <c>client_bpar</c>

        <c/>

        <c/>

        <c>"broadcast parameters"</c>

        <c>server_bpar</c>

        <c/>

        <c/>

        <c>"broadcast message"</c>

        <c>server_broad</c>
      </texttable>
    </section>

    <section title="TICTOC Security Requirements">
      <t>The following table compares the NTS specifications against the
      TICTOC security requirements <xref
      target="I-D.ietf-tictoc-security-requirements"/>.</t>

      <texttable align="left" style="all" suppress-title="false"
                 title="Comparsion of NTS sepecification against TICTOC security requirements.">
        <ttcol align="left">Section</ttcol>

        <ttcol>Requirement from I-D tictoc security-requirements-05</ttcol>

        <ttcol>Requirement level</ttcol>

        <ttcol width="">NTS</ttcol>

        <c>5.1.1</c>

        <c>Authentication of Servers</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.1.1</c>

        <c>Authorization of Servers</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.1.2</c>

        <c>Recursive Authentication of Servers (Stratum 1)</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.1.2</c>

        <c>Recursive Authorization of Servers (Stratum 1)</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.1.3</c>

        <c>Authentication and Authorization of Slaves</c>

        <c>MAY</c>

        <c>-</c>

        <c>5.2</c>

        <c>Integrity protection.</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.3</c>

        <c>Protection against DoS attacks</c>

        <c>SHOULD</c>

        <c>OK</c>

        <c>5.4</c>

        <c>Replay protection</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.5.1</c>

        <c>Key freshness.</c>

        <c>MUST</c>

        <c>OK</c>

        <c>5.5.2</c>

        <c>Security association.</c>

        <c>SHOULD</c>

        <c>OK</c>

        <c>5.5.3</c>

        <c>Unicast and multicast associations.</c>

        <c>SHOULD</c>

        <c>OK</c>

        <c>5.6</c>

        <c>Performance: no degradation in quality of time transfer.</c>

        <c>MUST</c>

        <c>OK</c>

        <c/>

        <c>Performance: lightweight computation</c>

        <c>SHOULD</c>

        <c>OK</c>

        <c/>

        <c>Performance: storage, bandwidth</c>

        <c>SHOULD</c>

        <c>OK</c>

        <c>5.7</c>

        <c>Confidentiality protection</c>

        <c>MAY</c>

        <c>NO</c>

        <c>5.8</c>

        <c>Protection against Packet Delay and Interception Attacks</c>

        <c>SHOULD</c>

        <c>NA*)</c>

        <c>5.9.1</c>

        <c>Secure mode</c>

        <c>MUST</c>

        <c>-</c>

        <c>5.9.2</c>

        <c>Hybrid mode</c>

        <c>MAY</c>

        <c>-</c>

        <postamble>*) Ensured by NTP via multi-source
        configuration.</postamble>
      </texttable>
    </section>

    <section anchor="appBroadcast" title="Broadcast Mode">
      <t/>
    </section>
  </back>
</rfc>
