draft-ietf-ntp-using-nts-for-ntp-08.txt   draft-ietf-ntp-using-nts-for-ntp-09.txt 
NTP Working Group D. Franke NTP Working Group D. Franke
Internet-Draft Akamai Internet-Draft Akamai
Intended status: Standards Track D. Sibold Intended status: Standards Track D. Sibold
Expires: September 14, 2017 K. Teichel Expires: December 28, 2017 K. Teichel
PTB PTB
March 13, 2017 June 26, 2017
Network Time Security for the Network Time Protocol Network Time Security for the Network Time Protocol
draft-ietf-ntp-using-nts-for-ntp-08 draft-ietf-ntp-using-nts-for-ntp-09
Abstract Abstract
This memo specifies Network Time Security (NTS), a mechanism for This memo specifies Network Time Security (NTS), a mechanism for
using Transport Layer Security (TLS) and Authenticated Encryption using Transport Layer Security (TLS) and Authenticated Encryption
with Associated Data (AEAD) to provide cryptographic security for the with Associated Data (AEAD) to provide cryptographic security for the
Network Time Protocol. Network Time Protocol.
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 Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 14, 2017. This Internet-Draft will expire on December 28, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2017 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terms and Abbreviations . . . . . . . . . . . . . . . . . . . 3 1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 3
3. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Protocol overview . . . . . . . . . . . . . . . . . . . . 4
4. Overview of NTS-Secured NTP . . . . . . . . . . . . . . . . . 4 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 5
4.1. Client-Server Mode . . . . . . . . . . . . . . . . . . . 5 3. TLS profile for Network Time Security . . . . . . . . . . . . 5
4.2. Symmetric/Peer Mode and Control Modes . . . . . . . . . . 5 4. The NTS-encapsulated NTPv4 protocol . . . . . . . . . . . . . 6
5. Employing (D)TLS for NTP Security . . . . . . . . . . . . . . 5 5. The NTS Key Establishment protocol . . . . . . . . . . . . . 8
5.1. TLS profile for Network Time Security . . . . . . . . . . 6 5.1. NTS-KE record types . . . . . . . . . . . . . . . . . . . 9
5.2. The NTS-encapsulated NTPv4 protocol . . . . . . . . . . . 7 5.1.1. End of Message . . . . . . . . . . . . . . . . . . . 9
5.3. The NTS Key Establishment protocol . . . . . . . . . . . 7 5.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 9
5.3.1. NTS-KE record types . . . . . . . . . . . . . . . . . 9 5.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3.2. Key Extraction (generally) . . . . . . . . . . . . . 11 5.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 10
5.4. NTS Extensions for NTPv4 . . . . . . . . . . . . . . . . 11 5.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 10
5.4.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . 11 5.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 11
5.4.2. Packet structure overview . . . . . . . . . . . . . . 12 5.2. Key Extraction (generally) . . . . . . . . . . . . . . . 11
5.4.3. The Unique Identifier extension . . . . . . . . . . . 13 6. NTS Extensions for NTPv4 . . . . . . . . . . . . . . . . . . 11
5.4.4. The NTS Cookie extension . . . . . . . . . . . . . . 13 6.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 11
5.4.5. The NTS Cookie Placeholder extension . . . . . . . . 14 6.2. Packet structure overview . . . . . . . . . . . . . . . . 12
5.4.6. The NTS Authenticator and Encrypted Extensions 6.3. The Unique Identifier extension . . . . . . . . . . . . . 13
extension . . . . . . . . . . . . . . . . . . . . . . 14 6.4. The NTS Cookie extension . . . . . . . . . . . . . . . . 13
5.4.7. Protocol details . . . . . . . . . . . . . . . . . . 15 6.5. The NTS Cookie Placeholder extension . . . . . . . . . . 13
5.5. Recommended format for NTS cookies . . . . . . . . . . . 17 6.6. The NTS Authenticator and Encrypted Extensions extension 14
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 6.7. Protocol details . . . . . . . . . . . . . . . . . . . . 15
7. Security Considerations . . . . . . . . . . . . . . . . . . . 22 7. Recommended format for NTS cookies . . . . . . . . . . . . . 17
7.1. Random Number Generation . . . . . . . . . . . . . . . . 23 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18
7.2. Usage of NTP Pools . . . . . . . . . . . . . . . . . . . 23 9. Security considerations . . . . . . . . . . . . . . . . . . . 22
7.3. Initial Verification of the Server Certificates . . . . . 23 9.1. Avoiding DDoS amplification . . . . . . . . . . . . . . . 22
7.4. Treatment of Initial Messages . . . . . . . . . . . . . . 23 9.2. Initial verification of server certificates . . . . . . . 22
7.5. DTLS-Related Issues . . . . . . . . . . . . . . . . . . . 23 9.3. Usage of NTP pools . . . . . . . . . . . . . . . . . . . 23
7.6. Delay Attack . . . . . . . . . . . . . . . . . . . . . . 23 9.4. Delay attacks . . . . . . . . . . . . . . . . . . . . . . 24
8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 24 9.5. Random number generation . . . . . . . . . . . . . . . . 24
8.1. Confidentiality . . . . . . . . . . . . . . . . . . . . . 24 10. Privacy Considerations . . . . . . . . . . . . . . . . . . . 24
8.2. Unlinkability . . . . . . . . . . . . . . . . . . . . . . 24 10.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 24
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25 10.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 25
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 25 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25
10.1. Normative References . . . . . . . . . . . . . . . . . . 25 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 26
10.2. Informative References . . . . . . . . . . . . . . . . . 27 12.1. Normative References . . . . . . . . . . . . . . . . . . 26
Appendix A. Flow Diagrams of Client Behaviour . . . . . . . . . 28 12.2. Informative References . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 28
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28
1. Introduction 1. Introduction
This document specifies measures to protect time synchronization This memo specifies Network Time Security (NTS), a cryptographic
between NTP participants. In particular, it describes two main security mechanism for network time synchronization. A complete
techniques. The first is a mechanism that uses TLS (over a specification is provided for application of NTS to the Network Time
connection on TCP port 123) to exchange key data and that afterwards Protocol (NTP) [RFC5905]. However, certain sections of this memo are
allows to secure NTP mode 3 and 4 packets using Authenticated not inherently NTP-specific, and enable future work to apply them to
Encryption with Associated Data objects embedded in extension fields other time synchronization protocols such as the Precision Time
of those packets. The second is a mechanism for using Datagram Protocol (PTP) [IEC.61588_2009].
Transport Layer Security [RFC6347] (DTLS) to provide cryptographic
security for NTP mode 1, 2 and 6 packets.
While the detailed application described in this document is
inherently NTP-specific, the overall approach is not. Therefore, it
could be taken as guidance on how future work may apply the described
techniques to other time synchronization protocols (such as the
Precision Time Protocol [IEC.61588_2009]).
2. Terms and Abbreviations
MAC Message Authentication Code
NTP Network Time Protocol (RFC 5905 [RFC5905])
NTS Network Time Security
TLS Transport Layer Security
DTLS Datagram Transport Layer Security
AEAD Authenticated Encryption with Associated Data (RFC 5116
[RFC5116])
3. Objectives
The specific objectives for the measures described this document are
as follows:
o Protection for NTP time synchronization messages:
* Integrity: NTS protects the integrity of NTP time
synchronization protocol packets.
* Confidentiality: NTS does not generally provide confidentiality
protection of the time synchronization data. It does so only
in the case of NTP's symmetric/peer mode.
* Privacy: Once an NTS session has been established, NTS supports 1.1. Objectives
unlinkability for devices that (1) use NTS as clients and (2)
minimize the information they expose in client query (mode 3)
packets per [I-D.dfranke-ntp-data-minimization]. Unlinkability
ensures that NTS does not leak data that allows an attacker to
track mobile NTP clients when they move between networks. See
Section 8.2 for details.
* Request-Response-Consistency: NTS enables a client to match an The objectives of NTS are as follows:
incoming response to a request it has sent. NTS also enables
the client to deduce from the response whether its request to
the server has arrived without alteration. This is to prevent
attacks employing replays of valid server responses.
o Additional protection for key exchange messages: o Identity: Through the use of the X.509 PKI, implementations may
cryptographically establish the identity of the parties they are
communicating with
* Authenticity: NTS enables an NTP client to authenticate its o Authentication: Implementations may cryptographically verify that
time server(s) during key exchange procedures. any time synchronization packets are authentic, i.e., that they
were produced by an identified party and have not been modified in
transit.
* Authorization: NTS optionally enables the server to verify the o Confidentiality: Although basic time synchronization data is
client's authorization. considered non-confidential and sent in the clear, NTS includes
support for encrypting NTP extension fields.
o Modes of operation: Both the client-server mode and the symmetric o Replay prevention: Implementations may detect when a received time
peer mode of NTP are supported. The broadcast mode of NTP can NOT synchronization packet is a replay of a previous packet.
be secured with measures within this document.
o Hybrid mode: For all supported modes, both secure and insecure o Request-response consistency: Client implementations may verify
communication modes can be used at the same time, for both NTP that a time synchronization packet received from a server was sent
servers and clients. in response to a particular request from the client.
o Compatibility: o Unlinkability: For mobile clients, NTS will not leak any
information which would permit a passive adversary to determine
that two packets sent over different networks came from the same
client.
* NTS-secured communication does not affect NTP associations o Non-amplification: implementations may avoid acting as DDoS
which are not secured by NTS. amplifiers by never responding to a request with a packet larger
than the request packet.
* NTS-secured authentication requests do not affect any NTP o Scalability: Servers implementations may serve large numbers of
servers that do not support NTS. clients without having to retain any client-specific state.
4. Overview of NTS-Secured NTP 1.2. Protocol overview
The Network Time Protocol includes many different operating modes to The Network Time Protocol includes many different operating modes to
support various network topologies. In addition to its best-known support various network topologies. In addition to its best-known
and most-widely-used client-server mode, it also includes modes for and most-widely-used client-server mode, it also includes modes for
synchronization between symmetric peers, a control mode for server synchronization between symmetric peers, a control mode for server
monitoring and administration and a broadcast mode. These various monitoring and administration and a broadcast mode. These various
modes have differing and contradictory requirements for security and modes have differing and contradictory requirements for security and
performance. Symmetric and control modes demand mutual performance. Symmetric and control modes demand mutual
authentication and mutual replay protection, and for certain message authentication and mutual replay protection, and for certain message
types control mode may require confidentiality as well as types control mode may require confidentiality as well as
skipping to change at page 5, line 17 skipping to change at page 4, line 28
servers may have vast number of clients and be unable to afford to servers may have vast number of clients and be unable to afford to
maintain per-client state. However, client-server mode also has more maintain per-client state. However, client-server mode also has more
relaxed security needs, because only the client requires replay relaxed security needs, because only the client requires replay
protection: it is harmless for servers to process replayed packets. protection: it is harmless for servers to process replayed packets.
The security demands of symmetric and control modes, on the other The security demands of symmetric and control modes, on the other
hand, are in conflict with the resource-utilization demands of hand, are in conflict with the resource-utilization demands of
client-server mode: any scheme which provides replay protection client-server mode: any scheme which provides replay protection
inherently involves maintaining some state to keep track of what inherently involves maintaining some state to keep track of what
messages have already been seen. messages have already been seen.
This document does not discuss how to add security to NTP's broadcast In order to simulatenously serve these conflicting requirements, NTS
mode. is structured as a suite of three protocols:
4.1. Client-Server Mode
The server does not keep a long-term state of the client. NTS The "DTLS-encapsulated NTPv4" protocol is little more than "NTP
initially verifies the authenticity of the time server and exchanges over DTLS": the two endpoints perform a DTLS handshake and then
one or more symmetric keys. The TLS-based key exchange procedure exchange NTP packets encapsulated as DTLS Application Data. It
described in Section 5 MUST be used for this exchange. provides mutual replay protection and is suitable for symmetric
and control modes, and is also secure for client/server mode but
relatively wasteful of server resources.
After the keys have been exchanged, the participants then use them to The "NTS Extensions for NTPv4" are a collection of NTP extension
protect the authenticity and the integrity of subsequent unicast-type fields for cryptographically securing NTPv4 using prevoiously-
time synchronization packets. In order to do this, participants established key material. They are suitable for securing client/
attach AEAD objects to their time synchronization packets, included server mode because the server can implement them without
in NTP extension fields and calculated over the whole time retaining per-client state, but on the other hand are suitable
synchronization packet. Therefore, the client can perform a validity *only* for client/server mode because only the client, and not the
check on reception of a time synchronization packet. server, is protected from replay.
4.2. Symmetric/Peer Mode and Control Modes The "NTS Key Establishment" protocol (NTS-KE) is mechanism for
establishing key material for use with the NTS extensions for
NTPv4. It uses TLS to exchange keys and negotiate some additional
protocol options, but then quickly closes the TLS channel and
permits the server to discard all associated state. NTS-KE is not
NTP-specific; it is designed to be extensible, and might be
extended to support key establishment for other protocols such as
PTP.
The symmetric ("peer") mode as well as the control modes, are secured It is intended that NTP implementations will use DTLS-encapsulated
via the DTLS-encapsulated NTPv4 protocol described in Section 5.2. NTPv4 to secure symmetric mode and control mode, and use NTS-KE
This protocol is little more than "NTP over DTLS"; the two endpoints followed by NTS Extensions for NTPv4 to secure client/server mode.
perform a DTLS handshake and then exchange NTP packets encapsulated NTS does not support NTP's broadcast mode.
as DTLS Application Data.
5. Employing (D)TLS for NTP Security As previously stated, DTLS-encapsulated NTPv4 is trivial. The
communicating parties establish a DTLS session and then exchange
arbitrary NTP packets as DTLS Application Data.
Since (as discussed in Section 4.1) no single approach can The typical protocol flow for client/server mode is as follows. The
simultaneously satisfy the needs of all modes, this specification client connects to the server on the NTS TCP port and the two parties
consists of not one protocol but a suite of them: perform a TLS handshake. Via the TLS channel, the parties negotiate
some additional protocol parameters and the server sends the client a
supply of cookies. The parties use TLS key export [RFC5705] to
extract key material which will be used in the next phase of the
protocol. This negotiation takes only a single round trip, after
which the server closes the connection and discards all associated
state. At this point the NTS-KE phase of the protocol is complete.
o The "NTS-encapsulated NTPv4" protocol is little more than "NTP Time synchronization proceeds over the NTP UDP port. The client
over DTLS": the two endpoints perform a DTLS handshake and then sends the server an NTP client packet which includes several
exchange NTP packets encapsulated as DTLS Application Data. It is extension fields. Included among these fields are a cookie
suitable for symmetric and control modes, and is also secure for (previously provided by the server), and an authentication tag,
client/server mode but relatively wasteful of server resources. computed using key material extracted from the NTS-KE handshake. The
server uses the cookie to recover this key material (previously
discarded to avoid maintaining state) and send back an authenticated
response. The response includes a fresh, encrypted cookie which the
client then sends back in the clear with its next request. (This
constant refreshing of cookies is necessary in order to achieve NTS's
unlinkability goal.)
o The "NTS Key Establishment" protocol (NTS-KE) uses TLS to 2. Requirements Language
establish key material and negotiate some additional protocol
options, but then quickly closes the DTLS channel and does not use
it for the exchange of time packets. NTS-KE is designed to be
extensible, and might be extended to support key establishment for
other protocols such as PTP.
o The "NTS extensions for NTPv4" are a collection of NTP extension The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
fields for cryptographically securing NTPv4 using key material "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
previously negotiated using NTS-KE. They are suitable for document are to be interpreted as described in RFC 2119 [RFC2119].
securing client/server mode because the server can implement them
without retaining per-client state, but on the other hand are
suitable *only* for client/server mode because only the client,
and not the server, is protected from replay.
5.1. TLS profile for Network Time Security 3. TLS profile for Network Time Security
Network Time Security makes use of both TLS (for NTS Key Network Time Security makes use of both TLS (for NTS Key
Establishment) and DTLS (for DTLS-encapsulated NTPv4). In either Establishment) and DTLS (for NTS-encapsulated NTPv4). In either
case, the requirements and recommendations of this section are case, the requirements and recommendations of this section are
similar. The notation "(D)TLS" refers to both TLS and DTLS. similar. The notation "(D)TLS" refers to both TLS and DTLS.
Since securing time protocols is (as of 2017) a novel application of Since securing time protocols is (as of 2017) a novel application of
(D)TLS, no backward-compatibility concerns exist to justify using (D)TLS, no backward-compatibility concerns exist to justify using
obsolete, insecure, or otherwise broken TLS features or versions. We obsolete, insecure, or otherwise broken TLS features or versions. We
therefore put forward the following requirements and guidelines, therefore put forward the following requirements and guidelines,
roughly representing 2017's best practices. roughly representing 2017's best practices.
Implementations MUST NOT negotiate (D)TLS versions earlier than 1.2. Implementations MUST NOT negotiate (D)TLS versions earlier than 1.2.
Implementations willing to negotiate more than one possible version Implementations willing to negotiate more than one possible version
of (D)TLS SHOULD NOT respond to handshake failures by retrying with a of (D)TLS SHOULD NOT respond to handshake failures by retrying with a
downgraded protocol version. If they do, they MUST implement downgraded protocol version. If they do, they MUST implement
[RFC7507]. [RFC7507].
(D)TLS clients MUST NOT offer, and DTLS servers MUST not select, RC4 (D)TLS clients MUST NOT offer, and (D)TLS servers MUST not select,
cipher suites. [RFC7465] RC4 cipher suites. [RFC7465]
(D)TLS clients SHOULD offer, and (D)TLS servers SHOULD accept, the (D)TLS clients SHOULD offer, and (D)TLS servers SHOULD accept, the
TLS Renegotiation Indication Extension [RFC5746]. Regardless, they TLS Renegotiation Indication Extension [RFC5746]. Regardless, they
MUST NOT initiate or permit insecure renegotiation. (*) MUST NOT initiate or permit insecure renegotiation. (*)
(D)TLS clients SHOULD offer, and (D)TLS servers SHOULD accept, the (D)TLS clients SHOULD offer, and (D)TLS servers SHOULD accept, the
TLS Session Hash and Extended Master Secret Extension [RFC7627]. (*) TLS Session Hash and Extended Master Secret Extension [RFC7627]. (*)
Use of the Application-Layer Protocol Negotation Extension [RFC7301] Use of the Application-Layer Protocol Negotation Extension [RFC7301]
is integral to NTS and support for it is REQUIRED for is integral to NTS and support for it is REQUIRED for
interoperability. interoperability.
(*): Note that (D)TLS 1.3 or beyond may render the indicated (*): Note that (D)TLS 1.3 or beyond may render the indicated
recommendations inapplicable. recommendations inapplicable.
5.2. The NTS-encapsulated NTPv4 protocol 4. The NTS-encapsulated NTPv4 protocol
The NTS-encapsulated NTPv4 protocol proceeds in two parts. The two The NTS-encapsulated NTPv4 protocol proceeds in two parts. The two
endpoints carry out a DTLS handshake in conformance with Section 5.1, endpoints carry out a DTLS handshake in conformance with Section 3,
with the client offering (via an ALPN [RFC7301] extension), and the with the client offering (via an ALPN [RFC7301] extension), and the
server accepting, an application-layer protocol of "ntp/4". Second, server accepting, an application-layer protocol of "ntp/4". Second,
once the handshake is successfully completed, the two endpoints use once the handshake is successfully completed, the two endpoints use
the established channel to exchange arbitrary NTPv4 packets as DTLS- the established channel to exchange arbitrary NTPv4 packets as DTLS-
protected Application Data. protected Application Data.
In addition to the requirements specified in Section 5.1, In addition to the requirements specified in Section 3,
implementations MUST enforce the anti-replay mechanism specified in implementations MUST enforce the anti-replay mechanism specified in
Section 4.1.2.6 of RFC 6347 [RFC6347] (or an equivalent mechanism Section 4.1.2.6 of RFC 6347 [RFC6347] (or an equivalent mechanism
specified in a subsequent revision of DTLS). Servers wishing to specified in a subsequent revision of DTLS). Servers wishing to
enforce access control SHOULD either demand a client certificate or enforce access control SHOULD either demand a client certificate or
use a PSK-based handshake in order to establish the client's use a PSK-based handshake in order to establish the client's
identity. identity.
The NTS-encapsulated NTPv4 protocol is the RECOMMENDED mechanism for The NTS-encapsulated NTPv4 protocol is the RECOMMENDED mechanism for
cryptographically securing mode 1 (symmetric active), 2 (symmetric cryptographically securing mode 1 (symmetric active), 2 (symmetric
passive), and 6 (control) NTPv4 traffic. It is equally safe for mode passive), and 6 (control) NTPv4 traffic. It is equally safe for mode
3/4 (client/server) traffic, but is NOT RECOMMENDED for this purpose 3/4 (client/server) traffic, but is NOT RECOMMENDED for this purpose
because it scales poorly compared to using NTS Extensions for NTPv4 because it scales poorly compared to using NTS Extensions for NTPv4
(Section 5.4). (Section 6).
5.3. The NTS Key Establishment protocol Since DTLS-encapsulated NTPv4 sessions may carry arbitrary NTP
packets, there is no prescribed implication from an implementation's
role as a DTLS client vs. DTLS server, to its role in the
application-level Network Time Protocol. For example, it is entirely
permissible for an implementation to initiate a DTLS handshake (thus
acting in the role of DTLS client), and then once the handshake is
completed, act as an NTP server with the DTLS server acting as an NTP
client. The following guidelines are offered as sensible default
behavior. Implementations may depart from this guidance if the user
configures them to do so.
The NTS key establishment protocol is conducted via TCP port [TBD]. Implementations typically should not use DTLS-encapsulated NTPv4 for
The two endpoints carry out a TLS handshake in conformance with client/server mode, instead preferring to use NTS-KE and NTS
Section 5.1, with the client offering (via an ALPN [RFC7301] Extensions for NTPv4. If DTLS-encapsulated NTPv4 is used for client/
server mode, then the NTP client (mode 3) should be the DTLS client
and the NTP server (mode 4) should be the DTLS server.
For control mode (6), the party sending queries should be the DTLS
client and the party responding to the queries should be the DTLS
server.
For symmetric operation between an active (mode 1) and passive (mode
2) peer, the active peer should be the DTLS client and the passive
peer should be the DTLS server.
For symmetric operation between two active (mode 1) peers, both
parties should attempt to initiate a DTLS session with their peer.
If one handshake fails and the other succeeds, the successfully-
established session should be used for traffic in both directions.
If both handshakes succeed, either session may be used and packets
should receive identical dispositon regardless of which of the two
sessions they arrived over. Inactive sessions may be timed out but
the redundant session should not be proactively closed.
If, likely as a result of user error, party A is configured as a
symmetry active peer of party B, but party B is neither accepting
DTLS handshakes from party A nor initiating one with it, then after a
suitable number of failed attempts, party A may fall back to acting
as an NTP client (mode 3) of party B using NTS-KE and NTS Extensions
for NTPv4.
5. The NTS Key Establishment protocol
The NTS key establishment protocol is conducted via TCP port
[[TBD1]]. The two endpoints carry out a TLS handshake in conformance
with Section 3, with the client offering (via an ALPN [RFC7301]
extension), and the server accepting, an application-layer protocol extension), and the server accepting, an application-layer protocol
of "ntske/1". Immediately following a successful handshake, the of "ntske/1". Immediately following a successful handshake, the
client SHALL send a single request (as Application Data encapsulated client SHALL send a single request (as Application Data encapsulated
in the TLS-protected channel), then the server SHALL send a single in the TLS-protected channel), then the server SHALL send a single
response followed by a TLS "Close notify" alert and then discard the response followed by a TLS "Close notify" alert and then discard the
channel state. channel state.
The client's request and the server's response each SHALL consist of The client's request and the server's response each SHALL consist of
a sequence of records formatted according to Figure 1. The sequence a sequence of records formatted according to Figure 1. The sequence
SHALL be terminated by a "End of Message" record, which has a Record SHALL be terminated by a "End of Message" record, which has a Record
skipping to change at page 8, line 21 skipping to change at page 8, line 38
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
. . . .
. Record Body . . Record Body .
. . . .
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1 Figure 1
[[Ed. Note: this ad-hoc binary format should be fine as long as we
continue to keep things very simple. However, if we think there's
any reasonable probability of wanting to include more complex data
structures, we should consider using some semi-structured data format
such as JSON, Protocol Buffers, or (ugh) ASN.1]]
The requirement that all NTS-KE messages be terminated by an End of The requirement that all NTS-KE messages be terminated by an End of
Message record makes them self-delimiting. Message record makes them self-delimiting.
The fields of an NTS-KE record are defined as follows: The fields of an NTS-KE record are defined as follows:
C (Critical Bit): Determines the disposition of unrecognized C (Critical Bit): Determines the disposition of unrecognized
Record Types. Implementations which receive a record with an Record Types. Implementations which receive a record with an
unrecognized Record Type MUST ignore the record if the Critical unrecognized Record Type MUST ignore the record if the Critical
Bit is 0, and MUST treat it as an error if the Critical Bit is 1. Bit is 0, and MUST treat it as an error if the Critical Bit is 1.
skipping to change at page 9, line 5 skipping to change at page 9, line 12
additional type numbers SHALL be tracked through the IANA Network additional type numbers SHALL be tracked through the IANA Network
Time Security Key Establishment Record Types registry. Time Security Key Establishment Record Types registry.
Body Length: the length of the Record Body field, in octets, as a Body Length: the length of the Record Body field, in octets, as a
16-bit integer in network byte order. Record bodies may have any 16-bit integer in network byte order. Record bodies may have any
representable length and need not be aligned to a word boundary. representable length and need not be aligned to a word boundary.
Record Body: the syntax and semantics of this field shall be Record Body: the syntax and semantics of this field shall be
determined by the Record Type. determined by the Record Type.
5.3.1. NTS-KE record types 5.1. NTS-KE record types
The following NTS-KE Record Types are defined. The following NTS-KE Record Types are defined.
5.3.1.1. End of Message 5.1.1. End of Message
The End of Message record has a Record Type number of 0 and an zero- The End of Message record has a Record Type number of 0 and an zero-
length body. It MUST occur exactly once as the final record of every length body. It MUST occur exactly once as the final record of every
NTS-KE request and response. The Critical Bit MUST be set. NTS-KE request and response. The Critical Bit MUST be set.
5.3.1.2. NTS Next Protocol Negotiation 5.1.2. NTS Next Protocol Negotiation
The NTS Next Protocol Negotiation record has a record type of 1. It The NTS Next Protocol Negotiation record has a record type of 1. It
MUST occur exactly once in every NTS-KE request and response. Its MUST occur exactly once in every NTS-KE request and response. Its
body consists of a sequence of 16-octet strings. Each 16-octet body consists of a sequence of 16-bit unsigned integers in network
string represents a Protocol Name from the IANA Network Time Security byte order. Each integer represents a Protocol ID from the IANA
Next Protocols registry. The Critical Bit MUST be set. Network Time Security Next Protocols registry. The Critical Bit MUST
be set.
The Protocol Names listed in the client's NTS Next Protocol The Protocol IDs listed in the client's NTS Next Protocol Negotiation
Negotiation record denote those protocols which the client wishes to record denote those protocols which the client wishes to speak using
speak using the key material established through this NTS-KE session. the key material established through this NTS-KE session. The
The Protocol Names listed in the server's response MUST comprise a Protocol IDs listed in the server's response MUST comprise a subset
subset of those listed in the request, and denote those protocols of those listed in the request, and denote those protocols which the
which the server is willing and able to speak using the key material server is willing and able to speak using the key material
established through this NTS-KE session. The client MAY proceed with established through this NTS-KE session. The client MAY proceed with
one or more of them. The request MUST list at least one protocol, one or more of them. The request MUST list at least one protocol,
but the response MAY be empty. but the response MAY be empty.
5.3.1.3. Error 5.1.3. Error
The Error record has a Record Type number of 2. Its body is exactly The Error record has a Record Type number of 2. Its body is exactly
two octets long, consisting of an unsigned 16-bit integer in network two octets long, consisting of an unsigned 16-bit integer in network
byte order, denoting an error code. The Critical Bit MUST be set. byte order, denoting an error code. The Critical Bit MUST be set.
Clients MUST NOT include Error records in their request. If clients Clients MUST NOT include Error records in their request. If clients
receive a server response which includes an Error record, they MUST receive a server response which includes an Error record, they MUST
discard any negotiated key material and MUST NOT proceed to the Next discard any negotiated key material and MUST NOT proceed to the Next
Protocol. Protocol.
skipping to change at page 10, line 10 skipping to change at page 10, line 16
MUST respond with this error code if the request included a record MUST respond with this error code if the request included a record
which the server did not understand and which had its Critical Bit which the server did not understand and which had its Critical Bit
set. The client SHOULD NOT retry its request without set. The client SHOULD NOT retry its request without
modification. modification.
Error code 1 means "Bad Request". The server MUST respond with Error code 1 means "Bad Request". The server MUST respond with
this error if, upon the expiration of an implementation-defined this error if, upon the expiration of an implementation-defined
timeout, it has not yet received a complete and syntactically timeout, it has not yet received a complete and syntactically
well-formed request from the client. This error is likely to be well-formed request from the client. This error is likely to be
the result of a dropped packet, so the client SHOULD start over the result of a dropped packet, so the client SHOULD start over
with a new DTLS handshake and retry its request. with a new TLS handshake and retry its request.
5.3.1.4. Warning 5.1.4. Warning
The Warning record has a Record Type number of 3. Its body is The Warning record has a Record Type number of 3. Its body is
exactly two octets long, consisting of an unsigned 16-bit integer in exactly two octets long, consisting of an unsigned 16-bit integer in
network byte order, denoting a warning code. The Critical Bit MUST network byte order, denoting a warning code. The Critical Bit MUST
be set. be set.
Clients MUST NOT include Warning records in their request. If Clients MUST NOT include Warning records in their request. If
clients receive a server response which includes an Warning record, clients receive a server response which includes an Warning record,
they MAY discard any negotiated key material and abort without they MAY discard any negotiated key material and abort without
proceeding to the Next Protocol. Unrecognized warning codes MUST be proceeding to the Next Protocol. Unrecognized warning codes MUST be
treated as errors. treated as errors.
This memo defines no warning codes. This memo defines no warning codes.
5.3.1.5. AEAD Algorithm Negotiation 5.1.5. AEAD Algorithm Negotiation
The AEAD Algorithm Negotiation record has a Record Type number of 4. The AEAD Algorithm Negotiation record has a Record Type number of 4.
Its body consists of a sequence of unsigned 16-bit integers in Its body consists of a sequence of unsigned 16-bit integers in
network byte order, denoting Numeric Identifiers from the IANA AEAD network byte order, denoting Numeric Identifiers from the IANA AEAD
registry [RFC5116]. The Critical Bit MAY be set. registry [RFC5116]. The Critical Bit MAY be set.
If the NTS Next Protocol Negotiation record offers "ntp/4",this If the NTS Next Protocol Negotiation record offers "ntp/4",this
record MUST be included exactly once. Other protocols MAY require it record MUST be included exactly once. Other protocols MAY require it
as well. as well.
When included in a request, this record denotes which AEAD algorithms When included in a request, this record denotes which AEAD algorithms
the client is willing to use to secure the Next Protocol, in the client is willing to use to secure the Next Protocol, in
decreasing preference order. When included in a response, this decreasing preference order. When included in a response, this
record denotes which algorithm the server chooses to use, or is empty record denotes which algorithm the server chooses to use, or is empty
if the server supports none of the algorithms offered.. In requests, if the server supports none of the algorithms offered. In requests,
the list MUST include at least one algorithm. In responses, it MUST the list MUST include at least one algorithm. In responses, it MUST
include at most one. Honoring the client's preference order is include at most one. Honoring the client's preference order is
OPTIONAL: servers may select among any of the client's offered OPTIONAL: servers may select among any of the client's offered
choices, even if they are able to support some other algorithm which choices, even if they are able to support some other algorithm which
the client prefers more. the client prefers more.
Server implementations of NTS extensions for NTPv4 (Section 5.4) MUST Server implementations of NTS extensions for NTPv4 (Section 6) MUST
support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15).
That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD
Algorithm Negotiation record, and the server accepts the "ntp/4" Algorithm Negotiation record, and the server accepts the "ntp/4"
protocol in its NTS Next Protocol Negotiation record, then the protocol in its NTS Next Protocol Negotiation record, then the
server's AEAD Algorithm Negotation record MUST NOT be empty. server's AEAD Algorithm Negotation record MUST NOT be empty.
5.3.1.6. New Cookie for NTPv4 5.1.6. New Cookie for NTPv4
The New Cookie for NTPv4 record has a Record Type number of 5. The The New Cookie for NTPv4 record has a Record Type number of 5. The
contents of its body SHALL be implementation-defined and clients MUST contents of its body SHALL be implementation-defined and clients MUST
NOT attempt to interpret them. See [[TODO]] for a RECOMMENDED NOT attempt to interpret them. See Section 7 for a RECOMMENDED
construction. construction.
Clients MUST NOT send records of this type. Servers MUST send at Clients MUST NOT send records of this type. Servers MUST send at
least one record of this type, and SHOULD send eight of them, if they least one record of this type, and SHOULD send eight of them, if they
accept "ntp/4" as a Next Protocol. The Critical Bit SHOULD NOT be accept "ntp/4" as a Next Protocol. The Critical Bit SHOULD NOT be
set. set.
[[Ed. Note: the purpose of sending eight cookies is to allow the 5.2. Key Extraction (generally)
client to recover from dropped packets without reusing cookies or
starting a new handshake. Discussion of cookie management should
probably be broken out into its own section.]]
5.3.2. Key Extraction (generally)
Following a successful run of the NTS-KE protocol, key material SHALL Following a successful run of the NTS-KE protocol, key material SHALL
be extracted according to RFC 5705 [RFC5705]. Inputs to the exporter be extracted according to RFC 5705 [RFC5705]. Inputs to the exporter
function are to be constructed in a manner specific to the negotiated function are to be constructed in a manner specific to the negotiated
Next Protocol. However, all protocols which utilize NTS-KE MUST Next Protocol. However, all protocols which utilize NTS-KE MUST
conform to the following two rules: conform to the following two rules:
The disambiguating label string MUST be "EXPORTER-network-time- The disambiguating label string MUST be "EXPORTER-network-time-
security/1". security/1".
The per-association context value MUST be provided, and MUST begin The per-association context value MUST be provided, and MUST begin
with the 16-octet Protocol Name which was negotiated as a Next with the two-octet Protocol ID which was negotiated as a Next
Protocol. Protocol.
5.4. NTS Extensions for NTPv4 6. NTS Extensions for NTPv4
5.4.1. Key Extraction (for NTPv4) 6.1. Key Extraction (for NTPv4)
Following a successful run of the NTS-KE protocol wherein "ntp/4" is Following a successful run of the NTS-KE protocol wherein "ntp/4" is
selected as a Next Protocol, two AEAD keys SHALL be extracted: a selected as a Next Protocol, two AEAD keys SHALL be extracted: a
client-to-server (C2S) key and a server-to-client (S2C) key. These client-to-server (C2S) key and a server-to-client (S2C) key. These
keys SHALL be computed according to RFC 5705 [RFC5705], using the keys SHALL be computed according to RFC 5705 [RFC5705], using the
following inputs. following inputs.
The disambiguating label string SHALL be "EXPORTER-network-time- The disambiguating label string SHALL be "EXPORTER-network-time-
security/1". security/1".
The per-association context value SHALL consist of the following The per-association context value SHALL consist of the following
19 octets: five octets:
The first 16 octets SHALL be (in hexadecimal):
6E 74 70 2F 34 00 00 00 00 00 00 00 00 00 00 00 The first two octets SHALL be zero.
The next two octets SHALL be the Numeric Identifier of the The next two octets SHALL be the Numeric Identifier of the
negotiated AEAD Algorithm, in network byte order. negotiated AEAD Algorithm, in network byte order.
The final octet SHALL be 0x00 for the C2S key and 0x01 for the The final octet SHALL be 0x00 for the C2S key and 0x01 for the
S2C key. S2C key.
Implementations wishing to derive additional keys for private or Implementations wishing to derive additional keys for private or
experimental use MUST NOT do so by extending the above-specified experimental use MUST NOT do so by extending the above-specified
syntax for per-association context values. Instead, they SHOULD use syntax for per-association context values. Instead, they SHOULD use
their own disambiguating label string. Note that RFC 5705 provides their own disambiguating label string. Note that RFC 5705 provides
that disambiguating label strings beginning with "EXPERIMENTAL" MAY that disambiguating label strings beginning with "EXPERIMENTAL" MAY
be used without IANA registration. be used without IANA registration.
5.4.2. Packet structure overview 6.2. Packet structure overview
In general, an NTS-protected NTPv4 packet consists of: In general, an NTS-protected NTPv4 packet consists of:
The usual 48-octet NTP header, which is authenticated but not The usual 48-octet NTP header, which is authenticated but not
encrypted. encrypted.
Some extensions which are authenticated but not encrypted. Some extensions which are authenticated but not encrypted.
An NTS extension which contains AEAD output (i.e., an An NTS extension which contains AEAD output (i.e., an
authentication tag and possible ciphertext). The corresponding authentication tag and possible ciphertext). The corresponding
plaintext, if non-empty, consists of some extensions which benefit plaintext, if non-empty, consists of some extensions which benefit
from both encryption and authentication. from both encryption and authentication.
Possibly, some additional extensions which are neither encrypted Possibly, some additional extensions which are neither encrypted
nor authenticated. These are discarded by the receiver. [[Ed. nor authenticated. These are discarded by the receiver.
Note: right now there's no good reason for the sender to include
anything here, but eventually there might be. We've seen Checksum
Complement [RFC7821] and LAST-EF as two examples of semantically-
void extensions that are included to satsify constraints imposed
lower on the protocol stack, and while there's no reason to use
either of these on NTS-protected packets, I think we could see
similar examples in the future. So, rejecting packets with
unauthenticated extensions could cause interoperability problems,
while accepting and processing those extensions would of course be
a security risk. Thus, I think "allow and discard" is the correct
policy.]]
Always included among the authenticated or authenticated-and- Always included among the authenticated or authenticated-and-
encrypted extensions are a cookie extension and a unique-identifier encrypted extensions are a cookie extension and a unique-identifier
extension. The purpose of the cookie extension is to enable the extension. The purpose of the cookie extension is to enable the
server to offload storage of session state onto the client. The server to offload storage of session state onto the client. The
purpose of the unique-identifier extension is to protect the client purpose of the unique-identifier extension is to protect the client
from replay attacks. from replay attacks.
5.4.3. The Unique Identifier extension 6.3. The Unique Identifier extension
The Unique Identifier extension has a Field Type of [[TBD]]. When The Unique Identifier extension has a Field Type of [[TBD2]]. When
the extension is included in a client packet (mode 3), its body SHALL the extension is included in a client packet (mode 3), its body SHALL
consist of a string of octets generated uniformly at random. The consist of a string of octets generated uniformly at random. The
string SHOULD be 32 octets long. When the extension is included in a string SHOULD be 32 octets long. When the extension is included in a
server packet (mode 4), its body SHALL contain the same octet string server packet (mode 4), its body SHALL contain the same octet string
as was provided in the client packet to which the server is as was provided in the client packet to which the server is
responding. Its use in modes other than client/server is not responding. Its use in modes other than client/server is not
defined. defined.
The Unique Identifier extension provides the client with a The Unique Identifier extension provides the client with a
cryptographically strong means of detecting replayed packets. It may cryptographically strong means of detecting replayed packets. It may
also be used standalone, without NTS, in which case it provides the also be used standalone, without NTS, in which case it provides the
client with a means of detecting spoofed packets from off-path client with a means of detecting spoofed packets from off-path
attackers. Historically, NTP's origin timestamp field has played attackers. Historically, NTP's origin timestamp field has played
both these roles, but for cryptographic purposes this is suboptimal both these roles, but for cryptographic purposes this is suboptimal
because it is only 64 bits long and, depending on implementation because it is only 64 bits long and, depending on implementation
details, most of those bits may be predictable. In contrast, the details, most of those bits may be predictable. In contrast, the
Unique Identifier extension enables a degree of unpredictability and Unique Identifier extension enables a degree of unpredictability and
collision-resistance more consistent with cryptographic best collision-resistance more consistent with cryptographic best
practice. practice.
[[TODO: consider using separate extension types for request and 6.4. The NTS Cookie extension
response, thus allowing for use in symmetric mode. But proper
handling in the presence of dropped packets needs to be documented
and involves a lot of subtlety.]]
5.4.4. The NTS Cookie extension
The NTS Cookie extension has a Field Type of [[TBD]]. Its purpose is The NTS Cookie extension has a Field Type of [[TBD3]]. Its purpose
to carry information which enables the server to recompute keys and is to carry information which enables the server to recompute keys
other session state without having to store any per-client state. and other session state without having to store any per-client state.
The contents of its body SHALL be implementation-defined and clients The contents of its body SHALL be implementation-defined and clients
MUST NOT attempt to interpret them. See [[TODO]] for a RECOMMENDED MUST NOT attempt to interpret them. See Section 7 for a RECOMMENDED
construction. The NTS Cookie extension MUST NOT be included in NTP construction. The NTS Cookie extension MUST NOT be included in NTP
packets whose mode is other than 3 (client) or 4 (server). packets whose mode is other than 3 (client) or 4 (server).
5.4.5. The NTS Cookie Placeholder extension 6.5. The NTS Cookie Placeholder extension
The NTS Cookie Placeholder extension has a Field Type of [[TBD]]. The NTS Cookie Placeholder extension has a Field Type of [[TBD4]].
When this extension is included in a client packet (mode 3), it When this extension is included in a client packet (mode 3), it
communicates to the server that the client wishes it to send communicates to the server that the client wishes it to send
additional cookies in its response. This extension MUST NOT be additional cookies in its response. This extension MUST NOT be
included in NTP packets whose mode is other than 3. included in NTP packets whose mode is other than 3.
Whenever an NTS Cookie Placeholder extension is present, it MUST be Whenever an NTS Cookie Placeholder extension is present, it MUST be
accompanied by an NTS Cookie extension, and the body length of the accompanied by an NTS Cookie extension, and the body length of the
NTS Cookie Placeholder extension MUST be the same as the body length NTS Cookie Placeholder extension MUST be the same as the body length
of the NTS Cookie Extension. (This length requirement serves to of the NTS Cookie Extension. (This length requirement serves to
ensure that the response will not be larger than the request, in ensure that the response will not be larger than the request, in
order to improve timekeeping precision and prevent DDoS order to improve timekeeping precision and prevent DDoS
amplification). The contents of the NTS Cookie Placeholder amplification). The contents of the NTS Cookie Placeholder
extension's body are undefined and, aside from checking its length, extension's body are undefined and, aside from checking its length,
MUST be ignored by the server. MUST be ignored by the server.
5.4.6. The NTS Authenticator and Encrypted Extensions extension 6.6. The NTS Authenticator and Encrypted Extensions extension
The NTS Authenticator and Encrypted Extensions extension is the The NTS Authenticator and Encrypted Extensions extension is the
central cryptographic element of an NTS-protected NTP packet. Its central cryptographic element of an NTS-protected NTP packet. Its
Field Type is [[TBD]] and the format of its body SHALL be as follows: Field Type is [[TBD5]] and the format of its body SHALL be as
follows:
Nonce length: two octets in network byte order, giving the length Nonce length: two octets in network byte order, giving the length
of the Nonce field. of the Nonce field.
Nonce: a nonce as required by the negotiated AEAD Algorithm. Nonce: a nonce as required by the negotiated AEAD Algorithm.
Ciphertext: the output of the negotiated AEAD Algorithm. The Ciphertext: the output of the negotiated AEAD Algorithm. The
structure of this field is determined by the negotiated algorithm, structure of this field is determined by the negotiated algorithm,
but it typically contains an authentication tag in addition to the but it typically contains an authentication tag in addition to the
actual ciphertext. actual ciphertext.
skipping to change at page 15, line 24 skipping to change at page 15, line 9
P: The plaintext SHALL consist of all (if any) extensions to be P: The plaintext SHALL consist of all (if any) extensions to be
encrypted. encrypted.
N: The nonce SHALL be formed however required by the negotiated N: The nonce SHALL be formed however required by the negotiated
AEAD Algorithm. AEAD Algorithm.
The NTS Authenticator and Encrypted Extensions extension MUST NOT be The NTS Authenticator and Encrypted Extensions extension MUST NOT be
included in NTP packets whose mode is other than 3 (client) or 4 included in NTP packets whose mode is other than 3 (client) or 4
(server). (server).
5.4.7. Protocol details 6.7. Protocol details
A client sending an NTS-protected request SHALL include the following A client sending an NTS-protected request SHALL include the following
extensions: extensions:
Exactly one Unique Identifier extension, which MUST be Exactly one Unique Identifier extension, which MUST be
authenticated and MUST NOT be encrypted [[Ed. Note: so that if authenticated, MUST NOT be encrypted, and whose contents MUST NOT
the server can't decrypt the request, it can still echo back the duplicate those of any previous request.
Unique Identifier in the NTS NAK it sends]]. MUST NOT duplicate
those of any previous request.
Exactly one NTS Cookie extension, which MUST be authenticated and Exactly one NTS Cookie extension, which MUST be authenticated and
MUST NOT be encrypted. The cookie MUST be one which the server MUST NOT be encrypted. The cookie MUST be one which the server
previously provided the client; it may have been provided during previously provided the client; it may have been provided during
the NTS-KE handshake or in response to a previous NTS-protected the NTS-KE handshake or in response to a previous NTS-protected
NTP request. To protect client's privacy, the same cookie SHOULD NTP request. To protect client's privacy, the same cookie SHOULD
NOT be included in multiple requests. If the client does not have NOT be included in multiple requests. If the client does not have
any cookies that it has not already sent, it SHOULD re-run the any cookies that it has not already sent, it SHOULD re-run the
NTS-KE protocol before continuing. NTS-KE protocol before continuing.
skipping to change at page 17, line 8 skipping to change at page 16, line 39
packet as though they were not present. Clients MAY implement packet as though they were not present. Clients MAY implement
exceptions to this requirement for particular extensions if their exceptions to this requirement for particular extensions if their
specification explicitly provides for such. specification explicitly provides for such.
If the server is unable to validate the cookie or authenticate the If the server is unable to validate the cookie or authenticate the
request, it SHOULD respond with a Kiss-o'-Death packet (see RFC 5905, request, it SHOULD respond with a Kiss-o'-Death packet (see RFC 5905,
Section 7.4) [RFC5905]) with kiss code "NTSN" (meaning "NTS NAK"). Section 7.4) [RFC5905]) with kiss code "NTSN" (meaning "NTS NAK").
Such a response MUST include exactly one Unique Identifier extension Such a response MUST include exactly one Unique Identifier extension
whose contents SHALL echo those provided by the client. It MUST NOT whose contents SHALL echo those provided by the client. It MUST NOT
include any NTS Cookie or NTS Authenticator and Encrypted Extensions include any NTS Cookie or NTS Authenticator and Encrypted Extensions
extension. [[Ed. Note: RFC 5905 already provides the kiss code extension.
"CRYP" meaning "Cryptographic authentication or identification
failed" but I think this is meant to be Autokey-specific.]]
Upon receiving an NTS-protected response, the client MUST verify that Upon receiving an NTS-protected response, the client MUST verify that
the Unique Identifier matches that of an outstanding request, and the Unique Identifier matches that of an outstanding request, and
that the packet is authentic under the S2C key associated with that that the packet is authentic under the S2C key associated with that
request. If either of these checks fails, the packet MUST be request. If either of these checks fails, the packet MUST be
discarded without further processing. discarded without further processing.
Upon receiving an NTS NAK, the client MUST verify that the Unique Upon receiving an NTS NAK, the client MUST verify that the Unique
Identifier matches that of an outstanding request. If this check Identifier matches that of an outstanding request. If this check
fails, the packet MUST be discarded without further processing. If fails, the packet MUST be discarded without further processing. If
this check passes, the client SHOULD discard all cookies and AEAD this check passes, the client SHOULD wait until the next poll for a
keys associated with the server which sent the NAK and initiate a valid NTS-protected response and if none is received, discard all
fresh NTS-KE handshake. cookies and AEAD keys associated with the server which sent the NAK
and initiate a fresh NTS-KE handshake.
5.5. Recommended format for NTS cookies 7. Recommended format for NTS cookies
This section provides a RECOMMENDED way for servers to construct NTS This section provides a RECOMMENDED way for servers to construct NTS
cookies. Clients MUST NOT examine the cookie under the assumption cookies. Clients MUST NOT examine the cookie under the assumption
that it is constructed according to this section. that it is constructed according to this section.
The role of cookies in NTS is closely analagous to that of session The role of cookies in NTS is closely analagous to that of session
cookies in TLS. Accordingly, the thematic resemblance of this cookies in TLS. Accordingly, the thematic resemblance of this
section to RFC 5077 [RFC5077] is deliberate, and the reader should section to RFC 5077 [RFC5077] is deliberate, and the reader should
likewise take heed of its security considerations. likewise take heed of its security considerations.
skipping to change at page 18, line 9 skipping to change at page 17, line 39
servers should securely erase any keys generated two or more rotation servers should securely erase any keys generated two or more rotation
periods prior. Servers should continue to accept any cookie periods prior. Servers should continue to accept any cookie
generated using keys that they have not yet erased, even if those generated using keys that they have not yet erased, even if those
keys are no longer current. Erasing old keys provides for forward keys are no longer current. Erasing old keys provides for forward
secrecy, limiting the scope of what old information can be stolen if secrecy, limiting the scope of what old information can be stolen if
a master key is somehow compromised. Holding on to a limited number a master key is somehow compromised. Holding on to a limited number
of old keys allows clients to seamlessly transition from one of old keys allows clients to seamlessly transition from one
generation to the next without having to perform a new NTS-KE generation to the next without having to perform a new NTS-KE
handshake. handshake.
[[TODO: discuss key management considerations for load-balanced The need to keep keys synchronized across load-balanced clusters can
servers]] make automatic key rotation challenging. However, the task can be
accomplished without the need for central key-management
infrastructure by using a ratchet, i.e., making each new key a
deterministic, cryptographically pseudo-random function of its
predecessor. A recommended concrete implementation of this approach
is to use HKDF [RFC5869] to derive new keys, using the key's
predecessor as Input Keying Material and its key identifier as a
salt.
To form a cookie, servers should first form a plaintext `P` To form a cookie, servers should first form a plaintext `P`
consisting of the following fields: consisting of the following fields:
The AEAD algorithm negotiated during NTS-KE The AEAD algorithm negotiated during NTS-KE
The S2C key The S2C key
The C2S key The C2S key
Servers should the generate a nonce `N` uniformly at random, and form Servers should the generate a nonce `N` uniformly at random, and form
AEAD output `C` by encrypting `P` under key `K` with nonce `N` and no AEAD output `C` by encrypting `P` under key `K` with nonce `N` and no
associated data. associated data.
The cookie should consist of the tuple `(I,N,C)`. The cookie should consist of the tuple `(I,N,C)`.
[[TODO: explicitly specify how to verify and decrypt a cookie, not To verify and decrypt a cookie provided by the client, first parse it
just how to form one]] into its components `I`, `N`, and `C`. Use `I` to look up its
decryption key `K`. If the key whose identifier is `I` has been
erased or never existed, decryption fails; reply with an NTS NAK.
Otherwise, attempt to decrypt and verify ciphertext `C` using key `K`
and nonce `N` with no associated data. If decryption or verification
fails, reply with an NTS NAK. Otherwise, parse out the contents of
the resulting plaintext `P` to obtain the negotiated AEAD algorithm,
S2C key, and C2S key.
6. IANA Considerations 8. IANA Considerations
IANA is requested to allocate an entry in the Service Name and IANA is requested to allocate two entries, identical except for the
Transport Protocol Port Number Registry as follows: Transport Protocol, in the Service Name and Transport Protocol Port
Number Registry as follows:
Service Name: nts Service Name: nts
Transport Protocol: udp Transport Protocol: tcp, udp
Assignee: IESG <iesg@ietf.org> Assignee: IESG <iesg@ietf.org>
Contact: IETF Chair <chair@ietf.org> Contact: IETF Chair <chair@ietf.org>
Description: Network Time Security Description: Network Time Security
Reference: [[this memo]] Reference: [[this memo]]
Port Number: selected by IANA from the user port range Port Number: [[TBD1]], selected by IANA from the user port range
IANA is requested to allocate the following two entries in the IANA is requested to allocate the following two entries in the
Application-Layer Protocol Negotation (ALPN) Protocol IDs registry: Application-Layer Protocol Negotation (ALPN) Protocol IDs registry:
Protocol: Network Time Security Key Establishment, version 1 Protocol: Network Time Security Key Establishment, version 1
Identification Sequence: Identification Sequence:
0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1")
Reference: [[this memo]] Reference: [[this memo]]
Protocol: Network Time Protocol, version 4 Protocol: Network Time Protocol, version 4
Identification Sequence: Identification Sequence:
0x6E 0x74 0x70 0x2F 0x34 ("ntp/4") 0x6E 0x74 0x70 0x2F 0x34 ("ntp/4")
Reference: [[this memo]] Reference: [[this memo]]
skipping to change at page 19, line 28 skipping to change at page 19, line 25
IANA is requested to allocate the following entry in the TLS Exporter IANA is requested to allocate the following entry in the TLS Exporter
Label Registry: Label Registry:
+----------------------------------+---------+---------------+------+ +----------------------------------+---------+---------------+------+
| Value | DTLS-OK | Reference | Note | | Value | DTLS-OK | Reference | Note |
+----------------------------------+---------+---------------+------+ +----------------------------------+---------+---------------+------+
| EXPORTER-network-time-security/1 | Y | [[this memo]] | | | EXPORTER-network-time-security/1 | Y | [[this memo]] | |
+----------------------------------+---------+---------------+------+ +----------------------------------+---------+---------------+------+
IANA is requested to allocate the following entries in the registry IANA is requested to allocate the following entry in the registry of
of NTP Kiss-o'-Death codes: NTP Kiss-o'-Death codes:
+------+------------------------------+ +------+---------+
| Code | Meaning | | Code | Meaning |
+------+------------------------------+ +------+---------+
| DTLS | Packet conveys a DTLS record | | NTSN | NTS NAK |
| NTSN | NTS NAK | +------+---------+
+------+------------------------------+
IANA is requested to allocate the following entries in the NTP IANA is requested to allocate the following entries in the NTP
Extensions Field Types registry: Extensions Field Types registry:
+------------+---------------------------------------+--------------+ +------------+---------------------------------------+--------------+
| Field Type | Meaning | Reference | | Field Type | Meaning | Reference |
+------------+---------------------------------------+--------------+ +------------+---------------------------------------+--------------+
| [[TBD]] | DTLS Record | [[this | | [[TBD2]] | Unique Identifier | [[this |
| | | memo]] |
| [[TBD]] | Unique Identifier | [[this |
| | | memo]] | | | | memo]] |
| [[TBD]] | NTS Cookie | [[this | | [[TBD3]] | NTS Cookie | [[this |
| | | memo]] | | | | memo]] |
| [[TBD]] | NTS Cookie Placeholder | [[this | | [[TBD4]] | NTS Cookie Placeholder | [[this |
| | | memo]] | | | | memo]] |
| [[TBD]] | NTS Authenticator and Encrypted | [[this | | [[TBD5]] | NTS Authenticator and Encrypted | [[this |
| | Extensions | memo]] | | | Extensions | memo]] |
+------------+---------------------------------------+--------------+ +------------+---------------------------------------+--------------+
IANA is requested to create a new registry entitled "Network Time IANA is requested to create a new registry entitled "Network Time
Security Key Establishment Record Types". Entries SHALL have the Security Key Establishment Record Types". Entries SHALL have the
following fields: following fields:
Type Number (REQUIRED): An integer in the range 0-32767 inclusive Type Number (REQUIRED): An integer in the range 0-32767 inclusive
Description (REQUIRED): short text description of the purpose of Description (REQUIRED): short text description of the purpose of
skipping to change at page 20, line 38 skipping to change at page 20, line 19
Set Critical Bit (REQUIRED): One of "MUST", "SHOULD", "MAY", Set Critical Bit (REQUIRED): One of "MUST", "SHOULD", "MAY",
"SHOULD NOT", or "MUST NOT" "SHOULD NOT", or "MUST NOT"
Reference (REQUIRED): A reference to a document specifying the Reference (REQUIRED): A reference to a document specifying the
semantics of the record. semantics of the record.
The policy for allocation of new entries in this registry SHALL vary The policy for allocation of new entries in this registry SHALL vary
by the Type Number, as follows: by the Type Number, as follows:
0-1023: Standards Action 0-1023: IETF Review
1024-16383: Specification Required 1024-16383: Specification Required
16384-32767: Private and Experimental Use 16384-32767: Private and Experimental Use
Applications for new entries SHALL specify the contents of the Applications for new entries SHALL specify the contents of the
Description, Set Critical Bit and Reference fields and which of the Description, Set Critical Bit and Reference fields and which of the
above ranges the Type Number should be allocated from. Applicants above ranges the Type Number should be allocated from. Applicants
MAY request a specific Type Number, and such requests MAY be granted MAY request a specific Type Number, and such requests MAY be granted
at the registrar's discretion. at the registrar's discretion.
skipping to change at page 21, line 17 skipping to change at page 20, line 45
| Number | | | | | Number | | | |
+-------------+-----------------------------+----------+------------+ +-------------+-----------------------------+----------+------------+
| 0 | End of message | MUST | [[this | | 0 | End of message | MUST | [[this |
| | | | memo]] | | | | | memo]] |
| 1 | NTS next protocol | MUST | [[this | | 1 | NTS next protocol | MUST | [[this |
| | negotiation | | memo]] | | | negotiation | | memo]] |
| 2 | Error | MUST | [[this | | 2 | Error | MUST | [[this |
| | | | memo]] | | | | | memo]] |
| 3 | Warning | MUST | [[this | | 3 | Warning | MUST | [[this |
| | | | memo]] | | | | | memo]] |
| 4 | AEAD algorithm negotation | MAY | [[this | | 4 | AEAD algorithm negotiation | MAY | [[this |
| | | | memo]] | | | | | memo]] |
| 5 | New cookie for NTPv4 | SHOULD | [[this | | 5 | New cookie for NTPv4 | SHOULD | [[this |
| | | NOT | memo]] | | | | NOT | memo]] |
| 16384-32767 | Reserved for Private & | MAY | [[this | | 16384-32767 | Reserved for Private & | MAY | [[this |
| | Experimental Use | | memo]] | | | Experimental Use | | memo]] |
+-------------+-----------------------------+----------+------------+ +-------------+-----------------------------+----------+------------+
IANA is requested to create a new registry entitled "Network Time IANA is requested to create a new registry entitled "Network Time
Security Next Protocols". Entries SHALL have the following fields: Security Next Protocols". Entries SHALL have the following fields:
Protocol Name (REQUIRED): a sequence of 16 octets. Shorter Protocol ID (REQUIRED): a 16-bit unsigned integer functioning as
sequences SHALL implicitly be right-padded with null octets an identifier.
(0x00).
Human-Readable Name (OPTIONAL): if the sequence of octets making Protocol Name (REQUIRED): a short text string naming the protocol
up the protocol name intentionally represent a valid UTF-8 being identified.
[RFC3629] string, this field SHALL consist of that string.
Reference (RECOMMENDED): a reference to a relevant specification Reference (RECOMMENDED): a reference to a relevant specification
document. If no relevant document exists, a point-of-contact for document. If no relevant document exists, a point-of-contact for
questions regarding the entry SHOULD be listed here in lieu. questions regarding the entry SHOULD be listed here in lieu.
Applications for new entries in this registry SHALL specify all Applications for new entries in this registry SHALL specify all
desired fields, and SHALL be granted on a First Come, First Serve desired fields, and SHALL be granted upon approval by a Designated
basis. Protocol Names beginning with 0x78 0x2D ("x-") SHALL be Expert. Protocol IDs 32768-65535 SHALL be reserved for Private or
reserved for Private or Experimental Use, and SHALL NOT be Experimental Use, and SHALL NOT be registered.
registered. The reserved entry "ptp/2" may be updated or released by
a future Standards Action.
The initial contents of this registry SHALL be as follows: The initial contents of this registry SHALL be as follows:
+---------------------------+-----------------+---------------------+ +-------------+-------------------------------+---------------------+
| Protocol Name | Human-Readable | Reference | | Protocol | Human-Readable Name | Reference |
| | Name | | | Name | | |
+---------------------------+-----------------+---------------------+ +-------------+-------------------------------+---------------------+
| 0x6E 0x74 0x70 0x2F 0x34 | ntp/4 | [[this memo]] | | 0 | Network Time Protocol version | [[this memo]] |
| 0x70 0x74 0x70 0x2F 0x32 | ptp/2 | Reserved by [[this | | | 4 | |
| | | memo]] | | 1 | Precision Time Protocol | Reserved by [[this |
+---------------------------+-----------------+---------------------+ | | version 2 | memo]] |
| 32768-65535 | Reserved for Private or | Reserved by [[this |
| | Experimental Use | memo]] |
+-------------+-------------------------------+---------------------+
IANA is requested to create two new registries entitled "Network Time IANA is requested to create two new registries entitled "Network Time
Security Error Codes" and "Network Time Security Warning Codes". Security Error Codes" and "Network Time Security Warning Codes".
Entries in each SHALL have the following fields: Entries in each SHALL have the following fields:
Number (REQUIRED): a 16-bit unsigned integer Number (REQUIRED): a 16-bit unsigned integer
Description (REQUIRED): a short text description of the condition. Description (REQUIRED): a short text description of the condition.
Reference (REQUIRED): a reference to a relevant specification Reference (REQUIRED): a reference to a relevant specification
document. document.
The policy for allocation of new entries in these registries SHALL The policy for allocation of new entries in these registries SHALL
vary by their Number, as follows: vary by their Number, as follows:
0-1023: Standards Action 0-1023: IETF Review
1024-32767: Specification Required 1024-32767: Specification Required
32768-65535: Private and Experimental Use 32768-65535: Private and Experimental Use
The initial contents of the Network Time Security Error Codes The initial contents of the Network Time Security Error Codes
Registry SHALL be as follows: Registry SHALL be as follows:
+--------+---------------------------------+---------------+ +--------+---------------------------------+---------------+
| Number | Description | Reference | | Number | Description | Reference |
+--------+---------------------------------+---------------+ +--------+---------------------------------+---------------+
| 0 | Unrecognized Critical Extension | [[this memo]] | | 0 | Unrecognized Critical Extension | [[this memo]] |
| 1 | Bad Request | [[this memo]] | | 1 | Bad Request | [[this memo]] |
+--------+---------------------------------+---------------+ +--------+---------------------------------+---------------+
The Network Time Security Warning Codes Registry SHALL initially be The Network Time Security Warning Codes Registry SHALL initially be
empty. empty.
7. Security Considerations 9. Security considerations
All security considerations described in
[I-D.ietf-ntp-network-time-security] have to be taken into account.
The application of NTS to NTP requires the following additional
considerations.
7.1. Random Number Generation 9.1. Avoiding DDoS amplification
At various points of the protocol, the generation of random numbers Certain non-standard and/or deprecated features of the Network Time
is required. The employed methods of generation need to be Protocol enable clients to send a request to a server which causes
cryptographically secure. See [RFC4086] for guidelines concerning the server to send a response much larger than the request. Servers
this topic. which enable these features can be abused in order to amplify traffic
volume in distributed denial-of-service (DDoS) attacks by sending
them a request with a spoofed source IP. In recent years, attacks of
this nature have become an endemic nuisance.
7.2. Usage of NTP Pools NTS is designed to avoid contributing any further to this problem by
ensuring that NTS-related extensions included in server responses
will be the same size as the NTS-related extensions sent by the
client. In particular, this is why the client is required to send a
separate and appropriately padded-out NTS Cookie Placeholder
extension for every cookie it wants to get back, rather than being
permitted simply to specify a desired quantity.
The certification-based authentication scheme described in 9.2. Initial verification of server certificates
[I-D.ietf-ntp-network-time-security] is not applicable to the concept
of NTP pools. Therefore, NTS is unable to provide secure usage of
NTP pools.
7.3. Initial Verification of the Server Certificates NTS's security goals are undermined if the client fails to verify
that the X.509 certificate chain presented by the server is valid and
rooted in a trusted certificate authority. [RFC5280] and [RFC6125]
specifies how such verification is to be performed in general.
However, the expectation that the client does not yet have a
correctly-set system clock at the time of certificate verification
presents difficulties with verifying that the certificate is within
its validity period, i.e., that the current time lies between the
times specified in the certificate's notBefore and notAfter fields,
and it may be operationally necessary in some cases for a client to
accept a certificate which appears to be expired or not yet valid.
While there is no perfect solution to this problem, there are several
mitigations the client can implement to make it more difficult for an
adversary to successfully present an expired certificate:
The client may wish to verify the validity of certificates during the Check whether the system time is in fact unreliable. If the
initial association phase. Since it generally has no reliable time system clock has previously been synchronized since last boot,
during this initial communication phase, it is impossible to verify then on operating systems which implement a kernel-based phase-
the period of validity of the certificates. locked-loop API, a call to ntp_gettime() should show a maximum
error less than NTP_PHASE_MAX. In this case, the clock should be
considered reliable and certificates can be strictly validated.
7.4. Treatment of Initial Messages Allow the system administrator to specify that certificates should
*always* be strictly validated. Such a configuration is
appropriate on systems which have a battery-backed clock and which
can reasonably prompt the user to manually set an approximately-
correct time if it appears to be needed.
NTP packets which contains extension fields with key exchange Once the clock has been synchronized, periodically write the
messages do not provide integrity and authenticity protection of the current system time to persistent storage. Do not accept any
included time stamps. Therefore these NTP packets MUST NOT be used certificate whose notAfter field is earlier than the last recorded
for clock synchronization. Otherwise an initial attack on the time.
client's clock [attacking-ntp] can potentially circumvent the
employed security measures of later messages [delorean].
7.5. DTLS-Related Issues Do not process time packets from servers if the time computed from
them falls outside the validity period of the server's
certificate.
... TBD Use multiple time sources. The ability to pass off an expired
certificate is only useful to an adversary who has compromised the
corresponding private key. If the adversary has compromised only
a minority of servers, NTP's selection algorithm ([RFC5905]
section 11.2.1) will protect the client from accepting bad time
from the adversary-controlled servers.
7.6. Delay Attack 9.3. Usage of NTP pools
In a packet delay attack, an adversary with the ability to act as a Additional standardization work and infrastructure development is
MITM delays time synchronization packets between client and server necessary before NTS can be used with public NTP server pools.
asymmetrically [RFC7384]. This prevents the client from accurately First, a scheme needs to be specified for determining what
measuring the network delay, and hence its time offset to the server constitutes an acceptable certificate for a pool server, such as
[Mizrahi]. The delay attack does not modify the content of the establishing a value required to be contained in its Extended Key
exchanged synchronization packets. Therefore, cryptographic means do Usage attribute, and how to determine, given the DNS name of a pool,
not provide a feasible way to mitigate this attack. However, the what Subject Alternative Name to expect in the certificates of its
maximum error that an adversary can introduced is bounded by half of members. A more important matter, however, is that pool operators
the round trip delay. Also, several non-cryptographic precautions need procedures for establishing and maintaining trust in their
can be taken in order to detect this attack. members. Pools in existence as of 2017 are volunteer-run, with
minimal requirements for admission and no organized effort to monitor
pool servers for misbehavior. Without any sort of policing in place,
there is nothing to prevent an adversary from going through normal
channels to obtain a valid certificate for participation in a pool
and then proceeding to serve maliciously inaccurate time.
1. Usage of multiple time servers: this enables the client to detect 9.4. Delay attacks
the attack, provided that the adversary is unable to delay the
synchronization packets between the majority of servers. This
approach is commonly used in NTP to exclude incorrect time
servers [RFC5905].
2. Multiple communication paths: The client and server utilize In a packet delay attack, an adversary with the ability to act as a
different paths for packet exchange. The client can detect the man-in-the-middle delays time synchronization packets between client
attack, provided that the adversary is unable to manipulate the and server asymmetrically [RFC7384]. Since NTP's formula for
majority of the available paths [Shpiner]. Note that this computing time offset relies on the assumption that network latency
approach is not yet available, neither for NTP nor for PTP. is roughly symmetrical, this leads to the client to compute an
inaccurate value [Mizrahi]. The delay attack does not reorder or
modify the content of the exchanged synchronization packets.
Therefore, cryptographic means do not provide a feasible way to
mitigate this attack. However, the maximum error that an adversary
can introduce is bounded by half of the round trip delay.
3. Usage of an encrypted connection: the client exchanges all [RFC5905] specifies a parameter called MAXDIST which denotes the
packets with the time server over an encrypted connection (e.g. maximum round-trip latency (including not only the immediate round
IPsec). This measure does not mitigate the delay attack, but it trip between client and server but the whole distance back to the
makes it more difficult for the adversary to identify the time reference clock as reported in the Root Delay filed) that a client
synchronization packets. will tolerate before concluding that the server is unsuitable for
synchronization. The standard value for MAXDIST is one second,
although some implementations use larger values. Whatever value a
client chooses, the maximum error which can be introduced by a delay
attack is MAXDIST/2.
4. Introduction of a threshold value for the delay time of the Usage of multiple time sources, or multiple network paths to a given
synchronization packets. The client can discard a time server if time source [Shpiner], may also serve to mitigate delay attacks if
the packet delay time of this time server is larger than the the adversary is in control of only some of the paths.
threshold value.
8. Privacy Considerations 9.5. Random number generation
8.1. Confidentiality At various points in NTS, the generation of cryptographically secure
random numbers is required. See [RFC4086] for guidelines concerning
this topic.
The actual time synchronization data in NTP packets does not involve 10. Privacy Considerations
any information that needs to be kept secret. There also does not
seem to be any necessity to disguise the nature of an NTP
association. This is why content confidentiality is a non-objective
for this document.
8.2. Unlinkability 10.1. Unlinkability
Unlinkability prevents a device from being tracked when it changes Unlinkability prevents a device from being tracked when it changes
network addresses (e.g. because said device moved between different network addresses (e.g. because said device moved between different
networks). In other words, unlinkability thwarts an attacker that networks). In other words, unlinkability thwarts an attacker that
seeks to link a new network address used by a device with a network seeks to link a new network address used by a device with a network
address that it was formerly using, because of recognizable data that address that it was formerly using, because of recognizable data that
the device persistently sends as part of an NTS-secured NTP the device persistently sends as part of an NTS-secured NTP
association. This is the justification for continually supplying the association. This is the justification for continually supplying the
client with fresh cookies, so that a cookie never represents client with fresh cookies, so that a cookie never represents
recognizable data in the sense outlined above. recognizable data in the sense outlined above.
NTS's unlinkability objective is merely to not leak any additional NTS's unlinkability objective is merely to not leak any additional
data that could be used to link a device's network address. NTS does data that could be used to link a device's network address. NTS does
not rectify legacy linkability issues that are already present in not rectify legacy linkability issues that are already present in
NTP. Thus, a client that requires unlinkability MUST also minimize NTP. Thus, a client that requires unlinkability MUST also minimize
information transmitted in a client query (mode 3) packet as information transmitted in a client query (mode 3) packet as
described in the draft [I-D.dfranke-ntp-data-minimization]. described in the draft [I-D.ietf-ntp-data-minimization].
The unlinkability objective only holds for time synchronization The unlinkability objective only holds for time synchronization
traffic, as opposed to key exchange traffic. This implies that it traffic, as opposed to key exchange traffic. This implies that it
cannot be guaranteed for devices that function not only as time cannot be guaranteed for devices that function not only as time
clients, but also as time servers (because the latter can be clients, but also as time servers (because the latter can be
externally triggered to send authentication data). externally triggered to send authentication data).
It should also be noted that it could be possible to link devices It should also be noted that it could be possible to link devices
that operate as time servers from their time synchronization traffic, that operate as time servers from their time synchronization traffic,
using information exposed in (mode 4) server response packets (e.g. using information exposed in (mode 4) server response packets (e.g.
reference ID, reference time, stratum, poll). Also, devices that reference ID, reference time, stratum, poll). Also, devices that
respond to NTP control queries could be linked using the information respond to NTP control queries could be linked using the information
revealed by control queries. revealed by control queries.
9. Acknowledgements 10.2. Confidentiality
NTS does not protect the confidentiality of information in NTP's
header fields. When clients implement
[I-D.ietf-ntp-data-minimization], client packet headers do not
contain any information which the client could conceivably wish to
keep secret: one field is random, and all others are fixed.
Information in server packet headers is likewise public: the origin
timestamp is copied from the client's (random) transmit timestamp,
and all other fields are set the same regardless of the identity of
the client making the request.
Future extension fields could hypothetically contain sensitive
information, in which case NTS provides a mechanism for encrypting
them.
11. Acknowledgements
The authors would like to thank Richard Barnes, Steven Bellovin, The authors would like to thank Richard Barnes, Steven Bellovin,
Sharon Goldberg, Russ Housley, Martin Langer, Miroslav Lichvar, Sharon Goldberg, Russ Housley, Martin Langer, Miroslav Lichvar,
Aanchal Malhotra, Dave Mills, Danny Mayer, Karen O'Donoghue, Eric K. Aanchal Malhotra, Dave Mills, Danny Mayer, Karen O'Donoghue, Eric K.
Rescorla, Stephen Roettger, Kurt Roeckx, Kyle Rose, Rich Salz, Brian Rescorla, Stephen Roettger, Kurt Roeckx, Kyle Rose, Rich Salz, Brian
Sniffen, Susan Sons, Douglas Stebila, Harlan Stenn, Martin Thomson, Sniffen, Susan Sons, Douglas Stebila, Harlan Stenn, Martin Thomson,
and Richard Welty for contributions to this document. on the design and Richard Welty for contributions to this document. on the design
of NTS. of NTS.
10. References 12. References
10.1. Normative References 12.1. Normative References
[I-D.dfranke-ntp-data-minimization] [I-D.ietf-ntp-data-minimization]
Franke, D. and A. Malhotra, "NTP Client Data Franke, D. and A. Malhotra, "NTP Client Data
Minimization", draft-dfranke-ntp-data-minimization-01 Minimization", draft-ietf-ntp-data-minimization-00 (work
(work in progress), October 2016. in progress), May 2017.
[I-D.ietf-ntp-extension-field]
Mizrahi, T. and D. Mayer, "The Network Time Protocol
Version 4 (NTPv4) Extension Fields", draft-ietf-ntp-
extension-field-07 (work in progress), February 2016.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[RFC3394] Schaad, J. and R. Housley, "Advanced Encryption Standard
(AES) Key Wrap Algorithm", RFC 3394, DOI 10.17487/RFC3394,
September 2002, <http://www.rfc-editor.org/info/rfc3394>.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <http://www.rfc-editor.org/info/rfc3629>.
[RFC4082] Perrig, A., Song, D., Canetti, R., Tygar, J., and B.
Briscoe, "Timed Efficient Stream Loss-Tolerant
Authentication (TESLA): Multicast Source Authentication
Transform Introduction", RFC 4082, DOI 10.17487/RFC4082,
June 2005, <http://www.rfc-editor.org/info/rfc4082>.
[RFC4634] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms
(SHA and HMAC-SHA)", RFC 4634, DOI 10.17487/RFC4634, July
2006, <http://www.rfc-editor.org/info/rfc4634>.
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated
Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008,
<http://www.rfc-editor.org/info/rfc5116>. <http://www.rfc-editor.org/info/rfc5116>.
[RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV)
Authenticated Encryption Using the Advanced Encryption Authenticated Encryption Using the Advanced Encryption
Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October
2008, <http://www.rfc-editor.org/info/rfc5297>. 2008, <http://www.rfc-editor.org/info/rfc5297>.
[RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,
RFC 5652, DOI 10.17487/RFC5652, September 2009,
<http://www.rfc-editor.org/info/rfc5652>.
[RFC5705] Rescorla, E., "Keying Material Exporters for Transport [RFC5705] Rescorla, E., "Keying Material Exporters for Transport
Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705,
March 2010, <http://www.rfc-editor.org/info/rfc5705>. March 2010, <http://www.rfc-editor.org/info/rfc5705>.
[RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, [RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov,
"Transport Layer Security (TLS) Renegotiation Indication "Transport Layer Security (TLS) Renegotiation Indication
Extension", RFC 5746, DOI 10.17487/RFC5746, February 2010, Extension", RFC 5746, DOI 10.17487/RFC5746, February 2010,
<http://www.rfc-editor.org/info/rfc5746>. <http://www.rfc-editor.org/info/rfc5746>.
[RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch,
"Network Time Protocol Version 4: Protocol and Algorithms "Network Time Protocol Version 4: Protocol and Algorithms
Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010,
<http://www.rfc-editor.org/info/rfc5905>. <http://www.rfc-editor.org/info/rfc5905>.
[RFC6125] Saint-Andre, P. and J. Hodges, "Representation and
Verification of Domain-Based Application Service Identity
within Internet Public Key Infrastructure Using X.509
(PKIX) Certificates in the Context of Transport Layer
Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March
2011, <http://www.rfc-editor.org/info/rfc6125>.
[RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer
Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347, Security Version 1.2", RFC 6347, DOI 10.17487/RFC6347,
January 2012, <http://www.rfc-editor.org/info/rfc6347>. January 2012, <http://www.rfc-editor.org/info/rfc6347>.
[RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan,
"Transport Layer Security (TLS) Application-Layer Protocol "Transport Layer Security (TLS) Application-Layer Protocol
Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301,
July 2014, <http://www.rfc-editor.org/info/rfc7301>. July 2014, <http://www.rfc-editor.org/info/rfc7301>.
[RFC7465] Popov, A., "Prohibiting RC4 Cipher Suites", RFC 7465, [RFC7465] Popov, A., "Prohibiting RC4 Cipher Suites", RFC 7465,
skipping to change at page 27, line 29 skipping to change at page 27, line 33
[RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A.,
Langley, A., and M. Ray, "Transport Layer Security (TLS) Langley, A., and M. Ray, "Transport Layer Security (TLS)
Session Hash and Extended Master Secret Extension", Session Hash and Extended Master Secret Extension",
RFC 7627, DOI 10.17487/RFC7627, September 2015, RFC 7627, DOI 10.17487/RFC7627, September 2015,
<http://www.rfc-editor.org/info/rfc7627>. <http://www.rfc-editor.org/info/rfc7627>.
[RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4
(NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822,
March 2016, <http://www.rfc-editor.org/info/rfc7822>. March 2016, <http://www.rfc-editor.org/info/rfc7822>.
10.2. Informative References 12.2. Informative References
[attacking-ntp]
"Attacking the Network Time Protocol", October 2015.
[delorean]
"Bypassing HTTP Strict Transport Security", 2014.
[I-D.ietf-ntp-network-time-security]
Sibold, D., Roettger, S., and K. Teichel, "Network Time
Security", draft-ietf-ntp-network-time-security-15 (work
in progress), September 2016.
[IEC.61588_2009] [IEC.61588_2009]
IEEE/IEC, "Precision clock synchronization protocol for IEEE/IEC, "Precision clock synchronization protocol for
networked measurement and control systems", networked measurement and control systems",
IEEE 1588-2008(E), IEC 61588:2009(E), IEEE 1588-2008(E), IEC 61588:2009(E),
DOI 10.1109/IEEESTD.2009.4839002, February 2009, DOI 10.1109/IEEESTD.2009.4839002, February 2009,
<http://ieeexplore.ieee.org/servlet/ <http://ieeexplore.ieee.org/servlet/
opac?punumber=4839000>. opac?punumber=4839000>.
[Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks
skipping to change at page 28, line 20 skipping to change at page 28, line 10
[RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106, RFC 4086, "Randomness Requirements for Security", BCP 106, RFC 4086,
DOI 10.17487/RFC4086, June 2005, DOI 10.17487/RFC4086, June 2005,
<http://www.rfc-editor.org/info/rfc4086>. <http://www.rfc-editor.org/info/rfc4086>.
[RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig,
"Transport Layer Security (TLS) Session Resumption without "Transport Layer Security (TLS) Session Resumption without
Server-Side State", RFC 5077, DOI 10.17487/RFC5077, Server-Side State", RFC 5077, DOI 10.17487/RFC5077,
January 2008, <http://www.rfc-editor.org/info/rfc5077>. January 2008, <http://www.rfc-editor.org/info/rfc5077>.
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
Housley, R., and W. Polk, "Internet X.509 Public Key
Infrastructure Certificate and Certificate Revocation List
(CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
<http://www.rfc-editor.org/info/rfc5280>.
[RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand
Key Derivation Function (HKDF)", RFC 5869,
DOI 10.17487/RFC5869, May 2010,
<http://www.rfc-editor.org/info/rfc5869>.
[RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in
Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384,
October 2014, <http://www.rfc-editor.org/info/rfc7384>. October 2014, <http://www.rfc-editor.org/info/rfc7384>.
[RFC7821] Mizrahi, T., "UDP Checksum Complement in the Network Time
Protocol (NTP)", RFC 7821, DOI 10.17487/RFC7821, March
2016, <http://www.rfc-editor.org/info/rfc7821>.
[Shpiner] "Multi-path Time Protocols", in Proceedings of IEEE [Shpiner] "Multi-path Time Protocols", in Proceedings of IEEE
International Symposium on Precision Clock Synchronization International Symposium on Precision Clock Synchronization
for Measurement, Control and Communication (ISPCS), for Measurement, Control and Communication (ISPCS),
September 2013. September 2013.
Appendix A. Flow Diagrams of Client Behaviour Appendix A. Terms and Abbreviations
.------------.
+------------------------------>o<----------( No More Keys )<---+
| | '------------' |
| v |
| +-------------+ |
| |Key Exchange | |
| +------+------+ |
| | .--------------. |
| o<---------( Keys Remaining )<--+
| | '--------------' |
| 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 2: The client's behavior in NTS unicast mode. AEAD Authenticated Encryption with Associated Data [RFC5116]
Authors' Addresses DDoS Distributed Denial of Service
DTLS Datagram Transport Layer Security
NTP Network Time Protocol [RFC5905]
NTS Network Time Security
PTP Precision Time Protocol
TLS Transport Layer Security
Authors' Addresses
Daniel Fox Franke Daniel Fox Franke
Akamai Technologies, Inc. Akamai Technologies, Inc.
150 Broadway 150 Broadway
Cambridge, MA 02142 Cambridge, MA 02142
United States United States
Email: dafranke@akamai.com Email: dafranke@akamai.com
URI: https://www.dfranke.us URI: https://www.dfranke.us
Dieter Sibold Dieter Sibold
Physikalisch-Technische Bundesanstalt Physikalisch-Technische Bundesanstalt
Bundesallee 100 Bundesallee 100
Braunschweig D-38116 Braunschweig D-38116
Germany Germany
Phone: +49-(0)531-592-8420 Phone: +49-(0)531-592-8420
Fax: +49-531-592-698420 Fax: +49-531-592-698420
Email: dieter.sibold@ptb.de Email: dieter.sibold@ptb.de
 End of changes. 133 change blocks. 
457 lines changed or deleted 449 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/