NTP Working Group                                              D. Sibold
Internet-Draft                                                       PTB
Intended status: Standards Track                             S. Roettger
Expires: April 21, August 18, 2014                                            TU-BS
                                                              K. Teichel
                                                                     PTB
                                                        October 18, 2013
                                                       February 14, 2014

                         Network Time Security
              draft-ietf-ntp-network-time-security-01.txt
              draft-ietf-ntp-network-time-security-02.txt

Abstract

   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 Network Networks [I-D.ietf-tictoc-security-requirements].

Requirements Language

   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 RFC 2119 [RFC2119].

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on April 21, August 18, 2014.

Copyright Notice

   Copyright (c) 2013 2014 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Security Threats  . . . . . . . . . . . . . . . . . . . . . .   3   4
   3.  Objectives  . . . . . . . . . . . . . . . . . . . . . . . . .   3   4
   4.  Terms and Abbreviations . . . . . . . . . . . . . . . . . . .   4
   5.  NTS Overview  . . . . . . . . . . . . . . . . . . . . . . . .   4   5
     5.1.  Symmetric and Client/Server Mode  . . . . . . . . . . . .   4   5
     5.2.  Broadcast Mode  . . . . . . . . . . . . . . . . . . . . .   5
   6.  Protocol Sequence Messages . . . . . . . . . . . . . . . . . . . . . .   5   6
     6.1.  Association Message Messages  . . . . . . . . . . . . . . . . . .   6
       6.1.1.  Message type: "client_assoc"  .   5
     6.2.  Certificate . . . . . . . . . . .   6
       6.1.2.  Message type: "server_assoc"  . . . . . . . . . . . .   6
     6.2.  Certificate Messages  . . . . . . .   5
     6.3.  Cookie Message . . . . . . . . . . .   7
       6.2.1.  Message type: "client_cert" . . . . . . . . . .   6
     6.4.  Broadcast Parameter . . .   7
       6.2.2.  Message type: "server_cert" . . . . . . . . . . . . .   7
     6.3.  Cookie Messages . .   6
     6.5.  Time Request Message . . . . . . . . . . . . . . . . . .   7
     6.6.  Broadcast .   8
       6.3.1.  Message type: "client_cook" . . . . . . . . . . . . .   8
       6.3.2.  Message type: "server_cook" . . . . . . .   7
     6.7.  Server Seed Refresh . . . . . .   8
     6.4.  Unicast Time Synchronisation Messages . . . . . . . . . .   8
       6.4.1.  Message type: "time_request"  . . .   7
   7.  Hash Algorithms and MAC Generation . . . . . . . . .   9
       6.4.2.  Message type: "time_response" . . . .   8
     7.1.  Hash Algorithms . . . . . . . .   9
     6.5.  Broadcast Parameter Messages  . . . . . . . . . . . . .   8
     7.2.  MAC Calculation .   9
       6.5.1.  Message type: "client_bpar" . . . . . . . . . . . . .  10
       6.5.2.  Message type: "server_bpar" . . . . . . .   8
   8.  Server Seed Considerations . . . . . .  10
     6.6.  Broadcast Message . . . . . . . . . . .   8
     8.1.  Server Seed Algorithm . . . . . . . . .  10
       6.6.1.  Message type: "server_broad"  . . . . . . . . .   9
     8.2.  Server Seed Live Time . . .  11
   7.  Protocol Sequence . . . . . . . . . . . . . . .   9
   9.  IANA Considerations . . . . . . .  11
     7.1.  The client  . . . . . . . . . . . . . .   9
   10. Security Considerations . . . . . . . . .  11
       7.1.1.  The client in unicast mode  . . . . . . . . . . . .   9
     10.1.  Initial Verification of the Server Certificates .  11
       7.1.2.  The client in broadcast mode  . . .   9
     10.2.  Revocation of Server Certificates . . . . . . . . .  12
     7.2.  The server  . .   9
     10.3.  Usage of NTP Pools . . . . . . . . . . . . . . . . . . .  10
     10.4.  Denial-of-Service . .  13
       7.2.1.  The server in Broadcast Mode unicast mode  . . . . . . . . . .  10
   11. Acknowledgements . . .  13
       7.2.2.  The server in broadcast mode  . . . . . . . . . . . .  14
     7.3.  Server Seed Refresh . . . . . . .  10
   12. References . . . . . . . . . . . .  14
   8.  Hash Algorithms and MAC Generation  . . . . . . . . . . . . .  10
     12.1.  Normative References  15
     8.1.  Hash Algorithms . . . . . . . . . . . . . . . . . .  10
     12.2.  Informative References . . .  15
     8.2.  MAC Calculation . . . . . . . . . . . . . .  11
   Appendix A.  TICTOC Security Requirements . . . . . . .  15

   9.  Server Seed Considerations  . . . . .  11
   Appendix B.  Broadcast Mode . . . . . . . . . . . .  15
     9.1.  Server Seed Algorithm . . . . . . .  12
   Authors' Addresses . . . . . . . . . . .  16
     9.2.  Server Seed Live Time . . . . . . . . . . . .  12

