idnits 2.17.1 draft-ietf-ntp-using-nts-for-ntp-23.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 3, 2020) is 1515 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 392 -- Looks like a reference, but probably isn't: '1' on line 392 -- Possible downref: Non-RFC (?) normative reference: ref. 'IANA-AEAD' ** Downref: Normative reference to an Informational RFC: RFC 5297 ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7507 (Obsoleted by RFC 8996) ** 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 4, 2020 K. Teichel 6 PTB 7 M. Dansarie 9 R. Sundblad 10 Netnod 11 March 3, 2020 13 Network Time Security for the Network Time Protocol 14 draft-ietf-ntp-using-nts-for-ntp-23 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 4, 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 . . . . . . . . . . . . . . . . . . . 10 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 . . . . . . . . . . . . . . . 13 79 4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 14 80 5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 14 81 5.1. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 14 82 5.2. Packet Structure Overview . . . . . . . . . . . . . . . . 15 83 5.3. The Unique Identifier Extension Field . . . . . . . . . . 15 84 5.4. The NTS Cookie Extension Field . . . . . . . . . . . . . 16 85 5.5. The NTS Cookie Placeholder Extension Field . . . . . . . 16 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 . . . . . . . . . . . . . . 24 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 . . . . . . . . . . . . . . . . . . . . 31 103 8.1.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 31 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 . . . . . . . . . . . . . . . . . . . . . . 32 110 8.2.3. Contact Information . . . . . . . . . . . . . . . . . 32 111 8.2.4. Last Update . . . . . . . . . . . . . . . . . . . . . 32 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 . . . . . . . . . . . . . . . . . . . . 33 118 8.4.1. Coverage . . . . . . . . . . . . . . . . . . . . . . 33 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 . . . . . . . . . . . . . . . . . . . . . . 34 125 8.5.3. Contact Information . . . . . . . . . . . . . . . . . 34 126 8.5.4. Last Update . . . . . . . . . . . . . . . . . . . . . 34 127 8.6. Implementation 6 . . . . . . . . . . . . . . . . . . . . 34 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 . . . . . . . . . . . . . . . . . . . 35 134 9.1. Protected Modes . . . . . . . . . . . . . . . . . . . . . 35 135 9.2. Sensitivity to DDoS Attacks . . . . . . . . . . . . . . . 35 136 9.3. Avoiding DDoS Amplification . . . . . . . . . . . . . . . 36 137 9.4. Initial Verification of Server Certificates . . . . . . . 36 138 9.5. Delay Attacks . . . . . . . . . . . . . . . . . . . . . . 37 139 9.6. Random Number Generation . . . . . . . . . . . . . . . . 38 140 9.7. NTS Stripping . . . . . . . . . . . . . . . . . . . . . . 38 141 10. Privacy Considerations . . . . . . . . . . . . . . . . . . . 38 142 10.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 38 143 10.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 39 144 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 39 145 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 40 146 12.1. Normative References . . . . . . . . . . . . . . . . . . 40 147 12.2. Informative References . . . . . . . . . . . . . . . . . 42 148 Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 43 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 the 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 1.2. Protocol Overview 198 The Network Time Protocol includes many different operating modes to 199 support various network topologies (see RFC 5905, Section 3 200 [RFC5905]). In addition to its best-known and most-widely-used 201 client-server mode, it also includes modes for synchronization 202 between symmetric peers, a control mode for server monitoring and 203 administration, and a broadcast mode. These various modes have 204 differing and partly contradictory requirements for security and 205 performance. Symmetric and control modes demand mutual 206 authentication and mutual replay protection. Additionally, for 207 certain message types control mode may require confidentiality as 208 well as authentication. Client-server mode places more stringent 209 requirements on resource utilization than other modes, because 210 servers may have vast number of clients and be unable to afford to 211 maintain per-client state. However, client-server mode also has more 212 relaxed security needs, because only the client requires replay 213 protection: it is harmless for stateless servers to process replayed 214 packets. The security demands of symmetric and control modes, on the 215 other hand, are in conflict with the resource-utilization demands of 216 client-server mode: any scheme which provides replay protection 217 inherently involves maintaining some state to keep track of what 218 messages have already been seen. 220 This memo specifies NTS exclusively for the client-server mode of 221 NTP. To this end, NTS is structured as a suite of two protocols: 223 The "NTS Extensions for NTPv4" define a collection of NTP 224 extension fields for cryptographically securing NTPv4 using 225 previously-established key material. They are suitable for 226 securing client-server mode because the server can implement them 227 without retaining per-client state. All state is kept by the 228 client and provided to the server in the form of an encrypted 229 cookie supplied with each request. On the other hand, the NTS 230 Extension Fields are suitable *only* for client-server mode 231 because only the client, and not the server, is protected from 232 replay. 234 The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for 235 establishing key material for use with the NTS Extension Fields 236 for NTPv4. It uses TLS to exchange keys, provide the client with 237 an initial supply of cookies, and negotiate some additional 238 protocol options. After this exchange, the TLS channel is closed 239 with no per-client state remaining on the server side. 241 The typical protocol flow is as follows: The client connects to an 242 NTS-KE server on the NTS TCP port and the two parties perform a TLS 243 handshake. Via the TLS channel, the parties negotiate some 244 additional protocol parameters and the server sends the client a 245 supply of cookies along with an IP address to the NTP server for 246 which the cookies are valid. The parties use TLS key export 247 [RFC5705] to extract key material which will be used in the next 248 phase of the protocol. This negotiation takes only a single round 249 trip, after which the server closes the connection and discards all 250 associated state. At this point the NTS-KE phase of the protocol is 251 complete. Ideally, the client never needs to connect to the NTS-KE 252 server again. 254 Time synchronization proceeds with one of the indicated NTP servers 255 over the NTP UDP port. The client sends the server an NTP client 256 packet which includes several extension fields. Included among these 257 fields are a cookie (previously provided by the key exchange server) 258 and an authentication tag, computed using key material extracted from 259 the NTS-KE handshake. The NTP server uses the cookie to recover this 260 key material and send back an authenticated response. The response 261 includes a fresh, encrypted cookie which the client then sends back 262 in the clear in a subsequent request. (This constant refreshing of 263 cookies is necessary in order to achieve NTS's unlinkability goal.) 265 Figure 1 provides an overview of the high-level interaction between 266 the client, the NTS-KE server, and the NTP server. Note that the 267 cookies' data format and the exchange of secrets between NTS-KE and 268 NTP servers are not part of this specification and are implementation 269 dependent. However, a suggested format for NTS cookies is provided 270 in Section 6. 272 +--------------+ 273 | | 274 +-> | NTP Server 1 | 275 | | | 276 Shared cookie | +--------------+ 277 +---------------+ encryption parameters | +--------------+ 278 | | (Implementation dependent) | | | 279 | NTS-KE Server | <------------------------------+-> | NTP Server 2 | 280 | | | | | 281 +---------------+ | +--------------+ 282 ^ | . 283 | | . 284 | 1. Negotiate parameters, | . 285 | receive initial cookie | +--------------+ 286 | supply, generate AEAD keys, | | | 287 | and receive NTP server IP +-> | NTP Server N | 288 | addresses using "NTS Key | | 289 | Establishment" protocol. +--------------+ 290 | ^ 291 | | 292 | +----------+ | 293 | | | | 294 +-----------> | Client | <-------------------------+ 295 | | 2. Perform authenticated 296 +----------+ time synchronization 297 and generate new 298 cookies using "NTS 299 Extension Fields for 300 NTPv4". 302 Figure 1: Overview of High-Level Interactions in NTS 304 2. Requirements Language 306 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 307 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 308 "OPTIONAL" in this document are to be interpreted as described in 309 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 310 capitals, as shown here. 312 3. TLS profile for Network Time Security 314 Network Time Security makes use of TLS for NTS key establishment. 316 Since the NTS protocol is new as of this publication, no backward- 317 compatibility concerns exist to justify using obsolete, insecure, or 318 otherwise broken TLS features or versions. Implementations MUST 319 conform with [RFC7525] or with a later revision of BCP 195. In 320 particular, failure to use cipher suites that provide forward secrecy 321 will make all negotiated NTS keys recoverable by anyone that gains 322 access to the NTS-KE server's private key. Furthermore: 324 Implementations MUST NOT negotiate TLS versions earlier than 1.2, 325 SHOULD negotiate TLS 1.3 [RFC8446] or later when possible, and MAY 326 refuse to negotiate any TLS version which has been superseded by a 327 later supported version. 329 Use of the Application-Layer Protocol Negotiation Extension [RFC7301] 330 is integral to NTS and support for it is REQUIRED for 331 interoperability. 333 4. The NTS Key Establishment Protocol 335 The NTS key establishment protocol is conducted via TCP port 336 [[TBD1]]. The two endpoints carry out a TLS handshake in conformance 337 with Section 3, with the client offering (via an ALPN [RFC7301] 338 extension), and the server accepting, an application-layer protocol 339 of "ntske/1". Immediately following a successful handshake, the 340 client SHALL send a single request as Application Data encapsulated 341 in the TLS-protected channel. Then, the server SHALL send a single 342 response followed by a TLS "Close notify" alert and then discard the 343 channel state. 345 The client's request and the server's response each SHALL consist of 346 a sequence of records formatted according to Figure 2. Requests and 347 non-error responses each SHALL include exactly one NTS Next Protocol 348 Negotiation record. The sequence SHALL be terminated by a "End of 349 Message" record. The requirement that all NTS-KE messages be 350 terminated by an End of Message record makes them self-delimiting. 352 Clients and servers MAY enforce length limits on requests and 353 responses, however, servers MUST accept requests of at least 1024 354 octets and clients SHOULD accept responses of at least 65536 octets. 356 0 1 2 3 357 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 358 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 359 |C| Record Type | Body Length | 360 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 361 | | 362 . . 363 . Record Body . 364 . . 365 | | 366 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 368 Figure 2: NTS-KE Record Format 370 The fields of an NTS-KE record are defined as follows: 372 C (Critical Bit): Determines the disposition of unrecognized 373 Record Types. Implementations which receive a record with an 374 unrecognized Record Type MUST ignore the record if the Critical 375 Bit is 0 and MUST treat it as an error if the Critical Bit is 1. 377 Record Type Number: A 15-bit integer in network byte order. The 378 semantics of record types 0-7 are specified in this memo. 379 Additional type numbers SHALL be tracked through the IANA Network 380 Time Security Key Establishment Record Types registry. 382 Body Length: The length of the Record Body field, in octets, as a 383 16-bit integer in network byte order. Record bodies MAY have any 384 representable length and need not be aligned to a word boundary. 386 Record Body: The syntax and semantics of this field SHALL be 387 determined by the Record Type. 389 For clarity regarding bit-endianness: the Critical Bit is the most- 390 significant bit of the first octet. In C, given a network buffer 391 `unsigned char b[]` containing an NTS-KE record, the critical bit is 392 `b[0] >> 7` while the record type is `((b[0] & 0x7f) << 8) + b[1]`. 394 Note that, although the Type-Length-Body format of an NTS-KE record 395 is similar to that of an NTP extension field, the semantics of the 396 length field differ. While the length subfield of an NTP extension 397 field gives the length of the entire extension field including the 398 type and length subfields, the length field of an NTS-KE record gives 399 just the length of the body. 401 Figure 3 provides a schematic overview of the key exchange. It 402 displays the protocol steps to be performed by the NTS client and 403 server and record types to be exchanged. 405 +---------------------------------------+ 406 | - Verify client request message. | 407 | - Extract TLS key material. | 408 | - Generate KE response message. | 409 | - Include Record Types: | 410 | o NTS Next Protocol Negotiation | 411 | o AEAD Algorithm Negotiation | 412 | o NTP Server Negotiation | 413 | o New Cookie for NTPv4 | 414 | o | 415 | o End of Message | 416 +-----------------+---------------------+ 417 | 418 | 419 Server -----------+---------------+-----+-----------------------> 420 ^ \ 421 / \ 422 / TLS application \ 423 / data \ 424 / \ 425 / V 426 Client -----+---------------------------------+-----------------> 427 | | 428 | | 429 | | 430 +-----------+----------------------+ +------+-----------------+ 431 |- Generate KE request message. | |- Verify server response| 432 | - Include Record Types: | | message. | 433 | o NTS Next Protocol Negotiation | |- Extract cookie(s). | 434 | o AEAD Algorithm Negotiation | | | 435 | o | | | 436 | o End of Message | | | 437 +----------------------------------+ +------------------------+ 439 Figure 3: NTS Key Exchange Messages 441 4.1. NTS-KE Record Types 443 The following NTS-KE Record Types are defined: 445 4.1.1. End of Message 447 The End of Message record has a Record Type number of 0 and a zero- 448 length body. It MUST occur exactly once as the final record of every 449 NTS-KE request and response. The Critical Bit MUST be set. 451 4.1.2. NTS Next Protocol Negotiation 453 The NTS Next Protocol Negotiation record has a Record Type number of 454 1. It MUST occur exactly once in every NTS-KE request and response. 455 Its body consists of a sequence of 16-bit unsigned integers in 456 network byte order. Each integer represents a Protocol ID from the 457 IANA Network Time Security Next Protocols registry. The Critical Bit 458 MUST be set. 460 The Protocol IDs listed in the client's NTS Next Protocol Negotiation 461 record denote those protocols which the client wishes to speak using 462 the key material established through this NTS-KE session. The 463 Protocol IDs listed in the server's response MUST comprise a subset 464 of those listed in the request and denote those protocols which the 465 server is willing and able to speak using the key material 466 established through this NTS-KE session. The client MAY proceed with 467 one or more of them. The request MUST list at least one protocol, 468 but the response MAY be empty. 470 4.1.3. Error 472 The Error record has a Record Type number of 2. Its body is exactly 473 two octets long, consisting of an unsigned 16-bit integer in network 474 byte order, denoting an error code. The Critical Bit MUST be set. 476 Clients MUST NOT include Error records in their request. If clients 477 receive a server response which includes an Error record, they MUST 478 discard any negotiated key material and MUST NOT proceed to the Next 479 Protocol. 481 The following error codes are defined: 483 Error code 0 means "Unrecognized Critical Record". The server 484 MUST respond with this error code if the request included a record 485 which the server did not understand and which had its Critical Bit 486 set. The client SHOULD NOT retry its request without 487 modification. 489 Error code 1 means "Bad Request". The server MUST respond with 490 this error if, upon the expiration of an implementation-defined 491 timeout, it has not yet received a complete and syntactically 492 well-formed request from the client. 494 Error code 2 means "Internal Server Error". The server MUST 495 respond with this error if it is unable to respond properly due to 496 an internal condition. 498 4.1.4. Warning 500 The Warning record has a Record Type number of 3. Its body is 501 exactly two octets long, consisting of an unsigned 16-bit integer in 502 network byte order, denoting a warning code. The Critical Bit MUST 503 be set. 505 Clients MUST NOT include Warning records in their request. If 506 clients receive a server response which includes a Warning record, 507 they MAY discard any negotiated key material and abort without 508 proceeding to the Next Protocol. Unrecognized warning codes MUST be 509 treated as errors. 511 This memo defines no warning codes. 513 4.1.5. AEAD Algorithm Negotiation 515 The AEAD Algorithm Negotiation record has a Record Type number of 4. 516 Its body consists of a sequence of unsigned 16-bit integers in 517 network byte order, denoting Numeric Identifiers from the IANA AEAD 518 Algorithms registry [IANA-AEAD]. The Critical Bit MAY be set. 520 If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for 521 NTPv4), then this record MUST be included exactly once. Other 522 protocols MAY require it as well. 524 When included in a request, this record denotes which AEAD algorithms 525 the client is willing to use to secure the Next Protocol, in 526 decreasing preference order. When included in a response, this 527 record denotes which algorithm the server chooses to use. It is 528 empty if the server supports none of the algorithms offered. In 529 requests, the list MUST include at least one algorithm. In 530 responses, it MUST include at most one. Honoring the client's 531 preference order is OPTIONAL: servers may select among any of the 532 client's offered choices, even if they are able to support some other 533 algorithm which the client prefers more. 535 Server implementations of NTS extension fields for NTPv4 (Section 5) 536 MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). 537 That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD 538 Algorithm Negotiation record and the server accepts Protocol ID 0 539 (NTPv4) in its NTS Next Protocol Negotiation record, then the 540 server's AEAD Algorithm Negotiation record MUST NOT be empty. 542 4.1.6. New Cookie for NTPv4 544 The New Cookie for NTPv4 record has a Record Type number of 5. The 545 contents of its body SHALL be implementation-defined and clients MUST 546 NOT attempt to interpret them. See Section 6 for a suggested 547 construction. 549 Clients MUST NOT send records of this type. Servers MUST send at 550 least one record of this type, and SHOULD send eight of them, if the 551 Next Protocol Negotiation response record contains Protocol ID 0 552 (NTPv4) and the AEAD Algorithm Negotiation response record is not 553 empty. The Critical Bit SHOULD NOT be set. 555 4.1.7. NTPv4 Server Negotiation 557 The NTPv4 Server Negotiation record has a Record Type number of 6. 558 Its body consists of an ASCII-encoded [ANSI.X3-4.1986] string. The 559 contents of the string SHALL be either an IPv4 address, an IPv6 560 address, or a fully qualified domain name (FQDN). IPv4 addresses 561 MUST be in dotted decimal notation. IPv6 addresses MUST conform to 562 the "Text Representation of Addresses" as specified in RFC 4291 563 [RFC4291] and MUST NOT include zone identifiers [RFC6874]. If a 564 label contains at least one non-ASCII character, an A-LABEL MUST be 565 used as defined in section 2.3.2.1 of RFC 5890 [RFC5890]. 567 When NTPv4 is negotiated as a Next Protocol and this record is sent 568 by the server, the body specifies the hostname or IP address of the 569 NTPv4 server with which the client should associate and which will 570 accept the supplied cookies. If no record of this type is sent, the 571 client SHALL interpret this as a directive to associate with an NTPv4 572 server at the same IP address as the NTS-KE server. Servers MUST NOT 573 send more than one record of this type. 575 When this record is sent by the client, it indicates that the client 576 wishes to associate with the specified NTP server. The NTS-KE server 577 MAY incorporate this request when deciding what NTPv4 Server 578 Negotiation records to respond with, but honoring the client's 579 preference is OPTIONAL. The client MUST NOT send more than one 580 record of this type. 582 Servers MAY set the Critical Bit on records of this type; clients 583 SHOULD NOT. 585 4.1.8. NTPv4 Port Negotiation 587 The NTPv4 Port Negotiation record has a Record Type number of 7. Its 588 body consists of a 16-bit unsigned integer in network byte order, 589 denoting a UDP port number. 591 When NTPv4 is negotiated as a Next Protocol and this record is sent 592 by the server, the body specifies the port number of the NTPv4 server 593 with which the client should associate and which will accept the 594 supplied cookies. If no record of this type is sent, the client 595 SHALL assume a default of 123 (the registered port number for NTP). 597 When this record is sent by the client in conjunction with a NTPv4 598 Server Negotiation record, it indicates that the client wishes to 599 associate with the NTP server at the specified port. The NTS-KE 600 server MAY incorporate this request when deciding what NTPv4 Server 601 Negotiation and NTPv4 Port Negotiation records to respond with, but 602 honoring the client's preference is OPTIONAL. 604 Servers MAY set the Critical Bit on records of this type; clients 605 SHOULD NOT. 607 4.2. Key Extraction (generally) 609 Following a successful run of the NTS-KE protocol, key material SHALL 610 be extracted using the TLS pseudorandom function (PRF) [RFC5705] for 611 TLS version 1.2, or the HMAC-based Extract-and-Expand Key Derivation 612 Function (HKDF) [RFC5869] in accordance with RFC 8446, Section 7.5 613 [RFC8446] for TLS version 1.3. Inputs to the exporter function are 614 to be constructed in a manner specific to the negotiated Next 615 Protocol. However, all protocols which utilize NTS-KE MUST conform 616 to the following two rules: 618 The disambiguating label string MUST be "EXPORTER-network-time- 619 security/1". 621 The per-association context value MUST be provided and MUST begin 622 with the two-octet Protocol ID which was negotiated as a Next 623 Protocol. 625 5. NTS Extension Fields for NTPv4 627 5.1. Key Extraction (for NTPv4) 629 Following a successful run of the NTS-KE protocol wherein Protocol ID 630 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 631 extracted: a client-to-server (C2S) key and a server-to-client (S2C) 632 key. These keys SHALL be computed with the PRF defined in RFC 5705 633 [RFC5705] for TLS version 1.2, or the HKDF defined in RFC 8446, 634 Section 7.5 [RFC8446] for TLS version 1.3, using the following 635 inputs. 637 The disambiguating label string (for PRF) or label (for HKDF) 638 SHALL be "EXPORTER-network-time-security/1". 640 The context value SHALL consist of the following five octets: 642 The first two octets SHALL be zero (the Protocol ID for NTPv4). 644 The next two octets SHALL be the Numeric Identifier of the 645 negotiated AEAD Algorithm in network byte order. 647 The final octet SHALL be 0x00 for the C2S key and 0x01 for the 648 S2C key. 650 Implementations wishing to derive additional keys for private or 651 experimental use MUST NOT do so by extending the above-specified 652 syntax for per-association context values. Instead, they SHOULD use 653 their own disambiguating label string. Note that RFC 5705 [RFC5705] 654 provides that disambiguating label strings beginning with 655 "EXPERIMENTAL" MAY be used without IANA registration. 657 5.2. Packet Structure Overview 659 In general, an NTS-protected NTPv4 packet consists of: 661 The usual 48-octet NTP header which is authenticated but not 662 encrypted. 664 Some extension fields which are authenticated but not encrypted. 666 An extension field which contains AEAD output (i.e., an 667 authentication tag and possible ciphertext). The corresponding 668 plaintext, if non-empty, consists of some extension fields which 669 benefit from both encryption and authentication. 671 Possibly, some additional extension fields which are neither 672 encrypted nor authenticated. In general, these are discarded by 673 the receiver. 675 Always included among the authenticated or authenticated-and- 676 encrypted extension fields are a cookie extension field and a unique 677 identifier extension field. The purpose of the cookie extension 678 field is to enable the server to offload storage of session state 679 onto the client. The purpose of the unique identifier extension 680 field is to protect the client from replay attacks. 682 5.3. The Unique Identifier Extension Field 684 The Unique Identifier extension field provides the client with a 685 cryptographically strong means of detecting replayed packets. It has 686 a Field Type of [[TBD2]]. When the extension field is included in a 687 client packet (mode 3), its body SHALL consist of a string of octets 688 generated uniformly at random. The string MUST be at least 32 octets 689 long. When the extension field is included in a server packet (mode 690 4), its body SHALL contain the same octet string as was provided in 691 the client packet to which the server is responding. All server 692 packets generated by NTS-implementing servers in response to client 693 packets containing this extension field MUST also contain this field 694 with the same content as in the client's request. The field's use in 695 modes other than client-server is not defined. 697 This extension field MAY also be used standalone, without NTS, in 698 which case it provides the client with a means of detecting spoofed 699 packets from off-path attackers. Historically, NTP's origin 700 timestamp field has played both these roles, but for cryptographic 701 purposes this is suboptimal because it is only 64 bits long and, 702 depending on implementation details, most of those bits may be 703 predictable. In contrast, the Unique Identifier extension field 704 enables a degree of unpredictability and collision resistance more 705 consistent with cryptographic best practice. 707 5.4. The NTS Cookie Extension Field 709 The NTS Cookie extension field has a Field Type of [[TBD3]]. Its 710 purpose is to carry information which enables the server to recompute 711 keys and other session state without having to store any per-client 712 state. The contents of its body SHALL be implementation-defined and 713 clients MUST NOT attempt to interpret them. See Section 6 for a 714 suggested construction. The NTS Cookie extension field MUST NOT be 715 included in NTP packets whose mode is other than 3 (client) or 4 716 (server). 718 5.5. The NTS Cookie Placeholder Extension Field 720 The NTS Cookie Placeholder extension field has a Field Type of 721 [[TBD4]]. When this extension field is included in a client packet 722 (mode 3), it communicates to the server that the client wishes it to 723 send additional cookies in its response. This extension field MUST 724 NOT be included in NTP packets whose mode is other than 3. 726 Whenever an NTS Cookie Placeholder extension field is present, it 727 MUST be accompanied by an NTS Cookie extension field. The body 728 length of the NTS Cookie Placeholder extension field MUST be the same 729 as the body length of the NTS Cookie extension field. This length 730 requirement serves to ensure that the response will not be larger 731 than the request, in order to improve timekeeping precision and 732 prevent DDoS amplification. The contents of the NTS Cookie 733 Placeholder extension field's body are undefined and, aside from 734 checking its length, MUST be ignored by the server. 736 5.6. The NTS Authenticator and Encrypted Extension Fields Extension 737 Field 739 The NTS Authenticator and Encrypted Extension Fields extension field 740 is the central cryptographic element of an NTS-protected NTP packet. 741 Its Field Type is [[TBD5]]. It SHALL be formatted according to 742 Figure 4 and include the following fields: 744 Nonce Length: Two octets in network byte order, giving the length 745 of the Nonce field, excluding any padding, interpreted as an 746 unsigned integer. 748 Ciphertext Length: Two octets in network byte order, giving the 749 length of the Ciphertext field, excluding any padding, interpreted 750 as an unsigned integer. 752 Nonce: A nonce as required by the negotiated AEAD Algorithm. The 753 field is zero-padded to a word (four octets) boundary. 755 Ciphertext: The output of the negotiated AEAD Algorithm. The 756 structure of this field is determined by the negotiated algorithm, 757 but it typically contains an authentication tag in addition to the 758 actual ciphertext. The field is zero-padded to a word (four 759 octets) boundary. 761 Additional Padding: Clients which use a nonce length shorter than 762 the maximum allowed by the negotiated AEAD algorithm may be 763 required to include additional zero-padding. The necessary length 764 of this field is specified below. 766 0 1 2 3 767 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 768 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 769 | Nonce Length | Ciphertext Length | 770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 771 | | 772 . . 773 . Nonce, including up to 3 octets padding . 774 . . 775 | | 776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 777 | | 778 . . 779 . Ciphertext, including up to 3 octets padding . 780 . . 781 | | 782 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 783 | | 784 . . 785 . Additional Padding . 786 . . 787 | | 788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 790 Figure 4: NTS Authenticator and Encrypted Extension Fields Extension 791 Field Format 793 The Ciphertext field SHALL be formed by providing the following 794 inputs to the negotiated AEAD Algorithm: 796 K: For packets sent from the client to the server, the C2S key 797 SHALL be used. For packets sent from the server to the client, 798 the S2C key SHALL be used. 800 A: The associated data SHALL consist of the portion of the NTP 801 packet beginning from the start of the NTP header and ending at 802 the end of the last extension field which precedes the NTS 803 Authenticator and Encrypted Extension Fields extension field. 805 P: The plaintext SHALL consist of all (if any) NTP extension 806 fields to be encrypted; if multiple extension fields are present 807 they SHALL be joined by concatenation. Each such field SHALL be 808 formatted in accordance with RFC 7822 [RFC7822], except that, 809 contrary to the RFC 7822 requirement that fields have a minimum 810 length of 16 or 28 octets, encrypted extension fields MAY be 811 arbitrarily short (but still MUST be a multiple of 4 octets in 812 length). 814 N: The nonce SHALL be formed however required by the negotiated 815 AEAD algorithm. 817 The purpose of the Additional Padding field is to ensure that servers 818 can always choose a nonce whose length is adequate to ensure its 819 uniqueness, even if the client chooses a shorter one, and still 820 ensure that the overall length of the server's response packet does 821 not exceed the length of the request. For mode 4 (server) packets, 822 no Additional Padding field is ever required. For mode 3 (client) 823 packets, the length of the Additional Padding field SHALL be computed 824 as follows. Let `N_LEN` be the padded length of the Nonce field. 825 Let `N_MAX` be, as specified by RFC 5116 [RFC5116], the maximum 826 permitted nonce length for the negotiated AEAD algorithm. Let 827 `N_REQ` be the lesser of 16 and N_MAX, rounded up to the nearest 828 multiple of 4. If N_LEN is greater than or equal to N_REQ, then no 829 Additional Padding field is required. Otherwise, the Additional 830 Padding field SHALL be at least N_REQ - N_LEN octets in length. 831 Servers MUST enforce this requirement by discarding any packet which 832 does not conform to it. 834 Senders are always free to include more Additional Padding than 835 mandated by the above paragraph. Theoretically, it could be 836 necessary to do so in order to bring the extension field to the 837 minimum length required by [RFC7822]. This should never happen in 838 practice because any reasonable AEAD algorithm will have a nonce and 839 an authenticator long enough to bring the extension field to its 840 required length already. Nonetheless, implementers are advised to 841 explicitly handle this case and ensure that the extension field they 842 emit is of legal length. 844 The NTS Authenticator and Encrypted Extension Fields extension field 845 MUST NOT be included in NTP packets whose mode is other than 3 846 (client) or 4 (server). 848 5.7. Protocol Details 850 A client sending an NTS-protected request SHALL include the following 851 extension fields as displayed in Figure 5: 853 Exactly one Unique Identifier extension field which MUST be 854 authenticated, MUST NOT be encrypted, and whose contents MUST NOT 855 duplicate those of any previous request. 857 Exactly one NTS Cookie extension field which MUST be authenticated 858 and MUST NOT be encrypted. The cookie MUST be one which has been 859 previously provided to the client; either from the key exchange 860 server during the NTS-KE handshake or from the NTP server in 861 response to a previous NTS-protected NTP request. 863 Exactly one NTS Authenticator and Encrypted Extension Fields 864 extension field, generated using an AEAD Algorithm and C2S key 865 established through NTS-KE. 867 To protect the client's privacy, the client SHOULD avoid reusing a 868 cookie. If the client does not have any cookies that it has not 869 already sent, it SHOULD initiate a re-run the NTS-KE protocol. The 870 client MAY reuse cookies in order to prioritize resilience over 871 unlinkability. Which of the two that should be prioritized in any 872 particular case is dependent on the application and the user's 873 preference. Section 10.1 describes the privacy considerations of 874 this in further detail. 876 The client MAY include one or more NTS Cookie Placeholder extension 877 fields which MUST be authenticated and MAY be encrypted. The number 878 of NTS Cookie Placeholder extension fields that the client includes 879 SHOULD be such that if the client includes N placeholders and the 880 server sends back N+1 cookies, the number of unused cookies stored by 881 the client will come to eight. The client SHOULD NOT include more 882 than seven NTS Cookie Placeholder extension fields in a request. 883 When both the client and server adhere to all cookie-management 884 guidance provided in this memo, the number of placeholder extension 885 fields will equal the number of dropped packets since the last 886 successful volley. 888 In rare circumstances, it may be necessary to include fewer NTS 889 Cookie Placeholder extensions than recommended above in order to 890 prevent datagram fragmentation. When cookies adhere the format 891 recommended in Section 6 and the AEAD in use is the mandatory-to- 892 implement AEAD_AES_SIV_CMAC_256, senders can include a cookie and 893 seven placeholders and still have packet size fall comfortably below 894 1280 octets if no non-NTS-related extensions are used; 1280 octets is 895 the minimum prescribed MTU for IPv6 and is in practice also safe for 896 avoiding IPv4 fragmentation. Nonetheless, senders SHOULD include 897 fewer cookies and placeholders than otherwise indicated if doing so 898 is necessary to prevent fragmentation. 900 +---------------------------------------+ 901 | - Verify time request message | 902 | - Generate time response message | 903 | - Included NTPv4 extension fields | 904 | o Unique Identifier EF | 905 | o NTS Authentication and | 906 | Encrypted Extension Fields EF | 907 | - NTS Cookie EF | 908 | - | 909 | - Transmit time request packet | 910 +-----------------+---------------------+ 911 | 912 | 913 Server -----------+---------------+-----+-----------------------> 914 ^ \ 915 / \ 916 Time request / \ Time response 917 (mode 3) / \ (mode 4) 918 / \ 919 / V 920 Client -----+---------------------------------+-----------------> 921 | | 922 | | 923 | | 924 +-----------+----------------------+ +------+-----------------+ 925 |- Generate time request message | |- Verify time response | 926 | - Include NTPv4 Extension fields | | message | 927 | o Unique Identifier EF | |- Extract cookie(s) | 928 | o NTS Cookie EF | |- Time synchronization | 929 | o | | processing | 930 | | +------------------------+ 931 |- Generate AEAD tag of NTP message| 932 |- Add NTS Authentication and | 933 | Encrypted Extension Fields EF | 934 |- Transmit time request packet | 935 +----------------------------------+ 937 Figure 5: NTS Time Synchronization Messages 939 The client MAY include additional (non-NTS-related) extension fields 940 which MAY appear prior to the NTS Authenticator and Encrypted 941 Extension Fields extension fields (therefore authenticated but not 942 encrypted), within it (therefore encrypted and authenticated), or 943 after it (therefore neither encrypted nor authenticated). In 944 general, however, the server MUST discard any unauthenticated 945 extension fields and process the packet as though they were not 946 present. Servers MAY implement exceptions to this requirement for 947 particular extension fields if their specification explicitly 948 provides for such. 950 Upon receiving an NTS-protected request, the server SHALL (through 951 some implementation-defined mechanism) use the cookie to recover the 952 AEAD Algorithm, C2S key, and S2C key associated with the request, and 953 then use the C2S key to authenticate the packet and decrypt the 954 ciphertext. If the cookie is valid and authentication and decryption 955 succeed, the server SHALL include the following extension fields in 956 its response: 958 Exactly one Unique Identifier extension field which MUST be 959 authenticated, MUST NOT be encrypted, and whose contents SHALL 960 echo those provided by the client. 962 Exactly one NTS Authenticator and Encrypted Extension Fields 963 extension field, generated using the AEAD algorithm and S2C key 964 recovered from the cookie provided by the client. 966 One or more NTS Cookie extension fields which MUST be 967 authenticated and encrypted. The number of NTS Cookie extension 968 fields included SHOULD be equal to, and MUST NOT exceed, one plus 969 the number of valid NTS Cookie Placeholder extension fields 970 included in the request. The cookies returned in those fields 971 MUST be valid for use with the NTP server that sent them. They 972 MAY be valid for other NTP servers as well, but there is no way 973 for the server to indicate this. 975 We emphasize the contrast that NTS Cookie extension fields MUST NOT 976 be encrypted when sent from client to server, but MUST be encrypted 977 when sent from server to client. The former is necessary in order 978 for the server to be able to recover the C2S and S2C keys, while the 979 latter is necessary to satisfy the unlinkability goals discussed in 980 Section 10.1. We emphasize also that "encrypted" means encapsulated 981 within the NTS Authenticator and Encrypted Extensions extension 982 field. While the body of an NTS Cookie extension field will 983 generally consist of some sort of AEAD output (regardless of whether 984 the recommendations of Section 6 are precisely followed), this is not 985 sufficient to make the extension field "encrypted". 987 The server MAY include additional (non-NTS-related) extension fields 988 which MAY appear prior to the NTS Authenticator and Encrypted 989 Extension Fields extension field (therefore authenticated but not 990 encrypted), within it (therefore encrypted and authenticated), or 991 after it (therefore neither encrypted nor authenticated). In 992 general, however, the client MUST discard any unauthenticated 993 extension fields and process the packet as though they were not 994 present. Clients MAY implement exceptions to this requirement for 995 particular extension fields if their specification explicitly 996 provides for such. 998 Upon receiving an NTS-protected response, the client MUST verify that 999 the Unique Identifier matches that of an outstanding request, and 1000 that the packet is authentic under the S2C key associated with that 1001 request. If either of these checks fails, the packet MUST be 1002 discarded without further processing. 1004 If the server is unable to validate the cookie or authenticate the 1005 request, it SHOULD respond with a Kiss-o'-Death (KoD) packet (see RFC 1006 5905, Section 7.4 [RFC5905]) with kiss code "NTSN", meaning "NTS 1007 negative-acknowledgment (NAK)". It MUST NOT include any NTS Cookie 1008 or NTS Authenticator and Encrypted Extension Fields extension fields. 1010 If the NTP server has previously responded with authentic NTS- 1011 protected NTP packets (i.e., packets containing the NTS Authenticator 1012 and Encrypted Extension Fields extension field), the client MUST 1013 verify that any KoD packets received from the server contain the 1014 Unique Identifier extension field and that the Unique Identifier 1015 matches that of an outstanding request. If this check fails, the 1016 packet MUST be discarded without further processing. If this check 1017 passes, the client MUST comply with RFC 5905, Section 7.4 [RFC5905] 1018 where required. A client MAY automatically re-run the NTS-KE 1019 protocol upon forced disassociation from an NTP server. In that 1020 case, it MUST be able to detect and stop looping between the NTS-KE 1021 and NTP servers by rate limiting the retries using e.g. exponential 1022 retry intervals. 1024 Upon reception of the NTS NAK kiss code, the client SHOULD wait until 1025 the next poll for a valid NTS-protected response and if none is 1026 received, initiate a fresh NTS-KE handshake to try to renegotiate new 1027 cookies, AEAD keys, and parameters. If the NTS-KE handshake 1028 succeeds, the client MUST discard all old cookies and parameters and 1029 use the new ones instead. As long as the NTS-KE handshake has not 1030 succeeded, the client SHOULD continue polling the NTP server using 1031 the cookies and parameters it has. 1033 To allow for NTP session restart when the NTS-KE server is 1034 unavailable and to reduce NTS-KE server load, the client SHOULD keep 1035 at least one unused but recent cookie, AEAD keys, negotiated AEAD 1036 algorithm, and other necessary parameters on persistent storage. 1037 This way, the client is able to resume the NTP session without 1038 performing renewed NTS-KE negotiation. 1040 6. Suggested Format for NTS Cookies 1042 This section is non-normative. It gives a suggested way for servers 1043 to construct NTS cookies. All normative requirements are stated in 1044 Section 4.1.6 and Section 5.4. 1046 The role of cookies in NTS is closely analogous to that of session 1047 cookies in TLS. Accordingly, the thematic resemblance of this 1048 section to RFC 5077 [RFC5077] is deliberate and the reader should 1049 likewise take heed of its security considerations. 1051 Servers should select an AEAD algorithm which they will use to 1052 encrypt and authenticate cookies. The chosen algorithm should be one 1053 such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental 1054 nonce reuse. It need not be the same as the one that was negotiated 1055 with the client. Servers should randomly generate and store a master 1056 AEAD key `K`. Servers should additionally choose a non-secret, unique 1057 value `I` as key-identifier for `K`. 1059 Servers should periodically (e.g., once daily) generate a new pair 1060 (I,K) and immediately switch to using these values for all newly- 1061 generated cookies. Immediately following each such key rotation, 1062 servers should securely erase any keys generated two or more rotation 1063 periods prior. Servers should continue to accept any cookie 1064 generated using keys that they have not yet erased, even if those 1065 keys are no longer current. Erasing old keys provides for forward 1066 secrecy, limiting the scope of what old information can be stolen if 1067 a master key is somehow compromised. Holding on to a limited number 1068 of old keys allows clients to seamlessly transition from one 1069 generation to the next without having to perform a new NTS-KE 1070 handshake. 1072 The need to keep keys synchronized between NTS-KE and NTP servers as 1073 well as across load-balanced clusters can make automatic key rotation 1074 challenging. However, the task can be accomplished without the need 1075 for central key-management infrastructure by using a ratchet, i.e., 1076 making each new key a deterministic, cryptographically pseudo-random 1077 function of its predecessor. A recommended concrete implementation 1078 of this approach is to use HKDF [RFC5869] to derive new keys, using 1079 the key's predecessor as Input Keying Material and its key identifier 1080 as a salt. 1082 To form a cookie, servers should first form a plaintext `P` 1083 consisting of the following fields: 1085 The AEAD algorithm negotiated during NTS-KE. 1087 The S2C key. 1089 The C2S key. 1091 Servers should then generate a nonce `N` uniformly at random, and 1092 form AEAD output `C` by encrypting `P` under key `K` with nonce `N` 1093 and no associated data. 1095 The cookie should consist of the tuple `(I,N,C)`. 1097 To verify and decrypt a cookie provided by the client, first parse it 1098 into its components `I`, `N`, and `C`. Use `I` to look up its 1099 decryption key `K`. If the key whose identifier is `I` has been 1100 erased or never existed, decryption fails; reply with an NTS NAK. 1101 Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` 1102 and nonce `N` with no associated data. If decryption or verification 1103 fails, reply with an NTS NAK. Otherwise, parse out the contents of 1104 the resulting plaintext `P` to obtain the negotiated AEAD algorithm, 1105 S2C key, and C2S key. 1107 7. IANA Considerations 1109 7.1. Service Name and Transport Protocol Port Number Registry 1111 IANA is requested to allocate the following entry in the Service Name 1112 and Transport Protocol Port Number Registry [RFC6335]: 1114 Service Name: ntske 1116 Transport Protocol: tcp 1118 Assignee: IESG 1120 Contact: IETF Chair 1122 Description: Network Time Security Key Exchange 1124 Reference: [[this memo]] 1126 Port Number: [[TBD1]], selected by IANA from the User Port range 1128 [[RFC EDITOR: Replace all instances of [[TBD1]] in this document with 1129 the IANA port assignment.]] 1131 7.2. TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs 1132 Registry 1134 IANA is requested to allocate the following entry in the TLS 1135 Application-Layer Protocol Negotiation (ALPN) Protocol IDs registry 1136 [RFC7301]: 1138 Protocol: Network Time Security Key Establishment, version 1 1140 Identification Sequence: 1141 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 1143 Reference: [[this memo]], Section 4 1145 7.3. TLS Exporter Labels Registry 1147 IANA is requested to allocate the following entry in the TLS Exporter 1148 Labels Registry [RFC5705]: 1150 +--------------------+---------+-------------+---------------+------+ 1151 | Value | DTLS-OK | Recommended | Reference | Note | 1152 +--------------------+---------+-------------+---------------+------+ 1153 | EXPORTER-network- | Y | Y | [[this | | 1154 | time-security/1 | | | memo]], | | 1155 | | | | Section 4.2 | | 1156 +--------------------+---------+-------------+---------------+------+ 1158 7.4. NTP Kiss-o'-Death Codes Registry 1160 IANA is requested to allocate the following entry in the registry of 1161 NTP Kiss-o'-Death Codes [RFC5905]: 1163 +------+---------------------------------------+--------------------+ 1164 | Code | Meaning | Reference | 1165 +------+---------------------------------------+--------------------+ 1166 | NTSN | Network Time Security (NTS) negative- | [[this memo]], | 1167 | | acknowledgment (NAK) | Section 5.7 | 1168 +------+---------------------------------------+--------------------+ 1170 7.5. NTP Extension Field Types Registry 1172 IANA is requested to allocate the following entries in the NTP 1173 Extension Field Types registry [RFC5905]: 1175 +----------+-----------------------------+--------------------------+ 1176 | Field | Meaning | Reference | 1177 | Type | | | 1178 +----------+-----------------------------+--------------------------+ 1179 | [[TBD2]] | Unique Identifier | [[this memo]], | 1180 | | | Section 5.3 | 1181 | [[TBD3]] | NTS Cookie | [[this memo]], | 1182 | | | Section 5.4 | 1183 | [[TBD4]] | NTS Cookie Placeholder | [[this memo]], | 1184 | | | Section 5.5 | 1185 | [[TBD5]] | NTS Authenticator and | [[this memo]], | 1186 | | Encrypted Extension Fields | Section 5.6 | 1187 +----------+-----------------------------+--------------------------+ 1189 [[RFC EDITOR: REMOVE BEFORE PUBLICATION - The NTP WG suggests that 1190 the following values be used: 1192 Unique Identifier 0x0104 1193 NTS Cookie 0x0204 1194 Cookie Placeholder 0x0304 1195 NTS Authenticator 0x0404]] 1197 [[RFC EDITOR: Replace all instances of [[TBD2]], [[TBD3]], [[TBD4]], 1198 and [[TBD5]] in this document with the respective IANA assignments.]] 1200 7.6. Network Time Security Key Establishment Record Types Registry 1202 IANA is requested to create a new registry entitled "Network Time 1203 Security Key Establishment Record Types". Entries SHALL have the 1204 following fields: 1206 Record Type Number (REQUIRED): An integer in the range 0-32767 1207 inclusive. 1209 Description (REQUIRED): A short text description of the purpose of 1210 the field. 1212 Reference (REQUIRED): A reference to a document specifying the 1213 semantics of the record. 1215 The policy for allocation of new entries in this registry SHALL vary 1216 by the Record Type Number, as follows: 1218 0-1023: IETF Review 1220 1024-16383: Specification Required 1222 16384-32767: Private and Experimental Use 1224 Applications for new entries SHALL specify the contents of the 1225 Description, Set Critical Bit, and Reference fields as well as which 1226 of the above ranges the Record Type Number should be allocated from. 1227 Applicants MAY request a specific Record Type Number and such 1228 requests MAY be granted at the registrar's discretion. 1230 The initial contents of this registry SHALL be as follows: 1232 +-------------+-------------------------+---------------------------+ 1233 | Record Type | Description | Reference | 1234 | Number | | | 1235 +-------------+-------------------------+---------------------------+ 1236 | 0 | End of Message | [[this memo]], | 1237 | | | Section 4.1.1 | 1238 | 1 | NTS Next Protocol | [[this memo]], | 1239 | | Negotiation | Section 4.1.2 | 1240 | 2 | Error | [[this memo]], | 1241 | | | Section 4.1.3 | 1242 | 3 | Warning | [[this memo]], | 1243 | | | Section 4.1.4 | 1244 | 4 | AEAD Algorithm | [[this memo]], | 1245 | | Negotiation | Section 4.1.5 | 1246 | 5 | New Cookie for NTPv4 | [[this memo]], | 1247 | | | Section 4.1.6 | 1248 | 6 | NTPv4 Server | [[this memo]], | 1249 | | Negotiation | Section 4.1.7 | 1250 | 7 | NTPv4 Port Negotiation | [[this memo]], | 1251 | | | Section 4.1.8 | 1252 | 16384-32767 | Reserved for Private & | [[this memo]] | 1253 | | Experimental Use | | 1254 +-------------+-------------------------+---------------------------+ 1256 7.7. Network Time Security Next Protocols Registry 1258 IANA is requested to create a new registry entitled "Network Time 1259 Security Next Protocols". Entries SHALL have the following fields: 1261 Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive, 1262 functioning as an identifier. 1264 Protocol Name (REQUIRED): A short text string naming the protocol 1265 being identified. 1267 Reference (REQUIRED): A reference to a relevant specification 1268 document. 1270 The policy for allocation of new entries in these registries SHALL 1271 vary by their Protocol ID, as follows: 1273 0-1023: IETF Review 1275 1024-32767: Specification Required 1277 32768-65535: Private and Experimental Use 1279 The initial contents of this registry SHALL be as follows: 1281 +-------------+-------------------------------+---------------------+ 1282 | Protocol ID | Protocol Name | Reference | 1283 +-------------+-------------------------------+---------------------+ 1284 | 0 | Network Time Protocol version | [[this memo]] | 1285 | | 4 (NTPv4) | | 1286 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1287 | | Experimental Use | memo]] | 1288 +-------------+-------------------------------+---------------------+ 1290 7.8. Network Time Security Error and Warning Codes Registries 1292 IANA is requested to create two new registries entitled "Network Time 1293 Security Error Codes" and "Network Time Security Warning Codes". 1294 Entries in each SHALL have the following fields: 1296 Number (REQUIRED): An integer in the range 0-65535 inclusive 1298 Description (REQUIRED): A short text description of the condition. 1300 Reference (REQUIRED): A reference to a relevant specification 1301 document. 1303 The policy for allocation of new entries in these registries SHALL 1304 vary by their Number, as follows: 1306 0-1023: IETF Review 1308 1024-32767: Specification Required 1310 32768-65535: Private and Experimental Use 1312 The initial contents of the Network Time Security Error Codes 1313 Registry SHALL be as follows: 1315 +-------------+------------------------------+----------------------+ 1316 | Number | Description | Reference | 1317 +-------------+------------------------------+----------------------+ 1318 | 0 | Unrecognized Critical | [[this memo]], | 1319 | | Extension | Section 4.1.3 | 1320 | 1 | Bad Request | [[this memo]], | 1321 | | | Section 4.1.3 | 1322 | 2 | Internal Server Error | [[this memo]], | 1323 | | | Section 4.1.3 | 1324 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1325 | | Experimental Use | memo]] | 1326 +-------------+------------------------------+----------------------+ 1328 The Network Time Security Warning Codes Registry SHALL initially be 1329 empty except for the reserved range, i.e.: 1331 +-------------+-------------------------------+---------------------+ 1332 | Number | Description | Reference | 1333 +-------------+-------------------------------+---------------------+ 1334 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1335 | | Experimental Use | memo]] | 1336 +-------------+-------------------------------+---------------------+ 1338 8. Implementation Status - RFC EDITOR: REMOVE BEFORE PUBLICATION 1340 This section records the status of known implementations of the 1341 protocol defined by this specification at the time of posting of this 1342 Internet-Draft, and is based on a proposal described in RFC 7942. 1343 The description of implementations in this section is intended to 1344 assist the IETF in its decision processes in progressing drafts to 1345 RFCs. Please note that the listing of any individual implementation 1346 here does not imply endorsement by the IETF. Furthermore, no effort 1347 has been spent to verify the information presented here that was 1348 supplied by IETF contributors. This is not intended as, and must not 1349 be construed to be, a catalog of available implementations or their 1350 features. Readers are advised to note that other implementations may 1351 exist. 1353 According to RFC 7942, "this will allow reviewers and working groups 1354 to assign due consideration to documents that have the benefit of 1355 running code, which may serve as evidence of valuable experimentation 1356 and feedback that have made the implemented protocols more mature. 1357 It is up to the individual working groups to use this information as 1358 they see fit". 1360 8.1. Implementation 1 1362 Organization: Ostfalia University of Applied Science 1364 Implementor: Martin Langer 1366 Maturity: Proof-of-Concept Prototype 1368 This implementation was used to verify consistency and to ensure 1369 completeness of this specification. 1371 8.1.1. Coverage 1373 This implementation covers the complete specification. 1375 8.1.2. Licensing 1377 The code is released under a Apache License 2.0 license. 1379 The source code is available at: https://gitlab.com/MLanger/nts/ 1381 8.1.3. Contact Information 1383 Contact Martin Langer: mart.langer@ostfalia.de 1385 8.1.4. Last Update 1387 The implementation was updated 25. February 2019. 1389 8.2. Implementation 2 1391 Organization: Netnod 1393 Implementor: Christer Weinigel 1395 Maturity: Proof-of-Concept Prototype 1397 This implementation was used to verify consistency and to ensure 1398 completeness of this specification. 1400 8.2.1. Coverage 1402 This implementation covers the complete specification. 1404 8.2.2. Licensing 1406 The source code is available at: https://github.com/Netnod/nts-poc- 1407 python. 1409 See LICENSE file for details on licensing (BSD 2). 1411 8.2.3. Contact Information 1413 Contact Christer Weinigel: christer@weinigel.se 1415 8.2.4. Last Update 1417 The implementation was updated 31. January 2019. 1419 8.3. Implementation 3 1421 Organization: Red Hat 1423 Implementor: Miroslav Lichvar 1425 Maturity: Prototype 1427 This implementation was used to verify consistency and to ensure 1428 completeness of this specification. 1430 8.3.1. Coverage 1432 This implementation covers the complete specification. 1434 8.3.2. Licensing 1436 Licensing is GPLv2. 1438 The source code is available at: https://github.com/mlichvar/chrony- 1439 nts 1441 8.3.3. Contact Information 1443 Contact Miroslav Lichvar: mlichvar@redhat.com 1445 8.3.4. Last Update 1447 The implementation was updated 28. March 2019. 1449 8.4. Implementation 4 1451 Organization: NTPsec 1453 Implementor: Hal Murray and NTPsec team 1455 Maturity:Looking for testers. Servers running at 1456 ntp1.glypnod.com:123 and ntp2.glypnod.com:123 1458 This implementation was used to verify consistency and to ensure 1459 completeness of this specification. 1461 8.4.1. Coverage 1463 This implementation covers the complete specification. 1465 8.4.2. Licensing 1467 The source code is available at: https://gitlab.com/NTPsec/ntpsec. 1468 Licensing details in LICENSE. 1470 8.4.3. Contact Information 1472 Contact Hal Murray: hmurray@megapathdsl.net, devel@ntpsec.org 1474 8.4.4. Last Update 1476 The implementation was updated 2019-Apr-10. 1478 8.5. Implementation 5 1480 Organization: Cloudflare 1482 Implementor: Watson Ladd 1484 Maturity: 1486 This implementation was used to verify consistency and to ensure 1487 completeness of this specification. 1489 8.5.1. Coverage 1491 This implementation covers the server side of the NTS specification. 1493 8.5.2. Licensing 1495 The source code is available at: https://github.com/wbl/nts-rust 1497 Licensing is ISC (details see LICENSE.txt file). 1499 8.5.3. Contact Information 1501 Contact Watson Ladd: watson@cloudflare.com 1503 8.5.4. Last Update 1505 The implementation was updated 21. March 2019. 1507 8.6. Implementation 6 1509 Organization: Hacklunch, independent 1511 Implementor: Michael Cardell Widerkrantz, Daniel Lublin, Martin 1512 Samuelsson et. al. 1514 Maturity: interoperable client, immature server 1516 8.6.1. Coverage 1518 NTS-KE client and server. 1520 8.6.2. Licensing 1522 Licensing is ISC (details in LICENSE file). 1524 Source code is available at: https://gitlab.com/hacklunch/ntsclient 1526 8.6.3. Contact Information 1528 Contact Michael Cardell Widerkrantz: mc@netnod.se 1530 8.6.4. Last Update 1532 The implementation was updated 6. February 2020. 1534 8.7. Interoperability 1536 The Interoperability tests distinguished between NTS key 1537 establishment protocol and NTS time exchange messages. For the 1538 implementations 1, 2, 3, and 4 pairwise interoperability of the NTS 1539 key establishment protocol and exchange of NTS protected NTP messages 1540 have been verified successfully. The implementation 2 was able to 1541 successfully perform the key establishment protocol against the 1542 server side of the implementation 5. 1544 These tests successfully demonstrate that there are at least four 1545 running implementations of this draft which are able to interoperate. 1547 9. Security Considerations 1549 9.1. Protected Modes 1551 NTP provides many different operating modes in order to support 1552 different network topologies and to adapt to various requirements. 1553 This memo only specifies NTS for NTP modes 3 (client) and 4 (server) 1554 (see Section 1.2). The best current practice for authenticating the 1555 other NTP modes is using the symmetric message authentication code 1556 feature as described in RFC 5905 [RFC5905] and RFC 8573 [RFC8573]. 1558 9.2. Sensitivity to DDoS Attacks 1560 The introduction of NTS brings with it the introduction of asymmetric 1561 cryptography to NTP. Asymmetric cryptography is necessary for 1562 initial server authentication and AEAD key extraction. Asymmetric 1563 cryptosystems are generally orders of magnitude slower than their 1564 symmetric counterparts. This makes it much harder to build systems 1565 that can serve requests at a rate corresponding to the full line 1566 speed of the network connection. This, in turn, opens up a new 1567 possibility for DDoS attacks on NTP services. 1569 The main protection against these attacks in NTS lies in that the use 1570 of asymmetric cryptosystems is only necessary in the initial NTS-KE 1571 phase of the protocol. Since the protocol design enables separation 1572 of the NTS-KE and NTP servers, a successful DDoS attack on an NTS-KE 1573 server separated from the NTP service it supports will not affect NTP 1574 users that have already performed initial authentication, AEAD key 1575 extraction, and cookie exchange. 1577 NTS users should also consider that they are not fully protected 1578 against DDoS attacks by on-path adversaries. In addition to dropping 1579 packets and attacks such as those described in Section 9.5, an on- 1580 path attacker can send spoofed kiss-o'-death replies, which are not 1581 authenticated, in response to NTP requests. This could result in 1582 significantly increased load on the NTS-KE server. Implementers have 1583 to weigh the user's need for unlinkability against the added 1584 resilience that comes with cookie reuse in cases of NTS-KE server 1585 unavailability. 1587 9.3. Avoiding DDoS Amplification 1589 Certain non-standard and/or deprecated features of the Network Time 1590 Protocol enable clients to send a request to a server which causes 1591 the server to send a response much larger than the request. Servers 1592 which enable these features can be abused in order to amplify traffic 1593 volume in DDoS attacks by sending them a request with a spoofed 1594 source IP. In recent years, attacks of this nature have become an 1595 endemic nuisance. 1597 NTS is designed to avoid contributing any further to this problem by 1598 ensuring that NTS-related extension fields included in server 1599 responses will be the same size as the NTS-related extension fields 1600 sent by the client. In particular, this is why the client is 1601 required to send a separate and appropriately padded-out NTS Cookie 1602 Placeholder extension field for every cookie it wants to get back, 1603 rather than being permitted simply to specify a desired quantity. 1605 Due to the RFC 7822 [RFC7822] requirement that extensions be padded 1606 and aligned to four-octet boundaries, response size may still in some 1607 cases exceed request size by up to three octets. This is 1608 sufficiently inconsequential that we have declined to address it. 1610 9.4. Initial Verification of Server Certificates 1612 NTS's security goals are undermined if the client fails to verify 1613 that the X.509 certificate chain presented by the NTS-KE server is 1614 valid and rooted in a trusted certificate authority. RFC 5280 1615 [RFC5280] and RFC 6125 [RFC6125] specify how such verification is to 1616 be performed in general. However, the expectation that the client 1617 does not yet have a correctly-set system clock at the time of 1618 certificate verification presents difficulties with verifying that 1619 the certificate is within its validity period, i.e., that the current 1620 time lies between the times specified in the certificate's notBefore 1621 and notAfter fields. It may be operationally necessary in some cases 1622 for a client to accept a certificate which appears to be expired or 1623 not yet valid. While there is no perfect solution to this problem, 1624 there are several mitigations the client can implement to make it 1625 more difficult for an adversary to successfully present an expired 1626 certificate: 1628 Check whether the system time is in fact unreliable. If the 1629 system clock has previously been synchronized since last boot, 1630 then on operating systems which implement a kernel-based phase- 1631 locked-loop API, a call to ntp_gettime() should show a maximum 1632 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be 1633 considered reliable and certificates can be strictly validated. 1635 Allow the system administrator to specify that certificates should 1636 *always* be strictly validated. Such a configuration is 1637 appropriate on systems which have a battery-backed clock and which 1638 can reasonably prompt the user to manually set an approximately- 1639 correct time if it appears to be needed. 1641 Once the clock has been synchronized, periodically write the 1642 current system time to persistent storage. Do not accept any 1643 certificate whose notAfter field is earlier than the last recorded 1644 time. 1646 NTP time replies are expected to be consistent with the NTS-KE TLS 1647 certificate validity period, i.e. time replies received 1648 immediately after an NTS-KE handshake are expected to lie within 1649 the certificate validity period. Implementations are recommended 1650 to check that this is the case. Performing a new NTS-KE handshake 1651 based solely on the fact that the certificate used by the NTS-KE 1652 server in a previous handshake has expired is normally not 1653 necessary. Clients that still wish to do this must take care not 1654 to cause an inadvertent denial-of-service attack on the NTS-KE 1655 server, for example by picking a random time in the week preceding 1656 certificate expiry to perform the new handshake. 1658 Use multiple time sources. The ability to pass off an expired 1659 certificate is only useful to an adversary who has compromised the 1660 corresponding private key. If the adversary has compromised only 1661 a minority of servers, NTP's selection algorithm (RFC 5905 section 1662 11.2.1 [RFC5905]) will protect the client from accepting bad time 1663 from the adversary-controlled servers. 1665 9.5. Delay Attacks 1667 In a packet delay attack, an adversary with the ability to act as a 1668 man-in-the-middle delays time synchronization packets between client 1669 and server asymmetrically [RFC7384]. Since NTP's formula for 1670 computing time offset relies on the assumption that network latency 1671 is roughly symmetrical, this leads to the client to compute an 1672 inaccurate value [Mizrahi]. The delay attack does not reorder or 1673 modify the content of the exchanged synchronization packets. 1674 Therefore, cryptographic means do not provide a feasible way to 1675 mitigate this attack. However, the maximum error that an adversary 1676 can introduce is bounded by half of the round trip delay. 1678 RFC 5905 [RFC5905] specifies a parameter called MAXDIST which denotes 1679 the maximum round-trip latency (including not only the immediate 1680 round trip between client and server, but the whole distance back to 1681 the reference clock as reported in the Root Delay field) that a 1682 client will tolerate before concluding that the server is unsuitable 1683 for synchronization. The standard value for MAXDIST is one second, 1684 although some implementations use larger values. Whatever value a 1685 client chooses, the maximum error which can be introduced by a delay 1686 attack is MAXDIST/2. 1688 Usage of multiple time sources, or multiple network paths to a given 1689 time source [Shpiner], may also serve to mitigate delay attacks if 1690 the adversary is in control of only some of the paths. 1692 9.6. Random Number Generation 1694 At various points in NTS, the generation of cryptographically secure 1695 random numbers is required. Whenever this draft specifies the use of 1696 random numbers, cryptographically secure random number generation 1697 MUST be used. RFC 4086 [RFC4086] contains guidelines concerning this 1698 topic. 1700 9.7. NTS Stripping 1702 Implementers must be aware of the possibility of "NTS stripping" 1703 attacks, where an attacker tricks clients into reverting to plain 1704 NTP. Naive client implementations might, for example, revert 1705 automatically to plain NTP if the NTS-KE handshake fails. A man-in- 1706 the-middle attacker can easily cause this to happen. Even clients 1707 that already hold valid cookies can be vulnerable, since an attacker 1708 can force a client to repeat the NTS-KE handshake by sending faked 1709 NTP mode 4 replies with the NTS NAK kiss code. Forcing a client to 1710 repeat the NTS-KE handshake can also be the first step in more 1711 advanced attacks. 1713 For the reasons described here, implementations SHOULD NOT revert 1714 from NTS-protected to unprotected NTP with any server without 1715 explicit user action. 1717 10. Privacy Considerations 1719 10.1. Unlinkability 1721 Unlinkability prevents a device from being tracked when it changes 1722 network addresses (e.g. because said device moved between different 1723 networks). In other words, unlinkability thwarts an attacker that 1724 seeks to link a new network address used by a device with a network 1725 address that it was formerly using, because of recognizable data that 1726 the device persistently sends as part of an NTS-secured NTP 1727 association. This is the justification for continually supplying the 1728 client with fresh cookies, so that a cookie never represents 1729 recognizable data in the sense outlined above. 1731 NTS's unlinkability objective is merely to not leak any additional 1732 data that could be used to link a device's network address. NTS does 1733 not rectify legacy linkability issues that are already present in 1734 NTP. Thus, a client that requires unlinkability must also minimize 1735 information transmitted in a client query (mode 3) packet as 1736 described in the draft [I-D.ietf-ntp-data-minimization]. 1738 The unlinkability objective only holds for time synchronization 1739 traffic, as opposed to key exchange traffic. This implies that it 1740 cannot be guaranteed for devices that function not only as time 1741 clients, but also as time servers (because the latter can be 1742 externally triggered to send authentication data). 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, Martin Langer, Miroslav Lichvar, Aanchal Malhotra, Dave 1775 Mills, Danny Mayer, Karen O'Donoghue, Eric K. Rescorla, Stephen 1776 Roettger, Kurt Roeckx, Kyle Rose, Rich Salz, Brian Sniffen, Susan 1777 Sons, Douglas Stebila, Harlan Stenn, Joachim Stroembergsson 1778 (Strombergsson), Martin Thomson, Richard Welty, and Christer Weinigel 1779 for contributions to this document and comments on the design of NTS. 1781 12. References 1783 12.1. Normative References 1785 [ANSI.X3-4.1986] 1786 American National Standards Institute, "Coded Character 1787 Set - 7-bit American Standard Code for Information 1788 Interchange", ANSI X3.4, 1986. 1790 [IANA-AEAD] 1791 IANA, "Authenticated Encryption with Associated Data 1792 (AEAD) Parameters", 1793 . 1795 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1796 Requirement Levels", BCP 14, RFC 2119, 1797 DOI 10.17487/RFC2119, March 1997, 1798 . 1800 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1801 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 1802 2006, . 1804 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1805 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1806 . 1808 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 1809 Authenticated Encryption Using the Advanced Encryption 1810 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 1811 2008, . 1813 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1814 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1815 March 2010, . 1817 [RFC5890] Klensin, J., "Internationalized Domain Names for 1818 Applications (IDNA): Definitions and Document Framework", 1819 RFC 5890, DOI 10.17487/RFC5890, August 2010, 1820 . 1822 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 1823 "Network Time Protocol Version 4: Protocol and Algorithms 1824 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 1825 . 1827 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1828 Verification of Domain-Based Application Service Identity 1829 within Internet Public Key Infrastructure Using X.509 1830 (PKIX) Certificates in the Context of Transport Layer 1831 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1832 2011, . 1834 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 1835 Cheshire, "Internet Assigned Numbers Authority (IANA) 1836 Procedures for the Management of the Service Name and 1837 Transport Protocol Port Number Registry", BCP 165, 1838 RFC 6335, DOI 10.17487/RFC6335, August 2011, 1839 . 1841 [RFC6874] Carpenter, B., Cheshire, S., and R. Hinden, "Representing 1842 IPv6 Zone Identifiers in Address Literals and Uniform 1843 Resource Identifiers", RFC 6874, DOI 10.17487/RFC6874, 1844 February 2013, . 1846 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1847 "Transport Layer Security (TLS) Application-Layer Protocol 1848 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1849 July 2014, . 1851 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 1852 Suite Value (SCSV) for Preventing Protocol Downgrade 1853 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 1854 . 1856 [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, 1857 "Recommendations for Secure Use of Transport Layer 1858 Security (TLS) and Datagram Transport Layer Security 1859 (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 1860 2015, . 1862 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 1863 (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, 1864 March 2016, . 1866 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1867 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1868 May 2017, . 1870 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1871 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1872 . 1874 12.2. Informative References 1876 [I-D.ietf-ntp-data-minimization] 1877 Franke, D. and A. Malhotra, "NTP Client Data 1878 Minimization", draft-ietf-ntp-data-minimization-04 (work 1879 in progress), March 2019. 1881 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1882 against time synchronization protocols", in Proceedings 1883 of Precision Clock Synchronization for Measurement Control 1884 and Communication, ISPCS 2012, pp. 1-6, September 2012. 1886 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 1887 "Randomness Requirements for Security", BCP 106, RFC 4086, 1888 DOI 10.17487/RFC4086, June 2005, 1889 . 1891 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1892 "Transport Layer Security (TLS) Session Resumption without 1893 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1894 January 2008, . 1896 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1897 Housley, R., and W. Polk, "Internet X.509 Public Key 1898 Infrastructure Certificate and Certificate Revocation List 1899 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1900 . 1902 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1903 Key Derivation Function (HKDF)", RFC 5869, 1904 DOI 10.17487/RFC5869, May 2010, 1905 . 1907 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1908 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 1909 October 2014, . 1911 [RFC8573] Malhotra, A. and S. Goldberg, "Message Authentication Code 1912 for the Network Time Protocol", RFC 8573, 1913 DOI 10.17487/RFC8573, June 2019, 1914 . 1916 [Shpiner] Shpiner, A., Revah, Y., and T. Mizrahi, "Multi-path Time 1917 Protocols", in Proceedings of IEEE International Symposium 1918 on Precision Clock Synchronization for Measurement, 1919 Control and Communication (ISPCS), September 2013. 1921 Appendix A. Terms and Abbreviations 1923 AEAD Authenticated Encryption with Associated Data [RFC5116] 1925 ALPN Application-Layer Protocol Negotiation [RFC7301] 1927 C2S Client-to-server 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 1942 NTS-KE Network Time Security Key Exchange 1944 PRF Pseudorandom Function 1946 S2C Server-to-client 1948 SCSV Signaling Cipher Suite Value [RFC7507] 1950 TLS Transport Layer Security [RFC8446] 1952 Authors' Addresses 1954 Daniel Fox Franke 1955 Akamai Technologies 1956 150 Broadway 1957 Cambridge, MA 02142 1958 United States 1960 Email: dafranke@akamai.com 1961 URI: https://www.dfranke.us 1962 Dieter Sibold 1963 Physikalisch-Technische 1964 Bundesanstalt 1965 Bundesallee 100 1966 Braunschweig D-38116 1967 Germany 1969 Phone: +49-(0)531-592-8420 1970 Fax: +49-531-592-698420 1971 Email: dieter.sibold@ptb.de 1973 Kristof Teichel 1974 Physikalisch-Technische 1975 Bundesanstalt 1976 Bundesallee 100 1977 Braunschweig D-38116 1978 Germany 1980 Phone: +49-(0)531-592-4471 1981 Email: kristof.teichel@ptb.de 1983 Marcus Dansarie 1984 Sweden 1986 Email: marcus@dansarie.se 1987 URI: https://orcid.org/0000-0001-9246-0263 1989 Ragnar Sundblad 1990 Netnod 1991 Sweden 1993 Email: ragge@netnod.se