idnits 2.17.1 draft-ietf-ntp-using-nts-for-ntp-25.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 19, 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 400 -- Looks like a reference, but probably isn't: '1' on line 400 -- 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 20, 2020 K. Teichel 6 PTB 7 M. Dansarie 9 R. Sundblad 10 Netnod 11 March 19, 2020 13 Network Time Security for the Network Time Protocol 14 draft-ietf-ntp-using-nts-for-ntp-25 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 20, 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. After sending their respective request and response, the 348 client and server SHALL send TLS "close_notify" alerts in accordance 349 with the TLS version in use, see RFC 8446 Section 6.1 [RFC8446]. 351 The client's request and the server's response each SHALL consist of 352 a sequence of records formatted according to Figure 2. The request 353 and a non-error response each SHALL include exactly one NTS Next 354 Protocol Negotiation record. The sequence SHALL be terminated by a 355 "End of Message" record. The requirement that all NTS-KE messages be 356 terminated by an End of Message record makes them self-delimiting. 358 Clients and servers MAY enforce length limits on requests and 359 responses, however, servers MUST accept requests of at least 1024 360 octets and clients SHOULD accept responses of at least 65536 octets. 362 0 1 2 3 363 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 364 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 365 |C| Record Type | Body Length | 366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 367 | | 368 . . 369 . Record Body . 370 . . 371 | | 372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 374 Figure 2: NTS-KE Record Format 376 The fields of an NTS-KE record are defined as follows: 378 C (Critical Bit): Determines the disposition of unrecognized 379 Record Types. Implementations which receive a record with an 380 unrecognized Record Type MUST ignore the record if the Critical 381 Bit is 0 and MUST treat it as an error if the Critical Bit is 1 382 (see Section 4.1.3). 384 Record Type Number: A 15-bit integer in network byte order. The 385 semantics of record types 0-7 are specified in this memo. 386 Additional type numbers SHALL be tracked through the IANA Network 387 Time Security Key Establishment Record Types registry. 389 Body Length: The length of the Record Body field, in octets, as a 390 16-bit integer in network byte order. Record bodies MAY have any 391 representable length and need not be aligned to a word boundary. 393 Record Body: The syntax and semantics of this field SHALL be 394 determined by the Record Type. 396 For clarity regarding bit-endianness: the Critical Bit is the most- 397 significant bit of the first octet. In the C programming language, 398 given a network buffer `unsigned char b[]` containing an NTS-KE 399 record, the critical bit is `b[0] >> 7` while the record type is 400 `((b[0] & 0x7f) << 8) + b[1]`. 402 Note that, although the Type-Length-Body format of an NTS-KE record 403 is similar to that of an NTP extension field, the semantics of the 404 length field differ. While the length subfield of an NTP extension 405 field gives the length of the entire extension field including the 406 type and length subfields, the length field of an NTS-KE record gives 407 just the length of the body. 409 Figure 3 provides a schematic overview of the key exchange. It 410 displays the protocol steps to be performed by the NTS client and 411 server and record types to be exchanged. 413 +---------------------------------------+ 414 | - Verify client request message. | 415 | - Extract TLS key material. | 416 | - Generate KE response message. | 417 | - Include Record Types: | 418 | o NTS Next Protocol Negotiation | 419 | o AEAD Algorithm Negotiation | 420 | o NTP Server Negotiation | 421 | o New Cookie for NTPv4 | 422 | o | 423 | o End of Message | 424 +-----------------+---------------------+ 425 | 426 | 427 Server -----------+---------------+-----+-----------------------> 428 ^ \ 429 / \ 430 / TLS application \ 431 / data \ 432 / \ 433 / V 434 Client -----+---------------------------------+-----------------> 435 | | 436 | | 437 | | 438 +-----------+----------------------+ +------+-----------------+ 439 |- Generate KE request message. | |- Verify server response| 440 | - Include Record Types: | | message. | 441 | o NTS Next Protocol Negotiation | |- Extract cookie(s). | 442 | o AEAD Algorithm Negotiation | | | 443 | o | | | 444 | o End of Message | | | 445 +----------------------------------+ +------------------------+ 447 Figure 3: NTS Key Exchange Messages 449 4.1. NTS-KE Record Types 451 The following NTS-KE Record Types are defined: 453 4.1.1. End of Message 455 The End of Message record has a Record Type number of 0 and a zero- 456 length body. It MUST occur exactly once as the final record of every 457 NTS-KE request and response. The Critical Bit MUST be set. 459 4.1.2. NTS Next Protocol Negotiation 461 The NTS Next Protocol Negotiation record has a Record Type number of 462 1. It MUST occur exactly once in every NTS-KE request and response. 463 Its body consists of a sequence of 16-bit unsigned integers in 464 network byte order. Each integer represents a Protocol ID from the 465 IANA Network Time Security Next Protocols registry. The Critical Bit 466 MUST be set. 468 The Protocol IDs listed in the client's NTS Next Protocol Negotiation 469 record denote those protocols which the client wishes to speak using 470 the key material established through this NTS-KE session. Protocol 471 IDs listed in the NTS-KE server's response MUST comprise a subset of 472 those listed in the request and denote those protocols which the NTP 473 server is willing and able to speak using the key material 474 established through this NTS-KE session. The client MAY proceed with 475 one or more of them. The request MUST list at least one protocol, 476 but the response MAY be empty. 478 4.1.3. Error 480 The Error record has a Record Type number of 2. Its body is exactly 481 two octets long, consisting of an unsigned 16-bit integer in network 482 byte order, denoting an error code. The Critical Bit MUST be set. 484 Clients MUST NOT include Error records in their request. If clients 485 receive a server response which includes an Error record, they MUST 486 discard any key material negotiated during the initial TLS exchange 487 and MUST NOT proceed to the Next Protocol. 489 The following error codes are defined: 491 Error code 0 means "Unrecognized Critical Record". The server 492 MUST respond with this error code if the request included a record 493 which the server did not understand and which had its Critical Bit 494 set. The client SHOULD NOT retry its request without 495 modification. 497 Error code 1 means "Bad Request". The server MUST respond with 498 this error if the request is not complete and syntactically well- 499 formed, or, upon the expiration of an implementation-defined 500 timeout, it has not yet received such a request. 502 Error code 2 means "Internal Server Error". The server MUST 503 respond with this error if it is unable to respond properly due to 504 an internal condition. 506 4.1.4. Warning 508 The Warning record has a Record Type number of 3. Its body is 509 exactly two octets long, consisting of an unsigned 16-bit integer in 510 network byte order, denoting a warning code. The Critical Bit MUST 511 be set. 513 Clients MUST NOT include Warning records in their request. If 514 clients receive a server response which includes a Warning record, 515 they MAY discard any negotiated key material and abort without 516 proceeding to the Next Protocol. Unrecognized warning codes MUST be 517 treated as errors. 519 This memo defines no warning codes. 521 4.1.5. AEAD Algorithm Negotiation 523 The AEAD Algorithm Negotiation record has a Record Type number of 4. 524 Its body consists of a sequence of unsigned 16-bit integers in 525 network byte order, denoting Numeric Identifiers from the IANA AEAD 526 Algorithms registry [IANA-AEAD]. The Critical Bit MAY be set. 528 If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for 529 NTPv4), then this record MUST be included exactly once. Other 530 protocols MAY require it as well. 532 When included in a request, this record denotes which AEAD algorithms 533 the client is willing to use to secure the Next Protocol, in 534 decreasing preference order. When included in a response, this 535 record denotes which algorithm the server chooses to use. It is 536 empty if the server supports none of the algorithms offered. In 537 requests, the list MUST include at least one algorithm. In 538 responses, it MUST include at most one. Honoring the client's 539 preference order is OPTIONAL: servers may select among any of the 540 client's offered choices, even if they are able to support some other 541 algorithm which the client prefers more. 543 Server implementations of NTS extension fields for NTPv4 (Section 5) 544 MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). 545 That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD 546 Algorithm Negotiation record and the server accepts Protocol ID 0 547 (NTPv4) in its NTS Next Protocol Negotiation record, then the 548 server's AEAD Algorithm Negotiation record MUST NOT be empty. 550 4.1.6. New Cookie for NTPv4 552 The New Cookie for NTPv4 record has a Record Type number of 5. The 553 contents of its body SHALL be implementation-defined and clients MUST 554 NOT attempt to interpret them. See Section 6 for a suggested 555 construction. 557 Clients MUST NOT send records of this type. Servers MUST send at 558 least one record of this type, and SHOULD send eight of them, if the 559 Next Protocol Negotiation response record contains Protocol ID 0 560 (NTPv4) and the AEAD Algorithm Negotiation response record is not 561 empty. The Critical Bit SHOULD NOT be set. 563 4.1.7. NTPv4 Server Negotiation 565 The NTPv4 Server Negotiation record has a Record Type number of 6. 566 Its body consists of an ASCII-encoded [RFC0020] string. The contents 567 of the string SHALL be either an IPv4 address, an IPv6 address, or a 568 fully qualified domain name (FQDN). IPv4 addresses MUST be in dotted 569 decimal notation. IPv6 addresses MUST conform to the "Text 570 Representation of Addresses" as specified in RFC 4291 [RFC4291] and 571 MUST NOT include zone identifiers [RFC6874]. If a label contains at 572 least one non-ASCII character, it is an internationalized domain name 573 and an A-LABEL MUST be used as defined in section 2.3.2.1 of RFC 5890 574 [RFC5890]. If the record contains a domain name, the recipient MUST 575 treat it as a FQDN, e.g. by making sure it ends with a dot. 577 When NTPv4 is negotiated as a Next Protocol and this record is sent 578 by the server, the body specifies the hostname or IP address of the 579 NTPv4 server with which the client should associate and which will 580 accept the supplied cookies. If no record of this type is sent, the 581 client SHALL interpret this as a directive to associate with an NTPv4 582 server at the same IP address as the NTS-KE server. Servers MUST NOT 583 send more than one record of this type. 585 When this record is sent by the client, it indicates that the client 586 wishes to associate with the specified NTP server. The NTS-KE server 587 MAY incorporate this request when deciding what NTPv4 Server 588 Negotiation records to respond with, but honoring the client's 589 preference is OPTIONAL. The client MUST NOT send more than one 590 record of this type. 592 If the client has sent a record of this type, the NTS-KE server 593 SHOULD reply with the same record if it is valid and the server is 594 able to supply cookies for it. If the client has not sent any record 595 of this type, the NTS-KE server SHOULD respond with either an NTP 596 server address in the same family as the NTS-KE session or a FQDN 597 that can be resolved to an address in that family, if such 598 alternatives are available. 600 Servers MAY set the Critical Bit on records of this type; clients 601 SHOULD NOT. 603 4.1.8. NTPv4 Port Negotiation 605 The NTPv4 Port Negotiation record has a Record Type number of 7. Its 606 body consists of a 16-bit unsigned integer in network byte order, 607 denoting a UDP port number. 609 When NTPv4 is negotiated as a Next Protocol and this record is sent 610 by the server, the body specifies the port number of the NTPv4 server 611 with which the client should associate and which will accept the 612 supplied cookies. If no record of this type is sent, the client 613 SHALL assume a default of 123 (the registered port number for NTP). 615 When this record is sent by the client in conjunction with a NTPv4 616 Server Negotiation record, it indicates that the client wishes to 617 associate with the NTP server at the specified port. The NTS-KE 618 server MAY incorporate this request when deciding what NTPv4 Server 619 Negotiation and NTPv4 Port Negotiation records to respond with, but 620 honoring the client's preference is OPTIONAL. 622 Servers MAY set the Critical Bit on records of this type; clients 623 SHOULD NOT. 625 4.2. Key Extraction (generally) 627 Following a successful run of the NTS-KE protocol, key material SHALL 628 be extracted using the TLS pseudorandom function (PRF) [RFC5705] for 629 TLS version 1.2, or the HMAC-based Extract-and-Expand Key Derivation 630 Function (HKDF) [RFC5869] in accordance with RFC 8446, Section 7.5 631 [RFC8446] for TLS version 1.3. Inputs to the exporter function are 632 to be constructed in a manner specific to the negotiated Next 633 Protocol. However, all protocols which utilize NTS-KE MUST conform 634 to the following two rules: 636 The disambiguating label string MUST be "EXPORTER-network-time- 637 security/1". 639 The per-association context value MUST be provided and MUST begin 640 with the two-octet Protocol ID which was negotiated as a Next 641 Protocol. 643 5. NTS Extension Fields for NTPv4 645 5.1. Key Extraction (for NTPv4) 647 Following a successful run of the NTS-KE protocol wherein Protocol ID 648 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 649 extracted: a client-to-server (C2S) key and a server-to-client (S2C) 650 key. These keys SHALL be computed with the PRF defined in RFC 5705 651 [RFC5705] for TLS version 1.2, or the HKDF defined in RFC 8446, 652 Section 7.5 [RFC8446] for TLS version 1.3, using the following 653 inputs. 655 The disambiguating label string (for PRF) or label (for HKDF) 656 SHALL be "EXPORTER-network-time-security/1". 658 The context value SHALL consist of the following five octets: 660 The first two octets SHALL be zero (the Protocol ID for NTPv4). 662 The next two octets SHALL be the Numeric Identifier of the 663 negotiated AEAD Algorithm in network byte order. 665 The final octet SHALL be 0x00 for the C2S key and 0x01 for the 666 S2C key. 668 Implementations wishing to derive additional keys for private or 669 experimental use MUST NOT do so by extending the above-specified 670 syntax for per-association context values. Instead, they SHOULD use 671 their own disambiguating label string. Note that RFC 5705 [RFC5705] 672 provides that disambiguating label strings beginning with 673 "EXPERIMENTAL" MAY be used without IANA registration. 675 5.2. Packet Structure Overview 677 In general, an NTS-protected NTPv4 packet consists of: 679 The usual 48-octet NTP header which is authenticated but not 680 encrypted. 682 Some extension fields which are authenticated but not encrypted. 684 An extension field which contains AEAD output (i.e., an 685 authentication tag and possible ciphertext). The corresponding 686 plaintext, if non-empty, consists of some extension fields which 687 benefit from both encryption and authentication. 689 Possibly, some additional extension fields which are neither 690 encrypted nor authenticated. In general, these are discarded by 691 the receiver. 693 Always included among the authenticated or authenticated-and- 694 encrypted extension fields are a cookie extension field and a unique 695 identifier extension field, as described in Section 5.7. The purpose 696 of the cookie extension field is to enable the server to offload 697 storage of session state onto the client. The purpose of the unique 698 identifier extension field is to protect the client from replay 699 attacks. 701 5.3. The Unique Identifier Extension Field 703 The Unique Identifier extension field provides the client with a 704 cryptographically strong means of detecting replayed packets. It has 705 a Field Type of [[TBD2]]. When the extension field is included in a 706 client packet (mode 3), its body SHALL consist of a string of octets 707 generated uniformly at random. The string MUST be at least 32 octets 708 long. When the extension field is included in a server packet (mode 709 4), its body SHALL contain the same octet string as was provided in 710 the client packet to which the server is responding. All server 711 packets generated by NTS-implementing servers in response to client 712 packets containing this extension field MUST also contain this field 713 with the same content as in the client's request. The field's use in 714 modes other than client-server is not defined. 716 This extension field MAY also be used standalone, without NTS, in 717 which case it provides the client with a means of detecting spoofed 718 packets from off-path attackers. Historically, NTP's origin 719 timestamp field has played both these roles, but for cryptographic 720 purposes this is suboptimal because it is only 64 bits long and, 721 depending on implementation details, most of those bits may be 722 predictable. In contrast, the Unique Identifier extension field 723 enables a degree of unpredictability and collision resistance more 724 consistent with cryptographic best practice. 726 5.4. The NTS Cookie Extension Field 728 The NTS Cookie extension field has a Field Type of [[TBD3]]. Its 729 purpose is to carry information which enables the server to recompute 730 keys and other session state without having to store any per-client 731 state. The contents of its body SHALL be implementation-defined and 732 clients MUST NOT attempt to interpret them. See Section 6 for a 733 suggested construction. The NTS Cookie extension field MUST NOT be 734 included in NTP packets whose mode is other than 3 (client) or 4 735 (server). 737 5.5. The NTS Cookie Placeholder Extension Field 739 The NTS Cookie Placeholder extension field has a Field Type of 740 [[TBD4]]. When this extension field is included in a client packet 741 (mode 3), it communicates to the server that the client wishes it to 742 send additional cookies in its response. This extension field MUST 743 NOT be included in NTP packets whose mode is other than 3. 745 Whenever an NTS Cookie Placeholder extension field is present, it 746 MUST be accompanied by an NTS Cookie extension field. The body 747 length of the NTS Cookie Placeholder extension field MUST be the same 748 as the body length of the NTS Cookie extension field. This length 749 requirement serves to ensure that the response will not be larger 750 than the request, in order to improve timekeeping precision and 751 prevent DDoS amplification. The contents of the NTS Cookie 752 Placeholder extension field's body SHOULD be all zeros and, aside 753 from checking its length, MUST be ignored by the server. 755 5.6. The NTS Authenticator and Encrypted Extension Fields Extension 756 Field 758 The NTS Authenticator and Encrypted Extension Fields extension field 759 is the central cryptographic element of an NTS-protected NTP packet. 760 Its Field Type is [[TBD5]]. It SHALL be formatted according to 761 Figure 4 and include the following fields: 763 Nonce Length: Two octets in network byte order, giving the length 764 of the Nonce field, excluding any padding, interpreted as an 765 unsigned integer. 767 Ciphertext Length: Two octets in network byte order, giving the 768 length of the Ciphertext field, excluding any padding, interpreted 769 as an unsigned integer. 771 Nonce: A nonce as required by the negotiated AEAD Algorithm. The 772 end of the field is zero-padded to a word (four octets) boundary. 774 Ciphertext: The output of the negotiated AEAD Algorithm. The 775 structure of this field is determined by the negotiated algorithm, 776 but it typically contains an authentication tag in addition to the 777 actual ciphertext. The end of the field is zero-padded to a word 778 (four octets) boundary. 780 Additional Padding: Clients which use a nonce length shorter than 781 the maximum allowed by the negotiated AEAD algorithm may be 782 required to include additional zero-padding. The necessary length 783 of this field is specified below. 785 0 1 2 3 786 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 787 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 788 | Nonce Length | Ciphertext Length | 789 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 790 | | 791 . . 792 . Nonce, including up to 3 octets padding . 793 . . 794 | | 795 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 796 | | 797 . . 798 . Ciphertext, including up to 3 octets padding . 799 . . 800 | | 801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 802 | | 803 . . 804 . Additional Padding . 805 . . 806 | | 807 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 809 Figure 4: NTS Authenticator and Encrypted Extension Fields Extension 810 Field Format 812 The Ciphertext field SHALL be formed by providing the following 813 inputs to the negotiated AEAD Algorithm: 815 K: For packets sent from the client to the server, the C2S key 816 SHALL be used. For packets sent from the server to the client, 817 the S2C key SHALL be used. 819 A: The associated data SHALL consist of the portion of the NTP 820 packet beginning from the start of the NTP header and ending at 821 the end of the last extension field which precedes the NTS 822 Authenticator and Encrypted Extension Fields extension field. 824 P: The plaintext SHALL consist of all (if any) NTP extension 825 fields to be encrypted; if multiple extension fields are present 826 they SHALL be joined by concatenation. Each such field SHALL be 827 formatted in accordance with RFC 7822 [RFC7822], except that, 828 contrary to the RFC 7822 requirement that fields have a minimum 829 length of 16 or 28 octets, encrypted extension fields MAY be 830 arbitrarily short (but still MUST be a multiple of 4 octets in 831 length). 833 N: The nonce SHALL be formed however required by the negotiated 834 AEAD algorithm. 836 The purpose of the Additional Padding field is to ensure that servers 837 can always choose a nonce whose length is adequate to ensure its 838 uniqueness, even if the client chooses a shorter one, and still 839 ensure that the overall length of the server's response packet does 840 not exceed the length of the request. For mode 4 (server) packets, 841 no Additional Padding field is ever required. For mode 3 (client) 842 packets, the length of the Additional Padding field SHALL be computed 843 as follows. Let `N_LEN` be the padded length of the Nonce field. 844 Let `N_MAX` be, as specified by RFC 5116 [RFC5116], the maximum 845 permitted nonce length for the negotiated AEAD algorithm. Let 846 `N_REQ` be the lesser of 16 and N_MAX, rounded up to the nearest 847 multiple of 4. If N_LEN is greater than or equal to N_REQ, then no 848 Additional Padding field is required. Otherwise, the Additional 849 Padding field SHALL be at least N_REQ - N_LEN octets in length. 850 Servers MUST enforce this requirement by discarding any packet which 851 does not conform to it. 853 Senders are always free to include more Additional Padding than 854 mandated by the above paragraph. Theoretically, it could be 855 necessary to do so in order to bring the extension field to the 856 minimum length required by [RFC7822]. This should never happen in 857 practice because any reasonable AEAD algorithm will have a nonce and 858 an authenticator long enough to bring the extension field to its 859 required length already. Nonetheless, implementers are advised to 860 explicitly handle this case and ensure that the extension field they 861 emit is of legal length. 863 The NTS Authenticator and Encrypted Extension Fields extension field 864 MUST NOT be included in NTP packets whose mode is other than 3 865 (client) or 4 (server). 867 5.7. Protocol Details 869 A client sending an NTS-protected request SHALL include the following 870 extension fields as displayed in Figure 5: 872 Exactly one Unique Identifier extension field which MUST be 873 authenticated, MUST NOT be encrypted, and whose contents MUST be 874 the output of a cryptographically secure random number generator. 875 [RFC4086] 877 Exactly one NTS Cookie extension field which MUST be authenticated 878 and MUST NOT be encrypted. The cookie MUST be one which has been 879 previously provided to the client, either from the key exchange 880 server during the NTS-KE handshake or from the NTP server in 881 response to a previous NTS-protected NTP request. 883 Exactly one NTS Authenticator and Encrypted Extension Fields 884 extension field, generated using an AEAD Algorithm and C2S key 885 established through NTS-KE. 887 To protect the client's privacy, the client SHOULD avoid reusing a 888 cookie. If the client does not have any cookies that it has not 889 already sent, it SHOULD initiate a re-run of the NTS-KE protocol. 890 The client MAY reuse cookies in order to prioritize resilience over 891 unlinkability. Which of the two that should be prioritized in any 892 particular case is dependent on the application and the user's 893 preference. Section 10.1 describes the privacy considerations of 894 this in further detail. 896 The client MAY include one or more NTS Cookie Placeholder extension 897 fields which MUST be authenticated and MAY be encrypted. The number 898 of NTS Cookie Placeholder extension fields that the client includes 899 SHOULD be such that if the client includes N placeholders and the 900 server sends back N+1 cookies, the number of unused cookies stored by 901 the client will come to eight. The client SHOULD NOT include more 902 than seven NTS Cookie Placeholder extension fields in a request. 903 When both the client and server adhere to all cookie-management 904 guidance provided in this memo, the number of placeholder extension 905 fields will equal the number of dropped packets since the last 906 successful volley. 908 In rare circumstances, it may be necessary to include fewer NTS 909 Cookie Placeholder extensions than recommended above in order to 910 prevent datagram fragmentation. When cookies adhere the format 911 recommended in Section 6 and the AEAD in use is the mandatory-to- 912 implement AEAD_AES_SIV_CMAC_256, senders can include a cookie and 913 seven placeholders and still have packet size fall comfortably below 914 1280 octets if no non-NTS-related extensions are used; 1280 octets is 915 the minimum prescribed MTU for IPv6 and is generally safe for 916 avoiding IPv4 fragmentation. Nonetheless, senders SHOULD include 917 fewer cookies and placeholders than otherwise indicated if doing so 918 is necessary to prevent fragmentation. 920 +---------------------------------------+ 921 | - Verify time request message | 922 | - Generate time response message | 923 | - Included NTPv4 extension fields | 924 | o Unique Identifier EF | 925 | o NTS Authentication and | 926 | Encrypted Extension Fields EF | 927 | - NTS Cookie EF | 928 | - | 929 | - Transmit time request packet | 930 +-----------------+---------------------+ 931 | 932 | 933 Server -----------+---------------+-----+-----------------------> 934 ^ \ 935 / \ 936 Time request / \ Time response 937 (mode 3) / \ (mode 4) 938 / \ 939 / V 940 Client -----+---------------------------------+-----------------> 941 | | 942 | | 943 | | 944 +-----------+----------------------+ +------+-----------------+ 945 |- Generate time request message | |- Verify time response | 946 | - Include NTPv4 Extension fields | | message | 947 | o Unique Identifier EF | |- Extract cookie(s) | 948 | o NTS Cookie EF | |- Time synchronization | 949 | o | | processing | 950 | | +------------------------+ 951 |- Generate AEAD tag of NTP message| 952 |- Add NTS Authentication and | 953 | Encrypted Extension Fields EF | 954 |- Transmit time request packet | 955 +----------------------------------+ 957 Figure 5: NTS-protected NTP Time Synchronization Messages 959 The client MAY include additional (non-NTS-related) extension fields 960 which MAY appear prior to the NTS Authenticator and Encrypted 961 Extension Fields extension fields (therefore authenticated but not 962 encrypted), within it (therefore encrypted and authenticated), or 963 after it (therefore neither encrypted nor authenticated). The server 964 MUST discard any unauthenticated extension fields. Future 965 specifications of extension fields MAY provide exceptions to this 966 rule. 968 Upon receiving an NTS-protected request, the server SHALL (through 969 some implementation-defined mechanism) use the cookie to recover the 970 AEAD Algorithm, C2S key, and S2C key associated with the request, and 971 then use the C2S key to authenticate the packet and decrypt the 972 ciphertext. If the cookie is valid and authentication and decryption 973 succeed, the server SHALL include the following extension fields in 974 its response: 976 Exactly one Unique Identifier extension field which MUST be 977 authenticated, MUST NOT be encrypted, and whose contents SHALL 978 echo those provided by the client. 980 Exactly one NTS Authenticator and Encrypted Extension Fields 981 extension field, generated using the AEAD algorithm and S2C key 982 recovered from the cookie provided by the client. 984 One or more NTS Cookie extension fields which MUST be 985 authenticated and encrypted. The number of NTS Cookie extension 986 fields included SHOULD be equal to, and MUST NOT exceed, one plus 987 the number of valid NTS Cookie Placeholder extension fields 988 included in the request. The cookies returned in those fields 989 MUST be valid for use with the NTP server that sent them. They 990 MAY be valid for other NTP servers as well, but there is no way 991 for the server to indicate this. 993 We emphasize the contrast that NTS Cookie extension fields MUST NOT 994 be encrypted when sent from client to server, but MUST be encrypted 995 when sent from server to client. The former is necessary in order 996 for the server to be able to recover the C2S and S2C keys, while the 997 latter is necessary to satisfy the unlinkability goals discussed in 998 Section 10.1. We emphasize also that "encrypted" means encapsulated 999 within the NTS Authenticator and Encrypted Extensions extension 1000 field. While the body of an NTS Cookie extension field will 1001 generally consist of some sort of AEAD output (regardless of whether 1002 the recommendations of Section 6 are precisely followed), this is not 1003 sufficient to make the extension field "encrypted". 1005 The server MAY include additional (non-NTS-related) extension fields 1006 which MAY appear prior to the NTS Authenticator and Encrypted 1007 Extension Fields extension field (therefore authenticated but not 1008 encrypted), within it (therefore encrypted and authenticated), or 1009 after it (therefore neither encrypted nor authenticated). The client 1010 MUST discard any unauthenticated extension fields. Future 1011 specifications of extension fields MAY provide exceptions to this 1012 rule. 1014 Upon receiving an NTS-protected response, the client MUST verify that 1015 the Unique Identifier matches that of an outstanding request, and 1016 that the packet is authentic under the S2C key associated with that 1017 request. If either of these checks fails, the packet MUST be 1018 discarded without further processing. 1020 If the server is unable to validate the cookie or authenticate the 1021 request, it SHOULD respond with a Kiss-o'-Death (KoD) packet (see RFC 1022 5905, Section 7.4 [RFC5905]) with kiss code "NTSN", meaning "NTS NAK" 1023 (NTS negative-acknowledgment). It MUST NOT include any NTS Cookie or 1024 NTS Authenticator and Encrypted Extension Fields extension fields. 1026 If the NTP server has previously responded with authentic NTS- 1027 protected NTP packets, the client MUST verify that any KoD packets 1028 received from the server contain the Unique Identifier extension 1029 field and that the Unique Identifier matches that of an outstanding 1030 request. If this check fails, the packet MUST be discarded without 1031 further processing. If this check passes, the client MUST comply 1032 with RFC 5905, Section 7.4 [RFC5905] where required. A client MAY 1033 automatically re-run the NTS-KE protocol upon forced disassociation 1034 from an NTP server. In that case, it MUST be able to detect and stop 1035 looping between the NTS-KE and NTP servers by rate limiting the 1036 retries using e.g. exponential retry intervals. 1038 Upon reception of the NTS NAK kiss code, the client SHOULD wait until 1039 the next poll for a valid NTS-protected response and if none is 1040 received, initiate a fresh NTS-KE handshake to try to renegotiate new 1041 cookies, AEAD keys, and parameters. If the NTS-KE handshake 1042 succeeds, the client MUST discard all old cookies and parameters and 1043 use the new ones instead. As long as the NTS-KE handshake has not 1044 succeeded, the client SHOULD continue polling the NTP server using 1045 the cookies and parameters it has. 1047 To allow for NTP session restart when the NTS-KE server is 1048 unavailable and to reduce NTS-KE server load, the client SHOULD keep 1049 at least one unused but recent cookie, AEAD keys, negotiated AEAD 1050 algorithm, and other necessary parameters on persistent storage. 1051 This way, the client is able to resume the NTP session without 1052 performing renewed NTS-KE negotiation. 1054 6. Suggested Format for NTS Cookies 1056 This section is non-normative. It gives a suggested way for servers 1057 to construct NTS cookies. All normative requirements are stated in 1058 Section 4.1.6 and Section 5.4. 1060 The role of cookies in NTS is closely analogous to that of session 1061 cookies in TLS. Accordingly, the thematic resemblance of this 1062 section to RFC 5077 [RFC5077] is deliberate and the reader should 1063 likewise take heed of its security considerations. 1065 Servers should select an AEAD algorithm which they will use to 1066 encrypt and authenticate cookies. The chosen algorithm should be one 1067 such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental 1068 nonce reuse. It need not be the same as the one that was negotiated 1069 with the client. Servers should randomly generate and store a master 1070 AEAD key `K`. Servers should additionally choose a non-secret, unique 1071 value `I` as key-identifier for `K`. 1073 Servers should periodically (e.g., once daily) generate a new pair 1074 (I,K) and immediately switch to using these values for all newly- 1075 generated cookies. Following each such key rotation, servers should 1076 securely erase any prevoiusly generated keys that should now be 1077 expired, e.g. two or more rotation periods prior. Servers should 1078 continue to accept any cookie generated using keys that they have not 1079 yet erased, even if those keys are no longer current. Erasing old 1080 keys provides for forward secrecy, limiting the scope of what old 1081 information can be stolen if a master key is somehow compromised. 1082 Holding on to a limited number of old keys allows clients to 1083 seamlessly transition from one generation to the next without having 1084 to perform a new NTS-KE handshake. 1086 The need to keep keys synchronized between NTS-KE and NTP servers as 1087 well as across load-balanced clusters can make automatic key rotation 1088 challenging. However, the task can be accomplished without the need 1089 for central key-management infrastructure by using a ratchet, i.e., 1090 making each new key a deterministic, cryptographically pseudo-random 1091 function of its predecessor. A recommended concrete implementation 1092 of this approach is to use HKDF [RFC5869] to derive new keys, using 1093 the key's predecessor as Input Keying Material and its key identifier 1094 as a salt. 1096 To form a cookie, servers should first form a plaintext `P` 1097 consisting of the following fields: 1099 The AEAD algorithm negotiated during NTS-KE. 1101 The S2C key. 1103 The C2S key. 1105 Servers should then generate a nonce `N` uniformly at random, and 1106 form AEAD output `C` by encrypting `P` under key `K` with nonce `N` 1107 and no associated data. 1109 The cookie should consist of the tuple `(I,N,C)`. 1111 To verify and decrypt a cookie provided by the client, first parse it 1112 into its components `I`, `N`, and `C`. Use `I` to look up its 1113 decryption key `K`. If the key whose identifier is `I` has been 1114 erased or never existed, decryption fails; reply with an NTS NAK. 1115 Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` 1116 and nonce `N` with no associated data. If decryption or verification 1117 fails, reply with an NTS NAK. Otherwise, parse out the contents of 1118 the resulting plaintext `P` to obtain the negotiated AEAD algorithm, 1119 S2C key, and C2S key. 1121 7. IANA Considerations 1123 7.1. Service Name and Transport Protocol Port Number Registry 1125 IANA is requested to allocate the following entry in the Service Name 1126 and Transport Protocol Port Number Registry [RFC6335]: 1128 Service Name: ntske 1130 Transport Protocol: tcp 1132 Assignee: IESG 1134 Contact: IETF Chair 1136 Description: Network Time Security Key Exchange 1138 Reference: [[this memo]] 1140 Port Number: [[TBD1]], selected by IANA from the User Port range 1142 [[RFC EDITOR: Replace all instances of [[TBD1]] in this document with 1143 the IANA port assignment.]] 1145 7.2. TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs 1146 Registry 1148 IANA is requested to allocate the following entry in the TLS 1149 Application-Layer Protocol Negotiation (ALPN) Protocol IDs registry 1150 [RFC7301]: 1152 Protocol: Network Time Security Key Establishment, version 1 1154 Identification Sequence: 1155 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 1157 Reference: [[this memo]], Section 4 1159 7.3. TLS Exporter Labels Registry 1161 IANA is requested to allocate the following entry in the TLS Exporter 1162 Labels Registry [RFC5705]: 1164 +--------------------+---------+-------------+---------------+------+ 1165 | Value | DTLS-OK | Recommended | Reference | Note | 1166 +--------------------+---------+-------------+---------------+------+ 1167 | EXPORTER-network- | Y | Y | [[this | | 1168 | time-security/1 | | | memo]], | | 1169 | | | | Section 4.2 | | 1170 +--------------------+---------+-------------+---------------+------+ 1172 7.4. NTP Kiss-o'-Death Codes Registry 1174 IANA is requested to allocate the following entry in the registry of 1175 NTP Kiss-o'-Death Codes [RFC5905]: 1177 +------+---------------------------------------+--------------------+ 1178 | Code | Meaning | Reference | 1179 +------+---------------------------------------+--------------------+ 1180 | NTSN | Network Time Security (NTS) negative- | [[this memo]], | 1181 | | acknowledgment (NAK) | Section 5.7 | 1182 +------+---------------------------------------+--------------------+ 1184 7.5. NTP Extension Field Types Registry 1186 IANA is requested to allocate the following entries in the NTP 1187 Extension Field Types registry [RFC5905]: 1189 +----------+-----------------------------+--------------------------+ 1190 | Field | Meaning | Reference | 1191 | Type | | | 1192 +----------+-----------------------------+--------------------------+ 1193 | [[TBD2]] | Unique Identifier | [[this memo]], | 1194 | | | Section 5.3 | 1195 | [[TBD3]] | NTS Cookie | [[this memo]], | 1196 | | | Section 5.4 | 1197 | [[TBD4]] | NTS Cookie Placeholder | [[this memo]], | 1198 | | | Section 5.5 | 1199 | [[TBD5]] | NTS Authenticator and | [[this memo]], | 1200 | | Encrypted Extension Fields | Section 5.6 | 1201 +----------+-----------------------------+--------------------------+ 1203 [[RFC EDITOR: REMOVE BEFORE PUBLICATION - The NTP WG suggests that 1204 the following values be used: 1206 Unique Identifier 0x0104 1207 NTS Cookie 0x0204 1208 Cookie Placeholder 0x0304 1209 NTS Authenticator 0x0404]] 1211 [[RFC EDITOR: Replace all instances of [[TBD2]], [[TBD3]], [[TBD4]], 1212 and [[TBD5]] in this document with the respective IANA assignments.]] 1214 7.6. Network Time Security Key Establishment Record Types Registry 1216 IANA is requested to create a new registry entitled "Network Time 1217 Security Key Establishment Record Types". Entries SHALL have the 1218 following fields: 1220 Record Type Number (REQUIRED): An integer in the range 0-32767 1221 inclusive. 1223 Description (REQUIRED): A short text description of the purpose of 1224 the field. 1226 Reference (REQUIRED): A reference to a document specifying the 1227 semantics of the record. 1229 The policy for allocation of new entries in this registry SHALL vary 1230 by the Record Type Number, as follows: 1232 0-1023: IETF Review 1234 1024-16383: Specification Required 1236 16384-32767: Private and Experimental Use 1238 The initial contents of this registry SHALL be as follows: 1240 +-------------+-------------------------+---------------------------+ 1241 | Record Type | Description | Reference | 1242 | Number | | | 1243 +-------------+-------------------------+---------------------------+ 1244 | 0 | End of Message | [[this memo]], | 1245 | | | Section 4.1.1 | 1246 | 1 | NTS Next Protocol | [[this memo]], | 1247 | | Negotiation | Section 4.1.2 | 1248 | 2 | Error | [[this memo]], | 1249 | | | Section 4.1.3 | 1250 | 3 | Warning | [[this memo]], | 1251 | | | Section 4.1.4 | 1252 | 4 | AEAD Algorithm | [[this memo]], | 1253 | | Negotiation | Section 4.1.5 | 1254 | 5 | New Cookie for NTPv4 | [[this memo]], | 1255 | | | Section 4.1.6 | 1256 | 6 | NTPv4 Server | [[this memo]], | 1257 | | Negotiation | Section 4.1.7 | 1258 | 7 | NTPv4 Port Negotiation | [[this memo]], | 1259 | | | Section 4.1.8 | 1260 | 16384-32767 | Reserved for Private & | [[this memo]] | 1261 | | Experimental Use | | 1262 +-------------+-------------------------+---------------------------+ 1264 7.7. Network Time Security Next Protocols Registry 1266 IANA is requested to create a new registry entitled "Network Time 1267 Security Next Protocols". Entries SHALL have the following fields: 1269 Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive, 1270 functioning as an identifier. 1272 Protocol Name (REQUIRED): A short text string naming the protocol 1273 being identified. 1275 Reference (REQUIRED): A reference to a relevant specification 1276 document. 1278 The policy for allocation of new entries in these registries SHALL 1279 vary by their Protocol ID, as follows: 1281 0-1023: IETF Review 1283 1024-32767: Specification Required 1285 32768-65535: Private and Experimental Use 1287 The initial contents of this registry SHALL be as follows: 1289 +-------------+-------------------------------+---------------------+ 1290 | Protocol ID | Protocol Name | Reference | 1291 +-------------+-------------------------------+---------------------+ 1292 | 0 | Network Time Protocol version | [[this memo]] | 1293 | | 4 (NTPv4) | | 1294 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1295 | | Experimental Use | memo]] | 1296 +-------------+-------------------------------+---------------------+ 1298 7.8. Network Time Security Error and Warning Codes Registries 1300 IANA is requested to create two new registries entitled "Network Time 1301 Security Error Codes" and "Network Time Security Warning Codes". 1302 Entries in each SHALL have the following fields: 1304 Number (REQUIRED): An integer in the range 0-65535 inclusive 1306 Description (REQUIRED): A short text description of the condition. 1308 Reference (REQUIRED): A reference to a relevant specification 1309 document. 1311 The policy for allocation of new entries in these registries SHALL 1312 vary by their Number, as follows: 1314 0-1023: IETF Review 1316 1024-32767: Specification Required 1318 32768-65535: Private and Experimental Use 1320 The initial contents of the Network Time Security Error Codes 1321 Registry SHALL be as follows: 1323 +-------------+------------------------------+----------------------+ 1324 | Number | Description | Reference | 1325 +-------------+------------------------------+----------------------+ 1326 | 0 | Unrecognized Critical | [[this memo]], | 1327 | | Extension | Section 4.1.3 | 1328 | 1 | Bad Request | [[this memo]], | 1329 | | | Section 4.1.3 | 1330 | 2 | Internal Server Error | [[this memo]], | 1331 | | | Section 4.1.3 | 1332 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1333 | | Experimental Use | memo]] | 1334 +-------------+------------------------------+----------------------+ 1335 The Network Time Security Warning Codes Registry SHALL initially be 1336 empty except for the reserved range, i.e.: 1338 +-------------+-------------------------------+---------------------+ 1339 | Number | Description | Reference | 1340 +-------------+-------------------------------+---------------------+ 1341 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1342 | | Experimental Use | memo]] | 1343 +-------------+-------------------------------+---------------------+ 1345 8. Implementation Status - RFC EDITOR: REMOVE BEFORE PUBLICATION 1347 This section records the status of known implementations of the 1348 protocol defined by this specification at the time of posting of this 1349 Internet-Draft, and is based on a proposal described in RFC 7942. 1350 The description of implementations in this section is intended to 1351 assist the IETF in its decision processes in progressing drafts to 1352 RFCs. Please note that the listing of any individual implementation 1353 here does not imply endorsement by the IETF. Furthermore, no effort 1354 has been spent to verify the information presented here that was 1355 supplied by IETF contributors. This is not intended as, and must not 1356 be construed to be, a catalog of available implementations or their 1357 features. Readers are advised to note that other implementations may 1358 exist. 1360 According to RFC 7942, "this will allow reviewers and working groups 1361 to assign due consideration to documents that have the benefit of 1362 running code, which may serve as evidence of valuable experimentation 1363 and feedback that have made the implemented protocols more mature. 1364 It is up to the individual working groups to use this information as 1365 they see fit". 1367 8.1. Implementation 1 1369 Organization: Ostfalia University of Applied Science 1371 Implementor: Martin Langer 1373 Maturity: Proof-of-Concept Prototype 1375 This implementation was used to verify consistency and to ensure 1376 completeness of this specification. 1378 8.1.1. Coverage 1380 This implementation covers the complete specification. 1382 8.1.2. Licensing 1384 The code is released under a Apache License 2.0 license. 1386 The source code is available at: https://gitlab.com/MLanger/nts/ 1388 8.1.3. Contact Information 1390 Contact Martin Langer: mart.langer@ostfalia.de 1392 8.1.4. Last Update 1394 The implementation was updated 25. February 2019. 1396 8.2. Implementation 2 1398 Organization: Netnod 1400 Implementor: Christer Weinigel 1402 Maturity: Proof-of-Concept Prototype 1404 This implementation was used to verify consistency and to ensure 1405 completeness of this specification. 1407 8.2.1. Coverage 1409 This implementation covers the complete specification. 1411 8.2.2. Licensing 1413 The source code is available at: https://github.com/Netnod/nts-poc- 1414 python. 1416 See LICENSE file for details on licensing (BSD 2). 1418 8.2.3. Contact Information 1420 Contact Christer Weinigel: christer@weinigel.se 1422 8.2.4. Last Update 1424 The implementation was updated 31. January 2019. 1426 8.3. Implementation 3 1428 Organization: Red Hat 1430 Implementor: Miroslav Lichvar 1432 Maturity: Prototype 1434 This implementation was used to verify consistency and to ensure 1435 completeness of this specification. 1437 8.3.1. Coverage 1439 This implementation covers the complete specification. 1441 8.3.2. Licensing 1443 Licensing is GPLv2. 1445 The source code is available at: https://github.com/mlichvar/chrony- 1446 nts 1448 8.3.3. Contact Information 1450 Contact Miroslav Lichvar: mlichvar@redhat.com 1452 8.3.4. Last Update 1454 The implementation was updated 28. March 2019. 1456 8.4. Implementation 4 1458 Organization: NTPsec 1460 Implementor: Hal Murray and NTPsec team 1462 Maturity:Looking for testers. Servers running at 1463 ntp1.glypnod.com:123 and ntp2.glypnod.com:123 1465 This implementation was used to verify consistency and to ensure 1466 completeness of this specification. 1468 8.4.1. Coverage 1470 This implementation covers the complete specification. 1472 8.4.2. Licensing 1474 The source code is available at: https://gitlab.com/NTPsec/ntpsec. 1475 Licensing details in LICENSE. 1477 8.4.3. Contact Information 1479 Contact Hal Murray: hmurray@megapathdsl.net, devel@ntpsec.org 1481 8.4.4. Last Update 1483 The implementation was updated 2019-Apr-10. 1485 8.5. Implementation 5 1487 Organization: Cloudflare 1489 Implementor: Watson Ladd 1491 Maturity: 1493 This implementation was used to verify consistency and to ensure 1494 completeness of this specification. 1496 8.5.1. Coverage 1498 This implementation covers the server side of the NTS specification. 1500 8.5.2. Licensing 1502 The source code is available at: https://github.com/wbl/nts-rust 1504 Licensing is ISC (details see LICENSE.txt file). 1506 8.5.3. Contact Information 1508 Contact Watson Ladd: watson@cloudflare.com 1510 8.5.4. Last Update 1512 The implementation was updated 21. March 2019. 1514 8.6. Implementation 6 1516 Organization: Hacklunch, independent 1518 Implementor: Michael Cardell Widerkrantz, Daniel Lublin, Martin 1519 Samuelsson et. al. 1521 Maturity: interoperable client, immature server 1523 8.6.1. Coverage 1525 NTS-KE client and server. 1527 8.6.2. Licensing 1529 Licensing is ISC (details in LICENSE file). 1531 Source code is available at: https://gitlab.com/hacklunch/ntsclient 1533 8.6.3. Contact Information 1535 Contact Michael Cardell Widerkrantz: mc@netnod.se 1537 8.6.4. Last Update 1539 The implementation was updated 6. February 2020. 1541 8.7. Interoperability 1543 The Interoperability tests distinguished between NTS key 1544 establishment protocol and NTS time exchange messages. For the 1545 implementations 1, 2, 3, and 4 pairwise interoperability of the NTS 1546 key establishment protocol and exchange of NTS protected NTP messages 1547 have been verified successfully. The implementation 2 was able to 1548 successfully perform the key establishment protocol against the 1549 server side of the implementation 5. 1551 These tests successfully demonstrate that there are at least four 1552 running implementations of this draft which are able to interoperate. 1554 9. Security Considerations 1556 9.1. Protected Modes 1558 NTP provides many different operating modes in order to support 1559 different network topologies and to adapt to various requirements. 1560 This memo only specifies NTS for NTP modes 3 (client) and 4 (server) 1561 (see Section 1.2). The best current practice for authenticating the 1562 other NTP modes is using the symmetric message authentication code 1563 feature as described in RFC 5905 [RFC5905] and RFC 8573 [RFC8573]. 1565 9.2. Sensitivity to DDoS Attacks 1567 The introduction of NTS brings with it the introduction of asymmetric 1568 cryptography to NTP. Asymmetric cryptography is necessary for 1569 initial server authentication and AEAD key extraction. Asymmetric 1570 cryptosystems are generally orders of magnitude slower than their 1571 symmetric counterparts. This makes it much harder to build systems 1572 that can serve requests at a rate corresponding to the full line 1573 speed of the network connection. This, in turn, opens up a new 1574 possibility for DDoS attacks on NTP services. 1576 The main protection against these attacks in NTS lies in that the use 1577 of asymmetric cryptosystems is only necessary in the initial NTS-KE 1578 phase of the protocol. Since the protocol design enables separation 1579 of the NTS-KE and NTP servers, a successful DDoS attack on an NTS-KE 1580 server separated from the NTP service it supports will not affect NTP 1581 users that have already performed initial authentication, AEAD key 1582 extraction, and cookie exchange. 1584 NTS users should also consider that they are not fully protected 1585 against DoS attacks by on-path adversaries. In addition to dropping 1586 packets and attacks such as those described in Section 9.5, an on- 1587 path attacker can send spoofed kiss-o'-death replies, which are not 1588 authenticated, in response to NTP requests. This could result in 1589 significantly increased load on the NTS-KE server. Implementers have 1590 to weigh the user's need for unlinkability against the added 1591 resilience that comes with cookie reuse in cases of NTS-KE server 1592 unavailability. 1594 9.3. Avoiding DDoS Amplification 1596 Certain non-standard and/or deprecated features of the Network Time 1597 Protocol enable clients to send a request to a server which causes 1598 the server to send a response much larger than the request. Servers 1599 which enable these features can be abused in order to amplify traffic 1600 volume in DDoS attacks by sending them a request with a spoofed 1601 source IP. In recent years, attacks of this nature have become an 1602 endemic nuisance. 1604 NTS is designed to avoid contributing any further to this problem by 1605 ensuring that NTS-related extension fields included in server 1606 responses will be the same size as the NTS-related extension fields 1607 sent by the client. In particular, this is why the client is 1608 required to send a separate and appropriately padded-out NTS Cookie 1609 Placeholder extension field for every cookie it wants to get back, 1610 rather than being permitted simply to specify a desired quantity. 1612 Due to the RFC 7822 [RFC7822] requirement that extensions be padded 1613 and aligned to four-octet boundaries, response size may still in some 1614 cases exceed request size by up to three octets. This is 1615 sufficiently inconsequential that we have declined to address it. 1617 9.4. Initial Verification of Server Certificates 1619 NTS's security goals are undermined if the client fails to verify 1620 that the X.509 certificate chain presented by the NTS-KE server is 1621 valid and rooted in a trusted certificate authority. RFC 5280 1622 [RFC5280] and RFC 6125 [RFC6125] specify how such verification is to 1623 be performed in general. However, the expectation that the client 1624 does not yet have a correctly-set system clock at the time of 1625 certificate verification presents difficulties with verifying that 1626 the certificate is within its validity period, i.e., that the current 1627 time lies between the times specified in the certificate's notBefore 1628 and notAfter fields. It may be operationally necessary in some cases 1629 for a client to accept a certificate which appears to be expired or 1630 not yet valid. While there is no perfect solution to this problem, 1631 there are several mitigations the client can implement to make it 1632 more difficult for an adversary to successfully present an expired 1633 certificate: 1635 Check whether the system time is in fact unreliable. If the 1636 system clock has previously been synchronized since last boot, 1637 then on operating systems which implement a kernel-based phase- 1638 locked-loop API, a call to ntp_gettime() should show a maximum 1639 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be 1640 considered reliable and certificates can be strictly validated. 1642 Allow the system administrator to specify that certificates should 1643 *always* be strictly validated. Such a configuration is 1644 appropriate on systems which have a battery-backed clock and which 1645 can reasonably prompt the user to manually set an approximately- 1646 correct time if it appears to be needed. 1648 Once the clock has been synchronized, periodically write the 1649 current system time to persistent storage. Do not accept any 1650 certificate whose notAfter field is earlier than the last recorded 1651 time. 1653 NTP time replies are expected to be consistent with the NTS-KE TLS 1654 certificate validity period, i.e. time replies received 1655 immediately after an NTS-KE handshake are expected to lie within 1656 the certificate validity period. Implementations are recommended 1657 to check that this is the case. Performing a new NTS-KE handshake 1658 based solely on the fact that the certificate used by the NTS-KE 1659 server in a previous handshake has expired is normally not 1660 necessary. Clients that still wish to do this must take care not 1661 to cause an inadvertent denial-of-service attack on the NTS-KE 1662 server, for example by picking a random time in the week preceding 1663 certificate expiry to perform the new handshake. 1665 Use multiple time sources. The ability to pass off an expired 1666 certificate is only useful to an adversary who has compromised the 1667 corresponding private key. If the adversary has compromised only 1668 a minority of servers, NTP's selection algorithm (RFC 5905 section 1669 11.2.1 [RFC5905]) will protect the client from accepting bad time 1670 from the adversary-controlled servers. 1672 9.5. Delay Attacks 1674 In a packet delay attack, an adversary with the ability to act as a 1675 man-in-the-middle delays time synchronization packets between client 1676 and server asymmetrically [RFC7384]. Since NTP's formula for 1677 computing time offset relies on the assumption that network latency 1678 is roughly symmetrical, this leads to the client to compute an 1679 inaccurate value [Mizrahi]. The delay attack does not reorder or 1680 modify the content of the exchanged synchronization packets. 1681 Therefore, cryptographic means do not provide a feasible way to 1682 mitigate this attack. However, the maximum error that an adversary 1683 can introduce is bounded by half of the round trip delay. 1685 RFC 5905 [RFC5905] specifies a parameter called MAXDIST which denotes 1686 the maximum round-trip latency (including not only the immediate 1687 round trip between client and server, but the whole distance back to 1688 the reference clock as reported in the Root Delay field) that a 1689 client will tolerate before concluding that the server is unsuitable 1690 for synchronization. The standard value for MAXDIST is one second, 1691 although some implementations use larger values. Whatever value a 1692 client chooses, the maximum error which can be introduced by a delay 1693 attack is MAXDIST/2. 1695 Usage of multiple time sources, or multiple network paths to a given 1696 time source [Shpiner], may also serve to mitigate delay attacks if 1697 the adversary is in control of only some of the paths. 1699 9.6. NTS Stripping 1701 Implementers must be aware of the possibility of "NTS stripping" 1702 attacks, where an attacker tricks clients into reverting to plain 1703 NTP. Naive client implementations might, for example, revert 1704 automatically to plain NTP if the NTS-KE handshake fails. A man-in- 1705 the-middle attacker can easily cause this to happen. Even clients 1706 that already hold valid cookies can be vulnerable, since an attacker 1707 can force a client to repeat the NTS-KE handshake by sending faked 1708 NTP mode 4 replies with the NTS NAK kiss code. Forcing a client to 1709 repeat the NTS-KE handshake can also be the first step in more 1710 advanced attacks. 1712 For the reasons described here, implementations SHOULD NOT revert 1713 from NTS-protected to unprotected NTP with any server without 1714 explicit user action. 1716 10. Privacy Considerations 1718 10.1. Unlinkability 1720 Unlinkability prevents a device from being tracked when it changes 1721 network addresses (e.g. because said device moved between different 1722 networks). In other words, unlinkability thwarts an attacker that 1723 seeks to link a new network address used by a device with a network 1724 address that it was formerly using, because of recognizable data that 1725 the device persistently sends as part of an NTS-secured NTP 1726 association. This is the justification for continually supplying the 1727 client with fresh cookies, so that a cookie never represents 1728 recognizable data in the sense outlined above. 1730 NTS's unlinkability objective is merely to not leak any additional 1731 data that could be used to link a device's network address. NTS does 1732 not rectify legacy linkability issues that are already present in 1733 NTP. Thus, a client that requires unlinkability must also minimize 1734 information transmitted in a client query (mode 3) packet as 1735 described in the draft [I-D.ietf-ntp-data-minimization]. 1737 The unlinkability objective only holds for time synchronization 1738 traffic, as opposed to key exchange traffic. This implies that it 1739 cannot be guaranteed for devices that function not only as time 1740 clients, but also as time servers (because the latter can be 1741 externally triggered to send linkable data, such as the TLS 1742 certificate). 1744 It should also be noted that it could be possible to link devices 1745 that operate as time servers from their time synchronization traffic, 1746 using information exposed in (mode 4) server response packets (e.g. 1747 reference ID, reference time, stratum, poll). Also, devices that 1748 respond to NTP control queries could be linked using the information 1749 revealed by control queries. 1751 Note that the unlinkability objective does not prevent a client 1752 device to be tracked by its time servers. 1754 10.2. Confidentiality 1756 NTS does not protect the confidentiality of information in NTP's 1757 header fields. When clients implement 1758 [I-D.ietf-ntp-data-minimization], client packet headers do not 1759 contain any information which the client could conceivably wish to 1760 keep secret: one field is random, and all others are fixed. 1761 Information in server packet headers is likewise public: the origin 1762 timestamp is copied from the client's (random) transmit timestamp, 1763 and all other fields are set the same regardless of the identity of 1764 the client making the request. 1766 Future extension fields could hypothetically contain sensitive 1767 information, in which case NTS provides a mechanism for encrypting 1768 them. 1770 11. Acknowledgements 1772 The authors would like to thank Richard Barnes, Steven Bellovin, 1773 Patrik Faeltstroem (Faltstrom), Scott Fluhrer, Sharon Goldberg, Russ 1774 Housley, Benjamin Kaduk, Suresh Krishnan, Martin Langer, Barry Leiba, 1775 Miroslav Lichvar, Aanchal Malhotra, Dave Mills, Sandra Murphy, Danny 1776 Mayer, Karen O'Donoghue, Eric K. Rescorla, Stephen Roettger, Kurt 1777 Roeckx, Dan Romascanu, Kyle Rose, Rich Salz, Brian Sniffen, Susan 1778 Sons, Douglas Stebila, Harlan Stenn, Joachim Stroembergsson 1779 (Strombergsson), Martin Thomson, Eric (Eric) Vyncke, Richard Welty, 1780 Christer Weinigel, and Magnus Westerlund for contributions to this 1781 document and comments on the design of NTS. 1783 12. References 1785 12.1. Normative References 1787 [IANA-AEAD] 1788 IANA, "Authenticated Encryption with Associated Data 1789 (AEAD) Parameters", 1790 . 1792 [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, 1793 RFC 20, DOI 10.17487/RFC0020, October 1969, 1794 . 1796 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1797 Requirement Levels", BCP 14, RFC 2119, 1798 DOI 10.17487/RFC2119, March 1997, 1799 . 1801 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1802 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 1803 2006, . 1805 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1806 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1807 . 1809 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1810 Housley, R., and W. Polk, "Internet X.509 Public Key 1811 Infrastructure Certificate and Certificate Revocation List 1812 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1813 . 1815 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 1816 Authenticated Encryption Using the Advanced Encryption 1817 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 1818 2008, . 1820 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1821 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1822 March 2010, . 1824 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1825 Key Derivation Function (HKDF)", RFC 5869, 1826 DOI 10.17487/RFC5869, May 2010, 1827 . 1829 [RFC5890] Klensin, J., "Internationalized Domain Names for 1830 Applications (IDNA): Definitions and Document Framework", 1831 RFC 5890, DOI 10.17487/RFC5890, August 2010, 1832 . 1834 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 1835 "Network Time Protocol Version 4: Protocol and Algorithms 1836 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 1837 . 1839 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1840 Verification of Domain-Based Application Service Identity 1841 within Internet Public Key Infrastructure Using X.509 1842 (PKIX) Certificates in the Context of Transport Layer 1843 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1844 2011, . 1846 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 1847 Cheshire, "Internet Assigned Numbers Authority (IANA) 1848 Procedures for the Management of the Service Name and 1849 Transport Protocol Port Number Registry", BCP 165, 1850 RFC 6335, DOI 10.17487/RFC6335, August 2011, 1851 . 1853 [RFC6874] Carpenter, B., Cheshire, S., and R. Hinden, "Representing 1854 IPv6 Zone Identifiers in Address Literals and Uniform 1855 Resource Identifiers", RFC 6874, DOI 10.17487/RFC6874, 1856 February 2013, . 1858 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1859 "Transport Layer Security (TLS) Application-Layer Protocol 1860 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1861 July 2014, . 1863 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1864 "Recommendations for Secure Use of Transport Layer 1865 Security (TLS) and Datagram Transport Layer Security 1866 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1867 2015, . 1869 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 1870 (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, 1871 March 2016, . 1873 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1874 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1875 May 2017, . 1877 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1878 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1879 . 1881 12.2. Informative References 1883 [I-D.ietf-ntp-data-minimization] 1884 Franke, D. and A. Malhotra, "NTP Client Data 1885 Minimization", draft-ietf-ntp-data-minimization-04 (work 1886 in progress), March 2019. 1888 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1889 against time synchronization protocols", in Proceedings 1890 of Precision Clock Synchronization for Measurement Control 1891 and Communication, ISPCS 2012, pp. 1-6 1892 DOI 10.1109/ISPCS.2012.6336612, September 2012. 1894 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 1895 "Randomness Requirements for Security", BCP 106, RFC 4086, 1896 DOI 10.17487/RFC4086, June 2005, 1897 . 1899 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1900 "Transport Layer Security (TLS) Session Resumption without 1901 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1902 January 2008, . 1904 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1905 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 1906 October 2014, . 1908 [RFC8573] Malhotra, A. and S. Goldberg, "Message Authentication Code 1909 for the Network Time Protocol", RFC 8573, 1910 DOI 10.17487/RFC8573, June 2019, 1911 . 1913 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 1914 Protocols", in Proceedings of IEEE International Symposium 1915 on Precision Clock Synchronization for Measurement, 1916 Control and Communication (ISPCS) 1917 DOI 10.1109/ISPCS.2013.6644754, September 2013. 1919 Appendix A. Terms and Abbreviations 1921 AEAD Authenticated Encryption with Associated Data [RFC5116] 1923 ALPN Application-Layer Protocol Negotiation [RFC7301] 1925 C2S Client-to-server 1927 DoS Denial-of-Service 1929 DDoS Distributed Denial-of-Service 1931 EF Extension Field [RFC5905] 1933 HKDF Hashed Message Authentication Code-based Key Derivation 1934 Function [RFC5869] 1936 KoD Kiss-o'-Death [RFC5905] 1938 NTP Network Time Protocol [RFC5905] 1940 NTS Network Time Security 1941 NTS NAK NTS negative-acknowledgment 1943 NTS-KE Network Time Security Key Exchange 1945 PRF Pseudorandom Function 1947 S2C Server-to-client 1949 TLS Transport Layer Security [RFC8446] 1951 Authors' Addresses 1953 Daniel Fox Franke 1954 Akamai Technologies 1955 145 Broadway 1956 Cambridge, MA 02142 1957 United States 1959 Email: dafranke@akamai.com 1961 Dieter Sibold 1962 Physikalisch-Technische 1963 Bundesanstalt 1964 Bundesallee 100 1965 Braunschweig D-38116 1966 Germany 1968 Phone: +49-(0)531-592-8420 1969 Fax: +49-531-592-698420 1970 Email: dieter.sibold@ptb.de 1972 Kristof Teichel 1973 Physikalisch-Technische 1974 Bundesanstalt 1975 Bundesallee 100 1976 Braunschweig D-38116 1977 Germany 1979 Phone: +49-(0)531-592-4471 1980 Email: kristof.teichel@ptb.de 1981 Marcus Dansarie 1982 Sweden 1984 Email: marcus@dansarie.se 1985 URI: https://orcid.org/0000-0001-9246-0263 1987 Ragnar Sundblad 1988 Netnod 1989 Sweden 1991 Email: ragge@netnod.se