1.  Introduction

   Time synchronization protocols are more and more . . . . . .  16
   10. IANA Considerations . . . . . . . . . . . . . . . . . . . . .  16
   11. Security Considerations . . . . . . . . . . . . . . . . . . .  16
     11.1.  Initial Verification of the Server Certificates  . . . .  16
     11.2.  Revocation of Server Certificates  . . . . . . . . . . .  16
     11.3.  Usage of NTP Pools . . . . . . . . . . . . . . . . . . .  17
     11.4.  Denial-of-Service in Broadcast Mode  . . . . . . . . . .  17
   12. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  17
   13. References  . . . . . . . . . . . . . . . . . . . . . . . . .  17
     13.1.  Normative References . . . . . . . . . . . . . . . . . .  17
     13.2.  Informative References . . . . . . . . . . . . . . . . .  18
   Appendix A.  Flow Diagrams of Client Behaviour  . . . . . . . . .  18
   Appendix B.  Extension fields . . . . . . . . . . . . . . . . . .  20
   Appendix C.  TICTOC Security Requirements . . . . . . . . . . . .  21
   Appendix D.  Broadcast Mode . . . . . . . . . . . . . . . . . . .  22
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  22

1.  Introduction

   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) [RFC5905] was supplemented by the autokey protocol [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 [Roettger].  For the Precision Time Protocol
   (PTP), Annex K of the standard document IEEE 1588 [IEEE1588] defines
   an informative security protocol that is still in experimental state.

   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.

   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 [I-D.ietf-tictoc-security-requirements].

   Note:

      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.

2.  Security Threats

   A profound analysis of security threats and requirements for NTP and
   PTP can be found in the I-D [I-D.ietf-tictoc-security-requirements].

3.  Objectives

   The objectives of the NTS specifications are as follows:

   o  Authenticity: NTS enables the client to authenticate its time
      server.

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

   o  Confidentiality: NTS does not provide confidentiality protection
      of the time synchronization packets.

   o  Modes of operation: All operational modes of NTP are supported.

   o  Operational modes of PTP should be supported as far as possible.

   o  Hybrid mode: Both secure and insecure communication modes are
      possible for NTP servers and clients, respectively.

   o  Compatibility:

      *  Unsecured NTP associations shall not be affected.

      *  An NTP server that does not support NTS shall not be affected
         by NTS authentication requests.

4.  Terms and Abbreviations

   o  TESLA: Timed Efficient Stream Loss-Tolerant Authentication

5.  NTS Overview

5.1.  Symmetric and Client/Server Mode

   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:

      cookie = MSB_128 (HMAC(server seed, public key of client)),

   with the server seed as key, 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
   synchronize clocks
   be kept secret.  The cookie thus never changes as long as the server
   seed stays the same.  The server seed has to be refreshed
   periodically in networked infrastructures. order to provide key freshness as required in
   [I-D.ietf-tictoc-security-requirements].  The reliable
   performance 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
   Section 6.4).

