idnits 2.17.1 draft-ietf-ipsecme-ikev2bis-10.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: ---------------------------------------------------------------------------- == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 8043 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. -- The draft header indicates that this document obsoletes RFC4306, but the abstract doesn't seem to directly say this. It does mention RFC4306 though, so this could be OK. -- The draft header indicates that this document obsoletes RFC4718, but the abstract doesn't seem to directly say this. It does mention RFC4718 though, so this could be OK. -- The abstract seems to indicate that this document updates RFC4306, but the header doesn't have an 'Updates:' line to match this. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 14, 2010) is 5118 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'CERTREQ' is mentioned on line 2364, but not defined == Missing Reference: 'KEi' is mentioned on line 7509, but not defined == Missing Reference: 'KEr' is mentioned on line 7512, but not defined == Missing Reference: 'CP' is mentioned on line 803, but not defined -- Looks like a reference, but probably isn't: '0' on line 4306 -- Looks like a reference, but probably isn't: '1' on line 4307 == Missing Reference: 'IKEv2' is mentioned on line 5819, but not defined == Missing Reference: 'IDr' is mentioned on line 6273, but not defined == Missing Reference: 'RFC5282' is mentioned on line 7124, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'IKEV2IANA' ** Obsolete normative reference: RFC 3447 (ref. 'PKCS1') (Obsoleted by RFC 8017) -- Obsolete informational reference (is this intentional?): RFC 4718 (ref. 'Clarif') (Obsoleted by RFC 5996) -- Obsolete informational reference (is this intentional?): RFC 2407 (ref. 'DOI') (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 5335 (ref. 'EAI') (Obsoleted by RFC 6532) -- Obsolete informational reference (is this intentional?): RFC 3490 (ref. 'IDNA') (Obsoleted by RFC 5890, RFC 5891) -- Obsolete informational reference (is this intentional?): RFC 2409 (ref. 'IKEV1') (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 4306 (ref. 'IKEV2') (Obsoleted by RFC 5996) -- Obsolete informational reference (is this intentional?): RFC 2401 (ref. 'IPSECARCH-OLD') (Obsoleted by RFC 4301) -- Obsolete informational reference (is this intentional?): RFC 2408 (ref. 'ISAKMP') (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 3775 (ref. 'MIPV6') (Obsoleted by RFC 6275) -- Obsolete informational reference (is this intentional?): RFC 4282 (ref. 'NAI') (Obsoleted by RFC 7542) Summary: 1 error (**), 0 flaws (~~), 11 warnings (==), 19 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group C. Kaufman 3 Internet-Draft Microsoft 4 Obsoletes: 4306, 4718 P. Hoffman 5 (if approved) VPN Consortium 6 Intended status: Standards Track Y. Nir 7 Expires: October 16, 2010 Check Point 8 P. Eronen 9 Nokia 10 April 14, 2010 12 Internet Key Exchange Protocol: IKEv2 13 draft-ietf-ipsecme-ikev2bis-10 15 Abstract 17 This document describes version 2 of the Internet Key Exchange (IKE) 18 protocol. IKE is a component of IPsec used for performing mutual 19 authentication and establishing and maintaining security associations 20 (SAs). This document replaces and updates RFC 4306, and includes all 21 of the clarifications from RFC 4718. 23 Status of this Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at http://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on October 16, 2010. 40 Copyright Notice 42 Copyright (c) 2010 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (http://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 This document may contain material from IETF Documents or IETF 56 Contributions published or made publicly available before November 57 10, 2008. The person(s) controlling the copyright in some of this 58 material may not have granted the IETF Trust the right to allow 59 modifications of such material outside the IETF Standards Process. 60 Without obtaining an adequate license from the person(s) controlling 61 the copyright in such materials, this document may not be modified 62 outside the IETF Standards Process, and derivative works of it may 63 not be created outside the IETF Standards Process, except to format 64 it for publication as an RFC or to translate it into languages other 65 than English. 67 Table of Contents 69 1. Introduction 70 1.1. Usage Scenarios 71 1.1.1. Security Gateway to Security Gateway Tunnel Mode 72 1.1.2. Endpoint-to-Endpoint Transport Mode 73 1.1.3. Endpoint to Security Gateway Tunnel Mode 74 1.1.4. Other Scenarios 75 1.2. The Initial Exchanges 76 1.3. The CREATE_CHILD_SA Exchange 77 1.3.1. Creating New Child SAs with the CREATE_CHILD_SA 78 Exchange 79 1.3.2. Rekeying IKE SAs with the CREATE_CHILD_SA Exchange 80 1.3.3. Rekeying Child SAs with the CREATE_CHILD_SA 81 Exchange 82 1.4. The INFORMATIONAL Exchange 83 1.4.1. Deleting an SA with INFORMATIONAL Exchanges 84 1.5. Informational Messages outside of an IKE SA 85 1.6. Requirements Terminology 86 1.7. Significant Differences Between RFC 4306 and This 87 Document 88 2. IKE Protocol Details and Variations 89 2.1. Use of Retransmission Timers 90 2.2. Use of Sequence Numbers for Message ID 91 2.3. Window Size for Overlapping Requests 92 2.4. State Synchronization and Connection Timeouts 93 2.5. Version Numbers and Forward Compatibility 94 2.6. IKE SA SPIs and Cookies 95 2.6.1. Interaction of COOKIE and INVALID_KE_PAYLOAD 96 2.7. Cryptographic Algorithm Negotiation 97 2.8. Rekeying 98 2.8.1. Simultaneous Child SA rekeying 99 2.8.2. Simultaneous IKE SA Rekeying 100 2.8.3. Rekeying the IKE SA Versus Reauthentication 101 2.9. Traffic Selector Negotiation 102 2.9.1. Traffic Selectors Violating Own Policy 103 2.10. Nonces 104 2.11. Address and Port Agility 105 2.12. Reuse of Diffie-Hellman Exponentials 106 2.13. Generating Keying Material 107 2.14. Generating Keying Material for the IKE SA 108 2.15. Authentication of the IKE SA 109 2.16. Extensible Authentication Protocol Methods 110 2.17. Generating Keying Material for Child SAs 111 2.18. Rekeying IKE SAs Using a CREATE_CHILD_SA Exchange 112 2.19. Requesting an Internal Address on a Remote Network 113 2.20. Requesting the Peer's Version 114 2.21. Error Handling 115 2.21.1. Error Handling in IKE_SA_INIT 116 2.21.2. Error Handling in IKE_AUTH 117 2.21.3. Error Handling after IKE SA is Authenticated 118 2.21.4. Error Handling Outside IKE SA 119 2.22. IPComp 120 2.23. NAT Traversal 121 2.23.1. Transport Mode NAT Traversal 122 2.24. Explicit Congestion Notification (ECN) 123 2.25. Exchange Collisions 124 2.25.1. Collisions While Rekeying or Closing Child SAs 125 2.25.2. Collisions While Rekeying or Closing IKE SAs 126 3. Header and Payload Formats 127 3.1. The IKE Header 128 3.2. Generic Payload Header 129 3.3. Security Association Payload 130 3.3.1. Proposal Substructure 131 3.3.2. Transform Substructure 132 3.3.3. Valid Transform Types by Protocol 133 3.3.4. Mandatory Transform IDs 134 3.3.5. Transform Attributes 135 3.3.6. Attribute Negotiation 136 3.4. Key Exchange Payload 137 3.5. Identification Payloads 138 3.6. Certificate Payload 139 3.7. Certificate Request Payload 140 3.8. Authentication Payload 141 3.9. Nonce Payload 142 3.10. Notify Payload 143 3.10.1. Notify Message Types 144 3.11. Delete Payload 145 3.12. Vendor ID Payload 146 3.13. Traffic Selector Payload 147 3.13.1. Traffic Selector 148 3.14. Encrypted Payload 149 3.15. Configuration Payload 150 3.15.1. Configuration Attributes 151 3.15.2. Meaning of INTERNAL_IP4_SUBNET and 152 INTERNAL_IP6_SUBNET 153 3.15.3. Configuration payloads for IPv6 154 3.15.4. Address Assignment Failures 155 3.16. Extensible Authentication Protocol (EAP) Payload 156 4. Conformance Requirements 157 5. Security Considerations 158 5.1. Traffic selector authorization 159 6. IANA Considerations 160 7. Acknowledgements 161 8. References 162 8.1. Normative References 163 8.2. Informative References 164 Appendix A. Summary of changes from IKEv1 165 Appendix B. Diffie-Hellman Groups 166 B.1. Group 1 - 768 Bit MODP 167 B.2. Group 2 - 1024 Bit MODP 168 Appendix C. Exchanges and Payloads 169 C.1. IKE_SA_INIT Exchange 170 C.2. IKE_AUTH Exchange without EAP 171 C.3. IKE_AUTH Exchange with EAP 172 C.4. CREATE_CHILD_SA Exchange for Creating or Rekeying 173 Child SAs 174 C.5. CREATE_CHILD_SA Exchange for Rekeying the IKE SA 175 C.6. INFORMATIONAL Exchange 176 Appendix D. Changes Between Internet Draft Versions 177 D.1. Changes from IKEv2 to draft -00 178 D.2. Changes from draft -00 to draft -01 179 D.3. Changes from draft -00 to draft -01 180 D.4. Changes from draft -01 to draft -02 181 D.5. Changes from draft -02 to draft -03 182 D.6. Changes from draft -03 to 183 draft-ietf-ipsecme-ikev2bis-00 184 D.7. Changes from draft-ietf-ipsecme-ikev2bis-00 to 185 draft-ietf-ipsecme-ikev2bis-01 186 D.8. Changes from draft-ietf-ipsecme-ikev2bis-01 to 187 draft-ietf-ipsecme-ikev2bis-02 188 D.9. Changes from draft-ietf-ipsecme-ikev2bis-01 to 189 draft-ietf-ipsecme-ikev2bis-02 190 D.10. Changes from draft-ietf-ipsecme-ikev2bis-02 to 191 draft-ietf-ipsecme-ikev2bis-03 192 D.11. Changes from draft-ietf-ipsecme-ikev2bis-03 to 193 draft-ietf-ipsecme-ikev2bis-04 194 D.12. Changes from draft-ietf-ipsecme-ikev2bis-04 to 195 draft-ietf-ipsecme-ikev2bis-05 196 D.13. Changes from draft-ietf-ipsecme-ikev2bis-05 to 197 draft-ietf-ipsecme-ikev2bis-06 198 D.14. Changes from draft-ietf-ipsecme-ikev2bis-06 to 199 draft-ietf-ipsecme-ikev2bis-07 200 D.15. Changes from draft-ietf-ipsecme-ikev2bis-07 to 201 draft-ietf-ipsecme-ikev2bis-08 202 D.16. Changes from draft-ietf-ipsecme-ikev2bis-08 to 203 draft-ietf-ipsecme-ikev2bis-09 204 D.17. Changes from draft-ietf-ipsecme-ikev2bis-09 to 205 draft-ietf-ipsecme-ikev2bis-10 206 Authors' Addresses 208 1. Introduction 210 IP Security (IPsec) provides confidentiality, data integrity, access 211 control, and data source authentication to IP datagrams. These 212 services are provided by maintaining shared state between the source 213 and the sink of an IP datagram. This state defines, among other 214 things, the specific services provided to the datagram, which 215 cryptographic algorithms will be used to provide the services, and 216 the keys used as input to the cryptographic algorithms. 218 Establishing this shared state in a manual fashion does not scale 219 well. Therefore, a protocol to establish this state dynamically is 220 needed. This document describes such a protocol -- the Internet Key 221 Exchange (IKE). Version 1 of IKE was defined in RFCs 2407 [DOI], 222 2408 [ISAKMP], and 2409 [IKEV1]. IKEv2 replaced all of those RFCs. 223 IKEv2 was defined in [IKEV2] (RFC 4306) and was clarified in [Clarif] 224 (RFC 4718). This document replaces and updates RFC 4306 and RFC 225 4718. IKEv2 was a change to the IKE protocol that was not backward 226 compatible. In contrast, the current document not only provides a 227 clarification of IKEv2, but makes minimum changes to the IKE 228 protocol. A list of the significant differences between RFC 4306 and 229 this document is given in Section 1.7. 231 IKE performs mutual authentication between two parties and 232 establishes an IKE security association (SA) that includes shared 233 secret information that can be used to efficiently establish SAs for 234 Encapsulating Security Payload (ESP) [ESP] or Authentication Header 235 (AH) [AH] and a set of cryptographic algorithms to be used by the SAs 236 to protect the traffic that they carry. In this document, the term 237 "suite" or "cryptographic suite" refers to a complete set of 238 algorithms used to protect an SA. An initiator proposes one or more 239 suites by listing supported algorithms that can be combined into 240 suites in a mix-and-match fashion. IKE can also negotiate use of IP 241 Compression (IPComp) [IP-COMP] in connection with an ESP or AH SA. 242 The SAs for ESP or AH that get set up through that IKE SA we call 243 "Child SAs". 245 All IKE communications consist of pairs of messages: a request and a 246 response. The pair is called an "exchange", and is sometimes called 247 "request/response pair". The first exchange of messages establishing 248 an IKE SA are called the IKE_SA_INIT and IKE_AUTH exchanges; 249 subsequent IKE exchanges are called the CREATE_CHILD_SA or 250 INFORMATIONAL exchanges. In the common case, there is a single 251 IKE_SA_INIT exchange and a single IKE_AUTH exchange (a total of four 252 messages) to establish the IKE SA and the first Child SA. In 253 exceptional cases, there may be more than one of each of these 254 exchanges. In all cases, all IKE_SA_INIT exchanges MUST complete 255 before any other exchange type, then all IKE_AUTH exchanges MUST 256 complete, and following that any number of CREATE_CHILD_SA and 257 INFORMATIONAL exchanges may occur in any order. In some scenarios, 258 only a single Child SA is needed between the IPsec endpoints, and 259 therefore there would be no additional exchanges. Subsequent 260 exchanges MAY be used to establish additional Child SAs between the 261 same authenticated pair of endpoints and to perform housekeeping 262 functions. 264 An IKE message flow always consists of a request followed by a 265 response. It is the responsibility of the requester to ensure 266 reliability. If the response is not received within a timeout 267 interval, the requester needs to retransmit the request (or abandon 268 the connection). 270 The first exchange of an IKE session, IKE_SA_INIT, negotiates 271 security parameters for the IKE SA, sends nonces, and sends Diffie- 272 Hellman values. 274 The second exchange, IKE_AUTH, transmits identities, proves knowledge 275 of the secrets corresponding to the two identities, and sets up an SA 276 for the first (and often only) AH or ESP Child SA (unless there is 277 failure setting up the AH or ESP Child SA, in which case the IKE SA 278 is still established without the Child SA). 280 The types of subsequent exchanges are CREATE_CHILD_SA (which creates 281 a Child SA) and INFORMATIONAL (which deletes an SA, reports error 282 conditions, or does other housekeeping). Every request requires a 283 response. An INFORMATIONAL request with no payloads (other than the 284 empty Encrypted payload required by the syntax) is commonly used as a 285 check for liveness. These subsequent exchanges cannot be used until 286 the initial exchanges have completed. 288 In the description that follows, we assume that no errors occur. 289 Modifications to the flow when errors occur are described in 290 Section 2.21. 292 1.1. Usage Scenarios 294 IKE is used to negotiate ESP or AH SAs in a number of different 295 scenarios, each with its own special requirements. 297 1.1.1. Security Gateway to Security Gateway Tunnel Mode 299 +-+-+-+-+-+ +-+-+-+-+-+ 300 | | IPsec | | 301 Protected |Tunnel | tunnel |Tunnel | Protected 302 Subnet <-->|Endpoint |<---------->|Endpoint |<--> Subnet 303 | | | | 304 +-+-+-+-+-+ +-+-+-+-+-+ 306 Figure 1: Security Gateway to Security Gateway Tunnel 308 In this scenario, neither endpoint of the IP connection implements 309 IPsec, but network nodes between them protect traffic for part of the 310 way. Protection is transparent to the endpoints, and depends on 311 ordinary routing to send packets through the tunnel endpoints for 312 processing. Each endpoint would announce the set of addresses 313 "behind" it, and packets would be sent in tunnel mode where the inner 314 IP header would contain the IP addresses of the actual endpoints. 316 1.1.2. Endpoint-to-Endpoint Transport Mode 318 +-+-+-+-+-+ +-+-+-+-+-+ 319 | | IPsec transport | | 320 |Protected| or tunnel mode SA |Protected| 321 |Endpoint |<---------------------------------------->|Endpoint | 322 | | | | 323 +-+-+-+-+-+ +-+-+-+-+-+ 325 Figure 2: Endpoint to Endpoint 327 In this scenario, both endpoints of the IP connection implement 328 IPsec, as required of hosts in [IPSECARCH]. Transport mode will 329 commonly be used with no inner IP header. A single pair of addresses 330 will be negotiated for packets to be protected by this SA. These 331 endpoints MAY implement application layer access controls based on 332 the IPsec authenticated identities of the participants. This 333 scenario enables the end-to-end security that has been a guiding 334 principle for the Internet since [ARCHPRINC], [TRANSPARENCY], and a 335 method of limiting the inherent problems with complexity in networks 336 noted by [ARCHGUIDEPHIL]. Although this scenario may not be fully 337 applicable to the IPv4 Internet, it has been deployed successfully in 338 specific scenarios within intranets using IKEv1. It should be more 339 broadly enabled during the transition to IPv6 and with the adoption 340 of IKEv2. 342 It is possible in this scenario that one or both of the protected 343 endpoints will be behind a network address translation (NAT) node, in 344 which case the tunneled packets will have to be UDP encapsulated so 345 that port numbers in the UDP headers can be used to identify 346 individual endpoints "behind" the NAT (see Section 2.23). 348 1.1.3. Endpoint to Security Gateway Tunnel Mode 350 +-+-+-+-+-+ +-+-+-+-+-+ 351 | | IPsec | | Protected 352 |Protected| tunnel |Tunnel | Subnet 353 |Endpoint |<------------------------>|Endpoint |<--- and/or 354 | | | | Internet 355 +-+-+-+-+-+ +-+-+-+-+-+ 357 Figure 3: Endpoint to Security Gateway Tunnel 359 In this scenario, a protected endpoint (typically a portable roaming 360 computer) connects back to its corporate network through an IPsec- 361 protected tunnel. It might use this tunnel only to access 362 information on the corporate network, or it might tunnel all of its 363 traffic back through the corporate network in order to take advantage 364 of protection provided by a corporate firewall against Internet-based 365 attacks. In either case, the protected endpoint will want an IP 366 address associated with the security gateway so that packets returned 367 to it will go to the security gateway and be tunneled back. This IP 368 address may be static or may be dynamically allocated by the security 369 gateway. In support of the latter case, IKEv2 includes a mechanism 370 (namely, configuration payloads) for the initiator to request an IP 371 address owned by the security gateway for use for the duration of its 372 SA. 374 In this scenario, packets will use tunnel mode. On each packet from 375 the protected endpoint, the outer IP header will contain the source 376 IP address associated with its current location (i.e., the address 377 that will get traffic routed to the endpoint directly), while the 378 inner IP header will contain the source IP address assigned by the 379 security gateway (i.e., the address that will get traffic routed to 380 the security gateway for forwarding to the endpoint). The outer 381 destination address will always be that of the security gateway, 382 while the inner destination address will be the ultimate destination 383 for the packet. 385 In this scenario, it is possible that the protected endpoint will be 386 behind a NAT. In that case, the IP address as seen by the security 387 gateway will not be the same as the IP address sent by the protected 388 endpoint, and packets will have to be UDP encapsulated in order to be 389 routed properly. Interaction with NATs is covered in detail in 390 Section 2.23. 392 1.1.4. Other Scenarios 394 Other scenarios are possible, as are nested combinations of the 395 above. One notable example combines aspects of 1.1.1 and 1.1.3. A 396 subnet may make all external accesses through a remote security 397 gateway using an IPsec tunnel, where the addresses on the subnet are 398 routed to the security gateway by the rest of the Internet. An 399 example would be someone's home network being virtually on the 400 Internet with static IP addresses even though connectivity is 401 provided by an ISP that assigns a single dynamically assigned IP 402 address to the user's security gateway (where the static IP addresses 403 and an IPsec relay are provided by a third party located elsewhere). 405 1.2. The Initial Exchanges 407 Communication using IKE always begins with IKE_SA_INIT and IKE_AUTH 408 exchanges (known in IKEv1 as Phase 1). These initial exchanges 409 normally consist of four messages, though in some scenarios that 410 number can grow. All communications using IKE consist of request/ 411 response pairs. We'll describe the base exchange first, followed by 412 variations. The first pair of messages (IKE_SA_INIT) negotiate 413 cryptographic algorithms, exchange nonces, and do a Diffie-Hellman 414 exchange [DH]. 416 The second pair of messages (IKE_AUTH) authenticate the previous 417 messages, exchange identities and certificates, and establish the 418 first Child SA. Parts of these messages are encrypted and integrity 419 protected with keys established through the IKE_SA_INIT exchange, so 420 the identities are hidden from eavesdroppers and all fields in all 421 the messages are authenticated. See Section 2.14 for information on 422 how the encryption keys are generated. (A man-in-the-middle who 423 cannot complete the IKE_AUTH exchange can nonetheless see the 424 identity of the initiator.) 426 All messages following the initial exchange are cryptographically 427 protected using the cryptographic algorithms and keys negotiated in 428 the IKE_SA_INIT exchange. These subsequent messages use the syntax 429 of the Encrypted Payload described in Section 3.14, encrypted with 430 keys that are derived as described in Section 2.14. All subsequent 431 messages include an Encrypted Payload, even if they are referred to 432 in the text as "empty". For the CREATE_CHILD_SA, IKE_AUTH, or 433 INFORMATIONAL exchanges, the message following the header is 434 encrypted and the message including the header is integrity protected 435 using the cryptographic algorithms negotiated for the IKE SA. 437 Every IKE message contains a Message ID as part of its fixed header. 438 This Message ID is used to match up requests and responses, and to 439 identify retransmissions of messages. 441 In the following descriptions, the payloads contained in the message 442 are indicated by names as listed below. 444 Notation Payload 445 ----------------------------------------- 446 AUTH Authentication 447 CERT Certificate 448 CERTREQ Certificate Request 449 CP Configuration 450 D Delete 451 EAP Extensible Authentication 452 HDR IKE Header (not a payload) 453 IDi Identification - Initiator 454 IDr Identification - Responder 455 KE Key Exchange 456 Ni, Nr Nonce 457 N Notify 458 SA Security Association 459 SK Encrypted and Authenticated 460 TSi Traffic Selector - Initiator 461 TSr Traffic Selector - Responder 462 V Vendor ID 464 The details of the contents of each payload are described in section 465 3. Payloads that may optionally appear will be shown in brackets, 466 such as [CERTREQ]; this indicates that a certificate request payload 467 can optionally be included. 469 The initial exchanges are as follows: 471 Initiator Responder 472 ------------------------------------------------------------------- 473 HDR, SAi1, KEi, Ni --> 475 HDR contains the Security Parameter Indexes (SPIs), version numbers, 476 and flags of various sorts. The SAi1 payload states the 477 cryptographic algorithms the initiator supports for the IKE SA. The 478 KE payload sends the initiator's Diffie-Hellman value. Ni is the 479 initiator's nonce. 481 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 483 The responder chooses a cryptographic suite from the initiator's 484 offered choices and expresses that choice in the SAr1 payload, 485 completes the Diffie-Hellman exchange with the KEr payload, and sends 486 its nonce in the Nr payload. 488 At this point in the negotiation, each party can generate SKEYSEED, 489 from which all keys are derived for that IKE SA. The messages that 490 follow are encrypted and integrity protected in their entirety, with 491 the exception of the message headers. The keys used for the 492 encryption and integrity protection are derived from SKEYSEED and are 493 known as SK_e (encryption) and SK_a (authentication, a.k.a. integrity 494 protection); see Section 2.13 and Section 2.14 for details on the key 495 derivation. A separate SK_e and SK_a is computed for each direction. 496 In addition to the keys SK_e and SK_a derived from the Diffie-Hellman 497 value for protection of the IKE SA, another quantity SK_d is derived 498 and used for derivation of further keying material for Child SAs. 499 The notation SK { ... } indicates that these payloads are encrypted 500 and integrity protected using that direction's SK_e and SK_a. 502 HDR, SK {IDi, [CERT,] [CERTREQ,] 503 [IDr,] AUTH, SAi2, 504 TSi, TSr} --> 506 The initiator asserts its identity with the IDi payload, proves 507 knowledge of the secret corresponding to IDi and integrity protects 508 the contents of the first message using the AUTH payload (see 509 Section 2.15). It might also send its certificate(s) in CERT 510 payload(s) and a list of its trust anchors in CERTREQ payload(s). If 511 any CERT payloads are included, the first certificate provided MUST 512 contain the public key used to verify the AUTH field. 514 The optional payload IDr enables the initiator to specify which of 515 the responder's identities it wants to talk to. This is useful when 516 the machine on which the responder is running is hosting multiple 517 identities at the same IP address. If the IDr proposed by the 518 initiator is not acceptable to the responder, the responder might use 519 some other IDr to finish the exchange. If the initiator then does 520 not accept the fact that responder used an IDr different than the one 521 that was requested, the initiator can close the SA after noticing the 522 fact. 524 The traffic selectors (TSi and TSr) are discussed in Section 2.9. 526 The initiator begins negotiation of a Child SA using the SAi2 527 payload. The final fields (starting with SAi2) are described in the 528 description of the CREATE_CHILD_SA exchange. 530 <-- HDR, SK {IDr, [CERT,] AUTH, 531 SAr2, TSi, TSr} 533 The responder asserts its identity with the IDr payload, optionally 534 sends one or more certificates (again with the certificate containing 535 the public key used to verify AUTH listed first), authenticates its 536 identity and protects the integrity of the second message with the 537 AUTH payload, and completes negotiation of a Child SA with the 538 additional fields described below in the CREATE_CHILD_SA exchange. 540 Both parties in the IKE_AUTH exchange MUST verify that all signatures 541 and MACs are computed correctly. If either side uses a shared secret 542 for authentication, the names in the ID payload MUST correspond to 543 the key used to generate the AUTH payload. 545 Because the initiator sends its Diffie-Hellman value in the 546 IKE_SA_INIT, it must guess the Diffie-Hellman group that the 547 responder will select from its list of supported groups. If the 548 initiator guesses wrong, the responder will respond with a Notify 549 payload of type INVALID_KE_PAYLOAD indicating the selected group. In 550 this case, the initiator MUST retry the IKE_SA_INIT with the 551 corrected Diffie-Hellman group. The initiator MUST again propose its 552 full set of acceptable cryptographic suites because the rejection 553 message was unauthenticated and otherwise an active attacker could 554 trick the endpoints into negotiating a weaker suite than a stronger 555 one that they both prefer. 557 If creating the Child SA during the IKE_AUTH exchange fails for some 558 reason, the IKE SA is still created as usual. The list of Notify 559 message types in the IKE_AUTH exchange that do not prevent an IKE SA 560 from being set up include at least the following: NO_PROPOSAL_CHOSEN, 561 TS_UNACCEPTABLE, SINGLE_PAIR_REQUIRED, INTERNAL_ADDRESS_FAILURE, and 562 FAILED_CP_REQUIRED. 564 If the failure is related to creating the IKE SA (for example, an 565 AUTHENTICATION_FAILED Notify error message is returned), the IKE SA 566 is not created. Note that although the IKE_AUTH messages are 567 encrypted and integrity protected, if the peer receiving this Notify 568 error message has not yet authenticated the other end (or if the peer 569 fails to authenticate the other end for some reason), the information 570 needs to be treated with caution. More precisely, assuming that the 571 MAC verifies correctly, the sender of the error Notify message is 572 known to be the responder of the IKE_SA_INIT exchange, but the 573 sender's identity cannot be assured. 575 Note that IKE_AUTH messages do not contain KEi/KEr or Ni/Nr payloads. 576 Thus, the SA payloads in the IKE_AUTH exchange cannot contain 577 Transform Type 4 (Diffie-Hellman Group) with any value other than 578 NONE. Implementations SHOULD omit the whole transform substructure 579 instead of sending value NONE. 581 1.3. The CREATE_CHILD_SA Exchange 583 The CREATE_CHILD_SA exchange is used to create new Child SAs and to 584 rekey both IKE SAs and Child SAs. This exchange consists of a single 585 request/response pair, and some of its function was referred to as a 586 phase 2 exchange in IKEv1. It MAY be initiated by either end of the 587 IKE SA after the initial exchanges are completed. 589 An SA is rekeyed by creating a new SA and then deleting the old one. 590 This section describes the first part of rekeying, the creation of 591 new SAs; Section 2.8 covers the mechanics of rekeying, including 592 moving traffic from old to new SAs and the deletion of the old SAs. 593 The two sections must be read together to understand the entire 594 process of rekeying. 596 Either endpoint may initiate a CREATE_CHILD_SA exchange, so in this 597 section the term initiator refers to the endpoint initiating this 598 exchange. An implementation MAY refuse all CREATE_CHILD_SA requests 599 within an IKE SA. 601 The CREATE_CHILD_SA request MAY optionally contain a KE payload for 602 an additional Diffie-Hellman exchange to enable stronger guarantees 603 of forward secrecy for the Child SA. The keying material for the 604 Child SA is a function of SK_d established during the establishment 605 of the IKE SA, the nonces exchanged during the CREATE_CHILD_SA 606 exchange, and the Diffie-Hellman value (if KE payloads are included 607 in the CREATE_CHILD_SA exchange). 609 If a CREATE_CHILD_SA exchange includes a KEi payload, at least one of 610 the SA offers MUST include the Diffie-Hellman group of the KEi. The 611 Diffie-Hellman group of the KEi MUST be an element of the group the 612 initiator expects the responder to accept (additional Diffie-Hellman 613 groups can be proposed). If the responder selects a proposal using a 614 different Diffie-Hellman group (other than NONE), the responder MUST 615 reject the request and indicate its preferred Diffie-Hellman group in 616 the INVALID_KE_PAYLOAD Notify payload. There are two octets of data 617 associated with this notification: the accepted Diffie-Hellman Group 618 number in big endian order. In the case of such a rejection, the 619 CREATE_CHILD_SA exchange fails, and the initiator will probably retry 620 the exchange with a Diffie-Hellman proposal and KEi in the group that 621 the responder gave in the INVALID_KE_PAYLOAD Notify payload. 623 The responder sends a NO_ADDITIONAL_SAS notification to indicate that 624 a CREATE_CHILD_SA request is unacceptable because the responder is 625 unwilling to accept any more Child SAs on this IKE SA. This 626 notification can also be used to reject IKE SA rekey. Some minimal 627 implementations may only accept a single Child SA setup in the 628 context of an initial IKE exchange and reject any subsequent attempts 629 to add more. 631 1.3.1. Creating New Child SAs with the CREATE_CHILD_SA Exchange 633 A Child SA may be created by sending a CREATE_CHILD_SA request. The 634 CREATE_CHILD_SA request for creating a new Child SA is: 636 Initiator Responder 637 ------------------------------------------------------------------- 638 HDR, SK {SA, Ni, [KEi], 639 TSi, TSr} --> 641 The initiator sends SA offer(s) in the SA payload, a nonce in the Ni 642 payload, optionally a Diffie-Hellman value in the KEi payload, and 643 the proposed traffic selectors for the proposed Child SA in the TSi 644 and TSr payloads. 646 The CREATE_CHILD_SA response for creating a new Child SA is: 648 <-- HDR, SK {SA, Nr, [KEr], 649 TSi, TSr} 651 The responder replies (using the same Message ID to respond) with the 652 accepted offer in an SA payload, and a Diffie-Hellman value in the 653 KEr payload if KEi was included in the request and the selected 654 cryptographic suite includes that group. 656 The traffic selectors for traffic to be sent on that SA are specified 657 in the TS payloads in the response, which may be a subset of what the 658 initiator of the Child SA proposed. 660 The USE_TRANSPORT_MODE notification MAY be included in a request 661 message that also includes an SA payload requesting a Child SA. It 662 requests that the Child SA use transport mode rather than tunnel mode 663 for the SA created. If the request is accepted, the response MUST 664 also include a notification of type USE_TRANSPORT_MODE. If the 665 responder declines the request, the Child SA will be established in 666 tunnel mode. If this is unacceptable to the initiator, the initiator 667 MUST delete the SA. Note: Except when using this option to negotiate 668 transport mode, all Child SAs will use tunnel mode. 670 The ESP_TFC_PADDING_NOT_SUPPORTED notification asserts that the 671 sending endpoint will not accept packets that contain Traffic Flow 672 Confidentiality (TFC) padding over the Child SA being negotiated. If 673 neither endpoint accepts TFC padding, this notification is included 674 in both the request and the response. If this notification is 675 included in only one of the messages, TFC padding can still be sent 676 in the other direction. 678 The NON_FIRST_FRAGMENTS_ALSO notification is used for fragmentation 679 control. See [IPSECARCH] for a fuller explanation. Both parties 680 need to agree to sending non-first fragments before either party does 681 so. It is enabled only if NON_FIRST_FRAGMENTS_ALSO notification is 682 included in both the request proposing an SA and the response 683 accepting it. If the responder does not want to send or receive non- 684 first fragments, it only omits NON_FIRST_FRAGMENTS_ALSO notification 685 from its response, but does not reject the whole Child SA creation. 687 An IPCOMP_SUPPORTED notification, covered in Section 2.22, can also 688 be included in the exchange. 690 A failed attempt to create a Child SA SHOULD NOT tear down the IKE 691 SA: there is no reason to lose the work done to set up the IKE SA. 692 See Section 2.21 for a list of error messages that might occur if 693 creating a Child SA fails. 695 1.3.2. Rekeying IKE SAs with the CREATE_CHILD_SA Exchange 697 The CREATE_CHILD_SA request for rekeying an IKE SA is: 699 Initiator Responder 700 ------------------------------------------------------------------- 701 HDR, SK {SA, Ni, KEi} --> 703 The initiator sends SA offer(s) in the SA payload, a nonce in the Ni 704 payload, and a Diffie-Hellman value in the KEi payload. The KEi 705 payload MUST be included. A new initiator SPI is supplied in the SPI 706 field of the SA payload. Once a peer receives a request to rekey an 707 IKE SA or sends a request to rekey an IKE SA, it SHOULD NOT start any 708 new CREATE_CHILD_SA exchanges on the IKE SA that is being rekeyed. 710 The CREATE_CHILD_SA response for rekeying an IKE SA is: 712 <-- HDR, SK {SA, Nr, KEr} 714 The responder replies (using the same Message ID to respond) with the 715 accepted offer in an SA payload, and a Diffie-Hellman value in the 716 KEr payload if the selected cryptographic suite includes that group. 717 A new responder SPI is supplied in the SPI field of the SA payload. 719 The new IKE SA has its message counters set to 0, regardless of what 720 they were in the earlier IKE SA. The first IKE requests from both 721 sides on the new IKE SA will have message ID 0. The old IKE SA 722 retains its numbering, so any further requests (for example, to 723 delete the IKE SA) will have consecutive numbering. The new IKE SA 724 also has its window size reset to 1, and the initiator in this rekey 725 exchange is the new "original initiator" of the new IKE SA. 727 Section 2.18 also covers IKE SA rekeying in detail. 729 1.3.3. Rekeying Child SAs with the CREATE_CHILD_SA Exchange 731 The CREATE_CHILD_SA request for rekeying a Child SA is: 733 Initiator Responder 734 ------------------------------------------------------------------- 735 HDR, SK {N(REKEY_SA), SA, Ni, [KEi], 736 TSi, TSr} --> 738 The initiator sends SA offer(s) in the SA payload, a nonce in the Ni 739 payload, optionally a Diffie-Hellman value in the KEi payload, and 740 the proposed traffic selectors for the proposed Child SA in the TSi 741 and TSr payloads. 743 The notifications described in Section 1.3.1 may also be sent in a 744 rekeying exchange. Usually these will be the same notifications that 745 were used in the original exchange; for example, when rekeying a 746 transport mode SA, the USE_TRANSPORT_MODE notification will be used. 748 The REKEY_SA notification MUST be included in a CREATE_CHILD_SA 749 exchange if the purpose of the exchange is to replace an existing ESP 750 or AH SA. The SA being rekeyed is identified by the SPI field in the 751 Notify payload; this is the SPI the exchange initiator would expect 752 in inbound ESP or AH packets. There is no data associated with this 753 Notify message type. The Protocol ID field of the REKEY_SA 754 notification is set to match the protocol of the SA we are rekeying, 755 for example, 3 for ESP and 2 for AH. 757 The CREATE_CHILD_SA response for rekeying a Child SA is: 759 <-- HDR, SK {SA, Nr, [KEr], 760 TSi, TSr} 762 The responder replies (using the same Message ID to respond) with the 763 accepted offer in an SA payload, and a Diffie-Hellman value in the 764 KEr payload if KEi was included in the request and the selected 765 cryptographic suite includes that group. 767 The traffic selectors for traffic to be sent on that SA are specified 768 in the TS payloads in the response, which may be a subset of what the 769 initiator of the Child SA proposed. 771 1.4. The INFORMATIONAL Exchange 773 At various points during the operation of an IKE SA, peers may desire 774 to convey control messages to each other regarding errors or 775 notifications of certain events. To accomplish this, IKE defines an 776 INFORMATIONAL exchange. INFORMATIONAL exchanges MUST ONLY occur 777 after the initial exchanges and are cryptographically protected with 778 the negotiated keys. Note that some informational messages, not 779 exchanges, can be sent outside the context of an IKE SA. Section 780 2.21 also covers error messages in great detail. 782 Control messages that pertain to an IKE SA MUST be sent under that 783 IKE SA. Control messages that pertain to Child SAs MUST be sent 784 under the protection of the IKE SA which generated them (or its 785 successor if the IKE SA was rekeyed). 787 Messages in an INFORMATIONAL exchange contain zero or more 788 Notification, Delete, and Configuration payloads. The recipient of 789 an INFORMATIONAL exchange request MUST send some response; otherwise, 790 the sender will assume the message was lost in the network and will 791 retransmit it. That response MAY be an empty message. The request 792 message in an INFORMATIONAL exchange MAY also contain no payloads. 793 This is the expected way an endpoint can ask the other endpoint to 794 verify that it is alive. 796 The INFORMATIONAL exchange is defined as: 798 Initiator Responder 799 ------------------------------------------------------------------- 800 HDR, SK {[N,] [D,] 801 [CP,] ...} --> 802 <-- HDR, SK {[N,] [D,] 803 [CP], ...} 805 The processing of an INFORMATIONAL exchange is determined by its 806 component payloads. 808 1.4.1. Deleting an SA with INFORMATIONAL Exchanges 810 ESP and AH SAs always exist in pairs, with one SA in each direction. 811 When an SA is closed, both members of the pair MUST be closed (that 812 is, deleted). Each endpoint MUST close its incoming SAs and allow 813 the other endpoint to close the other SA in each pair. To delete an 814 SA, an INFORMATIONAL exchange with one or more Delete payloads is 815 sent listing the SPIs (as they would be expected in the headers of 816 inbound packets) of the SAs to be deleted. The recipient MUST close 817 the designated SAs. Note that one never sends delete payloads for 818 the two sides of an SA in a single message. If there are many SAs to 819 delete at the same time, one includes Delete payloads for the inbound 820 half of each SA pair in the INFORMATIONAL exchange. 822 Normally, the response in the INFORMATIONAL exchange will contain 823 delete payloads for the paired SAs going in the other direction. 824 There is one exception. If by chance both ends of a set of SAs 825 independently decide to close them, each may send a delete payload 826 and the two requests may cross in the network. If a node receives a 827 delete request for SAs for which it has already issued a delete 828 request, it MUST delete the outgoing SAs while processing the request 829 and the incoming SAs while processing the response. In that case, 830 the responses MUST NOT include delete payloads for the deleted SAs, 831 since that would result in duplicate deletion and could in theory 832 delete the wrong SA. 834 Similar to ESP and AH SAs, IKE SAs are also deleted by sending an 835 Informational exchange. Deleting an IKE SA implicitly closes any 836 remaining Child SAs negotiated under it. The response to a request 837 that deletes the IKE SA is an empty INFORMATIONAL response. 839 Half-closed ESP or AH connections are anomalous, and a node with 840 auditing capability should probably audit their existence if they 841 persist. Note that this specification does not specify time periods, 842 so it is up to individual endpoints to decide how long to wait. A 843 node MAY refuse to accept incoming data on half-closed connections 844 but MUST NOT unilaterally close them and reuse the SPIs. If 845 connection state becomes sufficiently messed up, a node MAY close the 846 IKE SA, as described above. It can then rebuild the SAs it needs on 847 a clean base under a new IKE SA. 849 1.5. Informational Messages outside of an IKE SA 851 There are some cases in which a node receives a packet that it cannot 852 process, but it may want to notify the sender about this situation. 854 o If an ESP or AH packet arrives with an unrecognized SPI. This 855 might be due to the receiving node having recently crashed and 856 lost state, or because of some other system malfunction or attack. 858 o If an encrypted IKE request packet arrives on port 500 or 4500 859 with an unrecognized IKE SPI. This might be due to the receiving 860 node having recently crashed and lost state, or because of some 861 other system malfunction or attack. 863 o If an IKE request packet arrives with a higher major version 864 number than the implementation supports. 866 In the first case, if the receiving node has an active IKE SA to the 867 IP address from whence the packet came, it MAY send an INVALID_SPI 868 notification of the wayward packet over that IKE SA in an 869 INFORMATIONAL exchange. The Notification Data contains the SPI of 870 the invalid packet. The recipient of this notification cannot tell 871 whether the SPI is for AH or ESP, but this is not important because 872 the SPIs are supposed to be different for the two. If no suitable 873 IKE SA exists, the node MAY send an informational message without 874 cryptographic protection to the source IP address, using the source 875 UDP port as the destination port if the packet was UDP (UDP- 876 encapsulated ESP or AH). In this case, it should only be used by the 877 recipient as a hint that something might be wrong (because it could 878 easily be forged). This message is not part of an INFORMATIONAL 879 exchange, and the receiving node MUST NOT respond to it because doing 880 so could cause a message loop. The message is constructed as 881 follows: there are no IKE SPI values that would be meaningful to the 882 recipient of such a notification; using zero values or random values 883 are both acceptable, this being the exception to the rule in 884 Section 3.1 that prohibits zero IKE Initiator SPIs. The Initiator 885 flag is set to 1, the Response flag is set to 0, and the version 886 flags are set in the normal fashion; these flags are described in 887 Section 3.1. 889 In the second and third cases, the message is always sent without 890 cryptographic protection (outside of an IKE SA), and includes either 891 an INVALID_IKE_SPI or an INVALID_MAJOR_VERSION notification (with no 892 notification data). The message is a response message, and thus it 893 is sent to the IP address and port from whence it came with the same 894 IKE SPIs and the Message ID and Exchange Type are copied from the 895 request. The Response flag is set to 1, and the version flags are 896 set in the normal fashion. 898 1.6. Requirements Terminology 900 Definitions of the primitive terms in this document (such as Security 901 Association or SA) can be found in [IPSECARCH]. It should be noted 902 that parts of IKEv2 rely on some of the processing rules in 903 [IPSECARCH], as described in various sections of this document. 905 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 906 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 907 document are to be interpreted as described in [MUSTSHOULD]. 909 1.7. Significant Differences Between RFC 4306 and This Document 911 This document contains clarifications and amplifications to IKEv2 912 [IKEV2]. The clarifications are mostly based on [Clarif]. The 913 changes listed in that document were discussed in the IPsec Working 914 Group and, after the Working Group was disbanded, on the IPsec 915 mailing list. That document contains detailed explanations of areas 916 that were unclear in IKEv2, and is thus useful to implementers of 917 IKEv2. 919 The protocol described in this document retains the same major 920 version number (2) and minor version number (0) as was used in RFC 921 4306. That is, the version number is *not* changed from RFC 4306. 923 This document makes the figures and references a bit more consistent 924 than they were in [IKEV2]. 926 IKEv2 developers have noted that the SHOULD-level requirements in RFC 927 4306 are often unclear in that they don't say when it is OK to not 928 obey the requirements. They also have noted that there are MUST- 929 level requirements that are not related to interoperability. This 930 document has more explanation of some of these requirements. All 931 non-capitalized uses of the words SHOULD and MUST now mean their 932 normal English sense, not the interoperability sense of [MUSTSHOULD]. 934 IKEv2 (and IKEv1) developers have noted that there is a great deal of 935 material in the tables of codes in Section 3.10.1 in RFC 4306. This 936 leads to implementers not having all the needed information in the 937 main body of the document. Much of the material from those tables 938 has been moved into the associated parts of the main body of the 939 document. 941 This document removes discussion of nesting AH and ESP. This was a 942 mistake in RFC 4306 caused by the lag between finishing RFC 4306 and 943 RFC 4301. Basically, IKEv2 is based on RFC 4301, which does not 944 include "SA bundles" that were part of RFC 2401. While a single 945 packet can go through IPsec processing multiple times, each of these 946 passes uses a separate SA, and the passes are coordinated by the 947 forwarding tables. In IKEv2, each of these SAs has to be created 948 using a separate CREATE_CHILD_SA exchange. 950 This document removes discussion of the INTERNAL_ADDRESS_EXPIRY 951 configuration attribute because its implementation was very 952 problematic. Implementations that conform to this document MUST 953 ignore proposals that have configuration attribute type 5, the old 954 value for INTERNAL_ADDRESS_EXPIRY. This document also removed 955 INTERNAL_IP6_NBNS as a configuration attribute. 957 This document removes the allowance for rejecting messages where the 958 payloads were not in the "right" order; now implementations MUST NOT 959 reject them. This is due to the lack of clarity where the orders for 960 the payloads are described. 962 The lists of items from RFC 4306 that ended up in the IANA registry 963 were trimmed to only include items that were actually defined in RFC 964 4306. Also, many of those lists are now preceded with the very 965 important instruction to developers that they really should look at 966 the IANA registry at the time of development because new items have 967 been added since RFC 4306. 969 This document adds clarification on when notifications are and are 970 not sent encrypted, depending on the state of the negotiation at the 971 time. 973 This document discusses more about how to negotiate combined-mode 974 ciphers. 976 In section 1.3.2, changed "The KEi payload SHOULD be included" to be 977 "The KEi payload MUST be included". This also led to changes in 978 section 2.18. 980 In Section 2.1, there is new material covering how the initiator's 981 SPI and/or IP is used to differentiate if this is a "half-open" IKE 982 SA or a new request. 984 This document clarifies the use of the critical flag in Section 2.5. 986 In 2.8, changed "Note that, when rekeying, the new Child SA MAY have 987 different traffic selectors and algorithms than the old one" to "Note 988 that, when rekeying, the new Child SA SHOULD NOT have different 989 traffic selectors and algorithms than the old one". 991 The new Section 2.8.2 covers simultaneous IKE SA rekeying. 993 The new Section 2.9.2 covers traffic selectors in rekeying. 995 This document adds the restriction in Section 2.13 that all pseudo- 996 random functions (PRFs) used with IKEv2 MUST take variable-sized 997 keys. This should not affect any implementations because there were 998 no standardized PRFs that have fixed-size keys. 1000 Section 2.18 requires doing a Diffie-Hellman exchange when rekeying 1001 the IKE_SA. In theory, RFC 4306 allowed a policy where the Diffie- 1002 Hellman exchange was optional, but this was not useful (or 1003 appropriate) when rekeying the IKE_SA. 1005 Section 2.21 has been greatly expanded to cover the different cases 1006 where error responses are needed and the appropriate responses to 1007 them. 1009 Section 2.23 clarified that, in NAT traversal, now both UDP 1010 encapsulated IPsec packets and non-UDP encapsulated IPsec packets 1011 packets need to be understood when receiving. 1013 Added Section 2.23.1 to describe NAT traversal when transport mode is 1014 requested. 1016 Added Section 2.25 to explain how to act when there are timing 1017 collisions when deleting and/or rekeying SAs, and two new error 1018 notifications (TEMPORARY_FAILURE and CHILD_SA_NOT_FOUND) were 1019 defined. 1021 In Section 3.6, added "Implementations MUST support the HTTP method 1022 for hash-and-URL lookup. The behavior of other URL methods is not 1023 currently specified, and such methods SHOULD NOT be used in the 1024 absence of a document specifying them." 1026 In Section 3.15.3, added a pointer to a new document that is related 1027 to configuration of IPv6 addresses. 1029 Appendix C was expanded and clarified. 1031 2. IKE Protocol Details and Variations 1033 IKE normally listens and sends on UDP port 500, though IKE messages 1034 may also be received on UDP port 4500 with a slightly different 1035 format (see Section 2.23). Since UDP is a datagram (unreliable) 1036 protocol, IKE includes in its definition recovery from transmission 1037 errors, including packet loss, packet replay, and packet forgery. 1038 IKE is designed to function so long as (1) at least one of a series 1039 of retransmitted packets reaches its destination before timing out; 1040 and (2) the channel is not so full of forged and replayed packets so 1041 as to exhaust the network or CPU capacities of either endpoint. Even 1042 in the absence of those minimum performance requirements, IKE is 1043 designed to fail cleanly (as though the network were broken). 1045 Although IKEv2 messages are intended to be short, they contain 1046 structures with no hard upper bound on size (in particular, digital 1047 certificates), and IKEv2 itself does not have a mechanism for 1048 fragmenting large messages. IP defines a mechanism for fragmentation 1049 of oversized UDP messages, but implementations vary in the maximum 1050 message size supported. Furthermore, use of IP fragmentation opens 1051 an implementation to denial of service (DoS) attacks [DOSUDPPROT]. 1052 Finally, some NAT and/or firewall implementations may block IP 1053 fragments. 1055 All IKEv2 implementations MUST be able to send, receive, and process 1056 IKE messages that are up to 1280 octets long, and they SHOULD be able 1057 to send, receive, and process messages that are up to 3000 octets 1058 long. IKEv2 implementations need to be aware of the maximum UDP 1059 message size supported and MAY shorten messages by leaving out some 1060 certificates or cryptographic suite proposals if that will keep 1061 messages below the maximum. Use of the "Hash and URL" formats rather 1062 than including certificates in exchanges where possible can avoid 1063 most problems. Implementations and configuration need to keep in 1064 mind, however, that if the URL lookups are possible only after the 1065 Child SA is established, recursion issues could prevent this 1066 technique from working. 1068 The UDP payload of all packets containing IKE messages sent on port 1069 4500 MUST begin with the prefix of four zeros; otherwise, the 1070 receiver won't know how to handle them. 1072 2.1. Use of Retransmission Timers 1074 All messages in IKE exist in pairs: a request and a response. The 1075 setup of an IKE SA normally consists of two exchanges. Once the IKE 1076 SA is set up, either end of the security association may initiate 1077 requests at any time, and there can be many requests and responses 1078 "in flight" at any given moment. But each message is labeled as 1079 either a request or a response, and for each exchange, one end of the 1080 security association is the initiator and the other is the responder. 1082 For every pair of IKE messages, the initiator is responsible for 1083 retransmission in the event of a timeout. The responder MUST never 1084 retransmit a response unless it receives a retransmission of the 1085 request. In that event, the responder MUST ignore the retransmitted 1086 request except insofar as it causes a retransmission of the response. 1087 The initiator MUST remember each request until it receives the 1088 corresponding response. The responder MUST remember each response 1089 until it receives a request whose sequence number is larger than or 1090 equal to the sequence number in the response plus its window size 1091 (see Section 2.3). In order to allow saving memory, responders are 1092 allowed to forget the response after a timeout of several minutes. 1093 If the responder receives a retransmitted request for which it has 1094 already forgotten the response, it MUST ignore the request (and not, 1095 for example, attempt constructing a new response). 1097 IKE is a reliable protocol: the initiator MUST retransmit a request 1098 until either it receives a corresponding response, or until it deems 1099 the IKE SA to have failed. In the latter case, the initiator 1100 discards all state associated with the IKE SA and any Child SAs that 1101 were negotiated using that IKE SA. A retransmission from the 1102 initiator MUST be bitwise identical to the original request. That 1103 is, everything starting from the IKE Header (the IKE SA initiator's 1104 SPI onwards) must be bitwise identical; items before it (such as the 1105 IP and UDP headers) do not have to be identical. 1107 Retransmissions of the IKE_SA_INIT request require some special 1108 handling. When a responder receives an IKE_SA_INIT request, it has 1109 to determine whether the packet is a retransmission belonging to an 1110 existing "half-open" IKE SA (in which case the responder retransmits 1111 the same response), or a new request (in which case the responder 1112 creates a new IKE SA and sends a fresh response), or it belongs to an 1113 existing IKE SA where the IKE_AUTH request has been already received 1114 (in which case the responder ignores it). 1116 It is not sufficient to use the initiator's SPI and/or IP address to 1117 differentiate between these three cases because two different peers 1118 behind a single NAT could choose the same initiator SPI. Instead, a 1119 robust responder will do the IKE SA lookup using the whole packet, 1120 its hash, or the Ni payload. 1122 The retransmission policy for one-way messages is somewhat different 1123 from that for regular messages. Because no acknowledgement is ever 1124 sent, there is no reason to gratuitously retransmit one-way messages. 1125 Given that all these messages are errors, it makes sense to send them 1126 only once per "offending" packet, and only retransmit if further 1127 offending packets are received. Still, it also makes sense to limit 1128 retransmissions of such error messages. 1130 2.2. Use of Sequence Numbers for Message ID 1132 Every IKE message contains a Message ID as part of its fixed header. 1133 This Message ID is used to match up requests and responses, and to 1134 identify retransmissions of messages. Retransmission of a message 1135 MUST use the same Message ID as the original message. 1137 The Message ID is a 32-bit quantity, which is zero for the 1138 IKE_SA_INIT messages (including retries of the message due to 1139 responses such as COOKIE and INVALID_KE_PAYLOAD), and incremented for 1140 each subsequent exchange. Thus, the first pair of IKE_AUTH messages 1141 will have ID of 1, the second (when EAP is used) will be 2, and so 1142 on. The Message ID is reset to zero in the new IKE SA after the IKE 1143 SA is rekeyed. 1145 Each endpoint in the IKE Security Association maintains two "current" 1146 Message IDs: the next one to be used for a request it initiates and 1147 the next one it expects to see in a request from the other end. 1148 These counters increment as requests are generated and received. 1149 Responses always contain the same message ID as the corresponding 1150 request. That means that after the initial exchange, each integer n 1151 may appear as the message ID in four distinct messages: the nth 1152 request from the original IKE initiator, the corresponding response, 1153 the nth request from the original IKE responder, and the 1154 corresponding response. If the two ends make very different numbers 1155 of requests, the Message IDs in the two directions can be very 1156 different. There is no ambiguity in the messages, however, because 1157 the Initiator and Response flags in the message header specify which 1158 of the four messages a particular one is. 1160 Throughout this document, "initiator" refers to the party who 1161 initiated the exchange being described. The "original initiator" 1162 always refers to the party who initiated the exchange which resulted 1163 in the current IKE SA. In other words, if the "original responder" 1164 starts rekeying the IKE SA, that party becomes the "original 1165 initiator" of the new IKE SA. 1167 Note that Message IDs are cryptographically protected and provide 1168 protection against message replays. In the unlikely event that 1169 Message IDs grow too large to fit in 32 bits, the IKE SA MUST be 1170 closed or rekeyed. 1172 2.3. Window Size for Overlapping Requests 1174 The SET_WINDOW_SIZE notification asserts that the sending endpoint is 1175 capable of keeping state for multiple outstanding exchanges, 1176 permitting the recipient to send multiple requests before getting a 1177 response to the first. The data associated with a SET_WINDOW_SIZE 1178 notification MUST be 4 octets long and contain the big endian 1179 representation of the number of messages the sender promises to keep. 1180 The window size is always one until the initial exchanges complete. 1182 An IKE endpoint MUST wait for a response to each of its messages 1183 before sending a subsequent message unless it has received a 1184 SET_WINDOW_SIZE Notify message from its peer informing it that the 1185 peer is prepared to maintain state for multiple outstanding messages 1186 in order to allow greater throughput. 1188 After an IKE SA is set up, in order to maximize IKE throughput, an 1189 IKE endpoint MAY issue multiple requests before getting a response to 1190 any of them, up to the limit set by its peer's SET_WINDOW_SIZE. 1191 These requests may pass one another over the network. An IKE 1192 endpoint MUST be prepared to accept and process a request while it 1193 has a request outstanding in order to avoid a deadlock in this 1194 situation. An IKE endpoint may also accept and process multiple 1195 requests while it has a request outstanding. 1197 An IKE endpoint MUST NOT exceed the peer's stated window size for 1198 transmitted IKE requests. In other words, if the responder stated 1199 its window size is N, then when the initiator needs to make a request 1200 X, it MUST wait until it has received responses to all requests up 1201 through request X-N. An IKE endpoint MUST keep a copy of (or be able 1202 to regenerate exactly) each request it has sent until it receives the 1203 corresponding response. An IKE endpoint MUST keep a copy of (or be 1204 able to regenerate exactly) the number of previous responses equal to 1205 its declared window size in case its response was lost and the 1206 initiator requests its retransmission by retransmitting the request. 1208 An IKE endpoint supporting a window size greater than one ought to be 1209 capable of processing incoming requests out of order to maximize 1210 performance in the event of network failures or packet reordering. 1212 The window size is normally a (possibly configurable) property of a 1213 particular implementation, and is not related to congestion control 1214 (unlike the window size in TCP, for example). In particular, it is 1215 not defined what the responder should do when it receives a 1216 SET_WINDOW_SIZE notification containing a smaller value than is 1217 currently in effect. Thus, there is currently no way to reduce the 1218 window size of an existing IKE SA; you can only increase it. When 1219 rekeying an IKE SA, the new IKE SA starts with window size 1 until it 1220 is explicitly increased by sending a new SET_WINDOW_SIZE 1221 notification. 1223 The INVALID_MESSAGE_ID notification is sent when an IKE message ID 1224 outside the supported window is received. This Notify message MUST 1225 NOT be sent in a response; the invalid request MUST NOT be 1226 acknowledged. Instead, inform the other side by initiating an 1227 INFORMATIONAL exchange with Notification data containing the four 1228 octet invalid message ID. Sending this notification is OPTIONAL, and 1229 notifications of this type MUST be rate limited. 1231 2.4. State Synchronization and Connection Timeouts 1233 An IKE endpoint is allowed to forget all of its state associated with 1234 an IKE SA and the collection of corresponding Child SAs at any time. 1235 This is the anticipated behavior in the event of an endpoint crash 1236 and restart. It is important when an endpoint either fails or 1237 reinitializes its state that the other endpoint detect those 1238 conditions and not continue to waste network bandwidth by sending 1239 packets over discarded SAs and having them fall into a black hole. 1241 The INITIAL_CONTACT notification asserts that this IKE SA is the only 1242 IKE SA currently active between the authenticated identities. It MAY 1243 be sent when an IKE SA is established after a crash, and the 1244 recipient MAY use this information to delete any other IKE SAs it has 1245 to the same authenticated identity without waiting for a timeout. 1246 This notification MUST NOT be sent by an entity that may be 1247 replicated (e.g., a roaming user's credentials where the user is 1248 allowed to connect to the corporate firewall from two remote systems 1249 at the same time). The INITIAL_CONTACT notification, if sent, MUST 1250 be in the first IKE_AUTH request or response, not as a separate 1251 exchange afterwards; receiving parties MAY ignore it in other 1252 messages. 1254 Since IKE is designed to operate in spite of DoS attacks from the 1255 network, an endpoint MUST NOT conclude that the other endpoint has 1256 failed based on any routing information (e.g., ICMP messages) or IKE 1257 messages that arrive without cryptographic protection (e.g., Notify 1258 messages complaining about unknown SPIs). An endpoint MUST conclude 1259 that the other endpoint has failed only when repeated attempts to 1260 contact it have gone unanswered for a timeout period or when a 1261 cryptographically protected INITIAL_CONTACT notification is received 1262 on a different IKE SA to the same authenticated identity. An 1263 endpoint should suspect that the other endpoint has failed based on 1264 routing information and initiate a request to see whether the other 1265 endpoint is alive. To check whether the other side is alive, IKE 1266 specifies an empty INFORMATIONAL message that (like all IKE requests) 1267 requires an acknowledgement (note that within the context of an IKE 1268 SA, an "empty" message consists of an IKE header followed by an 1269 Encrypted payload that contains no payloads). If a cryptographically 1270 protected (fresh, i.e. not retransmitted) message has been received 1271 from the other side recently, unprotected Notify messages MAY be 1272 ignored. Implementations MUST limit the rate at which they take 1273 actions based on unprotected messages. 1275 Numbers of retries and lengths of timeouts are not covered in this 1276 specification because they do not affect interoperability. It is 1277 suggested that messages be retransmitted at least a dozen times over 1278 a period of at least several minutes before giving up on an SA, but 1279 different environments may require different rules. To be a good 1280 network citizen, retransmission times MUST increase exponentially to 1281 avoid flooding the network and making an existing congestion 1282 situation worse. If there has only been outgoing traffic on all of 1283 the SAs associated with an IKE SA, it is essential to confirm 1284 liveness of the other endpoint to avoid black holes. If no 1285 cryptographically protected messages have been received on an IKE SA 1286 or any of its Child SAs recently, the system needs to perform a 1287 liveness check in order to prevent sending messages to a dead peer. 1288 (This is sometimes called "dead peer detection" or "DPD", although it 1289 is really detecting live peers, not dead ones.) Receipt of a fresh 1290 cryptographically protected message on an IKE SA or any of its Child 1291 SAs ensures liveness of the IKE SA and all of its Child SAs. Note 1292 that this places requirements on the failure modes of an IKE 1293 endpoint. An implementation needs to stop sending on any SA if some 1294 failure prevents it from receiving on all of the associated SAs. If 1295 a system creates Child SAs that can fail independently from one 1296 another without the associated IKE SA being able to send a delete 1297 message, then the system MUST negotiate such Child SAs using separate 1298 IKE SAs. 1300 There is a DoS attack on the initiator of an IKE SA that can be 1301 avoided if the initiator takes the proper care. Since the first two 1302 messages of an SA setup are not cryptographically protected, an 1303 attacker could respond to the initiator's message before the genuine 1304 responder and poison the connection setup attempt. To prevent this, 1305 the initiator MAY be willing to accept multiple responses to its 1306 first message, treat each as potentially legitimate, respond to it, 1307 and then discard all the invalid half-open connections when it 1308 receives a valid cryptographically protected response to any one of 1309 its requests. Once a cryptographically valid response is received, 1310 all subsequent responses should be ignored whether or not they are 1311 cryptographically valid. 1313 Note that with these rules, there is no reason to negotiate and agree 1314 upon an SA lifetime. If IKE presumes the partner is dead, based on 1315 repeated lack of acknowledgement to an IKE message, then the IKE SA 1316 and all Child SAs set up through that IKE SA are deleted. 1318 An IKE endpoint may at any time delete inactive Child SAs to recover 1319 resources used to hold their state. If an IKE endpoint chooses to 1320 delete Child SAs, it MUST send Delete payloads to the other end 1321 notifying it of the deletion. It MAY similarly time out the IKE SA. 1322 Closing the IKE SA implicitly closes all associated Child SAs. In 1323 this case, an IKE endpoint SHOULD send a Delete payload indicating 1324 that it has closed the IKE SA unless the other endpoint is no longer 1325 responding. 1327 2.5. Version Numbers and Forward Compatibility 1329 This document describes version 2.0 of IKE, meaning the major version 1330 number is 2 and the minor version number is 0. This document is a 1331 replacement for [IKEV2]. It is likely that some implementations will 1332 want to support version 1.0 and version 2.0, and in the future, other 1333 versions. 1335 The major version number should be incremented only if the packet 1336 formats or required actions have changed so dramatically that an 1337 older version node would not be able to interoperate with a newer 1338 version node if it simply ignored the fields it did not understand 1339 and took the actions specified in the older specification. The minor 1340 version number indicates new capabilities, and MUST be ignored by a 1341 node with a smaller minor version number, but used for informational 1342 purposes by the node with the larger minor version number. For 1343 example, it might indicate the ability to process a newly defined 1344 Notify message type. The node with the larger minor version number 1345 would simply note that its correspondent would not be able to 1346 understand that message and therefore would not send it. 1348 If an endpoint receives a message with a higher major version number, 1349 it MUST drop the message and SHOULD send an unauthenticated Notify 1350 message of type INVALID_MAJOR_VERSION containing the highest 1351 (closest) version number it supports. If an endpoint supports major 1352 version n, and major version m, it MUST support all versions between 1353 n and m. If it receives a message with a major version that it 1354 supports, it MUST respond with that version number. In order to 1355 prevent two nodes from being tricked into corresponding with a lower 1356 major version number than the maximum that they both support, IKE has 1357 a flag that indicates that the node is capable of speaking a higher 1358 major version number. 1360 Thus, the major version number in the IKE header indicates the 1361 version number of the message, not the highest version number that 1362 the transmitter supports. If the initiator is capable of speaking 1363 versions n, n+1, and n+2, and the responder is capable of speaking 1364 versions n and n+1, then they will negotiate speaking n+1, where the 1365 initiator will set a flag indicating its ability to speak a higher 1366 version. If they mistakenly (perhaps through an active attacker 1367 sending error messages) negotiate to version n, then both will notice 1368 that the other side can support a higher version number, and they 1369 MUST break the connection and reconnect using version n+1. 1371 Note that IKEv1 does not follow these rules, because there is no way 1372 in v1 of noting that you are capable of speaking a higher version 1373 number. So an active attacker can trick two v2-capable nodes into 1374 speaking v1. When a v2-capable node negotiates down to v1, it should 1375 note that fact in its logs. 1377 Also for forward compatibility, all fields marked RESERVED MUST be 1378 set to zero by an implementation running version 2.0, and their 1379 content MUST be ignored by an implementation running version 2.0 ("Be 1380 conservative in what you send and liberal in what you receive"). In 1381 this way, future versions of the protocol can use those fields in a 1382 way that is guaranteed to be ignored by implementations that do not 1383 understand them. Similarly, payload types that are not defined are 1384 reserved for future use; implementations of a version where they are 1385 undefined MUST skip over those payloads and ignore their contents. 1387 IKEv2 adds a "critical" flag to each payload header for further 1388 flexibility for forward compatibility. If the critical flag is set 1389 and the payload type is unrecognized, the message MUST be rejected 1390 and the response to the IKE request containing that payload MUST 1391 include a Notify payload UNSUPPORTED_CRITICAL_PAYLOAD, indicating an 1392 unsupported critical payload was included. In that Notify payload, 1393 the notification data contains the one-octet payload type. If the 1394 critical flag is not set and the payload type is unsupported, that 1395 payload MUST be ignored. Payloads sent in IKE response messages MUST 1396 NOT have the critical flag set. Note that the critical flag applies 1397 only to the payload type, not the contents. If the payload type is 1398 recognized, but the payload contains something which is not (such as 1399 an unknown transform inside an SA payload, or an unknown Notify 1400 Message Type inside a Notify payload), the critical flag is ignored. 1402 Although new payload types may be added in the future and may appear 1403 interleaved with the fields defined in this specification, 1404 implementations SHOULD send the payloads defined in this 1405 specification in the order shown in the figures in Sections 1 and 2; 1406 implementations MUST NOT reject as invalid a message with those 1407 payloads in any other order. 1409 2.6. IKE SA SPIs and Cookies 1411 The initial two eight-octet fields in the header, called the "IKE 1412 SPIs", are used as a connection identifier at the beginning of IKE 1413 packets. Each endpoint chooses one of the two SPIs and MUST choose 1414 them so as to be unique identifiers of an IKE SA. An SPI value of 1415 zero is special: it indicates that the remote SPI value is not yet 1416 known by the sender. 1418 Incoming IKE packets are mapped to an IKE SA only using the packet's 1419 SPI, not using (for example) the source IP address of the packet. 1421 Unlike ESP and AH where only the recipient's SPI appears in the 1422 header of a message, in IKE the sender's SPI is also sent in every 1423 message. Since the SPI chosen by the original initiator of the IKE 1424 SA is always sent first, an endpoint with multiple IKE SAs open that 1425 wants to find the appropriate IKE SA using the SPI it assigned must 1426 look at the Initiator flag in the header to determine whether it 1427 assigned the first or the second eight octets. 1429 In the first message of an initial IKE exchange, the initiator will 1430 not know the responder's SPI value and will therefore set that field 1431 to zero. When the IKE_SA_INIT exchange does not result in the 1432 creation of an IKE SA due to INVALID_KE_PAYLOAD, NO_PROPOSAL_CHOSEN, 1433 or COOKIE (see Section 2.6), the responder's SPI will be zero also in 1434 the response message. However, if the responder sends a non-zero 1435 responder SPI, the initiator should not reject the response for only 1436 that reason. 1438 Two expected attacks against IKE are state and CPU exhaustion, where 1439 the target is flooded with session initiation requests from forged IP 1440 addresses. These attack can be made less effective if a responder 1441 uses minimal CPU and commits no state to an SA until it knows the 1442 initiator can receive packets at the address from which it claims to 1443 be sending them. 1445 When a responder detects a large number of half-open IKE SAs, it 1446 SHOULD reply to IKE_SA_INIT requests with a response containing the 1447 COOKIE notification. The data associated with this notification MUST 1448 be between 1 and 64 octets in length (inclusive), and its generation 1449 is described later in this section. If the IKE_SA_INIT response 1450 includes the COOKIE notification, the initiator MUST then retry the 1451 IKE_SA_INIT request, and include the COOKIE notification containing 1452 the received data as the first payload, and all other payloads 1453 unchanged. The initial exchange will then be as follows: 1455 Initiator Responder 1456 ------------------------------------------------------------------- 1457 HDR(A,0), SAi1, KEi, Ni --> 1458 <-- HDR(A,0), N(COOKIE) 1459 HDR(A,0), N(COOKIE), SAi1, 1460 KEi, Ni --> 1461 <-- HDR(A,B), SAr1, KEr, 1462 Nr, [CERTREQ] 1463 HDR(A,B), SK {IDi, [CERT,] 1464 [CERTREQ,] [IDr,] AUTH, 1465 SAi2, TSi, TSr} --> 1466 <-- HDR(A,B), SK {IDr, [CERT,] 1467 AUTH, SAr2, TSi, TSr} 1469 The first two messages do not affect any initiator or responder state 1470 except for communicating the cookie. In particular, the message 1471 sequence numbers in the first four messages will all be zero and the 1472 message sequence numbers in the last two messages will be one. 'A' 1473 is the SPI assigned by the initiator, while 'B' is the SPI assigned 1474 by the responder. 1476 An IKE implementation can implement its responder cookie generation 1477 in such a way as to not require any saved state to recognize its 1478 valid cookie when the second IKE_SA_INIT message arrives. The exact 1479 algorithms and syntax used to generate cookies do not affect 1480 interoperability and hence are not specified here. The following is 1481 an example of how an endpoint could use cookies to implement limited 1482 DoS protection. 1484 A good way to do this is to set the responder cookie to be: 1486 Cookie = | Hash(Ni | IPi | SPIi | ) 1488 where is a randomly generated secret known only to the 1489 responder and periodically changed and | indicates concatenation. 1490 should be changed whenever is 1491 regenerated. The cookie can be recomputed when the IKE_SA_INIT 1492 arrives the second time and compared to the cookie in the received 1493 message. If it matches, the responder knows that the cookie was 1494 generated since the last change to and that IPi must be the 1495 same as the source address it saw the first time. Incorporating SPIi 1496 into the calculation ensures that if multiple IKE SAs are being set 1497 up in parallel they will all get different cookies (assuming the 1498 initiator chooses unique SPIi's). Incorporating Ni in the hash 1499 ensures that an attacker who sees only message 2 can't successfully 1500 forge a message 3. Also, incorporating SPIi in the hash prevents an 1501 attacker from fetching one cookie from the other end, and then 1502 initiating many IKE_SA_INIT exchanges all with different initiator 1503 SPIs (and perhaps port numbers) so that the responder thinks that 1504 there are lots of machines behind one NAT box who are all trying to 1505 connect. 1507 If a new value for is chosen while there are connections in 1508 the process of being initialized, an IKE_SA_INIT might be returned 1509 with other than the current . The responder in 1510 that case MAY reject the message by sending another response with a 1511 new cookie or it MAY keep the old value of around for a 1512 short time and accept cookies computed from either one. The 1513 responder should not accept cookies indefinitely after is 1514 changed, since that would defeat part of the DoS protection. The 1515 responder should change the value of frequently, especially 1516 if under attack. 1518 When one party receives an IKE_SA_INIT request containing a cookie 1519 whose contents do not match the value expected, that party MUST 1520 ignore the cookie and process the message as if no cookie had been 1521 included; usually this means sending a response containing a new 1522 cookie. The initiator should limit the number of cookie exchanges it 1523 tries before giving up, possibly using exponential back-off. An 1524 attacker can forge multiple cookie responses to the initiator's 1525 IKE_SA_INIT message, and each of those forged cookie replies will 1526 cause two packets to be sent: one packet from the initiator to the 1527 responder (which will reject those cookies), and one response from 1528 responder to initiator that includes the correct cookie. 1530 A note on terminology: the term "cookies" originates with Karn and 1531 Simpson [PHOTURIS] in Photuris, an early proposal for key management 1532 with IPsec, and it has persisted. The Internet Security Association 1533 and Key Management Protocol (ISAKMP) [ISAKMP] fixed message header 1534 includes two eight-octet fields called "cookies", and that syntax is 1535 used by both IKEv1 and IKEv2, although in IKEv2 they are referred to 1536 as the "IKE SPI" and there is a new separate field in a Notify 1537 payload holding the cookie. 1539 2.6.1. Interaction of COOKIE and INVALID_KE_PAYLOAD 1541 There are two common reasons why the initiator may have to retry the 1542 IKE_SA_INIT exchange: the responder requests a cookie or wants a 1543 different Diffie-Hellman group than was included in the KEi payload. 1544 If the initiator receives a cookie from the responder, the initiator 1545 needs to decide whether or not to include the cookie in only the next 1546 retry of the IKE_SA_INIT request, or in all subsequent retries as 1547 well. 1549 If the initiator includes the cookie only in the next retry, one 1550 additional roundtrip may be needed in some cases. An additional 1551 roundtrip is needed also if the initiator includes the cookie in all 1552 retries, but the responder does not support this. For instance, if 1553 the responder includes the KEi payloads in cookie calculation, it 1554 will reject the request by sending a new cookie. 1556 If both peers support including the cookie in all retries, a slightly 1557 shorter exchange can happen. 1559 Initiator Responder 1560 ----------------------------------------------------------- 1561 HDR(A,0), SAi1, KEi, Ni --> 1562 <-- HDR(A,0), N(COOKIE) 1563 HDR(A,0), N(COOKIE), SAi1, KEi, Ni --> 1564 <-- HDR(A,0), N(INVALID_KE_PAYLOAD) 1565 HDR(A,0), N(COOKIE), SAi1, KEi', Ni --> 1566 <-- HDR(A,B), SAr1, KEr, Nr 1568 Implementations SHOULD support this shorter exchange, but MUST NOT 1569 fail if other implementations do not support this shorter exchange. 1571 2.7. Cryptographic Algorithm Negotiation 1573 The payload type known as "SA" indicates a proposal for a set of 1574 choices of IPsec protocols (IKE, ESP, or AH) for the SA as well as 1575 cryptographic algorithms associated with each protocol. 1577 An SA payload consists of one or more proposals. Each proposal 1578 includes one protocol. Each protocol contains one or more transforms 1579 -- each specifying a cryptographic algorithm. Each transform 1580 contains zero or more attributes (attributes are needed only if the 1581 transform identifier does not completely specify the cryptographic 1582 algorithm). 1584 This hierarchical structure was designed to efficiently encode 1585 proposals for cryptographic suites when the number of supported 1586 suites is large because multiple values are acceptable for multiple 1587 transforms. The responder MUST choose a single suite, which may be 1588 any subset of the SA proposal following the rules below: 1590 Each proposal contains one protocol. If a proposal is accepted, the 1591 SA response MUST contain the same protocol. The responder MUST 1592 accept a single proposal or reject them all and return an error. The 1593 error is given in a notification of type NO_PROPOSAL_CHOSEN. 1595 Each IPsec protocol proposal contains one or more transforms. Each 1596 transform contains a transform type. The accepted cryptographic 1597 suite MUST contain exactly one transform of each type included in the 1598 proposal. For example: if an ESP proposal includes transforms 1599 ENCR_3DES, ENCR_AES w/keysize 128, ENCR_AES w/keysize 256, 1600 AUTH_HMAC_MD5, and AUTH_HMAC_SHA, the accepted suite MUST contain one 1601 of the ENCR_ transforms and one of the AUTH_ transforms. Thus, six 1602 combinations are acceptable. 1604 If an initiator proposes both normal ciphers with integrity 1605 protection as well as combined-mode ciphers, then two proposals are 1606 needed. One of the proposals includes the normal ciphers with the 1607 integrity algoritms for them, and the other proposal includes all the 1608 combined mode ciphers without the integrity algorithms (because 1609 combined mode ciphers are not allowed to have any integrity algorithm 1610 other than "none"). 1612 2.8. Rekeying 1614 IKE, ESP, and AH security associations use secret keys that should be 1615 used only for a limited amount of time and to protect a limited 1616 amount of data. This limits the lifetime of the entire security 1617 association. When the lifetime of a security association expires, 1618 the security association MUST NOT be used. If there is demand, new 1619 security associations MAY be established. Reestablishment of 1620 security associations to take the place of ones that expire is 1621 referred to as "rekeying". 1623 To allow for minimal IPsec implementations, the ability to rekey SAs 1624 without restarting the entire IKE SA is optional. An implementation 1625 MAY refuse all CREATE_CHILD_SA requests within an IKE SA. If an SA 1626 has expired or is about to expire and rekeying attempts using the 1627 mechanisms described here fail, an implementation MUST close the IKE 1628 SA and any associated Child SAs and then MAY start new ones. 1629 Implementations may wish to support in-place rekeying of SAs, since 1630 doing so offers better performance and is likely to reduce the number 1631 of packets lost during the transition. 1633 To rekey a Child SA within an existing IKE SA, create a new, 1634 equivalent SA (see Section 2.17 below), and when the new one is 1635 established, delete the old one. Note that, when rekeying, the new 1636 Child SA SHOULD NOT have different traffic selectors and algorithms 1637 than the old one. 1639 To rekey an IKE SA, establish a new equivalent IKE SA (see 1640 Section 2.18 below) with the peer to whom the old IKE SA is shared 1641 using a CREATE_CHILD_SA within the existing IKE SA. An IKE SA so 1642 created inherits all of the original IKE SA's Child SAs, and the new 1643 IKE SA is used for all control messages needed to maintain those 1644 Child SAs. After the new equivalent IKE SA is created, the initiator 1645 deletes the old IKE SA, and the Delete payload to delete itself MUST 1646 be the last request sent over the old IKE SA. 1648 SAs should be rekeyed proactively, i.e., the new SA should be 1649 established before the old one expires and becomes unusable. Enough 1650 time should elapse between the time the new SA is established and the 1651 old one becomes unusable so that traffic can be switched over to the 1652 new SA. 1654 A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes 1655 were negotiated. In IKEv2, each end of the SA is responsible for 1656 enforcing its own lifetime policy on the SA and rekeying the SA when 1657 necessary. If the two ends have different lifetime policies, the end 1658 with the shorter lifetime will end up always being the one to request 1659 the rekeying. If an SA has been inactive for a long time and if an 1660 endpoint would not initiate the SA in the absence of traffic, the 1661 endpoint MAY choose to close the SA instead of rekeying it when its 1662 lifetime expires. It can also do so if there has been no traffic 1663 since the last time the SA was rekeyed. 1665 Note that IKEv2 deliberately allows parallel SAs with the same 1666 traffic selectors between common endpoints. One of the purposes of 1667 this is to support traffic quality of service (QoS) differences among 1668 the SAs (see [DIFFSERVFIELD], [DIFFSERVARCH], and section 4.1 of 1669 [DIFFTUNNEL]). Hence unlike IKEv1, the combination of the endpoints 1670 and the traffic selectors may not uniquely identify an SA between 1671 those endpoints, so the IKEv1 rekeying heuristic of deleting SAs on 1672 the basis of duplicate traffic selectors SHOULD NOT be used. 1674 There are timing windows -- particularly in the presence of lost 1675 packets -- where endpoints may not agree on the state of an SA. The 1676 responder to a CREATE_CHILD_SA MUST be prepared to accept messages on 1677 an SA before sending its response to the creation request, so there 1678 is no ambiguity for the initiator. The initiator MAY begin sending 1679 on an SA as soon as it processes the response. The initiator, 1680 however, cannot receive on a newly created SA until it receives and 1681 processes the response to its CREATE_CHILD_SA request. How, then, is 1682 the responder to know when it is OK to send on the newly created SA? 1684 From a technical correctness and interoperability perspective, the 1685 responder MAY begin sending on an SA as soon as it sends its response 1686 to the CREATE_CHILD_SA request. In some situations, however, this 1687 could result in packets unnecessarily being dropped, so an 1688 implementation MAY defer such sending. 1690 The responder can be assured that the initiator is prepared to 1691 receive messages on an SA if either (1) it has received a 1692 cryptographically valid message on the other half of the SA pair, or 1693 (2) the new SA rekeys an existing SA and it receives an IKE request 1694 to close the replaced SA. When rekeying an SA, the responder 1695 continues to send traffic on the old SA until one of those events 1696 occurs. When establishing a new SA, the responder MAY defer sending 1697 messages on a new SA until either it receives one or a timeout has 1698 occurred. If an initiator receives a message on an SA for which it 1699 has not received a response to its CREATE_CHILD_SA request, it 1700 interprets that as a likely packet loss and retransmits the 1701 CREATE_CHILD_SA request. An initiator MAY send a dummy ESP message 1702 on a newly created ESP SA if it has no messages queued in order to 1703 assure the responder that the initiator is ready to receive messages. 1705 2.8.1. Simultaneous Child SA rekeying 1707 If the two ends have the same lifetime policies, it is possible that 1708 both will initiate a rekeying at the same time (which will result in 1709 redundant SAs). To reduce the probability of this happening, the 1710 timing of rekeying requests SHOULD be jittered (delayed by a random 1711 amount of time after the need for rekeying is noticed). 1713 This form of rekeying may temporarily result in multiple similar SAs 1714 between the same pairs of nodes. When there are two SAs eligible to 1715 receive packets, a node MUST accept incoming packets through either 1716 SA. If redundant SAs are created though such a collision, the SA 1717 created with the lowest of the four nonces used in the two exchanges 1718 SHOULD be closed by the endpoint that created it. "Lowest" means an 1719 octet-by-octet comparison (instead of, for instance, comparing the 1720 nonces as large integers). In other words, start by comparing the 1721 first octet; if they're equal, move to the next octet, and so on. If 1722 you reach the end of one nonce, that nonce is the lower one. The 1723 node that initiated the surviving rekeyed SA should delete the 1724 replaced SA after the new one is established. 1726 The following is an explanation on the impact this has on 1727 implementations. Assume that hosts A and B have an existing Child SA 1728 pair with SPIs (SPIa1,SPIb1), and both start rekeying it at the same 1729 time: 1731 Host A Host B 1732 ------------------------------------------------------------------- 1733 send req1: N(REKEY_SA,SPIa1), 1734 SA(..,SPIa2,..),Ni1,.. --> 1735 <-- send req2: N(REKEY_SA,SPIb1), 1736 SA(..,SPIb2,..),Ni2 1737 recv req2 <-- 1739 At this point, A knows there is a simultaneous rekeying going on. 1740 However, it cannot yet know which of the exchanges will have the 1741 lowest nonce, so it will just note the situation and respond as 1742 usual. 1744 send resp2: SA(..,SPIa3,..), 1745 Nr1,.. --> 1746 --> recv req1 1748 Now B also knows that simultaneous rekeying is going on. It responds 1749 as usual. 1751 <-- send resp1: SA(..,SPIb3,..), 1752 Nr2,.. 1753 recv resp1 <-- 1754 --> recv resp2 1756 At this point, there are three Child SA pairs between A and B (the 1757 old one and two new ones). A and B can now compare the nonces. 1758 Suppose that the lowest nonce was Nr1 in message resp2; in this case, 1759 B (the sender of req2) deletes the redundant new SA, and A (the node 1760 that initiated the surviving rekeyed SA), deletes the old one. 1762 send req3: D(SPIa1) --> 1763 <-- send req4: D(SPIb2) 1764 --> recv req3 1765 <-- send resp3: D(SPIb1) 1766 recv req4 <-- 1767 send resp4: D(SPIa3) --> 1769 The rekeying is now finished. 1771 However, there is a second possible sequence of events that can 1772 happen if some packets are lost in the network, resulting in 1773 retransmissions. The rekeying begins as usual, but A's first packet 1774 (req1) is lost. 1776 Host A Host B 1777 ------------------------------------------------------------------- 1778 send req1: N(REKEY_SA,SPIa1), 1779 SA(..,SPIa2,..), 1780 Ni1,.. --> (lost) 1781 <-- send req2: N(REKEY_SA,SPIb1), 1782 SA(..,SPIb2,..),Ni2 1783 recv req2 <-- 1784 send resp2: SA(..,SPIa3,..), 1785 Nr1,.. --> 1786 --> recv resp2 1787 <-- send req3: D(SPIb1) 1788 recv req3 <-- 1789 send resp3: D(SPIa1) --> 1790 --> recv resp3 1792 From B's point of view, the rekeying is now completed, and since it 1793 has not yet received A's req1, it does not even know that there was 1794 simultaneous rekeying. However, A will continue retransmitting the 1795 message, and eventually it will reach B. 1797 resend req1 --> 1798 --> recv req1 1800 To B, it looks like A is trying to rekey an SA that no longer exists; 1801 thus, B responds to the request with something non-fatal such as 1802 CHILD_SA_NOT_FOUND. 1804 <-- send resp1: N(CHILD_SA_NOT_FOUND) 1805 recv resp1 <-- 1807 When A receives this error, it already knows there was simultaneous 1808 rekeying, so it can ignore the error message. 1810 2.8.2. Simultaneous IKE SA Rekeying 1812 Probably the most complex case occurs when both peers try to rekey 1813 the IKE_SA at the same time. Basically, the text in Section 2.8 1814 applies to this case as well; however, it is important to ensure that 1815 the Child SAs are inherited by the correct IKE_SA. 1817 The case where both endpoints notice the simultaneous rekeying works 1818 the same way as with Child SAs. After the CREATE_CHILD_SA exchanges, 1819 three IKE SAs exist between A and B: the old IKE SA and two new IKE 1820 SAs. The new IKE SA containing the lowest nonce SHOULD be deleted by 1821 the node that created it, and the other suriving new IKE SA MUST 1822 inherit all the Child SAs. 1824 In addition to normal simultaneous rekeying cases, there is a special 1825 case where one peer finishes its rekey before it even notices that 1826 other peer is doing a rekey. If only one peer detects a simultaneous 1827 rekey, redundant SAs are not created. In this case, when the peer 1828 that did not notice the simultaneous rekey gets the request to rekey 1829 the IKE SA that it has already successfully rekeyed, it SHOULD return 1830 TEMPORARY_FAILURE because it is an IKE SA that it is currently trying 1831 to close (whether or not it has already sent the delete notification 1832 for the SA). If the peer that did notice the simultaneous rekey gets 1833 the delete request from the other peer for the old IKE SA, it knows 1834 that the other peer did not detect the simultaneous rekey, and the 1835 first peer can forget its own rekey attempt. 1837 Host A Host B 1838 ------------------------------------------------------------------- 1839 send req1: 1840 SA(..,SPIa1,..),Ni1,.. --> 1841 <-- send req2: SA(..,SPIb1,..),Ni2,.. 1842 --> recv req1 1843 <-- send resp1: SA(..,SPIb2,..),Nr2,.. 1844 recv resp1 <-- 1845 send req3: D() --> 1846 --> recv req3 1848 At this point, host B sees a request to close the IKE_SA. There's 1849 not much more to do than to reply as usual. However, at this point 1850 host B should stop retransmitting req2, since once host A receives 1851 resp3, it will delete all the state associated with the old IKE_SA 1852 and will not be able to reply to it. 1854 <-- send resp3: () 1856 The TEMPORARY_FAILURE notification was not included in RFC 4306, and 1857 support of the TEMPORARY_FAILURE notification is not negotiated. 1858 Thus, older peers that implement RFC 4306 but not this document may 1859 receive these notifications. In that case, they will treat it the 1860 same as any other unknown error notification, and will stop the 1861 exchange. Because the other peer has already rekeyed the exchange, 1862 doing so does not have any ill effects. 1864 2.8.3. Rekeying the IKE SA Versus Reauthentication 1866 Rekeying the IKE SA and reauthentication are different concepts in 1867 IKEv2. Rekeying the IKE SA establishes new keys for the IKE SA and 1868 resets the Message ID counters, but it does not authenticate the 1869 parties again (no AUTH or EAP payloads are involved). 1871 Although rekeying the IKE SA may be important in some environments, 1872 reauthentication (the verification that the parties still have access 1873 to the long-term credentials) is often more important. 1875 IKEv2 does not have any special support for reauthentication. 1876 Reauthentication is done by creating a new IKE SA from scratch (using 1877 IKE_SA_INIT/IKE_AUTH exchanges, without any REKEY_SA notify 1878 payloads), creating new Child SAs within the new IKE SA (without 1879 REKEY_SA Notify payloads), and finally deleting the old IKE SA (which 1880 deletes the old Child SAs as well). 1882 This means that reauthentication also establishes new keys for the 1883 IKE SA and Child SAs. Therefore, while rekeying can be performed 1884 more often than reauthentication, the situation where "authentication 1885 lifetime" is shorter than "key lifetime" does not make sense. 1887 While creation of a new IKE SA can be initiated by either party 1888 (initiator or responder in the original IKE SA), the use of EAP 1889 authentication and/or configuration payloads means in practice that 1890 reauthentication has to be initiated by the same party as the 1891 original IKE SA. IKEv2 does not currently allow the responder to 1892 request reauthentication in this case; however, there are extensions 1893 that add this functionality such as [REAUTH]. 1895 2.9. Traffic Selector Negotiation 1897 When an RFC4301-compliant IPsec subsystem receives an IP packet that 1898 matches a "protect" selector in its Security Policy Database (SPD), 1899 the subsystem protects that packet with IPsec. When no SA exists 1900 yet, it is the task of IKE to create it. Maintenance of a system's 1901 SPD is outside the scope of IKE, although some implementations might 1902 update their SPD in connection with the running of IKE (for an 1903 example scenario, see Section 1.1.3). 1905 Traffic Selector (TS) payloads allow endpoints to communicate some of 1906 the information from their SPD to their peers. These must be 1907 communicated to IKE from the SPD (for example, the PF_KEY API [PFKEY] 1908 uses the SADB_ACQUIRE message). TS payloads specify the selection 1909 criteria for packets that will be forwarded over the newly set up SA. 1910 This can serve as a consistency check in some scenarios to assure 1911 that the SPDs are consistent. In others, it guides the dynamic 1912 update of the SPD. 1914 Two TS payloads appear in each of the messages in the exchange that 1915 creates a Child SA pair. Each TS payload contains one or more 1916 Traffic Selectors. Each traffic selector consists of an address 1917 range (IPv4 or IPv6), a port range, and an IP protocol ID. 1919 The first of the two TS payloads is known as TSi (Traffic Selector- 1920 initiator). The second is known as TSr (Traffic Selector-responder). 1921 TSi specifies the source address of traffic forwarded from (or the 1922 destination address of traffic forwarded to) the initiator of the 1923 Child SA pair. TSr specifies the destination address of the traffic 1924 forwarded to (or the source address of the traffic forwarded from) 1925 the responder of the Child SA pair. For example, if the original 1926 initiator requests the creation of a Child SA pair, and wishes to 1927 tunnel all traffic from subnet 198.51.100.* on the initiator's side 1928 to subnet 192.0.2.* on the responder's side, the initiator would 1929 include a single traffic selector in each TS payload. TSi would 1930 specify the address range (198.51.100.0 - 198.51.100.255) and TSr 1931 would specify the address range (192.0.2.0 - 192.0.2.255). Assuming 1932 that proposal was acceptable to the responder, it would send 1933 identical TS payloads back. 1935 IKEv2 allows the responder to choose a subset of the traffic proposed 1936 by the initiator. This could happen when the configurations of the 1937 two endpoints are being updated but only one end has received the new 1938 information. Since the two endpoints may be configured by different 1939 people, the incompatibility may persist for an extended period even 1940 in the absence of errors. It also allows for intentionally different 1941 configurations, as when one end is configured to tunnel all addresses 1942 and depends on the other end to have the up-to-date list. 1944 When the responder chooses a subset of the traffic proposed by the 1945 initiator, it narrows the traffic selectors to some subset of the 1946 initiator's proposal (provided the set does not become the null set). 1947 If the type of traffic selector proposed is unknown, the responder 1948 ignores that traffic selector, so that the unknown type is not 1949 returned in the narrowed set. 1951 To enable the responder to choose the appropriate range in this case, 1952 if the initiator has requested the SA due to a data packet, the 1953 initiator SHOULD include as the first traffic selector in each of TSi 1954 and TSr a very specific traffic selector including the addresses in 1955 the packet triggering the request. In the example, the initiator 1956 would include in TSi two traffic selectors: the first containing the 1957 address range (198.51.100.43 - 198.51.100.43) and the source port and 1958 IP protocol from the packet and the second containing (198.51.100.0 - 1959 198.51.100.255) with all ports and IP protocols. The initiator would 1960 similarly include two traffic selectors in TSr. If the initiator 1961 creates the Child SA pair not in response to an arriving packet, but 1962 rather, say, upon startup, then there may be no specific addresses 1963 the initiator prefers for the initial tunnel over any other. In that 1964 case, the first values in TSi and TSr can be ranges rather than 1965 specific values. 1967 The responder performs the narrowing as follows: 1969 o If the responder's policy does not allow it to accept any part of 1970 the proposed traffic selectors, it responds with a TS_UNACCEPTABLE 1971 Notify message. 1973 o If the responder's policy allows the entire set of traffic covered 1974 by TSi and TSr, no narrowing is necessary, and the responder can 1975 return the same TSi and TSr values. 1977 o If the responder's policy allows it to accept the first selector 1978 of TSi and TSr, then the responder MUST narrow the traffic 1979 selectors to a subset that includes the initiator's first choices. 1980 In this example above, the responder might respond with TSi being 1981 (198.51.100.43 - 198.51.100.43) with all ports and IP protocols. 1983 o If the responder's policy does not allow it to accept the first 1984 selector of TSi and TSr, the responder narrows to an acceptable 1985 subset of TSi and TSr. 1987 When narrowing is done, there may be several subsets that are 1988 acceptable but their union is not. In this case, the responder 1989 arbitrarily chooses one of them, and MAY include an 1990 ADDITIONAL_TS_POSSIBLE notification in the response. The 1991 ADDITIONAL_TS_POSSIBLE notification asserts that the responder 1992 narrowed the proposed traffic selectors but that other traffic 1993 selectors would also have been acceptable, though only in a separate 1994 SA. There is no data associated with this Notify type. This case 1995 will occur only when the initiator and responder are configured 1996 differently from one another. If the initiator and responder agree 1997 on the granularity of tunnels, the initiator will never request a 1998 tunnel wider than the responder will accept. 2000 It is possible for the responder's policy to contain multiple smaller 2001 ranges, all encompassed by the initiator's traffic selector, and with 2002 the responder's policy being that each of those ranges should be sent 2003 over a different SA. Continuing the example above, the responder 2004 might have a policy of being willing to tunnel those addresses to and 2005 from the initiator, but might require that each address pair be on a 2006 separately negotiated Child SA. If the initiator didn't generate its 2007 request based on the packet, but (for example) upon startup, there 2008 would not be the very specific first traffic selectors helping the 2009 responder to select the correct range. There would be no way for the 2010 responder to determine which pair of addresses should be included in 2011 this tunnel, and it would have to make a guess or reject the request 2012 with a SINGLE_PAIR_REQUIRED Notify message. 2014 The SINGLE_PAIR_REQUIRED error indicates that a CREATE_CHILD_SA 2015 request is unacceptable because its sender is only willing to accept 2016 traffic selectors specifying a single pair of addresses. The 2017 requestor is expected to respond by requesting an SA for only the 2018 specific traffic it is trying to forward. 2020 Few implementations will have policies that require separate SAs for 2021 each address pair. Because of this, if only some parts of the TSi 2022 and TSr proposed by the initiator are acceptable to the responder, 2023 responders SHOULD narrow the selectors to an acceptable subset rather 2024 than use SINGLE_PAIR_REQUIRED. 2026 2.9.1. Traffic Selectors Violating Own Policy 2028 When creating a new SA, the initiator needs to avoid proposing 2029 traffic selectors that violate its own policy. If this rule is not 2030 followed, valid traffic may be dropped. If you use decorrelated 2031 policies from [IPSECARCH], this kind of policy violations cannot 2032 happen. 2034 This is best illustrated by an example. Suppose that host A has a 2035 policy whose effect is that traffic to 198.51.100.66 is sent via host 2036 B encrypted using AES, and traffic to all other hosts in 2037 198.51.100.0/24 is also sent via B, but must use 3DES. Suppose also 2038 that host B accepts any combination of AES and 3DES. 2040 If host A now proposes an SA that uses 3DES, and includes TSr 2041 containing (198.51.100.0-198.51.100.255), this will be accepted by 2042 host B. Now, host B can also use this SA to send traffic from 2043 198.51.100.66, but those packets will be dropped by A since it 2044 requires the use of AES for this traffic. Even if host A creates a 2045 new SA only for 198.51.100.66 that uses AES, host B may freely 2046 continue to use the first SA for the traffic. In this situation, 2047 when proposing the SA, host A should have followed its own policy, 2048 and included a TSr containing ((198.51.100.0- 2049 198.51.100.65),(198.51.100.67-198.51.100.255)) instead. 2051 In general, if (1) the initiator makes a proposal "for traffic X 2052 (TSi/TSr), do SA", and (2) for some subset X' of X, the initiator 2053 does not actually accept traffic X' with SA, and (3) the initiator 2054 would be willing to accept traffic X' with some SA' (!=SA), valid 2055 traffic can be unnecessarily dropped since the responder can apply 2056 either SA or SA' to traffic X'. 2058 2.10. Nonces 2060 The IKE_SA_INIT messages each contain a nonce. These nonces are used 2061 as inputs to cryptographic functions. The CREATE_CHILD_SA request 2062 and the CREATE_CHILD_SA response also contain nonces. These nonces 2063 are used to add freshness to the key derivation technique used to 2064 obtain keys for Child SA, and to ensure creation of strong pseudo- 2065 random bits from the Diffie-Hellman key. Nonces used in IKEv2 MUST 2066 be randomly chosen, MUST be at least 128 bits in size, and MUST be at 2067 least half the key size of the negotiated pseudo-random function 2068 (PRF). However, the initiator chooses the nonce before the outcome 2069 of the negotiation is known. Because of that, the nonce has to be 2070 long enough for all the PRFs being proposed. If the same random 2071 number source is used for both keys and nonces, care must be taken to 2072 ensure that the latter use does not compromise the former. 2074 2.11. Address and Port Agility 2076 IKE runs over UDP ports 500 and 4500, and implicitly sets up ESP and 2077 AH associations for the same IP addresses it runs over. The IP 2078 addresses and ports in the outer header are, however, not themselves 2079 cryptographically protected, and IKE is designed to work even through 2080 Network Address Translation (NAT) boxes. An implementation MUST 2081 accept incoming requests even if the source port is not 500 or 4500, 2082 and MUST respond to the address and port from which the request was 2083 received. It MUST specify the address and port at which the request 2084 was received as the source address and port in the response. IKE 2085 functions identically over IPv4 or IPv6. 2087 2.12. Reuse of Diffie-Hellman Exponentials 2089 IKE generates keying material using an ephemeral Diffie-Hellman 2090 exchange in order to gain the property of "perfect forward secrecy". 2091 This means that once a connection is closed and its corresponding 2092 keys are forgotten, even someone who has recorded all of the data 2093 from the connection and gets access to all of the long-term keys of 2094 the two endpoints cannot reconstruct the keys used to protect the 2095 conversation without doing a brute force search of the session key 2096 space. 2098 Achieving perfect forward secrecy requires that when a connection is 2099 closed, each endpoint MUST forget not only the keys used by the 2100 connection but also any information that could be used to recompute 2101 those keys. 2103 Because computing Diffie-Hellman exponentials is computationally 2104 expensive, an endpoint may find it advantageous to reuse those 2105 exponentials for multiple connection setups. There are several 2106 reasonable strategies for doing this. An endpoint could choose a new 2107 exponential only periodically though this could result in less-than- 2108 perfect forward secrecy if some connection lasts for less than the 2109 lifetime of the exponential. Or it could keep track of which 2110 exponential was used for each connection and delete the information 2111 associated with the exponential only when some corresponding 2112 connection was closed. This would allow the exponential to be reused 2113 without losing perfect forward secrecy at the cost of maintaining 2114 more state. 2116 Whether and when to reuse Diffie-Hellman exponentials are private 2117 decisions in the sense that they will not affect interoperability. 2118 An implementation that reuses exponentials MAY choose to remember the 2119 exponential used by the other endpoint on past exchanges and if one 2120 is reused to avoid the second half of the calculation. See [REUSE] 2121 for a security analysis of this practice and for additional security 2122 considerations when reusing ephemeral Diffie-Hellman keys. 2124 2.13. Generating Keying Material 2126 In the context of the IKE SA, four cryptographic algorithms are 2127 negotiated: an encryption algorithm, an integrity protection 2128 algorithm, a Diffie-Hellman group, and a pseudo-random function 2129 (PRF). The PRF is used for the construction of keying material for 2130 all of the cryptographic algorithms used in both the IKE SA and the 2131 Child SAs. 2133 We assume that each encryption algorithm and integrity protection 2134 algorithm uses a fixed-size key and that any randomly chosen value of 2135 that fixed size can serve as an appropriate key. For algorithms that 2136 accept a variable length key, a fixed key size MUST be specified as 2137 part of the cryptographic transform negotiated (see Section 3.3.5 for 2138 the definition of the Key Length transform attribute). For 2139 algorithms for which not all values are valid keys (such as DES or 2140 3DES with key parity), the algorithm by which keys are derived from 2141 arbitrary values MUST be specified by the cryptographic transform. 2142 For integrity protection functions based on Hashed Message 2143 Authentication Code (HMAC), the fixed key size is the size of the 2144 output of the underlying hash function. 2146 It is assumed that PRFs accept keys of any length, but have a 2147 preferred key size. The preferred key size MUST be used as the 2148 length of SK_d, SK_pi, and SK_pr (see Section 2.14). For PRFs based 2149 on the HMAC construction, the preferred key size is equal to the 2150 length of the output of the underlying hash function. Other types of 2151 PRFs MUST specify their preferred key size. 2153 Keying material will always be derived as the output of the 2154 negotiated PRF algorithm. Since the amount of keying material needed 2155 may be greater than the size of the output of the PRF, the PRF is 2156 used iteratively. The term "prf+" describes a function that outputs 2157 a pseudo-random stream based on the inputs to a pseudo-random 2158 function called "prf". 2160 In the following, | indicates concatenation. prf+ is defined as: 2162 prf+ (K,S) = T1 | T2 | T3 | T4 | ... 2164 where: 2165 T1 = prf (K, S | 0x01) 2166 T2 = prf (K, T1 | S | 0x02) 2167 T3 = prf (K, T2 | S | 0x03) 2168 T4 = prf (K, T3 | S | 0x04) 2169 ... 2171 This continues until all the material needed to compute all required 2172 keys has been output from prf+. The keys are taken from the output 2173 string without regard to boundaries (e.g., if the required keys are a 2174 256-bit Advanced Encryption Standard (AES) key and a 160-bit HMAC 2175 key, and the prf function generates 160 bits, the AES key will come 2176 from T1 and the beginning of T2, while the HMAC key will come from 2177 the rest of T2 and the beginning of T3). 2179 The constant concatenated to the end of each prf function is a single 2180 octet. The prf+ function is not defined beyond 255 times the size of 2181 the prf function output. 2183 2.14. Generating Keying Material for the IKE SA 2185 The shared keys are computed as follows. A quantity called SKEYSEED 2186 is calculated from the nonces exchanged during the IKE_SA_INIT 2187 exchange and the Diffie-Hellman shared secret established during that 2188 exchange. SKEYSEED is used to calculate seven other secrets: SK_d 2189 used for deriving new keys for the Child SAs established with this 2190 IKE SA; SK_ai and SK_ar used as a key to the integrity protection 2191 algorithm for authenticating the component messages of subsequent 2192 exchanges; SK_ei and SK_er used for encrypting (and of course 2193 decrypting) all subsequent exchanges; and SK_pi and SK_pr, which are 2194 used when generating an AUTH payload. The lengths of SK_d, SK_pi, 2195 and SK_pr MUST be the preferred key length of the agreed-to PRF. 2197 SKEYSEED and its derivatives are computed as follows: 2199 SKEYSEED = prf(Ni | Nr, g^ir) 2201 {SK_d | SK_ai | SK_ar | SK_ei | SK_er | SK_pi | SK_pr } 2202 = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr ) 2204 (indicating that the quantities SK_d, SK_ai, SK_ar, SK_ei, SK_er, 2205 SK_pi, and SK_pr are taken in order from the generated bits of the 2206 prf+). g^ir is the shared secret from the ephemeral Diffie-Hellman 2207 exchange. g^ir is represented as a string of octets in big endian 2208 order padded with zeros if necessary to make it the length of the 2209 modulus. Ni and Nr are the nonces, stripped of any headers. For 2210 historical backwards-compatibility reasons, there are two PRFs that 2211 are treated specially in this calculation. If the negotiated PRF is 2212 AES-XCBC-PRF-128 [AESXCBCPRF128] or AES-CMAC-PRF-128 [AESCMACPRF128], 2213 only the first 64 bits of Ni and the first 64 bits of Nr are used in 2214 calculating SKEYSEED, but all the bits are used for input to the prf+ 2215 function. 2217 The two directions of traffic flow use different keys. The keys used 2218 to protect messages from the original initiator are SK_ai and SK_ei. 2219 The keys used to protect messages in the other direction are SK_ar 2220 and SK_er. 2222 2.15. Authentication of the IKE SA 2224 When not using extensible authentication (see Section 2.16), the 2225 peers are authenticated by having each sign (or MAC using a padded 2226 shared secret as the key, as described later in this section) a block 2227 of data. In these calculations, IDi' and IDr' are the entire ID 2228 payloads excluding the fixed header. For the responder, the octets 2229 to be signed start with the first octet of the first SPI in the 2230 header of the second message (IKE_SA_INIT response) and end with the 2231 last octet of the last payload in the second message. Appended to 2232 this (for purposes of computing the signature) are the initiator's 2233 nonce Ni (just the value, not the payload containing it), and the 2234 value prf(SK_pr, IDr'). Note that neither the nonce Ni nor the value 2235 prf(SK_pr, IDr') are transmitted. Similarly, the initiator signs the 2236 first message (IKE_SA_INIT request), starting with the first octet of 2237 the first SPI in the header and ending with the last octet of the 2238 last payload. Appended to this (for purposes of computing the 2239 signature) are the responder's nonce Nr, and the value prf(SK_pi, 2240 IDi'). It is critical to the security of the exchange that each side 2241 sign the other side's nonce. 2243 The initiator's signed octets can be described as: 2245 InitiatorSignedOctets = RealMessage1 | NonceRData | MACedIDForI 2246 GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR 2247 RealIKEHDR = SPIi | SPIr | . . . | Length 2248 RealMessage1 = RealIKEHDR | RestOfMessage1 2249 NonceRPayload = PayloadHeader | NonceRData 2250 InitiatorIDPayload = PayloadHeader | RestOfInitIDPayload 2251 RestOfInitIDPayload = IDType | RESERVED | InitIDData 2252 MACedIDForI = prf(SK_pi, RestOfInitIDPayload) 2254 The responder's signed octets can be described as: 2256 ResponderSignedOctets = RealMessage2 | NonceIData | MACedIDForR 2257 GenIKEHDR = [ four octets 0 if using port 4500 ] | RealIKEHDR 2258 RealIKEHDR = SPIi | SPIr | . . . | Length 2259 RealMessage2 = RealIKEHDR | RestOfMessage2 2260 NonceIPayload = PayloadHeader | NonceIData 2261 ResponderIDPayload = PayloadHeader | RestOfRespIDPayload 2262 RestOfRespIDPayload = IDType | RESERVED | RespIDData 2263 MACedIDForR = prf(SK_pr, RestOfRespIDPayload) 2265 Note that all of the payloads are included under the signature, 2266 including any payload types not defined in this document. If the 2267 first message of the exchange is sent multiple times (such as with a 2268 responder cookie and/or a different Diffie-Hellman group), it is the 2269 latest version of the message that is signed. 2271 Optionally, messages 3 and 4 MAY include a certificate, or 2272 certificate chain providing evidence that the key used to compute a 2273 digital signature belongs to the name in the ID payload. The 2274 signature or MAC will be computed using algorithms dictated by the 2275 type of key used by the signer, and specified by the Auth Method 2276 field in the Authentication payload. There is no requirement that 2277 the initiator and responder sign with the same cryptographic 2278 algorithms. The choice of cryptographic algorithms depends on the 2279 type of key each has. In particular, the initiator may be using a 2280 shared key while the responder may have a public signature key and 2281 certificate. It will commonly be the case (but it is not required) 2282 that if a shared secret is used for authentication that the same key 2283 is used in both directions. 2285 Note that it is a common but typically insecure practice to have a 2286 shared key derived solely from a user-chosen password without 2287 incorporating another source of randomness. This is typically 2288 insecure because user-chosen passwords are unlikely to have 2289 sufficient unpredictability to resist dictionary attacks and these 2290 attacks are not prevented in this authentication method. 2291 (Applications using password-based authentication for bootstrapping 2292 and IKE SA should use the authentication method in Section 2.16, 2293 which is designed to prevent off-line dictionary attacks.) The pre- 2294 shared key needs to contain as much unpredictability as the strongest 2295 key being negotiated. In the case of a pre-shared key, the AUTH 2296 value is computed as: 2298 For the initiator: 2299 AUTH = prf( prf(Shared Secret, "Key Pad for IKEv2"), 2300 ) 2301 For the responder: 2302 AUTH = prf( prf(Shared Secret, "Key Pad for IKEv2"), 2303 ) 2305 where the string "Key Pad for IKEv2" is 17 ASCII characters without 2306 null termination. The shared secret can be variable length. The pad 2307 string is added so that if the shared secret is derived from a 2308 password, the IKE implementation need not store the password in 2309 cleartext, but rather can store the value prf(Shared Secret,"Key Pad 2310 for IKEv2"), which could not be used as a password equivalent for 2311 protocols other than IKEv2. As noted above, deriving the shared 2312 secret from a password is not secure. This construction is used 2313 because it is anticipated that people will do it anyway. The 2314 management interface by which the Shared Secret is provided MUST 2315 accept ASCII strings of at least 64 octets and MUST NOT add a null 2316 terminator before using them as shared secrets. It MUST also accept 2317 a hex encoding of the Shared Secret. The management interface MAY 2318 accept other encodings if the algorithm for translating the encoding 2319 to a binary string is specified. 2321 There are two types of EAP authentication (described in 2322 Section 2.16), and each type uses different values in the AUTH 2323 computations shown above. If the EAP method is key-generating, 2324 substitute MSK for the Shared Secret in the computation. For non- 2325 key-generating methods, substitute SK_pi and SK_pr, respectively, for 2326 the Shared Secret in the two AUTH computations. 2328 2.16. Extensible Authentication Protocol Methods 2330 In addition to authentication using public key signatures and shared 2331 secrets, IKE supports authentication using methods defined in RFC 2332 3748 [EAP]. Typically, these methods are asymmetric (designed for a 2333 user authenticating to a server), and they may not be mutual. For 2334 this reason, these protocols are typically used to authenticate the 2335 initiator to the responder and MUST be used in conjunction with a 2336 public key signature based authentication of the responder to the 2337 initiator. These methods are often associated with mechanisms 2338 referred to as "Legacy Authentication" mechanisms. 2340 While this document references [EAP] with the intent that new methods 2341 can be added in the future without updating this specification, some 2342 simpler variations are documented here. [EAP] defines an 2343 authentication protocol requiring a variable number of messages. 2344 Extensible Authentication is implemented in IKE as additional 2345 IKE_AUTH exchanges that MUST be completed in order to initialize the 2346 IKE SA. 2348 An initiator indicates a desire to use extensible authentication by 2349 leaving out the AUTH payload from the first message in the IKE_AUTH 2350 exchange. (Note that the AUTH payload is required for non-EAP 2351 authentication, and is thus not marked as optional in the rest of 2352 this document.) By including an IDi payload but not an AUTH payload, 2353 the initiator has declared an identity but has not proven it. If the 2354 responder is willing to use an extensible authentication method, it 2355 will place an Extensible Authentication Protocol (EAP) payload in the 2356 response of the IKE_AUTH exchange and defer sending SAr2, TSi, and 2357 TSr until initiator authentication is complete in a subsequent 2358 IKE_AUTH exchange. In the case of a minimal extensible 2359 authentication, the initial SA establishment will appear as follows: 2361 Initiator Responder 2362 ------------------------------------------------------------------- 2363 HDR, SAi1, KEi, Ni --> 2364 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 2365 HDR, SK {IDi, [CERTREQ,] 2366 [IDr,] SAi2, 2367 TSi, TSr} --> 2368 <-- HDR, SK {IDr, [CERT,] AUTH, 2369 EAP } 2370 HDR, SK {EAP} --> 2371 <-- HDR, SK {EAP (success)} 2372 HDR, SK {AUTH} --> 2373 <-- HDR, SK {AUTH, SAr2, TSi, TSr } 2375 As described in Section 2.2, when EAP is used, each pair of IKE SA 2376 initial setup messages will have their message numbers incremented; 2377 the first pair of AUTH messages will have an ID of 1, the second will 2378 be 2, and so on. 2380 For EAP methods that create a shared key as a side effect of 2381 authentication, that shared key MUST be used by both the initiator 2382 and responder to generate AUTH payloads in messages 7 and 8 using the 2383 syntax for shared secrets specified in Section 2.15. The shared key 2384 from EAP is the field from the EAP specification named MSK. This 2385 shared key generated during an IKE exchange MUST NOT be used for any 2386 other purpose. 2388 EAP methods that do not establish a shared key SHOULD NOT be used, as 2389 they are subject to a number of man-in-the-middle attacks [EAPMITM] 2390 if these EAP methods are used in other protocols that do not use a 2391 server-authenticated tunnel. Please see the Security Considerations 2392 section for more details. If EAP methods that do not generate a 2393 shared key are used, the AUTH payloads in messages 7 and 8 MUST be 2394 generated using SK_pi and SK_pr, respectively. 2396 The initiator of an IKE SA using EAP needs to be capable of extending 2397 the initial protocol exchange to at least ten IKE_AUTH exchanges in 2398 the event the responder sends notification messages and/or retries 2399 the authentication prompt. Once the protocol exchange defined by the 2400 chosen EAP authentication method has successfully terminated, the 2401 responder MUST send an EAP payload containing the Success message. 2402 Similarly, if the authentication method has failed, the responder 2403 MUST send an EAP payload containing the Failure message. The 2404 responder MAY at any time terminate the IKE exchange by sending an 2405 EAP payload containing the Failure message. 2407 Following such an extended exchange, the EAP AUTH payloads MUST be 2408 included in the two messages following the one containing the EAP 2409 Success message. 2411 When the initiator authentication uses EAP, it is possible that the 2412 contents of the IDi payload is used only for AAA routing purposes and 2413 selecting which EAP method to use. This value may be different from 2414 the identity authenticated by the EAP method. It is important that 2415 policy lookups and access control decisions use the actual 2416 authenticated identity. Often the EAP server is implemented in a 2417 separate AAA server that communicates with the IKEv2 responder. In 2418 this case, the authenticated identity, if different from that in the 2419 IDi payload, has to be sent from the AAA server to the IKEv2 2420 responder. 2422 2.17. Generating Keying Material for Child SAs 2424 A single Child SA is created by the IKE_AUTH exchange, and additional 2425 Child SAs can optionally be created in CREATE_CHILD_SA exchanges. 2426 Keying material for them is generated as follows: 2428 KEYMAT = prf+(SK_d, Ni | Nr) 2430 Where Ni and Nr are the nonces from the IKE_SA_INIT exchange if this 2431 request is the first Child SA created or the fresh Ni and Nr from the 2432 CREATE_CHILD_SA exchange if this is a subsequent creation. 2434 For CREATE_CHILD_SA exchanges including an optional Diffie-Hellman 2435 exchange, the keying material is defined as: 2437 KEYMAT = prf+(SK_d, g^ir (new) | Ni | Nr ) 2439 where g^ir (new) is the shared secret from the ephemeral Diffie- 2440 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 2441 octet string in big endian order padded with zeros in the high-order 2442 bits if necessary to make it the length of the modulus). 2444 A single CHILD_SA negotiation may result in multiple security 2445 associations. ESP and AH SAs exist in pairs (one in each direction), 2446 so two SAs are created in a single Child SA negotiation for them. 2447 Furthermore, Child SA negotiation may include some future IPsec 2448 protocol(s) in addition to, or instead of, ESP or AH (for example, 2449 ROHC_INTEG as described in [ROHCV2]). In any case, keying material 2450 for each child SA MUST be taken from the expanded KEYMAT using the 2451 following rules: 2453 o All keys for SAs carrying data from the initiator to the responder 2454 are taken before SAs going from the responder to the initiator. 2456 o If multiple IPsec protocols are negotiated, keying material for 2457 each Child SA is taken in the order in which the protocol headers 2458 will appear in the encapsulated packet. 2460 o If an IPsec protocol requires multiple keys, the order in which 2461 they are taken from the SA's keying material needs to be described 2462 in the protocol's specification. For ESP and AH, [IPSECARCH] 2463 defines the order, namely: the encryption key (if any) MUST be 2464 taken from the first bits and the integrity key (if any) MUST be 2465 taken from the remaining bits. 2467 Each cryptographic algorithm takes a fixed number of bits of keying 2468 material specified as part of the algorithm, or negotiated in SA 2469 payloads (see Section 2.13 for description of key lengths, and 2470 Section 3.3.5 for the definition of the Key Length transform 2471 attribute). 2473 2.18. Rekeying IKE SAs Using a CREATE_CHILD_SA Exchange 2475 The CREATE_CHILD_SA exchange can be used to rekey an existing IKE SA 2476 (see Section 1.3.2 and Section 2.8). New initiator and responder 2477 SPIs are supplied in the SPI fields in the Proposal structures inside 2478 the Security Association (SA) payloads (not the SPI fields in the IKE 2479 header). The TS payloads are omitted when rekeying an IKE SA. 2480 SKEYSEED for the new IKE SA is computed using SK_d from the existing 2481 IKE SA as follows: 2483 SKEYSEED = prf(SK_d (old), g^ir (new) | Ni | Nr) 2485 where g^ir (new) is the shared secret from the ephemeral Diffie- 2486 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 2487 octet string in big endian order padded with zeros if necessary to 2488 make it the length of the modulus) and Ni and Nr are the two nonces 2489 stripped of any headers. 2491 The old and new IKE SA may have selected a different PRF. Because 2492 the rekeying exchange belongs to the old IKE SA, it is the old IKE 2493 SA's PRF that is used to generate SKEYSEED. 2495 The main reason for rekeying the IKE SA is to ensure that the 2496 compromise of old keying material does not provide information about 2497 the current keys, or vice versa. Therefore, implementations MUST 2498 perform a new Diffie-Hellman exchange when rekeying the IKE SA. In 2499 other words, an initiator MUST NOT propose the value "NONE" for the 2500 Diffie-Hellman transform, and a responder MUST NOT accept such a 2501 proposal. This means that a successful exchange rekeying the IKE SA 2502 always includes the KEi/KEr payloads. 2504 The new IKE SA MUST reset its message counters to 0. 2506 SK_d, SK_ai, SK_ar, SK_ei, and SK_er are computed from SKEYSEED as 2507 specified in Section 2.14, using SPIi, SPIr, Ni, and Nr from the new 2508 exchange, and using the new IKE SA's PRF. 2510 2.19. Requesting an Internal Address on a Remote Network 2512 Most commonly occurring in the endpoint-to-security-gateway scenario, 2513 an endpoint may need an IP address in the network protected by the 2514 security gateway and may need to have that address dynamically 2515 assigned. A request for such a temporary address can be included in 2516 any request to create a Child SA (including the implicit request in 2517 message 3) by including a CP payload. Note, however, it is usual to 2518 only assign one IP address during the IKE_AUTH exchange. That 2519 address persists at least until the deletion of the IKE SA. 2521 This function provides address allocation to an IPsec Remote Access 2522 Client (IRAC) trying to tunnel into a network protected by an IPsec 2523 Remote Access Server (IRAS). Since the IKE_AUTH exchange creates an 2524 IKE SA and a Child SA, the IRAC MUST request the IRAS-controlled 2525 address (and optionally other information concerning the protected 2526 network) in the IKE_AUTH exchange. The IRAS may procure an address 2527 for the IRAC from any number of sources such as a DHCP/BOOTP server 2528 or its own address pool. 2530 Initiator Responder 2531 ------------------------------------------------------------------- 2532 HDR, SK {IDi, [CERT,] 2533 [CERTREQ,] [IDr,] AUTH, 2534 CP(CFG_REQUEST), SAi2, 2535 TSi, TSr} --> 2536 <-- HDR, SK {IDr, [CERT,] AUTH, 2537 CP(CFG_REPLY), SAr2, 2538 TSi, TSr} 2540 In all cases, the CP payload MUST be inserted before the SA payload. 2541 In variations of the protocol where there are multiple IKE_AUTH 2542 exchanges, the CP payloads MUST be inserted in the messages 2543 containing the SA payloads. 2545 CP(CFG_REQUEST) MUST contain at least an INTERNAL_ADDRESS attribute 2546 (either IPv4 or IPv6) but MAY contain any number of additional 2547 attributes the initiator wants returned in the response. 2549 For example, message from initiator to responder: 2551 CP(CFG_REQUEST)= 2552 INTERNAL_ADDRESS() 2553 TSi = (0, 0-65535,0.0.0.0-255.255.255.255) 2554 TSr = (0, 0-65535,0.0.0.0-255.255.255.255) 2556 NOTE: Traffic selectors contain (protocol, port range, address 2557 range). 2559 Message from responder to initiator: 2561 CP(CFG_REPLY)= 2562 INTERNAL_ADDRESS(192.0.2.202) 2563 INTERNAL_NETMASK(255.255.255.0) 2564 INTERNAL_SUBNET(192.0.2.0/255.255.255.0) 2565 TSi = (0, 0-65535,192.0.2.202-192.0.2.202) 2566 TSr = (0, 0-65535,192.0.2.0-192.0.2.255) 2568 All returned values will be implementation dependent. As can be seen 2569 in the above example, the IRAS MAY also send other attributes that 2570 were not included in CP(CFG_REQUEST) and MAY ignore the non- 2571 mandatory attributes that it does not support. 2573 The responder MUST NOT send a CFG_REPLY without having first received 2574 a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS 2575 to perform an unnecessary configuration lookup if the IRAC cannot 2576 process the REPLY. 2578 In the case where the IRAS's configuration requires that CP be used 2579 for a given identity IDi, but IRAC has failed to send a 2580 CP(CFG_REQUEST), IRAS MUST fail the request, and terminate the Child 2581 SA creation with a FAILED_CP_REQUIRED error. The FAILED_CP_REQUIRED 2582 is not fatal to the IKE SA; it simply causes the Child SA creation to 2583 fail. The initiator can fix this by later starting a new 2584 configuration payload request. There is no associated data in the 2585 FAILED_CP_REQUIRED error. 2587 2.20. Requesting the Peer's Version 2589 An IKE peer wishing to inquire about the other peer's IKE software 2590 version information MAY use the method below. This is an example of 2591 a configuration request within an INFORMATIONAL exchange, after the 2592 IKE SA and first Child SA have been created. 2594 An IKE implementation MAY decline to give out version information 2595 prior to authentication or even after authentication in case some 2596 implementation is known to have some security weakness. In that 2597 case, it MUST either return an empty string or no CP payload if CP is 2598 not supported. 2600 Initiator Responder 2601 ------------------------------------------------------------------- 2602 HDR, SK{CP(CFG_REQUEST)} --> 2603 <-- HDR, SK{CP(CFG_REPLY)} 2605 CP(CFG_REQUEST)= 2606 APPLICATION_VERSION("") 2608 CP(CFG_REPLY) APPLICATION_VERSION("foobar v1.3beta, (c) Foo Bar 2609 Inc.") 2611 2.21. Error Handling 2613 There are many kinds of errors that can occur during IKE processing. 2614 The general rule is that if a request is received that is badly 2615 formatted, or unacceptable for reasons of policy (such as no matching 2616 cryptographic algorithms), the response contains a Notify payload 2617 indicating the error. The decision whether or not to send such a 2618 response depends whether or not there is an authenticated IKE SA. 2620 If there is an error parsing or processing a response packet, the 2621 general rule is to not send back any error message because responses 2622 should not generate new requests (and a new request would be the only 2623 way to send back an error message). Such errors in parsing or 2624 processing response packets should still cause the recipient to clean 2625 up the IKE state (for example, by sending a DELETE for a bad SA). 2627 Only authentication failures (AUTHENTICATION_FAILED and EAP failure) 2628 and malformed messages (INVALID_SYNTAX) lead to a deletion of the IKE 2629 SA without requiring an explicit INFORMATIONAL exchange carrying a 2630 DELETE payload. Other error conditions MAY require such an exchange 2631 if policy dictates that this is needed. If the exchange is 2632 terminated with EAP Failure, an AUTHENTICATION_FAILED notification is 2633 not sent. 2635 2.21.1. Error Handling in IKE_SA_INIT 2637 Errors that occur before a cryptographically protected IKE SA is 2638 established need to be handled very carefully. There is a trade-off 2639 between wanting to help the peer to diagnose a problem and thus 2640 responding to the error, and wanting to avoid being part of a DoS 2641 attack based on forged messages. 2643 In an IKE_SA_INIT exchange, any error notification causes the 2644 exchange to fail. Note that some error notifications such as COOKIE, 2645 INVALID_KE_PAYLOAD or INVALID_MAJOR_VERSION may lead to a subsequent 2646 successful exchange. Because all error notifications are completely 2647 unauthenticated, the recipient should continue trying for some time 2648 before giving up. The recipient should not immediately act based on 2649 the error notification unless corrective actions are defined in this 2650 specification, such as for COOKIE, INVALID_KE_PAYLOAD, and 2651 INVALID_MAJOR_VERSION. 2653 2.21.2. Error Handling in IKE_AUTH 2655 All errors that occur in an IKE_AUTH exchange, causing the 2656 authentication to fail for whatever reason (invalid shared secret, 2657 invalid ID, untrusted certificate issuer, revoked or expired 2658 certificate, etc.) SHOULD result in an AUTHENTICATION_FAILED 2659 notification. If the error occurred on the responder, the 2660 notification is returned in the protected response, and is usually 2661 the only payload in that response. Although the IKE_AUTH messages 2662 are encrypted and integrity protected, if the peer receiving this 2663 notification has not authenticated the other end yet, that peer needs 2664 to treat the information with caution. 2666 If the error occurs on the initiator, the notification MAY be 2667 returned in a separate INFORMATIONAL exchange, usually with no other 2668 payloads. This is an exception for the general rule of not starting 2669 new exchanges based on errors in responses. 2671 Note, however, that request messages that contain an unsupported 2672 critical payload, or where the whole message is malformed (rather 2673 than just bad payload contents), MUST be rejected in their entirety, 2674 and MUST only lead to an UNSUPPORTED_CRITICAL_PAYLOAD or 2675 INVALID_SYNTAX Notification sent as a response. The receiver should 2676 not verify the payloads related to authentication in this case. 2678 If authentication has succeeded in the IKE_AUTH exchange, the IKE SA 2679 is established; however, establishing the Child SA or requesting 2680 configuration information may still fail. This failure does not 2681 automatically cause the IKE SA to be deleted. Specifically, a 2682 responder may include all the payloads associated with authentication 2683 (IDr, Cert and AUTH) while sending error notifications for the 2684 piggybacked exchanges (FAILED_CP_REQUIRED, NO_PROPOSAL_CHOSEN, and so 2685 on), and the initiator MUST NOT fail the authentication because of 2686 this. The initiator MAY, of course, for reasons of policy later 2687 delete such an IKE SA. 2689 In an IKE_AUTH exchange, or in the INFORMATIONAL exchange immediately 2690 following it (in case an error happened when processing a response to 2691 IKE_AUTH), the UNSUPPORTED_CRITICAL_PAYLOAD, INVALID_SYNTAX, and 2692 AUTHENTICATION_FAILED notifications are the only ones to cause the 2693 IKE SA to be deleted or not created, without a DELETE payload. 2694 Extension documents may define new error notifications with these 2695 semantics, but MUST NOT use them unless the peer has been shown to 2696 understand them, such as by using the Vendor ID payload. 2698 2.21.3. Error Handling after IKE SA is Authenticated 2700 After the IKE SA is authenticated all requests having errors MUST 2701 result in a response notifying about the error. 2703 In normal situations, there should not be cases where a valid 2704 response from one peer results in an error situation in the other 2705 peer, so there should not be any reason for a peer to send error 2706 messages to the other end except as a response. Because sending such 2707 error messages as an INFORMATIONAL exchange might lead to further 2708 errors that could cause loops, such errors SHOULD NOT be sent. If 2709 errors are seen that indicate that the peers do not have the same 2710 state, it might be good to delete the IKE SA to clean up state and 2711 start over. 2713 If a peer parsing a request notices that it is badly formatted (after 2714 it has passed the message authentication code checks and window 2715 checks) and it returns an INVALID_SYNTAX notification, then this 2716 error notification is considered fatal in both peers, meaning that 2717 the IKE SA is deleted without needing an explicit DELETE payload. 2719 2.21.4. Error Handling Outside IKE SA 2721 A node needs to limit the rate at which it will send messages in 2722 response to unprotected messages. 2724 If a node receives a message on UDP port 500 or 4500 outside the 2725 context of an IKE SA known to it (and the message is not a request to 2726 start an IKE SA), this may be the result of a recent crash of the 2727 node. If the message is marked as a response, the node can audit the 2728 suspicious event but MUST NOT respond. If the message is marked as a 2729 request, the node can audit the suspicious event and MAY send a 2730 response. If a response is sent, the response MUST be sent to the IP 2731 address and port from where it came with the same IKE SPIs and the 2732 Message ID copied. The response MUST NOT be cryptographically 2733 protected and MUST contain an INVALID_IKE_SPI Notify payload. The 2734 INVALID_IKE_SPI notification indicates an IKE message was received 2735 with an unrecognized destination SPI; this usually indicates that the 2736 recipient has rebooted and forgotten the existence of an IKE SA. 2738 A peer receiving such an unprotected Notify payload MUST NOT respond 2739 and MUST NOT change the state of any existing SAs. The message might 2740 be a forgery or might be a response that a genuine correspondent was 2741 tricked into sending. A node should treat such a message (and also a 2742 network message like ICMP destination unreachable) as a hint that 2743 there might be problems with SAs to that IP address and should 2744 initiate a liveness check for any such IKE SA. An implementation 2745 SHOULD limit the frequency of such tests to avoid being tricked into 2746 participating in a DoS attack. 2748 If an error occurs outside the context of an IKE request (e.g., the 2749 node is getting ESP messages on a nonexistent SPI), the node SHOULD 2750 initiate an INFORMATIONAL exchange with a Notify payload describing 2751 the problem. 2753 A node receiving a suspicious message from an IP address (and port, 2754 if NAT traversal is used) with which it has an IKE SA SHOULD send an 2755 IKE Notify payload in an IKE INFORMATIONAL exchange over that SA. 2756 The recipient MUST NOT change the state of any SAs as a result, but 2757 may wish to audit the event to aid in diagnosing malfunctions. 2759 2.22. IPComp 2761 Use of IP compression [IP-COMP] can be negotiated as part of the 2762 setup of a Child SA. While IP compression involves an extra header 2763 in each packet and a compression parameter index (CPI), the virtual 2764 "compression association" has no life outside the ESP or AH SA that 2765 contains it. Compression associations disappear when the 2766 corresponding ESP or AH SA goes away. It is not explicitly mentioned 2767 in any DELETE payload. 2769 Negotiation of IP compression is separate from the negotiation of 2770 cryptographic parameters associated with a Child SA. A node 2771 requesting a Child SA MAY advertise its support for one or more 2772 compression algorithms through one or more Notify payloads of type 2773 IPCOMP_SUPPORTED. This Notify message may be included only in a 2774 message containing an SA payload negotiating a Child SA and indicates 2775 a willingness by its sender to use IPComp on this SA. The response 2776 MAY indicate acceptance of a single compression algorithm with a 2777 Notify payload of type IPCOMP_SUPPORTED. These payloads MUST NOT 2778 occur in messages that do not contain SA payloads. 2780 The data associated with this Notify message includes a two-octet 2781 IPComp CPI followed by a one-octet transform ID optionally followed 2782 by attributes whose length and format are defined by that transform 2783 ID. A message proposing an SA may contain multiple IPCOMP_SUPPORTED 2784 notifications to indicate multiple supported algorithms. A message 2785 accepting an SA may contain at most one. 2787 The transform IDs are listed here. The values in the following table 2788 are only current as of the publication date of RFC 4306. Other 2789 values may have been added since then or will be added after the 2790 publication of this document. Readers should refer to [IKEV2IANA] 2791 for the latest values. 2793 Name Number Defined In 2794 ------------------------------------- 2795 IPCOMP_OUI 1 2796 IPCOMP_DEFLATE 2 RFC 2394 2797 IPCOMP_LZS 3 RFC 2395 2798 IPCOMP_LZJH 4 RFC 3051 2800 Although there has been discussion of allowing multiple compression 2801 algorithms to be accepted and to have different compression 2802 algorithms available for the two directions of a Child SA, 2803 implementations of this specification MUST NOT accept an IPComp 2804 algorithm that was not proposed, MUST NOT accept more than one, and 2805 MUST NOT compress using an algorithm other than one proposed and 2806 accepted in the setup of the Child SA. 2808 A side effect of separating the negotiation of IPComp from 2809 cryptographic parameters is that it is not possible to propose 2810 multiple cryptographic suites and propose IP compression with some of 2811 them but not others. 2813 In some cases, Robust Header Compression (ROHC) may be more 2814 appropriate than IP Compression. [ROHCV2] defines the use of ROHC 2815 with IKEv2 and IPsec. 2817 2.23. NAT Traversal 2819 Network Address Translation (NAT) gateways are a controversial 2820 subject. This section briefly describes what they are and how they 2821 are likely to act on IKE traffic. Many people believe that NATs are 2822 evil and that we should not design our protocols so as to make them 2823 work better. IKEv2 does specify some unintuitive processing rules in 2824 order that NATs are more likely to work. 2826 NATs exist primarily because of the shortage of IPv4 addresses, 2827 though there are other rationales. IP nodes that are "behind" a NAT 2828 have IP addresses that are not globally unique, but rather are 2829 assigned from some space that is unique within the network behind the 2830 NAT but that are likely to be reused by nodes behind other NATs. 2831 Generally, nodes behind NATs can communicate with other nodes behind 2832 the same NAT and with nodes with globally unique addresses, but not 2833 with nodes behind other NATs. There are exceptions to that rule. 2834 When those nodes make connections to nodes on the real Internet, the 2835 NAT gateway "translates" the IP source address to an address that 2836 will be routed back to the gateway. Messages to the gateway from the 2837 Internet have their destination addresses "translated" to the 2838 internal address that will route the packet to the correct endnode. 2840 NATs are designed to be "transparent" to endnodes. Neither software 2841 on the node behind the NAT nor the node on the Internet requires 2842 modification to communicate through the NAT. Achieving this 2843 transparency is more difficult with some protocols than with others. 2844 Protocols that include IP addresses of the endpoints within the 2845 payloads of the packet will fail unless the NAT gateway understands 2846 the protocol and modifies the internal references as well as those in 2847 the headers. Such knowledge is inherently unreliable, is a network 2848 layer violation, and often results in subtle problems. 2850 Opening an IPsec connection through a NAT introduces special 2851 problems. If the connection runs in transport mode, changing the IP 2852 addresses on packets will cause the checksums to fail and the NAT 2853 cannot correct the checksums because they are cryptographically 2854 protected. Even in tunnel mode, there are routing problems because 2855 transparently translating the addresses of AH and ESP packets 2856 requires special logic in the NAT and that logic is heuristic and 2857 unreliable in nature. For that reason, IKEv2 will use UDP 2858 encapsulation of IKE and ESP packets. This encoding is slightly less 2859 efficient but is easier for NATs to process. In addition, firewalls 2860 may be configured to pass UDP-encapsulated IPsec traffic but not 2861 plain, unencapsulated ESP/AH or vice versa. 2863 It is a common practice of NATs to translate TCP and UDP port numbers 2864 as well as addresses and use the port numbers of inbound packets to 2865 decide which internal node should get a given packet. For this 2866 reason, even though IKE packets MUST be sent from and to UDP port 500 2867 or 4500, they MUST be accepted coming from any port and responses 2868 MUST be sent to the port from whence they came. This is because the 2869 ports may be modified as the packets pass through NATs. Similarly, 2870 IP addresses of the IKE endpoints are generally not included in the 2871 IKE payloads because the payloads are cryptographically protected and 2872 could not be transparently modified by NATs. 2874 Port 4500 is reserved for UDP-encapsulated ESP and IKE. An IPsec 2875 endpoint that discovers a NAT between it and its correspondent (as 2876 described below) MUST send all subsequent traffic from port 4500, 2877 which NATs should not treat specially (as they might with port 500). 2879 An initiator can use port 4500 for both IKE and ESP, regardless of 2880 whether or not there is a NAT, even at the beginning of IKE. When 2881 either side is using port 4500, sending ESP with UDP encapsulation is 2882 not required, but understanding received UDP encapsulated ESP packets 2883 is required. UDP encapsulation MUST NOT be done on port 500. If 2884 NAT-T is supported (that is, if NAT_DETECTION_*_IP payloads were 2885 exchanged during IKE_SA_INIT), all devices MUST be able to receive 2886 and process both UDP encapsulated ESP and non-UDP encapsulated ESP 2887 packets at any time. Either side can decide whether or not to use 2888 UDP encapsulation for ESP irrespective of the choice made by the 2889 other side. However, if a NAT is detected, both devices MUST use UDP 2890 encapsulation for ESP. 2892 The specific requirements for supporting NAT traversal [NATREQ] are 2893 listed below. Support for NAT traversal is optional. In this 2894 section only, requirements listed as MUST apply only to 2895 implementations supporting NAT traversal. 2897 o Both IKE initiator and responder MUST include in their IKE_SA_INIT 2898 packets Notify payloads of type NAT_DETECTION_SOURCE_IP and 2899 NAT_DETECTION_DESTINATION_IP. Those payloads can be used to 2900 detect if there is NAT between the hosts, and which end is behind 2901 the NAT. The location of the payloads in the IKE_SA_INIT packets 2902 is just after the Ni and Nr payloads (before the optional CERTREQ 2903 payload). 2905 o The data associated with the NAT_DETECTION_SOURCE_IP notification 2906 is a SHA-1 digest of the SPIs (in the order they appear in the 2907 header), IP address, and port from which this packet was sent. 2908 There MAY be multiple NAT_DETECTION_SOURCE_IP payloads in a 2909 message if the sender does not know which of several network 2910 attachments will be used to send the packet. 2912 o The data associated with the NAT_DETECTION_DESTINATION_IP 2913 notification is a SHA-1 digest of the SPIs (in the order they 2914 appear in the header), IP address, and port to which this packet 2915 was sent. 2917 o The recipient of either the NAT_DETECTION_SOURCE_IP or 2918 NAT_DETECTION_DESTINATION_IP notification MAY compare the supplied 2919 value to a SHA-1 hash of the SPIs, source or recipient IP address 2920 (respectively), address, and port, and if they don't match it 2921 SHOULD enable NAT traversal. In the case there is a mismatch of 2922 the NAT_DETECTION_SOURCE_IP hash with all of the 2923 NAT_DETECTION_SOURCE_IP payloads received, the recipient MAY 2924 reject the connection attempt if NAT traversal is not supported. 2925 In the case of a mismatching NAT_DETECTION_DESTINATION_IP hash, it 2926 means that the system receiving the NAT_DETECTION_DESTINATION_IP 2927 payload is behind a NAT and that system SHOULD start sending 2928 keepalive packets as defined in [UDPENCAPS]; alternately, it MAY 2929 reject the connection attempt if NAT traversal is not supported. 2931 o If none of the NAT_DETECTION_SOURCE_IP payload(s) received matches 2932 the expected value of the source IP and port found from the IP 2933 header of the packet containing the payload, it means that the 2934 system sending those payloads is behind NAT (i.e., someone along 2935 the route changed the source address of the original packet to 2936 match the address of the NAT box). In this case, the system 2937 receiving the payloads should allow dynamic update of the other 2938 systems' IP address, as described later. 2940 o The IKE initiator MUST check the NAT_DETECTION_SOURCE_IP or 2941 NAT_DETECTION_DESTINATION_IP payloads if present and if they do 2942 not match the addresses in the outer packet MUST tunnel all future 2943 IKE and ESP packets associated with this IKE SA over UDP port 2944 4500. 2946 o To tunnel IKE packets over UDP port 4500, the IKE header has four 2947 octets of zero prepended and the result immediately follows the 2948 UDP header. To tunnel ESP packets over UDP port 4500, the ESP 2949 header immediately follows the UDP header. Since the first four 2950 octets of the ESP header contain the SPI, and the SPI cannot 2951 validly be zero, it is always possible to distinguish ESP and IKE 2952 messages. 2954 o Implementations MUST process received UDP-encapsulated ESP packets 2955 even when no NAT was detected. 2957 o The original source and destination IP address required for the 2958 transport mode TCP and UDP packet checksum fixup (see [UDPENCAPS]) 2959 are obtained from the traffic selectors associated with the 2960 exchange. In the case of transport mode NAT traversal, the 2961 traffic selectors MUST contain exactly one IP address, which is 2962 then used as the original IP address. This is covered in greater 2963 detail in Section 2.23.1. 2965 o There are cases where a NAT box decides to remove mappings that 2966 are still alive (for example, the keepalive interval is too long, 2967 or the NAT box is rebooted). This will be apparent to a host if 2968 it receives a packet whose integrity protection validates, but has 2969 a different port, address, or both from the one that was 2970 associated with the SA in the validated packet. When such a 2971 validated packet is found, a host that does not support other 2972 methods of recovery such as MOBIKE [MOBIKE], and that is not 2973 behind a NAT, SHOULD send all packets (including retransmission 2974 packets) to the IP address and port in the validated packet, and 2975 SHOULD store this as the new address and port combination for the 2976 SA (that is, they SHOULD dynamically update the address). A host 2977 behind a NAT SHOULD NOT do this type of dynamic address update if 2978 a validated packet has different port and/or address values 2979 because it opens a possible DoS attack (such as allowing an 2980 attacker to break the connection with a single packet). Also, 2981 dynamic address update should only be done in response to a new 2982 packet; otherwise, an attacker can revert the addresses with old 2983 replayed packets. Because of this, dynamic update can only be 2984 done safely if replay protection is enabled. When IKEv2 is used 2985 with MOBIKE, dynamically updating the addresses described above 2986 interferes with MOBIKE's way of recovering from the same 2987 situation. See Section 3.8 of [MOBIKE] for more information. 2989 2.23.1. Transport Mode NAT Traversal 2991 Transport mode used with NAT Traversal requires special handling of 2992 the traffic selectors used in the IKEv2. The complete scenario looks 2993 like: 2995 +------+ +------+ +------+ +------+ 2996 |Client| IP1 | NAT | IPN1 IPN2 | NAT | IP2 |Server| 2997 |node |<------>| A |<---------->| B |<------->| | 2998 +------+ +------+ +------+ +------+ 3000 (Other scenarios are simplifications of this complex case, so this 3001 discussion uses the complete scenario.) 3003 In this scenario, there are two address translating NATs: NAT A and 3004 NAT B. NAT A is dynamic NAT that maps the clients source address IP1 3005 to IPN1. NAT B is static NAT configured so that connections coming 3006 to IPN2 address are mapped to the gateways address IP2, that is, IPN2 3007 destination address is mapped to IP2. This allows the client to 3008 connect to a server by connecting to the IPN2. NAT B does not 3009 necessarily need to be a static NAT, but the client needs to know how 3010 to connect to the server, and it can only do that if it somehow knows 3011 the outer address of the NAT B, that is, the IPN2 address. If NAT B 3012 is a static NAT, then its address can be configured to the client's 3013 configuration. Other options would be find it using some other 3014 protocol (like DNS), but those are outside of scope of IKEv2. 3016 In this scenario, both client and server are configured to use 3017 transport mode for the traffic originating from the client node and 3018 destined to the server. 3020 When the client starts creating the IKEv2 SA and Child SA for sending 3021 traffic to the server, it may have a triggering packet with source IP 3022 address of IP1, and a destination IP address of IPN2. Its PAD and 3023 SPD needs to have configuration matching those addresses (or wildcard 3024 entries covering them). Because this is transport mode, it uses 3025 exactly same addresses as the traffic selectors and outer IP address 3026 of the IKE packets. For transport mode, it MUST use exactly one IP 3027 address in the TSi and TSr payloads. It can have multiple traffic 3028 selectors if it has, for example, multiple port ranges that it wants 3029 to negotiate, but all TSi entries must use IP1-IP1 range as the IP 3030 addresses, and all TSr entries must have the IPN2-IPN2 range as IP 3031 addresses. The first traffic selector of TSi and TSr SHOULD have 3032 very specific traffic selectors including protocol and port numbers, 3033 such as from the packet triggering the request. 3035 NAT A will then replace the source address of the IKE packet from IP1 3036 to IPN1, and NAT B will replace the destination address of the IKE 3037 packet from IPN2 to IP2, so when the packet arrives to the server it 3038 will still have the exactly same traffic selectors which were sent by 3039 the client, but the IP address of the IKE packet has been replaced to 3040 IPN1 and IP2. 3042 When the server receives this packet, it normally looks in the Peer 3043 Authorization Database (PAD) described in RFC 4301 [IPSECARCH] based 3044 on the ID and then searches the SPD based on the traffic selectors. 3045 Because IP1 does not really mean anything to the server (it is the 3046 address client has behind the NAT), it is useless to do a lookup 3047 based on that if transport mode is used. On the other hand, the 3048 server cannot know whether transport mode is allowed by its policy 3049 before it finds the matching SPD entry. 3051 In this case, the server should first check that the initiator 3052 requested transport mode, and then do address substitution on the 3053 traffic selectors. It needs to first store the old traffic selector 3054 IP addresses to be used later for the incremental checksum fixup (the 3055 IP address in the TSi can be stored as the original source address 3056 and the IP address in the TSr can be stored as the original 3057 destination address). After that, if the other end was detected as 3058 being behind a NAT, the server replaces the IP address in TSi 3059 payloads with the IP address obtained from the source address of the 3060 IKE packet received (that is, it replaces IP1 in TSi with IPN1). If 3061 the server's end was detected to be behind NAT, it replaces the IP 3062 address in the TSr payloads with the IP address obtained from the 3063 destination address of the IKE packet received (that is, it replaces 3064 IPN2 in TSr with IP2). 3066 After this address substitution, both the traffic selectors and the 3067 IKE UDP source/destination addresses look the same, and the server 3068 does SPD lookup based on those new traffic selectors. If an entry is 3069 found and it allows transport mode, then that entry is used. If an 3070 entry is found but it does not allow transport mode, then the server 3071 MAY undo the address substitution and redo the SPD lookup using the 3072 original traffic selectors. If the second lookup succeeds, the 3073 server will create an SA in tunnel mode using real traffic selectors 3074 sent by the other end. 3076 This address substitution in transport mode is needed because the SPD 3077 is looked up using the addresses that will be seen by the local host. 3078 This also will make sure the SAD entries for the tunnel exit checks 3079 and return packets is added using the addresses as seen by the local 3080 operating system stack. 3082 The most common case is that the server's SPD will contain wildcard 3083 entries matching any addresses, but this allows also making different 3084 SPD entries, for example, for different known NATs' outer addresses. 3086 After the SPD lookup, the server will do traffic selector narrowing 3087 based on the SPD entry it found. It will again use the already- 3088 substituted traffic selectors, and it will thus send back traffic 3089 selectors having IPN1 and IP2 as their IP addresses; it can still 3090 narrow down the protocol number or port ranges used by the traffic 3091 selectors. The SAD entry created for the Child SA will have the 3092 addresses as seen by the server, namely IPN1 and IP2. 3094 When the client receives the server's response to the Child SA, it 3095 will do similar processing. If the transport mode SA was created, 3096 the client can store the original returned traffic selectors as 3097 original source and destination addresses. It will replace the IP 3098 addresses in the traffic selectors with the ones from the IP header 3099 of the IKE packet: it will replace IPN1 with IP1 and IP2 with IPN2. 3100 Then it will use those traffic selectors when verifying the SA 3101 against sent traffic selectors, and when installing the SAD entry. 3103 A summary of the rules for NAT-traversal in transport mode is: 3105 For the client proposing transport mode: 3107 - The TSi entries MUST have exactly one IP address, and that MUST 3108 match the source address of the IKE SA. 3110 - The TSr entries MUST have exactly one IP address, and that MUST 3111 match the destination address of the IKE SA. 3113 - The first TSi and TSr traffic selectors SHOULD have very specific 3114 traffic selectors including protocol and port numbers, such as 3115 from the packet triggering the request. 3117 - There MAY be multiple TSi and TSr entries. 3119 - If transport mode for the SA was selected (that is, if the server 3120 included USE_TRANSPORT_MODE notification in its response): 3122 - Store the original traffic selectors as the received source and 3123 destination address. 3125 - If the server is behind a NAT, substitute the IP address in the 3126 TSr entries with the remote address of the IKE SA. 3128 - If the client is behind a NAT, substitute the IP address in the 3129 TSi entries with the local address of the IKE SA. 3131 - Do address substitution before using those traffic selectors 3132 for anything else other than storing original content of them. 3133 This includes verification that traffic selectors were narrowed 3134 correctly by other end, creation of the SAD entry, and so on. 3136 For the responder, when transport mode is proposed by client: 3138 - Store the original traffic selector IP addresses as received source 3139 and destination address, both in case we need to undo address 3140 substitution, and to use as the "real source and destination 3141 address" specified by [UDPENCAPS], and for TCP/UDP checksum fixup. 3143 - If the client is behind a NAT, substitute the IP address in the 3144 TSi entries with the remote address of the IKE SA. 3146 - If the server is behind a NAT substitute the IP address in the 3147 TSr entries with the local address of the IKE SA. 3149 - Do PAD and SPD lookup using the ID and substituted traffic 3150 selectors. 3152 - If no SPD entry was found, or if found SPD entry does not 3153 allow transport mode, undo the traffic selector substitutions. 3154 Do PAD and SPD lookup again using the ID and original traffic 3155 selectors, but also searching for tunnel mode SPD entry (that 3156 is, fall back to tunnel mode). 3158 - However, if a transport mode SPD entry was found, do normal 3159 traffic selection narrowing based on the substituted traffic 3160 selectors and SPD entry. Use the resulting traffic selectors when 3161 creating SAD entries, and when sending traffic selectors back to 3162 the client. 3164 2.24. Explicit Congestion Notification (ECN) 3166 When IPsec tunnels behave as originally specified in [IPSECARCH-OLD], 3167 ECN usage is not appropriate for the outer IP headers because tunnel 3168 decapsulation processing discards ECN congestion indications to the 3169 detriment of the network. ECN support for IPsec tunnels for IKEv1- 3170 based IPsec requires multiple operating modes and negotiation (see 3171 [ECN]). IKEv2 simplifies this situation by requiring that ECN be 3172 usable in the outer IP headers of all tunnel-mode Child SAs created 3173 by IKEv2. Specifically, tunnel encapsulators and decapsulators for 3174 all tunnel-mode SAs created by IKEv2 MUST support the ECN full- 3175 functionality option for tunnels specified in [ECN] and MUST 3176 implement the tunnel encapsulation and decapsulation processing 3177 specified in [IPSECARCH] to prevent discarding of ECN congestion 3178 indications. 3180 2.25. Exchange Collisions 3182 Because IKEv2 exchanges can be initiated by either peer, it is 3183 possible that two exchanges affecting the same SA partly overlap. 3184 This can lead to a situation where the SA state information is 3185 temporarily not synchronized, and a peer can receive a request that 3186 it cannot process in a normal fashion. 3188 Obviously, using a window size greater than 1 leads to more complex 3189 situations, especially if requests are processed out of order. This 3190 section concentrates on problems that can arise even with a window 3191 size of 1, and recommends solutions. 3193 A TEMPORARY_FAILURE notification SHOULD be sent when a peer receives 3194 a request that cannot be completed due to a temporary condition such 3195 as a rekeying operation. When a peer receives a TEMPORARY_FAILURE 3196 notification, it MUST NOT immediately retry the operation; it MUST 3197 wait so that the sender may complete whatever operation caused the 3198 temporary condition. The recipient MAY retry the request one or more 3199 times over a period of several minutes. If a peer continues to 3200 receive TEMPORARY_FAILURE on the same IKE SA after several minutes, 3201 it SHOULD conclude that the state information is out-of-sync and 3202 close the IKE SA. 3204 A CHILD_SA_NOT_FOUND notification SHOULD be sent when a peer receives 3205 a request to rekey a Child SA that does not exist. The SA that the 3206 initiator attempted to rekey is indicated by the SPI field in the 3207 Notify Payload, which is copied from the SPI field in the REKEY_SA 3208 notification. A peer that receives a CHILD_SA_NOT_FOUND notification 3209 SHOULD silently delete the Child SA (if it still exists) and send a 3210 request to create a new Child SA from scratch (if the Child SA does 3211 not yet exist). 3213 2.25.1. Collisions While Rekeying or Closing Child SAs 3215 If a peer receives a request to rekey a Child SA that it is currently 3216 trying to close, it SHOULD reply with TEMPORARY_FAILURE. If a peer 3217 receives a request to rekey a Child SA that it is currently rekeying, 3218 it SHOULD reply as usual, and SHOULD prepare to close redundant SAs 3219 later based on the nonces (see Section 2.8.1). If a peer receives a 3220 request to rekey a Child SA that does not exist, it SHOULD reply with 3221 CHILD_SA_NOT_FOUND. 3223 If a peer receives a request to close a Child SA that it is currently 3224 trying to close, it SHOULD reply without Delete payloads (see 3225 Section 1.4.1). If a peer receives a request to close a Child SA 3226 that it is currently rekeying, it SHOULD reply as usual, with a 3227 Delete payload. If a peer receives a request to close a Child SA 3228 that does not exist, it SHOULD reply without Delete payloads. 3230 If a peer receives a request to rekey the IKE SA, and it is currently 3231 creating, rekeying, or closing a Child SA of that IKE SA, it SHOULD 3232 reply with TEMPORARY_FAILURE. 3234 2.25.2. Collisions While Rekeying or Closing IKE SAs 3236 If a peer receives a request to rekey an IKE SA that it is currently 3237 rekeying, it SHOULD reply as usual, and SHOULD prepare to close 3238 redundant SAs and move inherited Child SAs later based on the nonces 3239 (see Section 2.8.2). If a peer receives a request to rekey an IKE SA 3240 that it is currently trying to close, it SHOULD reply with 3241 TEMPORARY_FAILURE. 3243 If a peer receives a request to close an IKE SA that it is currently 3244 rekeying, it SHOULD reply as usual, and forget about its own rekeying 3245 request. If a peer receives a request to close an IKE SA that it is 3246 currently trying to close, it SHOULD reply as usual, and forget about 3247 its own close request. 3249 If a peer receives a request to create or rekey a Child SA when it is 3250 currently rekeying the IKE SA, it SHOULD reply with 3251 TEMPORARY_FAILURE. If a peer receives a request to delete a Child SA 3252 when it is currently rekeying the IKE SA, it SHOULD reply as usual, 3253 with a Delete payload. 3255 3. Header and Payload Formats 3257 In the tables in this section, some cryptographic primitives and 3258 configuration attributes are marked as "UNSPECIFIED". These are 3259 items for which there are no known specifications and therefore 3260 interoperability is currently impossible. A future specification may 3261 describe their use, but until such specification is made, 3262 implementations SHOULD NOT attempt to use items marked as 3263 "UNSPECIFIED" in implementations that are meant to be interoperable. 3265 3.1. The IKE Header 3267 IKE messages use UDP ports 500 and/or 4500, with one IKE message per 3268 UDP datagram. Information from the beginning of the packet through 3269 the UDP header is largely ignored except that the IP addresses and 3270 UDP ports from the headers are reversed and used for return packets. 3271 When sent on UDP port 500, IKE messages begin immediately following 3272 the UDP header. When sent on UDP port 4500, IKE messages have 3273 prepended four octets of zero. These four octets of zero are not 3274 part of the IKE message and are not included in any of the length 3275 fields or checksums defined by IKE. Each IKE message begins with the 3276 IKE header, denoted HDR in this document. Following the header are 3277 one or more IKE payloads each identified by a "Next Payload" field in 3278 the preceding payload. Payloads are identified in the order in which 3279 they appear in an IKE message by looking in the "Next Payload" field 3280 in the IKE header, and subsequently according to the "Next Payload" 3281 field in the IKE payload itself until a "Next Payload" field of zero 3282 indicates that no payloads follow. If a payload of type "Encrypted" 3283 is found, that payload is decrypted and its contents parsed as 3284 additional payloads. An Encrypted payload MUST be the last payload 3285 in a packet and an Encrypted payload MUST NOT contain another 3286 Encrypted payload. 3288 The responder's SPI in the header identifies an instance of an IKE 3289 security association. It is therefore possible for a single instance 3290 of IKE to multiplex distinct sessions with multiple peers, including 3291 multiple sessions per peer. 3293 All multi-octet fields representing integers are laid out in big 3294 endian order (also known as "most significant byte first", or 3295 "network byte order"). 3297 The format of the IKE header is shown in Figure 4. 3299 1 2 3 3300 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 3301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3302 | IKE SA Initiator's SPI | 3303 | | 3304 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3305 | IKE SA Responder's SPI | 3306 | | 3307 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3308 | Next Payload | MjVer | MnVer | Exchange Type | Flags | 3309 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3310 | Message ID | 3311 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3312 | Length | 3313 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3315 Figure 4: IKE Header Format 3317 o Initiator's SPI (8 octets) - A value chosen by the initiator to 3318 identify a unique IKE security association. This value MUST NOT 3319 be zero. 3321 o Responder's SPI (8 octets) - A value chosen by the responder to 3322 identify a unique IKE security association. This value MUST be 3323 zero in the first message of an IKE Initial Exchange (including 3324 repeats of that message including a cookie). 3326 o Next Payload (1 octet) - Indicates the type of payload that 3327 immediately follows the header. The format and value of each 3328 payload are defined below. 3330 o Major Version (4 bits) - Indicates the major version of the IKE 3331 protocol in use. Implementations based on this version of IKE 3332 MUST set the Major Version to 2. Implementations based on 3333 previous versions of IKE and ISAKMP MUST set the Major Version to 3334 1. Implementations based on this version of IKE MUST reject or 3335 ignore messages containing a version number greater than 2 with an 3336 INVALID_MAJOR_VERSION notification message as described in Section 3337 2.5. 3339 o Minor Version (4 bits) - Indicates the minor version of the IKE 3340 protocol in use. Implementations based on this version of IKE 3341 MUST set the Minor Version to 0. They MUST ignore the minor 3342 version number of received messages. 3344 o Exchange Type (1 octet) - Indicates the type of exchange being 3345 used. This constrains the payloads sent in each message in an 3346 exchange. The values in the following table are only current as 3347 of the publication date of RFC 4306. Other values may have been 3348 added since then or will be added after the publication of this 3349 document. Readers should refer to [IKEV2IANA] for the latest 3350 values. 3352 Exchange Type Value 3353 ---------------------------------- 3354 IKE_SA_INIT 34 3355 IKE_AUTH 35 3356 CREATE_CHILD_SA 36 3357 INFORMATIONAL 37 3359 o Flags (1 octet) - Indicates specific options that are set for the 3360 message. Presence of options is indicated by the appropriate bit 3361 in the flags field being set. The bits are as follows: 3363 +-+-+-+-+-+-+-+-+ 3364 |X|X|R|V|I|X|X|X| 3365 +-+-+-+-+-+-+-+-+ 3367 In the description below, a bit being 'set' means its value is 3368 '1', while 'cleared' means its value is '0'. "X" bits MUST be 3369 cleared when sending and MUST be ignored on receipt. 3371 * R (Response) - This bit indicates that this message is a 3372 response to a message containing the same message ID. This bit 3373 MUST be cleared in all request messages and MUST be set in all 3374 responses. An IKE endpoint MUST NOT generate a response to a 3375 message that is marked as being a response (with one exception; 3376 see Section 2.21.2). 3378 * V (Version) - This bit indicates that the transmitter is 3379 capable of speaking a higher major version number of the 3380 protocol than the one indicated in the major version number 3381 field. Implementations of IKEv2 MUST clear this bit when 3382 sending and MUST ignore it in incoming messages. 3384 * I (Initiator) - This bit MUST be set in messages sent by the 3385 original initiator of the IKE SA and MUST be cleared in 3386 messages sent by the original responder. It is used by the 3387 recipient to determine which eight octets of the SPI were 3388 generated by the recipient. This bit changes to reflect who 3389 initiated the last rekey of the IKE SA. 3391 o Message ID (4 octets, unsigned integer) - Message identifier used 3392 to control retransmission of lost packets and matching of requests 3393 and responses. It is essential to the security of the protocol 3394 because it is used to prevent message replay attacks. See 3395 Section 2.1 and Section 2.2. 3397 o Length (4 octets, unsigned integer) - Length of total message 3398 (header + payloads) in octets. 3400 3.2. Generic Payload Header 3402 Each IKE payload defined in Section 3.3 through Section 3.16 begins 3403 with a generic payload header, shown in Figure 5. Figures for each 3404 payload below will include the generic payload header, but for 3405 brevity the description of each field will be omitted. 3407 1 2 3 3408 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 3409 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3410 | Next Payload |C| RESERVED | Payload Length | 3411 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3413 Figure 5: Generic Payload Header 3415 The Generic Payload Header fields are defined as follows: 3417 o Next Payload (1 octet) - Identifier for the payload type of the 3418 next payload in the message. If the current payload is the last 3419 in the message, then this field will be 0. This field provides a 3420 "chaining" capability whereby additional payloads can be added to 3421 a message by appending each one to the end of the message and 3422 setting the "Next Payload" field of the preceding payload to 3423 indicate the new payload's type. An Encrypted payload, which must 3424 always be the last payload of a message, is an exception. It 3425 contains data structures in the format of additional payloads. In 3426 the header of an Encrypted payload, the Next Payload field is set 3427 to the payload type of the first contained payload (instead of 0); 3428 conversely, the Next Payload field of the last contained payload 3429 is set to zero). The payload type values are listed here. The 3430 values in the following table are only current as of the 3431 publication date of RFC 4306. Other values may have been added 3432 since then or will be added after the publication of this 3433 document. Readers should refer to [IKEV2IANA] for the latest 3434 values. 3436 Next Payload Type Notation Value 3437 -------------------------------------------------- 3438 No Next Payload 0 3439 Security Association SA 33 3440 Key Exchange KE 34 3441 Identification - Initiator IDi 35 3442 Identification - Responder IDr 36 3443 Certificate CERT 37 3444 Certificate Request CERTREQ 38 3445 Authentication AUTH 39 3446 Nonce Ni, Nr 40 3447 Notify N 41 3448 Delete D 42 3449 Vendor ID V 43 3450 Traffic Selector - Initiator TSi 44 3451 Traffic Selector - Responder TSr 45 3452 Encrypted and Authenticated SK 46 3453 Configuration CP 47 3454 Extensible Authentication EAP 48 3456 (Payload type values 1-32 should not be assigned in the 3457 future so that there is no overlap with the code assignments 3458 for IKEv1.) 3460 o Critical (1 bit) - MUST be set to zero if the sender wants the 3461 recipient to skip this payload if it does not understand the 3462 payload type code in the Next Payload field of the previous 3463 payload. MUST be set to one if the sender wants the recipient to 3464 reject this entire message if it does not understand the payload 3465 type. MUST be ignored by the recipient if the recipient 3466 understands the payload type code. MUST be set to zero for 3467 payload types defined in this document. Note that the critical 3468 bit applies to the current payload rather than the "next" payload 3469 whose type code appears in the first octet. The reasoning behind 3470 not setting the critical bit for payloads defined in this document 3471 is that all implementations MUST understand all payload types 3472 defined in this document and therefore must ignore the Critical 3473 bit's value. Skipped payloads are expected to have valid Next 3474 Payload and Payload Length fields. See Section 2.5 for more 3475 information on this bit. 3477 o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored on 3478 receipt. 3480 o Payload Length (2 octets, unsigned integer) - Length in octets of 3481 the current payload, including the generic payload header. 3483 Many payloads contain fields marked as "RESERVED". Some payloads in 3484 IKEv2 (and historically in IKEv1) are not aligned to 4-octet 3485 boundaries. 3487 3.3. Security Association Payload 3489 The Security Association Payload, denoted SA in this document, is 3490 used to negotiate attributes of a security association. Assembly of 3491 Security Association Payloads requires great peace of mind. An SA 3492 payload MAY contain multiple proposals. If there is more than one, 3493 they MUST be ordered from most preferred to least preferred. Each 3494 proposal contains a single IPsec protocol (where a protocol is IKE, 3495 ESP, or AH), each protocol MAY contain multiple transforms, and each 3496 transform MAY contain multiple attributes. When parsing an SA, an 3497 implementation MUST check that the total Payload Length is consistent 3498 with the payload's internal lengths and counts. Proposals, 3499 Transforms, and Attributes each have their own variable length 3500 encodings. They are nested such that the Payload Length of an SA 3501 includes the combined contents of the SA, Proposal, Transform, and 3502 Attribute information. The length of a Proposal includes the lengths 3503 of all Transforms and Attributes it contains. The length of a 3504 Transform includes the lengths of all Attributes it contains. 3506 The syntax of Security Associations, Proposals, Transforms, and 3507 Attributes is based on ISAKMP; however the semantics are somewhat 3508 different. The reason for the complexity and the hierarchy is to 3509 allow for multiple possible combinations of algorithms to be encoded 3510 in a single SA. Sometimes there is a choice of multiple algorithms, 3511 whereas other times there is a combination of algorithms. For 3512 example, an initiator might want to propose using ESP with either 3513 (3DES and HMAC_MD5) or (AES and HMAC_SHA1). 3515 One of the reasons the semantics of the SA payload has changed from 3516 ISAKMP and IKEv1 is to make the encodings more compact in common 3517 cases. 3519 The Proposal structure contains within it a Proposal Num and an IPsec 3520 protocol ID. Each structure MUST have a proposal number one (1) 3521 greater than the previous structure. The first Proposal in the 3522 initiator's SA payload MUST have a Proposal Num of one (1). One 3523 reason to use multiple proposals is to propose both standard crypto 3524 ciphers and combined-mode ciphers. Combined-mode ciphers include 3525 both integrity and encryption in a single encryption algorithm, and 3526 MUST either offer no integrity algorithm or a single integrity 3527 algorithm of "none", with no integrity algorithm being the 3528 RECOMMENDED method. If an initiator wants to propose both combined- 3529 mode ciphers and normal ciphers, it must include two proposals: one 3530 will have all the combined-mode ciphers, and the other will have all 3531 the normal ciphers with the integrity algorithms. For example, one 3532 such proposal would have two proposal structures. Proposal 1 is ESP 3533 with AES-128, AES-192, and AES-256 bits in CBC mode, with either 3534 HMAC-SHA1-96 or XCBC-96 as the integrity algorithm; Proposal 2 is 3535 AES-128 or AES-256 in GCM mode with an 8-octet ICV. Both proposals 3536 allow but do not require the use of ESN (extended sequence numbers). 3537 This can be illustrated as: 3539 SA Payload 3540 | 3541 +--- Proposal #1 ( Proto ID = ESP(3), SPI size = 4, 3542 | | 7 transforms, SPI = 0x052357bb ) 3543 | | 3544 | +-- Transform ENCR ( Name = ENCR_AES_CBC ) 3545 | | +-- Attribute ( Key Length = 128 ) 3546 | | 3547 | +-- Transform ENCR ( Name = ENCR_AES_CBC ) 3548 | | +-- Attribute ( Key Length = 192 ) 3549 | | 3550 | +-- Transform ENCR ( Name = ENCR_AES_CBC ) 3551 | | +-- Attribute ( Key Length = 256 ) 3552 | | 3553 | +-- Transform INTEG ( Name = AUTH_HMAC_SHA1_96 ) 3554 | +-- Transform INTEG ( Name = AUTH_AES_XCBC_96 ) 3555 | +-- Transform ESN ( Name = ESNs ) 3556 | +-- Transform ESN ( Name = No ESNs ) 3557 | 3558 +--- Proposal #2 ( Proto ID = ESP(3), SPI size = 4, 3559 | 4 transforms, SPI = 0x35a1d6f2 ) 3560 | 3561 +-- Transform ENCR ( Name = AES-GCM with a 8 octet ICV ) 3562 | +-- Attribute ( Key Length = 128 ) 3563 | 3564 +-- Transform ENCR ( Name = AES-GCM with a 8 octet ICV ) 3565 | +-- Attribute ( Key Length = 256 ) 3566 | 3567 +-- Transform ESN ( Name = ESNs ) 3568 +-- Transform ESN ( Name = No ESNs ) 3570 Each Proposal/Protocol structure is followed by one or more transform 3571 structures. The number of different transforms is generally 3572 determined by the Protocol. AH generally has two transforms: 3573 Extended Sequence Numbers (ESN) and an integrity check algorithm. 3574 ESP generally has three: ESN, an encryption algorithm and an 3575 integrity check algorithm. IKE generally has four transforms: a 3576 Diffie-Hellman group, an integrity check algorithm, a PRF algorithm, 3577 and an encryption algorithm. For each Protocol, the set of 3578 permissible transforms is assigned transform ID numbers, which appear 3579 in the header of each transform. 3581 If there are multiple transforms with the same Transform Type, the 3582 proposal is an OR of those transforms. If there are multiple 3583 Transforms with different Transform Types, the proposal is an AND of 3584 the different groups. For example, to propose ESP with (3DES or AES- 3585 CBC) and (HMAC_MD5 or HMAC_SHA), the ESP proposal would contain two 3586 Transform Type 1 candidates (one for 3DES and one for AEC-CBC) and 3587 two Transform Type 3 candidates (one for HMAC_MD5 and one for 3588 HMAC_SHA). This effectively proposes four combinations of 3589 algorithms. If the initiator wanted to propose only a subset of 3590 those, for example (3DES and HMAC_MD5) or (IDEA and HMAC_SHA), there 3591 is no way to encode that as multiple transforms within a single 3592 Proposal. Instead, the initiator would have to construct two 3593 different Proposals, each with two transforms. 3595 A given transform MAY have one or more Attributes. Attributes are 3596 necessary when the transform can be used in more than one way, as 3597 when an encryption algorithm has a variable key size. The transform 3598 would specify the algorithm and the attribute would specify the key 3599 size. Most transforms do not have attributes. A transform MUST NOT 3600 have multiple attributes of the same type. To propose alternate 3601 values for an attribute (for example, multiple key sizes for the AES 3602 encryption algorithm), an implementation MUST include multiple 3603 Transforms with the same Transform Type each with a single Attribute. 3605 Note that the semantics of Transforms and Attributes are quite 3606 different from those in IKEv1. In IKEv1, a single Transform carried 3607 multiple algorithms for a protocol with one carried in the Transform 3608 and the others carried in the Attributes. 3610 1 2 3 3611 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 3612 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3613 | Next Payload |C| RESERVED | Payload Length | 3614 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3615 | | 3616 ~ ~ 3617 | | 3618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3620 Figure 6: Security Association Payload 3622 o Proposals (variable) - One or more proposal substructures. 3624 The payload type for the Security Association Payload is thirty three 3625 (33). 3627 3.3.1. Proposal Substructure 3629 1 2 3 3630 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 3631 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3632 | 0 (last) or 2 | RESERVED | Proposal Length | 3633 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3634 | Proposal Num | Protocol ID | SPI Size |Num Transforms| 3635 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3636 ~ SPI (variable) ~ 3637 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3638 | | 3639 ~ ~ 3640 | | 3641 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3643 Figure 7: Proposal Substructure 3645 o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the 3646 last Proposal Substructure in the SA. This syntax is inherited 3647 from ISAKMP, but is unnecessary because the last Proposal could be 3648 identified from the length of the SA. The value (2) corresponds 3649 to a Payload Type of Proposal in IKEv1, and the first four octets 3650 of the Proposal structure are designed to look somewhat like the 3651 header of a Payload. 3653 o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored on 3654 receipt. 3656 o Proposal Length (2 octets, unsigned integer) - Length of this 3657 proposal, including all transforms and attributes that follow. 3659 o Proposal Num (1 octet) - When a proposal is made, the first 3660 proposal in an SA payload MUST be 1, and subsequent proposals MUST 3661 be one more than the previous proposal (indicating an OR of the 3662 two proposals). When a proposal is accepted, the proposal number 3663 in the SA payload MUST match the number on the proposal sent that 3664 was accepted. 3666 o Protocol ID (1 octet) - Specifies the IPsec protocol identifier 3667 for the current negotiation. The values in the following table 3668 are only current as of the publication date of RFC 4306. Other 3669 values may have been added since then or will be added after the 3670 publication of this document. Readers should refer to [IKEV2IANA] 3671 for the latest values. 3673 Protocol Protocol ID 3674 ----------------------------------- 3675 IKE 1 3676 AH 2 3677 ESP 3 3679 o SPI Size (1 octet) - For an initial IKE SA negotiation, this field 3680 MUST be zero; the SPI is obtained from the outer header. During 3681 subsequent negotiations, it is equal to the size, in octets, of 3682 the SPI of the corresponding protocol (8 for IKE, 4 for ESP and 3683 AH). 3685 o Num Transforms (1 octet) - Specifies the number of transforms in 3686 this proposal. 3688 o SPI (variable) - The sending entity's SPI. Even if the SPI Size 3689 is not a multiple of 4 octets, there is no padding applied to the 3690 payload. When the SPI Size field is zero, this field is not 3691 present in the Security Association payload. 3693 o Transforms (variable) - One or more transform substructures. 3695 3.3.2. Transform Substructure 3697 1 2 3 3698 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 3699 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3700 | 0 (last) or 3 | RESERVED | Transform Length | 3701 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3702 |Transform Type | RESERVED | Transform ID | 3703 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3704 | | 3705 ~ Transform Attributes ~ 3706 | | 3707 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3709 Figure 8: Transform Substructure 3711 o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the 3712 last Transform Substructure in the Proposal. This syntax is 3713 inherited from ISAKMP, but is unnecessary because the last 3714 transform could be identified from the length of the proposal. 3715 The value (3) corresponds to a Payload Type of Transform in IKEv1, 3716 and the first four octets of the Transform structure are designed 3717 to look somewhat like the header of a Payload. 3719 o RESERVED - MUST be sent as zero; MUST be ignored on receipt. 3721 o Transform Length - The length (in octets) of the Transform 3722 Substructure including Header and Attributes. 3724 o Transform Type (1 octet) - The type of transform being specified 3725 in this transform. Different protocols support different 3726 transform types. For some protocols, some of the transforms may 3727 be optional. If a transform is optional and the initiator wishes 3728 to propose that the transform be omitted, no transform of the 3729 given type is included in the proposal. If the initiator wishes 3730 to make use of the transform optional to the responder, it 3731 includes a transform substructure with transform ID = 0 as one of 3732 the options. 3734 o Transform ID (2 octets) - The specific instance of the transform 3735 type being proposed. 3737 The transform type values are listed below. The values in the 3738 following table are only current as of the publication date of RFC 3739 4306. Other values may have been added since then or will be added 3740 after the publication of this document. Readers should refer to 3741 [IKEV2IANA] for the latest values. 3743 Description Trans. Used In 3744 Type 3745 ------------------------------------------------------------------ 3746 Encryption Algorithm (ENCR) 1 IKE and ESP 3747 Pseudo-random Function (PRF) 2 IKE 3748 Integrity Algorithm (INTEG) 3 IKE*, AH, optional in ESP 3749 Diffie-Hellman Group (D-H) 4 IKE, optional in AH & ESP 3750 Extended Sequence Numbers (ESN) 5 AH and ESP 3752 (*) Negotiating an integrity algorithm is mandatory for the 3753 Encrypted payload format specified in this document. For example, 3754 [AEAD] specifies additional formats based on authenticated 3755 encryption, in which a separate integrity algorithm is not 3756 negotiated. 3758 For Transform Type 1 (Encryption Algorithm), the Transform IDs are 3759 listed below. The values in the following table are only current as 3760 of the publication date of RFC 4306. Other values may have been 3761 added since then or will be added after the publication of this 3762 document. Readers should refer to [IKEV2IANA] for the latest values. 3764 Name Number Defined In 3765 --------------------------------------------------- 3766 ENCR_DES_IV64 1 (UNSPECIFIED) 3767 ENCR_DES 2 (RFC2405), [DES] 3768 ENCR_3DES 3 (RFC2451) 3769 ENCR_RC5 4 (RFC2451) 3770 ENCR_IDEA 5 (RFC2451), [IDEA] 3771 ENCR_CAST 6 (RFC2451) 3772 ENCR_BLOWFISH 7 (RFC2451) 3773 ENCR_3IDEA 8 (UNSPECIFIED) 3774 ENCR_DES_IV32 9 (UNSPECIFIED) 3775 ENCR_NULL 11 (RFC2410) 3776 ENCR_AES_CBC 12 (RFC3602) 3777 ENCR_AES_CTR 13 (RFC3686) 3779 For Transform Type 2 (Pseudo-random Function), the Transform IDs are 3780 listed below. The values in the following table are only current as 3781 of the publication date of RFC 4306. Other values may have been 3782 added since then or will be added after the publication of this 3783 document. Readers should refer to [IKEV2IANA] for the latest values. 3785 Name Number Defined In 3786 ------------------------------------------------------ 3787 PRF_HMAC_MD5 1 (RFC2104), [MD5] 3788 PRF_HMAC_SHA1 2 (RFC2104), [SHA] 3789 PRF_HMAC_TIGER 3 (UNSPECIFIED) 3791 For Transform Type 3 (Integrity Algorithm), defined Transform IDs are 3792 listed below. The values in the following table are only current as 3793 of the publication date of RFC 4306. Other values may have been 3794 added since then or will be added after the publication of this 3795 document. Readers should refer to [IKEV2IANA] for the latest values. 3797 Name Number Defined In 3798 ---------------------------------------- 3799 NONE 0 3800 AUTH_HMAC_MD5_96 1 (RFC2403) 3801 AUTH_HMAC_SHA1_96 2 (RFC2404) 3802 AUTH_DES_MAC 3 (UNSPECIFIED) 3803 AUTH_KPDK_MD5 4 (UNSPECIFIED) 3804 AUTH_AES_XCBC_96 5 (RFC3566) 3806 For Transform Type 4 (Diffie-Hellman Group), defined Transform IDs 3807 are listed below. The values in the following table are only current 3808 as of the publication date of RFC 4306. Other values may have been 3809 added since then or will be added after the publication of this 3810 document. Readers should refer to [IKEV2IANA] for the latest values. 3812 Name Number Defined in 3813 ---------------------------------------- 3814 NONE 0 3815 768 Bit MODP 1 Appendix B 3816 1024 Bit MODP 2 Appendix B 3817 1536-bit MODP 5 [ADDGROUP] 3818 2048-bit MODP 14 [ADDGROUP] 3819 3072-bit MODP 15 [ADDGROUP] 3820 4096-bit MODP 16 [ADDGROUP] 3821 6144-bit MODP 17 [ADDGROUP] 3822 8192-bit MODP 18 [ADDGROUP] 3824 Although ESP and AH do not directly include a Diffie-Hellman 3825 exchange, a Diffie-Hellman group MAY be negotiated for the Child SA. 3826 This allows the peers to employ Diffie-Hellman in the CREATE_CHILD_SA 3827 exchange, providing perfect forward secrecy for the generated Child 3828 SA keys. 3830 For Transform Type 5 (Extended Sequence Numbers), defined Transform 3831 IDs are listed below. The values in the following table are only 3832 current as of the publication date of RFC 4306. Other values may 3833 have been added since then or will be added after the publication of 3834 this document. Readers should refer to [IKEV2IANA] for the latest 3835 values. 3837 Name Number 3838 -------------------------------------------- 3839 No Extended Sequence Numbers 0 3840 Extended Sequence Numbers 1 3842 Note that an initiator who supports ESNs will usually include two ESN 3843 transforms, with values "0" and "1", in its proposals. A proposal 3844 containing a single ESN transform with value "1" means that using 3845 normal (non-extended) sequence numbers is not acceptable. 3847 Numerous additional transform types have been defined since the 3848 publication of RFC 4306. Please refer to the IANA IKEv2 registry for 3849 details. 3851 3.3.3. Valid Transform Types by Protocol 3853 The number and type of transforms that accompany an SA payload are 3854 dependent on the protocol in the SA itself. An SA payload proposing 3855 the establishment of an SA has the following mandatory and optional 3856 transform types. A compliant implementation MUST understand all 3857 mandatory and optional types for each protocol it supports (though it 3858 need not accept proposals with unacceptable suites). A proposal MAY 3859 omit the optional types if the only value for them it will accept is 3860 NONE. 3862 Protocol Mandatory Types Optional Types 3863 --------------------------------------------------- 3864 IKE ENCR, PRF, INTEG*, D-H 3865 ESP ENCR, ESN INTEG, D-H 3866 AH INTEG, ESN D-H 3868 (*) Negotiating an integrity algorithm is mandatory for the 3869 Encrypted payload format specified in this document. For example, 3870 [AEAD] specifies additional formats based on authenticated 3871 encryption, in which a separate integrity algorithm is not 3872 negotiated. 3874 3.3.4. Mandatory Transform IDs 3876 The specification of suites that MUST and SHOULD be supported for 3877 interoperability has been removed from this document because they are 3878 likely to change more rapidly than this document evolves. 3880 An important lesson learned from IKEv1 is that no system should only 3881 implement the mandatory algorithms and expect them to be the best 3882 choice for all customers. 3884 It is likely that IANA will add additional transforms in the future, 3885 and some users may want to use private suites, especially for IKE 3886 where implementations should be capable of supporting different 3887 parameters, up to certain size limits. In support of this goal, all 3888 implementations of IKEv2 SHOULD include a management facility that 3889 allows specification (by a user or system administrator) of Diffie- 3890 Hellman parameters (the generator, modulus, and exponent lengths and 3891 values) for new Diffie-Hellman groups. Implementations SHOULD 3892 provide a management interface through which these parameters and the 3893 associated transform IDs may be entered (by a user or system 3894 administrator), to enable negotiating such groups. 3896 All implementations of IKEv2 MUST include a management facility that 3897 enables a user or system administrator to specify the suites that are 3898 acceptable for use with IKE. Upon receipt of a payload with a set of 3899 transform IDs, the implementation MUST compare the transmitted 3900 transform IDs against those locally configured via the management 3901 controls, to verify that the proposed suite is acceptable based on 3902 local policy. The implementation MUST reject SA proposals that are 3903 not authorized by these IKE suite controls. Note that cryptographic 3904 suites that MUST be implemented need not be configured as acceptable 3905 to local policy. 3907 3.3.5. Transform Attributes 3909 Each transform in a Security Association payload may include 3910 attributes that modify or complete the specification of the 3911 transform. The set of valid attributes depends on the transform. 3912 Currently, only a single attribute type is defined: the Key Length 3913 attribute is used by certain encryption transforms with variable- 3914 length keys (see below for details). 3916 The attributes are type/value pairs and are defined below. 3917 Attributes can have a value with a fixed two-octet length or a 3918 variable-length value. For the latter, the attribute is encoded as 3919 type/length/value. 3921 1 2 3 3922 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 3923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3924 |A| Attribute Type | AF=0 Attribute Length | 3925 |F| | AF=1 Attribute Value | 3926 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3927 | AF=0 Attribute Value | 3928 | AF=1 Not Transmitted | 3929 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3931 Figure 9: Data Attributes 3933 o Attribute Format (AF) (1 bit) - Indicates whether the data 3934 attribute follows the Type/Length/Value (TLV) format or a 3935 shortened Type/Value (TV) format. If the AF bit is zero (0), then 3936 the attribute uses TLV format; if the AF bit is one (1), the TV 3937 format (with two-byte value) is used. 3939 o Attribute Type (15 bits) - Unique identifier for each type of 3940 attribute (see below). 3942 o Attribute Value (variable length) - Value of the Attribute 3943 associated with the Attribute Type. If the AF bit is a zero (0), 3944 this field has a variable length defined by the Attribute Length 3945 field. If the AF bit is a one (1), the Attribute Value has a 3946 length of 2 octets. 3948 The only currently defined attribute type (Key Length) is fixed 3949 length; the variable-length encoding specification is included only 3950 for future extensions. Attributes described as fixed length MUST NOT 3951 be encoded using the variable-length encoding unless that length 3952 exceeds two bytes. Variable-length attributes MUST NOT be encoded as 3953 fixed-length even if their value can fit into two octets. NOTE: This 3954 is a change from IKEv1, where increased flexibility may have 3955 simplified the composer of messages but certainly complicated the 3956 parser. 3958 The values in the following table are only current as of the 3959 publication date of RFC 4306. Other values may have been added since 3960 then or will be added after the publication of this document. 3961 Readers should refer to [IKEV2IANA] for the latest values. 3963 Attribute Type Value Attribute Format 3964 ------------------------------------------------------------ 3965 Key Length (in bits) 14 TV 3967 Values 0-13 and 15-17 were used in a similar context in IKEv1, and 3968 should not be assigned except to matching values. 3970 The Key Length attribute specifies the key length in bits (MUST use 3971 network byte order) for certain transforms as follows: 3973 o The Key Length attribute MUST NOT be used with transforms that use 3974 a fixed length key. This includes, e.g., ENCR_DES, ENCR_IDEA, and 3975 all the Type 2 (Pseudo-random function) and Type 3 (Integrity 3976 Algorithm) transforms specified in this document. It is 3977 recommended that future Type 2 or 3 transforms do not use this 3978 attribute. 3980 o Some transforms specify that the Key Length attribute MUST be 3981 always included (omitting the attribute is not allowed, and 3982 proposals not containing it MUST be rejected). This includes, 3983 e.g., ENCR_AES_CBC and ENCR_AES_CTR. 3985 o Some transforms allow variable-length keys, but also specify a 3986 default key length if the attribute is not included. These 3987 transforms include, e.g., ENCR_RC5 and ENCR_BLOWFISH. 3989 Implementation note: To further interoperability and to support 3990 upgrading endpoints independently, implementers of this protocol 3991 SHOULD accept values that they deem to supply greater security. For 3992 instance, if a peer is configured to accept a variable-length cipher 3993 with a key length of X bits and is offered that cipher with a larger 3994 key length, the implementation SHOULD accept the offer if it supports 3995 use of the longer key. 3997 Support of this capability allows a responder to express a concept of 3998 "at least" a certain level of security -- "a key length of _at least_ 3999 X bits for cipher Y". However, as the attribute is always returned 4000 unchanged (see the next section), an initiator willing to accept 4001 multiple key lengths has to include multiple transforms with the same 4002 Transform Type, each with a different Key Length attribute. 4004 3.3.6. Attribute Negotiation 4006 During security association negotiation initiators present offers to 4007 responders. Responders MUST select a single complete set of 4008 parameters from the offers (or reject all offers if none are 4009 acceptable). If there are multiple proposals, the responder MUST 4010 choose a single proposal. If the selected proposal has multiple 4011 Transforms with the same type, the responder MUST choose a single 4012 one. Any attributes of a selected transform MUST be returned 4013 unmodified. The initiator of an exchange MUST check that the 4014 accepted offer is consistent with one of its proposals, and if not 4015 MUST terminate the exchange. 4017 If the responder receives a proposal that contains a Transform Type 4018 it does not understand, or a proposal that is missing a mandatory 4019 Transform Type, it MUST consider this proposal unacceptable; however, 4020 other proposals in the same SA payload are processed as usual. 4021 Similarly, if the responder receives a transform that it does not 4022 understand, or one that contains a Transform Attribute it does not 4023 understand, it MUST consider this transform unacceptable; other 4024 transforms with the same Transform Type are processed as usual. This 4025 allows new Transform Types and Transform Attributes to be defined in 4026 the future. 4028 Negotiating Diffie-Hellman groups presents some special challenges. 4029 SA offers include proposed attributes and a Diffie-Hellman public 4030 number (KE) in the same message. If in the initial exchange the 4031 initiator offers to use one of several Diffie-Hellman groups, it 4032 SHOULD pick the one the responder is most likely to accept and 4033 include a KE corresponding to that group. If the responder selects a 4034 proposal using a different Diffie-Hellman group (other than NONE), 4035 the responder will indicate the correct group in the response and the 4036 initiator SHOULD pick an element of that group for its KE value when 4037 retrying the first message. It SHOULD, however, continue to propose 4038 its full supported set of groups in order to prevent a man-in-the- 4039 middle downgrade attack. If one of the proposals offered is for the 4040 Diffie-Hellman group of NONE, and the responder selects that Diffie- 4041 Hellman group, then it MUST ignore the initiator's KE payload and 4042 omit the KE payload from the response. 4044 3.4. Key Exchange Payload 4046 The Key Exchange Payload, denoted KE in this document, is used to 4047 exchange Diffie-Hellman public numbers as part of a Diffie-Hellman 4048 key exchange. The Key Exchange Payload consists of the IKE generic 4049 payload header followed by the Diffie-Hellman public value itself. 4051 1 2 3 4052 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 4053 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4054 | Next Payload |C| RESERVED | Payload Length | 4055 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4056 | Diffie-Hellman Group Num | RESERVED | 4057 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4058 | | 4059 ~ Key Exchange Data ~ 4060 | | 4061 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4063 Figure 10: Key Exchange Payload Format 4065 A key exchange payload is constructed by copying one's Diffie-Hellman 4066 public value into the "Key Exchange Data" portion of the payload. 4067 The length of the Diffie-Hellman public value for MODP groups MUST be 4068 equal to the length of the prime modulus over which the 4069 exponentiation was performed, prepending zero bits to the value if 4070 necessary. 4072 The Diffie-Hellman Group Num identifies the Diffie-Hellman group in 4073 which the Key Exchange Data was computed (see Section 3.3.2). This 4074 Diffie-Hellman Group Num MUST match a Diffie-Hellman Group specified 4075 in a proposal in the SA payload that is sent in the same message, and 4076 SHOULD match the Diffie-Hellman group in the first group in the first 4077 proposal, if such exists. If none of the proposals in that SA 4078 payload specifies a Diffie-Hellman Group, the KE payload MUST NOT be 4079 present. If the selected proposal uses a different Diffie-Hellman 4080 group (other than NONE), the message MUST be rejected with a Notify 4081 payload of type INVALID_KE_PAYLOAD. See also Section 1.2 and 4082 Section 2.7. 4084 The payload type for the Key Exchange payload is thirty four (34). 4086 3.5. Identification Payloads 4088 The Identification Payloads, denoted IDi and IDr in this document, 4089 allow peers to assert an identity to one another. This identity may 4090 be used for policy lookup, but does not necessarily have to match 4091 anything in the CERT payload; both fields may be used by an 4092 implementation to perform access control decisions. When using the 4093 ID_IPV4_ADDR/ID_IPV6_ADDR identity types in IDi/IDr payloads, IKEv2 4094 does not require this address to match the address in the IP header 4095 of IKEv2 packets, or anything in the TSi/TSr payloads. The contents 4096 of IDi/IDr is used purely to fetch the policy and authentication data 4097 related to the other party. 4099 NOTE: In IKEv1, two ID payloads were used in each direction to hold 4100 Traffic Selector (TS) information for data passing over the SA. In 4101 IKEv2, this information is carried in TS payloads (see Section 3.13). 4103 The Peer Authorization Database (PAD) as described in RFC 4301 4104 [IPSECARCH] describes the use of the ID payload in IKEv2 and provides 4105 a formal model for the binding of identity to policy in addition to 4106 providing services that deal more specifically with the details of 4107 policy enforcement. The PAD is intended to provide a link between 4108 the SPD and the IKE security association management. See Section 4109 4.4.3 of RFC 4301 for more details. 4111 The Identification Payload consists of the IKE generic payload header 4112 followed by identification fields as follows: 4114 1 2 3 4115 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 4116 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4117 | Next Payload |C| RESERVED | Payload Length | 4118 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4119 | ID Type | RESERVED | 4120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4121 | | 4122 ~ Identification Data ~ 4123 | | 4124 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4126 Figure 11: Identification Payload Format 4128 o ID Type (1 octet) - Specifies the type of Identification being 4129 used. 4131 o RESERVED - MUST be sent as zero; MUST be ignored on receipt. 4133 o Identification Data (variable length) - Value, as indicated by the 4134 Identification Type. The length of the Identification Data is 4135 computed from the size in the ID payload header. 4137 The payload types for the Identification Payload are thirty five (35) 4138 for IDi and thirty six (36) for IDr. 4140 The following table lists the assigned semantics for the 4141 Identification Type field. The values in the following table are 4142 only current as of the publication date of RFC 4306. Other values 4143 may have been added since then or will be added after the publication 4144 of this document. Readers should refer to [IKEV2IANA] for the latest 4145 values. 4147 ID Type Value 4148 ------------------------------------------------------------------- 4149 ID_IPV4_ADDR 1 4150 A single four (4) octet IPv4 address. 4152 ID_FQDN 2 4153 A fully-qualified domain name string. An example of a ID_FQDN 4154 is, "example.com". The string MUST NOT contain any terminators 4155 (e.g., NULL, CR, etc.). All characters in the ID_FQDN are ASCII; 4156 for an "internationalized domain name", the syntax is as defined 4157 in [IDNA], for example "xn--tmonesimerkki-bfbb.example.net". 4159 ID_RFC822_ADDR 3 4160 A fully-qualified RFC822 email address string, An example of a 4161 ID_RFC822_ADDR is, "jsmith@example.com". The string MUST NOT 4162 contain any terminators. Because of [EAI], implementations would 4163 be wise to treat this field as UTF-8 encoded text, not as 4164 pure ASCII. 4166 ID_IPV6_ADDR 5 4167 A single sixteen (16) octet IPv6 address. 4169 ID_DER_ASN1_DN 9 4170 The binary Distinguished Encoding Rules (DER) encoding of an 4171 ASN.1 X.500 Distinguished Name [PKIX]. 4173 ID_DER_ASN1_GN 10 4174 The binary DER encoding of an ASN.1 X.509 GeneralName [PKIX]. 4176 ID_KEY_ID 11 4177 An opaque octet stream which may be used to pass vendor- 4178 specific information necessary to do certain proprietary 4179 types of identification. 4181 Two implementations will interoperate only if each can generate a 4182 type of ID acceptable to the other. To assure maximum 4183 interoperability, implementations MUST be configurable to send at 4184 least one of ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, or ID_KEY_ID, and 4185 MUST be configurable to accept all of these four types. 4186 Implementations SHOULD be capable of generating and accepting all of 4187 these types. IPv6-capable implementations MUST additionally be 4188 configurable to accept ID_IPV6_ADDR. IPv6-only implementations MAY 4189 be configurable to send only ID_IPV6_ADDR instead of ID_IPV4_ADDR for 4190 IP addresses. 4192 EAP [EAP] does not mandate the use of any particular type of 4193 identifier, but often EAP is used with Network Access Identifiers 4194 (NAIs) defined in [NAI]. Although NAIs look a bit like email 4195 addresses (e.g., "joe@example.com"), the syntax is not exactly the 4196 same as the syntax of email address in [MAILFORMAT]. For those NAIs 4197 that include the realm component, the ID_RFC822_ADDR identification 4198 type SHOULD be used. Responder implementations should not attempt to 4199 verify that the contents actually conform to the exact syntax given 4200 in [MAILFORMAT], but instead should accept any reasonable-looking 4201 NAI. For NAIs that do not include the realm component, the ID_KEY_ID 4202 identification type SHOULD be used. 4204 3.6. Certificate Payload 4206 The Certificate Payload, denoted CERT in this document, provides a 4207 means to transport certificates or other authentication-related 4208 information via IKE. Certificate payloads SHOULD be included in an 4209 exchange if certificates are available to the sender. The Hash and 4210 URL formats of the Certificate payloads should be used in case the 4211 peer has indicated an ability to retrieve this information from 4212 elsewhere using an HTTP_CERT_LOOKUP_SUPPORTED Notify payload. Note 4213 that the term "Certificate Payload" is somewhat misleading, because 4214 not all authentication mechanisms use certificates and data other 4215 than certificates may be passed in this payload. 4217 The Certificate Payload is defined as follows: 4219 1 2 3 4220 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 4221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4222 | Next Payload |C| RESERVED | Payload Length | 4223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4224 | Cert Encoding | | 4225 +-+-+-+-+-+-+-+-+ | 4226 ~ Certificate Data ~ 4227 | | 4228 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4230 Figure 12: Certificate Payload Format 4232 o Certificate Encoding (1 octet) - This field indicates the type of 4233 certificate or certificate-related information contained in the 4234 Certificate Data field. The values in the following table are 4235 only current as of the publication date of RFC 4306. Other values 4236 may have been added since then or will be added after the 4237 publication of this document. Readers should refer to [IKEV2IANA] 4238 for the latest values. 4240 Certificate Encoding Value 4241 ---------------------------------------------------- 4242 PKCS #7 wrapped X.509 certificate 1 UNSPECIFIED 4243 PGP Certificate 2 UNSPECIFIED 4244 DNS Signed Key 3 UNSPECIFIED 4245 X.509 Certificate - Signature 4 4246 Kerberos Token 6 UNSPECIFIED 4247 Certificate Revocation List (CRL) 7 4248 Authority Revocation List (ARL) 8 UNSPECIFIED 4249 SPKI Certificate 9 UNSPECIFIED 4250 X.509 Certificate - Attribute 10 UNSPECIFIED 4251 Raw RSA Key 11 4252 Hash and URL of X.509 certificate 12 4253 Hash and URL of X.509 bundle 13 4255 o Certificate Data (variable length) - Actual encoding of 4256 certificate data. The type of certificate is indicated by the 4257 Certificate Encoding field. 4259 The payload type for the Certificate Payload is thirty seven (37). 4261 Specific syntax for some of the certificate type codes above is not 4262 defined in this document. The types whose syntax is defined in this 4263 document are: 4265 o "X.509 Certificate - Signature" contains a DER encoded X.509 4266 certificate whose public key is used to validate the sender's AUTH 4267 payload. Note that with this encoding, if a chain of certificates 4268 needs to be sent, multiple CERT payloads are used, only the first 4269 of which holds the public key used to validate the sender's AUTH 4270 payload. 4272 o "Certificate Revocation List" contains a DER encoded X.509 4273 certificate revocation list. 4275 o "Raw RSA Key" contains a PKCS #1 encoded RSA key, that is, a DER- 4276 encoded RSAPublicKey structure (see [RSA] and [PKCS1]). 4278 o Hash and URL encodings allow IKE messages to remain short by 4279 replacing long data structures with a 20 octet SHA-1 hash (see 4280 [SHA]) of the replaced value followed by a variable-length URL 4281 that resolves to the DER encoded data structure itself. This 4282 improves efficiency when the endpoints have certificate data 4283 cached and makes IKE less subject to DoS attacks that become 4284 easier to mount when IKE messages are large enough to require IP 4285 fragmentation [DOSUDPPROT]. 4287 The "Hash and URL of a bundle" type uses the following ASN.1 4288 definition for the X.509 bundle: 4290 CertBundle 4291 { iso(1) identified-organization(3) dod(6) internet(1) 4292 security(5) mechanisms(5) pkix(7) id-mod(0) 4293 id-mod-cert-bundle(34) } 4295 DEFINITIONS EXPLICIT TAGS ::= 4296 BEGIN 4298 IMPORTS 4299 Certificate, CertificateList 4300 FROM PKIX1Explicit88 4301 { iso(1) identified-organization(3) dod(6) 4302 internet(1) security(5) mechanisms(5) pkix(7) 4303 id-mod(0) id-pkix1-explicit(18) } ; 4305 CertificateOrCRL ::= CHOICE { 4306 cert [0] Certificate, 4307 crl [1] CertificateList } 4309 CertificateBundle ::= SEQUENCE OF CertificateOrCRL 4311 END 4313 Implementations MUST be capable of being configured to send and 4314 accept up to four X.509 certificates in support of authentication, 4315 and also MUST be capable of being configured to send and accept the 4316 Hash and URL format (with HTTP URLs). Implementations SHOULD be 4317 capable of being configured to send and accept Raw RSA keys. If 4318 multiple certificates are sent, the first certificate MUST contain 4319 the public key used to sign the AUTH payload. The other certificates 4320 may be sent in any order. 4322 Implementations MUST support the HTTP method for hash-and-URL lookup. 4323 The behavior of other URL methods is not currently specified, and 4324 such methods SHOULD NOT be used in the absence of a document 4325 specifying them. 4327 3.7. Certificate Request Payload 4329 The Certificate Request Payload, denoted CERTREQ in this document, 4330 provides a means to request preferred certificates via IKE and can 4331 appear in the IKE_INIT_SA response and/or the IKE_AUTH request. 4332 Certificate Request payloads MAY be included in an exchange when the 4333 sender needs to get the certificate of the receiver. 4335 The Certificate Request Payload is defined as follows: 4337 1 2 3 4338 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 4339 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4340 | Next Payload |C| RESERVED | Payload Length | 4341 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4342 | Cert Encoding | | 4343 +-+-+-+-+-+-+-+-+ | 4344 ~ Certification Authority ~ 4345 | | 4346 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4348 Figure 13: Certificate Request Payload Format 4350 o Certificate Encoding (1 octet) - Contains an encoding of the type 4351 or format of certificate requested. Values are listed in 4352 Section 3.6. 4354 o Certification Authority (variable length) - Contains an encoding 4355 of an acceptable certification authority for the type of 4356 certificate requested. 4358 The payload type for the Certificate Request Payload is thirty eight 4359 (38). 4361 The Certificate Encoding field has the same values as those defined 4362 in Section 3.6. The Certification Authority field contains an 4363 indicator of trusted authorities for this certificate type. The 4364 Certification Authority value is a concatenated list of SHA-1 hashes 4365 of the public keys of trusted Certification Authorities (CAs). Each 4366 is encoded as the SHA-1 hash of the Subject Public Key Info element 4367 (see section 4.1.2.7 of [PKIX]) from each Trust Anchor certificate. 4368 The twenty-octet hashes are concatenated and included with no other 4369 formatting. 4371 The contents of the "Certification Authority" field are defined only 4372 for X.509 certificates, which are types 4, 12, and 13. Other values 4373 SHOULD NOT be used until standards-track specifications that specify 4374 their use are published. 4376 Note that the term "Certificate Request" is somewhat misleading, in 4377 that values other than certificates are defined in a "Certificate" 4378 payload and requests for those values can be present in a Certificate 4379 Request Payload. The syntax of the Certificate Request payload in 4380 such cases is not defined in this document. 4382 The Certificate Request Payload is processed by inspecting the "Cert 4383 Encoding" field to determine whether the processor has any 4384 certificates of this type. If so, the "Certification Authority" 4385 field is inspected to determine if the processor has any certificates 4386 that can be validated up to one of the specified certification 4387 authorities. This can be a chain of certificates. 4389 If an end-entity certificate exists that satisfies the criteria 4390 specified in the CERTREQ, a certificate or certificate chain SHOULD 4391 be sent back to the certificate requestor if the recipient of the 4392 CERTREQ: 4394 o is configured to use certificate authentication, 4396 o is allowed to send a CERT payload, 4398 o has matching CA trust policy governing the current negotiation, 4399 and 4401 o has at least one time-wise and usage appropriate end-entity 4402 certificate chaining to a CA provided in the CERTREQ. 4404 Certificate revocation checking must be considered during the 4405 chaining process used to select a certificate. Note that even if two 4406 peers are configured to use two different CAs, cross-certification 4407 relationships should be supported by appropriate selection logic. 4409 The intent is not to prevent communication through the strict 4410 adherence of selection of a certificate based on CERTREQ, when an 4411 alternate certificate could be selected by the sender that would 4412 still enable the recipient to successfully validate and trust it 4413 through trust conveyed by cross-certification, CRLs, or other out-of- 4414 band configured means. Thus, the processing of a CERTREQ should be 4415 seen as a suggestion for a certificate to select, not a mandated one. 4416 If no certificates exist, then the CERTREQ is ignored. This is not 4417 an error condition of the protocol. There may be cases where there 4418 is a preferred CA sent in the CERTREQ, but an alternate might be 4419 acceptable (perhaps after prompting a human operator). 4421 The HTTP_CERT_LOOKUP_SUPPORTED notification MAY be included in any 4422 message that can include a CERTREQ payload and indicates that the 4423 sender is capable of looking up certificates based on an HTTP-based 4424 URL (and hence presumably would prefer to receive certificate 4425 specifications in that format). 4427 3.8. Authentication Payload 4429 The Authentication Payload, denoted AUTH in this document, contains 4430 data used for authentication purposes. The syntax of the 4431 Authentication data varies according to the Auth Method as specified 4432 below. 4434 The Authentication Payload is defined as follows: 4436 1 2 3 4437 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 4438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4439 | Next Payload |C| RESERVED | Payload Length | 4440 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4441 | Auth Method | RESERVED | 4442 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4443 | | 4444 ~ Authentication Data ~ 4445 | | 4446 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4448 Figure 14: Authentication Payload Format 4450 o Auth Method (1 octet) - Specifies the method of authentication 4451 used. The types of signatures are listed here. The values in the 4452 following table are only current as of the publication date of RFC 4453 4306. Other values may have been added since then or will be 4454 added after the publication of this document. Readers should 4455 refer to [IKEV2IANA] for the latest values. 4457 Mechanism Value 4458 ----------------------------------------------------------------- 4459 RSA Digital Signature 1 4460 Computed as specified in Section 2.15 using an RSA private key 4461 with RSASSA-PKCS1-v1_5 signature scheme specified in [PKCS1] 4462 (implementors should note that IKEv1 used a different method for 4463 RSA signatures). To promote interoperability, implementations 4464 that support this type SHOULD support signatures that use SHA-1 4465 as the hash function and SHOULD use SHA-1 as the default hash 4466 function when generating signatures. Implementations can use the 4467 certificates received from a given peer as a hint for selecting a 4468 mutually-understood hash function for the AUTH payload signature. 4469 Note, however, that the hash algorithm used in the AUTH payload 4470 signature doesn't have to be the same as any hash algorithm(s) 4471 used in the certificate(s). 4473 Shared Key Message Integrity Code 2 4474 Computed as specified in Section 2.15 using the shared key 4475 associated with the identity in the ID payload and the negotiated 4476 PRF. 4478 DSS Digital Signature 3 4479 Computed as specified in Section 2.15 using a DSS private key 4480 (see [DSS]) over a SHA-1 hash. 4482 o Authentication Data (variable length) - see Section 2.15. 4484 The payload type for the Authentication Payload is thirty nine (39). 4486 3.9. Nonce Payload 4488 The Nonce Payload, denoted Ni and Nr in this document for the 4489 initiator's and responder's nonce respectively, contains random data 4490 used to guarantee liveness during an exchange and protect against 4491 replay attacks. 4493 The Nonce Payload is defined as follows: 4495 1 2 3 4496 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 4497 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4498 | Next Payload |C| RESERVED | Payload Length | 4499 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4500 | | 4501 ~ Nonce Data ~ 4502 | | 4503 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4505 Figure 15: Nonce Payload Format 4507 o Nonce Data (variable length) - Contains the random data generated 4508 by the transmitting entity. 4510 The payload type for the Nonce Payload is forty (40). 4512 The size of the Nonce Data MUST be between 16 and 256 octets 4513 inclusive. Nonce values MUST NOT be reused. 4515 3.10. Notify Payload 4517 The Notify Payload, denoted N in this document, is used to transmit 4518 informational data, such as error conditions and state transitions, 4519 to an IKE peer. A Notify Payload may appear in a response message 4520 (usually specifying why a request was rejected), in an INFORMATIONAL 4521 Exchange (to report an error not in an IKE request), or in any other 4522 message to indicate sender capabilities or to modify the meaning of 4523 the request. 4525 The Notify Payload is defined as follows: 4527 1 2 3 4528 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 4529 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4530 | Next Payload |C| RESERVED | Payload Length | 4531 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4532 | Protocol ID | SPI Size | Notify Message Type | 4533 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4534 | | 4535 ~ Security Parameter Index (SPI) ~ 4536 | | 4537 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4538 | | 4539 ~ Notification Data ~ 4540 | | 4541 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4543 Figure 16: Notify Payload Format 4545 o Protocol ID (1 octet) - If this notification concerns an existing 4546 SA whose SPI is given in the SPI field, this field indicates the 4547 type of that SA. For notifications concerning Child SAs this 4548 field MUST contain either (2) to indicate AH or (3) to indicate 4549 ESP. Of the notifications defined in this document, the SPI is 4550 included only with INVALID_SELECTORS and REKEY_SA. If the SPI 4551 field is empty, this field MUST be sent as zero and MUST be 4552 ignored on receipt. 4554 o SPI Size (1 octet) - Length in octets of the SPI as defined by the 4555 IPsec protocol ID or zero if no SPI is applicable. For a 4556 notification concerning the IKE SA, the SPI Size MUST be zero and 4557 the field must be empty. 4559 o Notify Message Type (2 octets) - Specifies the type of 4560 notification message. 4562 o SPI (variable length) - Security Parameter Index. 4564 o Notification Data (variable length) - Status or error data 4565 transmitted in addition to the Notify Message Type. Values for 4566 this field are type specific (see below). 4568 The payload type for the Notify Payload is forty one (41). 4570 3.10.1. Notify Message Types 4572 Notification information can be error messages specifying why an SA 4573 could not be established. It can also be status data that a process 4574 managing an SA database wishes to communicate with a peer process. 4575 The table below lists the Notification messages and their 4576 corresponding values. The number of different error statuses was 4577 greatly reduced from IKEv1 both for simplification and to avoid 4578 giving configuration information to probers. 4580 Types in the range 0 - 16383 are intended for reporting errors. An 4581 implementation receiving a Notify payload with one of these types 4582 that it does not recognize in a response MUST assume that the 4583 corresponding request has failed entirely. Unrecognized error types 4584 in a request and status types in a request or response MUST be 4585 ignored, and they should be logged. 4587 Notify payloads with status types MAY be added to any message and 4588 MUST be ignored if not recognized. They are intended to indicate 4589 capabilities, and as part of SA negotiation are used to negotiate 4590 non-cryptographic parameters. 4592 More information on error handling can be found in Section 2.21. 4594 The values in the following table are only current as of the 4595 publication date of RFC 4306, plus two error types added in this 4596 document. Other values may have been added since then or will be 4597 added after the publication of this document. Readers should refer 4598 to [IKEV2IANA] for the latest values. 4600 NOTIFY messages: error types Value 4601 ------------------------------------------------------------------- 4602 UNSUPPORTED_CRITICAL_PAYLOAD 1 4603 See Section 2.5. 4605 INVALID_IKE_SPI 4 4606 See Section 2.21. 4608 INVALID_MAJOR_VERSION 5 4609 See Section 2.5. 4611 INVALID_SYNTAX 7 4612 Indicates the IKE message that was received was invalid because 4613 some type, length, or value was out of range or because the 4614 request was rejected for policy reasons. To avoid a DoS 4615 attack using forged messages, this status may only be 4616 returned for and in an encrypted packet if the message ID and 4617 cryptographic checksum were valid. To avoid leaking information 4618 to someone probing a node, this status MUST be sent in response 4619 to any error not covered by one of the other status types. 4620 To aid debugging, more detailed error information should be 4621 written to a console or log. 4623 INVALID_MESSAGE_ID 9 4624 See Section 2.3. 4626 INVALID_SPI 11 4627 See Section 1.5. 4629 NO_PROPOSAL_CHOSEN 14 4630 None of the proposed crypto suites was acceptable. This can be 4631 sent in any case where the offered proposals (including but not 4632 limited to SA payload values, USE_TRANSPORT_MODE notify, 4633 IPCOMP_SUPPORTED notify) are not acceptable for the responder. 4634 This can also be used as "generic" Child SA error when Child SA 4635 cannot be created for some other reason. See also Section 2.7. 4637 INVALID_KE_PAYLOAD 17 4638 See Section 1.2 and 1.3. 4640 AUTHENTICATION_FAILED 24 4641 Sent in the response to an IKE_AUTH message when for some reason 4642 the authentication failed. There is no associated data. See also 4643 Section 2.21.2. 4645 SINGLE_PAIR_REQUIRED 34 4646 See Section 2.9. 4648 NO_ADDITIONAL_SAS 35 4649 See Section 1.3. 4651 INTERNAL_ADDRESS_FAILURE 36 4652 See Section 3.15.4. 4654 FAILED_CP_REQUIRED 37 4655 See Section 2.19. 4657 TS_UNACCEPTABLE 38 4658 See Section 2.9. 4660 INVALID_SELECTORS 39 4661 MAY be sent in an IKE INFORMATIONAL exchange when a node receives 4662 an ESP or AH packet whose selectors do not match those of the SA 4663 on which it was delivered (and that caused the packet to be 4664 dropped). The Notification Data contains the start of the 4665 offending packet (as in ICMP messages) and the SPI field of the 4666 notification is set to match the SPI of the Child SA. 4668 TEMPORARY_FAILURE {TBA1} 4669 See section 2.25. 4671 CHILD_SA_NOT_FOUND {TBA2} 4672 See section 2.25. 4674 NOTIFY messages: status types Value 4675 ------------------------------------------------------------------- 4676 INITIAL_CONTACT 16384 4677 See Section 2.4. 4679 SET_WINDOW_SIZE 16385 4680 See Section 2.3. 4682 ADDITIONAL_TS_POSSIBLE 16386 4683 See Section 2.9. 4685 IPCOMP_SUPPORTED 16387 4686 See Section 2.22. 4688 NAT_DETECTION_SOURCE_IP 16388 4689 See Section 2.23. 4691 NAT_DETECTION_DESTINATION_IP 16389 4692 See Section 2.23. 4694 COOKIE 16390 4695 See Section 2.6. 4697 USE_TRANSPORT_MODE 16391 4698 See Section 1.3.1. 4700 HTTP_CERT_LOOKUP_SUPPORTED 16392 4701 See Section 3.6. 4703 REKEY_SA 16393 4704 See Section 1.3.3. 4706 ESP_TFC_PADDING_NOT_SUPPORTED 16394 4707 See Section 1.3.1. 4709 NON_FIRST_FRAGMENTS_ALSO 16395 4710 See Section 1.3.1. 4712 3.11. Delete Payload 4714 The Delete Payload, denoted D in this document, contains a protocol 4715 specific security association identifier that the sender has removed 4716 from its security association database and is, therefore, no longer 4717 valid. Figure 17 shows the format of the Delete Payload. It is 4718 possible to send multiple SPIs in a Delete payload; however, each SPI 4719 MUST be for the same protocol. Mixing of protocol identifiers MUST 4720 NOT be performed in the Delete payload. It is permitted, however, to 4721 include multiple Delete payloads in a single INFORMATIONAL exchange 4722 where each Delete payload lists SPIs for a different protocol. 4724 Deletion of the IKE SA is indicated by a protocol ID of 1 (IKE) but 4725 no SPIs. Deletion of a Child SA, such as ESP or AH, will contain the 4726 IPsec protocol ID of that protocol (2 for AH, 3 for ESP), and the SPI 4727 is the SPI the sending endpoint would expect in inbound ESP or AH 4728 packets. 4730 The Delete Payload is defined as follows: 4732 1 2 3 4733 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 4734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4735 | Next Payload |C| RESERVED | Payload Length | 4736 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4737 | Protocol ID | SPI Size | Num of SPIs | 4738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4739 | | 4740 ~ Security Parameter Index(es) (SPI) ~ 4741 | | 4742 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4744 Figure 17: Delete Payload Format 4746 o Protocol ID (1 octet) - Must be 1 for an IKE SA, 2 for AH, or 3 4747 for ESP. 4749 o SPI Size (1 octet) - Length in octets of the SPI as defined by the 4750 protocol ID. It MUST be zero for IKE (SPI is in message header) 4751 or four for AH and ESP. 4753 o Num of SPIs (2 octets, unsigned integer) - The number of SPIs 4754 contained in the Delete payload. The size of each SPI is defined 4755 by the SPI Size field. 4757 o Security Parameter Index(es) (variable length) - Identifies the 4758 specific security association(s) to delete. The length of this 4759 field is determined by the SPI Size and Num of SPIs fields. 4761 The payload type for the Delete Payload is forty two (42). 4763 3.12. Vendor ID Payload 4765 The Vendor ID Payload, denoted V in this document, contains a vendor 4766 defined constant. The constant is used by vendors to identify and 4767 recognize remote instances of their implementations. This mechanism 4768 allows a vendor to experiment with new features while maintaining 4769 backward compatibility. 4771 A Vendor ID payload MAY announce that the sender is capable of 4772 accepting certain extensions to the protocol, or it MAY simply 4773 identify the implementation as an aid in debugging. A Vendor ID 4774 payload MUST NOT change the interpretation of any information defined 4775 in this specification (i.e., the critical bit MUST be set to 0). 4776 Multiple Vendor ID payloads MAY be sent. An implementation is not 4777 required to send any Vendor ID payload at all. 4779 A Vendor ID payload may be sent as part of any message. Reception of 4780 a familiar Vendor ID payload allows an implementation to make use of 4781 private use numbers described throughout this document, such as 4782 private payloads, private exchanges, private notifications, etc. 4783 Unfamiliar Vendor IDs MUST be ignored. 4785 Writers of Internet-Drafts who wish to extend this protocol MUST 4786 define a Vendor ID payload to announce the ability to implement the 4787 extension in the Internet-Draft. It is expected that Internet-Drafts 4788 that gain acceptance and are standardized will be given "magic 4789 numbers" out of the Future Use range by IANA, and the requirement to 4790 use a Vendor ID will go away. 4792 The Vendor ID Payload fields are defined as follows: 4794 1 2 3 4795 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 4796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4797 | Next Payload |C| RESERVED | Payload Length | 4798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4799 | | 4800 ~ Vendor ID (VID) ~ 4801 | | 4802 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4804 Figure 18: Vendor ID Payload Format 4806 o Vendor ID (variable length) - It is the responsibility of the 4807 person choosing the Vendor ID to assure its uniqueness in spite of 4808 the absence of any central registry for IDs. Good practice is to 4809 include a company name, a person name, or some such. If you want 4810 to show off, you might include the latitude and longitude and time 4811 where you were when you chose the ID and some random input. A 4812 message digest of a long unique string is preferable to the long 4813 unique string itself. 4815 The payload type for the Vendor ID Payload is forty three (43). 4817 3.13. Traffic Selector Payload 4819 The Traffic Selector Payload, denoted TS in this document, allows 4820 peers to identify packet flows for processing by IPsec security 4821 services. The Traffic Selector Payload consists of the IKE generic 4822 payload header followed by individual traffic selectors as follows: 4824 1 2 3 4825 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 4826 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4827 | Next Payload |C| RESERVED | Payload Length | 4828 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4829 | Number of TSs | RESERVED | 4830 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4831 | | 4832 ~ ~ 4833 | | 4834 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4836 Figure 19: Traffic Selectors Payload Format 4838 o Number of TSs (1 octet) - Number of traffic selectors being 4839 provided. 4841 o RESERVED - This field MUST be sent as zero and MUST be ignored on 4842 receipt. 4844 o Traffic Selectors (variable length) - One or more individual 4845 traffic selectors. 4847 The length of the Traffic Selector payload includes the TS header and 4848 all the traffic selectors. 4850 The payload type for the Traffic Selector payload is forty four (44) 4851 for addresses at the initiator's end of the SA and forty five (45) 4852 for addresses at the responder's end. 4854 There is no requirement that TSi and TSr contain the same number of 4855 individual traffic selectors. Thus, they are interpreted as follows: 4856 a packet matches a given TSi/TSr if it matches at least one of the 4857 individual selectors in TSi, and at least one of the individual 4858 selectors in TSr. 4860 For instance, the following traffic selectors: 4862 TSi = ((17, 100, 198.51.100.66-198.51.100.66), 4863 (17, 200, 198.51.100.66-198.51.100.66)) 4864 TSr = ((17, 300, 0.0.0.0-255.255.255.255), 4865 (17, 400, 0.0.0.0-255.255.255.255)) 4867 would match UDP packets from 198.51.100.66 to anywhere, with any of 4868 the four combinations of source/destination ports (100,300), 4869 (100,400), (200,300), and (200, 400). 4871 Thus, some types of policies may require several Child SA pairs. For 4872 instance, a policy matching only source/destination ports (100,300) 4873 and (200,400), but not the other two combinations, cannot be 4874 negotiated as a single Child SA pair. 4876 3.13.1. Traffic Selector 4878 1 2 3 4879 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 4880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4881 | TS Type |IP Protocol ID*| Selector Length | 4882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4883 | Start Port* | End Port* | 4884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4885 | | 4886 ~ Starting Address* ~ 4887 | | 4888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4889 | | 4890 ~ Ending Address* ~ 4891 | | 4892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4894 Figure 20: Traffic Selector 4896 *Note: All fields other than TS Type and Selector Length depend on 4897 the TS Type. The fields shown are for TS Types 7 and 8, the only two 4898 values currently defined. 4900 o TS Type (one octet) - Specifies the type of traffic selector. 4902 o IP protocol ID (1 octet) - Value specifying an associated IP 4903 protocol ID (such as UDP, TCP, and ICMP). A value of zero means 4904 that the protocol ID is not relevant to this traffic selector-- 4905 the SA can carry all protocols. 4907 o Selector Length - Specifies the length of this Traffic Selector 4908 substructure including the header. 4910 o Start Port (2 octets, unsigned integer) - Value specifying the 4911 smallest port number allowed by this traffic selector. For 4912 protocols for which port is undefined (including protocol 0), or 4913 if all ports are allowed, this field MUST be zero. ICMP and 4914 ICMPv6 Type and Code values, as well as MIPv6 MH Type values, are 4915 represented in this field as specified in Section 4.4.1.1 of 4916 [IPSECARCH]. ICMP Type and Code values are treated as a single 4917 16-bit integer port number, with Type in the most significant 4918 eight bits and Code in the least significant eight bits. MIPv6 MH 4919 Type values are treated as a single 16-bit integer port number, 4920 with Type in the most significant eight bits and the least 4921 significant eight bits set to zero. 4923 o End Port (2 octets, unsigned integer) - Value specifying the 4924 largest port number allowed by this traffic selector. For 4925 protocols for which port is undefined (including protocol 0), or 4926 if all ports are allowed, this field MUST be 65535. ICMP and 4927 ICMPv6 Type and Code values, as well as MIPv6 MH Type values, are 4928 represented in this field as specified in Section 4.4.1.1 of 4929 [IPSECARCH]. ICMP Type and Code values are treated as a single 4930 16-bit integer port number, with Type in the most significant 4931 eight bits and Code in the least significant eight bits. MIPv6 MH 4932 Type values are treated as a single 16-bit integer port number, 4933 with Type in the most significant eight bits and the least 4934 significant eight bits set to zero. 4936 o Starting Address - The smallest address included in this Traffic 4937 Selector (length determined by TS type). 4939 o Ending Address - The largest address included in this Traffic 4940 Selector (length determined by TS type). 4942 Systems that are complying with [IPSECARCH] that wish to indicate 4943 "ANY" ports MUST set the start port to 0 and the end port to 65535; 4944 note that according to [IPSECARCH], "ANY" includes "OPAQUE". Systems 4945 working with [IPSECARCH] that wish to indicate "OPAQUE" ports, but 4946 not "ANY" ports, MUST set the start port to 65535 and the end port to 4947 0. 4949 The traffic selector types 7 and 8 can also refer to ICMP or ICMPv6 4950 type and code fields, as well as MH Type fields for the IPv6 mobility 4951 header [MIPV6]. Note, however, that neither ICMP nor MIPv6 packets 4952 have separate source and destination fields. The method for 4953 specifying the traffic selectors for ICMP and MIPv6 is shown by 4954 example in Section 4.4.1.3 of [IPSECARCH]. 4956 The following table lists values for the Traffic Selector Type field 4957 and the corresponding Address Selector Data. The values in the 4958 following table are only current as of the publication date of RFC 4959 4306. Other values may have been added since then or will be added 4960 after the publication of this document. Readers should refer to 4961 [IKEV2IANA] for the latest values. 4963 TS Type Value 4964 ------------------------------------------------------------------- 4965 TS_IPV4_ADDR_RANGE 7 4967 A range of IPv4 addresses, represented by two four-octet 4968 values. The first value is the beginning IPv4 address 4969 (inclusive) and the second value is the ending IPv4 address 4970 (inclusive). All addresses falling between the two specified 4971 addresses are considered to be within the list. 4973 TS_IPV6_ADDR_RANGE 8 4975 A range of IPv6 addresses, represented by two sixteen-octet 4976 values. The first value is the beginning IPv6 address 4977 (inclusive) and the second value is the ending IPv6 address 4978 (inclusive). All addresses falling between the two specified 4979 addresses are considered to be within the list. 4981 3.14. Encrypted Payload 4983 The Encrypted Payload, denoted SK{...} in this document, contains 4984 other payloads in encrypted form. The Encrypted Payload, if present 4985 in a message, MUST be the last payload in the message. Often, it is 4986 the only payload in the message. This payload is also called the 4987 "Encrypted and Authenticated" payload. 4989 The algorithms for encryption and integrity protection are negotiated 4990 during IKE SA setup, and the keys are computed as specified in 4991 Section 2.14 and Section 2.18. 4993 This document specifies the cryptographic processing of Encrypted 4994 payloads using a block cipher in CBC mode and an integrity check 4995 algorithm that computes a fixed-length checksum over a variable size 4996 message. The design is modeled after the ESP algorithms described in 4997 RFCs 2104 [HMAC], 4303 [ESP], and 2451 [ESPCBC]. This document 4998 completely specifies the cryptographic processing of IKE data, but 4999 those documents should be consulted for design rationale. Future 5000 documents may specify the processing of Encrypted payloads for other 5001 types of transforms, such as counter mode encryption and 5002 authenticated encryption algorithms. Peers MUST NOT negotiate 5003 transforms for which no such specification exists. 5005 When an authenticated encryption algorithm is used to protect the IKE 5006 SA, the construction of the encrypted payload is different than what 5007 is described here. See [AEAD] for more information on authenticated 5008 encryption algorithms and their use in ESP. 5010 The payload type for an Encrypted payload is forty six (46). The 5011 Encrypted Payload consists of the IKE generic payload header followed 5012 by individual fields as follows: 5014 1 2 3 5015 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 5016 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5017 | Next Payload |C| RESERVED | Payload Length | 5018 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5019 | Initialization Vector | 5020 | (length is block size for encryption algorithm) | 5021 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5022 ~ Encrypted IKE Payloads ~ 5023 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5024 | | Padding (0-255 octets) | 5025 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 5026 | | Pad Length | 5027 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5028 ~ Integrity Checksum Data ~ 5029 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5031 Figure 21: Encrypted Payload Format 5033 o Next Payload - The payload type of the first embedded payload. 5034 Note that this is an exception in the standard header format, 5035 since the Encrypted payload is the last payload in the message and 5036 therefore the Next Payload field would normally be zero. But 5037 because the content of this payload is embedded payloads and there 5038 was no natural place to put the type of the first one, that type 5039 is placed here. 5041 o Payload Length - Includes the lengths of the header, IV, Encrypted 5042 IKE Payloads, Padding, Pad Length, and Integrity Checksum Data. 5044 o Initialization Vector - For CBC mode ciphers, the length of the 5045 initialization vector (IV) is equal to the block length of the 5046 underlying encryption algorithm. Senders MUST select a new 5047 unpredictable IV for every message; recipients MUST accept any 5048 value. The reader is encouraged to consult [MODES] for advice on 5049 IV generation. In particular, using the final ciphertext block of 5050 the previous message is not considered unpredictable. For modes 5051 other than CBC, the IV format and processing is specified in the 5052 document specifying the encryption algorithm and mode. 5054 o IKE Payloads are as specified earlier in this section. This field 5055 is encrypted with the negotiated cipher. 5057 o Padding MAY contain any value chosen by the sender, and MUST have 5058 a length that makes the combination of the Payloads, the Padding, 5059 and the Pad Length to be a multiple of the encryption block size. 5060 This field is encrypted with the negotiated cipher. 5062 o Pad Length is the length of the Padding field. The sender SHOULD 5063 set the Pad Length to the minimum value that makes the combination 5064 of the Payloads, the Padding, and the Pad Length a multiple of the 5065 block size, but the recipient MUST accept any length that results 5066 in proper alignment. This field is encrypted with the negotiated 5067 cipher. 5069 o Integrity Checksum Data is the cryptographic checksum of the 5070 entire message starting with the Fixed IKE Header through the Pad 5071 Length. The checksum MUST be computed over the encrypted message. 5072 Its length is determined by the integrity algorithm negotiated. 5074 3.15. Configuration Payload 5076 The Configuration payload, denoted CP in this document, is used to 5077 exchange configuration information between IKE peers. The exchange 5078 is for an IRAC to request an internal IP address from an IRAS and to 5079 exchange other information of the sort that one would acquire with 5080 Dynamic Host Configuration Protocol (DHCP) if the IRAC were directly 5081 connected to a LAN. 5083 The Configuration Payload is defined as follows: 5085 1 2 3 5086 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 5087 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5088 | Next Payload |C| RESERVED | Payload Length | 5089 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5090 | CFG Type | RESERVED | 5091 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5092 | | 5093 ~ Configuration Attributes ~ 5094 | | 5095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5097 Figure 22: Configuration Payload Format 5099 The payload type for the Configuration Payload is forty seven (47). 5101 o CFG Type (1 octet) - The type of exchange represented by the 5102 Configuration Attributes. The values in the following table are 5103 only current as of the publication date of RFC 4306. Other values 5104 may have been added since then or will be added after the 5105 publication of this document. Readers should refer to [IKEV2IANA] 5106 for the latest values. 5108 CFG Type Value 5109 -------------------------- 5110 CFG_REQUEST 1 5111 CFG_REPLY 2 5112 CFG_SET 3 5113 CFG_ACK 4 5115 o RESERVED (3 octets) - MUST be sent as zero; MUST be ignored on 5116 receipt. 5118 o Configuration Attributes (variable length) - These are type length 5119 value (TLV) structures specific to the Configuration Payload and 5120 are defined below. There may be zero or more Configuration 5121 Attributes in this payload. 5123 3.15.1. Configuration Attributes 5125 1 2 3 5126 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 5127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5128 |R| Attribute Type | Length | 5129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5130 | | 5131 ~ Value ~ 5132 | | 5133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5135 Figure 23: Configuration Attribute Format 5137 o Reserved (1 bit) - This bit MUST be set to zero and MUST be 5138 ignored on receipt. 5140 o Attribute Type (15 bits) - A unique identifier for each of the 5141 Configuration Attribute Types. 5143 o Length (2 octets, unsigned integer) - Length in octets of Value. 5145 o Value (0 or more octets) - The variable-length value of this 5146 Configuration Attribute. The following lists the attribute types. 5148 The values in the following table are only current as of the 5149 publication date of RFC 4306 (except INTERNAL_ADDRESS_EXPIRY and 5150 INTERNAL_IP6_NBNS which were removed by this document). Other values 5151 may have been added since then or will be added after the publication 5152 of this document. Readers should refer to [IKEV2IANA] for the latest 5153 values. 5155 Attribute Type Value Multi-Valued Length 5156 ------------------------------------------------------------ 5157 INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets 5158 INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets 5159 INTERNAL_IP4_DNS 3 YES 0 or 4 octets 5160 INTERNAL_IP4_NBNS 4 YES 0 or 4 octets 5161 INTERNAL_IP4_DHCP 6 YES 0 or 4 octets 5162 APPLICATION_VERSION 7 NO 0 or more 5163 INTERNAL_IP6_ADDRESS 8 YES* 0 or 17 octets 5164 INTERNAL_IP6_DNS 10 YES 0 or 16 octets 5165 INTERNAL_IP6_DHCP 12 YES 0 or 16 octets 5166 INTERNAL_IP4_SUBNET 13 YES 0 or 8 octets 5167 SUPPORTED_ATTRIBUTES 14 NO Multiple of 2 5168 INTERNAL_IP6_SUBNET 15 YES 17 octets 5170 * These attributes may be multi-valued on return only if 5171 multiple values were requested. 5173 o INTERNAL_IP4_ADDRESS, INTERNAL_IP6_ADDRESS - An address on the 5174 internal network, sometimes called a red node address or private 5175 address and MAY be a private address on the Internet. In a 5176 request message, the address specified is a requested address (or 5177 a zero-length address if no specific address is requested). If a 5178 specific address is requested, it likely indicates that a previous 5179 connection existed with this address and the requestor would like 5180 to reuse that address. With IPv6, a requestor MAY supply the low- 5181 order address octets it wants to use. Multiple internal addresses 5182 MAY be requested by requesting multiple internal address 5183 attributes. The responder MAY only send up to the number of 5184 addresses requested. The INTERNAL_IP6_ADDRESS is made up of two 5185 fields: the first is a 16-octet IPv6 address, and the second is a 5186 one-octet prefix-length as defined in [ADDRIPV6]. The requested 5187 address is valid as long as this IKE SA (or its rekeyed 5188 successors) requesting the address is valid. This is described in 5189 more detail in Section 3.15.3. 5191 o INTERNAL_IP4_NETMASK - The internal network's netmask. Only one 5192 netmask is allowed in the request and response messages (e.g., 5193 255.255.255.0), and it MUST be used only with an 5194 INTERNAL_IP4_ADDRESS attribute. INTERNAL_IP4_NETMASK in a 5195 CFG_REPLY means roughly the same thing as INTERNAL_IP4_SUBNET 5196 containing the same information ("send traffic to these addresses 5197 through me"), but also implies a link boundary. For instance, the 5198 client could use its own address and the netmask to calculate the 5199 broadcast address of the link. An empty INTERNAL_IP4_NETMASK 5200 attribute can be included in a CFG_REQUEST to request this 5201 information (although the gateway can send the information even 5202 when not requested). Non-empty values for this attribute in a 5203 CFG_REQUEST do not make sense and thus MUST NOT be included. 5205 o INTERNAL_IP4_DNS, INTERNAL_IP6_DNS - Specifies an address of a DNS 5206 server within the network. Multiple DNS servers MAY be requested. 5207 The responder MAY respond with zero or more DNS server attributes. 5209 o INTERNAL_IP4_NBNS - Specifies an address of a NetBios Name Server 5210 (WINS) within the network. Multiple NBNS servers MAY be 5211 requested. The responder MAY respond with zero or more NBNS 5212 server attributes. 5214 o INTERNAL_IP4_DHCP, INTERNAL_IP6_DHCP - Instructs the host to send 5215 any internal DHCP requests to the address contained within the 5216 attribute. Multiple DHCP servers MAY be requested. The responder 5217 MAY respond with zero or more DHCP server attributes. 5219 o APPLICATION_VERSION - The version or application information of 5220 the IPsec host. This is a string of printable ASCII characters 5221 that is NOT null terminated. 5223 o INTERNAL_IP4_SUBNET - The protected sub-networks that this edge- 5224 device protects. This attribute is made up of two fields: the 5225 first being an IP address and the second being a netmask. 5226 Multiple sub-networks MAY be requested. The responder MAY respond 5227 with zero or more sub-network attributes. This is discussed in 5228 more detail in Section 3.15.2. 5230 o SUPPORTED_ATTRIBUTES - When used within a Request, this attribute 5231 MUST be zero-length and specifies a query to the responder to 5232 reply back with all of the attributes that it supports. The 5233 response contains an attribute that contains a set of attribute 5234 identifiers each in 2 octets. The length divided by 2 (octets) 5235 would state the number of supported attributes contained in the 5236 response. 5238 o INTERNAL_IP6_SUBNET - The protected sub-networks that this edge- 5239 device protects. This attribute is made up of two fields: the 5240 first is a 16-octet IPv6 address, and the second is a one-octet 5241 prefix-length as defined in [ADDRIPV6]. Multiple sub-networks MAY 5242 be requested. The responder MAY respond with zero or more sub- 5243 network attributes. This is discussed in more detail in 5244 Section 3.15.2. 5246 Note that no recommendations are made in this document as to how an 5247 implementation actually figures out what information to send in a 5248 response. That is, we do not recommend any specific method of an 5249 IRAS determining which DNS server should be returned to a requesting 5250 IRAC. 5252 The CFG_REQUEST and CFG_REPLY pair allows an IKE endpoint to request 5253 information from its peer. If an attribute in the CFG_REQUEST 5254 Configuration Payload is not zero-length, it is taken as a suggestion 5255 for that attribute. The CFG_REPLY Configuration Payload MAY return 5256 that value, or a new one. It MAY also add new attributes and not 5257 include some requested ones. Unrecognized or unsupported attributes 5258 MUST be ignored in both requests and responses. 5260 The CFG_SET and CFG_ACK pair allows an IKE endpoint to push 5261 configuration data to its peer. In this case, the CFG_SET 5262 Configuration Payload contains attributes the initiator wants its 5263 peer to alter. The responder MUST return a Configuration Payload if 5264 it accepted any of the configuration data and it MUST contain the 5265 attributes that the responder accepted with zero-length data. Those 5266 attributes that it did not accept MUST NOT be in the CFG_ACK 5267 Configuration Payload. If no attributes were accepted, the responder 5268 MUST return either an empty CFG_ACK payload or a response message 5269 without a CFG_ACK payload. There are currently no defined uses for 5270 the CFG_SET/CFG_ACK exchange, though they may be used in connection 5271 with extensions based on Vendor IDs. An implementation of this 5272 specification MAY ignore CFG_SET payloads. 5274 3.15.2. Meaning of INTERNAL_IP4_SUBNET and INTERNAL_IP6_SUBNET 5276 INTERNAL_IP4/6_SUBNET attributes can indicate additional subnets, 5277 ones that need one or more separate SAs, that can be reached through 5278 the gateway that announces the attributes. INTERNAL_IP4/6_SUBNET 5279 attributes may also express the gateway's policy about what traffic 5280 should be sent through the gateway; the client can choose whether 5281 other traffic (covered by TSr, but not in INTERNAL_IP4/6_SUBNET) is 5282 sent through the gateway or directly to the destination. Thus, 5283 traffic to the addresses listed in the INTERNAL_IP4/6_SUBNET 5284 attributes should be sent through the gateway that announces the 5285 attributes. If there are no existing Child SAs whose traffic 5286 selectors cover the address in question, new SAs need to be created. 5288 For instance, if there are two subnets, 198.51.100.0/26 and 5289 192.0.2.0/24, and the client's request contains the following: 5291 CP(CFG_REQUEST) = 5292 INTERNAL_IP4_ADDRESS() 5293 TSi = (0, 0-65535, 0.0.0.0-255.255.255.255) 5294 TSr = (0, 0-65535, 0.0.0.0-255.255.255.255) 5296 then a valid response could be the following (in which TSr and 5297 INTERNAL_IP4_SUBNET contain the same information): 5299 CP(CFG_REPLY) = 5300 INTERNAL_IP4_ADDRESS(198.51.100.234) 5301 INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192) 5302 INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0) 5303 TSi = (0, 0-65535, 198.51.100.234-198.51.100.234) 5304 TSr = ((0, 0-65535, 198.51.100.0-198.51.100.63), 5305 (0, 0-65535, 192.0.2.0-192.0.2.255)) 5307 In these cases, the INTERNAL_IP4_SUBNET does not really carry any 5308 useful information. 5310 A different possible response would have been this: 5312 CP(CFG_REPLY) = 5313 INTERNAL_IP4_ADDRESS(198.51.100.234) 5314 INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192) 5315 INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0) 5316 TSi = (0, 0-65535, 198.51.100.234-198.51.100.234) 5317 TSr = (0, 0-65535, 0.0.0.0-255.255.255.255) 5319 That response would mean that the client can send all its traffic 5320 through the gateway, but the gateway does not mind if the client 5321 sends traffic not included by INTERNAL_IP4_SUBNET directly to the 5322 destination (without going through the gateway). 5324 A different situation arises if the gateway has a policy that 5325 requires the traffic for the two subnets to be carried in separate 5326 SAs. Then a response like this would indicate to the client that if 5327 it wants access to the second subnet, it needs to create a separate 5328 SA: 5330 CP(CFG_REPLY) = 5331 INTERNAL_IP4_ADDRESS(198.51.100.234) 5332 INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192) 5333 INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0) 5334 TSi = (0, 0-65535, 198.51.100.234-198.51.100.234) 5335 TSr = (0, 0-65535, 198.51.100.0-198.51.100.63) 5337 INTERNAL_IP4_SUBNET can also be useful if the client's TSr included 5338 only part of the address space. For instance, if the client requests 5339 the following: 5341 CP(CFG_REQUEST) = 5342 INTERNAL_IP4_ADDRESS() 5343 TSi = (0, 0-65535, 0.0.0.0-255.255.255.255) 5344 TSr = (0, 0-65535, 192.0.2.155-192.0.2.155) 5346 then the gateway's response might be: 5348 CP(CFG_REPLY) = 5349 INTERNAL_IP4_ADDRESS(198.51.100.234) 5350 INTERNAL_IP4_SUBNET(198.51.100.0/255.255.255.192) 5351 INTERNAL_IP4_SUBNET(192.0.2.0/255.255.255.0) 5352 TSi = (0, 0-65535, 198.51.100.234-198.51.100.234) 5353 TSr = (0, 0-65535, 192.0.2.155-192.0.2.155) 5355 Because the meaning of INTERNAL_IP4_SUBNET/INTERNAL_IP6_SUBNET in 5356 CFG_REQUESTs is unclear, they cannot be used reliably in 5357 CFG_REQUESTs. 5359 3.15.3. Configuration payloads for IPv6 5361 The configuration payloads for IPv6 are based on the corresponding 5362 IPv4 payloads, and do not fully follow the "normal IPv6 way of doing 5363 things". In particular, IPv6 stateless autoconfiguration or router 5364 advertisement messages are not used; neither is neighbor discovery. 5365 Note that there is an additional document that discusses IPv6 5366 configuration in IKEv2, [IPV6CONFIG]. At the present time, it is an 5367 experimental document, but there is a hope that with more 5368 implementation experience, it will gain the same standards treatment 5369 as this document. 5371 A client can be assigned an IPv6 address using the 5372 INTERNAL_IP6_ADDRESS configuration payload. A minimal exchange might 5373 look like this: 5375 CP(CFG_REQUEST) = 5376 INTERNAL_IP6_ADDRESS() 5377 INTERNAL_IP6_DNS() 5378 TSi = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF) 5379 TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF) 5381 CP(CFG_REPLY) = 5382 INTERNAL_IP6_ADDRESS(2001:DB8:0:1:2:3:4:5/64) 5383 INTERNAL_IP6_DNS(2001:DB8:99:88:77:66:55:44) 5384 TSi = (0, 0-65535, 2001:DB8:0:1:2:3:4:5 - 2001:DB8:0:1:2:3:4:5) 5385 TSr = (0, 0-65535, :: - FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF) 5387 The client MAY send a non-empty INTERNAL_IP6_ADDRESS attribute in the 5388 CFG_REQUEST to request a specific address or interface identifier. 5389 The gateway first checks if the specified address is acceptable, and 5390 if it is, returns that one. If the address was not acceptable, the 5391 gateway attempts to use the interface identifier with some other 5392 prefix; if even that fails, the gateway selects another interface 5393 identifier. 5395 The INTERNAL_IP6_ADDRESS attribute also contains a prefix length 5396 field. When used in a CFG_REPLY, this corresponds to the 5397 INTERNAL_IP4_NETMASK attribute in the IPv4 case. 5399 Although this approach to configuring IPv6 addresses is reasonably 5400 simple, it has some limitations. IPsec tunnels configured using 5401 IKEv2 are not fully-featured "interfaces" in the IPv6 addressing 5402 architecture sense [ADDRIPV6]. In particular, they do not 5403 necessarily have link-local addresses, and this may complicate the 5404 use of protocols that assume them, such as [MLDV2]. 5406 3.15.4. Address Assignment Failures 5408 If the responder encounters an error while attempting to assign an IP 5409 address to the initiator during the processing of a Configuration 5410 Payload, it responds with an INTERNAL_ADDRESS_FAILURE notification. 5411 The IKE SA is still created even if the initial Child SA cannot be 5412 created because of this failure. If this error is generated within 5413 an IKE_AUTH exchange, no Child SA will be created. However, there 5414 are some more complex error cases. 5416 If the responder does not support configuration payloads at all, it 5417 can simply ignore all configuration payloads. This type of 5418 implementation never sends INTERNAL_ADDRESS_FAILURE notifications. 5419 If the initiator requires the assignment of an IP address, it will 5420 treat a response without CFG_REPLY as an error. 5422 The initiator may request a particular type of address (IPv4 or IPv6) 5423 that the responder does not support, even though the responder 5424 supports configuration payloads. In this case, the responder simply 5425 ignores the type of address it does not support and processes the 5426 rest of the request as usual. 5428 If the initiator requests multiple addresses of a type that the 5429 responder supports, and some (but not all) of the requests fail, the 5430 responder replies with the successful addresses only. The responder 5431 sends INTERNAL_ADDRESS_FAILURE only if no addresses can be assigned. 5433 If the initiator does not receive the IP address(es) required by its 5434 policy, it MAY keep the IKE SA up and retry the configuration payload 5435 as separate INFORMATIONAL exchange after suitable timeout, or it MAY 5436 tear down the IKE SA by sending a DELETE payload inside a separate 5437 INFORMATIONAL exchange and later retry IKE SA from the beginning 5438 after some timeout. Such a timeout should not be too short 5439 (especially if the IKE SA is started from the beginning) because 5440 these error situations may not be able to be fixed quickly; the 5441 timeout should likely be several minutes. For example, an address 5442 shortage problem on the responder will probably only be fixed when 5443 more entries are returned to the address pool when other clients 5444 disconnect or when responder is reconfigured with larger address 5445 pool. 5447 3.16. Extensible Authentication Protocol (EAP) Payload 5449 The Extensible Authentication Protocol Payload, denoted EAP in this 5450 document, allows IKE SAs to be authenticated using the protocol 5451 defined in RFC 3748 [EAP] and subsequent extensions to that protocol. 5452 When using EAP, an appropriate EAP method needs to be selected. Many 5453 of these methods have been defined, specifying the protocol's use 5454 with various authentication mechanisms. EAP method types are listed 5455 in [EAP-IANA]. A short summary of the EAP format is included here 5456 for clarity. 5458 1 2 3 5459 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 5460 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5461 | Next Payload |C| RESERVED | Payload Length | 5462 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5463 | | 5464 ~ EAP Message ~ 5465 | | 5466 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5468 Figure 24: EAP Payload Format 5470 The payload type for an EAP Payload is forty eight (48). 5472 1 2 3 5473 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 5474 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5475 | Code | Identifier | Length | 5476 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5477 | Type | Type_Data... 5478 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 5480 Figure 25: EAP Message Format 5482 o Code (1 octet) indicates whether this message is a Request (1), 5483 Response (2), Success (3), or Failure (4). 5485 o Identifier (1 octet) is used in PPP to distinguish replayed 5486 messages from repeated ones. Since in IKE, EAP runs over a 5487 reliable protocol, it serves no function here. In a response 5488 message, this octet MUST be set to match the identifier in the 5489 corresponding request. 5491 o Length (2 octets, unsigned integer) is the length of the EAP 5492 message and MUST be four less than the Payload Length of the 5493 encapsulating payload. 5495 o Type (1 octet) is present only if the Code field is Request (1) or 5496 Response (2). For other codes, the EAP message length MUST be 5497 four octets and the Type and Type_Data fields MUST NOT be present. 5498 In a Request (1) message, Type indicates the data being requested. 5499 In a Response (2) message, Type MUST either be Nak or match the 5500 type of the data requested. Note that since IKE passes an 5501 indication of initiator identity in the first message in the 5502 IKE_AUTH exchange, the responder SHOULD NOT send EAP Identity 5503 requests (type 1). The initiator MAY, however, respond to such 5504 requests if it receives them. 5506 o Type_Data (Variable Length) varies with the Type of Request and 5507 the associated Response. For the documentation of the EAP 5508 methods, see [EAP]. 5510 Note that since IKE passes an indication of initiator identity in the 5511 first message in the IKE_AUTH exchange, the responder should not send 5512 EAP Identity requests. The initiator may, however, respond to such 5513 requests if it receives them. 5515 4. Conformance Requirements 5517 In order to assure that all implementations of IKEv2 can 5518 interoperate, there are "MUST support" requirements in addition to 5519 those listed elsewhere. Of course, IKEv2 is a security protocol, and 5520 one of its major functions is to allow only authorized parties to 5521 successfully complete establishment of SAs. So a particular 5522 implementation may be configured with any of a number of restrictions 5523 concerning algorithms and trusted authorities that will prevent 5524 universal interoperability. 5526 IKEv2 is designed to permit minimal implementations that can 5527 interoperate with all compliant implementations. The following are 5528 features that can be omitted in a minimal implementation: 5530 o Ability to negotiate SAs through a NAT and tunnel the resulting 5531 ESP SA over UDP. 5533 o Ability to request (and respond to a request for) a temporary IP 5534 address on the remote end of a tunnel. 5536 o Ability to support EAP-based authentication. 5538 o Ability to support window sizes greater than one. 5540 o Ability to establish multiple ESP or AH SAs within a single IKE 5541 SA. 5543 o Ability to rekey SAs. 5545 To assure interoperability, all implementations MUST be capable of 5546 parsing all payload types (if only to skip over them) and to ignore 5547 payload types that it does not support unless the critical bit is set 5548 in the payload header. If the critical bit is set in an unsupported 5549 payload header, all implementations MUST reject the messages 5550 containing those payloads. 5552 Every implementation MUST be capable of doing four-message 5553 IKE_SA_INIT and IKE_AUTH exchanges establishing two SAs (one for IKE, 5554 one for ESP or AH). Implementations MAY be initiate-only or respond- 5555 only if appropriate for their platform. Every implementation MUST be 5556 capable of responding to an INFORMATIONAL exchange, but a minimal 5557 implementation MAY respond to any request in the INFORMATIONAL 5558 exchange with an empty response (note that within the context of an 5559 IKE SA, an "empty" message consists of an IKE header followed by an 5560 Encrypted payload with no payloads contained in it). A minimal 5561 implementation MAY support the CREATE_CHILD_SA exchange only in so 5562 far as to recognize requests and reject them with a Notify payload of 5563 type NO_ADDITIONAL_SAS. A minimal implementation need not be able to 5564 initiate CREATE_CHILD_SA or INFORMATIONAL exchanges. When an SA 5565 expires (based on locally configured values of either lifetime or 5566 octets passed), and implementation MAY either try to renew it with a 5567 CREATE_CHILD_SA exchange or it MAY delete (close) the old SA and 5568 create a new one. If the responder rejects the CREATE_CHILD_SA 5569 request with a NO_ADDITIONAL_SAS notification, the implementation 5570 MUST be capable of instead deleting the old SA and creating a new 5571 one. 5573 Implementations are not required to support requesting temporary IP 5574 addresses or responding to such requests. If an implementation does 5575 support issuing such requests and its policy requires using temporary 5576 IP addresses, it MUST include a CP payload in the first message in 5577 the IKE_AUTH exchange containing at least a field of type 5578 INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. All other fields are 5579 optional. If an implementation supports responding to such requests, 5580 it MUST parse the CP payload of type CFG_REQUEST in the first message 5581 in the IKE_AUTH exchange and recognize a field of type 5582 INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. If it supports leasing 5583 an address of the appropriate type, it MUST return a CP payload of 5584 type CFG_REPLY containing an address of the requested type. The 5585 responder may include any other related attributes. 5587 For an implementation to be called conforming to this specification, 5588 it MUST be possible to configure it to accept the following: 5590 o PKIX Certificates containing and signed by RSA keys of size 1024 5591 or 2048 bits, where the ID passed is any of ID_KEY_ID, ID_FQDN, 5592 ID_RFC822_ADDR, or ID_DER_ASN1_DN. 5594 o Shared key authentication where the ID passed is any of ID_KEY_ID, 5595 ID_FQDN, or ID_RFC822_ADDR. 5597 o Authentication where the responder is authenticated using PKIX 5598 Certificates and the initiator is authenticated using shared key 5599 authentication. 5601 5. Security Considerations 5603 While this protocol is designed to minimize disclosure of 5604 configuration information to unauthenticated peers, some such 5605 disclosure is unavoidable. One peer or the other must identify 5606 itself first and prove its identity first. To avoid probing, the 5607 initiator of an exchange is required to identify itself first, and 5608 usually is required to authenticate itself first. The initiator can, 5609 however, learn that the responder supports IKE and what cryptographic 5610 protocols it supports. The responder (or someone impersonating the 5611 responder) can probe the initiator not only for its identity, but 5612 using CERTREQ payloads may be able to determine what certificates the 5613 initiator is willing to use. 5615 Use of EAP authentication changes the probing possibilities somewhat. 5616 When EAP authentication is used, the responder proves its identity 5617 before the initiator does, so an initiator that knew the name of a 5618 valid initiator could probe the responder for both its name and 5619 certificates. 5621 Repeated rekeying using CREATE_CHILD_SA without additional Diffie- 5622 Hellman exchanges leaves all SAs vulnerable to cryptanalysis of a 5623 single key. Implementers should take note of this fact and set a 5624 limit on CREATE_CHILD_SA exchanges between exponentiations. This 5625 document does not prescribe such a limit. 5627 The strength of a key derived from a Diffie-Hellman exchange using 5628 any of the groups defined here depends on the inherent strength of 5629 the group, the size of the exponent used, and the entropy provided by 5630 the random number generator used. Due to these inputs, it is 5631 difficult to determine the strength of a key for any of the defined 5632 groups. Diffie-Hellman group number two, when used with a strong 5633 random number generator and an exponent no less than 200 bits, is 5634 common for use with 3DES. Group five provides greater security than 5635 group two. Group one is for historic purposes only and does not 5636 provide sufficient strength except for use with DES, which is also 5637 for historic use only. Implementations should make note of these 5638 estimates when establishing policy and negotiating security 5639 parameters. 5641 Note that these limitations are on the Diffie-Hellman groups 5642 themselves. There is nothing in IKE that prohibits using stronger 5643 groups nor is there anything that will dilute the strength obtained 5644 from stronger groups (limited by the strength of the other algorithms 5645 negotiated including the PRF). In fact, the extensible framework of 5646 IKE encourages the definition of more groups; use of elliptical curve 5647 groups may greatly increase strength using much smaller numbers. 5649 It is assumed that all Diffie-Hellman exponents are erased from 5650 memory after use. 5652 The IKE_SA_INIT and IKE_AUTH exchanges happen before the initiator 5653 has been authenticated. As a result, an implementation of this 5654 protocol needs to be completely robust when deployed on any insecure 5655 network. Implementation vulnerabilities, particularly DoS attacks, 5656 can be exploited by unauthenticated peers. This issue is 5657 particularly worrisome because of the unlimited number of messages in 5658 EAP-based authentication. 5660 The strength of all keys is limited by the size of the output of the 5661 negotiated PRF. For this reason, a PRF whose output is less than 128 5662 bits (e.g., 3DES-CBC) MUST NOT be used with this protocol. 5664 The security of this protocol is critically dependent on the 5665 randomness of the randomly chosen parameters. These should be 5666 generated by a strong random or properly seeded pseudo-random source 5667 (see [RANDOMNESS]). Implementers should take care to ensure that use 5668 of random numbers for both keys and nonces is engineered in a fashion 5669 that does not undermine the security of the keys. 5671 For information on the rationale of many of the cryptographic design 5672 choices in this protocol, see [SIGMA] and [SKEME]. Though the 5673 security of negotiated Child SAs does not depend on the strength of 5674 the encryption and integrity protection negotiated in the IKE SA, 5675 implementations MUST NOT negotiate NONE as the IKE integrity 5676 protection algorithm or ENCR_NULL as the IKE encryption algorithm. 5678 When using pre-shared keys, a critical consideration is how to assure 5679 the randomness of these secrets. The strongest practice is to ensure 5680 that any pre-shared key contain as much randomness as the strongest 5681 key being negotiated. Deriving a shared secret from a password, 5682 name, or other low-entropy source is not secure. These sources are 5683 subject to dictionary and social engineering attacks, among others. 5685 The NAT_DETECTION_*_IP notifications contain a hash of the addresses 5686 and ports in an attempt to hide internal IP addresses behind a NAT. 5687 Since the IPv4 address space is only 32 bits, and it is usually very 5688 sparse, it would be possible for an attacker to find out the internal 5689 address used behind the NAT box by trying all possible IP addresses 5690 and trying to find the matching hash. The port numbers are normally 5691 fixed to 500, and the SPIs can be extracted from the packet. This 5692 reduces the number of hash calculations to 2^32. With an educated 5693 guess of the use of private address space, the number of hash 5694 calculations is much smaller. Designers should therefore not assume 5695 that use of IKE will not leak internal address information. 5697 When using an EAP authentication method that does not generate a 5698 shared key for protecting a subsequent AUTH payload, certain man-in- 5699 the-middle and server impersonation attacks are possible [EAPMITM]. 5700 These vulnerabilities occur when EAP is also used in protocols that 5701 are not protected with a secure tunnel. Since EAP is a general- 5702 purpose authentication protocol, which is often used to provide 5703 single-signon facilities, a deployed IPsec solution that relies on an 5704 EAP authentication method that does not generate a shared key (also 5705 known as a non-key-generating EAP method) can become compromised due 5706 to the deployment of an entirely unrelated application that also 5707 happens to use the same non-key-generating EAP method, but in an 5708 unprotected fashion. Note that this vulnerability is not limited to 5709 just EAP, but can occur in other scenarios where an authentication 5710 infrastructure is reused. For example, if the EAP mechanism used by 5711 IKEv2 utilizes a token authenticator, a man-in-the-middle attacker 5712 could impersonate the web server, intercept the token authentication 5713 exchange, and use it to initiate an IKEv2 connection. For this 5714 reason, use of non-key-generating EAP methods SHOULD be avoided where 5715 possible. Where they are used, it is extremely important that all 5716 usages of these EAP methods SHOULD utilize a protected tunnel, where 5717 the initiator validates the responder's certificate before initiating 5718 the EAP authentication. Implementers should describe the 5719 vulnerabilities of using non-key-generating EAP methods in the 5720 documentation of their implementations so that the administrators 5721 deploying IPsec solutions are aware of these dangers. 5723 An implementation using EAP MUST also use a public-key-based 5724 authentication of the server to the client before the EAP 5725 authentication begins, even if the EAP method offers mutual 5726 authentication. This avoids having additional IKEv2 protocol 5727 variations and protects the EAP data from active attackers. 5729 If the messages of IKEv2 are long enough that IP-level fragmentation 5730 is necessary, it is possible that attackers could prevent the 5731 exchange from completing by exhausting the reassembly buffers. The 5732 chances of this can be minimized by using the Hash and URL encodings 5733 instead of sending certificates (see Section 3.6). Additional 5734 mitigations are discussed in [DOSUDPPROT]. 5736 Admission control is critical to the security of the protocol. For 5737 example, trust anchors used for identifying IKE peers should probably 5738 be different than those used for other forms of trust, such as those 5739 used to identify public web servers. Moreover, although IKE provides 5740 a great deal of leeway in defining the security policy for a trusted 5741 peer's identity, credentials, and the correlation between them, 5742 having such security policy defined explicitly is essential to a 5743 secure implementation. 5745 5.1. Traffic selector authorization 5747 IKEv2 relies on information in the Peer Authorization Database (PAD) 5748 when determining what kind of Child SAs a peer is allowed to create. 5749 This process is described in [IPSECARCH] Section 4.4.3. When a peer 5750 requests the creation of an Child SA with some traffic selectors, the 5751 PAD must contain "Child SA Authorization Data" linking the identity 5752 authenticated by IKEv2 and the addresses permitted for traffic 5753 selectors. 5755 For example, the PAD might be configured so that authenticated 5756 identity "sgw23.example.com" is allowed to create Child SAs for 5757 192.0.2.0/24, meaning this security gateway is a valid 5758 "representative" for these addresses. Host-to-host IPsec requires 5759 similar entries, linking, for example, "fooserver4.example.com" with 5760 198.51.100.66/32, meaning this identity a valid "owner" or 5761 "representative" of the address in question. 5763 As noted in [IPSECARCH], "It is necessary to impose these constraints 5764 on creation of child SAs to prevent an authenticated peer from 5765 spoofing IDs associated with other, legitimate peers." In the 5766 example given above, a correct configuration of the PAD prevents 5767 sgw23 from creating Child SAs with address 198.51.100.66, and 5768 prevents fooserver4 from creating Child SAs with addresses from 5769 192.0.2.0/24. 5771 It is important to note that simply sending IKEv2 packets using some 5772 particular address does not imply a permission to create Child SAs 5773 with that address in the traffic selectors. For example, even if 5774 sgw23 would be able to spoof its IP address as 198.51.100.66, it 5775 could not create Child SAs matching fooserver4's traffic. 5777 The IKEv2 specification does not specify how exactly IP address 5778 assignment using configuration payloads interacts with the PAD. Our 5779 interpretation is that when a security gateway assigns an address 5780 using configuration payloads, it also creates a temporary PAD entry 5781 linking the authenticated peer identity and the newly allocated inner 5782 address. 5784 It has been recognized that configuring the PAD correctly may be 5785 difficult in some environments. For instance, if IPsec is used 5786 between a pair of hosts whose addresses are allocated dynamically 5787 using DHCP, it is extremely difficult to ensure that the PAD 5788 specifies the correct "owner" for each IP address. This would 5789 require a mechanism to securely convey address assignments from the 5790 DHCP server, and link them to identities authenticated using IKEv2. 5792 Due to this limitation, some vendors have been known to configure 5793 their PADs to allow an authenticated peer to create Child SAs with 5794 traffic selectors containing the same address that was used for the 5795 IKEv2 packets. In environments where IP spoofing is possible (i.e., 5796 almost everywhere) this essentially allows any peer to create Child 5797 SAs with any traffic selectors. This is not an appropriate or secure 5798 configuration in most circumstances. See [H2HIPSEC] for an extensive 5799 discussion about this issue, and the limitations of host-to-host 5800 IPsec in general. 5802 6. IANA Considerations 5804 [IKEV2] defined many field types and values. IANA has already 5805 registered those types and values in [IKEV2IANA], so they are not 5806 listed here again. 5808 Two items are removed from the IKEv2 Configuration Payload Attribute 5809 Types table: INTERNAL_IP6_NBNS and INTERNAL_ADDRESS_EXPIRY. 5811 Two new additions to the IKEv2 parameters "NOTIFY MESSAGES - ERROR 5812 TYPES" registry are defined here that were not defined in [IKEV2]: 5814 {TBA1} TEMPORARY_FAILURE 5815 {TBA2} CHILD_SA_NOT_FOUND 5817 IANA should change the exiting IKEv2 Payload Types table from: 5819 46 Encrypted E [IKEv2] 5821 to 5823 46 Encrypted and Authenticated SK [This document] 5825 IANA should update all references to RFC 4306 to point to this 5826 document. 5828 7. Acknowledgements 5830 Many individuals in the IPsecME Working Group were very helpful in 5831 contributing ideas and text for this document, as well as in 5832 reviewing the clarifications suggested by others. 5834 The acknowledgements from the IKEv2 document were: 5836 This document is a collaborative effort of the entire IPsec WG. If 5837 there were no limit to the number of authors that could appear on an 5838 RFC, the following, in alphabetical order, would have been listed: 5839 Bill Aiello, Stephane Beaulieu, Steve Bellovin, Sara Bitan, Matt 5840 Blaze, Ran Canetti, Darren Dukes, Dan Harkins, Paul Hoffman, John 5841 Ioannidis, Charlie Kaufman, Steve Kent, Angelos Keromytis, Tero 5842 Kivinen, Hugo Krawczyk, Andrew Krywaniuk, Radia Perlman, Omer 5843 Reingold, and Michael Richardson. Many other people contributed to 5844 the design. It is an evolution of IKEv1, ISAKMP, and the IPsec DOI, 5845 each of which has its own list of authors. Hugh Daniel suggested the 5846 feature of having the initiator, in message 3, specify a name for the 5847 responder, and gave the feature the cute name "You Tarzan, Me Jane". 5848 David Faucher and Valery Smyslov helped refine the design of the 5849 traffic selector negotiation. 5851 This paragraph lists references that appear only in figures. The 5852 section is only here to keep the 'xml2rfc' program happy, and needs 5853 to be removed when the document is published. The RFC Editor will 5854 remove it before publication. [EAI] [DES] [IDEA] [MD5] [DSS] 5856 8. References 5858 8.1. Normative References 5860 [ADDGROUP] 5861 Kivinen, T. and M. Kojo, "More Modular Exponential (MODP) 5862 Diffie-Hellman groups for Internet Key Exchange (IKE)", 5863 RFC 3526, May 2003. 5865 [ADDRIPV6] 5866 Hinden, R. and S. Deering, "Internet Protocol Version 6 5867 (IPv6) Addressing Architecture", RFC 4291, February 2006. 5869 [AEAD] McGrew, D. and D. Black, "Using Authenticated Encryption 5870 Algorithms with the Encrypted Payload of the Internet Key 5871 Exchange version 2 (IKEv2) Protocol", RFC 5282, 5872 August 2008. 5874 [AESCMACPRF128] 5875 Song, J., "The Advanced Encryption Standard-Cipher-based 5876 Message Authentication Code-Pseudo-Random Function-128 5877 (AES-CMAC-PRF-128) Algorithm for the Internet Key Exchange 5878 Protocol (IKE)", RFC 4615, August 2006. 5880 [AESXCBCPRF128] 5881 Hoffman, P., "The AES-XCBC-PRF-128 Algorithm for the 5882 Internet Key Exchange Protocol (IKE)", RFC 4434, 5883 February 2006. 5885 [EAP] Aboba, B., Blunk, L., Vollbrecht, J., Carlson, J., and H. 5886 Levkowetz, "Extensible Authentication Protocol (EAP)", 5887 RFC 3748, June 2004. 5889 [ECN] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition 5890 of Explicit Congestion Notification (ECN) to IP", 5891 RFC 3168, September 2001. 5893 [ESPCBC] Pereira, R. and R. Adams, "The ESP CBC-Mode Cipher 5894 Algorithms", RFC 2451, November 1998. 5896 [IKEV2IANA] 5897 "Internet Key Exchange Version 2 (IKEv2) Parameters", 5898 . 5900 [IPSECARCH] 5901 Kent, S. and K. Seo, "Security Architecture for the 5902 Internet Protocol", RFC 4301, December 2005. 5904 [MUSTSHOULD] 5905 Bradner, S., "Key Words for use in RFCs to indicate 5906 Requirement Levels", BCP 14, RFC 2119, March 1997. 5908 [PKCS1] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 5909 Standards (PKCS) #1: RSA Cryptography Specifications 5910 Version 2.1", RFC 3447, February 2003. 5912 [PKIX] Housley, R., Polk, W., Ford, W., and D. Solo, "Internet 5913 X.509 Public Key Infrastructure Certificate and 5914 Certificate Revocation List (CRL) Profile", RFC 5280, 5915 May 2008. 5917 [UDPENCAPS] 5918 Huttunen, A., Swander, B., Volpe, V., DiBurro, L., and M. 5919 Stenberg, "UDP Encapsulation of IPsec ESP Packets", 5920 RFC 3948, January 2005. 5922 8.2. Informative References 5924 [AH] Kent, S., "IP Authentication Header", RFC 4302, 5925 December 2005. 5927 [ARCHGUIDEPHIL] 5928 Bush, R. and D. Meyer, "Some Internet Architectural 5929 Guidelines and Philosophy", RFC 3439, December 2002. 5931 [ARCHPRINC] 5932 Carpenter, B., "Architectural Principles of the Internet", 5933 RFC 1958, June 1996. 5935 [Clarif] Eronen, P. and P. Hoffman, "IKEv2 Clarifications and 5936 Implementation Guidelines", RFC 4718, October 2006. 5938 [DES] American National Standards Institute, "American National 5939 Standard for Information Systems-Data Link Encryption", 5940 ANSI X3.106, 1983. 5942 [DH] Diffie, W. and M. Hellman, "New Directions in 5943 Cryptography", IEEE Transactions on Information Theory, 5944 V.IT-22 n. 6, June 1977. 5946 [DIFFSERVARCH] 5947 Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z., 5948 and W. Weiss, "An Architecture for Differentiated 5949 Services", RFC 2475. 5951 [DIFFSERVFIELD] 5952 Nichols, K., Blake, S., Baker, F., and D. Black, 5953 "Definition of the Differentiated Services Field (DS 5954 Field) in the IPv4 and IPv6 Headers", RFC 2474, 5955 December 1998. 5957 [DIFFTUNNEL] 5958 Black, D., "Differentiated Services and Tunnels", 5959 RFC 2983, October 2000. 5961 [DOI] Piper, D., "The Internet IP Security Domain of 5962 Interpretation for ISAKMP", RFC 2407, November 1998. 5964 [DOSUDPPROT] 5965 C. Kaufman, R. Perlman, and B. Sommerfeld, "DoS protection 5966 for UDP-based protocols", ACM Conference on Computer and 5967 Communications Security , October 2003. 5969 [DSS] National Institute of Standards and Technology, U.S. 5970 Department of Commerce, "Digital Signature Standard", 5971 Draft FIPS 186-3, June 2008. 5973 [EAI] Abel, Y., "Internationalized Email Headers", RFC 5335, 5974 September 2008. 5976 [EAP-IANA] 5977 "Extensible Authentication Protocol (EAP) Registry: Method 5978 Types", . 5980 [EAPMITM] N. Asokan, V. Nierni, and K. Nyberg, "Man-in-the-Middle in 5981 Tunneled Authentication Protocols", November 2002, 5982 . 5984 [ESP] Kent, S., "IP Encapsulating Security Payload (ESP)", 5985 RFC 4303, December 2005. 5987 [EXCHANGEANALYSIS] 5988 R. Perlman and C. Kaufman, "Analysis of the IPsec key 5989 exchange Standard", WET-ICE Security Conference, MIT , 5990 2001, 5991 . 5993 [H2HIPSEC] 5994 Aura, T., Roe, M., and A. Mohammed, "Experiences with 5995 Host-to-Host IPsec", 13th International Workshop on 5996 Security Protocols, Cambridge, UK, April 2005. 5998 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 5999 Hashing for Message Authentication", RFC 2104, 6000 February 1997. 6002 [IDEA] X. Lai, "On the Design and Security of Block Ciphers", ETH 6003 Series in Information Processing, v. 1, Konstanz: Hartung- 6004 Gorre Verlag, 1992. 6006 [IDNA] Faltstrom, P., Hoffman, P., and A. Costello, 6007 "Internationalizing Domain Names in Applications (IDNA)", 6008 RFC 3490, March 2003. 6010 [IKEV1] Harkins, D. and D. Carrel, "The Internet Key Exchange 6011 (IKE)", RFC 2409, November 1998. 6013 [IKEV2] Kaufman, C., "Internet Key Exchange (IKEv2) Protocol", 6014 RFC 4306, December 2005. 6016 [IP-COMP] Shacham, A., Monsour, B., Pereira, R., and M. Thomas, "IP 6017 Payload Compression Protocol (IPComp)", RFC 3173, 6018 September 2001. 6020 [IPSECARCH-OLD] 6021 Kent, S. and R. Atkinson, "Security Architecture for the 6022 Internet Protocol", RFC 2401, November 1998. 6024 [IPV6CONFIG] 6025 Eronen, et. al., P., "IPv6 Configuration in IKEv2", 6026 RFC 5739, February 2010. 6028 [ISAKMP] Maughan, D., Schneider, M., and M. Schertler, "Internet 6029 Security Association and Key Management Protocol 6030 (ISAKMP)", RFC 2408, November 1998. 6032 [MAILFORMAT] 6033 Resnick, P., "Internet Message Format", RFC 5322, 6034 October 2008. 6036 [MD5] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 6037 April 1992. 6039 [MIPV6] Johnson, D., Perkins, C., and J. Arkko, "Mobility Support 6040 in IPv6", RFC 3775, June 2004. 6042 [MLDV2] Vida, R. and L. Costa, "Multicast Listener Discovery 6043 Version 2 (MLDv2) for IPv6", RFC 3810, June 2004. 6045 [MOBIKE] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 6046 (MOBIKE)", RFC 4555, June 2006. 6048 [MODES] National Institute of Standards and Technology, U.S. 6049 Department of Commerce, "Recommendation for Block Cipher 6050 Modes of Operation", SP 800-38A, 2001. 6052 [NAI] Aboba, B., Beadles, M., Eronen, P., and J. Arkko, "The 6053 Network Access Identifier", RFC 4282, December 2005. 6055 [NATREQ] Aboba, B. and W. Dixon, "IPsec-Network Address Translation 6056 (NAT) Compatibility Requirements", RFC 3715, March 2004. 6058 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol", 6059 RFC 2412, November 1998. 6061 [PFKEY] McDonald, D., Metz, C., and B. Phan, "PF_KEY Key 6062 Management API, Version 2", RFC 2367, July 1998. 6064 [PHOTURIS] 6065 Karn, P. and W. Simpson, "Photuris: Session-Key Management 6066 Protocol", RFC 2522, March 1999. 6068 [RANDOMNESS] 6069 Eastlake, D., Schiller, J., and S. Crocker, "Randomness 6070 Requirements for Security", BCP 106, RFC 4086, June 2005. 6072 [REAUTH] Nir, Y., "Repeated Authentication in Internet Key Exchange 6073 (IKEv2) Protocol", RFC 4478, April 2006. 6075 [REUSE] Menezes, A. and B. Ustaoglu, "On Reusing Ephemeral Keys In 6076 Diffie-Hellman Key Agreement Protocols", December 2008, 6077 . 6080 [ROHCV2] Ertekin, et. al., E., "IKEv2 Extensions to Support Robust 6081 Header Compression over IPsec (ROHCoIPsec)", 6082 draft-ietf-rohc-ikev2-extensions-hcoipsec (work in 6083 progress), August 2009. 6085 [RSA] R. Rivest, A. Shamir, and L. Adleman, "A Method for 6086 Obtaining Digital Signatures and Public-Key 6087 Cryptosystems", February 1978. 6089 [SHA] National Institute of Standards and Technology, U.S. 6090 Department of Commerce, "Secure Hash Standard", 6091 FIPS 180-3, October 2008. 6093 [SIGMA] H. Krawczyk, "SIGMA: the `SIGn-and-MAc' Approach to 6094 Authenticated Diffie-Hellman and its Use in the IKE 6095 Protocols", Advances in Cryptography - CRYPTO 2003 6096 Proceedings LNCS 2729, 2003, . 6100 [SKEME] H. Krawczyk, "SKEME: A Versatile Secure Key Exchange 6101 Mechanism for Internet", IEEE Proceedings of the 1996 6102 Symposium on Network and Distributed Systems Security , 6103 1996. 6105 [TRANSPARENCY] 6106 Carpenter, B., "Internet Transparency", RFC 2775, 6107 February 2000. 6109 Appendix A. Summary of changes from IKEv1 6111 The goals of this revision to IKE are: 6113 1. To define the entire IKE protocol in a single document, 6114 replacing RFCs 2407, 2408, and 2409 and incorporating subsequent 6115 changes to support NAT Traversal, Extensible Authentication, and 6116 Remote Address acquisition; 6118 2. To simplify IKE by replacing the eight different initial 6119 exchanges with a single four-message exchange (with changes in 6120 authentication mechanisms affecting only a single AUTH payload 6121 rather than restructuring the entire exchange) see 6122 [EXCHANGEANALYSIS]; 6124 3. To remove the Domain of Interpretation (DOI), Situation (SIT), 6125 and Labeled Domain Identifier fields, and the Commit and 6126 Authentication only bits; 6128 4. To decrease IKE's latency in the common case by making the 6129 initial exchange be 2 round trips (4 messages), and allowing the 6130 ability to piggyback setup of a Child SA on that exchange; 6132 5. To replace the cryptographic syntax for protecting the IKE 6133 messages themselves with one based closely on ESP to simplify 6134 implementation and security analysis; 6136 6. To reduce the number of possible error states by making the 6137 protocol reliable (all messages are acknowledged) and sequenced. 6138 This allows shortening CREATE_CHILD_SA exchanges from 3 messages 6139 to 2; 6141 7. To increase robustness by allowing the responder to not do 6142 significant processing until it receives a message proving that 6143 the initiator can receive messages at its claimed IP address; 6145 8. To fix cryptographic weaknesses such as the problem with 6146 symmetries in hashes used for authentication documented by Tero 6147 Kivinen; 6149 9. To specify traffic selectors in their own payloads type rather 6150 than overloading ID payloads, and making more flexible the 6151 traffic selectors that may be specified; 6153 10. To specify required behavior under certain error conditions or 6154 when data that is not understood is received in order to make it 6155 easier to make future revisions in a way that does not break 6156 backwards compatibility; 6158 11. To simplify and clarify how shared state is maintained in the 6159 presence of network failures and DoS attacks; and 6161 12. To maintain existing syntax and magic numbers to the extent 6162 possible to make it likely that implementations of IKEv1 can be 6163 enhanced to support IKEv2 with minimum effort. 6165 Appendix B. Diffie-Hellman Groups 6167 There are two Diffie-Hellman groups defined here for use in IKE. 6168 These groups were generated by Richard Schroeppel at the University 6169 of Arizona. Properties of these primes are described in [OAKLEY]. 6171 The strength supplied by group 1 may not be sufficient for typical 6172 uses and is here for historic reasons. 6174 Additional Diffie-Hellman groups have been defined in [ADDGROUP]. 6176 B.1. Group 1 - 768 Bit MODP 6178 This group is assigned id 1 (one). 6180 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 6181 Its hexadecimal value is: 6183 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 6184 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 6185 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 6186 E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF 6188 The generator is 2. 6190 B.2. Group 2 - 1024 Bit MODP 6192 This group is assigned id 2 (two). 6194 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 6195 Its hexadecimal value is: 6197 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 6198 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD 6199 EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 6200 E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED 6201 EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 6202 FFFFFFFF FFFFFFFF 6204 The generator is 2. 6206 Appendix C. Exchanges and Payloads 6208 This appendix contains a short summary of the IKEv2 exchanges, and 6209 what payloads can appear in which message. This appendix is purely 6210 informative; if it disagrees with the body of this document, the 6211 other text is considered correct. 6213 Vendor-ID (V) payloads may be included in any place in any message. 6214 This sequence here shows what are the most logical places for them. 6216 C.1. IKE_SA_INIT Exchange 6218 request --> [N(COOKIE)], 6219 SA, KE, Ni, 6220 [N(NAT_DETECTION_SOURCE_IP)+, 6221 N(NAT_DETECTION_DESTINATION_IP)], 6222 [V+][N+] 6224 normal response <-- SA, KE, Nr, 6225 (no cookie) [N(NAT_DETECTION_SOURCE_IP), 6226 N(NAT_DETECTION_DESTINATION_IP)], 6227 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 6228 [V+][N+] 6230 cookie response <-- N(COOKIE), 6231 [V+][N+] 6233 different Diffie- <-- N(INVALID_KE_PAYLOAD), 6234 Hellman group [V+][N+] 6235 wanted 6237 C.2. IKE_AUTH Exchange without EAP 6239 request --> IDi, [CERT+], 6240 [N(INITIAL_CONTACT)], 6241 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 6242 [IDr], 6243 AUTH, 6244 [CP(CFG_REQUEST)], 6245 [N(IPCOMP_SUPPORTED)+], 6246 [N(USE_TRANSPORT_MODE)], 6247 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6248 [N(NON_FIRST_FRAGMENTS_ALSO)], 6249 SA, TSi, TSr, 6250 [V+][N+] 6252 response <-- IDr, [CERT+], 6253 AUTH, 6254 [CP(CFG_REPLY)], 6255 [N(IPCOMP_SUPPORTED)], 6256 [N(USE_TRANSPORT_MODE)], 6257 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6258 [N(NON_FIRST_FRAGMENTS_ALSO)], 6259 SA, TSi, TSr, 6260 [N(ADDITIONAL_TS_POSSIBLE)], 6261 [V+][N+] 6263 error in Child SA <-- IDr, [CERT+], 6264 creation AUTH, 6265 N(error), 6266 [V+][N+] 6268 C.3. IKE_AUTH Exchange with EAP 6270 first request --> IDi, 6271 [N(INITIAL_CONTACT)], 6272 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 6273 [IDr], 6274 [CP(CFG_REQUEST)], 6275 [N(IPCOMP_SUPPORTED)+], 6276 [N(USE_TRANSPORT_MODE)], 6277 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6278 [N(NON_FIRST_FRAGMENTS_ALSO)], 6279 SA, TSi, TSr, 6280 [V+][N+] 6282 first response <-- IDr, [CERT+], AUTH, 6283 EAP, 6284 [V+][N+] 6286 / --> EAP 6287 repeat 1..N times | 6288 \ <-- EAP 6290 last request --> AUTH 6292 last response <-- AUTH, 6293 [CP(CFG_REPLY)], 6294 [N(IPCOMP_SUPPORTED)], 6295 [N(USE_TRANSPORT_MODE)], 6296 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6297 [N(NON_FIRST_FRAGMENTS_ALSO)], 6298 SA, TSi, TSr, 6299 [N(ADDITIONAL_TS_POSSIBLE)], 6300 [V+][N+] 6302 C.4. CREATE_CHILD_SA Exchange for Creating or Rekeying Child SAs 6304 request --> [N(REKEY_SA)], 6305 [CP(CFG_REQUEST)], 6306 [N(IPCOMP_SUPPORTED)+], 6307 [N(USE_TRANSPORT_MODE)], 6308 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6309 [N(NON_FIRST_FRAGMENTS_ALSO)], 6310 SA, Ni, [KEi], TSi, TSr 6311 [V+][N+] 6313 normal <-- [CP(CFG_REPLY)], 6314 response [N(IPCOMP_SUPPORTED)], 6315 [N(USE_TRANSPORT_MODE)], 6316 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 6317 [N(NON_FIRST_FRAGMENTS_ALSO)], 6318 SA, Nr, [KEr], TSi, TSr, 6319 [N(ADDITIONAL_TS_POSSIBLE)] 6320 [V+][N+] 6322 error case <-- N(error) 6324 different Diffie- <-- N(INVALID_KE_PAYLOAD), 6325 Hellman group [V+][N+] 6326 wanted 6328 C.5. CREATE_CHILD_SA Exchange for Rekeying the IKE SA 6330 request --> SA, Ni, KEi 6331 [V+][N+] 6333 response <-- SA, Nr, KEr 6334 [V+][N+] 6336 C.6. INFORMATIONAL Exchange 6338 request --> [N+], 6339 [D+], 6340 [CP(CFG_REQUEST)] 6342 response <-- [N+], 6343 [D+], 6344 [CP(CFG_REPLY)] 6346 Appendix D. Changes Between Internet Draft Versions 6348 This section will be removed before publication as an RFC, but should 6349 be left intact until then so that reviewers can follow what has 6350 changed. 6352 D.1. Changes from IKEv2 to draft -00 6354 There were a zillion additions from RFC 4718. These are noted with 6355 "{{ Clarif-nn }}". 6357 Cleaned up many of the figures. Made the table headings consistent. 6358 Made some tables easier to read by removing blank spaces. Removed 6359 the "reserved to IANA" and "private use" text wording and moved it 6360 into the tables. 6362 Changed many SHOULD requirements to better match RFC 2119. These are 6363 also marked with comments such as "{{ Demoted the SHOULD }}". 6365 In Section 2.16, changed the MUST requirement of authenticating the 6366 responder from "public key signature based" to "strong" because that 6367 is what most current IKEv2 implementations do, and it better matches 6368 the actual security requirement. 6370 D.2. Changes from draft -00 to draft -01 6372 The most significant technical change was to make KE optional but 6373 strongly recommended in Section 1.3.2. 6375 Updated all references to the IKEv2 Clarifications document to RFC 6376 4718. 6378 Moved a lot of the protocol description out of the long tables in 6379 Section 3.10.1 into the body of the document. These are noted with 6380 "{{ 3.10.1-nnnn }}", where "nnnn" is the notification type number. 6382 Made some table changes based on suggestions from Alfred Hoenes. 6384 Changed "byte" to "octet" in many places. 6386 Removed discussion of ESP+AH bundles in many places, and added a 6387 paragraph about it in Section 1.7. 6389 Removed the discussion of INTERNAL_ADDRESS_EXPIRY in many places, and 6390 added a paragraph about it in Section 1.7. 6392 Moved Clarif-7.10 from Section 1.2 to Section 3.2. 6394 In the figure in Section 1.3.2, made KEi optional, and added text 6395 saying "The KEi payload SHOULD be included." 6397 In the figure in Section 1.3.2, maked KEr optional, and removed text 6398 saying "KEi and KEr are required for rekeying an IKE SA." 6400 In Section 1.4, clarified that the half-closed connections being 6401 discussed are AH and ESP. 6403 Rearranged the end of Section 1.7, and added the new notation for 6404 moving text out of 3.10.1. 6406 Clarified the wording in the second paragraph of Section 2.2. This 6407 allowd the removal of the fourth paragraph, which previously had 6408 Clarif-2.2 in it. 6410 In section 2.5, removed "or later" from "version 2.0". 6412 Added the question for implementers about payload order at the end of 6413 Section 2.5. 6415 Corrected Section 2.7 based on Clarif-7-13 to say that you can't do 6416 ESP and AH at one time. 6418 In Section 2.8, clarified the wording about how to replace an IKE SA. 6420 Clarified the text in the last many paragraphs in Section 2.9. Also 6421 moved some text from near the beginning of 2.9 to the beginning of 6422 2.9.1. 6424 Removed some redundant text in Section 2.9 concerning creating a 6425 Child SA pair not in response to an arriving packet. 6427 Added the following to the end of the first paragraph of Section 6428 2.14: "The lengths of SK_d, SK_pi, and SK_pr are the key length of 6429 the agreed-to PRF." 6431 Added the restriction in Section 2.15 that all PRFs used with IKEv2 6432 MUST take variable-sized keys. 6434 In Section 2.17, removed "If multiple IPsec protocols are negotiated, 6435 keying material is taken in the order in which the protocol headers 6436 will appear in the encapsulated packet" because multiple IPsec 6437 protocols cannot be negotiated at one time. 6439 Added the material from Clarif-5.12 to Section 2.18. 6441 Changed "hash of" to "expected value of" in Section 2.23. 6443 In the bulleted list in Section 2.23, replaced "this end" with a 6444 clearer description of which system is being discussed. 6446 Added the paragraph at the beginning of Section 3 about 6447 interoperability and UNSPECIFIED values ("In the tables in this 6448 section..."). 6450 Fixed Section 3.3 to not include proposal that include both AH and 6451 ESP. Ditto for the "Proposal #" bullet in Section 3.3.1. 6453 In the description of ID_FQDN in Section 3.5, added "All characters 6454 in the ID_FQDN are ASCII; this follows that for an "internationalized 6455 domain name" as defined in [IDNA]." 6457 In Section 3.8, shortened and clarified the description of "RSA 6458 Digital Signature". 6460 In Section 3.10, shortened and clarified the description of "Protocol 6461 ID". 6463 In Section 3.15, "The requested address is valid until the expiry 6464 time defined with the INTERNAL_ADDRESS_EXPIRY attribute or there are 6465 no IKE SAs between the peers" is shortened to just "The requested 6466 address is valid until there are no IKE SAs between the peers." 6468 In Section 3.15.1, changed "INTERNAL_IP6_NBNS" to unspecified. 6470 Made [ADDRIPV6] an informative reference instead of a normative 6471 reference and updated it. 6473 Made [PKCS1] a normative reference instead of an informative 6474 reference and changed the pointer to RFC 3447. 6476 D.3. Changes from draft -00 to draft -01 6478 In Section 1.5, added "request" to first sentence to make it "If an 6479 encrypted IKE request packet arrives on port 500 or 4500 with an 6480 unrecognized SPI...". 6482 In Section 3.3, fifth paragraph, upped the number of transforms for 6483 AH and ESP by one each to account for ESN, which is now mandatory. 6485 In Section 2.1, added "or equal to" in "The responder MUST remember 6486 each response until it receives a request whose sequence number is 6487 larger than or equal to the sequence number in the response plus its 6488 window size." 6490 In Section 2.18, removed " Note that this may not work if the new IKE 6491 SA's PRF has a fixed key size because the output of the PRF may not 6492 be of the correct size." because it is no longer relevant. 6494 D.4. Changes from draft -01 to draft -02 6496 Many grammatical fixes. 6498 In Section 1.2, reworded Clarif-4.3 to be clearer. 6500 In Section 1.3.3, reworded 3.10.1-16393 and Clarif-5.4 to remove 6501 redundant text. 6503 In Section 2.13, replaced text about variable length keys with 6504 clearer explanation and requirement on non-HMAC PRFs. Also added 6505 "preferred" to Section 2.14 for the key length, and removed redundant 6506 text. 6508 In Section 2.14, removed the "half and half" description and replaced 6509 it with exceptions for RFC4434 and RFC4615. 6511 Removed the now-redundant "All PRFs used with IKEv2 MUST take 6512 variable-sized keys" from Section 2.15. 6514 In Section 2.15, added "(IKE_SA_INIT response)" after "of the second 6515 message" and "(IKE_SA_INIT request)" after "the first message". 6517 In Section 2.17, simplified because there are no more bundles. "A 6518 single Child SA negotiation may result in multiple security 6519 associations. ESP and AH SAs exist in pairs (one in each 6520 direction)." becomes "For ESP and AH, a single Child SA negotiation 6521 results in two security associations (one in each direction)." 6523 In section 3.3, made the example of combinations of algorithms and 6524 the contents of the first proposal clearer. 6526 Added Clarif-4.4 to the end of Section 3.3.2. 6528 Reordered Section 3.3.5 and added Clarif-7.11. 6530 Clarified Section 3.3.6 about choosing a single proposal. Also added 6531 second paragraph about transforms not understood, and clarified third 6532 paragraph about picking D-H groups. 6534 Moved 3.10.1-16392 from Section 3.6 to 3.7. 6536 In Section 3.10, clarified 3.10.1-16394. 6538 Updated Section 6 to indicate that there is nothing new for IANA in 6539 this spec. Also removed the definition of "Expert Review" from 6540 Section 1.6 for the same reason. 6542 In Appendix A, removed "and not commit any state to an exchange until 6543 the initiator can be cryptographically authenticated" because that 6544 was only true in an earlier version of IKEv2. 6546 D.5. Changes from draft -02 to draft -03 6548 In Section 1.3, changed "If the responder rejects the Diffie-Hellman 6549 group of the KEi payload, the responder MUST reject the request and 6550 indicate its preferred Diffie-Hellman group in the INVALID_KE_PAYLOAD 6551 Notification payload." to "If the responder selects a proposal using 6552 a different Diffie-Hellman group (other than NONE), the responder 6553 MUST reject the request and indicate its preferred Diffie-Hellman 6554 group in the INVALID_KE_PAYLOAD Notification payload. 6556 In Section 2.3, added the last two paragraphs covering why you 6557 initiator's SPI and/or IP to differentiate if this is a "half-open" 6558 IKE SA or a new request. Also removed similar text from Section 2.2. 6560 In Section 2.5, added "Payloads sent in IKE response messages MUST 6561 NOT have the critical flag set. Note that the critical flag applies 6562 only to the payload type, not the contents. If the payload type is 6563 recognized, but the payload contains something which is not (such as 6564 an unknown transform inside an SA payload, or an unknown Notify 6565 Message Type inside a Notify payload), the critical flag is ignored." 6567 In Section 2.6, moved the text about {{ 3.10.1-16390 }} later in the 6568 section. Also reworded the text to make it clearer what the COOKIE 6569 is for. 6571 Moved text from Clarif-2.1 from Section 2.6 to Section 2.7. 6573 In Section 2.13, added "(see Section 3.3.5 for the defintion of the 6574 Key Length transform attribute)". 6576 In Section 2.17, change the description of the keying material from 6577 the list with two bullets to a clearer list. 6579 In Section 2.23, added "Implementations MUST process received UDP- 6580 encapsulated ESP packets even when no NAT was detected." 6582 In Section 3.3, changed "Each proposal may contain a" to "Each 6583 proposal contains a". 6585 Added the asterisks to the transform type table in Section 3.3.2 and 6586 the types table in 3.3.3 to foreshadow future developments. 6588 In Section 3.3.2, changed the following algorithms to (UNSPECIFIED) 6589 because the RFCs listed didn't really specify how to implement them 6590 in an interoperable fashion: 6592 Encryption Algorithms 6593 ENCR_DES_IV64 1 (RFC1827) 6594 ENCR_3IDEA 8 (RFC2451) 6595 ENCR_DES_IV32 9 6596 Pseudo-random Functions 6597 PRF_HMAC_TIGER 3 (RFC2104) 6598 Integrity Algorithms 6599 AUTH_DES_MAC 3 6600 AUTH_KPDK_MD5 4 (RFC1826) 6602 In Section 3.4, added "(other than NONE)" to the second-to-last 6603 paragraph. 6605 Rewrote the third paragraph of Section 3.14 to talk about other 6606 modes, and to clarify which encryption and integrity protection we 6607 are talking about. 6609 Changed the "Initialization Vector" bullet in Section 3.14 to specify 6610 better what is needed for the IV. Upgraded the SHOULDs to MUSTs. 6611 Also added the reference for [MODES]. 6613 In Section 5, in the second-to-last paragraph, changed "a public-key- 6614 based" to "strong" to match the wording in Section 2.16. 6616 D.6. Changes from draft -03 to draft-ietf-ipsecme-ikev2bis-00 6618 Changed the document's filename to draft-ietf-ipsecme-ikev2bis-00. 6619 Added Yoav Nir as a co-author. 6621 In many places in the document, changed "and/or" to "or" when talking 6622 about combinations of ESP and AH SAs. For example, in the intro, it 6623 said "can be used to efficiently establish SAs for Encapsulating 6624 Security Payload (ESP) and/or Authentication Header (AH)". This is 6625 changed to "or" to indicate that you can only establish one type of 6626 SA at a time. 6628 In Section 1, clarified that RFC 4306 already replaced IKEv1, and 6629 that this document replaces RFC 4306. Also fixed Section 2.5 for 6630 similar issue. Also updated the Abstract to cover this. 6632 In Section 2.15, in the responder's signed octets, changed: 6634 RestOfRespIDPayload = IDType | RESERVED | InitIDData 6635 to 6636 RestOfRespIDPayload = IDType | RESERVED | RespIDData 6638 In 2.16, changed "strong" back to "public key signature based" to 6639 make it the same as 4306. 6641 In section 3.10, added "and the field must be empty" to make it clear 6642 that a zero-length SPI is really empty. 6644 D.7. Changes from draft-ietf-ipsecme-ikev2bis-00 to 6645 draft-ietf-ipsecme-ikev2bis-01 6647 Throughout, changed "IKE_SA" to "IKE SA", and changed "CHILD_SA" to 6648 "Child SA" (except left "CREATE_CHILD_SA" alone). 6650 Added the middle sentence in the Abstract to say what IKE actually 6651 does. 6653 Added in section 1 "(unless there is failure setting up the AH or ESP 6654 Child SA, in which case the IKE SA is still established without Child 6655 SA)". 6657 Clarified the titles of 1.1.1, 1.1.2, and 1.1.3. 6659 In 1.1.2, changed "If there is an inner IP header, the inner 6660 addresses will be the same as the outer addresses." because we are 6661 talking about transport mode here. 6663 Added reference to section 2.14 to setion 1.2 and 1.3. 6665 In 1.2, clarified what is and isn't encrypted in a message. 6667 Added the following to 1.2: "If the IDr proposed by the initiator is 6668 not acceptable to the responder, the responder might use some other 6669 IDr to finish the exchange. If the initiator then does not accept 6670 that fact that responder used different IDr than the one that was 6671 requested, the initiator can close the SA after noticing the fact." 6673 Moved the paragraph beginning "All messages following..." from 1.3 up 6674 to 1.2, and reworded it to apply to all the cases it covers. 6676 At the end of section 1.3.1, clarified that the responder is the one 6677 who controls whether non-first-fragments will be sent, and reworded 6678 the paragraph. 6680 In section 1.3.3, added "The Protocol ID field of the REKEY_SA 6681 notification is set to match the protocol of the SA we are rekeying, 6682 for example, 3 for ESP and 2 for AH." [Issue #10] 6684 In 1.3.2, added "of the SA payload" to "New initiator and responder 6685 SPIs are supplied in the SPI fields." 6687 In 1.3.3, fixed the art. 6689 <-- HDR, SK {SA, Nr, [KEr], 6690 Si, TSr} 6691 becomes 6692 <-- HDR, SK {SA, Nr, [KEr], 6693 TSi, TSr} 6695 In 1.4 and 2.18, changed "replaced for the purpose of rekeying" to 6696 "rekeyed". 6698 Split out the SA deletion material from section 1.4 into its own 6699 subsection, 1.4.1. 6701 Clarified which bits are set at the end of Section 1.5. 6703 In 1.7, added "That is, the version number is *not* changed from RFC 6704 4306.". 6706 In 2.1, added wording about retransmissions needing to be identical. 6708 In 2.2, added "or rekeyed" to "In the unlikely event that Message IDs 6709 grow too large to fit in 32 bits, the IKE SA MUST be closed" 6711 In 2.2, moved the sentence "Rekeying an IKE SA resets the sequence 6712 numbers." up higher so it would be more likely to be seen. [Issue 6713 #15] 6715 Moved the definition of "original initiator" from 2.8 into 2.2 6716 because that is where it is first used. 6718 In 2.4, added "fresh (i.e., not retransmitted)" to "If a 6719 cryptographically protected message has been received from the other 6720 side recently". Also added the sentence saying that liveness checks 6721 are sometimes call dead peer detection. 6723 Removed the question to implementers about payload order in 2.5. 6725 Changed the title of 2.6 to "IKE SA SPIs and Cookies". Also, in the 6726 paragraph that describes how to implement the responder, changed the 6727 lower-case "should" to "can" to emphasize that this is a choice. 6729 Added the second paragraph in 2.6 to make it clear that the SPI is 6730 used for mapping. 6732 In section 2.6, upgraded "needs to choose them so as to be unique 6733 identifiers of an IKE_SA" to a MUST. 6735 Added sentences at the end of 2.6 eplaining wny the initiator should 6736 limit the number of responses it sends out. 6738 In 2.6.1, added the example of the shorter exchange; this is copied 6739 from RFC 4718 but was dropped in early drafts of this document. 6741 Added the paragraph to 2.7 that describes needing two proposals if 6742 you are having both normal ciphers and combined-mode ciphers. [Issue 6743 #20]. 6745 In section 2.8, added "Note that, when rekeying, the new Child SA MAY 6746 have different traffic selectors and algorithms than the old one." 6748 Added a note in 2.9 that PFKEY applies only to IKEv1. Also added 6749 that unknown traffic selector types are not returned in narrowed 6750 responses. 6752 Added note in the first paragraph of Setion 2.9.1 about decorrelated 6753 policies preventing the problem mentioned. 6755 In 2.12, removed "In particular, it MUST forget the secrets used in 6756 the Diffie-Hellman calculation and any state that may persist in the 6757 state of a pseudo-random number generator that could be used to 6758 recompute the Diffie-Hellman secrets." 6760 In 2.15, noted that the retry could happen multiple times for 6761 different reasons. 6763 In section 2.16, changed "This shared key generated during an IKE 6764 exchange" to "This key". 6766 At the end of 2.19, added statement that FAILED_CP_REQUIRED is not 6767 fatal to the IKE SA. 6769 Added the reference to ROHCV2 to the end of 2.22. 6771 In 2.23, changed "can negotiate" to "will use". for UDP 6772 encapsulation. Added "or 4500" to "...MUST be sent from and to UDP 6773 port 500". Also removed the text about why not to do NAT-traversal 6774 over port 500 because we later say you can't do that anyway. [Issue 6775 #27] Also removed the last paragraph, which obliquely pointed to 6776 MOBIKE. More will be added later on MOBIKE. 6778 In 3.1, removed "and orderings of messages" from "Exchange type". 6779 [Issue #29] 6781 In 3.1, added "This bit changes to reflect who initiated the last 6782 rekey of the IKE SA." to the description of the Initiator bit. 6784 In 3.3, added a long example of why you might use a Proposal 6785 structure because of combined-mode algorithms. [Issue #42] 6787 In 3.3.2, changed "is unnecessary because the last Proposal could be 6788 identified from the length of the SA" to "is unnecessary because the 6789 last transform could be identified from the length of the proposal." 6791 Added reference to AEAD to 3.3.2 and 3.3.3. 6793 Added the reference to RFC 2104 back for PRF_HMAC_TIGER in 3.3.2. 6794 [Issue #33] 6796 Added note at the bottom of 3.3.2 to see the IANA registry. 6798 In 3.3.4, removed all the "this could happen in the future" stuff 6799 because it already happened. 6801 Added a reference to email address internationalization to 3.5, 6802 making the address binary (not ASCII). 6804 In the table in 3.6, made "Authority Revocation List (ARL) 8" and 6805 "X.509 Certificate - Attribute 10" unspecified. 6807 In 3.7, changed the last sentence of the first paragraph to eliminate 6808 the non-protocol SHOULD. 6810 In 3.13.1, added "(including protocol 0)" for the start port and end 6811 port. 6813 In 3.14, updated the discussion of initialization modes to reflect 6814 that it is only about CBC, and that other specs have to specify their 6815 own IVs. 6817 In 3.15.1, added a pointer to 3.15.3. In the entries for 6818 INTERNAL_IP4_SUBNET and INTERNAL_IP6_SUBNET, added a pointer to 6819 3.15.2. 6821 In 3.15.4, added "The IKE SA is still created even if the initial 6822 Child SA cannot be created because of this failure." 6824 Changed "EAP exchange" to "EAP authentication" in 5. 6826 Removed "In particular, these exponents MUST NOT be derived from 6827 long-lived secrets like the seed to a pseudo-random generator that is 6828 not erased after use." from section 5 because it is not possible in 6829 most implementations to do so. 6831 Updated a bunch of reference to their newer versions. 6833 Added "[V+]" to the end of the exchanges in C.4 and C.5. 6835 Added two more response templates to Appendix C.1. Added another 6836 response template in Appendix C.2. Added two more responses in 6837 Appendix C.4. 6839 D.8. Changes from draft-ietf-ipsecme-ikev2bis-01 to 6840 draft-ietf-ipsecme-ikev2bis-02 6842 In section 1.3.1, added "Failure of an attempt to create a CHILD SA 6843 SHOULD NOT tear down the IKE SA: there is no reason to lose the work 6844 done to set up the IKE SA. When an IKE SA is not created, the error 6845 message return SHOULD NOT be encrypted because the other party will 6846 not be able to authenticate that message." This may be changed again 6847 in the future. [Issue #9] 6849 In section 1.3.2, changed "The KEi payload SHOULD be included" to be 6850 "The KEi payload MUST be included". This also led to changes in 6851 section 2.18. The square brackets around "g^ir (new)" in the 6852 SKEYSEED calculation are eliminated, and the requirement language in 6853 the paragraph starting "The main rekeying" is changed from SHOULD to 6854 MUST. [Issue #50] 6856 In section 1.3.2, changed "The window size starts at 1 for any new 6857 IKE SA." to "The first IKE requests from both sides on the new IKE SA 6858 will have message ID 0. The old IKE SA retains its numbering, so any 6859 further requests (for example, to delete the IKE SA) will have 6860 consecutive numbering. The new IKE SA also has its window size reset 6861 to 1, and the initiator in this rekey exchange is the new "original 6862 initiator" of the new IKE SA." [Issue #65] 6864 Added to section 1.5: For a one-way INVALID_IKE_SPI notification for 6865 an unrecognized SPI, the responder SHOULD copy the Exchange Type from 6866 the request. [Issue #46] 6868 In 2.1, at the end of the paragraph about retransmission timers, 6869 added "In order to allow saving memory, responders are allowed to 6870 forget response after a timeout of several minutes. If the responder 6871 receives a retransmitted request for which it has already forgotten 6872 the response, it MUST ignore the request (and not, for example, 6873 attempt constructing a new response)." [Issue #14] 6875 In 2.6, added: "Also, incorporating Ni in the hash prevents an 6876 attacker from fetching one one cookie from the other end, and then 6877 initiating many IKE_SA_INIT exchanges all with different initiator 6878 SPIs (and perhaps port numbers) so that the responder thinks that 6879 there are lots of machines behind one NAT box who are all trying to 6880 connect." [Issue #19] 6882 Added text for the new 2.8.2, and bumped the section number of the 6883 old 2.8.2 to 2.8.3. [Issue #22] 6885 Added a reference to the end of 2.12 on key reuse. 6887 Added to the end of the first paragraph in 2.19: Note, however, it is 6888 usual to only assign one IP address during the IKE_AUTH exchange. 6889 That address persists at least until the deletion of the IKE SA. 6890 [Issue #79] 6892 Added the following to 2.23: An initiator can float to port 4500, 6893 regardless whether or not there is NAT, even at the beginning of IKE. 6894 When either side is using port 4500, sending with UDP encapsulation 6895 is not required, but understanding received packets with UDP 6896 encapsulation is required. UDP encapsulation MUST NOT be done on 6897 port 500. If NAT-T is supported (that is, if NAT_DETECTION_*_IP 6898 payloads were exchanged during IKE_SA_INIT), all devices MUST be able 6899 to receive and process both UDP encapsulated and non-UDP encapsulated 6900 packets at any time. Either side can decide whether or not to use 6901 UDP encapsulation irrespective of the choice made by the other side. 6902 However, if a NAT is detected, both devices MUST send UDP 6903 encapsulated packets. [Issue #40] 6905 The second-to-last paragraph in section 3.4 is changed to: The DH 6906 Group # identifies the Diffie-Hellman group in which the Key Exchange 6907 Data was computed (see Section 3.3.2. This Group # MUST match a DH 6908 Group specified in a proposal in the SA payload that is sent in the 6909 same message, and SHOULD match the DH group in the first group in the 6910 first proposal, if such exists. If none of the proposals in that SA 6911 payload specifies a DH Group, the KE payload MUST NOT be present. If 6912 the selected proposal uses a different Diffie-Hellman group (other 6913 than NONE), the message MUST be rejected with a Notify payload of 6914 type INVALID_KE_PAYLOAD. [Issue #30] 6916 In 3.10.1, changed the definition of NO_PROPOSAL_CHOSEN, 14, to: None 6917 of the proposed crypto suites was acceptable. This can be sent in 6918 any case where the offered proposal (including but not limited to SA 6919 payload values, USE_TRANSPORT_MODE notify, IPCOMP_SUPPORTED notify) 6920 are not acceptable for the responder. This can also be used as 6921 "generic" Child SA error when Child SA cannot be created for some 6922 other reason. See also Section 2.7. [Issue #81] 6924 In the description of IVs in 3.14, reorganized the text a bit to 6925 emphasize when we are and are not talking about CBC. [Issue #68] 6927 Added the following to section 5 (Security Considerations): "The 6928 IKE_SA_INIT and IKE_AUTH exchanges happen before the initiator has 6929 been authenticated. As a result, an implementation of this protocol 6930 needs to be completely robust when deployed on any insecure network. 6931 Implementation vulnerabilities, particularly denial-of-service 6932 attacks, can be exploited by unauthenticated peers. This issue is 6933 particularly worrisome because of the unlimited number of messages in 6934 EAP-based authentication." [Issue #62] 6936 Added new Appendix D, "Significant Changes from RFC 4306", as a 6937 placeholder for now. [Issue #3] 6939 D.9. Changes from draft-ietf-ipsecme-ikev2bis-01 to 6940 draft-ietf-ipsecme-ikev2bis-02 6942 Near the end of 1.3, changed "If the guess turns out to be wrong, the 6943 responder will indicate the correct group in the response and the 6944 initiator SHOULD pick an element of that group for its KE value when 6945 retrying the first message." to "If the responder selects a proposal 6946 using a different Diffie-Hellman group (other than NONE), the 6947 responder will indicate the correct group in the response and the 6948 initiator SHOULD pick an element of that group for its KE value when 6949 retrying the first message." [Issue #6] 6951 In the figures in 1.3.2, changed the diagrams from "HDR, SK {SA, Ni, 6952 [KEi]}" to "HDR, SK {SA, Ni, KEi}", and "HDR, SK {SA, Nr,[KEr]}" to 6953 "HDR, SK {SA, Nr,KEr}". This matches the text in the section, which 6954 was updated in the last revision. [Issue #50] 6956 Reorganized the beginning of section 2.3 and clarified some of the 6957 logic. [Issue #52] 6959 Clarified the octets to be signed in setion 2.15. Changed 6961 AUTH = prf(prf(Shared Secret,"Key Pad for IKEv2"), ) 6963 to 6965 For the initiator: 6966 AUTH = prf( prf( Shared Secret,"Key Pad for IKEv2"), 6967 ) 6968 For the responder: 6969 AUTH = prf( prf( Shared Secret,"Key Pad for IKEv2"), 6970 ) 6972 [Issue #72] 6974 Changed the last bullet item in section 2.23 to discuss MOBIKE in 6975 more detail. [Issue #41] 6977 In section 3.1, the bullet about bit 4, changed "must" to "MUST". 6979 In section 3.3.6, added two sentences at the end of the second 6980 paragraph to indicate that there is an exception for when the 6981 proposal is a DH group of NONE. [Issue #6] 6983 D.10. Changes from draft-ietf-ipsecme-ikev2bis-02 to 6984 draft-ietf-ipsecme-ikev2bis-03 6986 In section 2.4, change "The INITIAL_CONTACT notification, if sent, 6987 MUST be in the first IKE_AUTH request, not as a separate exchange 6988 afterwards; however, receiving parties need to deal with it in other 6989 requests." to "The INITIAL_CONTACT notification, if sent, MUST be in 6990 the first IKE_AUTH request or response, not as a separate exchange 6991 afterwards; receiving parties MAY ignore it in other messages." 6992 [Issue #53] 6994 Added to the security considerations: "Admission control is critical 6995 to the security of the protocol. For example, trust anchors used for 6996 identifying IKE peers should probably be different than those used 6997 for other forms of trust, such as those used to identify public web 6998 servers. Moreover, although IKE provides a great deal of leeway in 6999 defining the security policy for a trusted peer's identity, 7000 credentials, and the correlation between them, having such security 7001 policy defined explicitly is essential to a secure implementation." 7002 [Issue #61] 7004 Changed "[V+]" to "[V+][N+]" throughout Appendix C. [Issue #63] 7006 D.11. Changes from draft-ietf-ipsecme-ikev2bis-03 to 7007 draft-ietf-ipsecme-ikev2bis-04 7009 Throughout, removed the marks that showed where text from the 7010 Clarifications RFC was inserted, or where a "SHOULD" was demoted to 7011 weaker language. 7013 In section 1, added "IKEv2 was a change to the IKE protocol that was 7014 not backward compatible. In contrast, the current document not only 7015 provides a clarification of IKEv2, but makes minimum changes to the 7016 IKE protocol." [Issue #48] 7018 In 1.5, added "The recipient of this notification cannot tell whether 7019 the SPI is for AH or ESP, but this is not important because the SPIs 7020 are supposed to be different for the two." [Issue #35] 7022 In 1.5, added "(INVALID_MAJOR_VERSION is also a one-way message which 7023 is sent outside of an IKE SA, although it is sent as a response to 7024 the incoming IKE SA creation.)" [Issue #13] 7026 In 1.7, added "This document removes the allowance for rejecting 7027 messages where the payloads were not in the "right" order; now 7028 implementations MUST NOT reject them. This is due to the lack of 7029 clarity where the orders for th payloads are described." 7031 Added "The Message ID is reset to zero in the new IKE SA after the 7032 IKE SA is rekeyed" in the first paragraph of 2.2. [Issue #15] 7034 In 2.5, changed "implementations MUST send the payloads defined in 7035 this specification in the order shown in the figures in Section 2; 7036 implementations are explicitly allowed to reject as invalid a message 7037 with those payloads in any other order" to "implementations SHOULD 7038 send the payloads defined in this specification in the order shown in 7039 the figures in Section 2; implementations MUST NOT reject as invalid 7040 a message with those payloads in any other order". [Issue #16] 7041 [Issue #45] 7043 In 2.9, added "Maintenance of a system's SPD is outside the scope of 7044 IKE (see [PFKEY] for an example programming interface, although it 7045 only applies to IKEv1), though some implementations might update 7046 their SPD in connection with the running of IKE (for an example 7047 scenario, see Section 1.1.3)." This was actually done in -03 but not 7048 noted in the change notes. [Issue #64] [Issue #54] 7050 In 2.18, added "using SPIi, SPIr, Ni, and Nr from the new exchange" 7051 to the last sentence. 7053 In the last paragraph of 2.25, added "The SA that the initiator 7054 attempted to rekey is indicated by the SPI field in the Notify 7055 Payload, which is copied from the SPI field in the REYEY_SA 7056 notification." 7058 Removed INTERNAL_IP6_NBNS from 3.15.1. [Issue #44] 7060 Changed "The requested address is valid until there are no IKE_SAs 7061 between the peers" to "The requested address is valid as long as this 7062 IKE SA (or its rekeyed successors) requesting the address is valid." 7063 [Issue #43] 7065 D.12. Changes from draft-ietf-ipsecme-ikev2bis-04 to 7066 draft-ietf-ipsecme-ikev2bis-05 7068 Added the following near the end of 1.2: "If the failure is related 7069 to creating the IKE SA (for example, AUTHENTICATION_FAILED), the IKE 7070 SA is not created. Note that although the IKE_AUTH messages are 7071 encrypted and integrity protected, if the peer receiving this 7072 notification has not yet authenticated the other end (or if the peer 7073 fails to authenticate the other end for some reason), the information 7074 needs to be treated with caution. More precisely, assuming that the 7075 MAC verifies correctly, the sender of the error indication is known 7076 to be the responder of the IKE_SA_INIT exchange, but the sender's 7077 identity cannot be assured." [Issue #9] 7079 Added "Section 2.21 also covers error messages in great detail" near 7080 the beginning of 1.4. 7082 Added "Section 2.21 has been greatly expanded to cover the different 7083 cases where error responses are needed and the appropriate responses 7084 to them" to the end of 1.7. 7086 In 1.5, changed "There are two cases when such a one-way 7087 notification" to "There are two cases when a one-way notification". 7088 Also changed "notification" to "message" throughout this paragraph. 7090 In 2.8, changed "Note that, when rekeying, the new Child SA MAY have 7091 different traffic selectors and algorithms than the old one." to 7092 "Note that, when rekeying, the new Child SA SHOULD NOT have different 7093 traffic selectors and algorithms than the old one.". [Issue #12] 7095 Section 2.21 was replaced and significantly expanded to cover many 7096 different error situations. [Issue #26] 7098 Added 2.23.1, which covers how to handle NAT traversal when transport 7099 mode is requested. [Issue #28] 7101 In 3.3.2, after the table for tranform type 4, added "Although ESP 7102 and AH do not directly include a Diffie-Hellman exchange, a Diffie- 7103 Hellman group MAY be negotiated for the Child SA. This allows the 7104 peers to employ Diffie-Hellman in the CREATE_CHILD_SA exchange, 7105 providing perfect forward secrecy for the generated Child SA keys." 7106 [Issue #57] 7108 In 3.5, added "The Peer Authorization Database (PAD) as described in 7109 RFC 4301 [IPSECARCH] describes the use of the ID payload in IKEv2 and 7110 provides a formal model for the binding of identity to policy in 7111 addition to providing services that deal more specifically with the 7112 details of policy enforcement. The PAD is intended to provide a link 7113 between the SPD and the IKE security association management. See 7114 Section 4.4.3 of RFC 4301 for more details." [Issue #58] 7116 Added to the definition of "X.509 Certificate" in 3.6: "Note that 7117 with this encoding, if a chain of certificates needs to be sent, 7118 multiple CERT payloads are used, only the first of which holds the 7119 public key used to validate the sender's AUTH payload." [Issue 7120 #107]. 7122 In 3.14, added "When an authenticated encryption algorithm is used to 7123 protect the IKE SA, the construction of the encrypted payload is 7124 different that what is described here. See [RFC5282] for more 7125 information on authenticated encryption algorithms and their use in 7126 ESP." 7128 Added the last two paragraphs of 3.15 (on CFG_REQUEST and CFG_REPLY, 7129 and CFG_SET and CFG_ACK). Removed all of 2.19.1 which contained the 7130 same material and a lot of material that was duplicated from other 7131 parts of the document. [Issue #108] 7133 Added the following to 3.15.3: "Note that there is an additional 7134 document that discusses IPv6 configuration in IKEv2, [IPV6CONFIG]. 7135 At the present time, it is an experimental document, but there is a 7136 hope that with more implementation experience, it will gain the same 7137 standards treatment as this document." [Issue #47 and Issue #60] 7139 Reworded the acknowledgements to be more inclusive. 7141 D.13. Changes from draft-ietf-ipsecme-ikev2bis-05 to 7142 draft-ietf-ipsecme-ikev2bis-06 7144 Many small editorial nits fixed. 7146 Changed all the tables to only list the values that were defined in 7147 RFC 4306. Removed reserved and private use ranges. Also, a pointer 7148 to the IANA registry is given repeatedly. 7150 At the end of 1.3.1, added "See Section 2.21 for a list of error 7151 messages that might occur if creating a Child SA fails." 7153 In 1.3.2, made the response "HDR, SK {SA, Nr, KEr}", as it was 7154 supposed to be from earlier changes. [Issue #50] 7156 In 1.3.2, added "Once a peer receives a request to rekey an IKE SA or 7157 sends a request to rekey an IKE SA, it SHOULD NOT start any new 7158 CREATE_CHILD_SA exchanges on the IKE SA that is being rekeyed." 7159 [Issue #22] 7161 In 1.3.2, removed "[[ Note: this text may be changed in the future. 7162 ]]" 7164 Added "All of Section 2.25 was added to explain how to act when there 7165 are timing collisions when deleting and/or rekeying SAs." to 1.7. 7166 [Issue #22] 7168 In 2.8, split the third paragraph into two paragraphs to make the 7169 different types of rekeying clearer. Also, changed "The old IKE SA 7170 is then deleted" to "After the new equivalent IKE SA is created, the 7171 initiator deletes the old IKE SA". 7173 In 2.8, changed "The initiator MAY begin sending on an SA as soon as 7174 it processes the response" to "The initiator SHOULD begin sending on 7175 an SA as soon as it processes the response". 7177 Completely revised and expanded the second paragraph of 2.8.2 ("The 7178 case where both..."). [Issue #22] 7180 Changed the first parenthetical statement at the beginning of 2.15 to 7181 read "or MAC using a padded shared secret as the key, as described 7182 later in this section". Also, changed the formatting of the MAC 7183 calculation at the end of the section very slightly. 7185 Also in 2.15, in the description of the signed octets, fixed two 7186 lines. 7188 . . . 7189 InitiatorIDPayload = PayloadHeader | RestOfIDPayload 7190 RestOfInitIDPayload = IDType | RESERVED | InitIDData 7191 . . . 7193 becomes 7195 . . . 7196 InitiatorIDPayload = PayloadHeader | RestOfInitIDPayload 7197 RestOfInitIDPayload = IDType | RESERVED | InitIDData 7198 . . . 7200 ...and the same change for the responder. 7202 In 2.23, removed the second-to-last bullet because it was 7203 accidentally left there when the last bullet was copied and expanded 7204 from it. 7206 Added 2.25 and its subsections. [Issue #22] 7208 Added to the end of 3.6: "Implementations MUST support the HTTP 7209 method for hash-and-URL lookup. The behavior of other URL methods is 7210 not currently specified, and such methods SHOULD NOT be used in the 7211 absence of a document specifying them." [Issue #117] 7213 In 3.7, removed "10" from the list of acceptable types for the 7214 "Certification Authority" field. [Issue #120] 7216 In 3.8, definition of RSA Digital Signature, added: "Implementations 7217 can use the certificates received from a given peer as a hint for 7218 selecting a mutually-understood hash function for the AUTH payload 7219 signature. Note, however, that the hash algorithm used in the AUTH 7220 payload signature doesn't have to be the same as any hash 7221 algorithm(s) used in the certificate(s)." [Isse #116] 7223 In 3.10.1, added 7225 TEMPORARY_FAILURE 7226 See section 2.25. 7228 CHILD_SA_NOT_FOUND 7229 See section 2.25. 7231 Also added these to the IANA considerations in section 6. [Issue 7232 #22] 7234 In 3.15, changed "Requestors MUST ignore returned attributes that 7235 they do not recognize" to "Unrecognized or unsupported attributes 7236 MUST be ignored in both requests and responses". This brings back 7237 some text that was removed a few iterations ago. 7239 In 4, changed "If an implementation does support issuing such 7240 requests" to "If an implementation does support issuing such requests 7241 and its policy requires using temporary IP addresses". 7243 In 8 (Refereneces), changed the reference for AEAD from RFC 5116 to 7244 RFC 5282. Also added IKEV2IANA as a normative reference. Also 7245 changed the FTP URLs to the RFC Editor to HTTP references. 7247 D.14. Changes from draft-ietf-ipsecme-ikev2bis-06 to 7248 draft-ietf-ipsecme-ikev2bis-07 7250 These changes were made during and after WG Last Call. 7252 Many small editorial nits fixed. 7254 In 1.2, added "(A man-in-the-middle who cannot complete the IKE_AUTH 7255 exchange can nonetheless see the identity of the initiator.)" 7257 In the table in 1.2, added " (not a payload)" to "IKE Header" because 7258 the other items are, in fact, payloads. Also changed "E Encrypted" 7259 to "SK Encrypted and Authenticated". 7261 Removed "When an IKE SA is not created, the error message return 7262 SHOULD NOT be encrypted because the other party will not be able to 7263 authenticate that message." from the end of 1.3.1. [Issue #127] 7265 In 1.3.1, added "An IPCOMP_SUPPORTED notification, covered in 7266 Section 2.22, can also be included in the exchange." 7268 In 1.3.2, changed "New initiator and responder SPIs are supplied in 7269 the SPI fields of the SA payload." to "A new initiator SPI is 7270 supplied in the SPI field of the SA payload." Also added "A new 7271 responder SPI is supplied in the SPI field of the SA payload." a few 7272 paragraphs down. 7274 In 1.3.3, changed the figure for the initiator from: 7276 Initiator Responder 7277 ------------------------------------------------------------------- 7278 HDR, SK {N, SA, Ni, [KEi], 7279 TSi, TSr} --> 7281 to: 7283 Initiator Responder 7284 ------------------------------------------------------------------- 7285 HDR, SK {N(REKEY_SA), SA, Ni, [KEi], 7286 TSi, TSr} --> 7288 Added to 1.4: "Note that some informational messages, not exchanges, 7289 can be sent outside the context of an IKE SA." 7291 In 1.5, changed "it MAY send an informational message" to "it MAY 7292 indicate this with a Notify payload". Made a similar change in the 7293 following paragraph. 7295 In 1.5, changed "If the receiving node has an active IKE SA to the IP 7296 address from whence the packet came, it MAY send a notification of 7297 the wayward packet over that IKE SA in an INFORMATIONAL exchange. If 7298 it does not have such an IKE SA, it MAY indicate this with a Notify 7299 payload without cryptographic protection to the source IP address." 7300 to "If the receiving node does not have an active IKE SA to the IP 7301 address from whence the packet came, it MAY send a notification of 7302 the wayward packet with a Notify payload without cryptographic 7303 protection to the source IP address." 7305 Fixed the boilerplate wording in 1.6. 7307 Added and clarified materila in 1.7. Also added "Significant" to the 7308 title of the section because it cannot list all the differences. 7309 [Issue #126] 7311 In 2.1, changed "IKE is a reliable protocol, in the sense that the 7312 initiator MUST retransmit a request until either it receives a 7313 corresponding reply OR it deems the IKE security association to have 7314 failed and it discards all state associated with the IKE SA and any 7315 Child SAs negotiated using that IKE SA." to "IKE is a reliable 7316 protocol: the initiator MUST retransmit a request until either it 7317 receives a corresponding reply, or until it deems the IKE SA to have 7318 failed. In the latter case, the initiator discards all state 7319 associated with the IKE SA and any Child SAs that were negotiated 7320 using that IKE SA." 7322 In 2.1, removed ", and the zero non-ESP marker" because it was 7323 confusing. 7325 In 2.2, rearranged the paragraphs beginning "The Message ID is a 32- 7326 bit.." and "Throughout this document, "initiator"...". 7328 In 2.5, changed "implementations SHOULD send the payloads defined in 7329 this specification in the order shown in the figures in Section 2" to 7330 "...the figures in Sections 1 and 2". 7332 In 2.6, changed "Also, incorporating Ni" to "Also, incorporating 7333 SPi". 7335 In 2.6, removed the paragraph that started "In addition to cookies" 7336 because it was redundant with information in 2.7 that was stated 7337 better. 7339 In 2.8, changed "It should do so if there has been no traffic since 7340 the last time the SA was rekeyed." to "It can also do so if ..." 7342 In 2.8.1, changed NO_PROPOSAL_CHOSEN to CHILD_SA_NOT_FOUND in the 7343 paragraph that starts "To B, it looks like A is trying to rekey" and 7344 the artwork after it. 7346 In 2.8.2, changed "In this case, when the peer that did not notice 7347 the simultaneous rekey gets the request to rekey the IKE SA that it 7348 has already successfully rekeyed, it MUST return 7349 TEMPORARY_FAILURE..." to "...it SHOULD return TEMPORARY_FAILURE...". 7350 [Issue #131] 7352 In 2.9, changed "To enable the responder to choose the appropriate 7353 range in this case, if the initiator has requested the SA due to a 7354 data packet, the initiator SHOULD include as the first traffic 7355 selector in each of TSi and TSr a very specific traffic selector 7356 including the addresses in the packet triggering the request" to "If 7357 the initiator requests an SA because it wants to sen a data packet, 7358 including the specific addresses in the packet triggering the request 7359 in the first traffic selector in both TSi and TSr enables the 7360 responder to choose the appropriate range". 7362 In 2.9, removed "Such misconfigurations should be recorded in error 7363 logs." [Issue #125] 7365 In 2.9, changed the end of the paragraph that starts "It is possible 7366 for the responder's policy..." to actually match the scenario, which 7367 is not a triggering packet. 7369 In 2.9, changed the "192.0.1" example network to "198.51.100" and 7370 removed the parenthetical comment about the old ones. Did the same 7371 change in 3.15.2 and 5.1. 7373 Rewrote parts of 2.13 to make it clearer when general functions and 7374 specific functions were being discussed. Also cleaned up 7375 inconsistent use of "prf" and "PRF" throughout the document. 7377 In 2.18, added "to generate SKEYSEED" to the end of "The old and new 7378 IKE SA...", and added "and using the new IKE SA's PRF" to the end of 7379 the last paragraph. [Issue #121] 7381 At the end of 2.19, removed some redundancy and split the final 7382 paragraph into two. 7384 In 2.21.2, removed "NOTE FOR WG DISCUSSION: Having other payloads in 7385 the message is allowed but there are none suggested. One WG member 7386 mentioned the possibility of adding a DELETE payload when the error 7387 is sent in a separate INFORMATIONAL exchange. Do we want to allow 7388 such additional payloads that have operational semantics?" 7390 In 2.23, changed "float to" to "use". 7392 In 2.23, changed "In the case of a mismatching 7393 NAT_DETECTION_SOURCE_IP hash, the recipient MAY reject the connection 7394 attempt if NAT traversal is not supported." to "In the case there is 7395 a mismatch of the NAT_DETECTION_SOURCE_IP hash with all of the 7396 NAT_DETECTION_SOURCE_IP payloads received, the recipient MAY reject 7397 the connection attempt if NAT traversal is not supported." Also 7398 removed the bullet that started "If the NAT_DETECTION_DESTINATION_IP 7399 payload received does not match the hash of the destination IP" 7400 because it was already covered above. 7402 In 2.23, removed "so this method MUST NOT be used when MOBIKE is 7403 used" but left in the reference to section 3.8 in MOBIKE so that 7404 readers can see what is and is not allowed. 7406 In 2.23.1, in the first bullet for the responder in transport mode, 7407 changed "Store the original traffic selector IP addresses as received 7408 source and destination address in case we need to undo address 7409 substitution." to "Store the original traffic selector IP addresses 7410 as received source and destination address, both in case we need to 7411 undo address substitution, and to use as the "real source and 7412 destination address" specified by [UDPENCAPS], and for TCP/UDP 7413 checksum fixup." 7415 In 2.25, changed: "A peer that receives a CHILD_SA_NOT_FOUND 7416 notification SHOULD silently delete the Child SA and send a request 7417 to create a new Child SA from scratch." to "A peer that receives a 7418 CHILD_SA_NOT_FOUND notification SHOULD silently delete the Child SA 7419 (if it still exists) and send a request to create a new Child SA from 7420 scratch (if the Child SA does not yet exist)." 7422 In the flags description in 3.1, replaced "The bits are defined LSB 7423 first, so bit 0 would be the least significant bit of the Flags 7424 octet. " with "The bits are as follows: 7426 +-+-+-+-+-+-+-+-+ 7427 |X|X|R|V|I|X|X|X| 7428 +-+-+-+-+-+-+-+-+ 7430 Also added: ""X" bits MUST be cleared when sending and MUST be 7431 ignored on receipt." Then removed the bit positions from the 7432 description. 7434 In 3.1, added "See Section 2.5 for more information on this bit" to 7435 the end of the Critical bit description. 7437 In 3.2, changed "E Encrypted" to "SK Encrypted and Authenticated". 7439 In 3.3, fourth paragraph, changed "Combined-mode ciphers include both 7440 integrity and encryption in a single encryption algorithm, and are 7441 not allowed to be offered with a separate integrity algorithm other 7442 than "none"." to "Combined-mode ciphers include both integrity and 7443 encryption in a single encryption algorithm, and MUST either offer no 7444 integrity algorithm or a single integrity algorithm of "none", with 7445 no integrity algorithm being the RECOMMENDED method." Also, removed 7446 "If an algorithm that combines encryption and integrity protection is 7447 proposed, it MUST be proposed as an encryption algorithm and an 7448 integrity protection algorithm MUST NOT be proposed" from the 7449 following paragraph. [Issue #122] 7451 In 3.3.6, moved the last sentence from the second paragraph and moved 7452 it to third paragraph. It now reads "If one of the proposals offered 7453 is for the Diffie-Hellman group of NONE, the responder MUST ignore 7454 the initiator's KE payload and omit the KE payload from the 7455 response." 7457 In 3.4, added "See also Section 1.2 and Section 2.7." 7459 In 3.6, changed "Certificate payloads SHOULD be included in an 7460 exchange if certificates are available to the sender unless the peer 7461 has indicated an ability to retrieve this information from elsewhere 7462 using an HTTP_CERT_LOOKUP_SUPPORTED Notify payload." to "Certificate 7463 payloads SHOULD be included in an exchange if certificates are 7464 available to the sender. The Hash and URL formats of the Certificate 7465 payloads should be used in case the peer has indicated an ability to 7466 retrieve this information from elsewhere using an 7467 HTTP_CERT_LOOKUP_SUPPORTED Notify payload." 7469 In 3.10.1, added "More information on error handling can be found in 7470 Section 2.21." 7472 Added TEMPORARY_FAILURE and CHILD_SA_NOT_FOUND to the table in 7473 3.10.1. 7475 Replaced the Start Port and End Port discussions in 3.13.1 with ones 7476 that describe the ICMP and ICMPv6 in more detail. Also replaced the 7477 two paragraphs starting "The traffic selector types 7..." and 7478 "Traffic selectors can use" with "he traffic selector types 7 and 8 7479 can also refer to ICMP or ICMPv6 type and code fields, as well as MH 7480 Type fields for the IPv6 mobility header [MIPV6]. Note, however, 7481 that neither ICMP nor MIPv6 packets have separate source and 7482 destination fields. The method for specifying the traffic selectors 7483 for ICMP and MIPv6 is shown by example in Section 4.4.1.3 of 7484 [IPSECARCH]". [Issue #129] 7486 In 3.15.1, made the table heading "Multi-Valued" instead of "Valued". 7488 In 3.15.1, added "(except INTERNAL_ADDRESS_EXPIRY and 7489 INTERNAL_IP6_NBNS which were removed by this document)" to the bullet 7490 point for "Value" because those two were removed from the table. 7492 Added new paragraph at the end of 3.15.4 to suggest what the 7493 initiator should do if they don't get enough addresses. [Issue #124] 7495 In 5, changed "An implementation using EAP MUST also use strong 7496 authentication" back to "An implementation using EAP MUST also use a 7497 public-key-based authentication" soas not to change mandatory 7498 requirements from RFC 4306. 7500 Added to section 6: "Two items are removed from the IKEv2 7501 Configuration Payload Attribute Types table: INTERNAL_IP6_NBNS and 7502 INTERNAL_ADDRESS_EXPIRY." 7504 Removed Appendix C, "Significant Changes from RFC 4306", because this 7505 information is actually going in section 1.7. 7507 In C.5, changed the figure from: 7509 request --> SA, Ni, [KEi] 7510 [V+][N+] 7512 response <-- SA, Nr, [KEr] 7513 [V+][N+] 7515 to 7517 request --> SA, Ni, KEi 7518 [V+][N+] 7520 response <-- SA, Nr, KEr 7521 [V+][N+] 7523 D.15. Changes from draft-ietf-ipsecme-ikev2bis-07 to 7524 draft-ietf-ipsecme-ikev2bis-08 7526 Lots more small editorial issues fixed. 7528 These changes were made after WG Last Call, mostly to close out open 7529 issues. 7531 In 1.2, changed "The recipients of messages 3 and 4 MUST verify that 7532 all signatures and MACs are computed correctly and that the names in 7533 the ID payloads correspond to the keys used to generate the AUTH 7534 payload." to "The recipients of messages 3 and 4 MUST verify that all 7535 signatures and MACs are computed correctly. If either side uses a 7536 shared secret for authentication, the names in the ID payload MUST 7537 correspond to the key used to generate the AUTH payload." 7539 In 1.3, added "This notify can also be used to reject IKE SA rekey" 7540 to the discussion of sending the NO_ADDITIONAL_SAS notification. 7541 [Issue #132] 7543 In 1.3.2, added a pointer to 2.18; vice versa. 7545 Added to 1.3.3: "The notifications described in Section 1.3.1 may 7546 also be sent in a rekeying exchange. Usually these will be the same 7547 notifications that were used in the original exchange; for example, 7548 when rekeying a transport mode SA, the USE_TRANSPORT_MODE 7549 notification will be used." [Issue #133] 7551 In 1.4.1, replaced the last paragraph ("Half-closed ESP or AH 7552 connections...") with two paragraphs that clarify deleting IKE SAs as 7553 compared to half-closed ESP or AH connections. 7555 In 1.5, changed "If the receiving node does not have an active IKE SA 7556 to the IP address from whence the packet came, it" to "The receiving 7557 node". 7559 In 1.5, replaced the last three paragraphs ("There are two cases...", 7560 "In case of INVALID_IKE_SPI...", and "In case of INVALID_SPI...") 7561 with a more detailed description. [Issue #143] 7563 In 1.7, added "Section 2.23 clarified that, in NAT traversal, now 7564 both UDP encapsulated IPsec packets and non-UDP encapsulated IPsec 7565 packets packets need to be understood when receiving." 7567 Added a new paragraph at the end of 2.1 ("The retransmission policy 7568 for one-way messages is somewhat different..."). [Issue #147] 7570 Replaced the first paragraph in 2.6 with a shorter one, and moved the 7571 historical material to the end of the section. [Issue #148] 7573 In 2.6.1, removed "SAi1 and" from "For instance, if the responder 7574 includes the SAi1 and KEi payloads in cookie calculation..." [Issue 7575 #134] 7577 In 2.7, moved the paragraph that begins "Because the initiator sends 7578 its Diffie-Hellman value in the IKE_SA_INIT" to 1.2. [Issue #144] 7580 In 2.8, replaced "MAY send a dummy message on a newly created SA" 7581 with "MAY send a dummy ESP message on a newly created ESP SA". 7582 [Issue #154] 7584 In 2.8, changed "...it has received a cryptographically valid message 7585 on the new SA..." to "...it has received a cryptographically valid 7586 message on the other half of the SA pair...". [Issue #149] 7588 In 2.8.2, changed "The new IKE SA containing the lowest nonce 7589 inherits the Child SAs" to "The new IKE SA containing the lowest 7590 nonce SHOULD be deleted by the node that created it, and the other 7591 suriving new IKE SA MUST inherit all the Child SAs". [Issue #135] 7593 In 2.8.2, added "In addition to normal simultaneous rekeying cases, 7594 there is a special case where one peer finishes its rekey before it 7595 even notices that other peer is doing a rekey." [Issue #171] 7597 In 2.8.2, added "Support of the TEMPORARY_FAILURE notification is not 7598 negotiated, so older peers may receive these notifications. In that 7599 case, they will treat it the same as any other unknown error 7600 notification, and will stop the exchange. Because the other peer has 7601 already rekeyed the exchange, doing so does not have any ill 7602 effects." [Issue #150] 7604 In 2.9, reverted to using a SHOULD for trigger packets. Replaced "If 7605 the initiator requests an SA because it wants to send a data packet, 7606 including the specific addresses in the packet triggering the request 7607 in the first traffic selector in both TSi and TSr enables the 7608 responder to choose the appropriate range" with "To enable the 7609 responder to choose the appropriate range in this case, if the 7610 initiator has requested the SA due to a data packet, the initiator 7611 SHOULD include as the first traffic selector in each of TSi and TSr a 7612 very specific traffic selector including the addresses in the packet 7613 triggering the request." [Issue #155] 7615 In 2.14, changed "only the first 64 bits of Ni and the first 64 bits 7616 of Nr are used in the calculation" to "only the first 64 bits of Ni 7617 and the first 64 bits of Nr are used in calculating SKEYSEED, but all 7618 the bits are used for input to the prf+ function". [Issue #138] 7620 Added to the end of 2.15: "There are two types of EAP authentication 7621 (described in Section 2.16), and each type uses different values in 7622 the AUTH computations shown above. If the EAP method is key- 7623 generating, substitute MSK for the Shared Secret in the computation. 7624 For non-key-generating methods, substitute SK_pi and SK_pr, 7625 respectively, for the Shared Secret in the two AUTH computations." 7626 [Issue #151] 7628 In 2.16, changed "the authenticated identity has to be sent" to "the 7629 authenticated identity, if different from that in the IDi payload, 7630 has to be sent". [Issue #174] 7632 In 2.17, significantly changed the discussion of the order in which 7633 keying material is taken from KEYMAT. The result is the same, but 7634 the description is quite different, and now also refers to ROHC. 7635 [Issue #139] 7637 In 2.21, changed "Only authentication failures 7638 (AUTHENTICATION_FAILED)..." to "Only authentication failures 7639 (AUTHENTICATION_FAILED and EAP failure)...". Also added "If the 7640 exchange is terminated with EAP Failure, an AUTHENTICATION_FAILED 7641 notification is not sent." [Issue #152 and #160] 7643 In 2.21.2, removed INVALID_SELECTORS from the list of things that are 7644 returned from the piggybacked exchanges. [Issue #166] 7646 In 2.23, changed "In the case of NAT traversal, the Traffic Selectors 7647 MUST contain exactly one IP address, which is then used as the 7648 original IP address" to "In the case of transport mode NAT traversal, 7649 the traffic selectors MUST contain exactly one IP address, which is 7650 then used as the original IP address". [Issue #136] 7652 In 2.23, completely replaced the paragraph that begins "An initiator 7653 can use port 4500". [Issue #146] 7655 In 2.23, changed "In addition, firewalls may be configured to pass 7656 IPsec traffic over UDP but not ESP/AH or vice versa." to "In 7657 addition, firewalls may be configured to pass UDP-encapsulated IPsec 7658 traffic but not plain, unencapsulated ESP/AH or vice versa". 7660 In 2.23, changed "SPIs, source IP address, and port" to "SPIs, source 7661 or recipient IP address respectively, and port". [Issue #162]. 7663 In 2.23, completely replaced the last paragraph ("There are cases 7664 where a NAT box..."). [Issue #175] 7666 In 2.23.1, changed "When the client starts creating the IKEv2 SA and 7667 Child SA for sending traffic to the server, it has a triggering 7668 packet with source IP address of IP1, and a destination IP address of 7669 IPN2" to "...it may have a triggering packet...". Changed "The first 7670 traffic selector of TSi and TSr SHOULD have very specific traffic 7671 selectors including protocol and port numbers from the packet 7672 triggering the request" to "...SHOULD have very specific traffic 7673 selectors including protocol and port numbers, such as from the 7674 packet...". The same change is made in the third bullet of the 7675 client list near the end of the section. [Issue #173] 7677 At the beginning of the second paragraph of 3.1, changed "The 7678 Recipient SPI" to the "The responder's SPI". 7680 In 3.1, changed "Payloads are processed in the order in which they 7681 appear in an IKE message by invoking the appropriate processing 7682 routine according to the "Next Payload" field in the IKE header and 7683 subsequently according to the "Next Payload" field in the IKE payload 7684 itself until a "Next Payload" field of zero indicates that no 7685 payloads follow" to "Payloads are identified in the order in which 7686 they appear in an IKE message by looking in the "Next Payload" field 7687 in the IKE header, and subsequently according to the "Next Payload" 7688 field in the IKE payload itself until a "Next Payload" field of zero 7689 indicates that no payloads follow". [Issue #159] 7691 In 3.1, added "including multiple sessions per peer" to the end of 7692 the second paragraph. 7694 In 3.2, changed "In the header of an Encrypted payload, the Next 7695 Payload field is set to the payload type of the first contained 7696 payload (instead of 0)" to "In the header of an Encrypted payload, 7697 the Next Payload field is set to the payload type of the first 7698 contained payload (instead of 0); conversely, the Next Payload field 7699 of the last contained payload is set to zero." [Issue #164] 7701 In 3.3, changed the example of the two proposals and added a worked- 7702 out figure for them. [Issue #157] 7704 In 3.3.2, changed PRF_HMAC_TIGER to UNSPECIFIED. 7706 In 3.3.5, added "unless that length exceeds two bytes" to the end of 7707 "Attributes described as fixed length MUST NOT be encoded using the 7708 variable-length encoding". [Issue #167] 7710 In 3.3.6, changed "The initiator of an exchange MUST check that the 7711 accepted offer is consistent with one of its proposals, and if not 7712 that response MUST be rejected" to "The initiator of an exchange MUST 7713 check that the accepted offer is consistent with one of its 7714 proposals, and if not MUST terminate the exchange". 7716 In 3.3.6, changed "Similarly, if the responder receives a transform 7717 that contains a Transform Attribute it does not understand..." to 7718 "Similarly, if the responder receives a transform that it does not 7719 understand, or one that contains a Transform Attribute it does not 7720 understand...". 7722 In 3.4, changed "The length of the Diffie-Hellman public value MUST 7723 be equal to the length of the prime modulus over which the 7724 exponentiation was performed, prepending zero bits to the value if 7725 necessary" to "The length of the the Diffie-Hellman public value for 7726 MODP groups..." (because it is not true for elliptic curve groups). 7728 In 3.5, changed "IPv6-only implementations MAY be configurable to 7729 send only ID_IPV6_ADDR" to "IPv6-only implementations MAY be 7730 configurable to send ID_IPV6_ADDR instead of ID_IPV6_ADDR for IP 7731 addresses." 7733 In 3.6, replaced "Use the following ASN.1 definition for an X.509 7734 bundle" by "The "Hash and URL of a bundle" type uses the following 7735 ASN.1 definition for the X.509 bundle". 7737 In 3.7, removed "If multiple CAs are trusted and the certificate 7738 encoding does not allow a list, then multiple Certificate Request 7739 payloads would need to be transmitted". 7741 In 3.14, added "This payload is also called the "Encrypted and 7742 Authenticated" payload." 7744 In 3.16, removed the table of EAP types and replaced it with "Note 7745 that since IKE passes an indication of initiator identity in message 7746 3 of the protocol, the responder SHOULD NOT send EAP Identity 7747 requests (type 1). The initiator MAY, however, respond to such 7748 requests if it receives them." [Issue #153] 7750 In 3.16, removed "In other messages, this field MAY be set to any 7751 value" from the bullet defining Identifier. [Issue #168] 7753 In 4, changed "Ability to support various types of legacy 7754 authentication" to "Ability to support EAP-based authentication". 7756 In section 4, removed two sentences ("A minimal IPv4 responder 7757 implementation..." and "A minimal IPv4 initiator...") because they 7758 were redundant with the preceding text but also used new terms that 7759 were not defined. [Issue #172] 7761 In 5, removed "or overrun of either endpoint". [Issue #169] 7763 In 6, added that IANA should change "46 Encrypted E" to "46 Encrypted 7764 SK". 7766 In 8.2, updated the pointer for IPV6CONFIG to RFC 5739. 7768 D.16. Changes from draft-ietf-ipsecme-ikev2bis-08 to 7769 draft-ietf-ipsecme-ikev2bis-09 7771 These changes came during IETF Last Call. 7773 Fixed more minor editorial nits. 7775 Throughout, changed "#" in the name of variables to "Num" or "Number" 7776 because "#" is US-centric and confusing. 7778 Throughout, changed "denial of service" to "DoS" after the first 7779 definition to be consistent. 7781 In many places, changed "message 3" to "the first message in the 7782 IKE_AUTH exchange". 7784 In 1, changed 'The pair is called an "exchange"' to 'The pair is 7785 called an "exchange", and is sometimes called "request/response"'. 7786 Then changed most of the rest of "request/response" to "exchange" 7787 throughout the document. 7789 In 1, changed "We call the first messages establishing an IKE SA 7790 IKE_SA_INIT and IKE_AUTH exchanges and subsequent IKE exchanges 7791 CREATE_CHILD_SA or INFORMATIONAL exchanges" to "The first exchange of 7792 messages establishing an IKE SA are called the IKE_SA_INIT and 7793 IKE_AUTH exchanges; subsequent IKE exchanges are called the 7794 CREATE_CHILD_SA or INFORMATIONAL exchanges". 7796 In 1.2, added "see Section 2.13 and Section 2.14 for details on the 7797 key derivation". 7799 In 1.2, copied text from 2.2 to describe what a Message ID is before 7800 we start talking about it. 7802 In 1.2, added "The traffic selectors (TSi and TSr) are discussed in 7803 Section 2.9" because it was ignored in the section. 7805 In 1.2, changed "The recipients of messages 3 and 4 MUST verify..." 7806 to "Both parties in the IKE_SA_INIT exchange MUST verify...". 7808 In 1.2, changed "The list of responses..." to "Notify message 7809 types...". 7811 In 1.2, changed "If the failure is related to creating the IKE SA 7812 (for example, AUTHENTICATION_FAILED)" to "If the failure is related 7813 to creating the IKE SA (for example, an AUTHENTICATION_FAILED Notify 7814 error message is returned)". 7816 In 1.2, changed "the sender of the error indication" to "the sender 7817 of the error Notify message". 7819 In 1.3, removed the paragraph starting "All messages following..." 7820 because it is a duplicate from 1.2. 7822 In 1.3, changed "this notify" to "this notification". 7824 In 1.3, removed "The CREATE_CHILD_SA is also used for rekeying IKE 7825 SAs and Child SAs" because it is redundant with the first sentence of 7826 the section. 7828 In 1.3.1, changed "Failure of an attempt" to "A failed attempt". 7830 In 1.5, added "these flags are described in Section 3.1" because they 7831 had not beed defined yet. 7833 In 2.2, added "Retransmission of a message MUST use the same Message 7834 ID as the original message." 7836 At the end of 2.3, changed "is optional" to "is OPTIONAL". 7838 In 2.4, changed "Every implementation MUST be capable of responding 7839 to an INFORMATIONAL exchange, but a minimal implementation MAY 7840 respond to any INFORMATIONAL message with an empty INFORMATIONAL 7841 response" to "Every implementation MUST be capable of responding to 7842 an INFORMATIONAL exchange, but a minimal implementation MAY respond 7843 to any request in the INFORMATIONAL exchange with an empty response". 7845 In 2.4, changed "An implementation MUST NOT continue sending on any 7846 SA if some failure prevents it from receiving on all of the 7847 associated SAs" to "An implementation needs to stop sending on any 7848 SA..." because there is no way for the implementation to know if 7849 "some failure" has occured. 7851 In 2.4, changed "If Child SAs can fail independently from one another 7852 without the associated IKE SA being able to send a delete message, 7853 then they MUST be negotiated by separate IKE SAs" to "If a system 7854 creates Child SAs that can fail independently from one another 7855 without the associated IKE SA being able to send a delete message, 7856 then the system MUST negotiate such Child SAs using separate IKE 7857 SAs". [Issue #181] 7859 In 2.6, changed "will cause two packets:" to "will cause two packets 7860 to be sent:". 7862 In 2.6, added "possibly using exponential back-off" to the discussion 7863 of limiting the number of cookies it sends. 7865 Moved the paragraph that starts "When the IKE_SA_INIT exchange does 7866 not result" from 2.7 to 2.6. Also changed"the responder's SPI will 7867 be zero" to "the responder's SPI will be zero also in the response 7868 message". 7870 In 2.8.1, removed "lexicographical" because it was undefined and 7871 unnecessary. 7873 In 2.8.2, last paragraph: Change the beginning of the sentence and 7874 changed "older peers may receive these notifications" to "older peers 7875 that implement RFC 4306 but not this document may receive these 7876 notifications". 7878 Fixed the first two paragraphs of 2.9 to talk about PFKEY in the 7879 correct context. 7881 In 2.9, changed "reject the request with a status of 7882 SINGLE_PAIR_REQUIRED" with "reject the request with a 7883 SINGLE_PAIR_REQUIRED Notify message". 7885 In 2.13, changed "The preferred key size is used as the length of 7886 SK_d, SK_pi, and SK_pr" to "The preferred key size MUST be used as 7887 the length of SK_d, SK_pi, and SK_pr". 7889 In 2.14, changed "The lengths of SK_d, SK_pi, and SK_pr are the 7890 preferred key length of the agreed-to PRF" to "The lengths of SK_d, 7891 SK_pi, and SK_pr MUST be the preferred key length of the agreed-to 7892 PRF". 7894 In 2.15, moved "In the above calculation, IDi' and IDr' are the 7895 entire ID payloads excluding the fixed header" earlier and removed 7896 redundant definitions. 7898 In 2.16, added "(Note that the AUTH payload is required for non-EAP 7899 authentication, and is thus not marked as optional in the rest of 7900 this document.)" 7902 In 2.17, added a reference to [ROHCV2]. 7904 In 2.20, removed "to prevent trolling" because it is not a widely- 7905 known term. 7907 In 2.21.2, added "using the Vendor ID payload" to the last sentence. 7909 In 2.23, clarified the paragraph that starts "An initiator can 7910 use..." in many places, saying that it is UDP encapsulated ESP. 7912 In the bulleted list in 2.23 that lists what implementations that 7913 support NAT traversal must do, removed "IKE MUST listen on port 4500 7914 as well as port 500. IKE MUST respond to the IP address and port 7915 from which packets arrived". That requirement applies to all IKE 7916 implementations. 7918 In 2.23, changed "these payloads" to "the NAT_DETECTION_SOURCE_IP or 7919 NAT_DETECTION_DESTINATION_IP payloads". 7921 Throughout subsections of 3, added ", unsigned integer" in 7922 definitions of multi-octet items such as Message ID and Payload 7923 Length. 7925 In 3.1, added "(with one exception; see Section 2.21.2)" to the 7926 discussion of the Response flag. 7928 In 3.3.1, changed "the SPI is obtained from outer header" to "the SPI 7929 is obtained from outer IP header". 7931 In 3.3.6, changed "If one of the proposals offered is for the Diffie- 7932 Hellman group of NONE, the responder MUST ignore the initiator's KE 7933 payload and omit the KE payload from the response" to "If one of the 7934 proposals offered is for the Diffie-Hellman group of NONE, and the 7935 responder selects that Diffie-Hellman group, then it MUST ignore the 7936 initiator's KE payload and omit the KE payload from the response". 7937 [Issue #176] 7939 In 3.5, changed "[X.501]" and "[X.509]" to "[PKIX]". Also removed 7940 those two now-unneeded references. [Issue #183] 7942 In 3.5, changed "IPv6-only implementations MAY be configurable to 7943 send only ID_IPV6_ADDR instead of ID_IPV6_ADDR for IP addresses" to 7944 "IPv6-only implementations MAY be configurable to send only 7945 ID_IPV6_ADDR instead of ID_IPV4_ADDR for IP addresses". 7947 In 3.5, changed "and MUST be configurable to accept all of these 7948 types" to "and MUST be configurable to accept all of these four 7949 types". [Issue #186] 7951 In 3.6, changed "MUST be capable of being configured to send and 7952 accept the two Hash and URL formats (with HTTP URLs)" to "MUST be 7953 capable of being configured to send and accept the Hash and URL 7954 format (with HTTP URLs)" because there is only one format. 7956 At the beginning of 3.16, changed "The full set of acceptable values 7957 for the payload is defined elsewhere, but a short summary of RFC 3748 7958 is included here to make this document stand alone in the common 7959 cases" to "When using EAP, an appropriate EAP method needs to be 7960 selected. Many of these methods have been defined, specifying the 7961 protocol's use with various authentication mechanisms. EAP method 7962 types are listed in [EAP-IANA]. A short summary of the EAP format is 7963 included here for clarity.". Also added the reference to [EAP-IANA] 7964 to the informative references. [Issue #187] 7966 In 4, changed "There are a series of optional features that can 7967 easily be ignored by a particular implementation if it does not 7968 support that feature. Those features include:" to "The following are 7969 some of the features that can be omitted in a minimal 7970 implementation:". 7972 In the references, moved [AEAD] from informative to normative. 7974 In Appendix B, changed "The strength supplied by group one may not be 7975 sufficient for the mandatory-to-implement encryption algorithm and is 7976 here for historic reasons" to "The strength supplied by group 1 may 7977 not be sufficient for typical uses and is here for historic reasons". 7979 D.17. Changes from draft-ietf-ipsecme-ikev2bis-09 to 7980 draft-ietf-ipsecme-ikev2bis-10 7982 Small editorial changes. 7984 Authors' Addresses 7986 Charlie Kaufman 7987 Microsoft 7988 1 Microsoft Way 7989 Redmond, WA 98052 7990 US 7992 Phone: 1-425-707-3335 7993 Email: charliek@microsoft.com 7995 Paul Hoffman 7996 VPN Consortium 7997 127 Segre Place 7998 Santa Cruz, CA 95060 7999 US 8001 Phone: 1-831-426-9827 8002 Email: paul.hoffman@vpnc.org 8004 Yoav Nir 8005 Check Point Software Technologies Ltd. 8006 5 Hasolelim St. 8007 Tel Aviv 67897 8008 Israel 8010 Email: ynir@checkpoint.com 8012 Pasi Eronen 8013 Nokia Research Center 8014 P.O. Box 407 8015 FIN-00045 Nokia Group 8016 Finland 8018 Email: pasi.eronen@nokia.com