idnits 2.17.1 draft-ietf-ntp-using-nts-for-ntp-24.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 18, 2020) is 1499 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 399 -- Looks like a reference, but probably isn't: '1' on line 399 -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-AEAD' ** Downref: Normative reference to an Informational RFC: RFC 5297 ** Downref: Normative reference to an Informational RFC: RFC 5869 ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7525 (Obsoleted by RFC 9325) -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NTP Working Group D. Franke 3 Internet-Draft Akamai 4 Intended status: Standards Track D. Sibold 5 Expires: September 19, 2020 K. Teichel 6 PTB 7 M. Dansarie 9 R. Sundblad 10 Netnod 11 March 18, 2020 13 Network Time Security for the Network Time Protocol 14 draft-ietf-ntp-using-nts-for-ntp-24 16 Abstract 18 This memo specifies Network Time Security (NTS), a mechanism for 19 using Transport Layer Security (TLS) and Authenticated Encryption 20 with Associated Data (AEAD) to provide cryptographic security for the 21 client-server mode of the Network Time Protocol (NTP). 23 NTS is structured as a suite of two loosely coupled sub-protocols. 24 The first (NTS-KE) handles initial authentication and key 25 establishment over TLS. The second handles encryption and 26 authentication during NTP time synchronization via extension fields 27 in the NTP packets, and holds all required state only on the client 28 via opaque cookies. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at https://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on September 19, 2020. 47 Copyright Notice 49 Copyright (c) 2020 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (https://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 65 1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 4 66 1.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 5 67 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 7 68 3. TLS profile for Network Time Security . . . . . . . . . . . . 7 69 4. The NTS Key Establishment Protocol . . . . . . . . . . . . . 8 70 4.1. NTS-KE Record Types . . . . . . . . . . . . . . . . . . . 10 71 4.1.1. End of Message . . . . . . . . . . . . . . . . . . . 11 72 4.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 11 73 4.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 11 74 4.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 12 75 4.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 12 76 4.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 13 77 4.1.7. NTPv4 Server Negotiation . . . . . . . . . . . . . . 13 78 4.1.8. NTPv4 Port Negotiation . . . . . . . . . . . . . . . 14 79 4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 14 80 5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 15 81 5.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 15 82 5.2. Packet Structure Overview . . . . . . . . . . . . . . . . 15 83 5.3. The Unique Identifier Extension Field . . . . . . . . . . 16 84 5.4. The NTS Cookie Extension Field . . . . . . . . . . . . . 16 85 5.5. The NTS Cookie Placeholder Extension Field . . . . . . . 17 86 5.6. The NTS Authenticator and Encrypted Extension Fields 87 Extension Field . . . . . . . . . . . . . . . . . . . . . 17 88 5.7. Protocol Details . . . . . . . . . . . . . . . . . . . . 19 89 6. Suggested Format for NTS Cookies . . . . . . . . . . . . . . 23 90 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 91 7.1. Service Name and Transport Protocol Port Number Registry 25 92 7.2. TLS Application-Layer Protocol Negotiation (ALPN) 93 Protocol IDs Registry . . . . . . . . . . . . . . . . . . 25 94 7.3. TLS Exporter Labels Registry . . . . . . . . . . . . . . 26 95 7.4. NTP Kiss-o'-Death Codes Registry . . . . . . . . . . . . 26 96 7.5. NTP Extension Field Types Registry . . . . . . . . . . . 26 97 7.6. Network Time Security Key Establishment Record Types 98 Registry . . . . . . . . . . . . . . . . . . . . . . . . 27 99 7.7. Network Time Security Next Protocols Registry . . . . . . 28 100 7.8. Network Time Security Error and Warning Codes Registries 29 101 8. Implementation Status - RFC EDITOR: REMOVE BEFORE PUBLICATION 30 102 8.1. Implementation 1 . . . . . . . . . . . . . . . . . . . . 30 103 8.1.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 30 104 8.1.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 31 105 8.1.3. Contact Information . . . . . . . . . . . . . . . . . 31 106 8.1.4. Last Update . . . . . . . . . . . . . . . . . . . . . 31 107 8.2. Implementation 2 . . . . . . . . . . . . . . . . . . . . 31 108 8.2.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 31 109 8.2.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 31 110 8.2.3. Contact Information . . . . . . . . . . . . . . . . . 31 111 8.2.4. Last Update . . . . . . . . . . . . . . . . . . . . . 31 112 8.3. Implementation 3 . . . . . . . . . . . . . . . . . . . . 32 113 8.3.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 32 114 8.3.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 32 115 8.3.3. Contact Information . . . . . . . . . . . . . . . . . 32 116 8.3.4. Last Update . . . . . . . . . . . . . . . . . . . . . 32 117 8.4. Implementation 4 . . . . . . . . . . . . . . . . . . . . 32 118 8.4.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 32 119 8.4.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 33 120 8.4.3. Contact Information . . . . . . . . . . . . . . . . . 33 121 8.4.4. Last Update . . . . . . . . . . . . . . . . . . . . . 33 122 8.5. Implementation 5 . . . . . . . . . . . . . . . . . . . . 33 123 8.5.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 33 124 8.5.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 33 125 8.5.3. Contact Information . . . . . . . . . . . . . . . . . 33 126 8.5.4. Last Update . . . . . . . . . . . . . . . . . . . . . 33 127 8.6. Implementation 6 . . . . . . . . . . . . . . . . . . . . 33 128 8.6.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 34 129 8.6.2. Licensing . . . . . . . . . . . . . . . . . . . . . . 34 130 8.6.3. Contact Information . . . . . . . . . . . . . . . . . 34 131 8.6.4. Last Update . . . . . . . . . . . . . . . . . . . . . 34 132 8.7. Interoperability . . . . . . . . . . . . . . . . . . . . 34 133 9. Security Considerations . . . . . . . . . . . . . . . . . . . 34 134 9.1. Protected Modes . . . . . . . . . . . . . . . . . . . . . 34 135 9.2. Sensitivity to DDoS Attacks . . . . . . . . . . . . . . . 35 136 9.3. Avoiding DDoS Amplification . . . . . . . . . . . . . . . 35 137 9.4. Initial Verification of Server Certificates . . . . . . . 36 138 9.5. Delay Attacks . . . . . . . . . . . . . . . . . . . . . . 37 139 9.6. NTS Stripping . . . . . . . . . . . . . . . . . . . . . . 37 140 10. Privacy Considerations . . . . . . . . . . . . . . . . . . . 38 141 10.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 38 142 10.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 39 144 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 39 145 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 39 146 12.1. Normative References . . . . . . . . . . . . . . . . . . 39 147 12.2. Informative References . . . . . . . . . . . . . . . . . 41 148 Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 42 149 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 151 1. Introduction 153 This memo specifies Network Time Security (NTS), a cryptographic 154 security mechanism for network time synchronization. A complete 155 specification is provided for application of NTS to the client-server 156 mode of the Network Time Protocol (NTP) [RFC5905]. 158 1.1. Objectives 160 The objectives of NTS are as follows: 162 o Identity: Through the use of a X.509 public key infrastructure, 163 implementations may cryptographically establish the identity of 164 the parties they are communicating with. 166 o Authentication: Implementations may cryptographically verify that 167 any time synchronization packets are authentic, i.e., that they 168 were produced by an identified party and have not been modified in 169 transit. 171 o Confidentiality: Although basic time synchronization data is 172 considered non-confidential and sent in the clear, NTS includes 173 support for encrypting NTP extension fields. 175 o Replay prevention: Client implementations may detect when a 176 received time synchronization packet is a replay of a previous 177 packet. 179 o Request-response consistency: Client implementations may verify 180 that a time synchronization packet received from a server was sent 181 in response to a particular request from the client. 183 o Unlinkability: For mobile clients, NTS will not leak any 184 information additional to NTP which would permit a passive 185 adversary to determine that two packets sent over different 186 networks came from the same client. 188 o Non-amplification: Implementations (especially server 189 implementations) may avoid acting as distributed denial-of-service 190 (DDoS) amplifiers by never responding to a request with a packet 191 larger than the request packet. 193 o Scalability: Server implementations may serve large numbers of 194 clients without having to retain any client-specific state. 196 o Performance: NTS must not significantly degrade the quality of the 197 time transfer. The encryption and authentication used when 198 actually transferring time should be lightweight (see RFC 7384, 199 Section 5.7 [RFC7384]). 201 1.2. Protocol Overview 203 The Network Time Protocol includes many different operating modes to 204 support various network topologies (see RFC 5905, Section 3 205 [RFC5905]). In addition to its best-known and most-widely-used 206 client-server mode, it also includes modes for synchronization 207 between symmetric peers, a control mode for server monitoring and 208 administration, and a broadcast mode. These various modes have 209 differing and partly contradictory requirements for security and 210 performance. Symmetric and control modes demand mutual 211 authentication and mutual replay protection. Additionally, for 212 certain message types control mode may require confidentiality as 213 well as authentication. Client-server mode places more stringent 214 requirements on resource utilization than other modes, because 215 servers may have vast number of clients and be unable to afford to 216 maintain per-client state. However, client-server mode also has more 217 relaxed security needs, because only the client requires replay 218 protection: it is harmless for stateless servers to process replayed 219 packets. The security demands of symmetric and control modes, on the 220 other hand, are in conflict with the resource-utilization demands of 221 client-server mode: any scheme which provides replay protection 222 inherently involves maintaining some state to keep track of what 223 messages have already been seen. 225 This memo specifies NTS exclusively for the client-server mode of 226 NTP. To this end, NTS is structured as a suite of two protocols: 228 The "NTS Extensions for NTPv4" define a collection of NTP 229 extension fields for cryptographically securing NTPv4 using 230 previously-established key material. They are suitable for 231 securing client-server mode because the server can implement them 232 without retaining per-client state. All state is kept by the 233 client and provided to the server in the form of an encrypted 234 cookie supplied with each request. On the other hand, the NTS 235 Extension Fields are suitable *only* for client-server mode 236 because only the client, and not the server, is protected from 237 replay. 239 The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for 240 establishing key material for use with the NTS Extension Fields 241 for NTPv4. It uses TLS to exchange keys, provide the client with 242 an initial supply of cookies, and negotiate some additional 243 protocol options. After this exchange, the TLS channel is closed 244 with no per-client state remaining on the server side. 246 The typical protocol flow is as follows: The client connects to an 247 NTS-KE server on the NTS TCP port and the two parties perform a TLS 248 handshake. Via the TLS channel, the parties negotiate some 249 additional protocol parameters and the server sends the client a 250 supply of cookies along with an address of an NTP server for which 251 the cookies are valid. The parties use TLS key export [RFC5705] to 252 extract key material which will be used in the next phase of the 253 protocol. This negotiation takes only a single round trip, after 254 which the server closes the connection and discards all associated 255 state. At this point the NTS-KE phase of the protocol is complete. 256 Ideally, the client never needs to connect to the NTS-KE server 257 again. 259 Time synchronization proceeds with the indicated NTP server over the 260 NTP UDP port. The client sends the server an NTP client packet which 261 includes several extension fields. Included among these fields are a 262 cookie (previously provided by the key exchange server) and an 263 authentication tag, computed using key material extracted from the 264 NTS-KE handshake. The NTP server uses the cookie to recover this key 265 material and send back an authenticated response. The response 266 includes a fresh, encrypted cookie which the client then sends back 267 in the clear in a subsequent request. (This constant refreshing of 268 cookies is necessary in order to achieve NTS's unlinkability goal.) 270 Figure 1 provides an overview of the high-level interaction between 271 the client, the NTS-KE server, and the NTP server. Note that the 272 cookies' data format and the exchange of secrets between NTS-KE and 273 NTP servers are not part of this specification and are implementation 274 dependent. However, a suggested format for NTS cookies is provided 275 in Section 6. 277 +--------------+ 278 | | 279 +-> | NTP Server 1 | 280 | | | 281 Shared cookie | +--------------+ 282 +---------------+ encryption parameters | +--------------+ 283 | | (Implementation dependent) | | | 284 | NTS-KE Server | <------------------------------+-> | NTP Server 2 | 285 | | | | | 286 +---------------+ | +--------------+ 287 ^ | . 288 | | . 289 | 1. Negotiate parameters, | . 290 | receive initial cookie | +--------------+ 291 | supply, generate AEAD keys, | | | 292 | and receive NTP server IP +-> | NTP Server N | 293 | addresses using "NTS Key | | 294 | Establishment" protocol. +--------------+ 295 | ^ 296 | | 297 | +----------+ | 298 | | | | 299 +-----------> | Client | <-------------------------+ 300 | | 2. Perform authenticated 301 +----------+ time synchronization 302 and generate new 303 cookies using "NTS 304 Extension Fields for 305 NTPv4". 307 Figure 1: Overview of High-Level Interactions in NTS 309 2. Requirements Language 311 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 312 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 313 "OPTIONAL" in this document are to be interpreted as described in 314 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 315 capitals, as shown here. 317 3. TLS profile for Network Time Security 319 Network Time Security makes use of TLS for NTS key establishment. 321 Since the NTS protocol is new as of this publication, no backward- 322 compatibility concerns exist to justify using obsolete, insecure, or 323 otherwise broken TLS features or versions. Implementations MUST 324 conform with [RFC7525] or with a later revision of BCP 195. In 325 particular, failure to use cipher suites that provide forward secrecy 326 will make all negotiated NTS keys recoverable by anyone that gains 327 access to the NTS-KE server's private key. Furthermore: 329 Implementations MUST NOT negotiate TLS versions earlier than 1.2, 330 SHOULD negotiate TLS 1.3 [RFC8446] or later when possible, and MAY 331 refuse to negotiate any TLS version which has been superseded by a 332 later supported version. 334 Use of the Application-Layer Protocol Negotiation Extension [RFC7301] 335 is integral to NTS and support for it is REQUIRED for 336 interoperability. 338 4. The NTS Key Establishment Protocol 340 The NTS key establishment protocol is conducted via TCP port 341 [[TBD1]]. The two endpoints carry out a TLS handshake in conformance 342 with Section 3, with the client offering (via an ALPN [RFC7301] 343 extension), and the server accepting, an application-layer protocol 344 of "ntske/1". Immediately following a successful handshake, the 345 client SHALL send a single request as Application Data encapsulated 346 in the TLS-protected channel. Then, the server SHALL send a single 347 response followed by a TLS "Close notify" alert and then discard the 348 channel state. 350 The client's request and the server's response each SHALL consist of 351 a sequence of records formatted according to Figure 2. The request 352 and a non-error response each SHALL include exactly one NTS Next 353 Protocol Negotiation record. The sequence SHALL be terminated by a 354 "End of Message" record. The requirement that all NTS-KE messages be 355 terminated by an End of Message record makes them self-delimiting. 357 Clients and servers MAY enforce length limits on requests and 358 responses, however, servers MUST accept requests of at least 1024 359 octets and clients SHOULD accept responses of at least 65536 octets. 361 0 1 2 3 362 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 363 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 364 |C| Record Type | Body Length | 365 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 366 | | 367 . . 368 . Record Body . 369 . . 370 | | 371 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 373 Figure 2: NTS-KE Record Format 375 The fields of an NTS-KE record are defined as follows: 377 C (Critical Bit): Determines the disposition of unrecognized 378 Record Types. Implementations which receive a record with an 379 unrecognized Record Type MUST ignore the record if the Critical 380 Bit is 0 and MUST treat it as an error if the Critical Bit is 1 381 (see Section 4.1.3). 383 Record Type Number: A 15-bit integer in network byte order. The 384 semantics of record types 0-7 are specified in this memo. 385 Additional type numbers SHALL be tracked through the IANA Network 386 Time Security Key Establishment Record Types registry. 388 Body Length: The length of the Record Body field, in octets, as a 389 16-bit integer in network byte order. Record bodies MAY have any 390 representable length and need not be aligned to a word boundary. 392 Record Body: The syntax and semantics of this field SHALL be 393 determined by the Record Type. 395 For clarity regarding bit-endianness: the Critical Bit is the most- 396 significant bit of the first octet. In the C programming language, 397 given a network buffer `unsigned char b[]` containing an NTS-KE 398 record, the critical bit is `b[0] >> 7` while the record type is 399 `((b[0] & 0x7f) << 8) + b[1]`. 401 Note that, although the Type-Length-Body format of an NTS-KE record 402 is similar to that of an NTP extension field, the semantics of the 403 length field differ. While the length subfield of an NTP extension 404 field gives the length of the entire extension field including the 405 type and length subfields, the length field of an NTS-KE record gives 406 just the length of the body. 408 Figure 3 provides a schematic overview of the key exchange. It 409 displays the protocol steps to be performed by the NTS client and 410 server and record types to be exchanged. 412 +---------------------------------------+ 413 | - Verify client request message. | 414 | - Extract TLS key material. | 415 | - Generate KE response message. | 416 | - Include Record Types: | 417 | o NTS Next Protocol Negotiation | 418 | o AEAD Algorithm Negotiation | 419 | o NTP Server Negotiation | 420 | o New Cookie for NTPv4 | 421 | o | 422 | o End of Message | 423 +-----------------+---------------------+ 424 | 425 | 426 Server -----------+---------------+-----+-----------------------> 427 ^ \ 428 / \ 429 / TLS application \ 430 / data \ 431 / \ 432 / V 433 Client -----+---------------------------------+-----------------> 434 | | 435 | | 436 | | 437 +-----------+----------------------+ +------+-----------------+ 438 |- Generate KE request message. | |- Verify server response| 439 | - Include Record Types: | | message. | 440 | o NTS Next Protocol Negotiation | |- Extract cookie(s). | 441 | o AEAD Algorithm Negotiation | | | 442 | o | | | 443 | o End of Message | | | 444 +----------------------------------+ +------------------------+ 446 Figure 3: NTS Key Exchange Messages 448 4.1. NTS-KE Record Types 450 The following NTS-KE Record Types are defined: 452 4.1.1. End of Message 454 The End of Message record has a Record Type number of 0 and a zero- 455 length body. It MUST occur exactly once as the final record of every 456 NTS-KE request and response. The Critical Bit MUST be set. 458 4.1.2. NTS Next Protocol Negotiation 460 The NTS Next Protocol Negotiation record has a Record Type number of 461 1. It MUST occur exactly once in every NTS-KE request and response. 462 Its body consists of a sequence of 16-bit unsigned integers in 463 network byte order. Each integer represents a Protocol ID from the 464 IANA Network Time Security Next Protocols registry. The Critical Bit 465 MUST be set. 467 The Protocol IDs listed in the client's NTS Next Protocol Negotiation 468 record denote those protocols which the client wishes to speak using 469 the key material established through this NTS-KE session. Protocol 470 IDs listed in the NTS-KE server's response MUST comprise a subset of 471 those listed in the request and denote those protocols which the NTP 472 server is willing and able to speak using the key material 473 established through this NTS-KE session. The client MAY proceed with 474 one or more of them. The request MUST list at least one protocol, 475 but the response MAY be empty. 477 4.1.3. Error 479 The Error record has a Record Type number of 2. Its body is exactly 480 two octets long, consisting of an unsigned 16-bit integer in network 481 byte order, denoting an error code. The Critical Bit MUST be set. 483 Clients MUST NOT include Error records in their request. If clients 484 receive a server response which includes an Error record, they MUST 485 discard any key material negotiated during the initial TLS exchange 486 and MUST NOT proceed to the Next Protocol. 488 The following error codes are defined: 490 Error code 0 means "Unrecognized Critical Record". The server 491 MUST respond with this error code if the request included a record 492 which the server did not understand and which had its Critical Bit 493 set. The client SHOULD NOT retry its request without 494 modification. 496 Error code 1 means "Bad Request". The server MUST respond with 497 this error if the request is not complete and syntactically well- 498 formed, or, upon the expiration of an implementation-defined 499 timeout, it has not yet received such a request. 501 Error code 2 means "Internal Server Error". The server MUST 502 respond with this error if it is unable to respond properly due to 503 an internal condition. 505 4.1.4. Warning 507 The Warning record has a Record Type number of 3. Its body is 508 exactly two octets long, consisting of an unsigned 16-bit integer in 509 network byte order, denoting a warning code. The Critical Bit MUST 510 be set. 512 Clients MUST NOT include Warning records in their request. If 513 clients receive a server response which includes a Warning record, 514 they MAY discard any negotiated key material and abort without 515 proceeding to the Next Protocol. Unrecognized warning codes MUST be 516 treated as errors. 518 This memo defines no warning codes. 520 4.1.5. AEAD Algorithm Negotiation 522 The AEAD Algorithm Negotiation record has a Record Type number of 4. 523 Its body consists of a sequence of unsigned 16-bit integers in 524 network byte order, denoting Numeric Identifiers from the IANA AEAD 525 Algorithms registry [IANA-AEAD]. The Critical Bit MAY be set. 527 If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for 528 NTPv4), then this record MUST be included exactly once. Other 529 protocols MAY require it as well. 531 When included in a request, this record denotes which AEAD algorithms 532 the client is willing to use to secure the Next Protocol, in 533 decreasing preference order. When included in a response, this 534 record denotes which algorithm the server chooses to use. It is 535 empty if the server supports none of the algorithms offered. In 536 requests, the list MUST include at least one algorithm. In 537 responses, it MUST include at most one. Honoring the client's 538 preference order is OPTIONAL: servers may select among any of the 539 client's offered choices, even if they are able to support some other 540 algorithm which the client prefers more. 542 Server implementations of NTS extension fields for NTPv4 (Section 5) 543 MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). 544 That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD 545 Algorithm Negotiation record and the server accepts Protocol ID 0 546 (NTPv4) in its NTS Next Protocol Negotiation record, then the 547 server's AEAD Algorithm Negotiation record MUST NOT be empty. 549 4.1.6. New Cookie for NTPv4 551 The New Cookie for NTPv4 record has a Record Type number of 5. The 552 contents of its body SHALL be implementation-defined and clients MUST 553 NOT attempt to interpret them. See Section 6 for a suggested 554 construction. 556 Clients MUST NOT send records of this type. Servers MUST send at 557 least one record of this type, and SHOULD send eight of them, if the 558 Next Protocol Negotiation response record contains Protocol ID 0 559 (NTPv4) and the AEAD Algorithm Negotiation response record is not 560 empty. The Critical Bit SHOULD NOT be set. 562 4.1.7. NTPv4 Server Negotiation 564 The NTPv4 Server Negotiation record has a Record Type number of 6. 565 Its body consists of an ASCII-encoded [RFC0020] string. The contents 566 of the string SHALL be either an IPv4 address, an IPv6 address, or a 567 fully qualified domain name (FQDN). IPv4 addresses MUST be in dotted 568 decimal notation. IPv6 addresses MUST conform to the "Text 569 Representation of Addresses" as specified in RFC 4291 [RFC4291] and 570 MUST NOT include zone identifiers [RFC6874]. If a label contains at 571 least one non-ASCII character, it is an internationalized domain name 572 and an A-LABEL MUST be used as defined in section 2.3.2.1 of RFC 5890 573 [RFC5890]. If the record contains a domain name, the recipient MUST 574 treat it as a FQDN, e.g. by making sure it ends with a dot. 576 When NTPv4 is negotiated as a Next Protocol and this record is sent 577 by the server, the body specifies the hostname or IP address of the 578 NTPv4 server with which the client should associate and which will 579 accept the supplied cookies. If no record of this type is sent, the 580 client SHALL interpret this as a directive to associate with an NTPv4 581 server at the same IP address as the NTS-KE server. Servers MUST NOT 582 send more than one record of this type. 584 When this record is sent by the client, it indicates that the client 585 wishes to associate with the specified NTP server. The NTS-KE server 586 MAY incorporate this request when deciding what NTPv4 Server 587 Negotiation records to respond with, but honoring the client's 588 preference is OPTIONAL. The client MUST NOT send more than one 589 record of this type. 591 If the client has sent a record of this type, the NTS-KE server 592 SHOULD reply with the same record if it is valid and the server is 593 able to supply cookies for it. If the client has not sent any record 594 of this type, the NTS-KE server SHOULD respond with either an NTP 595 server address in the same family as the NTS-KE session or a FQDN 596 that can be resolved to an address in that family, if such 597 alternatives are available. 599 Servers MAY set the Critical Bit on records of this type; clients 600 SHOULD NOT. 602 4.1.8. NTPv4 Port Negotiation 604 The NTPv4 Port Negotiation record has a Record Type number of 7. Its 605 body consists of a 16-bit unsigned integer in network byte order, 606 denoting a UDP port number. 608 When NTPv4 is negotiated as a Next Protocol and this record is sent 609 by the server, the body specifies the port number of the NTPv4 server 610 with which the client should associate and which will accept the 611 supplied cookies. If no record of this type is sent, the client 612 SHALL assume a default of 123 (the registered port number for NTP). 614 When this record is sent by the client in conjunction with a NTPv4 615 Server Negotiation record, it indicates that the client wishes to 616 associate with the NTP server at the specified port. The NTS-KE 617 server MAY incorporate this request when deciding what NTPv4 Server 618 Negotiation and NTPv4 Port Negotiation records to respond with, but 619 honoring the client's preference is OPTIONAL. 621 Servers MAY set the Critical Bit on records of this type; clients 622 SHOULD NOT. 624 4.2. Key Extraction (generally) 626 Following a successful run of the NTS-KE protocol, key material SHALL 627 be extracted using the TLS pseudorandom function (PRF) [RFC5705] for 628 TLS version 1.2, or the HMAC-based Extract-and-Expand Key Derivation 629 Function (HKDF) [RFC5869] in accordance with RFC 8446, Section 7.5 630 [RFC8446] for TLS version 1.3. Inputs to the exporter function are 631 to be constructed in a manner specific to the negotiated Next 632 Protocol. However, all protocols which utilize NTS-KE MUST conform 633 to the following two rules: 635 The disambiguating label string MUST be "EXPORTER-network-time- 636 security/1". 638 The per-association context value MUST be provided and MUST begin 639 with the two-octet Protocol ID which was negotiated as a Next 640 Protocol. 642 5. NTS Extension Fields for NTPv4 644 5.1. Key Extraction (for NTPv4) 646 Following a successful run of the NTS-KE protocol wherein Protocol ID 647 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 648 extracted: a client-to-server (C2S) key and a server-to-client (S2C) 649 key. These keys SHALL be computed with the PRF defined in RFC 5705 650 [RFC5705] for TLS version 1.2, or the HKDF defined in RFC 8446, 651 Section 7.5 [RFC8446] for TLS version 1.3, using the following 652 inputs. 654 The disambiguating label string (for PRF) or label (for HKDF) 655 SHALL be "EXPORTER-network-time-security/1". 657 The context value SHALL consist of the following five octets: 659 The first two octets SHALL be zero (the Protocol ID for NTPv4). 661 The next two octets SHALL be the Numeric Identifier of the 662 negotiated AEAD Algorithm in network byte order. 664 The final octet SHALL be 0x00 for the C2S key and 0x01 for the 665 S2C key. 667 Implementations wishing to derive additional keys for private or 668 experimental use MUST NOT do so by extending the above-specified 669 syntax for per-association context values. Instead, they SHOULD use 670 their own disambiguating label string. Note that RFC 5705 [RFC5705] 671 provides that disambiguating label strings beginning with 672 "EXPERIMENTAL" MAY be used without IANA registration. 674 5.2. Packet Structure Overview 676 In general, an NTS-protected NTPv4 packet consists of: 678 The usual 48-octet NTP header which is authenticated but not 679 encrypted. 681 Some extension fields which are authenticated but not encrypted. 683 An extension field which contains AEAD output (i.e., an 684 authentication tag and possible ciphertext). The corresponding 685 plaintext, if non-empty, consists of some extension fields which 686 benefit from both encryption and authentication. 688 Possibly, some additional extension fields which are neither 689 encrypted nor authenticated. In general, these are discarded by 690 the receiver. 692 Always included among the authenticated or authenticated-and- 693 encrypted extension fields are a cookie extension field and a unique 694 identifier extension field, as described in Section 5.7. The purpose 695 of the cookie extension field is to enable the server to offload 696 storage of session state onto the client. The purpose of the unique 697 identifier extension field is to protect the client from replay 698 attacks. 700 5.3. The Unique Identifier Extension Field 702 The Unique Identifier extension field provides the client with a 703 cryptographically strong means of detecting replayed packets. It has 704 a Field Type of [[TBD2]]. When the extension field is included in a 705 client packet (mode 3), its body SHALL consist of a string of octets 706 generated uniformly at random. The string MUST be at least 32 octets 707 long. When the extension field is included in a server packet (mode 708 4), its body SHALL contain the same octet string as was provided in 709 the client packet to which the server is responding. All server 710 packets generated by NTS-implementing servers in response to client 711 packets containing this extension field MUST also contain this field 712 with the same content as in the client's request. The field's use in 713 modes other than client-server is not defined. 715 This extension field MAY also be used standalone, without NTS, in 716 which case it provides the client with a means of detecting spoofed 717 packets from off-path attackers. Historically, NTP's origin 718 timestamp field has played both these roles, but for cryptographic 719 purposes this is suboptimal because it is only 64 bits long and, 720 depending on implementation details, most of those bits may be 721 predictable. In contrast, the Unique Identifier extension field 722 enables a degree of unpredictability and collision resistance more 723 consistent with cryptographic best practice. 725 5.4. The NTS Cookie Extension Field 727 The NTS Cookie extension field has a Field Type of [[TBD3]]. Its 728 purpose is to carry information which enables the server to recompute 729 keys and other session state without having to store any per-client 730 state. The contents of its body SHALL be implementation-defined and 731 clients MUST NOT attempt to interpret them. See Section 6 for a 732 suggested construction. The NTS Cookie extension field MUST NOT be 733 included in NTP packets whose mode is other than 3 (client) or 4 734 (server). 736 5.5. The NTS Cookie Placeholder Extension Field 738 The NTS Cookie Placeholder extension field has a Field Type of 739 [[TBD4]]. When this extension field is included in a client packet 740 (mode 3), it communicates to the server that the client wishes it to 741 send additional cookies in its response. This extension field MUST 742 NOT be included in NTP packets whose mode is other than 3. 744 Whenever an NTS Cookie Placeholder extension field is present, it 745 MUST be accompanied by an NTS Cookie extension field. The body 746 length of the NTS Cookie Placeholder extension field MUST be the same 747 as the body length of the NTS Cookie extension field. This length 748 requirement serves to ensure that the response will not be larger 749 than the request, in order to improve timekeeping precision and 750 prevent DDoS amplification. The contents of the NTS Cookie 751 Placeholder extension field's body SHOULD be all zeros and, aside 752 from checking its length, MUST be ignored by the server. 754 5.6. The NTS Authenticator and Encrypted Extension Fields Extension 755 Field 757 The NTS Authenticator and Encrypted Extension Fields extension field 758 is the central cryptographic element of an NTS-protected NTP packet. 759 Its Field Type is [[TBD5]]. It SHALL be formatted according to 760 Figure 4 and include the following fields: 762 Nonce Length: Two octets in network byte order, giving the length 763 of the Nonce field, excluding any padding, interpreted as an 764 unsigned integer. 766 Ciphertext Length: Two octets in network byte order, giving the 767 length of the Ciphertext field, excluding any padding, interpreted 768 as an unsigned integer. 770 Nonce: A nonce as required by the negotiated AEAD Algorithm. The 771 end of the field is zero-padded to a word (four octets) boundary. 773 Ciphertext: The output of the negotiated AEAD Algorithm. The 774 structure of this field is determined by the negotiated algorithm, 775 but it typically contains an authentication tag in addition to the 776 actual ciphertext. The end of the field is zero-padded to a word 777 (four octets) boundary. 779 Additional Padding: Clients which use a nonce length shorter than 780 the maximum allowed by the negotiated AEAD algorithm may be 781 required to include additional zero-padding. The necessary length 782 of this field is specified below. 784 0 1 2 3 785 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 786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 787 | Nonce Length | Ciphertext Length | 788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 789 | | 790 . . 791 . Nonce, including up to 3 octets padding . 792 . . 793 | | 794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 795 | | 796 . . 797 . Ciphertext, including up to 3 octets padding . 798 . . 799 | | 800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 801 | | 802 . . 803 . Additional Padding . 804 . . 805 | | 806 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 808 Figure 4: NTS Authenticator and Encrypted Extension Fields Extension 809 Field Format 811 The Ciphertext field SHALL be formed by providing the following 812 inputs to the negotiated AEAD Algorithm: 814 K: For packets sent from the client to the server, the C2S key 815 SHALL be used. For packets sent from the server to the client, 816 the S2C key SHALL be used. 818 A: The associated data SHALL consist of the portion of the NTP 819 packet beginning from the start of the NTP header and ending at 820 the end of the last extension field which precedes the NTS 821 Authenticator and Encrypted Extension Fields extension field. 823 P: The plaintext SHALL consist of all (if any) NTP extension 824 fields to be encrypted; if multiple extension fields are present 825 they SHALL be joined by concatenation. Each such field SHALL be 826 formatted in accordance with RFC 7822 [RFC7822], except that, 827 contrary to the RFC 7822 requirement that fields have a minimum 828 length of 16 or 28 octets, encrypted extension fields MAY be 829 arbitrarily short (but still MUST be a multiple of 4 octets in 830 length). 832 N: The nonce SHALL be formed however required by the negotiated 833 AEAD algorithm. 835 The purpose of the Additional Padding field is to ensure that servers 836 can always choose a nonce whose length is adequate to ensure its 837 uniqueness, even if the client chooses a shorter one, and still 838 ensure that the overall length of the server's response packet does 839 not exceed the length of the request. For mode 4 (server) packets, 840 no Additional Padding field is ever required. For mode 3 (client) 841 packets, the length of the Additional Padding field SHALL be computed 842 as follows. Let `N_LEN` be the padded length of the Nonce field. 843 Let `N_MAX` be, as specified by RFC 5116 [RFC5116], the maximum 844 permitted nonce length for the negotiated AEAD algorithm. Let 845 `N_REQ` be the lesser of 16 and N_MAX, rounded up to the nearest 846 multiple of 4. If N_LEN is greater than or equal to N_REQ, then no 847 Additional Padding field is required. Otherwise, the Additional 848 Padding field SHALL be at least N_REQ - N_LEN octets in length. 849 Servers MUST enforce this requirement by discarding any packet which 850 does not conform to it. 852 Senders are always free to include more Additional Padding than 853 mandated by the above paragraph. Theoretically, it could be 854 necessary to do so in order to bring the extension field to the 855 minimum length required by [RFC7822]. This should never happen in 856 practice because any reasonable AEAD algorithm will have a nonce and 857 an authenticator long enough to bring the extension field to its 858 required length already. Nonetheless, implementers are advised to 859 explicitly handle this case and ensure that the extension field they 860 emit is of legal length. 862 The NTS Authenticator and Encrypted Extension Fields extension field 863 MUST NOT be included in NTP packets whose mode is other than 3 864 (client) or 4 (server). 866 5.7. Protocol Details 868 A client sending an NTS-protected request SHALL include the following 869 extension fields as displayed in Figure 5: 871 Exactly one Unique Identifier extension field which MUST be 872 authenticated, MUST NOT be encrypted, and whose contents MUST be 873 the output of a cryptographically secure random number generator. 874 [RFC4086] 876 Exactly one NTS Cookie extension field which MUST be authenticated 877 and MUST NOT be encrypted. The cookie MUST be one which has been 878 previously provided to the client, either from the key exchange 879 server during the NTS-KE handshake or from the NTP server in 880 response to a previous NTS-protected NTP request. 882 Exactly one NTS Authenticator and Encrypted Extension Fields 883 extension field, generated using an AEAD Algorithm and C2S key 884 established through NTS-KE. 886 To protect the client's privacy, the client SHOULD avoid reusing a 887 cookie. If the client does not have any cookies that it has not 888 already sent, it SHOULD initiate a re-run of the NTS-KE protocol. 889 The client MAY reuse cookies in order to prioritize resilience over 890 unlinkability. Which of the two that should be prioritized in any 891 particular case is dependent on the application and the user's 892 preference. Section 10.1 describes the privacy considerations of 893 this in further detail. 895 The client MAY include one or more NTS Cookie Placeholder extension 896 fields which MUST be authenticated and MAY be encrypted. The number 897 of NTS Cookie Placeholder extension fields that the client includes 898 SHOULD be such that if the client includes N placeholders and the 899 server sends back N+1 cookies, the number of unused cookies stored by 900 the client will come to eight. The client SHOULD NOT include more 901 than seven NTS Cookie Placeholder extension fields in a request. 902 When both the client and server adhere to all cookie-management 903 guidance provided in this memo, the number of placeholder extension 904 fields will equal the number of dropped packets since the last 905 successful volley. 907 In rare circumstances, it may be necessary to include fewer NTS 908 Cookie Placeholder extensions than recommended above in order to 909 prevent datagram fragmentation. When cookies adhere the format 910 recommended in Section 6 and the AEAD in use is the mandatory-to- 911 implement AEAD_AES_SIV_CMAC_256, senders can include a cookie and 912 seven placeholders and still have packet size fall comfortably below 913 1280 octets if no non-NTS-related extensions are used; 1280 octets is 914 the minimum prescribed MTU for IPv6 and is generally safe for 915 avoiding IPv4 fragmentation. Nonetheless, senders SHOULD include 916 fewer cookies and placeholders than otherwise indicated if doing so 917 is necessary to prevent fragmentation. 919 +---------------------------------------+ 920 | - Verify time request message | 921 | - Generate time response message | 922 | - Included NTPv4 extension fields | 923 | o Unique Identifier EF | 924 | o NTS Authentication and | 925 | Encrypted Extension Fields EF | 926 | - NTS Cookie EF | 927 | - | 928 | - Transmit time request packet | 929 +-----------------+---------------------+ 930 | 931 | 932 Server -----------+---------------+-----+-----------------------> 933 ^ \ 934 / \ 935 Time request / \ Time response 936 (mode 3) / \ (mode 4) 937 / \ 938 / V 939 Client -----+---------------------------------+-----------------> 940 | | 941 | | 942 | | 943 +-----------+----------------------+ +------+-----------------+ 944 |- Generate time request message | |- Verify time response | 945 | - Include NTPv4 Extension fields | | message | 946 | o Unique Identifier EF | |- Extract cookie(s) | 947 | o NTS Cookie EF | |- Time synchronization | 948 | o | | processing | 949 | | +------------------------+ 950 |- Generate AEAD tag of NTP message| 951 |- Add NTS Authentication and | 952 | Encrypted Extension Fields EF | 953 |- Transmit time request packet | 954 +----------------------------------+ 956 Figure 5: NTS-protected NTP Time Synchronization Messages 958 The client MAY include additional (non-NTS-related) extension fields 959 which MAY appear prior to the NTS Authenticator and Encrypted 960 Extension Fields extension fields (therefore authenticated but not 961 encrypted), within it (therefore encrypted and authenticated), or 962 after it (therefore neither encrypted nor authenticated). The server 963 MUST discard any unauthenticated extension fields. Future 964 specifications of extension fields MAY provide exceptions to this 965 rule. 967 Upon receiving an NTS-protected request, the server SHALL (through 968 some implementation-defined mechanism) use the cookie to recover the 969 AEAD Algorithm, C2S key, and S2C key associated with the request, and 970 then use the C2S key to authenticate the packet and decrypt the 971 ciphertext. If the cookie is valid and authentication and decryption 972 succeed, the server SHALL include the following extension fields in 973 its response: 975 Exactly one Unique Identifier extension field which MUST be 976 authenticated, MUST NOT be encrypted, and whose contents SHALL 977 echo those provided by the client. 979 Exactly one NTS Authenticator and Encrypted Extension Fields 980 extension field, generated using the AEAD algorithm and S2C key 981 recovered from the cookie provided by the client. 983 One or more NTS Cookie extension fields which MUST be 984 authenticated and encrypted. The number of NTS Cookie extension 985 fields included SHOULD be equal to, and MUST NOT exceed, one plus 986 the number of valid NTS Cookie Placeholder extension fields 987 included in the request. The cookies returned in those fields 988 MUST be valid for use with the NTP server that sent them. They 989 MAY be valid for other NTP servers as well, but there is no way 990 for the server to indicate this. 992 We emphasize the contrast that NTS Cookie extension fields MUST NOT 993 be encrypted when sent from client to server, but MUST be encrypted 994 when sent from server to client. The former is necessary in order 995 for the server to be able to recover the C2S and S2C keys, while the 996 latter is necessary to satisfy the unlinkability goals discussed in 997 Section 10.1. We emphasize also that "encrypted" means encapsulated 998 within the NTS Authenticator and Encrypted Extensions extension 999 field. While the body of an NTS Cookie extension field will 1000 generally consist of some sort of AEAD output (regardless of whether 1001 the recommendations of Section 6 are precisely followed), this is not 1002 sufficient to make the extension field "encrypted". 1004 The server MAY include additional (non-NTS-related) extension fields 1005 which MAY appear prior to the NTS Authenticator and Encrypted 1006 Extension Fields extension field (therefore authenticated but not 1007 encrypted), within it (therefore encrypted and authenticated), or 1008 after it (therefore neither encrypted nor authenticated). The client 1009 MUST discard any unauthenticated extension fields. Future 1010 specifications of extension fields MAY provide exceptions to this 1011 rule. 1013 Upon receiving an NTS-protected response, the client MUST verify that 1014 the Unique Identifier matches that of an outstanding request, and 1015 that the packet is authentic under the S2C key associated with that 1016 request. If either of these checks fails, the packet MUST be 1017 discarded without further processing. 1019 If the server is unable to validate the cookie or authenticate the 1020 request, it SHOULD respond with a Kiss-o'-Death (KoD) packet (see RFC 1021 5905, Section 7.4 [RFC5905]) with kiss code "NTSN", meaning "NTS NAK" 1022 (NTS negative-acknowledgment). It MUST NOT include any NTS Cookie or 1023 NTS Authenticator and Encrypted Extension Fields extension fields. 1025 If the NTP server has previously responded with authentic NTS- 1026 protected NTP packets, the client MUST verify that any KoD packets 1027 received from the server contain the Unique Identifier extension 1028 field and that the Unique Identifier matches that of an outstanding 1029 request. If this check fails, the packet MUST be discarded without 1030 further processing. If this check passes, the client MUST comply 1031 with RFC 5905, Section 7.4 [RFC5905] where required. A client MAY 1032 automatically re-run the NTS-KE protocol upon forced disassociation 1033 from an NTP server. In that case, it MUST be able to detect and stop 1034 looping between the NTS-KE and NTP servers by rate limiting the 1035 retries using e.g. exponential retry intervals. 1037 Upon reception of the NTS NAK kiss code, the client SHOULD wait until 1038 the next poll for a valid NTS-protected response and if none is 1039 received, initiate a fresh NTS-KE handshake to try to renegotiate new 1040 cookies, AEAD keys, and parameters. If the NTS-KE handshake 1041 succeeds, the client MUST discard all old cookies and parameters and 1042 use the new ones instead. As long as the NTS-KE handshake has not 1043 succeeded, the client SHOULD continue polling the NTP server using 1044 the cookies and parameters it has. 1046 To allow for NTP session restart when the NTS-KE server is 1047 unavailable and to reduce NTS-KE server load, the client SHOULD keep 1048 at least one unused but recent cookie, AEAD keys, negotiated AEAD 1049 algorithm, and other necessary parameters on persistent storage. 1050 This way, the client is able to resume the NTP session without 1051 performing renewed NTS-KE negotiation. 1053 6. Suggested Format for NTS Cookies 1055 This section is non-normative. It gives a suggested way for servers 1056 to construct NTS cookies. All normative requirements are stated in 1057 Section 4.1.6 and Section 5.4. 1059 The role of cookies in NTS is closely analogous to that of session 1060 cookies in TLS. Accordingly, the thematic resemblance of this 1061 section to RFC 5077 [RFC5077] is deliberate and the reader should 1062 likewise take heed of its security considerations. 1064 Servers should select an AEAD algorithm which they will use to 1065 encrypt and authenticate cookies. The chosen algorithm should be one 1066 such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental 1067 nonce reuse. It need not be the same as the one that was negotiated 1068 with the client. Servers should randomly generate and store a master 1069 AEAD key `K`. Servers should additionally choose a non-secret, unique 1070 value `I` as key-identifier for `K`. 1072 Servers should periodically (e.g., once daily) generate a new pair 1073 (I,K) and immediately switch to using these values for all newly- 1074 generated cookies. Following each such key rotation, servers should 1075 securely erase any prevoiusly generated keys that should now be 1076 expired, e.g. two or more rotation periods prior. Servers should 1077 continue to accept any cookie generated using keys that they have not 1078 yet erased, even if those keys are no longer current. Erasing old 1079 keys provides for forward secrecy, limiting the scope of what old 1080 information can be stolen if a master key is somehow compromised. 1081 Holding on to a limited number of old keys allows clients to 1082 seamlessly transition from one generation to the next without having 1083 to perform a new NTS-KE handshake. 1085 The need to keep keys synchronized between NTS-KE and NTP servers as 1086 well as across load-balanced clusters can make automatic key rotation 1087 challenging. However, the task can be accomplished without the need 1088 for central key-management infrastructure by using a ratchet, i.e., 1089 making each new key a deterministic, cryptographically pseudo-random 1090 function of its predecessor. A recommended concrete implementation 1091 of this approach is to use HKDF [RFC5869] to derive new keys, using 1092 the key's predecessor as Input Keying Material and its key identifier 1093 as a salt. 1095 To form a cookie, servers should first form a plaintext `P` 1096 consisting of the following fields: 1098 The AEAD algorithm negotiated during NTS-KE. 1100 The S2C key. 1102 The C2S key. 1104 Servers should then generate a nonce `N` uniformly at random, and 1105 form AEAD output `C` by encrypting `P` under key `K` with nonce `N` 1106 and no associated data. 1108 The cookie should consist of the tuple `(I,N,C)`. 1110 To verify and decrypt a cookie provided by the client, first parse it 1111 into its components `I`, `N`, and `C`. Use `I` to look up its 1112 decryption key `K`. If the key whose identifier is `I` has been 1113 erased or never existed, decryption fails; reply with an NTS NAK. 1114 Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` 1115 and nonce `N` with no associated data. If decryption or verification 1116 fails, reply with an NTS NAK. Otherwise, parse out the contents of 1117 the resulting plaintext `P` to obtain the negotiated AEAD algorithm, 1118 S2C key, and C2S key. 1120 7. IANA Considerations 1122 7.1. Service Name and Transport Protocol Port Number Registry 1124 IANA is requested to allocate the following entry in the Service Name 1125 and Transport Protocol Port Number Registry [RFC6335]: 1127 Service Name: ntske 1129 Transport Protocol: tcp 1131 Assignee: IESG 1133 Contact: IETF Chair 1135 Description: Network Time Security Key Exchange 1137 Reference: [[this memo]] 1139 Port Number: [[TBD1]], selected by IANA from the User Port range 1141 [[RFC EDITOR: Replace all instances of [[TBD1]] in this document with 1142 the IANA port assignment.]] 1144 7.2. TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs 1145 Registry 1147 IANA is requested to allocate the following entry in the TLS 1148 Application-Layer Protocol Negotiation (ALPN) Protocol IDs registry 1149 [RFC7301]: 1151 Protocol: Network Time Security Key Establishment, version 1 1153 Identification Sequence: 1154 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 1156 Reference: [[this memo]], Section 4 1158 7.3. TLS Exporter Labels Registry 1160 IANA is requested to allocate the following entry in the TLS Exporter 1161 Labels Registry [RFC5705]: 1163 +--------------------+---------+-------------+---------------+------+ 1164 | Value | DTLS-OK | Recommended | Reference | Note | 1165 +--------------------+---------+-------------+---------------+------+ 1166 | EXPORTER-network- | Y | N | [[this | | 1167 | time-security/1 | | | memo]], | | 1168 | | | | Section 4.2 | | 1169 +--------------------+---------+-------------+---------------+------+ 1171 7.4. NTP Kiss-o'-Death Codes Registry 1173 IANA is requested to allocate the following entry in the registry of 1174 NTP Kiss-o'-Death Codes [RFC5905]: 1176 +------+---------------------------------------+--------------------+ 1177 | Code | Meaning | Reference | 1178 +------+---------------------------------------+--------------------+ 1179 | NTSN | Network Time Security (NTS) negative- | [[this memo]], | 1180 | | acknowledgment (NAK) | Section 5.7 | 1181 +------+---------------------------------------+--------------------+ 1183 7.5. NTP Extension Field Types Registry 1185 IANA is requested to allocate the following entries in the NTP 1186 Extension Field Types registry [RFC5905]: 1188 +----------+-----------------------------+--------------------------+ 1189 | Field | Meaning | Reference | 1190 | Type | | | 1191 +----------+-----------------------------+--------------------------+ 1192 | [[TBD2]] | Unique Identifier | [[this memo]], | 1193 | | | Section 5.3 | 1194 | [[TBD3]] | NTS Cookie | [[this memo]], | 1195 | | | Section 5.4 | 1196 | [[TBD4]] | NTS Cookie Placeholder | [[this memo]], | 1197 | | | Section 5.5 | 1198 | [[TBD5]] | NTS Authenticator and | [[this memo]], | 1199 | | Encrypted Extension Fields | Section 5.6 | 1200 +----------+-----------------------------+--------------------------+ 1202 [[RFC EDITOR: REMOVE BEFORE PUBLICATION - The NTP WG suggests that 1203 the following values be used: 1205 Unique Identifier 0x0104 1206 NTS Cookie 0x0204 1207 Cookie Placeholder 0x0304 1208 NTS Authenticator 0x0404]] 1210 [[RFC EDITOR: Replace all instances of [[TBD2]], [[TBD3]], [[TBD4]], 1211 and [[TBD5]] in this document with the respective IANA assignments.]] 1213 7.6. Network Time Security Key Establishment Record Types Registry 1215 IANA is requested to create a new registry entitled "Network Time 1216 Security Key Establishment Record Types". Entries SHALL have the 1217 following fields: 1219 Record Type Number (REQUIRED): An integer in the range 0-32767 1220 inclusive. 1222 Description (REQUIRED): A short text description of the purpose of 1223 the field. 1225 Reference (REQUIRED): A reference to a document specifying the 1226 semantics of the record. 1228 The policy for allocation of new entries in this registry SHALL vary 1229 by the Record Type Number, as follows: 1231 0-1023: IETF Review 1233 1024-16383: Specification Required 1235 16384-32767: Private and Experimental Use 1237 Applications for new entries SHALL specify the contents of the 1238 Description and Reference fields as well as which of the above ranges 1239 the Record Type Number should be allocated from. Applicants MAY 1240 request a specific Record Type Number and such requests MAY be 1241 granted at the registrar's discretion. 1243 The initial contents of this registry SHALL be as follows: 1245 +-------------+-------------------------+---------------------------+ 1246 | Record Type | Description | Reference | 1247 | Number | | | 1248 +-------------+-------------------------+---------------------------+ 1249 | 0 | End of Message | [[this memo]], | 1250 | | | Section 4.1.1 | 1251 | 1 | NTS Next Protocol | [[this memo]], | 1252 | | Negotiation | Section 4.1.2 | 1253 | 2 | Error | [[this memo]], | 1254 | | | Section 4.1.3 | 1255 | 3 | Warning | [[this memo]], | 1256 | | | Section 4.1.4 | 1257 | 4 | AEAD Algorithm | [[this memo]], | 1258 | | Negotiation | Section 4.1.5 | 1259 | 5 | New Cookie for NTPv4 | [[this memo]], | 1260 | | | Section 4.1.6 | 1261 | 6 | NTPv4 Server | [[this memo]], | 1262 | | Negotiation | Section 4.1.7 | 1263 | 7 | NTPv4 Port Negotiation | [[this memo]], | 1264 | | | Section 4.1.8 | 1265 | 16384-32767 | Reserved for Private & | [[this memo]] | 1266 | | Experimental Use | | 1267 +-------------+-------------------------+---------------------------+ 1269 7.7. Network Time Security Next Protocols Registry 1271 IANA is requested to create a new registry entitled "Network Time 1272 Security Next Protocols". Entries SHALL have the following fields: 1274 Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive, 1275 functioning as an identifier. 1277 Protocol Name (REQUIRED): A short text string naming the protocol 1278 being identified. 1280 Reference (REQUIRED): A reference to a relevant specification 1281 document. 1283 The policy for allocation of new entries in these registries SHALL 1284 vary by their Protocol ID, as follows: 1286 0-1023: IETF Review 1288 1024-32767: Specification Required 1290 32768-65535: Private and Experimental Use 1292 The initial contents of this registry SHALL be as follows: 1294 +-------------+-------------------------------+---------------------+ 1295 | Protocol ID | Protocol Name | Reference | 1296 +-------------+-------------------------------+---------------------+ 1297 | 0 | Network Time Protocol version | [[this memo]] | 1298 | | 4 (NTPv4) | | 1299 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1300 | | Experimental Use | memo]] | 1301 +-------------+-------------------------------+---------------------+ 1303 7.8. Network Time Security Error and Warning Codes Registries 1305 IANA is requested to create two new registries entitled "Network Time 1306 Security Error Codes" and "Network Time Security Warning Codes". 1307 Entries in each SHALL have the following fields: 1309 Number (REQUIRED): An integer in the range 0-65535 inclusive 1311 Description (REQUIRED): A short text description of the condition. 1313 Reference (REQUIRED): A reference to a relevant specification 1314 document. 1316 The policy for allocation of new entries in these registries SHALL 1317 vary by their Number, as follows: 1319 0-1023: IETF Review 1321 1024-32767: Specification Required 1323 32768-65535: Private and Experimental Use 1325 The initial contents of the Network Time Security Error Codes 1326 Registry SHALL be as follows: 1328 +-------------+------------------------------+----------------------+ 1329 | Number | Description | Reference | 1330 +-------------+------------------------------+----------------------+ 1331 | 0 | Unrecognized Critical | [[this memo]], | 1332 | | Extension | Section 4.1.3 | 1333 | 1 | Bad Request | [[this memo]], | 1334 | | | Section 4.1.3 | 1335 | 2 | Internal Server Error | [[this memo]], | 1336 | | | Section 4.1.3 | 1337 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1338 | | Experimental Use | memo]] | 1339 +-------------+------------------------------+----------------------+ 1340 The Network Time Security Warning Codes Registry SHALL initially be 1341 empty except for the reserved range, i.e.: 1343 +-------------+-------------------------------+---------------------+ 1344 | Number | Description | Reference | 1345 +-------------+-------------------------------+---------------------+ 1346 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1347 | | Experimental Use | memo]] | 1348 +-------------+-------------------------------+---------------------+ 1350 8. Implementation Status - RFC EDITOR: REMOVE BEFORE PUBLICATION 1352 This section records the status of known implementations of the 1353 protocol defined by this specification at the time of posting of this 1354 Internet-Draft, and is based on a proposal described in RFC 7942. 1355 The description of implementations in this section is intended to 1356 assist the IETF in its decision processes in progressing drafts to 1357 RFCs. Please note that the listing of any individual implementation 1358 here does not imply endorsement by the IETF. Furthermore, no effort 1359 has been spent to verify the information presented here that was 1360 supplied by IETF contributors. This is not intended as, and must not 1361 be construed to be, a catalog of available implementations or their 1362 features. Readers are advised to note that other implementations may 1363 exist. 1365 According to RFC 7942, "this will allow reviewers and working groups 1366 to assign due consideration to documents that have the benefit of 1367 running code, which may serve as evidence of valuable experimentation 1368 and feedback that have made the implemented protocols more mature. 1369 It is up to the individual working groups to use this information as 1370 they see fit". 1372 8.1. Implementation 1 1374 Organization: Ostfalia University of Applied Science 1376 Implementor: Martin Langer 1378 Maturity: Proof-of-Concept Prototype 1380 This implementation was used to verify consistency and to ensure 1381 completeness of this specification. 1383 8.1.1. Coverage 1385 This implementation covers the complete specification. 1387 8.1.2. Licensing 1389 The code is released under a Apache License 2.0 license. 1391 The source code is available at: https://gitlab.com/MLanger/nts/ 1393 8.1.3. Contact Information 1395 Contact Martin Langer: mart.langer@ostfalia.de 1397 8.1.4. Last Update 1399 The implementation was updated 25. February 2019. 1401 8.2. Implementation 2 1403 Organization: Netnod 1405 Implementor: Christer Weinigel 1407 Maturity: Proof-of-Concept Prototype 1409 This implementation was used to verify consistency and to ensure 1410 completeness of this specification. 1412 8.2.1. Coverage 1414 This implementation covers the complete specification. 1416 8.2.2. Licensing 1418 The source code is available at: https://github.com/Netnod/nts-poc- 1419 python. 1421 See LICENSE file for details on licensing (BSD 2). 1423 8.2.3. Contact Information 1425 Contact Christer Weinigel: christer@weinigel.se 1427 8.2.4. Last Update 1429 The implementation was updated 31. January 2019. 1431 8.3. Implementation 3 1433 Organization: Red Hat 1435 Implementor: Miroslav Lichvar 1437 Maturity: Prototype 1439 This implementation was used to verify consistency and to ensure 1440 completeness of this specification. 1442 8.3.1. Coverage 1444 This implementation covers the complete specification. 1446 8.3.2. Licensing 1448 Licensing is GPLv2. 1450 The source code is available at: https://github.com/mlichvar/chrony- 1451 nts 1453 8.3.3. Contact Information 1455 Contact Miroslav Lichvar: mlichvar@redhat.com 1457 8.3.4. Last Update 1459 The implementation was updated 28. March 2019. 1461 8.4. Implementation 4 1463 Organization: NTPsec 1465 Implementor: Hal Murray and NTPsec team 1467 Maturity:Looking for testers. Servers running at 1468 ntp1.glypnod.com:123 and ntp2.glypnod.com:123 1470 This implementation was used to verify consistency and to ensure 1471 completeness of this specification. 1473 8.4.1. Coverage 1475 This implementation covers the complete specification. 1477 8.4.2. Licensing 1479 The source code is available at: https://gitlab.com/NTPsec/ntpsec. 1480 Licensing details in LICENSE. 1482 8.4.3. Contact Information 1484 Contact Hal Murray: hmurray@megapathdsl.net, devel@ntpsec.org 1486 8.4.4. Last Update 1488 The implementation was updated 2019-Apr-10. 1490 8.5. Implementation 5 1492 Organization: Cloudflare 1494 Implementor: Watson Ladd 1496 Maturity: 1498 This implementation was used to verify consistency and to ensure 1499 completeness of this specification. 1501 8.5.1. Coverage 1503 This implementation covers the server side of the NTS specification. 1505 8.5.2. Licensing 1507 The source code is available at: https://github.com/wbl/nts-rust 1509 Licensing is ISC (details see LICENSE.txt file). 1511 8.5.3. Contact Information 1513 Contact Watson Ladd: watson@cloudflare.com 1515 8.5.4. Last Update 1517 The implementation was updated 21. March 2019. 1519 8.6. Implementation 6 1521 Organization: Hacklunch, independent 1523 Implementor: Michael Cardell Widerkrantz, Daniel Lublin, Martin 1524 Samuelsson et. al. 1526 Maturity: interoperable client, immature server 1528 8.6.1. Coverage 1530 NTS-KE client and server. 1532 8.6.2. Licensing 1534 Licensing is ISC (details in LICENSE file). 1536 Source code is available at: https://gitlab.com/hacklunch/ntsclient 1538 8.6.3. Contact Information 1540 Contact Michael Cardell Widerkrantz: mc@netnod.se 1542 8.6.4. Last Update 1544 The implementation was updated 6. February 2020. 1546 8.7. Interoperability 1548 The Interoperability tests distinguished between NTS key 1549 establishment protocol and NTS time exchange messages. For the 1550 implementations 1, 2, 3, and 4 pairwise interoperability of the NTS 1551 key establishment protocol and exchange of NTS protected NTP messages 1552 have been verified successfully. The implementation 2 was able to 1553 successfully perform the key establishment protocol against the 1554 server side of the implementation 5. 1556 These tests successfully demonstrate that there are at least four 1557 running implementations of this draft which are able to interoperate. 1559 9. Security Considerations 1561 9.1. Protected Modes 1563 NTP provides many different operating modes in order to support 1564 different network topologies and to adapt to various requirements. 1565 This memo only specifies NTS for NTP modes 3 (client) and 4 (server) 1566 (see Section 1.2). The best current practice for authenticating the 1567 other NTP modes is using the symmetric message authentication code 1568 feature as described in RFC 5905 [RFC5905] and RFC 8573 [RFC8573]. 1570 9.2. Sensitivity to DDoS Attacks 1572 The introduction of NTS brings with it the introduction of asymmetric 1573 cryptography to NTP. Asymmetric cryptography is necessary for 1574 initial server authentication and AEAD key extraction. Asymmetric 1575 cryptosystems are generally orders of magnitude slower than their 1576 symmetric counterparts. This makes it much harder to build systems 1577 that can serve requests at a rate corresponding to the full line 1578 speed of the network connection. This, in turn, opens up a new 1579 possibility for DDoS attacks on NTP services. 1581 The main protection against these attacks in NTS lies in that the use 1582 of asymmetric cryptosystems is only necessary in the initial NTS-KE 1583 phase of the protocol. Since the protocol design enables separation 1584 of the NTS-KE and NTP servers, a successful DDoS attack on an NTS-KE 1585 server separated from the NTP service it supports will not affect NTP 1586 users that have already performed initial authentication, AEAD key 1587 extraction, and cookie exchange. 1589 NTS users should also consider that they are not fully protected 1590 against DoS attacks by on-path adversaries. In addition to dropping 1591 packets and attacks such as those described in Section 9.5, an on- 1592 path attacker can send spoofed kiss-o'-death replies, which are not 1593 authenticated, in response to NTP requests. This could result in 1594 significantly increased load on the NTS-KE server. Implementers have 1595 to weigh the user's need for unlinkability against the added 1596 resilience that comes with cookie reuse in cases of NTS-KE server 1597 unavailability. 1599 9.3. Avoiding DDoS Amplification 1601 Certain non-standard and/or deprecated features of the Network Time 1602 Protocol enable clients to send a request to a server which causes 1603 the server to send a response much larger than the request. Servers 1604 which enable these features can be abused in order to amplify traffic 1605 volume in DDoS attacks by sending them a request with a spoofed 1606 source IP. In recent years, attacks of this nature have become an 1607 endemic nuisance. 1609 NTS is designed to avoid contributing any further to this problem by 1610 ensuring that NTS-related extension fields included in server 1611 responses will be the same size as the NTS-related extension fields 1612 sent by the client. In particular, this is why the client is 1613 required to send a separate and appropriately padded-out NTS Cookie 1614 Placeholder extension field for every cookie it wants to get back, 1615 rather than being permitted simply to specify a desired quantity. 1617 Due to the RFC 7822 [RFC7822] requirement that extensions be padded 1618 and aligned to four-octet boundaries, response size may still in some 1619 cases exceed request size by up to three octets. This is 1620 sufficiently inconsequential that we have declined to address it. 1622 9.4. Initial Verification of Server Certificates 1624 NTS's security goals are undermined if the client fails to verify 1625 that the X.509 certificate chain presented by the NTS-KE server is 1626 valid and rooted in a trusted certificate authority. RFC 5280 1627 [RFC5280] and RFC 6125 [RFC6125] specify how such verification is to 1628 be performed in general. However, the expectation that the client 1629 does not yet have a correctly-set system clock at the time of 1630 certificate verification presents difficulties with verifying that 1631 the certificate is within its validity period, i.e., that the current 1632 time lies between the times specified in the certificate's notBefore 1633 and notAfter fields. It may be operationally necessary in some cases 1634 for a client to accept a certificate which appears to be expired or 1635 not yet valid. While there is no perfect solution to this problem, 1636 there are several mitigations the client can implement to make it 1637 more difficult for an adversary to successfully present an expired 1638 certificate: 1640 Check whether the system time is in fact unreliable. If the 1641 system clock has previously been synchronized since last boot, 1642 then on operating systems which implement a kernel-based phase- 1643 locked-loop API, a call to ntp_gettime() should show a maximum 1644 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be 1645 considered reliable and certificates can be strictly validated. 1647 Allow the system administrator to specify that certificates should 1648 *always* be strictly validated. Such a configuration is 1649 appropriate on systems which have a battery-backed clock and which 1650 can reasonably prompt the user to manually set an approximately- 1651 correct time if it appears to be needed. 1653 Once the clock has been synchronized, periodically write the 1654 current system time to persistent storage. Do not accept any 1655 certificate whose notAfter field is earlier than the last recorded 1656 time. 1658 NTP time replies are expected to be consistent with the NTS-KE TLS 1659 certificate validity period, i.e. time replies received 1660 immediately after an NTS-KE handshake are expected to lie within 1661 the certificate validity period. Implementations are recommended 1662 to check that this is the case. Performing a new NTS-KE handshake 1663 based solely on the fact that the certificate used by the NTS-KE 1664 server in a previous handshake has expired is normally not 1665 necessary. Clients that still wish to do this must take care not 1666 to cause an inadvertent denial-of-service attack on the NTS-KE 1667 server, for example by picking a random time in the week preceding 1668 certificate expiry to perform the new handshake. 1670 Use multiple time sources. The ability to pass off an expired 1671 certificate is only useful to an adversary who has compromised the 1672 corresponding private key. If the adversary has compromised only 1673 a minority of servers, NTP's selection algorithm (RFC 5905 section 1674 11.2.1 [RFC5905]) will protect the client from accepting bad time 1675 from the adversary-controlled servers. 1677 9.5. Delay Attacks 1679 In a packet delay attack, an adversary with the ability to act as a 1680 man-in-the-middle delays time synchronization packets between client 1681 and server asymmetrically [RFC7384]. Since NTP's formula for 1682 computing time offset relies on the assumption that network latency 1683 is roughly symmetrical, this leads to the client to compute an 1684 inaccurate value [Mizrahi]. The delay attack does not reorder or 1685 modify the content of the exchanged synchronization packets. 1686 Therefore, cryptographic means do not provide a feasible way to 1687 mitigate this attack. However, the maximum error that an adversary 1688 can introduce is bounded by half of the round trip delay. 1690 RFC 5905 [RFC5905] specifies a parameter called MAXDIST which denotes 1691 the maximum round-trip latency (including not only the immediate 1692 round trip between client and server, but the whole distance back to 1693 the reference clock as reported in the Root Delay field) that a 1694 client will tolerate before concluding that the server is unsuitable 1695 for synchronization. The standard value for MAXDIST is one second, 1696 although some implementations use larger values. Whatever value a 1697 client chooses, the maximum error which can be introduced by a delay 1698 attack is MAXDIST/2. 1700 Usage of multiple time sources, or multiple network paths to a given 1701 time source [Shpiner], may also serve to mitigate delay attacks if 1702 the adversary is in control of only some of the paths. 1704 9.6. NTS Stripping 1706 Implementers must be aware of the possibility of "NTS stripping" 1707 attacks, where an attacker tricks clients into reverting to plain 1708 NTP. Naive client implementations might, for example, revert 1709 automatically to plain NTP if the NTS-KE handshake fails. A man-in- 1710 the-middle attacker can easily cause this to happen. Even clients 1711 that already hold valid cookies can be vulnerable, since an attacker 1712 can force a client to repeat the NTS-KE handshake by sending faked 1713 NTP mode 4 replies with the NTS NAK kiss code. Forcing a client to 1714 repeat the NTS-KE handshake can also be the first step in more 1715 advanced attacks. 1717 For the reasons described here, implementations SHOULD NOT revert 1718 from NTS-protected to unprotected NTP with any server without 1719 explicit user action. 1721 10. Privacy Considerations 1723 10.1. Unlinkability 1725 Unlinkability prevents a device from being tracked when it changes 1726 network addresses (e.g. because said device moved between different 1727 networks). In other words, unlinkability thwarts an attacker that 1728 seeks to link a new network address used by a device with a network 1729 address that it was formerly using, because of recognizable data that 1730 the device persistently sends as part of an NTS-secured NTP 1731 association. This is the justification for continually supplying the 1732 client with fresh cookies, so that a cookie never represents 1733 recognizable data in the sense outlined above. 1735 NTS's unlinkability objective is merely to not leak any additional 1736 data that could be used to link a device's network address. NTS does 1737 not rectify legacy linkability issues that are already present in 1738 NTP. Thus, a client that requires unlinkability must also minimize 1739 information transmitted in a client query (mode 3) packet as 1740 described in the draft [I-D.ietf-ntp-data-minimization]. 1742 The unlinkability objective only holds for time synchronization 1743 traffic, as opposed to key exchange traffic. This implies that it 1744 cannot be guaranteed for devices that function not only as time 1745 clients, but also as time servers (because the latter can be 1746 externally triggered to send linkable data, such as the TLS 1747 certificate). 1749 It should also be noted that it could be possible to link devices 1750 that operate as time servers from their time synchronization traffic, 1751 using information exposed in (mode 4) server response packets (e.g. 1752 reference ID, reference time, stratum, poll). Also, devices that 1753 respond to NTP control queries could be linked using the information 1754 revealed by control queries. 1756 Note that the unlinkability objective does not prevent a client 1757 device to be tracked by its time servers. 1759 10.2. Confidentiality 1761 NTS does not protect the confidentiality of information in NTP's 1762 header fields. When clients implement 1763 [I-D.ietf-ntp-data-minimization], client packet headers do not 1764 contain any information which the client could conceivably wish to 1765 keep secret: one field is random, and all others are fixed. 1766 Information in server packet headers is likewise public: the origin 1767 timestamp is copied from the client's (random) transmit timestamp, 1768 and all other fields are set the same regardless of the identity of 1769 the client making the request. 1771 Future extension fields could hypothetically contain sensitive 1772 information, in which case NTS provides a mechanism for encrypting 1773 them. 1775 11. Acknowledgements 1777 The authors would like to thank Richard Barnes, Steven Bellovin, 1778 Patrik Faeltstroem (Faltstrom), Scott Fluhrer, Sharon Goldberg, Russ 1779 Housley, Benjamin Kaduk, Suresh Krishnan, Martin Langer, Barry Leiba, 1780 Miroslav Lichvar, Aanchal Malhotra, Dave Mills, Sandra Murphy, Danny 1781 Mayer, Karen O'Donoghue, Eric K. Rescorla, Stephen Roettger, Kurt 1782 Roeckx, Dan Romascanu, Kyle Rose, Rich Salz, Brian Sniffen, Susan 1783 Sons, Douglas Stebila, Harlan Stenn, Joachim Stroembergsson 1784 (Strombergsson), Martin Thomson, Eric (Eric) Vyncke, Richard Welty, 1785 Christer Weinigel, and Magnus Westerlund for contributions to this 1786 document and comments on the design of NTS. 1788 12. References 1790 12.1. Normative References 1792 [IANA-AEAD] 1793 IANA, "Authenticated Encryption with Associated Data 1794 (AEAD) Parameters", 1795 . 1797 [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, 1798 RFC 20, DOI 10.17487/RFC0020, October 1969, 1799 . 1801 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1802 Requirement Levels", BCP 14, RFC 2119, 1803 DOI 10.17487/RFC2119, March 1997, 1804 . 1806 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1807 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 1808 2006, . 1810 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1811 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1812 . 1814 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1815 Housley, R., and W. Polk, "Internet X.509 Public Key 1816 Infrastructure Certificate and Certificate Revocation List 1817 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1818 . 1820 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 1821 Authenticated Encryption Using the Advanced Encryption 1822 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 1823 2008, . 1825 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1826 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1827 March 2010, . 1829 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1830 Key Derivation Function (HKDF)", RFC 5869, 1831 DOI 10.17487/RFC5869, May 2010, 1832 . 1834 [RFC5890] Klensin, J., "Internationalized Domain Names for 1835 Applications (IDNA): Definitions and Document Framework", 1836 RFC 5890, DOI 10.17487/RFC5890, August 2010, 1837 . 1839 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 1840 "Network Time Protocol Version 4: Protocol and Algorithms 1841 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 1842 . 1844 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1845 Verification of Domain-Based Application Service Identity 1846 within Internet Public Key Infrastructure Using X.509 1847 (PKIX) Certificates in the Context of Transport Layer 1848 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1849 2011, . 1851 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 1852 Cheshire, "Internet Assigned Numbers Authority (IANA) 1853 Procedures for the Management of the Service Name and 1854 Transport Protocol Port Number Registry", BCP 165, 1855 RFC 6335, DOI 10.17487/RFC6335, August 2011, 1856 . 1858 [RFC6874] Carpenter, B., Cheshire, S., and R. Hinden, "Representing 1859 IPv6 Zone Identifiers in Address Literals and Uniform 1860 Resource Identifiers", RFC 6874, DOI 10.17487/RFC6874, 1861 February 2013, . 1863 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1864 "Transport Layer Security (TLS) Application-Layer Protocol 1865 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1866 July 2014, . 1868 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1869 "Recommendations for Secure Use of Transport Layer 1870 Security (TLS) and Datagram Transport Layer Security 1871 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1872 2015, . 1874 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 1875 (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, 1876 March 2016, . 1878 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1879 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1880 May 2017, . 1882 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1883 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1884 . 1886 12.2. Informative References 1888 [I-D.ietf-ntp-data-minimization] 1889 Franke, D. and A. Malhotra, "NTP Client Data 1890 Minimization", draft-ietf-ntp-data-minimization-04 (work 1891 in progress), March 2019. 1893 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1894 against time synchronization protocols", in Proceedings 1895 of Precision Clock Synchronization for Measurement Control 1896 and Communication, ISPCS 2012, pp. 1-6 1897 DOI 10.1109/ISPCS.2012.6336612, September 2012. 1899 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 1900 "Randomness Requirements for Security", BCP 106, RFC 4086, 1901 DOI 10.17487/RFC4086, June 2005, 1902 . 1904 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1905 "Transport Layer Security (TLS) Session Resumption without 1906 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1907 January 2008, . 1909 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1910 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 1911 October 2014, . 1913 [RFC8573] Malhotra, A. and S. Goldberg, "Message Authentication Code 1914 for the Network Time Protocol", RFC 8573, 1915 DOI 10.17487/RFC8573, June 2019, 1916 . 1918 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 1919 Protocols", in Proceedings of IEEE International Symposium 1920 on Precision Clock Synchronization for Measurement, 1921 Control and Communication (ISPCS) 1922 DOI 10.1109/ISPCS.2013.6644754, September 2013. 1924 Appendix A. Terms and Abbreviations 1926 AEAD Authenticated Encryption with Associated Data [RFC5116] 1928 ALPN Application-Layer Protocol Negotiation [RFC7301] 1930 C2S Client-to-server 1932 DoS Denial-of-Service 1934 DDoS Distributed Denial-of-Service 1936 EF Extension Field [RFC5905] 1938 HKDF Hashed Message Authentication Code-based Key Derivation 1939 Function [RFC5869] 1941 KoD Kiss-o'-Death [RFC5905] 1943 NTP Network Time Protocol [RFC5905] 1945 NTS Network Time Security 1946 NTS NAK NTS negative-acknowledgment 1948 NTS-KE Network Time Security Key Exchange 1950 PRF Pseudorandom Function 1952 S2C Server-to-client 1954 TLS Transport Layer Security [RFC8446] 1956 Authors' Addresses 1958 Daniel Fox Franke 1959 Akamai Technologies 1960 145 Broadway 1961 Cambridge, MA 02142 1962 United States 1964 Email: dafranke@akamai.com 1966 Dieter Sibold 1967 Physikalisch-Technische 1968 Bundesanstalt 1969 Bundesallee 100 1970 Braunschweig D-38116 1971 Germany 1973 Phone: +49-(0)531-592-8420 1974 Fax: +49-531-592-698420 1975 Email: dieter.sibold@ptb.de 1977 Kristof Teichel 1978 Physikalisch-Technische 1979 Bundesanstalt 1980 Bundesallee 100 1981 Braunschweig D-38116 1982 Germany 1984 Phone: +49-(0)531-592-4471 1985 Email: kristof.teichel@ptb.de 1986 Marcus Dansarie 1987 Sweden 1989 Email: marcus@dansarie.se 1990 URI: https://orcid.org/0000-0001-9246-0263 1992 Ragnar Sundblad 1993 Netnod 1994 Sweden 1996 Email: ragge@netnod.se