5.2.  Broadcast Mode

   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 [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 such infrastructures can be degraded seriously the previous disclosure interval.
   The client verifies the MAC by
   successful attacks against buffering the time synchronization protocol.
   Therefore, time synchronization protocols applied packet until the
   disclosure of the key in critical
   infrastructures have its associated disclosure interval.  In
   order to provide security measures be able to defeat possible
   adversaries.  Consequently, the widespread Network Time Protocol
   (NTP) [RFC5905] was supplemented by verify the autokey protocol [RFC5906]
   which shall ensure authenticity validity of the NTP 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 integrity of
   the protocol packets.  Unfortunately,the autokey protocol exhibits
   various severe security vulnerabilities as revealed in server.  For a thorough
   analysis more detailed description of the
   TESLA protocol [Roettger].  For the Precision Time see Appendix D.

6.  Protocol
   (PTP) Annex K Messages

   Note that this section currently describes realization of the standard document IEEE 1588 [IEEE1588] defines
   an informative security protocol that is still in experimental state.

   Because message
   format of autokey's security vulnerabilities and NTS only for its utilization for NTP, in which the absence NTS
   specific data are enclosed in extension fields on top of a
   standardized security protocol NTP packets.
   A specification of NTS messages for PTP these protocols cannot would have to be
   applied in environments developed
   accordingly.

   The steps described in which compliance requirements demand
   authenticity and integrity protection.  This document specifies a
   security protocol which ensures authenticity of Section 6.1 - Section 6.4 belong to the time server via a
   Public Key Infrastructure
   unicast mode, while Section 6.5 and integrity Section 6.6 explain the steps
   involved in the broadcast mode of NTS.

6.1.  Association Messages

   In this step, the time synchronization
   protocol packets hash and which therefore enables signature algorithms that are used for the usage
   rest of NTP and PTP
   in such environments. the protocol are negotiated.

6.1.1.  Message type: "client_assoc"

   The protocol is specified sequence starts with the prerequisite in mind that precise
   timekeeping can only be accomplished with stateless time
   synchronization communication, which excludes standard security
   protocols like IPsec or TLS. client sending an association
   message, called client_assoc.  This prerequisite corresponds with message contains

   o  the
   requirement version number of NTS that a security mechanism for timekeeping must the client wants to use (this
      SHOULD be
   designed in such a way the highest version number that it does not degrade supports),

   o  the quality hostname of the
   time transfer [I-D.ietf-tictoc-security-requirements].

   Note:

      It client,

   o  a selection of hash algorithms, and

   o  a selection of accepted algorithms for the signatures.

   For NTP, this message is intended to formulate realized as a packet with an extension field
   of type "association", which contains all this data.

6.1.2.  Message type: "server_assoc"

   This message is sent by the server upon receipt of client_assoc.  It
   contains

   o  the version number used for the rest of the protocol to (which SHOULD
      be applicable to NTP
      as well determined as PTP.  In the current state minimum over the draft focuses on client's suggestion in the
      application to NTP.

2.  Security Threats

   A profound analysis
      client_assoc and the highest supported by the server),

   o  the hostname of security threats the server, and requirements

   o  the server's choice of algorithm for NTP the signatures and
   PTP can
      cryptographic hash algorithm, both of which MUST be found chosen from
      the client's proposals.

   In the case of NTP, the data is enclosed in a packet's extension
   field, also of type "association".

6.2.  Certificate Messages

   In this step, the I-D [I-D.ietf-tictoc-security-requirements].

3.  Objectives

   The objectives 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 NTS specifications are as follows:

   o  Authenticity: NTS enables server messages with extension fields is ensured.

   Discussion:

      Note that in this step the client to authenticate its time
      server.

   o  Integrity: NTS protects validates the integrity authenticity of time synchronization
      protocol packets via a message authentication code (MAC).

   o  Confidentiality: NTS
      its immediate NTP server only.  It does not provide confidentiality protection recursively validate
      the authenticity of each NTP server on the time synchronization packets.

   o  Modes of operation: All operational modes
      chain.  Recursive authentication (and authorization) as formulated
      in [I-D.ietf-tictoc-security-requirements] depends on the chosen
      trust anchor.

6.2.1.  Message type: "client_cert"

   This message is sent by the client, after it successfully verified
   the content of NTP are supported. the received server_assoc message (see Section 7.1.1).
   It contains

   o  Operational modes of PTP should be supported as far as possible.  the negotiated version number,

   o  Hybrid mode: Both secure and insecure communication modes are
      possible for NTP servers  the client's hostname, and clients, respectively.

   o  Compatibility:

      *  Unsecured NTP associations shall not be affected.

      *  An  the signature algorithm negotiated during the association
      messages.

   It is realized as an NTP server that does not support NTS shall not be affected packet with extension field of type
   "certificate request" for the necessary data.

6.2.2.  Message type: "server_cert"

   This message is sent by NTS authentication requests.

4.  Terms and Abbreviations

   o  TESLA: Time efficient stream loss-tolerant authentication

5.  NTS Overview

5.1.  Symmetric the server, upon receipt of a client_cert
   message, if the version number and Client/Server Mode

   Authenticity choice of methods communicated in
   that message are actually supported by the server.  It contains

   o  all the information necessary to authenticate the time server to the
      client.  This is verified once by a Public Key
   Infrastructure.  Authenticity and integrity chain of certificates, which starts at the NTP packets are
   then ensured
      server and goes up to a trusted authority, where each certificate
      MUST be certified by the one directly following it.

   This message is realized for NTP as a packet with extension field of
   type "certificate" which holds the certification data.

6.3.  Cookie Messages

   During this step, the server transmits a Message Authentication Code (MAC), which is
   attached secret cookie to the NTP packet. client
   securely.  The calculation of cookie will be used for integrity protection during
   unicast time synchronization.

6.3.1.  Message type: "client_cook"

   This message is sent by the MAC includes client, upon successful authentication of
   the
   whole NTP packet and server.  In this message, the client requests a cookie which is shared from the
   server.  It contains

   o  the negotiated version number,

   o  the hash algorithm H negotiated between client and
   server.  It server during
      the association messages,

   o  the client's public key.

   For NTP, an extension field of type "cookie request" holds the listed
   data.

6.3.2.  Message type: "server_cook"

   This message is calculated according to:

      cookie = MSB_128 (H(server seed || H(public key sent by the server, upon receipt of client))),

   where || indicates concatenation and a client_cook
   message.  The hash of the client's public key, as included in which H
   client_cook, is used by the server to calculate the cookie (see
   Section 5.1).  This message contains

   o  a hash algorithm.
   The function MSB_128 cuts off concatenated pair, encrypted with the 128 most significant bits client's public key, where
      the pair consists of

      *  the
   result cookie, and

      *  a signature of the hash function.  The server seed cookie signed with the server's private key.

   In the case of NTP, this is a 128 bit random
   value packet with an extension field of type
   "cookie transmit".

6.4.  Unicast Time Synchronisation Messages

   In this step, the server, which has to usual time synchronization process is executed,
   with the addition of integrity protection for all messages that the
   server sends.  This step can be kept secret.  The cookie thus
   never changes repeated as often as the client
   desires and as long as the server seed stays integrity of the same.  The server
   seed has to be refreshed periodically in order to provide key
   freshness as required in [I-D.ietf-tictoc-security-requirements].
   The server does not keep a state server's time responses
   is verified successfully.  Secure time synchronization by repetition
   of this step is the goal of a unicast run.

6.4.1.  Message type: "time_request"

   This message is sent by the client.  Therefore client when it has to
   recalculate the cookie each requests time it receives a request from the
   client. exchange.
   To send this end, message, the client has MUST have received server_cook and
   successfully verified the cookie via the server's signature.  It
   contains

   o  the negotiated version number,

   o  the time synchronization data that the client wants to attach transmit,

   o  a 128-bit nonce,

   o  the negotiated hash algorithm H,

   o  the hash value of its the client's public key to each request (see Section 6.5).

5.2.  Broadcast Mode

   Just under H.

   It is realized as in an NTP packet with the case time synchronization data
   and an additional extension field of type "time request" for the client server mode and symmetric mode,
   authenticity and integrity rest
   of the NTP packets are ensured by a MAC,
   which information.

6.4.2.  Message type: "time_response"

   This message is attached to the NTP packet sent by the sender. server, after it received a time_request
   message.  The verification
   of the authenticity is based on server uses the TESLA protocol [RFC4082].  TESLA
   is based on a one-way chain hash of keys, where each the client's public key is and the output of
   a one-way function applied on
   transmitted hash algorithm to recalculate the previous key in cookie for the chain.  The
   last element of client.
   This message contains

   o  the chain is shared securely with all clients.  The
   server splits server's time into intervals of uniform duration and assigns
   each key to an interval synchronization response data,

   o  the nonce transmitted in reverse order, starting time_request,

   o  a MAC (generated with the
   penultimate.  At each time interval, cookie as key) for verification of the server sends
      above.

   It is realized as an NTP
   broadcast packet appended by a MAC, calculated using the
   corresponding key, and the key of the previous interval.  The client
   verifies the MAC by buffering the packet until with the disclosure 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
   key in time synchronization data and the next interval.  In order to be able to verify extension field, with the validity
   of
   cookie as the key, key.

6.5.  Broadcast Parameter Messages

   In this step, the client has to be loosely time synchronized to receives the
   server.  This has necessary information to be accomplished during
   execute the initial client server
   exchange between TESLA protocol in a secured broadcast association.  The
   client and server.  For can only initiate a more detailed
   description of the TESLA protocol secure broadcast association after a
   successful unicast run, see Section 7.1.2.

   See Appendix B.

6.  Protocol Sequence

6.1.  Association D for more details on TESLA.

6.5.1.  Message

   The protocol sequence starts type: "client_bpar"

   This message is sent by the client in order to establish a secured
   time broadcast association with the server.  It contains

   o  the version number negotiated during association message, in which unicast mode,

   o  the client sends an NTP client's hostname, and

   o  the signature algorithm negotiated during unicast.

   For NTP, this message is realized as a packet with an extension field
   of type
   association.  It contains "broadcast request".

6.5.2.  Message type: "server_bpar"

   This message is sent by the hostname server upon receipt of the client and a status
   word which client_bpar
   message during the broadcast loop of the server.  It contains

   o  the algorithms one-way function used for building the signatures and one-way key chain,

   o  the
   status last key of the connection.  The response contains one-way key chain, and

   o  the hostname disclosure schedule of the
   server keys.  This contains:

      *  time interval duration,

      *  the disclosure delay (number of intervals between use and
         disclosure of a key),

      *  the algorithms for time at which the signatures. next time interval will start, and

      *  the next interval's associated index.

   o  The message also contains a signature signed by the server notifies with
      its private key, verifying all the cryptographic hash algorithms data listed above.

   It is realized for NTP as a packet with an extension field of type
   "broadcast parameters", which it supports.

6.2.  Certificate contains all the given data.

6.6.  Broadcast Message

   In this step, the client receives the certification chain up server keeps sending broadcast time synchronization
   messages to a
   trusted authority (TA).  To this end, the client requests all participating clients.

6.6.1.  Message type: "server_broad"

   This message is sent by the
   certificate for server over the subject name (hostname) course of the NTP server.  The
   response its broadcast
   schedule.  It is part of any broadcast association.  It contains

   o  time broadcast data,

   o  the certificate with index that belongs to the issuer name.  If current interval (and therefore
      identifies the
   issuer name is different from current, yet undisclosed key)

   o  the subject name, disclosed key of the client requests previous disclosure interval (current
      time interval minus disclosure delay).

   o  a MAC, calculated with the certificate key for the issuer.  This continues until it receives a
   certificate in which the subject name and current time interval,
      verifying the issuer name are
   identical, which indicates that it is issued by a TA. time data

   The client
   then checks that the issuer message is indeed on its list of issuers which
   are accepted realized as TAs.  The client has to check that each issuer in the
   certificate chain is authorized to issue new certificates.  To this
   end, the certificates have to include an NTP broadcast packet with the X.509v3 time
   broadcast data and with an extension field
   "CA:TRUE".  With of type "broadcast
   message", which contains the established certification chain rest of the client listed data.  The NTP packet
   is
   able to verify the server signatures and, hence, then appended by a MAC verifying the authenticity of time data, but not the server messages with
   extension fields is ensured.

   Discussion:

      Note that field.

7.  Protocol Sequence

7.1.  The client

7.1.1.  The client in this step unicast mode

   For a unicast run, the client validates performs the authenticity of
      its NTP server only. following steps:

   1.  It does not recursively validate sends a client_assoc message to the server.

   2.  It waits for a reply in the
      authenticity form of a server_assoc message.
       After receipt of each NTP server on the time synchronization chain.
      But each NTP server on message it performs the time synchronization chain validates following checks:

       *  The message MUST contain a conform version number.

       *  The client has to verify that the NTP server to which it is synchronized.  This conforms to has chosen the
      recursive authentication requirement
          signature and hash algorithms from its proposal sent in the TICTOC security
      requirements [I-D.ietf-tictoc-security-requirements].

6.3.  Cookie Message
          client_assoc message.

       If one of the checks fails, the client MUST abort the run.

   3.  The client requests then sends a cookie from client_cert message to the server.

   4.  It selects awaits a hash
   algorithm from reply in the list form of algorithms supported by the server.  The
   request includes its public key a server_cert message and
       performs an authenticity check.  If this check fails, the selected hash algorithm.  The
   hash of the public key is used by client
       MUST abort the server run.

   5.  Next, it sends a client_cook message to calculate the cookie
   (see Section 5.1).  The response server.

   6.  It awaits a reply in the form of a server_cook message; upon
       receipt it executes the server contains following actions:

       *  It decrypts the cookie
   and message with its own private key.

       *  It checks that the decrypted message has the format of a 128
          bit Cookie concatenated with its own signature of the cookie signed value,
          verifiable with the server's private key,
   both encrypted with the client's public key.

6.4.  Broadcast Parameter Message

   In

       If the broadcast mode check fails, the client requests the following information
   from the server:

   o MAY abort the last key of run.

   7.  The client sends a time_request message to the one-way key chain,

   o server.

   8.  It awaits a reply in the disclosure schedule form of the following keys.  This contains: a time_response message.  Upon
       receipt, it checks:

       *  time interval duration, time at which  that the next time interval
         will start and its associated index,

      *  key disclosure delay (number of time intervals for which a key
         is valid).

   The server will sign all transmitted properties so nonce belongs to the previous
          time_request message and .

       *  that the appended MAC verifies the time data and the
          transmitted nonce.

       If the nonce is invalid, the client MUST ignore this
       time_response message.  If the MAC is
   able invalid, the client MUST do
       one of the following: abort the run or go back to verify their authenticity.  For this packet exchange a new
   extension field "broadcast parameters" step 5.  If
       both checks are successful, the client SHOULD continue time
       synchronization by going back to step 7.

   The client's behaviour in unicast mode is used. also expressed in Figure 1.

7.1.2.  The client
   synchronizes its time with the server in broadcast mode

   To establish a secure broadcast association with a broadcast server,
   the client MUST initially authenticate the broadcast server mode and
   saves
   securely synchronize its time to it up to an upper bound of for its time
   offset with respect to the time of in unicast mode.  After that, the server.  See Appendix B for more details.

6.5.  Time Request Message

   The client request includes a new extension field "time request"
   which contains performs the hash of its public key,
   following steps:

   1.  It sends a 128-bit nonce, and the
   chosen hash algorithm . The server needs the hash of the public key
   and the notified hash algorithm client_bpar message to recalculate the cookie server.

   2.  It waits for the
   client.  The response is a NTP packet with a new extension field
   "time response" which contains reply in the nonce and form of a MAC generated over the
   time synchronization data, the cookie and server_bpar message after
       which it performs the nonce.

6.6.  Broadcast Message

   In broadcast mode following checks:

       *  The message must contain all the NTP packet includes a new extension field
   "broadcast message" which contains necessary information for the disclosed key
          TESLA protocol, as listed in Section 6.5.2.

       *  Verification of the previous
   disclosure interval (current time interval minus disclosure delay).
   The NTP packet message's signature.

       If any information is appended missing or cannot be verified as signed by a MAC, calculated with
       the key for server, the client MUST abort the
   current time interval.  When a broadcast run.

   3.  The client receives awaits time synchronization data in the form of a broadcast message
       server_broadcast message.  Upon receipt, it
   has to perform performs the
       following tests:

   o checks:

       1.  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 it has to be
      discarded.
           authentication.  Otherwise, the client MUST discard it.  Note
           that the time information included in the packet will not be
           used for synchronization until their its authenticity could be
           verified.

   o

       2.  The client checks whether it already knows the disclosed key.
           If so, the client SHOULD discard the packet is discarded 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 falsified, the packet has
      to be discarded.

   o client MUST discard the packet.

       3.  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 client
           MUST request authentic time from the server by means of a
           unicast time request message.

       See RFC 4082[RFC4082] for a detailed description of the packet
       verification process.

   The client's behaviour in broadcast mode can also be seen in Figure
   2.

7.2.  The server

   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.

7.2.1.  The server in unicast mode
   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:

   o  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 Section 6.1.2.

   o  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 Section 6.2.2.

   o  Upon receipt of a client_cook message, the server calculates the
      cookie according to the formula given in Section 5.1.  With this,
      it constructs a server_cook message as described in Section 6.3.2.

   o  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 Section 6.4.2.

   Also, it must adhere to the rule of server seed refreshing, as given
   in [1].  More information on that can be found in Section 7.3.

7.2.2.  The server in broadcast mode

   To support NTS broadcast, the server MUST
      request authentic time from be ready to perform the server by means
   following actions:

   o  Upon receipt of a unicast time
      request message.

   See RFC 4082[RFC4082] for client_bpar message, the server constructs and
      sends a detailed description server_bpar message as described in Section 6.5.2.

   o  The server follows the TESLA protocol in all other aspects, by
      regularly sending server_broad messages as described in
      Section 6.6.1, adhering to its own disclosure schedule.

   It is also the server's responsibility to watch for the expiration
   date of the packet
   verification process.

6.7. one-way key chain and generate a new key chain
   accordingly.

7.3.  Server Seed Refresh
   According to the requirements in
   [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 (Section 6.3).  This is
   true for the unicast and broadcast mode, respectively.

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

   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.

7.

8.  Hash Algorithms and MAC Generation

7.1.

8.1.  Hash Algorithms

   Hash algorithms are used at different points: calculation of the
   cookie and the MAC, and hashing of the public key.  The client
   selects the  Client and server
   negotiate a hash algorithm from the list of hash algorithms which are
   supported by the server.  This list is notified H during the association message exchange
   (Section 6.1). 6.1) at the beginning of a unicast run.  The selected
   algorithm H is used for all hashing processes in the protocol. that run.

   In the broadcast mode mode, hash algorithm 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.

   The list of the hash algorithms supported by the server has to
   fulfill the following requirements:

   o  it MUST NOT include MD5 or weaker algorithms,

   o  it MUST include SHA-256 or stronger algorithms.

7.2.

8.2.  MAC Calculation

   For the calculation of the MAC client and server are using a Keyed-
   Hash Message Authentication Code (HMAC) approach [RFC2104].  The HMAC
   is generated with the hash algorithm specified by the client (see
   Section 7.1).

8. 8.1).

