draft-ietf-ntp-using-nts-for-ntp-12.txt   draft-ietf-ntp-using-nts-for-ntp-13.txt 
NTP Working Group D. Franke NTP Working Group D. Franke
Internet-Draft Internet-Draft
Intended status: Standards Track D. Sibold Intended status: Standards Track D. Sibold
Expires: January 2, 2019 K. Teichel Expires: March 3, 2019 K. Teichel
PTB PTB
July 01, 2018 M. Dansarie
R. Sundblad
Netnod
August 30, 2018
Network Time Security for the Network Time Protocol Network Time Security for the Network Time Protocol
draft-ietf-ntp-using-nts-for-ntp-12 draft-ietf-ntp-using-nts-for-ntp-13
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. client-server mode of the Network Time Protocol (NTP).
NTS is structured as a suite of two loosely coupled sub-protocols:
the NTS Key Establishment Protocol (NTS-KE) and NTS Extensions for
NTPv4. NTS-KE handles NTS service authentication, initial
handshaking, and key extraction over TLS. Encryption and
authentication during NTP time synchronization is performed through
NTS extension fields in otherwise standard NTP packets. Except for
during the initial NTS-KE process, all state required by the protocol
is held by the client in opaque cookies.
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 January 2, 2019. This Internet-Draft will expire on March 3, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
(https://trustee.ietf.org/license-info) in effect on the date of (https://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
1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Protocol overview . . . . . . . . . . . . . . . . . . . . 4 1.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 4
2. Requirements Language . . . . . . . . . . . . . . . . . . . . 5 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 6
3. TLS profile for Network Time Security . . . . . . . . . . . . 5 3. TLS profile for Network Time Security . . . . . . . . . . . . 7
4. The NTS Key Establishment protocol . . . . . . . . . . . . . 6 4. The NTS Key Establishment Protocol . . . . . . . . . . . . . 7
4.1. NTS-KE Record Types . . . . . . . . . . . . . . . . . . . 8 4.1. NTS-KE Record Types . . . . . . . . . . . . . . . . . . . 9
4.1.1. End of Message . . . . . . . . . . . . . . . . . . . 8 4.1.1. End of Message . . . . . . . . . . . . . . . . . . . 9
4.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 9 4.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 10
4.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 10 4.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 10 4.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 11
4.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 11 4.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 11
4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 11 4.1.7. NTPv4 Server Negotiation . . . . . . . . . . . . . . 12
5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 11 4.1.8. NTPv4 Port Negotiation . . . . . . . . . . . . . . . 12
5.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 11 4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 13
5.2. Packet structure overview . . . . . . . . . . . . . . . . 12 5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 13
5.3. The Unique Identifier extension field . . . . . . . . . . 12 5.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 13
5.4. The NTS Cookie extension field . . . . . . . . . . . . . 13 5.2. Packet Structure Overview . . . . . . . . . . . . . . . . 14
5.5. The NTS Cookie Placeholder extension field . . . . . . . 13 5.3. The Unique Identifier Extension Field . . . . . . . . . . 14
5.4. The NTS Cookie Extension Field . . . . . . . . . . . . . 15
5.5. The NTS Cookie Placeholder Extension Field . . . . . . . 15
5.6. The NTS Authenticator and Encrypted Extension Fields 5.6. The NTS Authenticator and Encrypted Extension Fields
extension field . . . . . . . . . . . . . . . . . . . . . 13 Extension Field . . . . . . . . . . . . . . . . . . . . . 15
6. Protocol details . . . . . . . . . . . . . . . . . . . . . . 15 5.7. Protocol Details . . . . . . . . . . . . . . . . . . . . 17
7. Suggested format for NTS cookies . . . . . . . . . . . . . . 18 6. Suggested Format for NTS Cookies . . . . . . . . . . . . . . 22
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23
9. Implementation Status . . . . . . . . . . . . . . . . . . . . 24 7.1. Service Name and Transport Protocol Port Number Registry 23
9.1. Implementation PoC 1 . . . . . . . . . . . . . . . . . . 24 7.2. TLS Application-Layer Protocol Negotiation (ALPN)
9.1.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 24 Protocol IDs Registry . . . . . . . . . . . . . . . . . . 24
9.1.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 24 7.3. TLS Exporter Labels Registry . . . . . . . . . . . . . . 24
9.1.3. Contact Information . . . . . . . . . . . . . . . . . 25 7.4. NTP Kiss-o'-Death Codes Registry . . . . . . . . . . . . 24
9.1.4. Last Update . . . . . . . . . . . . . . . . . . . . . 25 7.5. NTP Extension Field Types Registry . . . . . . . . . . . 24
9.2. Implementation PoC 2 . . . . . . . . . . . . . . . . . . 25 7.6. Network Time Security Key Establishment Record Types
9.2.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 25 Registry . . . . . . . . . . . . . . . . . . . . . . . . 25
9.2.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 25 7.7. Network Time Security Next Protocols Registry . . . . . . 26
9.2.3. Contact Information . . . . . . . . . . . . . . . . . 25 7.8. Network Time Security Error and Warning Codes Registries 27
9.2.4. Last Update . . . . . . . . . . . . . . . . . . . . . 25 8. Implementation Status . . . . . . . . . . . . . . . . . . . . 28
9.3. Interoperability . . . . . . . . . . . . . . . . . . . . 25 8.1. Implementation PoC 1 . . . . . . . . . . . . . . . . . . 28
10. Security considerations . . . . . . . . . . . . . . . . . . . 26 8.1.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 28
10.1. Avoiding DDoS amplification . . . . . . . . . . . . . . 26 8.1.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 29
10.2. Initial verification of server certificates . . . . . . 26 8.1.3. Contact Information . . . . . . . . . . . . . . . . . 29
10.3. Usage of NTP pools . . . . . . . . . . . . . . . . . . . 27 8.1.4. Last Update . . . . . . . . . . . . . . . . . . . . . 29
10.4. Delay attacks . . . . . . . . . . . . . . . . . . . . . 27 8.2. Implementation PoC 2 . . . . . . . . . . . . . . . . . . 29
10.5. Random number generation . . . . . . . . . . . . . . . . 28 8.2.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 29
8.2.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 29
11. Privacy Considerations . . . . . . . . . . . . . . . . . . . 28 8.2.3. Contact Information . . . . . . . . . . . . . . . . . 29
11.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 28 8.2.4. Last Update . . . . . . . . . . . . . . . . . . . . . 29
11.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 29 8.3. Interoperability . . . . . . . . . . . . . . . . . . . . 30
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 29 9. Security Considerations . . . . . . . . . . . . . . . . . . . 30
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 9.1. Sensitivity to DDoS attacks . . . . . . . . . . . . . . . 30
13.1. Normative References . . . . . . . . . . . . . . . . . . 29 9.2. Avoiding DDoS Amplification . . . . . . . . . . . . . . . 30
13.2. Informative References . . . . . . . . . . . . . . . . . 31 9.3. Initial Verification of Server Certificates . . . . . . . 31
Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 32 9.4. Delay Attacks . . . . . . . . . . . . . . . . . . . . . . 32
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 9.5. Random Number Generation . . . . . . . . . . . . . . . . 32
10. Privacy Considerations . . . . . . . . . . . . . . . . . . . 33
10.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 33
10.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 33
11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 34
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 34
12.1. Normative References . . . . . . . . . . . . . . . . . . 34
12.2. Informative References . . . . . . . . . . . . . . . . . 36
Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 37
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38
1. Introduction 1. Introduction
This memo specifies Network Time Security (NTS), a cryptographic This memo specifies Network Time Security (NTS), a cryptographic
security mechanism for network time synchronization. A complete security mechanism for network time synchronization. A complete
specification is provided for application of NTS to the client-server specification is provided for application of NTS to the client-server
mode of the Network Time Protocol (NTP) [RFC5905]. mode of the Network Time Protocol (NTP) [RFC5905].
1.1. Objectives 1.1. Objectives
The objectives of NTS are as follows: The objectives of NTS are as follows:
o Identity: Through the use of the X.509 PKI, implementations may o Identity: Through the use of the X.509 public key infrastructure,
cryptographically establish the identity of the parties they are implementations may cryptographically establish the identity of
communicating with. the parties they are communicating with.
o Authentication: Implementations may cryptographically verify that o Authentication: Implementations may cryptographically verify that
any time synchronization packets are authentic, i.e., that they any time synchronization packets are authentic, i.e., that they
were produced by an identified party and have not been modified in were produced by an identified party and have not been modified in
transit. transit.
o Confidentiality: Although basic time synchronization data is o Confidentiality: Although basic time synchronization data is
considered non-confidential and sent in the clear, NTS includes considered non-confidential and sent in the clear, NTS includes
support for encrypting NTP extension fields. support for encrypting NTP extension fields.
skipping to change at page 4, line 6 skipping to change at page 4, line 28
o Request-response consistency: Client implementations may verify o Request-response consistency: Client implementations may verify
that a time synchronization packet received from a server was sent that a time synchronization packet received from a server was sent
in response to a particular request from the client. in response to a particular request from the client.
o Unlinkability: For mobile clients, NTS will not leak any o Unlinkability: For mobile clients, NTS will not leak any
information additional to NTP which would permit a passive information additional to NTP which would permit a passive
adversary to determine that two packets sent over different adversary to determine that two packets sent over different
networks came from the same client. networks came from the same client.
o Non-amplification: Implementations (especially server o Non-amplification: Implementations (especially server
implementations) may avoid acting as DDoS amplifiers by never implementations) may avoid acting as distributed denial-of-service
responding to a request with a packet larger than the request (DDoS) amplifiers by never responding to a request with a packet
packet. larger than the request packet.
o Scalability: Server implementations may serve large numbers of o Scalability: Server implementations may serve large numbers of
clients without having to retain any client-specific state. clients without having to retain any client-specific state.
1.2. Protocol overview 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 partly contradictory requirements for modes have differing and partly contradictory requirements for
security and performance. Symmetric and control modes demand mutual security and performance. Symmetric and control modes demand mutual
authentication and mutual replay protection, and for certain message authentication and mutual replay protection. Additionally, for
types control mode may require confidentiality as well as certain message types control mode may require confidentiality as
authentication. Client-server mode places more stringent well as authentication. Client-server mode places more stringent
requirements on resource utilization than other modes, because requirements on resource utilization than other modes, because
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 stateless servers to process replayed protection: it is harmless for stateless servers to process replayed
packets. The security demands of symmetric and control modes, on the packets. The security demands of symmetric and control modes, on the
other hand, are in conflict with the resource-utilization demands of other 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 memo specifies NTS exclusively for the client-server mode of This memo specifies NTS exclusively for the client-server mode of
NTP. To this end, NTS is structured as a suite of two protocols: NTP. To this end, NTS is structured as a suite of two protocols:
The "NTS Extension Fields for NTPv4" are a collection of NTP The "NTS Extensions for NTPv4" define a collection of NTP
extension fields for cryptographically securing NTPv4 using extension fields for cryptographically securing NTPv4 using
previously-established key material. They are suitable for previously-established key material. They are suitable for
securing client-server mode because the server can implement them securing client-server mode because the server can implement them
without retaining per-client state, but on the other hand are without retaining per-client state. All state is kept by the
suitable *only* for client-server mode because only the client, client and provided to the server in the form of an encrypted
and not the server, is protected from replay. cookie supplied with each request. On the other hand, the NTS
Extension Fields are suitable *only* for client-server mode
because only the client, and not the server, is protected from
replay.
The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for
establishing key material for use with the NTS Extension Fields establishing key material for use with the NTS Extension Fields
for NTPv4. It uses TLS to exchange keys and negotiate some for NTPv4. It uses TLS to exchange keys, provide the client with
additional protocol options, but then quickly closes the TLS an initial supply of cookies, and negotiate some additional
channel and permits the server to discard all associated state. protocol options. After this exchange, the TLS channel is closed
with no per-client state remaining on the server side.
The typical protocol flow is as follows. The client connects to the The typical protocol flow is as follows: The client connects to an
server on the NTS TCP port and the two parties perform a TLS NTS-KE server on the NTS TCP port and the two parties perform a TLS
handshake. Via the TLS channel, the parties negotiate some handshake. Via the TLS channel, the parties negotiate some
additional protocol parameters and the server sends the client a additional protocol parameters and the server sends the client a
supply of cookies. The parties use TLS key export [RFC5705] to supply of cookies along with a list of one or more IP addresses to
extract key material which will be used in the next phase of the NTP servers for which the cookies are valid. The parties use TLS key
protocol. This negotiation takes only a single round trip, after export [RFC5705] to extract key material which will be used in the
which the server closes the connection and discards all associated next phase of the protocol. This negotiation takes only a single
state. At this point the NTS-KE phase of the protocol is complete. 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. Ideally, the client never needs to connect to the NTS-
KE server again.
Time synchronization proceeds over the NTP UDP port. The client Time synchronization proceeds with one of the indicated NTP servers
sends the server an NTP client packet which includes several over the NTP UDP port. The client sends the server an NTP client
extension fields. Included among these fields are a cookie packet which includes several extension fields. Included among these
(previously provided by the server), and an authentication tag, fields are a cookie (previously provided by the key exchange server)
computed using key material extracted from the NTS-KE handshake. The and an authentication tag, computed using key material extracted from
server uses the cookie to recover this key material (previously the NTS-KE handshake. The NTP server uses the cookie to recover this
discarded to avoid maintaining state) and sends back an authenticated key material and send back an authenticated response. The response
response. The response includes a fresh, encrypted cookie which the includes a fresh, encrypted cookie which the client then sends back
client then sends back in the clear with its next request. (This in the clear in a subsequent request. (This constant refreshing of
constant refreshing of cookies is necessary in order to achieve NTS's cookies is necessary in order to achieve NTS's unlinkability goal.)
unlinkability goal.)
Figure 1 provides an overview of the high-level interaction between
the client, the NTS-KE server, and the NTP server. Note that the
cookies' data format and the exchange of secrets between NTS-KE and
NTP servers are not part of this specification and are implementation
dependent. However, a suggested format for NTS cookies is provided
in Section 6.
+--------------+
| |
+-> | NTP Server 1 |
| | |
Shared cookie | +--------------+
+---------------+ encryption parameters | +--------------+
| | (Implementation dependent) | | |
| NTS-KE Server | <------------------------------+-> | NTP Server 2 |
| | | | |
+---------------+ | +--------------+
^ | .
| | .
| 1. Negotiate parameters, | .
| receive initial cookie | +--------------+
| supply, generate AEAD keys, | | |
| and receive NTP server IP +-> | NTP Server N |
| addresses using "NTS Key | |
| Establishment" protocol. +--------------+
| ^
| |
| +----------+ |
| | | |
+-----------> | Client | <-------------------------+
| | 2. Perform authenticated
+----------+ time synchronization
and generate new
cookies using "NTS
Extension Fields for
NTPv4".
Figure 1: Overview of High-Level Interactions in NTS
2. Requirements Language 2. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in RFC 2119 [RFC2119]. "OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
3. TLS profile for Network Time Security 3. TLS profile for Network Time Security
Network Time Security makes use of TLS for NTS key establishment. Network Time Security makes use of TLS for NTS key establishment.
Since securing time protocols is (as of 2017) a novel application of Since the NTS protocol is new as of this publication, no backward-
TLS, no backward-compatibility concerns exist to justify using compatibility concerns exist to justify using obsolete, insecure, or
obsolete, insecure, or otherwise broken TLS features or versions. We otherwise broken TLS features or versions. Implementations MUST
therefore put forward the following requirements and guidelines, conform with [RFC7525] or with a later revision of BCP 195.
roughly representing 2017's best practices. Furthermore:
Implementations MUST NOT negotiate TLS versions earlier than 1.2.
Implementations willing to negotiate more than one possible version
of TLS SHOULD NOT respond to handshake failures by retrying with a
downgraded protocol version. If they do, they MUST implement
[RFC7507].
TLS clients MUST NOT offer, and TLS servers MUST NOT select, RC4
cipher suites. [RFC7465]
TLS 1.2 clients SHOULD offer, and TLS servers SHOULD accept, the TLS
Renegotiation Indication Extension [RFC5746]. Regardless, they MUST
NOT initiate or permit insecure renegotiation.
TLS 1.2 clients SHOULD offer, and TLS 1.2 servers SHOULD accept, the Implementations MUST NOT negotiate TLS versions earlier than 1.2,
TLS Session Hash and Extended Master Secret Extension [RFC7627]. SHOULD negotiate TLS 1.3 [RFC8446] or later when possible, and MAY
refuse to negotiate any TLS version which has been superseded by a
later supported version.
Use of the Application-Layer Protocol Negotiation Extension [RFC7301] Use of the Application-Layer Protocol Negotiation 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.
4. The NTS Key Establishment protocol 4. The NTS Key Establishment Protocol
The NTS key establishment protocol is conducted via TCP port The NTS key establishment protocol is conducted via TCP port
[[TBD1]]. The two endpoints carry out a TLS handshake in conformance [[TBD1]]. The two endpoints carry out a TLS handshake in conformance
with Section 3, with the client offering (via an ALPN [RFC7301] 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 2. Requests and
SHALL be terminated by a "End of Message" record, which has a Record non-error responses each SHALL include exactly one NTS Next Protocol
Type of zero and a zero-length body. Furthermore, requests and non- Negotiation record. The sequence SHALL be terminated by a "End of
error responses each SHALL include exactly one NTS Next Protocol Message" record. The requirement that all NTS-KE messages be
Negotiation record. terminated by an End of Message record makes them self-delimiting.
Clients and servers MAY enforce length limits on requests and Clients and servers MAY enforce length limits on requests and
responses, however servers MUST accept requests of at least 1024 responses, however, servers MUST accept requests of at least 1024
octets, and clients SHOULD accept responses of at least 65536 octets. octets and clients SHOULD accept responses of at least 65536 octets.
0 1 2 3 0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|C| Record Type | Body Length | |C| Record Type | Body Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
. . . .
. Record Body . . Record Body .
. . . .
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1 Figure 2: NTS-KE Record Format
The requirement that all NTS-KE messages be terminated by an End of
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.
Record Type: A 15-bit integer in network byte order. The Record Type Number: A 15-bit integer in network byte order. The
semantics of record types 0-5 are specified in this memo; semantics of record types 0-6 are specified in this memo.
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.
For clarity regarding bit-endianness: the Critical Bit is the most- For clarity regarding bit-endianness: the Critical Bit is the most-
significant bit of the first octet. In C, given a network buffer significant bit of the first octet. In C, given a network buffer
`unsigned char b[]` containing an NTS-KE record, the critical bit is `unsigned char b[]` containing an NTS-KE record, the critical bit is
`b[0] >> 7` while the record type is `((b[0] & 0x7f) << 8) + b[1]`. `b[0] >> 7` while the record type is `((b[0] & 0x7f) << 8) + b[1]`.
Figure 2 provides a schematic overview of the key exchange. It Figure 3 provides a schematic overview of the key exchange. It
displays the protocol steps to be performed by the NTS client and displays the protocol steps to be performed by the NTS client and
server and record types to be exchanged. server and record types to be exchanged.
+---------------------------------------+ +---------------------------------------+
| - verify client request message | | - Verify client request message. |
| - extract TLS key material | | - Extract TLS key material. |
| - generate KE response message | | - Generate KE response message. |
| - included Record Types: | | - Include Record Types: |
| - NTS Next Protocol Negotiation | | o NTS Next Protocol Negotiation |
| - AEAD Alg. Negotiation | | o AEAD Algorithm Negotiation |
| - New Cookie for NTPv4 | | o NTP Server Negotiation |
| - <New Cookie for NTPv4> | | o New Cookie for NTPv4 |
| - End of Message | | o <New Cookie for NTPv4> |
| o End of Message |
+-----------------+---------------------+ +-----------------+---------------------+
| |
| |
Server -----------+---------------+-----+-----------------------> Server -----------+---------------+-----+----------------------->
^ \ ^ \
/ \ / \
/ TLS application \ / TLS application \
/ data \ / data \
/ \ / \
/ V / V
Client -----+---------------------------------+----------------> Client -----+---------------------------------+---------------->
| | | |
| | | |
| | | |
+-----------+----------------------+ +------+-----------------+ +-----------+----------------------+ +------+-----------------+
|- generate KE request message | |- verify server response| |- Generate KE request message. | |- Verify server response|
| - include Record Types: | | message | | - Include Record Types: | | message. |
| o NTS Next Protocol Negotiation | |- extract cookie(s) | | o NTS Next Protocol Negotiation | |- Extract cookie(s). |
| o AEAD Alg. Negotiation | | | | o AEAD Algorithm Negotiation | | |
| o <NTP Server Negotiation> | | |
| o End of Message | | | | o End of Message | | |
+----------------------------------+ +------------------------+ +----------------------------------+ +------------------------+
Figure 2: NTS Key Exchange messages Figure 3: NTS Key Exchange Messages
4.1. NTS-KE Record Types 4.1. NTS-KE Record Types
The following NTS-KE Record Types are defined. The following NTS-KE Record Types are defined:
4.1.1. End of Message 4.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 a 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.
4.1.2. NTS Next Protocol Negotiation 4.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 number of
MUST occur exactly once in every NTS-KE request and response. Its 1. It MUST occur exactly once in every NTS-KE request and response.
body consists of a sequence of 16-bit unsigned integers in network Its body consists of a sequence of 16-bit unsigned integers in
byte order. Each integer represents a Protocol ID from the IANA network byte order. Each integer represents a Protocol ID from the
Network Time Security Next Protocols registry. The Critical Bit MUST IANA Network Time Security Next Protocols registry. The Critical Bit
be set. MUST be set.
The Protocol IDs listed in the client's NTS Next Protocol Negotiation The Protocol IDs listed in the client's NTS Next Protocol Negotiation
record denote those protocols which the client wishes to speak using record denote those protocols which the client wishes to speak using
the key material established through this NTS-KE session. The the key material established through this NTS-KE session. The
Protocol IDs listed in the server's response MUST comprise a subset Protocol IDs listed in the server's response MUST comprise a subset
of those listed in the request, and denote those protocols which the of those listed in the request and denote those protocols 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.
4.1.3. Error 4.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.
The following error codes are defined. The following error codes are defined:
Error code 0 means "Unrecognized Critical Record". The server Error code 0 means "Unrecognized Critical Record". The server
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.
the result of a dropped packet, so the client SHOULD start over
with a new TLS handshake and retry its request.
4.1.4. Warning 4.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 a Warning record, clients receive a server response which includes a Warning record,
skipping to change at page 10, line 34 skipping to change at page 11, line 29
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 Protocol ID 0 (for If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for
NTPv4), then this record MUST be included exactly once. Other NTPv4), then this record MUST be included exactly once. Other
protocols MAY require it as well. protocols MAY require it 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. It is
if the server supports none of the algorithms offered. In requests, empty if the server supports none of the algorithms offered. In
the list MUST include at least one algorithm. In responses, it MUST requests, the list MUST include at least one algorithm. In
include at most one. Honoring the client's preference order is responses, it MUST include at most one. Honoring the client's
OPTIONAL: servers may select among any of the client's offered preference order is OPTIONAL: servers may select among any of the
choices, even if they are able to support some other algorithm which client's offered choices, even if they are able to support some other
the client prefers more. algorithm which the client prefers more.
Server implementations of NTS extension fields for NTPv4 (Section 5) Server implementations of NTS extension fields for NTPv4 (Section 5)
MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). MUST 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 Protocol ID 0 Algorithm Negotiation record and the server accepts Protocol ID 0
(NTPv4) in its NTS Next Protocol Negotiation record, then the (NTPv4) in its NTS Next Protocol Negotiation record, then the
server's AEAD Algorithm Negotiation record MUST NOT be empty. server's AEAD Algorithm Negotiation record MUST NOT be empty.
4.1.6. New Cookie for NTPv4 4.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 Section 7 for a suggested NOT attempt to interpret them. See Section 6 for a suggested
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 the
accept Protocol ID 0 (NTPv4) as a Next Protocol. The Critical Bit Next Protocol Negotiation response record contains Protocol ID 0
SHOULD NOT be set. (NTPv4) and the AEAD Algorithm Negotiation response record is not
empty. The Critical Bit SHOULD NOT be set.
4.1.7. NTPv4 Server Negotiation
The NTPv4 Server Negotiation record has a Record Type number of 6.
Its body consists of an ASCII-encoded [ANSI.X3-4.1986] string
conforming to the syntax of the Host subcomponent of a URI
([RFC3986]). IPv6 addresses MUST NOT include zone identifiers
[RFC6874].
When NTPv4 is negotiated as a Next Protocol and this record is sent
by the server, the body specifies the hostname or IP address of the
NTPv4 server with which the client should associate and which will
accept the supplied cookies. If no record of this type is sent, the
client SHALL interpret this as a directive to associate with an NTPv4
server at the same IP address as the NTS-KE server. Servers MUST NOT
send more than one record of this type.
When this record is sent by the client, it indicates that the client
wishes to associate with the specified NTP server. The NTS-KE server
MAY incorporate this request when deciding what NTPv4 Server
Negotiation records to respond with, but honoring the client's
preference is OPTIONAL. The client MUST NOT send more than one
record of this type.
Servers MAY set the Critical Bit on records of this type; clients
SHOULD NOT.
4.1.8. NTPv4 Port Negotiation
The NTPv4 Port Negotiation record has a Record Type number of 7. Its
body consists of a 16-bit unsigned integer in network byte order,
denoting a UDP port number.
When NTPv4 is negotiated as a Next Protocol and this record is sent
by the server, the body specifies the port number of the NTPv4 server
with which the client should associate and which will accept the
supplied cookies. If no record of this type is sent, the client
SHALL assume a default of 123 (the registered port number for NTP).
When this record is sent by the client in conjunction with a NTPv4
Server Negotiation record, it indicates that the client wishes to
associate with the NTP server at the specified port. The NTS-KE
server MAY incorporate this request when deciding what NTPv4 Server
Negotiation and NTPv4 Port Negotiation records to respond with, but
honoring the client's preference is OPTIONAL.
Servers MAY set the Critical Bit on records of this type; clients
SHOULD NOT.
4.2. Key Extraction (generally) 4.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 two-octet Protocol ID which was negotiated as a Next with the two-octet Protocol ID which was negotiated as a Next
Protocol. Protocol.
5. NTS Extension Fields for NTPv4 5. NTS Extension Fields for NTPv4
5.1. Key Extraction (for NTPv4) 5.1. Key Extraction (for NTPv4)
Following a successful run of the NTS-KE protocol wherein Protocol ID Following a successful run of the NTS-KE protocol wherein Protocol ID
0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be
extracted: a client-to-server (C2S) key and a server-to-client (S2C) extracted: a client-to-server (C2S) key and a server-to-client (S2C)
skipping to change at page 11, line 51 skipping to change at page 13, line 44
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
five octets: five octets:
The first two octets SHALL be zero (the Protocol ID for NTPv4). The first two octets SHALL be zero (the Protocol ID for NTPv4).
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 [RFC5705]
that disambiguating label strings beginning with "EXPERIMENTAL" MAY provides that disambiguating label strings beginning with
be used without IANA registration. "EXPERIMENTAL" MAY be used without IANA registration.
5.2. Packet structure overview 5.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 extension fields which are authenticated but not encrypted. Some extension fields which are authenticated but not encrypted.
An extension field which contains AEAD output (i.e., an An extension field 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 extension fields which plaintext, if non-empty, consists of some extension fields which
benefit from both encryption and authentication. benefit from both encryption and authentication.
Possibly, some additional extension fields which are neither Possibly, some additional extension fields which are neither
encrypted nor authenticated. These are discarded by the receiver. encrypted nor authenticated. These are discarded by the receiver.
Always included among the authenticated or authenticated-and- Always included among the authenticated or authenticated-and-
encrypted extension fields are a cookie extension field and a unique- encrypted extension fields are a cookie extension field and a unique
identifier extension field. The purpose of the cookie extension identifier extension field. The purpose of the cookie extension
field is to enable the server to offload storage of session state field is to enable the server to offload storage of session state
onto the client. The purpose of the unique-identifier extension onto the client. The purpose of the unique identifier extension
field is to protect the client from replay attacks. field is to protect the client from replay attacks.
5.3. The Unique Identifier extension field 5.3. The Unique Identifier Extension Field
The Unique Identifier extension field has a Field Type of [[TBD2]].
When the extension field is included in a client packet (mode 3), its
body SHALL consist of a string of octets generated uniformly at
random. The string MUST be at least 32 octets long. When the
extension field is included in a server packet (mode 4), its body
SHALL contain the same octet string as was provided in the client
packet to which the server is responding. Its use in modes other
than client-server is not defined.
The Unique Identifier extension field provides the client with a The Unique Identifier extension field provides the client with a
cryptographically strong means of detecting replayed packets. It MAY cryptographically strong means of detecting replayed packets. It has
also be used standalone, without NTS, in which case it provides the a Field Type of [[TBD2]]. When the extension field is included in a
client with a means of detecting spoofed packets from off-path client packet (mode 3), its body SHALL consist of a string of octets
attackers. Historically, NTP's origin timestamp field has played generated uniformly at random. The string MUST be at least 32 octets
both these roles, but for cryptographic purposes this is suboptimal long. When the extension field is included in a server packet (mode
because it is only 64 bits long and, depending on implementation 4), its body SHALL contain the same octet string as was provided in
details, most of those bits may be predictable. In contrast, the the client packet to which the server is responding. All server
Unique Identifier extension field enables a degree of packets generated by NTS-implementing servers in response to client
unpredictability and collision-resistance more consistent with packets containing this extension field MUST also contain this field
cryptographic best practice. with the same content as in the client's request. The field's use in
modes other than client-server is not defined.
5.4. The NTS Cookie extension field This extension field MAY also be used standalone, without NTS, in
which case it provides the client with a means of detecting spoofed
packets from off-path attackers. Historically, NTP's origin
timestamp field has played both these roles, but for cryptographic
purposes this is suboptimal because it is only 64 bits long and,
depending on implementation details, most of those bits may be
predictable. In contrast, the Unique Identifier extension field
enables a degree of unpredictability and collision resistance more
consistent with cryptographic best practice.
5.4. The NTS Cookie Extension Field
The NTS Cookie extension field has a Field Type of [[TBD3]]. Its The NTS Cookie extension field has a Field Type of [[TBD3]]. Its
purpose is to carry information which enables the server to recompute purpose is to carry information which enables the server to recompute
keys and other session state without having to store any per-client keys and other session state without having to store any per-client
state. The contents of its body SHALL be implementation-defined and state. The contents of its body SHALL be implementation-defined and
clients MUST NOT attempt to interpret them. See Section 7 for a clients MUST NOT attempt to interpret them. See Section 6 for a
suggested construction. The NTS Cookie extension field MUST NOT be suggested construction. The NTS Cookie extension field 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.5. The NTS Cookie Placeholder extension field 5.5. The NTS Cookie Placeholder Extension Field
The NTS Cookie Placeholder extension field has a Field Type of The NTS Cookie Placeholder extension field has a Field Type of
[[TBD4]]. When this extension field is included in a client packet [[TBD4]]. When this extension field is included in a client packet
(mode 3), it communicates to the server that the client wishes it to (mode 3), it communicates to the server that the client wishes it to
send additional cookies in its response. This extension field MUST send additional cookies in its response. This extension field MUST
NOT be included in NTP packets whose mode is other than 3. NOT be included in NTP packets whose mode is other than 3.
Whenever an NTS Cookie Placeholder extension field is present, it Whenever an NTS Cookie Placeholder extension field is present, it
MUST be accompanied by an NTS Cookie extension field, and the body MUST be accompanied by an NTS Cookie extension field. The body
length of the NTS Cookie Placeholder extension field MUST be the same length of the NTS Cookie Placeholder extension field MUST be the same
as the body length of the NTS Cookie extension field. (This length as the body length of the NTS Cookie extension field. This length
requirement serves to ensure that the response will not be larger requirement serves to ensure that the response will not be larger
than the request, in order to improve timekeeping precision and than the request, in order to improve timekeeping precision and
prevent DDoS amplification). The contents of the NTS Cookie prevent DDoS amplification. The contents of the NTS Cookie
Placeholder extension field's body are undefined and, aside from Placeholder extension field's body are undefined and, aside from
checking its length, MUST be ignored by the server. checking its length, MUST be ignored by the server.
5.6. The NTS Authenticator and Encrypted Extension Fields extension 5.6. The NTS Authenticator and Encrypted Extension Fields Extension
field Field
The NTS Authenticator and Encrypted Extension Fields extension field The NTS Authenticator and Encrypted Extension Fields extension field
is the central cryptographic element of an NTS-protected NTP packet. is the central cryptographic element of an NTS-protected NTP packet.
Its Field Type is [[TBD5]] and the format of its body SHALL be as Its Field Type is [[TBD5]]. It SHALL be formatted according to
follows: Figure 4 and include the following fields:
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 and interpreted as an unsigned integer. of the Nonce field, excluding any padding, interpreted as an
unsigned integer.
Nonce: A nonce as required by the negotiated AEAD Algorithm. Ciphertext Length: Two octets in network byte order, giving the
length of the Ciphertext field, excluding any padding, interpreted
as an unsigned integer.
Nonce: A nonce as required by the negotiated AEAD Algorithm. The
field is zero-padded to a word (four octets) boundary.
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. The field is zero-padded to a word (four
octets) boundary.
Padding: several octets of padding, with every octet set to the Additional Padding: Clients which use a nonce length shorter than
number of padding octets included, e.g., "01", "02 02", or "03 03 the maximum allowed by the negotiated AEAD algorithm may be
03". Constraints on the number of padding octets included are required to include additional zero-padding. The necessary length
enumerated below. of this field is specified below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Nonce Length | Ciphertext Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Nonce, including up to 3 bytes padding .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Ciphertext, including up to 3 bytes padding .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
. .
. Additional Padding .
. .
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 4: NTS Authenticator and Encrypted Extension Fields Extension
Field Format
The Ciphertext field SHALL be formed by providing the following The Ciphertext field SHALL be formed by providing the following
inputs to the negotiated AEAD Algorithm: inputs to the negotiated AEAD Algorithm:
K: For packets sent from the client to the server, the C2S key K: For packets sent from the client to the server, the C2S key
SHALL be used. For packets sent from the server to the client, SHALL be used. For packets sent from the server to the client,
the S2C key SHALL be used. the S2C key SHALL be used.
A: The associated data SHALL consist of the portion of the NTP A: The associated data SHALL consist of the portion of the NTP
packet beginning from the start of the NTP header and ending at packet beginning from the start of the NTP header and ending at
the end of the last extension field which precedes the NTS the end of the last extension field which precedes the NTS
Authenticator and Encrypted Extension Fields extension field. Authenticator and Encrypted Extension Fields extension field.
P: The plaintext SHALL consist of all (if any) NTP extension P: The plaintext SHALL consist of all (if any) NTP extension
fields to be encrypted. The format of any such fields SHALL be in fields to be encrypted. The format of any such fields SHALL be in
accordance with RFC 7822 [RFC7822], and if multiple extension accordance with RFC 7822 [RFC7822]. If multiple extension fields
fields are present they SHALL be joined by concatenation. are present they SHALL be joined by concatenation.
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 number of padding octets included SHALL conform to the following
constraints:
The number MUST be at least 1, so that the final octet of the
extension field always gives the padding length.
The number MUST NOT be greater than 255, since high numbers are
unrepresentable in a single octet
The number MUST result in an extension field length which is legal
per [RFC7822]. That is, the number of padding octets must be
chosen so that the total length of the extension field (including
the Field Type and Length subfields) is a multiple of 4 greater
than or equal to 16, and greater than or equal to 28 if the
extension field is the last one in the packet.
For mode 3 (client) packets only, the number MUST be at least The purpose of the Additional Padding field is to ensure that servers
MAX(MIN(N_MAX, 16) - N_len, 0) + 4, where `N_len` represents the can always choose a nonce whose length is adequate to ensure its
actual length of the nonce and N_MAX is, per [RFC5116], the uniqueness, even if the client chooses a shorter one, and still
maximum permitted nonce length for the AEAD algorithm in use. ensure that the overall length of the server's response packet. does
This constraint ensures that servers can always use an adequately not exceed the length of the request. For mode 4 (server) packets,
long nonce without causing the size of their response packet to no Additional Padding field is ever required. For mode 3 (client)
exceed the size of the request packet. Servers SHOULD enforce packets, the length of the Additional Padding field SHALL be computed
this constraint by dropping client packets that do not conform to as follows. Let `N_LEN` be the padded length of the the Nonce field.
it. Clients MUST NOT enforce it since it is not binding on mode 4 Let `N_MAX` be, as specified by RFC 5116 [RFC5116], the maximum
(server) packets to begin with. permitted nonce length for the negotiated AEAD algorithm. Let
`N_REQ` be the lesser of 16 and N_MAX, rounded up to the nearest
multiple of 4. If N_LEN is greater than or equal to N_REQ, then no
Additional Padding field is required. Otherwise, the Additional
Padding field SHALL be at least N_REQ - N_LEN octets in length.
Servers MUST enforce this requirement by discarding any packet which
does not conform to it.
The NTS Authenticator and Encrypted Extension Fields extension field The NTS Authenticator and Encrypted Extension Fields extension field
MUST NOT be included in NTP packets whose mode is other than 3 MUST NOT be included in NTP packets whose mode is other than 3
(client) or 4 (server). (client) or 4 (server).
6. Protocol details 5.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
extension fields as displayed in Figure 3: extension fields as displayed in Figure 5:
Exactly one Unique Identifier extension field, which MUST be Exactly one Unique Identifier extension field which MUST be
authenticated, MUST NOT be encrypted, and whose contents MUST NOT authenticated, MUST NOT be encrypted, and whose contents MUST NOT
duplicate those of any previous request. duplicate those of any previous request.
Exactly one NTS Cookie extension field, which MUST be Exactly one NTS Cookie extension field which MUST be authenticated
authenticated and MUST NOT be encrypted. The cookie MUST be one and MUST NOT be encrypted. The cookie MUST be one which has been
which the server previously provided the client; it may have been previously provided to the client; either from the key exchange
provided during the NTS-KE handshake or in response to a previous server during the NTS-KE handshake or from the NTP server in
NTS-protected NTP request. To protect client's privacy, the same response to a previous NTS-protected NTP request. To protect the
cookie SHOULD NOT be included in multiple requests. If the client client's privacy, the same cookie SHOULD NOT be included in
does not have any cookies that it has not already sent, it SHOULD multiple requests. If the client does not have any cookies that
re-run the NTS-KE protocol before continuing. it has not already sent, it SHOULD initiate a re-run the NTS-KE
protocol.
Exactly one NTS Authenticator and Encrypted Extension Fields Exactly one NTS Authenticator and Encrypted Extension Fields
extension field, generated using an AEAD Algorithm and C2S key extension field, generated using an AEAD Algorithm and C2S key
established through NTS-KE. established through NTS-KE.
The client MAY include one or more NTS Cookie Placeholder extension The client MAY include one or more NTS Cookie Placeholder extension
field, which MUST be authenticated and MAY be encrypted. The number fields which MUST be authenticated and MAY be encrypted. The number
of NTS Cookie Placeholder extension fields that the client includes of NTS Cookie Placeholder extension fields that the client includes
SHOULD be such that if the client includes N placeholders and the SHOULD be such that if the client includes N placeholders and the
server sends back N+1 cookies, the number of unused cookies stored by server sends back N+1 cookies, the number of unused cookies stored by
the client will come to eight. When both the client and server the client will come to eight. The client SHOULD NOT include more
adhere to all cookie-management guidance provided in this memo, the than seven NTS Cookie Placeholder extension fields in a request.
number of placeholder extension fields will equal the number of When both the client and server adhere to all cookie-management
dropped packets since the last successful volley. guidance provided in this memo, the number of placeholder extension
fields will equal the number of dropped packets since the last
successful volley.
The client MAY include additional (non-NTS-related) extension fields, +---------------------------------------+
| - Verify time request message. |
| - Generate time response message. |
| - Include NTPv4 extension fields: |
| o Unique Identifier EF |
| o NTS Cookie EF |
| o <NTS Cookie EF> |
| |
| - Generate AEAD tag of NTP message. |
| - Add NTS Authentication and |
| Encrypted Extension Fields EF. |
| - Transmit time response packet. |
+-----------------+---------------------+
|
|
Server -----------+---------------+-----+----------------------->
^ \
/ \
Time request / \ Time response
(mode 3) / \ (mode 4)
/ \
/ V
Client -----+---------------------------------+---------------->
| |
| |
| |
+-----------+-----------------------+ +-----+------------------+
|- Generate time request message. | |- Verify time response |
| - Include NTPv4 extension fields: | | message. |
| o Unique Identifier EF | |- Extract cookie(s). |
| o NTS Cookie EF | |- Time synchronization |
| o <NTS Cookie Placeholder EF> | | processing. |
| | +------------------------+
|- Generate AEAD tag of NTP message.|
|- Add NTS Authentication and |
| Encrypted Extension Fields EF. |
|- Transmit time request packet. |
+-----------------------------------+
Figure 5: NTS Time Synchronization Messages
The client MAY include additional (non-NTS-related) extension fields
which MAY appear prior to the NTS Authenticator and Encrypted which MAY appear prior to the NTS Authenticator and Encrypted
Extension Fields extension fields (therefore authenticated but not Extension Fields extension fields (therefore authenticated but not
encrypted), within it (therefore encrypted and authenticated), or encrypted), within it (therefore encrypted and authenticated), or
after it (therefore neither encrypted nor authenticated). In after it (therefore neither encrypted nor authenticated). In
general, however, the server MUST discard any unauthenticated general, however, the server MUST discard any unauthenticated
extension fields and process the packet as though they were not extension fields and process the packet as though they were not
present. Servers MAY implement exceptions to this requirement for present. Servers MAY implement exceptions to this requirement for
particular extension fields if their specification explicitly particular extension fields if their specification explicitly
provides for such. provides for such.
Upon receiving an NTS-protected request, the server SHALL (through Upon receiving an NTS-protected request, the server SHALL (through
some implementation-defined mechanism) use the cookie to recover the some implementation-defined mechanism) use the cookie to recover the
AEAD Algorithm, C2S key, and S2C key associated with the request, and AEAD Algorithm, C2S key, and S2C key associated with the request, and
then use the C2S key to authenticate the packet and decrypt the then use the C2S key to authenticate the packet and decrypt the
ciphertext. If the cookie is valid and authentication and decryption ciphertext. If the cookie is valid and authentication and decryption
succeed, then the server SHALL include the following extension fields succeed, the server SHALL include the following extension fields in
in its response: its response:
Exactly one Unique Identifier extension field, which MUST be Exactly one Unique Identifier extension field which MUST be
authenticated, MUST NOT be encrypted, and whose contents SHALL authenticated, MUST NOT be encrypted, and whose contents SHALL
echo those provided by the client. echo those provided by the client.
Exactly one NTS Authenticator and Encrypted Extension Fields Exactly one NTS Authenticator and Encrypted Extension Fields
extension field, generated using the AEAD algorithm and S2C key extension field, generated using the AEAD algorithm and S2C key
recovered from the cookie provided by the client. recovered from the cookie provided by the client.
One or more NTS Cookie extension fields, which MUST be encrypted One or more NTS Cookie extension fields which MUST be
and authenticated. The number of NTS Cookie extension fields authenticated and encrypted. The number of NTS Cookie extension
included SHOULD be equal to, and MUST NOT exceed, one plus the fields included SHOULD be equal to, and MUST NOT exceed, one plus
number of valid NTS Cookie Placeholder extension fields included the number of valid NTS Cookie Placeholder extension fields
in the request. included in the request. The cookies returned in those fields
MUST be valid for use with the NTP server that sent them. They
MAY be valid for other NTP servers as well, but there is no way
for the server to indicate this.
We emphasize the contrast that NTS Cookie extension fields MUST NOT We emphasize the contrast that NTS Cookie extension fields MUST NOT
be encrypted when sent from client to server, but MUST be encrypted be encrypted when sent from client to server, but MUST be encrypted
from sent from server to client. The former is necessary in order from sent from server to client. The former is necessary in order
for the server to be able to recover the C2S and S2C keys, while the for the server to be able to recover the C2S and S2C keys, while the
latter is necessary to satisfy the unlinkability goals discussed in latter is necessary to satisfy the unlinkability goals discussed in
Section 11.1. We emphasize also that " encrypted" means encapsulated Section 10.1. We emphasize also that "encrypted" means encapsulated
within the the NTS Authenticator and Encrypted Extensions extension within the the NTS Authenticator and Encrypted Extensions extension
field. While the body of a NTS Cookie extension field will generally field. While the body of an NTS Cookie extension field will
consist of some sort of AEAD output (regardless of whether the generally consist of some sort of AEAD output (regardless of whether
recommendations of Section 7 are precisely followed), this is not the recommendations of Section 6 are precisely followed), this is not
sufficient to make the extension field "encrypted". sufficient to make the extension field "encrypted".
The server MAY include additional (non-NTS-related) extension fields, The server MAY include additional (non-NTS-related) extension fields
which MAY appear prior to the NTS Authenticator and Encrypted which MAY appear prior to the NTS Authenticator and Encrypted
Extension Fields extension field (therefore authenticated but not Extension Fields extension field (therefore authenticated but not
encrypted), within it (therefore encrypted and authenticated), or encrypted), within it (therefore encrypted and authenticated), or
after it (therefore neither encrypted nor authenticated). In after it (therefore neither encrypted nor authenticated). In
general, however, the client MUST discard any unauthenticated general, however, the client MUST discard any unauthenticated
extension fields and process the packet as though they were not extension fields and process the packet as though they were not
present. Clients MAY implement exceptions to this requirement for present. Clients MAY implement exceptions to this requirement for
particular extension fields if their specification explicitly particular extension fields if their specification explicitly
provides for such. provides for such.
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,
Section 7.4) [RFC5905]) with kiss code "NTSN" (meaning "NTS NAK").
Such a response MUST include exactly one Unique Identifier extension
field whose contents SHALL echo those provided by the client. It
MUST NOT include any NTS Cookie or NTS Authenticator and Encrypted
Extension Fields extension fields.
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 If the server is unable to validate the cookie or authenticate the
Identifier matches that of an outstanding request. If this check request, it SHOULD respond with a Kiss-o'-Death (KoD) packet (see RFC
fails, the packet MUST be discarded without further processing. If 5905, Section 7.4 [RFC5905]) with kiss code "NTSN", meaning "NTS
this check passes, the client SHOULD wait until the next poll for a negative-acknowledgment (NAK)". It MUST NOT include any NTS Cookie
valid NTS-protected response and if none is received, discard all or NTS Authenticator and Encrypted Extension Fields extension fields.
cookies and AEAD keys associated with the server which sent the NAK
and initiate a fresh NTS-KE handshake.
+---------------------------------------+ If the NTP server has previously responded with authentic NTS-
| - verify time request message | protected NTP packets (i.e., packets containing the NTS Authenticator
| - generate time response message | and Encrypted Extension Fields extension field), the client MUST
| - included NTPv4 extension fields | verify that any KoD packets received from the server contain the
| o Unique Identifier EF | Unique Identifier extension field and that the Unique Identifier
| o NTS Authentication and | matches that of an outstanding request. If this check fails, the
| Encrypted Extension Fields EF | packet MUST be discarded without further processing. If this check
| - NTS Cookie EF | passes, the client MUST comply with RFC 5095, Section 7.4 [RFC5905]
| - <NTS Cookie EF> | where required. A client MAY automatically re-run the NTS-KE
| - transmit time request packet | protocol upon forced disassociation from an NTP server. In that
+-----------------+---------------------+ case, it MUST be able to detect and stop looping between the NTS-KE
| and NTP servers.
|
Server -------- --+---------------+-----+----------------------->
^ \
/ \
time request / \ time response
(mode 3) / \ (mode 4)
/ \
/ V
Client -----+---------------------------------+---------------->
| |
| |
| |
+-----------+----------------------+ +------+-----------------+
|- generate time request message | |- verify time response |
| - include NTPv4 Extension fields | | message |
| o Unique Identifier EF | |- extract cookie(s) |
| o NTS Cookie EF | |- time synchronization |
| o <NTS Cookie Placeholder EF> | | processing |
| | +------------------------+
|- generate AEAD tag of NTP message|
|- add NTS Authentication and |
| Encrypted Extension Fields EF |
|- transmit time request packet |
+----------------------------------+
Figure 3: NTS Time Synchronization Message Upon reception of the NTS NAK kiss code, the client SHOULD wait until
the next poll for a valid NTS-protected response and if none is
received, initiate a fresh NTS-KE handshake to try to renegotiate new
cookies, AEAD keys, and parameters. If the NTS-KE handshake
succeeds, the client MUST discard all old cookies and parameters and
use the new ones instead. As long as the NTS-KE handshake has not
succeeded, the client SHOULD continue polling the NTP server using
the cookies and parameters it has.
7. Suggested format for NTS cookies The client MAY reuse cookies in order to prioritize resilience over
unlinkability. Which of the two that should be prioritized in any
particular case is dependent on the application and the user's
preference. Section 10.1 describes the privacy considerations of
this in further detail.
To allow for NTP session restart when the NTS-KE server is
unavailable and to reduce NTS-KE server load, the client SHOULD keep
at least one unused but recent cookie, AEAD keys, negotiated AEAD
algorithm, and other necessary parameters on persistent storage.
This way, the client is able to resume the NTP session without
performing renewed NTS-KE negotiation.
6. Suggested Format for NTS Cookies
This section is non-normative. It gives a suggested way for servers This section is non-normative. It gives a suggested way for servers
to construct NTS cookies. All normative requirements are stated in to construct NTS cookies. All normative requirements are stated in
Section 4.1.6 and Section 5.4. Section 4.1.6 and Section 5.4.
The role of cookies in NTS is closely analogous to that of session The role of cookies in NTS is closely analogous 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.
Servers should select an AEAD algorithm which they will use to Servers should select an AEAD algorithm which they will use to
encrypt and authenticate cookies. The chosen algorithm should be one encrypt and authenticate cookies. The chosen algorithm should be one
such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental
nonce reuse, and it need not be the same as the one that was nonce reuse. It need not be the same as the one that was negotiated
negotiated with the client. Servers should randomly generate and with the client. Servers should randomly generate and store a master
store a master AEAD key `K`. Servers should additionally choose a AEAD key `K`. Servers should additionally choose a non-secret, unique
non-secret, unique value `I` as key-identifier for `K`. value `I` as key-identifier for `K`.
Servers should periodically (e.g., once daily) generate a new pair Servers should periodically (e.g., once daily) generate a new pair
(I,K) and immediately switch to using these values for all newly- (I,K) and immediately switch to using these values for all newly-
generated cookies. Immediately following each such key rotation, generated cookies. Immediately following each such key rotation,
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.
The need to keep keys synchronized across load-balanced clusters can The need to keep keys synchronized between NTS-KE and NTP servers as
make automatic key rotation challenging. However, the task can be well as across load-balanced clusters can make automatic key rotation
accomplished without the need for central key-management challenging. However, the task can be accomplished without the need
infrastructure by using a ratchet, i.e., making each new key a for central key-management infrastructure by using a ratchet, i.e.,
deterministic, cryptographically pseudo-random function of its making each new key a deterministic, cryptographically pseudo-random
predecessor. A recommended concrete implementation of this approach function of its predecessor. A recommended concrete implementation
is to use HKDF [RFC5869] to derive new keys, using the key's of this approach is to use HKDF [RFC5869] to derive new keys, using
predecessor as Input Keying Material and its key identifier as a the key's predecessor as Input Keying Material and its key identifier
salt. 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 then generate a nonce `N` uniformly at random, and Servers should then generate a nonce `N` uniformly at random, and
form AEAD output `C` by encrypting `P` under key `K` with nonce `N` form AEAD output `C` by encrypting `P` under key `K` with nonce `N`
and no associated data. and no associated data.
The cookie should consist of the tuple `(I,N,C)`. The cookie should consist of the tuple `(I,N,C)`.
To verify and decrypt a cookie provided by the client, first parse it To verify and decrypt a cookie provided by the client, first parse it
into its components `I`, `N`, and `C`. Use `I` to look up its 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 decryption key `K`. If the key whose identifier is `I` has been
erased or never existed, decryption fails; reply with an NTS NAK. erased or never existed, decryption fails; reply with an NTS NAK.
Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` Otherwise, attempt to decrypt and verify ciphertext `C` using key `K`
and nonce `N` with no associated data. If decryption or verification and nonce `N` with no associated data. If decryption or verification
fails, reply with an NTS NAK. Otherwise, parse out the contents of fails, reply with an NTS NAK. Otherwise, parse out the contents of
the resulting plaintext `P` to obtain the negotiated AEAD algorithm, the resulting plaintext `P` to obtain the negotiated AEAD algorithm,
S2C key, and C2S key. S2C key, and C2S key.
8. IANA Considerations 7. IANA Considerations
IANA is requested to allocate two entries, identical except for the 7.1. Service Name and Transport Protocol Port Number Registry
Transport Protocol, in the Service Name and Transport Protocol Port
Number Registry as follows:
Service Name: nts IANA is requested to allocate the following entry in the Service Name
and Transport Protocol Port Number Registry [RFC6335]:
Transport Protocol: tcp, udp Service Name: ntske
Transport Protocol: tcp
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 Key Exchange
Reference: [[this memo]] Reference: [[this memo]]
Port Number: [[TBD1]], 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 entry in the Application- [[RFC EDITOR: Replace all instances of [[TBD1]] in this document with
Layer Protocol Negotation (ALPN) Protocol IDs registry: the IANA port assignment.]]
7.2. TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs
Registry
IANA is requested to allocate the following entry in the TLS
Application-Layer Protocol Negotiation (ALPN) Protocol IDs registry
[RFC7301]:
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]], Section 4
7.3. TLS Exporter Labels Registry
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: Labels Registry [RFC5705]:
+--------------------+---------+-------------+---------------+------+
| Value | DTLS-OK | Recommended | Reference | Note |
+--------------------+---------+-------------+---------------+------+
| EXPORTER-network- | Y | Y | [[this | |
| time-security/1 | | | memo]], | |
| | | | Section 4.2 | |
+--------------------+---------+-------------+---------------+------+
7.4. NTP Kiss-o'-Death Codes Registry
+----------------------------------+---------+---------------+------+
| Value | DTLS-OK | Reference | Note |
+----------------------------------+---------+---------------+------+
| EXPORTER-network-time-security/1 | Y | [[this memo]] | |
+----------------------------------+---------+---------------+------+
IANA is requested to allocate the following entry in the registry of IANA is requested to allocate the following entry in the registry of
NTP Kiss-o'-Death codes: NTP Kiss-o'-Death Codes [RFC5905]:
+------+---------+ +------+---------------------------------------+--------------------+
| Code | Meaning | | Code | Meaning | Reference |
+------+---------+ +------+---------------------------------------+--------------------+
| NTSN | NTS NAK | | NTSN | Network Time Security (NTS) negative- | [[this memo]], |
+------+---------+ | | acknowledgment (NAK) | Section 5.7 |
+------+---------------------------------------+--------------------+
7.5. NTP Extension Field Types Registry
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: Extension Field Types registry [RFC5905]:
+-----------+-----------------------------------------+-------------+ +----------+----------------------------------+---------------------+
| Field | Meaning | Reference | | Field | Meaning | Reference |
| Type | | | | Type | | |
+-----------+-----------------------------------------+-------------+ +----------+----------------------------------+---------------------+
| [[TBD2]] | Unique Identifier | [[this | | [[TBD2]] | Unique Identifier | [[this memo]], |
| | | memo]] | | | | Section 5.3 |
| [[TBD3]] | NTS Cookie | [[this | | [[TBD3]] | NTS Cookie | [[this memo]], |
| | | memo]] | | | | Section 5.4 |
| [[TBD4]] | NTS Cookie Placeholder | [[this | | [[TBD4]] | NTS Cookie Placeholder | [[this memo]], |
| | | memo]] | | | | Section 5.5 |
| [[TBD5]] | NTS Authenticator and Encrypted | [[this | | [[TBD5]] | NTS Authenticator and Encrypted | [[this memo]], |
| | Extension Fields | memo]] | | | Extension Fields | Section 5.6 |
+-----------+-----------------------------------------+-------------+ +----------+----------------------------------+---------------------+
[[RFC EDITOR: Replace all instances of [[TBD2]], [[TBD3]], [[TBD4]],
and [[TBD5]] in this document with the respective IANA assignments.
7.6. Network Time Security Key Establishment Record Types Registry
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. Record Type Number (REQUIRED): An integer in the range 0-32767
inclusive.
Description (REQUIRED): A short text description of the purpose of Description (REQUIRED): A short text description of the purpose of
the field. the field.
Set Critical Bit (REQUIRED): One of "MUST", "SHOULD", "MAY",
"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 Record Type Number, as follows:
0-1023: IETF Review 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 as well as which
above ranges the Type Number should be allocated from. Applicants of the above ranges the Record Type Number should be allocated from.
MAY request a specific Type Number, and such requests MAY be granted Applicants MAY request a specific Record Type Number and such
at the registrar's discretion. requests MAY be granted at the registrar's discretion.
The initial contents of this registry SHALL be as follows: The initial contents of this registry SHALL be as follows:
+-------------+-----------------------------+----------+------------+ +---------------+----------------------------+----------------------+
| Field | Description | Critical | Reference | | Record Type | Description | Reference |
| Number | | | | | Number | | |
+-------------+-----------------------------+----------+------------+ +---------------+----------------------------+----------------------+
| 0 | End of message | MUST | [[this | | 0 | End of Message | [[this memo]], |
| | | | memo]] | | | | Section 4.1.1 |
| 1 | NTS next protocol | MUST | [[this | | 1 | NTS Next Protocol | [[this memo]], |
| | negotiation | | memo]] | | | Negotiation | Section 4.1.2 |
| 2 | Error | MUST | [[this | | 2 | Error | [[this memo]], |
| | | | memo]] | | | | Section 4.1.3 |
| 3 | Warning | MUST | [[this | | 3 | Warning | [[this memo]], |
| | | | memo]] | | | | Section 4.1.4 |
| 4 | AEAD algorithm negotiation | MAY | [[this | | 4 | AEAD Algorithm Negotiation | [[this memo]], |
| | | | memo]] | | | | Section 4.1.5 |
| 5 | New cookie for NTPv4 | SHOULD | [[this | | 5 | New Cookie for NTPv4 | [[this memo]], |
| | | NOT | memo]] | | | | Section 4.1.6 |
| 16384-32767 | Reserved for Private & | MAY | [[this | | 6 | NTPv4 Server Negotiation | [[this memo]], |
| | Experimental Use | | memo]] | | | | Section 4.1.7 |
+-------------+-----------------------------+----------+------------+ | 7 | NTPv4 Port Negotiation | [[this memo]], |
| | | Section 4.1.8 |
| 16384-32767 | Reserved for Private & | [[this memo]] |
| | Experimental Use | |
+---------------+----------------------------+----------------------+
7.7. Network Time Security Next Protocols Registry
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 ID (REQUIRED): An integer in the range 0-65535 inclusive, Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive,
functioning as an identifier. functioning as an identifier.
Protocol Name (REQUIRED): A short text string naming the protocol Protocol Name (REQUIRED): A short text string naming the protocol
being identified. being identified.
Reference (RECOMMENDED): A reference to a relevant specification Reference (REQUIRED): A reference to a relevant specification
document. If no relevant document exists, a point-of-contact for document.
questions regarding the entry SHOULD be listed here in lieu.
Applications for new entries in this registry SHALL specify all The policy for allocation of new entries in these registries SHALL
desired fields, and SHALL be granted upon approval by a Designated vary by their Protocol ID, as follows:
Expert. Protocol IDs 32768-65535 SHALL be reserved for Private or
Experimental Use, and SHALL NOT be registered. 0-1023: IETF Review
1024-32767: Specification Required
32768-65535: Private and Experimental Use
The initial contents of this registry SHALL be as follows: The initial contents of this registry SHALL be as follows:
+-------------+-------------------------------+---------------------+ +-------------+-------------------------------+---------------------+
| Protocol ID | Human-Readable Name | Reference | | Protocol ID | Protocol Name | Reference |
+-------------+-------------------------------+---------------------+ +-------------+-------------------------------+---------------------+
| 0 | Network Time Protocol version | [[this memo]] | | 0 | Network Time Protocol version | [[this memo]] |
| | 4 (NTPv4) | | | | 4 (NTPv4) | |
| 32768-65535 | Reserved for Private or | Reserved by [[this | | 32768-65535 | Reserved for Private or | Reserved by [[this |
| | Experimental Use | memo]] | | | Experimental Use | memo]] |
+-------------+-------------------------------+---------------------+ +-------------+-------------------------------+---------------------+
7.8. Network Time Security Error and Warning Codes Registries
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): An integer in the range 0-65535 inclusive. Number (REQUIRED): An integer in the range 0-65535 inclusive
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: IETF Review 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 | [[this memo]], |
| 1 | Bad Request | [[this memo]] | | | Extension | Section 4.1.3 |
+--------+---------------------------------+---------------+ | 1 | Bad Request | [[this memo]], |
| | | Section 4.1.3 |
| 32768-65535 | Reserved for Private or | Reserved by [[this |
| | Experimental Use | memo]] |
+-------------+------------------------------+----------------------+
The Network Time Security Warning Codes Registry SHALL initially be The Network Time Security Warning Codes Registry SHALL initally be
empty. empty except for the reserved range, i.e.:
9. Implementation Status +-------------+-------------------------------+---------------------+
| Number | Description | Reference |
+-------------+-------------------------------+---------------------+
| 32768-65535 | Reserved for Private or | Reserved by [[this |
| | Experimental Use | memo]] |
+-------------+-------------------------------+---------------------+
8. Implementation Status
This section records the status of known implementations of the This section records the status of known implementations of the
protocol defined by this specification at the time of posting of this protocol defined by this specification at the time of posting of this
Internet-Draft, and is based on a proposal described in RFC 7942. Internet-Draft, and is based on a proposal described in RFC 7942.
The description of implementations in this section is intended to The description of implementations in this section is intended to
assist the IETF in its decision processes in progressing drafts to assist the IETF in its decision processes in progressing drafts to
RFCs. Please note that the listing of any individual implementation RFCs. Please note that the listing of any individual implementation
here does not imply endorsement by the IETF. Furthermore, no effort here does not imply endorsement by the IETF. Furthermore, no effort
has been spent to verify the information presented here that was has been spent to verify the information presented here that was
supplied by IETF contributors. This is not intended as, and must not supplied by IETF contributors. This is not intended as, and must not
skipping to change at page 24, line 27 skipping to change at page 28, line 34
features. Readers are advised to note that other implementations may features. Readers are advised to note that other implementations may
exist. exist.
According to RFC 7942, "this will allow reviewers and working groups According to RFC 7942, "this will allow reviewers and working groups
to assign due consideration to documents that have the benefit of to assign due consideration to documents that have the benefit of
running code, which may serve as evidence of valuable experimentation running code, which may serve as evidence of valuable experimentation
and feedback that have made the implemented protocols more mature. and feedback that have made the implemented protocols more mature.
It is up to the individual working groups to use this information as It is up to the individual working groups to use this information as
they see fit". they see fit".
9.1. Implementation PoC 1 8.1. Implementation PoC 1
Organization: Ostfalia University of Applied Science Organization: Ostfalia University of Applied Science
Implementor: Martin Langer Implementor: Martin Langer
Maturity: Proof-of-Concept Prototype Maturity: Proof-of-Concept Prototype
This implementation was used to verify consistency and to ensure This implementation was used to verify consistency and to ensure
completeness of this specification. It also demonstrate completeness of this specification. It also demonstrate
interoperability with NTP's client-server mode messages. interoperability with NTP's client-server mode messages.
9.1.1. Coverage 8.1.1. Coverage
This implementation covers the complete specification. This implementation covers the complete specification.
9.1.2. Licensing 8.1.2. Licensing
The code is released under a Apache License 2.0 license. The code is released under a Apache License 2.0 license.
The source code is available at: https://gitlab.com/MLanger/nts/ The source code is available at: https://gitlab.com/MLanger/nts/
9.1.3. Contact Information 8.1.3. Contact Information
Contact Martin Langer: mart.langer@ostfalia.de Contact Martin Langer: mart.langer@ostfalia.de
9.1.4. Last Update 8.1.4. Last Update
The implementation was updated 3rd May 2018. The implementation was updated 3rd May 2018.
9.2. Implementation PoC 2 8.2. Implementation PoC 2
Organization: tbd Organization: tbd
Implementor: Daniel Fox Franke Implementor: Daniel Fox Franke
Maturity: Proof-of-Concept Prototype Maturity: Proof-of-Concept Prototype
This implementation was used to verify consistency and to ensure This implementation was used to verify consistency and to ensure
completeness of this specification. completeness of this specification.
9.2.1. Coverage 8.2.1. Coverage
This implementation provides the client and the server for the This implementation provides the client and the server for the
initial TLS handshake and NTS key exchange. It provides the the initial TLS handshake and NTS key exchange. It provides the the
client part of the NTS protected NTP messages. client part of the NTS protected NTP messages.
9.2.2. Licensing 8.2.2. Licensing
Public domain. Public domain.
The source code is available at: https://github.com/dfoxfranke/nts- The source code is available at: https://github.com/dfoxfranke/nts-
hackathon hackathon
9.2.3. Contact Information 8.2.3. Contact Information
Contact Daniel Fox Franke: dfoxfranke@gmail.com Contact Daniel Fox Franke: dfoxfranke@gmail.com
9.2.4. Last Update 8.2.4. Last Update
The implementation was updated 16th March 2018. The implementation was updated 16th March 2018.
9.3. Interoperability 8.3. Interoperability
The Interoperability tests distinguished between NTS key exchange and The Interoperability tests distinguished between NTS key exchange and
NTS time exchange messages. For the NTS key exchange, NTS time exchange messages. For the NTS key exchange,
interoperability between the two implementations has been verified interoperability between the two implementations has been verified
successfully. Interoperability of NTS time exchange messages has successfully. Interoperability of NTS time exchange messages has
been verified successfully for the case that PoC 1 represents the been verified successfully for the case that PoC 1 represents the
server and PoC 2 the client. server and PoC 2 the client.
These tests successfully demonstrate that there are at least two These tests successfully demonstrate that there are at least two
running implementations of this draft which are able to interoperate. running implementations of this draft which are able to interoperate.
10. Security considerations 9. Security Considerations
10.1. Avoiding DDoS amplification 9.1. Sensitivity to DDoS attacks
The introduction of NTS brings with it the introduction of asymmetric
cryptography to NTP. Asymmetric cryptography is necessary for
initial server authentication and AEAD key extraction. Asymmetric
cryptosystems are generally orders of magnitude slower than their
symmetric counterparts. This makes it much harder to build systems
that can serve requests at a rate corresponding to the full line
speed of the network connection. This, in turn, opens up a new
possibility for DDoS attacks on NTP services.
The main protection against these attacks in NTS lies in that the use
of asymmetric cryptosystems is only necessary in the initial NTS-KE
phase of the protocol. Since the protocol design enables separation
of the NTS-KE and NTP servers, a successful DDoS attack on an NTS-KE
server separated from the NTP service it supports will not affect NTP
users that have already performed initial authentication, AEAD key
extraction, and cookie exchange.
NTS users should also consider that they are not fully protected
against DDoS attacks by on-path adversaries. In addition to dropping
packets and attacks such as those described in Section 9.4, an on-
path attacker can send spoofed kiss-o'-death replies, which are not
authenticated, in response to NTP requests. This could result in
significantly increased load on the NTS-KE server. Implementers have
to weigh the user's need for unlinkability against the added
resilience that comes with cookie reuse in cases of NTS-KE server
unavailability.
9.2. Avoiding DDoS Amplification
Certain non-standard and/or deprecated features of the Network Time Certain non-standard and/or deprecated features of the Network Time
Protocol enable clients to send a request to a server which causes Protocol enable clients to send a request to a server which causes
the server to send a response much larger than the request. Servers the server to send a response much larger than the request. Servers
which enable these features can be abused in order to amplify traffic which enable these features can be abused in order to amplify traffic
volume in distributed denial-of-service (DDoS) attacks by sending volume in DDoS attacks by sending them a request with a spoofed
them a request with a spoofed source IP. In recent years, attacks of source IP. In recent years, attacks of this nature have become an
this nature have become an endemic nuisance. endemic nuisance.
NTS is designed to avoid contributing any further to this problem by NTS is designed to avoid contributing any further to this problem by
ensuring that NTS-related extension fields included in server ensuring that NTS-related extension fields included in server
responses will be the same size as the NTS-related extension fields responses will be the same size as the NTS-related extension fields
sent by the client. In particular, this is why the client is sent by the client. In particular, this is why the client is
required to send a separate and appropriately padded-out NTS Cookie required to send a separate and appropriately padded-out NTS Cookie
Placeholder extension field for every cookie it wants to get back, Placeholder extension field for every cookie it wants to get back,
rather than being permitted simply to specify a desired quantity. rather than being permitted simply to specify a desired quantity.
Due to the [RFC7822] requirement that extensions be padded and Due to the RFC 7822 [RFC7822] requirement that extensions be padded
aligned to four-octet boundaries, response size may still in some and aligned to four-octet boundaries, response size may still in some
cases exceed request size by up to three octets. This is cases exceed request size by up to three octets. This is
sufficiently inconsequential that we have declined to address it. sufficiently inconsequential that we have declined to address it.
10.2. Initial verification of server certificates 9.3. Initial Verification of Server Certificates
NTS's security goals are undermined if the client fails to verify 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 that the X.509 certificate chain presented by the NTS-KE server is
rooted in a trusted certificate authority. [RFC5280] and [RFC6125] valid and rooted in a trusted certificate authority. RFC 5280
specify how such verification is to be performed in general. [RFC5280] and RFC 6125 [RFC6125] specify how such verification is to
However, the expectation that the client does not yet have a be performed in general. However, the expectation that the client
correctly-set system clock at the time of certificate verification does not yet have a correctly-set system clock at the time of
presents difficulties with verifying that the certificate is within certificate verification presents difficulties with verifying that
its validity period, i.e., that the current time lies between the the certificate is within its validity period, i.e., that the current
times specified in the certificate's notBefore and notAfter fields, time lies between the times specified in the certificate's notBefore
and it may be operationally necessary in some cases for a client to and notAfter fields. It may be operationally necessary in some cases
accept a certificate which appears to be expired or not yet valid. for a client to accept a certificate which appears to be expired or
While there is no perfect solution to this problem, there are several not yet valid. While there is no perfect solution to this problem,
mitigations the client can implement to make it more difficult for an there are several mitigations the client can implement to make it
adversary to successfully present an expired certificate: more difficult for an adversary to successfully present an expired
certificate:
Check whether the system time is in fact unreliable. If the Check whether the system time is in fact unreliable. If the
system clock has previously been synchronized since last boot, system clock has previously been synchronized since last boot,
then on operating systems which implement a kernel-based phase- then on operating systems which implement a kernel-based phase-
locked-loop API, a call to ntp_gettime() should show a maximum 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 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be
considered reliable and certificates can be strictly validated. considered reliable and certificates can be strictly validated.
Allow the system administrator to specify that certificates should Allow the system administrator to specify that certificates should
*always* be strictly validated. Such a configuration is *always* be strictly validated. Such a configuration is
skipping to change at page 27, line 26 skipping to change at page 32, line 17
certificate whose notAfter field is earlier than the last recorded certificate whose notAfter field is earlier than the last recorded
time. time.
Do not process time packets from servers if the time computed from Do not process time packets from servers if the time computed from
them falls outside the validity period of the server's them falls outside the validity period of the server's
certificate. certificate.
Use multiple time sources. The ability to pass off an expired Use multiple time sources. The ability to pass off an expired
certificate is only useful to an adversary who has compromised the certificate is only useful to an adversary who has compromised the
corresponding private key. If the adversary has compromised only corresponding private key. If the adversary has compromised only
a minority of servers, NTP's selection algorithm ([RFC5905] a minority of servers, NTP's selection algorithm (RFC 5905 section
section 11.2.1) will protect the client from accepting bad time 11.2.1 [RFC5905]) will protect the client from accepting bad time
from the adversary-controlled servers. from the adversary-controlled servers.
10.3. Usage of NTP pools 9.4. Delay Attacks
Additional standardization work and infrastructure development is
necessary before NTS can be used with public NTP server pools.
First, a scheme will need to be specified for determining what
constitutes an acceptable certificate for a pool server, such as
establishing a value required to be contained in its Extended Key
Usage attribute, and how to determine, given the DNS name of a pool,
what Subject Alternative Name to expect in the certificates of its
members. Implementing any such specification will necessitate
infrastructure work: pool organizers will need to act as certificate
authorities, regularly monitor the behavior of servers to which
certificates have been issued, and promptly revoke the certificate of
any server found to be serving incorrect time.
10.4. Delay attacks
In a packet delay attack, an adversary with the ability to act as a In a packet delay attack, an adversary with the ability to act as a
man-in-the-middle delays time synchronization packets between client man-in-the-middle delays time synchronization packets between client
and server asymmetrically [RFC7384]. Since NTP's formula for and server asymmetrically [RFC7384]. Since NTP's formula for
computing time offset relies on the assumption that network latency computing time offset relies on the assumption that network latency
is roughly symmetrical, this leads to the client to compute an is roughly symmetrical, this leads to the client to compute an
inaccurate value [Mizrahi]. The delay attack does not reorder or inaccurate value [Mizrahi]. The delay attack does not reorder or
modify the content of the exchanged synchronization packets. modify the content of the exchanged synchronization packets.
Therefore, cryptographic means do not provide a feasible way to Therefore, cryptographic means do not provide a feasible way to
mitigate this attack. However, the maximum error that an adversary mitigate this attack. However, the maximum error that an adversary
can introduce is bounded by half of the round trip delay. can introduce is bounded by half of the round trip delay.
[RFC5905] specifies a parameter called MAXDIST which denotes the RFC 5905 [RFC5905] specifies a parameter called MAXDIST which denotes
maximum round-trip latency (including not only the immediate round the maximum round-trip latency (including not only the immediate
trip between client and server but the whole distance back to the round trip between client and server, but the whole distance back to
reference clock as reported in the Root Delay field) that a client the reference clock as reported in the Root Delay field) that a
will tolerate before concluding that the server is unsuitable for client will tolerate before concluding that the server is unsuitable
synchronization. The standard value for MAXDIST is one second, for synchronization. The standard value for MAXDIST is one second,
although some implementations use larger values. Whatever value a although some implementations use larger values. Whatever value a
client chooses, the maximum error which can be introduced by a delay client chooses, the maximum error which can be introduced by a delay
attack is MAXDIST/2. attack is MAXDIST/2.
Usage of multiple time sources, or multiple network paths to a given Usage of multiple time sources, or multiple network paths to a given
time source [Shpiner], may also serve to mitigate delay attacks if time source [Shpiner], may also serve to mitigate delay attacks if
the adversary is in control of only some of the paths. the adversary is in control of only some of the paths.
10.5. Random number generation 9.5. Random Number Generation
At various points in NTS, the generation of cryptographically secure At various points in NTS, the generation of cryptographically secure
random numbers is required. Whenever this draft specifies the use of random numbers is required. Whenever this draft specifies the use of
random numbers, then cryptographically secure random number random numbers, cryptographically secure random number generation
generation MUST be used. See [RFC4086] for guidelines concerning MUST be used. RFC 4086 [RFC4086] contains guidelines concerning this
this topic. topic.
11. Privacy Considerations 10. Privacy Considerations
11.1. 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.
skipping to change at page 29, line 18 skipping to change at page 33, line 41
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.
11.2. Confidentiality Note that the unlinkability objective does not prevent a client
device to be tracked by its time servers.
10.2. Confidentiality
NTS does not protect the confidentiality of information in NTP's NTS does not protect the confidentiality of information in NTP's
header fields. When clients implement header fields. When clients implement
[I-D.ietf-ntp-data-minimization], client packet headers do not [I-D.ietf-ntp-data-minimization], client packet headers do not
contain any information which the client could conceivably wish to contain any information which the client could conceivably wish to
keep secret: one field is random, and all others are fixed. keep secret: one field is random, and all others are fixed.
Information in server packet headers is likewise public: the origin Information in server packet headers is likewise public: the origin
timestamp is copied from the client's (random) transmit timestamp, timestamp is copied from the client's (random) transmit timestamp,
and all other fields are set the same regardless of the identity of and all other fields are set the same regardless of the identity of
the client making the request. the client making the request.
Future extension fields could hypothetically contain sensitive Future extension fields could hypothetically contain sensitive
information, in which case NTS provides a mechanism for encrypting information, in which case NTS provides a mechanism for encrypting
them. them.
12. Acknowledgements 11. Acknowledgements
The authors would like to thank Richard Barnes, Steven Bellovin, The authors would like to thank Richard Barnes, Steven Bellovin,
Scott Fluhrer, Sharon Goldberg, Russ Housley, Martin Langer, Miroslav Patrik Faeltstroem (Faltstrom), Scott Fluhrer, Sharon Goldberg, Russ
Lichvar, Aanchal Malhotra, Dave Mills, Danny Mayer, Karen O'Donoghue, Housley, Martin Langer, Miroslav Lichvar, Aanchal Malhotra, Dave
Eric K. Rescorla, Stephen Roettger, Kurt Roeckx, Kyle Rose, Rich Mills, Danny Mayer, Karen O'Donoghue, Eric K. Rescorla, Stephen
Salz, Brian Sniffen, Susan Sons, Douglas Stebila, Harlan Stenn, Roettger, Kurt Roeckx, Kyle Rose, Rich Salz, Brian Sniffen, Susan
Martin Thomson, and Richard Welty for contributions to this document Sons, Douglas Stebila, Harlan Stenn, Joachim Stroembergsson
and comments on the design of NTS. (Strombergsson), Martin Thomson, and Richard Welty for contributions
to this document and comments on the design of NTS.
13. References 12. References
13.1. Normative References 12.1. Normative References
[ANSI.X3-4.1986]
American National Standards Institute, "Coded Character
Set - 7-bit American Standard Code for Information
Interchange", ANSI X3.4, 1986.
[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,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>.
[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,
<https://www.rfc-editor.org/info/rfc5116>. <https://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, <https://www.rfc-editor.org/info/rfc5297>. 2008, <https://www.rfc-editor.org/info/rfc5297>.
[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, <https://www.rfc-editor.org/info/rfc5705>. March 2010, <https://www.rfc-editor.org/info/rfc5705>.
[RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov,
"Transport Layer Security (TLS) Renegotiation Indication
Extension", RFC 5746, DOI 10.17487/RFC5746, February 2010,
<https://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,
<https://www.rfc-editor.org/info/rfc5905>. <https://www.rfc-editor.org/info/rfc5905>.
[RFC6125] Saint-Andre, P. and J. Hodges, "Representation and [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and
Verification of Domain-Based Application Service Identity Verification of Domain-Based Application Service Identity
within Internet Public Key Infrastructure Using X.509 within Internet Public Key Infrastructure Using X.509
(PKIX) Certificates in the Context of Transport Layer (PKIX) Certificates in the Context of Transport Layer
Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March
2011, <https://www.rfc-editor.org/info/rfc6125>. 2011, <https://www.rfc-editor.org/info/rfc6125>.
[RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S.
Cheshire, "Internet Assigned Numbers Authority (IANA)
Procedures for the Management of the Service Name and
Transport Protocol Port Number Registry", BCP 165,
RFC 6335, DOI 10.17487/RFC6335, August 2011,
<https://www.rfc-editor.org/info/rfc6335>.
[RFC6874] Carpenter, B., Cheshire, S., and R. Hinden, "Representing
IPv6 Zone Identifiers in Address Literals and Uniform
Resource Identifiers", RFC 6874, DOI 10.17487/RFC6874,
February 2013, <https://www.rfc-editor.org/info/rfc6874>.
[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, <https://www.rfc-editor.org/info/rfc7301>. July 2014, <https://www.rfc-editor.org/info/rfc7301>.
[RFC7465] Popov, A., "Prohibiting RC4 Cipher Suites", RFC 7465,
DOI 10.17487/RFC7465, February 2015,
<https://www.rfc-editor.org/info/rfc7465>.
[RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher
Suite Value (SCSV) for Preventing Protocol Downgrade Suite Value (SCSV) for Preventing Protocol Downgrade
Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015,
<https://www.rfc-editor.org/info/rfc7507>. <https://www.rfc-editor.org/info/rfc7507>.
[RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre,
Langley, A., and M. Ray, "Transport Layer Security (TLS) "Recommendations for Secure Use of Transport Layer
Session Hash and Extended Master Secret Extension", Security (TLS) and Datagram Transport Layer Security
RFC 7627, DOI 10.17487/RFC7627, September 2015, (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May
<https://www.rfc-editor.org/info/rfc7627>. 2015, <https://www.rfc-editor.org/info/rfc7525>.
[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, <https://www.rfc-editor.org/info/rfc7822>. March 2016, <https://www.rfc-editor.org/info/rfc7822>.
13.2. Informative References [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>.
12.2. Informative References
[I-D.ietf-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-ietf-ntp-data-minimization-00 (work Minimization", draft-ietf-ntp-data-minimization-02 (work
in progress), May 2017. in progress), July 2018.
[Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks
against time synchronization protocols", in Proceedings against time synchronization protocols", in Proceedings
of Precision Clock Synchronization for Measurement Control of Precision Clock Synchronization for Measurement Control
and Communication, ISPCS 2012, pp. 1-6, September 2012. and Communication, ISPCS 2012, pp. 1-6, September 2012.
[RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
DOI 10.17487/RFC0768, August 1980,
<https://www.rfc-editor.org/info/rfc768>.
[RFC0793] Postel, J., "Transmission Control Protocol", STD 7,
RFC 793, DOI 10.17487/RFC0793, September 1981,
<https://www.rfc-editor.org/info/rfc793>.
[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,
<https://www.rfc-editor.org/info/rfc4086>. <https://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, <https://www.rfc-editor.org/info/rfc5077>. January 2008, <https://www.rfc-editor.org/info/rfc5077>.
skipping to change at page 32, line 12 skipping to change at page 37, line 16
Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384,
October 2014, <https://www.rfc-editor.org/info/rfc7384>. October 2014, <https://www.rfc-editor.org/info/rfc7384>.
[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. Terms and Abbreviations Appendix A. Terms and Abbreviations
AEAD Authenticated Encryption with Associated Data [RFC5116] AEAD Authenticated Encryption with Associated Data [RFC5116]
DDoS Distributed Denial of Service ALPN Application-Layer Protocol Negotiation [RFC7301]
NTP Network Time Protocol [RFC5905] C2S Client-to-server
NTS Network Time Security DDoS Distributed Denial-of-Service
TLS Transport Layer Security EF Extension Field [RFC5905]
HKDF Hashed Message Authentication Code-based Key Derivation
Function [RFC5869]
IANA Internet Assigned Numbers Authority
IP Internet Protocol
KoD Kiss-o'-Death [RFC5905]
NTP Network Time Protocol [RFC5905]
NTS Network Time Security
NTS-KE Network Time Security Key Exchange
S2C Server-to-client
SCSV Signaling Cipher Suite Value [RFC7507]
TCP Transmission Control Protocol [RFC0793]
TLS Transport Layer Security [RFC8446]
UDP User Datagram Protocol [RFC0768]
Authors' Addresses Authors' Addresses
Daniel Fox Franke Daniel Fox Franke
Email: dfoxfranke@gmail.com Email: dfoxfranke@gmail.com
URI: https://www.dfranke.us URI: https://www.dfranke.us
Dieter Sibold Dieter Sibold
Physikalisch-Technische Bundesanstalt Physikalisch-Technische Bundesanstalt
skipping to change at line 1471 skipping to change at page 38, line 30
Email: dieter.sibold@ptb.de Email: dieter.sibold@ptb.de
Kristof Teichel Kristof Teichel
Physikalisch-Technische Bundesanstalt Physikalisch-Technische Bundesanstalt
Bundesallee 100 Bundesallee 100
Braunschweig D-38116 Braunschweig D-38116
Germany Germany
Phone: +49-(0)531-592-4471 Phone: +49-(0)531-592-4471
Email: kristof.teichel@ptb.de Email: kristof.teichel@ptb.de
Marcus Dansarie
Email: marcus@dansarie.se
Ragnar Sundblad
Netnod
Email: ragge@netnod.se
 End of changes. 163 change blocks. 
521 lines changed or deleted 804 lines changed or added

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