idnits 2.17.1 draft-dansarie-nts-00.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 : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 02, 2018) is 2124 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 362 -- Looks like a reference, but probably isn't: '1' on line 362 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7507 (Obsoleted by RFC 8996) == Outdated reference: A later version (-04) exists of draft-ietf-ntp-data-minimization-02 -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) Summary: 3 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 4 Intended status: Standards Track D. Sibold 5 Expires: January 3, 2019 K. Teichel 6 PTB 7 M. Dansarie 9 R. Sundblad 10 Netnod 11 July 02, 2018 13 Network Time Security for the Network Time Protocol 14 draft-dansarie-nts-00 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 NTS Key Establishment Protocol (NTS-KE) and the NTS Extension 25 Fields for NTPv4. NTS-KE handles NTS service authentication, initial 26 handshaking, and key extraction over TLS. Encryption and 27 authentication during NTP time synchronization is performed through 28 the NTS Extension Fields in otherwise standard NTP packets. Except 29 for during the initial NTS-KE process, all state required by the 30 protocol is held by the client in opaque cookies. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on January 3, 2019. 49 Copyright Notice 51 Copyright (c) 2018 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (https://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 67 1.1. Objectives . . . . . . . . . . . . . . . . . . . . . . . 3 68 1.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 4 69 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 6 70 3. TLS Profile for Network Time Security . . . . . . . . . . . . 6 71 4. The NTS Key Establishment Protocol . . . . . . . . . . . . . 7 72 4.1. NTS-KE Record Types . . . . . . . . . . . . . . . . . . . 9 73 4.1.1. End of Message . . . . . . . . . . . . . . . . . . . 9 74 4.1.2. NTS Next Protocol Negotiation . . . . . . . . . . . . 10 75 4.1.3. Error . . . . . . . . . . . . . . . . . . . . . . . . 10 76 4.1.4. Warning . . . . . . . . . . . . . . . . . . . . . . . 10 77 4.1.5. AEAD Algorithm Negotiation . . . . . . . . . . . . . 11 78 4.1.6. New Cookie for NTPv4 . . . . . . . . . . . . . . . . 11 79 4.1.7. NTP Server Negotiation . . . . . . . . . . . . . . . 12 80 4.2. Key Extraction (generally) . . . . . . . . . . . . . . . 12 81 4.3. Key Extraction (for NTPv4) . . . . . . . . . . . . . . . 13 82 5. NTS Extension Fields for NTPv4 . . . . . . . . . . . . . . . 13 83 5.1. Packet Structure Overview . . . . . . . . . . . . . . . . 13 84 5.2. The Unique Identifier Extension Field . . . . . . . . . . 14 85 5.3. The NTS Cookie Extension Field . . . . . . . . . . . . . 14 86 5.4. The NTS Cookie Placeholder Extension Field . . . . . . . 14 87 5.5. The NTS Authenticator and Encrypted Extension Fields 88 Extension Field . . . . . . . . . . . . . . . . . . . . . 15 89 6. Protocol Details . . . . . . . . . . . . . . . . . . . . . . 17 90 7. Suggested Format for NTS Cookies . . . . . . . . . . . . . . 21 91 8. Usage of NTP pools . . . . . . . . . . . . . . . . . . . . . 22 92 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 93 9.1. Service Name and Transport Protocol Port Number Registry 23 94 9.2. TLS Application-Layer Protocol Negotiation (ALPN) 95 Protocol IDs Registry . . . . . . . . . . . . . . . . . . 23 96 9.3. TLS Exporter Labels Registry . . . . . . . . . . . . . . 24 97 9.4. NTP Kiss-o'-Death Codes Registry . . . . . . . . . . . . 24 98 9.5. NTP Extension Field Types Registry . . . . . . . . . . . 24 99 9.6. Network Time Security Key Establishment Record Types 100 Registry . . . . . . . . . . . . . . . . . . . . . . . . 25 101 9.7. Network Time Security Next Protocols Registry . . . . . . 26 102 9.8. Network Time Security Error and Warning Codes Registries 27 103 10. Security Considerations . . . . . . . . . . . . . . . . . . . 28 104 10.1. Sensitivity to DDoS attacks . . . . . . . . . . . . . . 28 105 10.2. Avoiding DDoS Amplification . . . . . . . . . . . . . . 28 106 10.3. Initial Verification of Server Certificates . . . . . . 29 107 10.4. Delay Attacks . . . . . . . . . . . . . . . . . . . . . 30 108 10.5. Random Number Generation . . . . . . . . . . . . . . . . 30 109 11. Privacy Considerations . . . . . . . . . . . . . . . . . . . 30 110 11.1. Unlinkability . . . . . . . . . . . . . . . . . . . . . 31 111 11.2. Confidentiality . . . . . . . . . . . . . . . . . . . . 31 112 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 32 113 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 32 114 13.1. Normative References . . . . . . . . . . . . . . . . . . 32 115 13.2. Informative References . . . . . . . . . . . . . . . . . 33 116 Appendix A. Terms and Abbreviations . . . . . . . . . . . . . . 34 117 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35 119 1. Introduction 121 This memo specifies Network Time Security (NTS), a cryptographic 122 security mechanism for network time synchronization. A complete 123 specification is provided for application of NTS to the client-server 124 mode of the Network Time Protocol (NTP) [RFC5905]. 126 1.1. Objectives 128 The objectives of NTS are as follows: 130 o Identity: Through the use of the X.509 public key infrastructure, 131 implementations may cryptographically establish the identity of 132 the parties they are communicating with. 134 o Authentication: Implementations may cryptographically verify that 135 any time synchronization packets are authentic, i.e., that they 136 were produced by an identified party and have not been modified in 137 transit. 139 o Confidentiality: Although basic time synchronization data is 140 considered non-confidential and sent in the clear, NTS includes 141 support for encrypting NTP extension fields. 143 o Replay prevention: Client implementations may detect when a 144 received time synchronization packet is a replay of a previous 145 packet. 147 o Request-response consistency: Client implementations may verify 148 that a time synchronization packet received from a server was sent 149 in response to a particular request from the client. 151 o Unlinkability: For mobile clients, NTS will not leak any 152 information additional to NTP which would permit a passive 153 adversary to determine that two packets sent over different 154 networks came from the same client. 156 o Non-amplification: Implementations (especially server 157 implementations) may avoid acting as distributed denial-of-service 158 (DDoS) amplifiers by never responding to a request with a packet 159 larger than the request packet. 161 o Scalability: Server implementations may serve large numbers of 162 clients without having to retain any client-specific state. 164 o Resilience: Attacks on or faults in parts of the NTS 165 infrastructure should not completely prohibit clients from 166 performing time synchronization. 168 1.2. Protocol Overview 170 The Network Time Protocol includes many different operating modes to 171 support various network topologies. In addition to its best-known 172 and most-widely-used client-server mode, it also includes modes for 173 synchronization between symmetric peers, a control mode for server 174 monitoring and administration, and a broadcast mode. These various 175 modes have differing and partly contradictory requirements for 176 security and performance. Symmetric and control modes demand mutual 177 authentication and mutual replay protection. Additionally, for 178 certain message types control mode may require confidentiality as 179 well as authentication. Client-server mode places more stringent 180 requirements on resource utilization than other modes, because 181 servers may have vast number of clients and be unable to afford to 182 maintain per-client state. However, client-server mode also has more 183 relaxed security needs, because only the client requires replay 184 protection: it is harmless for stateless servers to process replayed 185 packets. The security demands of symmetric and control modes, on the 186 other hand, are in conflict with the resource-utilization demands of 187 client-server mode: any scheme which provides replay protection 188 inherently involves maintaining some state to keep track of what 189 messages have already been seen. 191 This memo specifies NTS exclusively for the client-server mode of 192 NTP. To this end, NTS is structured as a suite of two protocols: 194 The "NTS Extension Fields for NTPv4" are a collection of NTP 195 extension fields for cryptographically securing NTPv4 using 196 previously-established key material. They are suitable for 197 securing client-server mode because the server can implement them 198 without retaining per-client state. All state is kept by the 199 client and provided to the server in the form of an encrypted 200 cookie supplied with each request. On the other hand, the NTS 201 Extension Fields are suitable *only* for client-server mode 202 because only the client, and not the server, is protected from 203 replay. 205 The "NTS Key Establishment" protocol (NTS-KE) is a mechanism for 206 establishing key material for use with the NTS Extension Fields 207 for NTPv4. It uses TLS to exchange keys, provide the client with 208 an initial supply of cookies, and negotiate some additional 209 protocol options. After this exchange, the TLS channel is closed 210 with no per-client state remaining on the server side. 212 The typical protocol flow is as follows: The client connects to an 213 NTS-KE server on the NTS TCP port and the two parties perform a TLS 214 handshake. Via the TLS channel, the parties negotiate some 215 additional protocol parameters and the server sends the client a 216 supply of cookies along with a list of one or more IP addresses to 217 NTP servers for which the cookies are valid. The parties use TLS key 218 export [RFC5705] to extract key material which will be used in the 219 next phase of the protocol. This negotiation takes only a single 220 round trip, after which the server closes the connection and discards 221 all associated state. At this point the NTS-KE phase of the protocol 222 is complete. Ideally, the client never needs to connect to the NTS- 223 KE server again. 225 Time synchronization proceeds with one of the indicated NTP servers 226 over the NTP UDP port. The client sends the server an NTP client 227 packet which includes several extension fields. Included among these 228 fields are a cookie (previously provided by the key exchange server) 229 and an authentication tag, computed using key material extracted from 230 the NTS-KE handshake. The NTP server uses the cookie to recover this 231 key material and send back an authenticated response. The response 232 includes a fresh, encrypted cookie which the client then sends back 233 in the clear in a subsequent request. (This constant refreshing of 234 cookies is necessary in order to achieve NTS's unlinkability goal.) 236 Figure 1 provides an overview of the high-level interaction between 237 the client, the NTS-KE server, and the NTP server. Note that the 238 cookies' data format and the exchange of secrets between NTS-KE and 239 NTP servers are not part of this specification and are implementation 240 dependent. However, a suggested format for NTS cookies is provided 241 in Section 7. 243 +--------------+ 244 | | 245 +-> | NTP Server 1 | 246 | | | 247 Shared cookie | +--------------+ 248 +---------------+ encryption parameters | +--------------+ 249 | | (Implementation dependent) | | | 250 | NTS-KE Server | <------------------------------+-> | NTP Server 2 | 251 | | | | | 252 +---------------+ | +--------------+ 253 ^ | . 254 | | . 255 | 1. Negotiate parameters, | . 256 | receive initial cookie | +--------------+ 257 | supply, generate AEAD keys, | | | 258 | and receive NTP server IP +-> | NTP Server N | 259 | addresses using "NTS Key | | 260 | Establishment" protocol. +--------------+ 261 | ^ 262 | | 263 | +----------+ | 264 | | | | 265 +-----------> | Client | <-------------------------+ 266 | | 2. Perform authenticated 267 +----------+ time synchronization 268 and generate new 269 cookies using "NTS 270 Extension Fields for 271 NTPv4". 273 Figure 1: Overview of High-Level Interactions in NTS 275 2. Requirements Language 277 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 278 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 279 document are to be interpreted as described in RFC 2119 [RFC2119]. 281 3. TLS Profile for Network Time Security 283 Network Time Security makes use of TLS [RFC8446] for NTS key 284 establishment. 286 Since securing time protocols is (as of 2018) a novel application of 287 TLS, no backward-compatibility concerns exist to justify using 288 obsolete, insecure, or otherwise broken TLS features or versions. We 289 therefore put forward the following requirements and guidelines, 290 roughly representing 2018's best practices: 292 Implementations MUST NOT negotiate TLS versions earlier than 1.3. 294 Implementations willing to negotiate more than one possible version 295 of TLS SHOULD NOT respond to handshake failures by retrying with a 296 downgraded protocol version. If they do, they MUST implement TLS 297 Fallback SCSV [RFC7507]. 299 Use of the Application-Layer Protocol Negotiation Extension [RFC7301] 300 is integral to NTS and support for it is REQUIRED for 301 interoperability. 303 4. The NTS Key Establishment Protocol 305 The NTS key establishment protocol is conducted via TCP port 306 [[TBD1]]. The two endpoints carry out a TLS handshake in conformance 307 with Section 3, with the client offering (via an ALPN [RFC7301] 308 extension), and the server accepting, an application-layer protocol 309 of "ntske/1". Immediately following a successful handshake, the 310 client SHALL send a single request as Application Data encapsulated 311 in the TLS-protected channel. Then, the server SHALL send a single 312 response followed by a TLS "Close notify" alert and then discard the 313 channel state. 315 The client's request and the server's response each SHALL consist of 316 a sequence of records formatted according to Figure 2. Requests and 317 non-error responses each SHALL include exactly one NTS Next Protocol 318 Negotiation record. The sequence SHALL be terminated by a "End of 319 Message" record. The requirement that all NTS-KE messages be 320 terminated by an End of Message record makes them self-delimiting. 322 Clients and servers MAY enforce length limits on requests and 323 responses, however, servers MUST accept requests of at least 1024 324 octets and clients SHOULD accept responses of at least 65536 octets. 326 0 1 2 3 327 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 328 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 329 |C| Record Type | Body Length | 330 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 331 | | 332 . . 333 . Record Body . 334 . . 335 | | 336 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 338 Figure 2: NTS-KE Record Format 340 The fields of an NTS-KE record are defined as follows: 342 C (Critical Bit): Determines the disposition of unrecognized 343 Record Types. Implementations which receive a record with an 344 unrecognized Record Type MUST ignore the record if the Critical 345 Bit is 0 and MUST treat it as an error if the Critical Bit is 1. 347 Record Type Number: A 15-bit integer in network byte order. The 348 semantics of record types 0-6 are specified in this memo. 349 Additional type numbers SHALL be tracked through the IANA Network 350 Time Security Key Establishment Record Types registry. 352 Body Length: The length of the Record Body field, in octets, as a 353 16-bit integer in network byte order. Record bodies MAY have any 354 representable length and need not be aligned to a word boundary. 356 Record Body: The syntax and semantics of this field SHALL be 357 determined by the Record Type. 359 For clarity regarding bit-endianness: the Critical Bit is the most- 360 significant bit of the first octet. In C, given a network buffer 361 `unsigned char b[]` containing an NTS-KE record, the critical bit is 362 `b[0] >> 7` while the record type is `((b[0] & 0x7f) << 8) + b[1]`. 364 Figure 3 provides a schematic overview of the key exchange. It 365 displays the protocol steps to be performed by the NTS client and 366 server and record types to be exchanged. 368 +---------------------------------------+ 369 | - Verify client request message. | 370 | - Extract TLS key material. | 371 | - Generate KE response message. | 372 | - Include Record Types: | 373 | o NTS Next Protocol Negotiation | 374 | o AEAD Algorithm Negotiation | 375 | o NTP Server Negotiation | 376 | o New Cookie for NTPv4 | 377 | o | 378 | o End of Message | 379 +-----------------+---------------------+ 380 | 381 | 382 Server -----------+---------------+-----+-----------------------> 383 ^ \ 384 / \ 385 / TLS application \ 386 / data \ 387 / \ 388 / V 389 Client -----+---------------------------------+----------------> 390 | | 391 | | 392 | | 393 +-----------+----------------------+ +------+-----------------+ 394 |- Generate KE request message. | |- Verify server response| 395 | - Include Record Types: | | message. | 396 | o NTS Next Protocol Negotiation | |- Extract cookie(s). | 397 | o AEAD Algorithm Negotiation | | | 398 | o | | | 399 | o End of Message | | | 400 +----------------------------------+ +------------------------+ 402 Figure 3: NTS Key Exchange Messages 404 4.1. NTS-KE Record Types 406 The following NTS-KE Record Types are defined: 408 4.1.1. End of Message 410 The End of Message record has a Record Type number of 0 and a zero- 411 length body. It MUST occur exactly once as the final record of every 412 NTS-KE request and response. The Critical Bit MUST be set. 414 4.1.2. NTS Next Protocol Negotiation 416 The NTS Next Protocol Negotiation record has a Record Type number of 417 1. It MUST occur exactly once in every NTS-KE request and response. 418 Its body consists of a sequence of 16-bit unsigned integers in 419 network byte order. Each integer represents a Protocol ID from the 420 IANA Network Time Security Next Protocols registry. The Critical Bit 421 MUST be set. 423 The Protocol IDs listed in the client's NTS Next Protocol Negotiation 424 record denote those protocols which the client wishes to speak using 425 the key material established through this NTS-KE session. The 426 Protocol IDs listed in the server's response MUST comprise a subset 427 of those listed in the request and denote those protocols which the 428 server is willing and able to speak using the key material 429 established through this NTS-KE session. The client MAY proceed with 430 one or more of them. The request MUST list at least one protocol, 431 but the response MAY be empty. 433 4.1.3. Error 435 The Error record has a Record Type number of 2. Its body is exactly 436 two octets long, consisting of an unsigned 16-bit integer in network 437 byte order, denoting an error code. The Critical Bit MUST be set. 439 Clients MUST NOT include Error records in their request. If clients 440 receive a server response which includes an Error record, they MUST 441 discard any negotiated key material and MUST NOT proceed to the Next 442 Protocol. 444 The following error codes are defined: 446 Error code 0 means "Unrecognized Critical Record". The server 447 MUST respond with this error code if the request included a record 448 which the server did not understand and which had its Critical Bit 449 set. The client SHOULD NOT retry its request without 450 modification. 452 Error code 1 means "Bad Request". The server MUST respond with 453 this error if, upon the expiration of an implementation-defined 454 timeout, it has not yet received a complete and syntactically 455 well-formed request from the client. 457 4.1.4. Warning 459 The Warning record has a Record Type number of 3. Its body is 460 exactly two octets long, consisting of an unsigned 16-bit integer in 461 network byte order, denoting a warning code. The Critical Bit MUST 462 be set. 464 Clients MUST NOT include Warning records in their request. If 465 clients receive a server response which includes a Warning record, 466 they MAY discard any negotiated key material and abort without 467 proceeding to the Next Protocol. Unrecognized warning codes MUST be 468 treated as errors. 470 This memo defines no warning codes. 472 4.1.5. AEAD Algorithm Negotiation 474 The AEAD Algorithm Negotiation record has a Record Type number of 4. 475 Its body consists of a sequence of unsigned 16-bit integers in 476 network byte order, denoting Numeric Identifiers from the IANA AEAD 477 registry [RFC5116]. The Critical Bit MAY be set. 479 If the NTS Next Protocol Negotiation record offers Protocol ID 0 (for 480 NTPv4), then this record MUST be included exactly once. Other 481 protocols MAY require it as well. 483 When included in a request, this record denotes which AEAD algorithms 484 the client is willing to use to secure the Next Protocol, in 485 decreasing preference order. When included in a response, this 486 record denotes which algorithm the server chooses to use. It is 487 empty if the server supports none of the algorithms offered. In 488 requests, the list MUST include at least one algorithm. In 489 responses, it MUST include at most one. Honoring the client's 490 preference order is OPTIONAL: servers may select among any of the 491 client's offered choices, even if they are able to support some other 492 algorithm which the client prefers more. 494 Server implementations of NTS extension fields for NTPv4 (Section 5) 495 MUST support AEAD_AES_SIV_CMAC_256 [RFC5297] (Numeric Identifier 15). 496 That is, if the client includes AEAD_AES_SIV_CMAC_256 in its AEAD 497 Algorithm Negotiation record and the server accepts Protocol ID 0 498 (NTPv4) in its NTS Next Protocol Negotiation record, then the 499 server's AEAD Algorithm Negotiation record MUST NOT be empty. 501 4.1.6. New Cookie for NTPv4 503 The New Cookie for NTPv4 record has a Record Type number of 5. The 504 contents of its body SHALL be implementation-defined and clients MUST 505 NOT attempt to interpret them. See Section 7 for a suggested 506 construction. 508 Clients MUST NOT send records of this type. Servers MUST send at 509 least one record of this type, and SHOULD send eight of them, if the 510 Next Protocol Negotiation response record contains Protocol ID 0 511 (NTPv4) and the AEAD Algorithm Negotiation response record is not 512 empty. The Critical Bit SHOULD NOT be set. 514 4.1.7. NTP Server Negotiation 516 The NTP Server Negotiation record has a Record Type number of 6. The 517 record MAY be sent by a client in a request and SHOULD be sent by a 518 server as part of a reply. Its body consists of a sequence of IPv4 519 and/or IPv6 addresses. Both address types are represented by 16 520 octets in network byte order. To achieve this, IPv4 addresses are 521 represented as "IPv4-mapped IPv6 addresses" in the format specified 522 in RFC 4291, Section 2.5.5.2 [RFC4291]. For example: The IPv4 523 address 192.0.2.1 would be mapped to the IPv6 address space as 524 ::ffff:192.0.2.1. The Critical Bit SHOULD be set. 526 When used in a request, the NTP Server Negotiation record is the 527 client's way of indicating to the KE server which NTP servers it 528 wishes to receive cookies for. Honoring the client's NTP server 529 preferences is OPTIONAL. When used in a response, this record 530 informs the client about which NTP servers the received cookies can 531 be used with in the next phase of the protocol. The client SHOULD 532 NOT attempt to use the received cookies with any other NTP servers 533 than those indicated by the KE server. 535 If a response does not include this record, the client SHOULD assume 536 that the received cookies are valid for use with an NTP server at the 537 same network address as the key exchange server. 539 4.2. Key Extraction (generally) 541 Following a successful run of the NTS-KE protocol, key material SHALL 542 be extracted according to RFC 5705 [RFC5705]. Inputs to the exporter 543 function are to be constructed in a manner specific to the negotiated 544 Next Protocol. However, all protocols which utilize NTS-KE MUST 545 conform to the following two rules: 547 The disambiguating label string MUST be "EXPORTER-network-time- 548 security/1". 550 The per-association context value MUST be provided and MUST begin 551 with the two-octet Protocol ID which was negotiated as a Next 552 Protocol. 554 4.3. Key Extraction (for NTPv4) 556 Following a successful run of the NTS-KE protocol wherein Protocol ID 557 0 (NTPv4) is selected as a Next Protocol, two AEAD keys SHALL be 558 extracted: a client-to-server (C2S) key and a server-to-client (S2C) 559 key. These keys SHALL be computed according to RFC 5705 [RFC5705], 560 using the following inputs. 562 The disambiguating label string SHALL be "EXPORTER-network-time- 563 security/1". 565 The per-association context value SHALL consist of the following 566 five octets: 568 The first two octets SHALL be zero (the Protocol ID for NTPv4). 570 The next two octets SHALL be the Numeric Identifier of the 571 negotiated AEAD Algorithm in network byte order. 573 The final octet SHALL be 0x00 for the C2S key and 0x01 for the 574 S2C key. 576 Implementations wishing to derive additional keys for private or 577 experimental use MUST NOT do so by extending the above-specified 578 syntax for per-association context values. Instead, they SHOULD use 579 their own disambiguating label string. Note that RFC 5705 [RFC5705] 580 provides that disambiguating label strings beginning with 581 "EXPERIMENTAL" MAY be used without IANA registration. 583 5. NTS Extension Fields for NTPv4 585 5.1. Packet Structure Overview 587 In general, an NTS-protected NTPv4 packet consists of: 589 The usual 48-octet NTP header which is authenticated but not 590 encrypted. 592 Some extension fields which are authenticated but not encrypted. 594 An extension field which contains AEAD output (i.e., an 595 authentication tag and possible ciphertext). The corresponding 596 plaintext, if non-empty, consists of some extension fields which 597 benefit from both encryption and authentication. 599 Possibly, some additional extension fields which are neither 600 encrypted nor authenticated. These are discarded by the receiver. 602 Always included among the authenticated or authenticated-and- 603 encrypted extension fields are a cookie extension field and a unique 604 identifier extension field. The purpose of the cookie extension 605 field is to enable the server to offload storage of session state 606 onto the client. The purpose of the unique identifier extension 607 field is to protect the client from replay attacks. 609 5.2. The Unique Identifier Extension Field 611 The Unique Identifier extension field provides the client with a 612 cryptographically strong means of detecting replayed packets. It has 613 a Field Type of [[TBD2]]. When the extension field is included in a 614 client packet (mode 3), its body SHALL consist of a string of octets 615 generated uniformly at random. The string MUST be at least 32 octets 616 long. When the extension field is included in a server packet (mode 617 4), its body SHALL contain the same octet string as was provided in 618 the client packet to which the server is responding. All server 619 packets generated by NTS-implementing servers in response to client 620 packets containing this extension field MUST also contain this field 621 with the same content as in the client's request. The field's use in 622 modes other than client-server is not defined. 624 This extension field MAY also be used standalone, without NTS, in 625 which case it provides the client with a means of detecting spoofed 626 packets from off-path attackers. Historically, NTP's origin 627 timestamp field has played both these roles, but for cryptographic 628 purposes this is suboptimal because it is only 64 bits long and, 629 depending on implementation details, most of those bits may be 630 predictable. In contrast, the Unique Identifier extension field 631 enables a degree of unpredictability and collision resistance more 632 consistent with cryptographic best practice. 634 5.3. The NTS Cookie Extension Field 636 The NTS Cookie extension field has a Field Type of [[TBD3]]. Its 637 purpose is to carry information which enables the server to recompute 638 keys and other session state without having to store any per-client 639 state. The contents of its body SHALL be implementation-defined and 640 clients MUST NOT attempt to interpret them. See Section 7 for a 641 suggested construction. The NTS Cookie extension field MUST NOT be 642 included in NTP packets whose mode is other than 3 (client) or 4 643 (server). 645 5.4. The NTS Cookie Placeholder Extension Field 647 The NTS Cookie Placeholder extension field has a Field Type of 648 [[TBD4]]. When this extension field is included in a client packet 649 (mode 3), it communicates to the server that the client wishes it to 650 send additional cookies in its response. This extension field MUST 651 NOT be included in NTP packets whose mode is other than 3. 653 Whenever an NTS Cookie Placeholder extension field is present, it 654 MUST be accompanied by an NTS Cookie extension field. The body 655 length of the NTS Cookie Placeholder extension field MUST be the same 656 as the body length of the NTS Cookie extension field. This length 657 requirement serves to ensure that the response will not be larger 658 than the request, in order to improve timekeeping precision and 659 prevent DDoS amplification. The contents of the NTS Cookie 660 Placeholder extension field's body are undefined and, aside from 661 checking its length, MUST be ignored by the server. 663 5.5. The NTS Authenticator and Encrypted Extension Fields Extension 664 Field 666 The NTS Authenticator and Encrypted Extension Fields extension field 667 is the central cryptographic element of an NTS-protected NTP packet. 668 Its Field Type is [[TBD5]]. It SHALL be formatted according to 669 Figure 4 and include the following fields: 671 Nonce length: Two octets in network byte order, giving the length 672 of the Nonce field, excluding any padding, interpreted as an 673 unsigned integer. 675 Ciphertext Length: Two octets in network byte order, giving the 676 length of the Ciphertext field, excluding any padding, interpreted 677 as an unsigned integer. 679 Nonce: A nonce as required by the negotiated AEAD Algorithm. The 680 field is zero-padded to a word (four octets) boundary. 682 Ciphertext: The output of the negotiated AEAD Algorithm. The 683 structure of this field is determined by the negotiated algorithm, 684 but it typically contains an authentication tag in addition to the 685 actual ciphertext. The field is zero-padded to a word (four 686 octets) boundary. 688 0 1 2 3 689 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 690 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 691 | Nonce Length | Ciphertext Length | 692 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 693 | | 694 . . 695 . Nonce, including up to 3 bytes padding . 696 . . 697 | | 698 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 699 | | 700 . . 701 . Ciphertext, including up to 3 bytes padding . 702 . . 703 | | 704 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 706 Figure 4: NTS Authenticator and Encrypted Extension Fields Extension 707 Field Format 709 The Ciphertext field SHALL be formed by providing the following 710 inputs to the negotiated AEAD Algorithm: 712 K: For packets sent from the client to the server, the C2S key 713 SHALL be used. For packets sent from the server to the client, 714 the S2C key SHALL be used. 716 A: The associated data SHALL consist of the portion of the NTP 717 packet beginning from the start of the NTP header and ending at 718 the end of the last extension field which precedes the NTS 719 Authenticator and Encrypted Extension Fields extension field. 721 P: The plaintext SHALL consist of all (if any) NTP extension 722 fields to be encrypted. The format of any such fields SHALL be in 723 accordance with RFC 7822 [RFC7822]. If multiple extension fields 724 are present they SHALL be joined by concatenation. 726 N: The nonce SHALL be formed however required by the negotiated 727 AEAD Algorithm. 729 The NTS Authenticator and Encrypted Extension Fields extension field 730 MUST NOT be included in NTP packets whose mode is other than 3 731 (client) or 4 (server). 733 6. Protocol Details 735 A client sending an NTS-protected request SHALL include the following 736 extension fields as displayed in Figure 5: 738 Exactly one Unique Identifier extension field which MUST be 739 authenticated, MUST NOT be encrypted, and whose contents MUST NOT 740 duplicate those of any previous request. 742 Exactly one NTS Cookie extension field which MUST be authenticated 743 and MUST NOT be encrypted. The cookie MUST be one which has been 744 previously provided to the client; either from the key exchange 745 server during the NTS-KE handshake or from the NTP server in 746 response to a previous NTS-protected NTP request. To protect the 747 client's privacy, the same cookie SHOULD NOT be included in 748 multiple requests. If the client does not have any cookies that 749 it has not already sent, it SHOULD initiate a re-run the NTS-KE 750 protocol. 752 Exactly one NTS Authenticator and Encrypted Extension Fields 753 extension field, generated using an AEAD Algorithm and C2S key 754 established through NTS-KE. 756 The client MAY include one or more NTS Cookie Placeholder extension 757 fields which MUST be authenticated and MAY be encrypted. The number 758 of NTS Cookie Placeholder extension fields that the client includes 759 SHOULD be such that if the client includes N placeholders and the 760 server sends back N+1 cookies, the number of unused cookies stored by 761 the client will come to eight. The client SHOULD NOT include more 762 than seven NTS Cookie Placeholder extension fields in a request. 763 When both the client and server adhere to all cookie-management 764 guidance provided in this memo, the number of placeholder extension 765 fields will equal the number of dropped packets since the last 766 successful volley. 768 +---------------------------------------+ 769 | - Verify time request message. | 770 | - Generate time response message. | 771 | - Include NTPv4 extension fields: | 772 | o Unique Identifier EF | 773 | o NTS Cookie EF | 774 | o | 775 | | 776 | - Generate AEAD tag of NTP message. | 777 | - Add NTS Authentication and | 778 | Encrypted Extension Fields EF. | 779 | - Transmit time response packet. | 780 +-----------------+---------------------+ 781 | 782 | 783 Server -----------+---------------+-----+-----------------------> 784 ^ \ 785 / \ 786 Time request / \ Time response 787 (mode 3) / \ (mode 4) 788 / \ 789 / V 790 Client -----+---------------------------------+----------------> 791 | | 792 | | 793 | | 794 +-----------+-----------------------+ +-----+------------------+ 795 |- Generate time request message. | |- Verify time response | 796 | - Include NTPv4 extension fields: | | message. | 797 | o Unique Identifier EF | |- Extract cookie(s). | 798 | o NTS Cookie EF | |- Time synchronization | 799 | o | | processing. | 800 | | +------------------------+ 801 |- Generate AEAD tag of NTP message.| 802 |- Add NTS Authentication and | 803 | Encrypted Extension Fields EF. | 804 |- Transmit time request packet. | 805 +-----------------------------------+ 807 Figure 5: NTS Time Synchronization Messages 809 The client MAY include additional (non-NTS-related) extension fields 810 which MAY appear prior to the NTS Authenticator and Encrypted 811 Extension Fields extension fields (therefore authenticated but not 812 encrypted), within it (therefore encrypted and authenticated), or 813 after it (therefore neither encrypted nor authenticated). In 814 general, however, the server MUST discard any unauthenticated 815 extension fields and process the packet as though they were not 816 present. Servers MAY implement exceptions to this requirement for 817 particular extension fields if their specification explicitly 818 provides for such. 820 Upon receiving an NTS-protected request, the server SHALL (through 821 some implementation-defined mechanism) use the cookie to recover the 822 AEAD Algorithm, C2S key, and S2C key associated with the request, and 823 then use the C2S key to authenticate the packet and decrypt the 824 ciphertext. If the cookie is valid and authentication and decryption 825 succeed, the server SHALL include the following extension fields in 826 its response: 828 Exactly one Unique Identifier extension field which MUST be 829 authenticated, MUST NOT be encrypted, and whose contents SHALL 830 echo those provided by the client. 832 Exactly one NTS Authenticator and Encrypted Extension Fields 833 extension field, generated using the AEAD algorithm and S2C key 834 recovered from the cookie provided by the client. 836 One or more NTS Cookie extension fields which MUST be 837 authenticated and encrypted. The number of NTS Cookie extension 838 fields included SHOULD be equal to, and MUST NOT exceed, one plus 839 the number of valid NTS Cookie Placeholder extension fields 840 included in the request. The cookies returned in those fields 841 MUST be valid for use with the NTP server that sent them. They 842 MAY be valid for other NTP servers as well, but there is no way 843 for the server to indicate this. 845 We emphasize the contrast that NTS Cookie extension fields MUST NOT 846 be encrypted when sent from client to server, but MUST be encrypted 847 from sent from server to client. The former is necessary in order 848 for the server to be able to recover the C2S and S2C keys, while the 849 latter is necessary to satisfy the unlinkability goals discussed in 850 Section 11.1. We emphasize also that "encrypted" means encapsulated 851 within the the NTS Authenticator and Encrypted Extensions extension 852 field. While the body of an NTS Cookie extension field will 853 generally consist of some sort of AEAD output (regardless of whether 854 the recommendations of Section 7 are precisely followed), this is not 855 sufficient to make the extension field "encrypted". 857 The server MAY include additional (non-NTS-related) extension fields 858 which MAY appear prior to the NTS Authenticator and Encrypted 859 Extension Fields extension field (therefore authenticated but not 860 encrypted), within it (therefore encrypted and authenticated), or 861 after it (therefore neither encrypted nor authenticated). In 862 general, however, the client MUST discard any unauthenticated 863 extension fields and process the packet as though they were not 864 present. Clients MAY implement exceptions to this requirement for 865 particular extension fields if their specification explicitly 866 provides for such. 868 Upon receiving an NTS-protected response, the client MUST verify that 869 the Unique Identifier matches that of an outstanding request, and 870 that the packet is authentic under the S2C key associated with that 871 request. If either of these checks fails, the packet MUST be 872 discarded without further processing. 874 If the server is unable to validate the cookie or authenticate the 875 request, it SHOULD respond with a Kiss-o'-Death (KoD) packet (see RFC 876 5905, Section 7.4 [RFC5905]) with kiss code "NTSN", meaning "NTS 877 negative-acknowledgment (NAK)". It MUST NOT include any NTS Cookie 878 or NTS Authenticator and Encrypted Extension Fields extension fields. 880 If the NTP server has previously responded with authentic NTS- 881 protected NTP packets (i.e., packets containing the NTS Authenticator 882 and Encrypted Extension Fields extension field), the client MUST 883 verify that any KoD packets received from the server contain the 884 Unique Identifier extension field and that the Unique Identifier 885 matches that of an outstanding request. If this check fails, the 886 packet MUST be discarded without further processing. If this check 887 passes, the client MUST comply with RFC 5095, Section 7.4 [RFC5905] 888 where required. A client MAY automatically re-run the NTS-KE 889 protocol upon forced disassociation from an NTP server. In that 890 case, it MUST be able to detect and stop looping between the NTS-KE 891 and NTP servers. 893 Upon reception of the NTS NAK kiss code, the client SHOULD wait until 894 the next poll for a valid NTS-protected response and if none is 895 received, initiate a fresh NTS-KE handshake to try to renegotiate new 896 cookies, AEAD keys, and parameters. If the NTS-KE handshake 897 succeeds, the client MUST discard all old cookies and parameters and 898 use the new ones instead. As long as the NTS-KE handshake has not 899 succeeded, the client SHOULD continue polling the NTP server using 900 the cookies and parameters it has. 902 The client MAY reuse cookies in order to prioritize resilience over 903 unlinkability. Which of the two that should be prioritized in any 904 particular case is dependent on the application and the user's 905 preference. Section 11.1 describes the privacy considerations of 906 this in further detail. 908 To allow for NTP session restart when the NTS-KE server is 909 unavailable and to reduce NTS-KE server load, the client SHOULD keep 910 at least one unused but recent cookie, AEAD keys, negotiated AEAD 911 algorithm, and other necessary parameters on persistent storage. 913 This way, the client is able to resume the NTP session without 914 performing renewed NTS-KE negotiation. 916 7. Suggested Format for NTS Cookies 918 This section is non-normative. It gives a suggested way for servers 919 to construct NTS cookies. All normative requirements are stated in 920 Section 4.1.6 and Section 5.3. 922 The role of cookies in NTS is closely analogous to that of session 923 cookies in TLS. Accordingly, the thematic resemblance of this 924 section to RFC 5077 [RFC5077] is deliberate and the reader should 925 likewise take heed of its security considerations. 927 Servers should select an AEAD algorithm which they will use to 928 encrypt and authenticate cookies. The chosen algorithm should be one 929 such as AEAD_AES_SIV_CMAC_256 [RFC5297] which resists accidental 930 nonce reuse. It need not be the same as the one that was negotiated 931 with the client. Servers should randomly generate and store a master 932 AEAD key `K`. Servers should additionally choose a non-secret, unique 933 value `I` as key-identifier for `K`. 935 Servers should periodically (e.g., once daily) generate a new pair 936 (I,K) and immediately switch to using these values for all newly- 937 generated cookies. Immediately following each such key rotation, 938 servers should securely erase any keys generated two or more rotation 939 periods prior. Servers should continue to accept any cookie 940 generated using keys that they have not yet erased, even if those 941 keys are no longer current. Erasing old keys provides for forward 942 secrecy, limiting the scope of what old information can be stolen if 943 a master key is somehow compromised. Holding on to a limited number 944 of old keys allows clients to seamlessly transition from one 945 generation to the next without having to perform a new NTS-KE 946 handshake. 948 The need to keep keys synchronized between NTS-KE and NTP servers as 949 well as across load-balanced clusters can make automatic key rotation 950 challenging. However, the task can be accomplished without the need 951 for central key-management infrastructure by using a ratchet, i.e., 952 making each new key a deterministic, cryptographically pseudo-random 953 function of its predecessor. A recommended concrete implementation 954 of this approach is to use HKDF [RFC5869] to derive new keys, using 955 the key's predecessor as Input Keying Material and its key identifier 956 as a salt. 958 To form a cookie, servers should first form a plaintext `P` 959 consisting of the following fields: 961 The AEAD algorithm negotiated during NTS-KE. 963 The S2C key. 965 The C2S key. 967 Servers should then generate a nonce `N` uniformly at random, and 968 form AEAD output `C` by encrypting `P` under key `K` with nonce `N` 969 and no associated data. 971 The cookie should consist of the tuple `(I,N,C)`. 973 To verify and decrypt a cookie provided by the client, first parse it 974 into its components `I`, `N`, and `C`. Use `I` to look up its 975 decryption key `K`. If the key whose identifier is `I` has been 976 erased or never existed, decryption fails; reply with an NTS NAK. 977 Otherwise, attempt to decrypt and verify ciphertext `C` using key `K` 978 and nonce `N` with no associated data. If decryption or verification 979 fails, reply with an NTS NAK. Otherwise, parse out the contents of 980 the resulting plaintext `P` to obtain the negotiated AEAD algorithm, 981 S2C key, and C2S key. 983 8. Usage of NTP pools 985 Many NTP server pools exist. Some of them have thousands of 986 individual servers spread out over several continents. Due to their 987 size and prevalence, it can be expected that a significant portion of 988 NTP users are users of NTP pools. 990 The separation of the initial NTS key exchange from the authenticated 991 NTP protocol simplifies the implementation of NTS on pool 992 infrastructures. Since NTS key exchange over TLS is expected to be a 993 rare occurrence in comparison with the normal authenticated NTP 994 request and response traffic, even large pools should require a 995 relatively small number of NTS-KE servers. This eliminates the need 996 for complex certificate infrastructures. The lower timing and 997 hardware requirements on NTS-KE servers also provide for load- 998 balancing solutions that aren't suitable for NTP servers, such as 999 virtual machine implementations that are started and stopped as 1000 needed. 1002 The ability for NTS-KE servers to freely choose what NTP servers they 1003 will issue cookies for means that each pool can implement whatever 1004 secret-sharing system between NTS-KE and NTP servers it deems 1005 suitable. For example, in a large pool where the trust in the 1006 individual NTP server administrators is relatively low, it may be 1007 necessary to have separate shared secrets for each possible pair of 1008 NTS-KE and NTP servers. It should also be noted that not all NTS-KE 1009 servers in a pool must have the ability to issue cookies for all NTP 1010 servers in that pool. 1012 Due to their freedom to choose what servers to issue cookies for, 1013 NTS-KE servers can perform a number of functions in addition to 1014 authenticating themselves to clients and issuing cookies. This 1015 includes load-balancing and geographic assignment of clients to NTP 1016 servers. 1018 9. IANA Considerations 1020 9.1. Service Name and Transport Protocol Port Number Registry 1022 IANA is requested to allocate two entries, identical except for the 1023 Transport Protocol, in the Service Name and Transport Protocol Port 1024 Number Registry [RFC6335] as follows: 1026 Service Name: nts 1028 Transport Protocol: tcp, udp 1030 Assignee: IESG 1032 Contact: IETF Chair 1034 Description: Network Time Security 1036 Reference: [[this memo]] 1038 Port Number: [[TBD1]], selected by IANA from the system port range 1040 9.2. TLS Application-Layer Protocol Negotiation (ALPN) Protocol IDs 1041 Registry 1043 IANA is requested to allocate the following entry in the TLS 1044 Application-Layer Protocol Negotiation (ALPN) Protocol IDs registry 1045 [RFC7301]: 1047 Protocol: Network Time Security Key Establishment, version 1 1049 Identification Sequence: 1050 0x6E 0x74 0x73 0x6B 0x65 0x2F 0x31 ("ntske/1") 1052 Reference: [[this memo]], Section 4 1054 9.3. TLS Exporter Labels Registry 1056 IANA is requested to allocate the following entry in the TLS Exporter 1057 Labels Registry [RFC5705]: 1059 +--------------------+---------+-------------+---------------+------+ 1060 | Value | DTLS-OK | Recommended | Reference | Note | 1061 +--------------------+---------+-------------+---------------+------+ 1062 | EXPORTER-network- | Y | Y | [[this | | 1063 | time-security/1 | | | memo]], | | 1064 | | | | Section 4.2 | | 1065 +--------------------+---------+-------------+---------------+------+ 1067 9.4. NTP Kiss-o'-Death Codes Registry 1069 IANA is requested to allocate the following entry in the registry of 1070 NTP Kiss-o'-Death Codes [RFC5905]: 1072 +------+----------------------------------------+-------------------+ 1073 | Code | Meaning | Reference | 1074 +------+----------------------------------------+-------------------+ 1075 | NTSN | Network Time Security (NTS) negative- | [[this memo]], | 1076 | | acknowledgment (NAK) | Section 6 | 1077 +------+----------------------------------------+-------------------+ 1079 9.5. NTP Extension Field Types Registry 1081 IANA is requested to allocate the following entries in the NTP 1082 Extension Field Types registry [RFC5905]: 1084 +----------+----------------------------------+---------------------+ 1085 | Field | Meaning | Reference | 1086 | Type | | | 1087 +----------+----------------------------------+---------------------+ 1088 | [[TBD2]] | Unique Identifier | [[this memo]], | 1089 | | | Section 5.2 | 1090 | [[TBD3]] | NTS Cookie | [[this memo]], | 1091 | | | Section 5.3 | 1092 | [[TBD4]] | NTS Cookie Placeholder | [[this memo]], | 1093 | | | Section 5.4 | 1094 | [[TBD5]] | NTS Authenticator and Encrypted | [[this memo]], | 1095 | | Extension Fields | Section 5.5 | 1096 +----------+----------------------------------+---------------------+ 1098 9.6. Network Time Security Key Establishment Record Types Registry 1100 IANA is requested to create a new registry entitled "Network Time 1101 Security Key Establishment Record Types". Entries SHALL have the 1102 following fields: 1104 Record Type Number (REQUIRED): An integer in the range 0-32767 1105 inclusive. 1107 Description (REQUIRED): A short text description of the purpose of 1108 the field. 1110 Set Critical Bit (REQUIRED): One of "MUST", "SHOULD", "MAY", 1111 "SHOULD NOT", or "MUST NOT". 1113 Reference (REQUIRED): A reference to a document specifying the 1114 semantics of the record. 1116 The policy for allocation of new entries in this registry SHALL vary 1117 by the Record Type Number, as follows: 1119 0-1023: IETF Review. 1121 1024-16383: Specification Required. 1123 16384-32767: Private and Experimental Use. 1125 Applications for new entries SHALL specify the contents of the 1126 Description, Set Critical Bit, and Reference fields as well as which 1127 of the above ranges the Record Type Number should be allocated from. 1128 Applicants MAY request a specific Record Type Number and such 1129 requests MAY be granted at the registrar's discretion. 1131 The initial contents of this registry SHALL be as follows: 1133 +-------------+----------------------+-----------+------------------+ 1134 | Record Type | Description | Set | Reference | 1135 | Number | | Critical | | 1136 | | | Bit | | 1137 +-------------+----------------------+-----------+------------------+ 1138 | 0 | End of Message | MUST | [[this memo]], | 1139 | | | | Section 4.1.1 | 1140 | 1 | NTS Next Protocol | MUST | [[this memo]], | 1141 | | Negotiation | | Section 4.1.2 | 1142 | 2 | Error | MUST | [[this memo]], | 1143 | | | | Section 4.1.3 | 1144 | 3 | Warning | MUST | [[this memo]], | 1145 | | | | Section 4.1.4 | 1146 | 4 | AEAD Algorithm | MAY | [[this memo]], | 1147 | | Negotiation | | Section 4.1.5 | 1148 | 5 | New Cookie for NTPv4 | SHOULD | [[this memo]], | 1149 | | | NOT | Section 4.1.6 | 1150 | 6 | NTP Server | SHOULD | [[this memo]], | 1151 | | Negotiation | | Section 4.1.7 | 1152 | 16384-32767 | Reserved for Private | MAY | [[this memo]] | 1153 | | & Experimental Use | | | 1154 +-------------+----------------------+-----------+------------------+ 1156 9.7. Network Time Security Next Protocols Registry 1158 IANA is requested to create a new registry entitled "Network Time 1159 Security Next Protocols". Entries SHALL have the following fields: 1161 Protocol ID (REQUIRED): An integer in the range 0-65535 inclusive, 1162 functioning as an identifier. 1164 Protocol Name (REQUIRED): A short text string naming the protocol 1165 being identified. 1167 Reference (RECOMMENDED): A reference to a relevant specification 1168 document. If no relevant document exists, a point-of-contact for 1169 questions regarding the entry SHOULD be listed here in lieu. 1171 Applications for new entries in this registry SHALL specify all 1172 desired fields and SHALL be granted upon approval by a Designated 1173 Expert. Protocol IDs 32768-65535 SHALL be reserved for Private or 1174 Experimental Use and SHALL NOT be registered. 1176 The initial contents of this registry SHALL be as follows: 1178 +-------------+-------------------------------+---------------------+ 1179 | Protocol ID | Protocol Name | Reference | 1180 +-------------+-------------------------------+---------------------+ 1181 | 0 | Network Time Protocol version | [[this memo]] | 1182 | | 4 (NTPv4) | | 1183 | 32768-65535 | Reserved for Private or | Reserved by [[this | 1184 | | Experimental Use | memo]] | 1185 +-------------+-------------------------------+---------------------+ 1187 9.8. Network Time Security Error and Warning Codes Registries 1189 IANA is requested to create two new registries entitled "Network Time 1190 Security Error Codes" and "Network Time Security Warning Codes". 1191 Entries in each SHALL have the following fields: 1193 Number (REQUIRED): An integer in the range 0-65535 inclusive 1195 Description (REQUIRED): A short text description of the condition. 1197 Reference (REQUIRED): A reference to a relevant specification 1198 document. 1200 The policy for allocation of new entries in these registries SHALL 1201 vary by their Number, as follows: 1203 0-1023: IETF Review. 1205 1024-32767: Specification Required. 1207 32768-65535: Private and Experimental Use. 1209 The initial contents of the Network Time Security Error Codes 1210 Registry SHALL be as follows: 1212 +--------+-----------------------------+----------------------------+ 1213 | Number | Description | Reference | 1214 +--------+-----------------------------+----------------------------+ 1215 | 0 | Unrecognized Critical | [[this memo]], Section | 1216 | | Extension | 4.1.3 | 1217 | 1 | Bad Request | [[this memo]], Section | 1218 | | | 4.1.3 | 1219 +--------+-----------------------------+----------------------------+ 1221 The Network Time Security Warning Codes Registry SHALL initially be 1222 empty. 1224 10. Security Considerations 1226 10.1. Sensitivity to DDoS attacks 1228 The introduction of NTS brings with it the introduction of asymmetric 1229 cryptography to NTP. Asymmetric cryptography is necessary for 1230 initial server authentication and AEAD key extraction. Asymmetric 1231 cryptosystems are generally orders of magnitude slower than their 1232 symmetric counterparts. This makes it much harder to build systems 1233 that can serve requests at a rate corresponding to the full line 1234 speed of the network connection. This, in turn, opens up a new 1235 possibility for DDoS attacks on NTP services. 1237 The main protection against these attacks in NTS lies in that the use 1238 of asymmetric cryptosystems is only necessary in the initial NTS-KE 1239 phase of the protocol. Since the protocol design enables separation 1240 of the NTS-KE and NTP servers, a successful DDoS attack on an NTS-KE 1241 server separated from the NTP service it supports will not affect NTP 1242 users that have already performed initial authentication, AEAD key 1243 extraction, and cookie exchange. Furthermore, as noted in Section 8, 1244 NTP-KE capacity is easier to scale up and down than NTP server 1245 capacity. 1247 NTS users should also consider that they are not fully protected 1248 against DDoS attacks by on-path adversaries. In addition to dropping 1249 packets and attacks such as those described in Section 10.4, an on- 1250 path attacker can send spoofed kiss-o'-death replies, which are not 1251 authenticated, in response to NTP requests. This could result in 1252 significantly increased load on the NTS-KE server. Implementers have 1253 to weigh the user's need for unlinkability against the added 1254 resilience that comes with cookie reuse in cases of NTS-KE server 1255 unavailability. 1257 10.2. Avoiding DDoS Amplification 1259 Certain non-standard and/or deprecated features of the Network Time 1260 Protocol enable clients to send a request to a server which causes 1261 the server to send a response much larger than the request. Servers 1262 which enable these features can be abused in order to amplify traffic 1263 volume in DDoS attacks by sending them a request with a spoofed 1264 source IP. In recent years, attacks of this nature have become an 1265 endemic nuisance. 1267 NTS is designed to avoid contributing any further to this problem by 1268 ensuring that NTS-related extension fields included in server 1269 responses will be the same size as the NTS-related extension fields 1270 sent by the client. In particular, this is why the client is 1271 required to send a separate and appropriately padded-out NTS Cookie 1272 Placeholder extension field for every cookie it wants to get back, 1273 rather than being permitted simply to specify a desired quantity. 1275 Due to the RFC 7822 [RFC7822] requirement that extensions be padded 1276 and aligned to four-octet boundaries, response size may still in some 1277 cases exceed request size by up to three octets. This is 1278 sufficiently inconsequential that we have declined to address it. 1280 10.3. Initial Verification of Server Certificates 1282 NTS's security goals are undermined if the client fails to verify 1283 that the X.509 certificate chain presented by the NTS-KE server is 1284 valid and rooted in a trusted certificate authority. RFC 5280 1285 [RFC5280] and RFC 6125 [RFC6125] specify how such verification is to 1286 be performed in general. However, the expectation that the client 1287 does not yet have a correctly-set system clock at the time of 1288 certificate verification presents difficulties with verifying that 1289 the certificate is within its validity period, i.e., that the current 1290 time lies between the times specified in the certificate's notBefore 1291 and notAfter fields. It may be operationally necessary in some cases 1292 for a client to accept a certificate which appears to be expired or 1293 not yet valid. While there is no perfect solution to this problem, 1294 there are several mitigations the client can implement to make it 1295 more difficult for an adversary to successfully present an expired 1296 certificate: 1298 Check whether the system time is in fact unreliable. If the 1299 system clock has previously been synchronized since last boot, 1300 then on operating systems which implement a kernel-based phase- 1301 locked-loop API, a call to ntp_gettime() should show a maximum 1302 error less than NTP_PHASE_MAX. In this case, the clock SHOULD be 1303 considered reliable and certificates can be strictly validated. 1305 Allow the system administrator to specify that certificates should 1306 *always* be strictly validated. Such a configuration is 1307 appropriate on systems which have a battery-backed clock and which 1308 can reasonably prompt the user to manually set an approximately- 1309 correct time if it appears to be needed. 1311 Once the clock has been synchronized, periodically write the 1312 current system time to persistent storage. Do not accept any 1313 certificate whose notAfter field is earlier than the last recorded 1314 time. 1316 Do not process time packets from servers if the time computed from 1317 them falls outside the validity period of the server's 1318 certificate. 1320 Use multiple time sources. The ability to pass off an expired 1321 certificate is only useful to an adversary who has compromised the 1322 corresponding private key. If the adversary has compromised only 1323 a minority of servers, NTP's selection algorithm (RFC 5905 section 1324 11.2.1 [RFC5905]) will protect the client from accepting bad time 1325 from the adversary-controlled servers. 1327 10.4. Delay Attacks 1329 In a packet delay attack, an adversary with the ability to act as a 1330 man-in-the-middle delays time synchronization packets between client 1331 and server asymmetrically [RFC7384]. Since NTP's formula for 1332 computing time offset relies on the assumption that network latency 1333 is roughly symmetrical, this leads to the client to compute an 1334 inaccurate value [Mizrahi]. The delay attack does not reorder or 1335 modify the content of the exchanged synchronization packets. 1336 Therefore, cryptographic means do not provide a feasible way to 1337 mitigate this attack. However, the maximum error that an adversary 1338 can introduce is bounded by half of the round trip delay. 1340 RFC 5905 [RFC5905] specifies a parameter called MAXDIST which denotes 1341 the maximum round-trip latency (including not only the immediate 1342 round trip between client and server, but the whole distance back to 1343 the reference clock as reported in the Root Delay field) that a 1344 client will tolerate before concluding that the server is unsuitable 1345 for synchronization. The standard value for MAXDIST is one second, 1346 although some implementations use larger values. Whatever value a 1347 client chooses, the maximum error which can be introduced by a delay 1348 attack is MAXDIST/2. 1350 Usage of multiple time sources, or multiple network paths to a given 1351 time source [Shpiner], may also serve to mitigate delay attacks if 1352 the adversary is in control of only some of the paths. 1354 10.5. Random Number Generation 1356 At various points in NTS, the generation of cryptographically secure 1357 random numbers is required. Whenever this draft specifies the use of 1358 random numbers, cryptographically secure random number generation 1359 MUST be used. RFC 4086 [RFC4086] contains guidelines concerning this 1360 topic. 1362 11. Privacy Considerations 1363 11.1. Unlinkability 1365 Unlinkability prevents a device from being tracked when it changes 1366 network addresses (e.g., because said device moved between different 1367 networks). In other words, unlinkability thwarts an attacker that 1368 seeks to link a new network address used by a device with a network 1369 address that it was formerly using through recognizable data that the 1370 device persistently sends as part of an NTS-secured NTP association. 1371 This is the justification for continually supplying the client with 1372 fresh cookies, so that a cookie never represents recognizable data in 1373 the sense outlined above. 1375 NTS's unlinkability objective is merely to not leak any additional 1376 data that could be used to link a device's network address. NTS does 1377 not rectify legacy linkability issues that are already present in 1378 NTP. Thus, a client that requires unlinkability must also minimize 1379 information transmitted in a client query (mode 3) packet as 1380 described in the NTP Client Data Minimization Internet-Draft 1381 [I-D.ietf-ntp-data-minimization]. 1383 The unlinkability objective only holds for time synchronization 1384 traffic, as opposed to key exchange traffic. This implies that it 1385 cannot be guaranteed for devices that function not only as time 1386 clients, but also as time servers (because the latter can be 1387 externally triggered to send authentication data). 1389 It should also be noted that it could be possible to link devices 1390 that operate as time servers from their time synchronization traffic, 1391 using information exposed in (mode 4) server response packets (e.g., 1392 reference ID, reference time, stratum, poll). Also, devices that 1393 respond to NTP control queries could be linked using the information 1394 revealed by control queries. 1396 11.2. Confidentiality 1398 NTS does not protect the confidentiality of information in NTP's 1399 header fields. When clients implement NTP Client Data Minimization 1400 [I-D.ietf-ntp-data-minimization], client packet headers do not 1401 contain any information which the client could conceivably wish to 1402 keep secret: one field is random and all others are fixed. 1403 Information in server packet headers is likewise public: the origin 1404 timestamp is copied from the client's (random) transmit timestamp and 1405 all other fields are set the same regardless of the identity of the 1406 client making the request. 1408 Future extension fields could hypothetically contain sensitive 1409 information, in which case NTS provides a mechanism for encrypting 1410 them. 1412 12. Acknowledgements 1414 The authors would like to thank Richard Barnes, Steven Bellovin, 1415 Scott Fluhrer, Sharon Goldberg, Russ Housley, Martin Langer, Miroslav 1416 Lichvar, Aanchal Malhotra, Dave Mills, Danny Mayer, Karen O'Donoghue, 1417 Eric K. Rescorla, Stephen Roettger, Kurt Roeckx, Kyle Rose, Rich 1418 Salz, Brian Sniffen, Susan Sons, Douglas Stebila, Harlan Stenn, 1419 Martin Thomson, and Richard Welty for contributions to this document 1420 and comments on the design of NTS. 1422 The idea of separation of the NTS-KE server from the NTP server was 1423 added by Marcus Dansarie and Ragnar Sundblad. Thanks for this work 1424 goes to Patrik Faeltstroem (Faltstrom) and Joachim Stroembergsson 1425 (Strombergsson) for review and ideas. 1427 13. References 1429 13.1. Normative References 1431 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 1432 DOI 10.17487/RFC0768, August 1980, 1433 . 1435 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1436 RFC 793, DOI 10.17487/RFC0793, September 1981, 1437 . 1439 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1440 Requirement Levels", BCP 14, RFC 2119, 1441 DOI 10.17487/RFC2119, March 1997, 1442 . 1444 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 1445 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 1446 2006, . 1448 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1449 Encryption", RFC 5116, DOI 10.17487/RFC5116, January 2008, 1450 . 1452 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 1453 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 1454 March 2010, . 1456 [RFC5905] Mills, D., Martin, J., Ed., Burbank, J., and W. Kasch, 1457 "Network Time Protocol Version 4: Protocol and Algorithms 1458 Specification", RFC 5905, DOI 10.17487/RFC5905, June 2010, 1459 . 1461 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1462 Verification of Domain-Based Application Service Identity 1463 within Internet Public Key Infrastructure Using X.509 1464 (PKIX) Certificates in the Context of Transport Layer 1465 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1466 2011, . 1468 [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. 1469 Cheshire, "Internet Assigned Numbers Authority (IANA) 1470 Procedures for the Management of the Service Name and 1471 Transport Protocol Port Number Registry", BCP 165, 1472 RFC 6335, DOI 10.17487/RFC6335, August 2011, 1473 . 1475 [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan, 1476 "Transport Layer Security (TLS) Application-Layer Protocol 1477 Negotiation Extension", RFC 7301, DOI 10.17487/RFC7301, 1478 July 2014, . 1480 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 1481 Suite Value (SCSV) for Preventing Protocol Downgrade 1482 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 1483 . 1485 [RFC7822] Mizrahi, T. and D. Mayer, "Network Time Protocol Version 4 1486 (NTPv4) Extension Fields", RFC 7822, DOI 10.17487/RFC7822, 1487 March 2016, . 1489 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1490 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, July 2018, 1491 . 1493 13.2. Informative References 1495 [I-D.ietf-ntp-data-minimization] 1496 Franke, D. and A. Malhotra, "NTP Client Data 1497 Minimization", draft-ietf-ntp-data-minimization-02 (work 1498 in progress), July 2018. 1500 [Mizrahi] Mizrahi, T., "A game theoretic analysis of delay attacks 1501 against time synchronization protocols", in Proceedings 1502 of Precision Clock Synchronization for Measurement Control 1503 and Communication, ISPCS 2012, pp. 1-6, September 2012. 1505 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 1506 "Randomness Requirements for Security", BCP 106, RFC 4086, 1507 DOI 10.17487/RFC4086, June 2005, 1508 . 1510 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1511 "Transport Layer Security (TLS) Session Resumption without 1512 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 1513 January 2008, . 1515 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1516 Housley, R., and W. Polk, "Internet X.509 Public Key 1517 Infrastructure Certificate and Certificate Revocation List 1518 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 1519 . 1521 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 1522 Authenticated Encryption Using the Advanced Encryption 1523 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 1524 2008, . 1526 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1527 Key Derivation Function (HKDF)", RFC 5869, 1528 DOI 10.17487/RFC5869, May 2010, 1529 . 1531 [RFC7384] Mizrahi, T., "Security Requirements of Time Protocols in 1532 Packet Switched Networks", RFC 7384, DOI 10.17487/RFC7384, 1533 October 2014, . 1535 [Shpiner] "Multi-path Time Protocols", in Proceedings of IEEE 1536 International Symposium on Precision Clock Synchronization 1537 for Measurement, Control and Communication (ISPCS), 1538 September 2013. 1540 Appendix A. Terms and Abbreviations 1542 AEAD Authenticated Encryption with Associated Data [RFC5116] 1544 ALPN Application-Layer Protocol Negotiation [RFC7301] 1546 C2S Client-to-server 1548 DDoS Distributed Denial-of-Service 1550 EF Extension Field [RFC5905] 1552 HKDF Hashed Message Authentication Code-based Key Derivation 1553 Function [RFC5869] 1555 IANA Internet Assigned Numbers Authority 1557 IP Internet Protocol 1558 KoD Kiss-o'-Death [RFC5905] 1560 NTP Network Time Protocol [RFC5905] 1562 NTS Network Time Security 1564 NTS-KE Network Time Security Key Exchange 1566 S2C Server-to-client 1568 SCSV Signaling Cipher Suite Value [RFC7507] 1570 TCP Transmission Control Protocol [RFC0793] 1572 TLS Transport Layer Security [RFC8446] 1574 UDP User Datagram Protocol [RFC0768] 1576 Authors' Addresses 1578 Daniel Fox Franke 1580 Email: dfoxfranke@gmail.com 1581 URI: https://www.dfranke.us 1583 Dieter Sibold 1584 Physikalisch-Technische Bundesanstalt 1585 Bundesallee 100 1586 Braunschweig D-38116 1587 Germany 1589 Phone: +49-(0)531-592-8420 1590 Fax: +49-531-592-698420 1591 Email: dieter.sibold@ptb.de 1593 Kristof Teichel 1594 Physikalisch-Technische Bundesanstalt 1595 Bundesallee 100 1596 Braunschweig D-38116 1597 Germany 1599 Phone: +49-(0)531-592-4471 1600 Email: kristof.teichel@ptb.de 1601 Marcus Dansarie 1603 Email: marcus@dansarie.se 1605 Ragnar Sundblad 1606 Netnod 1608 Email: ragge@netnod.se