9.  Server Seed Considerations
   The server has to calculate a random seed which has to be kept secret
   and which has to MUST be changed periodically.  The server has to MUST generate a
   seed for each supported hash algorithm.

8.1.

9.1.  Server Seed Algorithm

8.2.

9.2.  Server Seed Live Time

9.

10.  IANA Considerations

   This document makes no request of IANA.

   Note to RFC Editor: this section may be removed on publication as an
   RFC.

10.

11.  Security Considerations

10.1.

11.1.  Initial Verification of the Server Certificates

   The client has to verify the validity of the certificates during the
   certification message exchange (Section 6.2).  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:

   o  The validity of the certificates is preconditioned.  Usually this
      will be the case in corporate networks.

   o  The client ensures that the certificates are not revoked.  To this
      end, the client uses the Online Certificate Status Protocol (OCSP)
      defined in [RFC6277].

   o  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 [RFC3161].

10.2.

11.2.  Revocation of Server Certificates

   According to Section Section 6.7 7.3, 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
   (Section 6.2).  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.

10.3.

11.3.  Usage of NTP Pools

   The certification based authentication scheme described in Section 6
   is not applicable to the concept of NTP pools.  Therefore, NTS is not
   able to provide secure usage of NTP pools.

10.4.

11.4.  Denial-of-Service in Broadcast Mode

   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 RFC
   4082 [RFC4082].  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.

   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.

11.  Acknowledgements

12.  Acknowledgements

   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.

13.  References

12.1.

13.1.  Normative References

   [IEEE1588]
              IEEE Instrumentation and Measurement Society. TC-9 Sensor
              Technology, "IEEE standard for a precision clock
              synchronization protocol for networked measurement and
              control systems", 2008.

   [RFC2104]  Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
              Hashing for Message Authentication", RFC 2104, February
              1997.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC3161]  Adams, C., Cain, P., Pinkas, D., and R. Zuccherato,
              "Internet X.509 Public Key Infrastructure Time-Stamp
              Protocol (TSP)", RFC 3161, August 2001.

   [RFC4082]  Perrig, A., Song, D., Canetti, R., Tygar, J.D., J., and B.
              Briscoe, "Timed Efficient Stream Loss-Tolerant
              Authentication (TESLA): Multicast Source Authentication
              Transform Introduction", RFC 4082, June 2005.

   [RFC5905]  Mills, D., Martin, J., Burbank, J., and W. Kasch, "Network
              Time Protocol Version 4: Protocol and Algorithms
              Specification", RFC 5905, June 2010.

   [RFC5906]  Haberman, B. and D. Mills, "Network Time Protocol Version
              4: Autokey Specification", RFC 5906, June 2010.

   [RFC6277]  Santesson, S. and P. Hallam-Baker, "Online Certificate
              Status Protocol Algorithm Agility", RFC 6277, June 2011.

12.2.

13.2.  Informative References

   [I-D.ietf-tictoc-security-requirements]
              Mizrahi, T., "Security Requirements of Time Protocols in
              Packet Switched Networks", draft-ietf-tictoc-security-
              requirements-05 (work
              Packet Switched Networks", draft-ietf-tictoc-security-
              requirements-05 (work in progress), April 2013.

   [Roettger]
              Roettger, S., "Analysis of the NTP Autokey Procedures",
              February 2012.

Appendix A.  Flow Diagrams of Client Behaviour

                        +---------------------+
                        |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-----------+

           Figure 1: The client's behaviour in NTS unicast mode.

                            +-----------------------------+
                            |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 |                          |
   |    +------+------+   +--------+--------+                          |
   |           |                   |                                   |
   +-----------+                   +-----------------------------------+

          Figure 2: The client's behaviour in progress), April 2013.

   [Roettger]
              Roettger, S., "Analysis of the NTS broadcast mode.

Appendix B.  Extension fields

   In Section 6, some new extension fields for NTP Autokey Procedures",
              February 2012. packets are
   introduced.  They are listed here again, for reference.

                +------------------------+---------------+
                | name                   | used in       |
                +------------------------+---------------+
                | "association"          | client_assoc  |
                |                        | server_assoc  |
                |                        |               |
                | "certificate request"  | client_cert   |
                |                        |               |
                | "certificate"          | server_cert   |
                |                        |               |
                | "cookie request"       | client_cook   |
                |                        |               |
                | "cookie transmit"      | server_cook   |
                |                        |               |
                | "time request"         | time_request  |
                |                        |               |
                | "time response"        | time_response |
                |                        |               |
                | "broadcast request"    | client_bpar   |
                |                        |               |
                | "broadcast parameters" | server_bpar   |
                |                        |               |
                | "broadcast message"    | server_broad  |
                +------------------------+---------------+

Appendix A. C.  TICTOC Security Requirements

   The following table compares the NTS specifications against the
   TICTOC security requirements [I-D.ietf-tictoc-security-requirements].

   +---------+--------------------------------+---------------+--------+
   | Section | Requirement from I-D tictoc    | Requirement   | NTS    |
   |         | security-requirements-05       | level         |        |
   +---------+--------------------------------+---------------+--------+
   | 5.1.1   | Authentication of Servers      | MUST          | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.1.1   | Authorization of Servers       | MUST          | - OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.1.2   | Recursive Authentication of    | MUST          | NO OK     |
   |         | Servers (Stratum 1)            |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.1.2   | Recursive Authorization of     | MUST          | - OK     |
   |         | Servers (Stratum 1)            |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.1.3   | Authentication and             | MAY           | -      |
   |         | Authorization of Slaves        |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.2     | Integrity protection.          | MUST          | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.3     | Protection against DoS attacks | SHOULD        | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.4     | Replay protection              | MUST          | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.5.1   | Key freshness.                 | MUST          | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.5.2   | Security association.          | SHOULD        | OK     |
   +---------+--------------------------------+---------------+--------+
   | 5.5.3   | Unicast and multicast          | SHOULD        | OK     |
   |         | associations.                  |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.6     | Performance: no degradation in | MUST          | OK     |
   |         | quality of time transfer.      |               |        |
   +---------+--------------------------------+---------------+--------+
   |         | Performance: lightweight       | SHOULD        | OK     |
   |         | computation                    |               |        |
   +---------+--------------------------------+---------------+--------+
   |         | Performance: storage,          | SHOULD        | OK     |
   |         | bandwidth                      |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.7     | Confidentiality protection     | MAY           | NO     |
   +---------+--------------------------------+---------------+--------+
   | 5.8     | Protection against Packet      | SHOULD        | NA*)   |
   |         | Delay and Interception Attacks |               |        |
   +---------+--------------------------------+---------------+--------+
   | 5.9.1   | Secure mode                    | MUST          | -      |
   +---------+--------------------------------+---------------+--------+
   | 5.9.2   | Hybrid mode                    | MAY           | -      |
   +---------+--------------------------------+---------------+--------+

   *) Ensured by NTP via multi-source configuration.

         Comparsion of NTS sepecification against TICTOC security
                               requirements.

Appendix B. D.  Broadcast Mode

Authors' Addresses

   Dieter Sibold
   Physikalisch-Technische Bundesanstalt
   Bundesallee 100
   Braunschweig  D-38116
   Germany

   Phone: +49-(0)531-592-8420
   Fax:   +49-531-592-698420
   Email: dieter.sibold@ptb.de

   Stephen Roettger
   Technische Universitaet Braunschweig

   Email: stephen.roettger@googlemail.com
   Kristof Teichel
   Physikalisch-Technische Bundesanstalt
   Bundesallee 100
   Braunschweig  D-38116
   Germany

   Email: kristof.teichel@ptb.de