idnits 2.17.1 draft-ietf-ipsec-ikev2-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 97 longer pages, the longest (page 2) being 60 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 5 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 4243 has weird spacing: '... The equati...' == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The exact meaning of the all-uppercase expression 'NOT REQUIRED' is not defined in RFC 2119. If it is intended as a requirements expression, it should be rewritten using one of the combinations defined in RFC 2119; otherwise it should not be all-uppercase. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The responder MUST not send a CFG_REPLY without having first received a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS to perform an unnecessary configuration lookup if the IRAC cannot process the REPLY. In the case where the IRAS's configuration requires that CP be used for a given identity IDi, but IRAC has failed to send a CP(CFG_REQUEST), IRAS MUST fail the request, and terminate the IKE exchange with a FAILED_CP_REQUIRED error. == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: A fully-qualified domain name string. An example of a ID_FQDN is, "example.com". The string MUST not contain any terminators (e.g., NULL, CR, etc.). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: A fully-qualified RFC822 email address string, An example of a ID_RFC822_ADDR is, "jsmith@example.com". The string MUST not contain any terminators. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 2003) is 7560 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'RFC2406' is mentioned on line 157, but not defined ** Obsolete undefined reference: RFC 2406 (Obsoleted by RFC 4303, RFC 4305) == Missing Reference: 'RFC2402' is mentioned on line 157, but not defined ** Obsolete undefined reference: RFC 2402 (Obsoleted by RFC 4302, RFC 4305) == Missing Reference: 'RFC2393' is mentioned on line 162, but not defined ** Obsolete undefined reference: RFC 2393 (Obsoleted by RFC 3173) == Missing Reference: 'CERTREQ' is mentioned on line 1395, but not defined == Missing Reference: 'N' is mentioned on line 432, but not defined == Missing Reference: 'KEi' is mentioned on line 432, but not defined == Missing Reference: 'KEr' is mentioned on line 453, but not defined == Missing Reference: 'CP' is mentioned on line 530, but not defined == Missing Reference: 'RFC 2522' is mentioned on line 804, but not defined == Missing Reference: 'AUTH' is mentioned on line 1405, but not defined == Missing Reference: 'RFC 2401' is mentioned on line 1769, but not defined ** Obsolete undefined reference: RFC 2401 (Obsoleted by RFC 4301) == Missing Reference: 'RFC 3168' is mentioned on line 1777, but not defined == Missing Reference: 'RFC2401bis' is mentioned on line 4474, but not defined ** Obsolete undefined reference: RFC 2401 (Obsoleted by RFC 4301) == Unused Reference: 'ESPCBC' is defined on line 3975, but no explicit reference was found in the text == Unused Reference: 'RFC 3280' is defined on line 3978, but no explicit reference was found in the text == Unused Reference: 'Ble98' is defined on line 3985, but no explicit reference was found in the text == Unused Reference: 'BR94' is defined on line 3990, but no explicit reference was found in the text == Unused Reference: 'DES' is defined on line 3994, but no explicit reference was found in the text == Unused Reference: 'DH' is defined on line 3998, but no explicit reference was found in the text == Unused Reference: 'DSS' is defined on line 4005, but no explicit reference was found in the text == Unused Reference: 'HC98' is defined on line 4009, but no explicit reference was found in the text == Unused Reference: 'IDEA' is defined on line 4016, but no explicit reference was found in the text == Unused Reference: 'Ker01' is defined on line 4024, but no explicit reference was found in the text == Unused Reference: 'KBC96' is defined on line 4027, but no explicit reference was found in the text == Unused Reference: 'MD5' is defined on line 4034, but no explicit reference was found in the text == Unused Reference: 'MSST98' is defined on line 4037, but no explicit reference was found in the text == Unused Reference: 'PKCS1' is defined on line 4047, but no explicit reference was found in the text == Unused Reference: 'PK01' is defined on line 4050, but no explicit reference was found in the text == Unused Reference: 'Pip98' is defined on line 4054, but no explicit reference was found in the text == Unused Reference: 'RFC2401' is defined on line 4063, but no explicit reference was found in the text == Unused Reference: 'RFC2474' is defined on line 4066, but no explicit reference was found in the text == Unused Reference: 'RFC2475' is defined on line 4071, but no explicit reference was found in the text == Unused Reference: 'RFC2522' is defined on line 4075, but no explicit reference was found in the text == Unused Reference: 'RFC3168' is defined on line 4078, but no explicit reference was found in the text == Unused Reference: 'RSA' is defined on line 4082, but no explicit reference was found in the text == Unused Reference: 'SHA' is defined on line 4087, but no explicit reference was found in the text == Unused Reference: 'SKEME' is defined on line 4097, but no explicit reference was found in the text ** Obsolete normative reference: RFC 3513 (ref. 'ADDRIPV6') (Obsoleted by RFC 4291) ** Obsolete normative reference: RFC 2284 (ref. 'EAP') (Obsoleted by RFC 3748) ** Obsolete normative reference: RFC 3280 (Obsoleted by RFC 5280) -- Obsolete informational reference (is this intentional?): RFC 2409 (ref. 'HC98') (Obsoleted by RFC 4306) == Outdated reference: A later version (-09) exists of draft-ietf-ipsec-udp-encaps-05 -- Obsolete informational reference (is this intentional?): RFC 2251 (ref. 'LDAP') (Obsoleted by RFC 4510, RFC 4511, RFC 4512, RFC 4513) -- Obsolete informational reference (is this intentional?): RFC 2408 (ref. 'MSST98') (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 2407 (ref. 'Pip98') (Obsoleted by RFC 4306) -- Obsolete informational reference (is this intentional?): RFC 2138 (ref. 'RADIUS') (Obsoleted by RFC 2865) -- Obsolete informational reference (is this intentional?): RFC 1750 (Obsoleted by RFC 4086) -- Obsolete informational reference (is this intentional?): RFC 2401 (Obsoleted by RFC 4301) Summary: 14 errors (**), 0 flaws (~~), 48 warnings (==), 10 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPSEC Working Group Charlie Kaufman 3 INTERNET-DRAFT editor 4 draft-ietf-ipsec-ikev2-09.txt August 2003 6 Internet Key Exchange (IKEv2) Protocol 7 9 Status of this Memo 11 This document is a submission by the IPSEC Working Group of the 12 Internet Engineering Task Force (IETF). Comments should be submitted 13 to the ipsec@lists.tislabs.com mailing list. 15 Distribution of this memo is unlimited. 17 This document is an Internet Draft and is in full conformance with 18 all provisions of Section 10 of RFC2026 [Bra96]. Internet Drafts are 19 working documents of the Internet Engineering Task Force (IETF), its 20 areas, and working groups. Note that other groups may also distribute 21 working documents as Internet Drafts. 23 Internet Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet Drafts as reference 26 material or to cite them other than as "work in progress." 28 To learn the current status of any Internet Draft, please check the 29 "1id-abstracts.txt" listing contained in the Internet Drafts Shadow 30 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), 31 munnari.oz.au (Australia), ds.internic.net (US East Coast), or 32 ftp.isi.edu (US West Coast). 34 Abstract 36 This document describes version 2 of the IKE (Internet Key Exchange) 37 protocol. IKE is a component of IPsec used for performing mutual 38 authentication and establishing and maintaining security 39 associations. 41 This version of IKE simplifies the design by removing options that 42 were rarely used and simplifying the encoding. This version of the 43 IKE specification combines the contents of what were previously 44 separate documents, including ISAKMP (RFC 2408), IKE (RFC 2409), the 45 Internet DOI (RFC 2407), NAT Traversal, Legacy authentication, and 46 remote address acquisition. 48 Version 2 of IKE does not interoperate with version 1, but it has 49 enough of the header format in common that both versions can 50 unambiguously run over the same UDP port. 52 Table of Contents 54 Abstract.....................................................1 55 Requirements Terminology.....................................3 56 1 IKE Protocol Overview......................................3 57 1.1 Usage Scenarios..........................................5 58 1.1.1 Security Gateway to Security Gateway Tunnel............5 59 1.1.2 Endpoint to Endpoint Transport.........................6 60 1.1.3 Endpoint to Security Gateway Transport.................6 61 1.1.4 Other Scenarios........................................7 62 1.2 The Initial Exchange.....................................7 63 1.3 The CREATE_CHILD_SA Exchange.............................9 64 1.4 The INFORMATIONAL Exchange..............................10 65 1.5 Informational Messages outside of an IKE_SA.............12 66 2 IKE Protocol Details and Variations.......................12 67 2.1 Use of Retransmission Timers............................12 68 2.2 Use of Sequence Numbers for Message ID..................13 69 2.3 Window Size for overlapping requests....................13 70 2.4 State Synchronization and Connection Timeouts...........14 71 2.5 Version Numbers and Forward Compatibility...............16 72 2.6 Cookies.................................................17 73 2.7 Cryptographic Algorithm Negotiation.....................20 74 2.8 Rekeying................................................21 75 2.9 Traffic Selector Negotiation............................23 76 2.10 Nonces.................................................25 77 2.11 Address and Port Agility...............................25 78 2.12 Reuse of Diffie-Hellman Exponentials...................25 79 2.13 Generating Keying Material.............................26 80 2.14 Generating Keying Material for the IKE_SA..............27 81 2.15 Authentication of the IKE_SA...........................28 82 2.16 Extended Authentication Protocol Methods...............29 83 2.17 Generating Keying Material for CHILD_SAs...............30 84 2.18 Rekeying IKE_SAs using a CREATE_CHILD_SA exchange......31 85 2.19 Requesting an internal address on a remote network.....32 86 2.20 Requesting a Peer's Version............................33 87 2.21 Error Handling.........................................34 88 2.22 IPComp.................................................35 89 2.23 NAT Traversal..........................................35 90 2.24 ECN Notification.......................................38 91 3 Header and Payload Formats................................38 92 3.1 The IKE Header..........................................38 93 3.2 Generic Payload Header..................................41 94 3.3 Security Association Payload............................43 95 3.3.1 Proposal Substructure.................................45 96 3.3.2 Transform Substructure................................46 97 3.3.3 Valid Transform Types by Protocol.....................49 98 3.3.4 Mandatory Transform IDs...............................49 99 3.3.5 Transform Attributes..................................50 100 3.3.6 Attribute Negotiation.................................51 101 3.4 Key Exchange Payload....................................52 102 3.5 Identification Payloads.................................53 103 3.6 Certificate Payload.....................................55 104 3.7 Certificate Request Payload.............................57 105 3.8 Authentication Payload..................................58 106 3.9 Nonce Payload...........................................59 107 3.10 Notify Payload.........................................59 108 3.10.1 Notify Message Types.................................61 109 3.11 Delete Payload.........................................66 110 3.12 Vendor ID Payload......................................67 111 3.13 Traffic Selector Payload...............................68 112 3.13.1 Traffic Selector.....................................70 113 3.14 Encrypted Payload......................................71 114 3.15 Configuration Payload..................................73 115 3.15.1 Configuration Attributes.............................76 116 3.16 Extended Authentication Protocol (EAP) Payload.........78 117 4 Conformance Requirements..................................80 118 5 Security Considerations...................................82 119 6 IANA Considerations.......................................83 120 7 Intellectual property rights..............................84 121 8 Acknowledgements..........................................84 122 9 References................................................84 123 9.1 Normative References....................................84 124 9.2 Non-normative References................................85 125 Appendix A: Summary of Changes from IKEv1...................88 126 Appendix B: Diffie-Hellman Groups...........................90 127 Change History (To be removed from RFC).....................93 128 Editor's Address............................................98 129 Full Copyright Statement....................................98 131 Requirements Terminology 133 Keywords "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT" and 134 "MAY" that appear in this document are to be interpreted as described 135 in [Bra97]. 137 1 IKE Protocol Overview 139 IP Security (IPsec) provides confidentiality, data integrity, access 140 control, and data source authentication to IP datagrams. These 141 services are provided by maintaining shared state between the source 142 and the sink of an IP datagram. This state defines, among other 143 things, the specific services provided to the datagram, which 144 cryptographic algorithms will be used to provide the services, and 145 the keys used as input to the cryptographic algorithms. 147 Establishing this shared state in a manual fashion does not scale 148 well. Therefore a protocol to establish this state dynamically is 149 needed. This memo describes such a protocol-- the Internet Key 150 Exchange (IKE). This is version 2 of IKE. Version 1 of IKE was 151 defined in RFCs 2407, 2408, and 2409. This single document is 152 intended to replace all three of those RFCs. 154 IKE performs mutual authentication between two parties and 155 establishes an IKE security association that includes shared secret 156 information that can be used to efficiently establish SAs for ESP 157 [RFC2406] and/or AH [RFC2402] and a set of cryptographic algorithms 158 to be used to protect the SAs. In this document, the term "suite" or 159 "cryptographic suite" refers to a complete set of algorithms used to 160 protect an SA. An initiator proposes one or more suites by listing 161 supported algorithms that can be combined into suites in a mix and 162 match fashion. IKE can also negotiate use of IPComp [RFC2393] in 163 connection with an ESP and/or AH SA. We call the IKE SA an "IKE_SA". 164 The SAs for ESP and/or AH that get set up through that IKE_SA we call 165 "CHILD_SA"s. 167 All IKE communications consist of pairs of messages: a request and a 168 response. The pair is called an "exchange". We call the first 169 messages establishing an IKE_SA IKE_SA_INIT and IKE_AUTH exchanges 170 and subsequent IKE exchanges CREATE_CHILD_SA or INFORMATIONAL 171 exchanges. In the common case, there is a single IKE_SA_INIT exchange 172 and a single IKE_AUTH exchange (a total of four messages) to 173 establish the IKE_SA and the first CHILD_SA. In exceptional cases, 174 there may be more than one of each of these exchanges. In all cases, 175 all IKE_SA_INIT exchanges MUST complete before any other exchange 176 type, then all IKE_AUTH exchanges MUST complete, and following that 177 any number of CREATE_CHILD_SA and INFORMATIONAL exchanges may occur 178 in any order. In some scenarios, only a single CHILD_SA is needed 179 between the IPsec endpoints and therefore there would be no 180 additional exchanges. Subsequent exchanges MAY be used to establish 181 additional CHILD_SAs between the same authenticated pair of endpoints 182 and to perform housekeeping functions. 184 IKE message flow always consists of a request followed by a response. 185 It is the responsibility of the requester to ensure reliability. If 186 the response is not received within a timeout interval, the requester 187 needs to retransmit the request (or abandon the connection). 189 The first request/response of an IKE session negotiates security 190 parameters for the IKE_SA, sends nonces, and sends Diffie-Hellman 191 values. We call the initial exchange IKE_SA_INIT (request and 192 response). 194 The second request/response, which we'll call IKE_AUTH transmits 195 identities, proves knowledge of the secrets corresponding to the two 196 identities, and sets up an SA for the first (and often only) AH 197 and/or ESP CHILD_SA. 199 The types of subsequent exchanges are CREATE_CHILD_SA (which creates 200 a CHILD_SA), and INFORMATIONAL (which deletes an SA, reports error 201 conditions, or does other housekeeping). Every request requires a 202 response. An INFORMATIONAL request with no payloads is commonly used 203 as a check for liveness. These subsequent exchanges cannot be used 204 until the initial exchanges have completed. 206 In the description that follows, we assume that no errors occur. 207 Modifications to the flow should errors occur are described in 208 section 2.21. 210 1.1 Usage Scenarios 212 IKE is expected to be used to negotiate ESP and/or AH SAs in a number 213 of different scenarios, each with its own special requirements. 215 1.1.1 Security Gateway to Security Gateway Tunnel 217 +-+-+-+-+-+ +-+-+-+-+-+ 218 ! ! IPsec ! ! 219 Protected !Tunnel ! Tunnel !Tunnel ! Protected 220 Subnet <-->!Endpoint !<---------->!Endpoint !<--> Subnet 221 ! ! ! ! 222 +-+-+-+-+-+ +-+-+-+-+-+ 224 Figure 1: Security Gateway to Security Gateway Tunnel 226 In this scenario, neither endpoint of the IP connection implements 227 IPsec, but network nodes between them protect traffic for part of the 228 way. Protection is transparent to the endpoints, and depends on 229 ordinary routing sending packets through the tunnel endpoints for 230 processing. Each endpoint would announce the set of addresses 231 "behind" it, and packets would be sent in Tunnel Mode where the inner 232 IP header would contain the IP addresses of the actual endpoints. 234 1.1.2 Endpoint to Endpoint Transport 236 +-+-+-+-+-+ +-+-+-+-+-+ 237 ! ! IPsec ! ! 238 !Protected! Tunnel !Protected! 239 !Endpoint !<---------------------------------------->!Endpoint ! 240 ! ! ! ! 241 +-+-+-+-+-+ +-+-+-+-+-+ 243 Figure 2: Endpoint to Endpoint 245 In this scenario, both endpoints of the IP connection implement 246 IPsec. These endpoints may implement application layer access 247 controls based on the authenticated identities of the participants. 248 Transport mode will commonly be used with no inner IP header. If 249 there is an inner IP header, the inner addresses will be the same as 250 the outer addresses. A single pair of addresses will be negotiated 251 for packets to be sent over this SA. 253 It is possible in this scenario that one or both of the protected 254 endpoints will be behind a network address translation (NAT) node, in 255 which case the tunnelled packets will have to be UDP encapsulated so 256 that port numbers in the UDP headers can be used to identify 257 individual endpoints "behind" the NAT. 259 1.1.3 Endpoint to Security Gateway Transport 261 +-+-+-+-+-+ +-+-+-+-+-+ 262 ! ! IPsec ! ! Protected 263 !Protected! Tunnel !Tunnel ! Subnet 264 !Endpoint !<------------------------>!Endpoint !<--- and/or 265 ! ! ! ! Internet 266 +-+-+-+-+-+ +-+-+-+-+-+ 268 Figure 3: Endpoint to Security Gateway Tunnel 270 In this scenario, a protected endpoint (typically a portable roaming 271 computer) connects back to its corporate network through an IPsec 272 protected tunnel. It might use this tunnel only to access information 273 on the corporate network or it might tunnel all of its traffic back 274 through the corporate network in order to take advantage of 275 protection provided by a corporate firewall against Internet based 276 attacks. In either case, the protected endpoint will want an IP 277 address associated with the security gateway so that packets returned 278 to it will go to the security gateway and be tunnelled back. This IP 279 address may be static or may be dynamically allocated by the security 280 gateway. In support of the latter case, IKEv2 includes a mechanism 281 for the initiator to request an IP address owned by the security 282 gateway for use for the duration of its SA. 284 In this scenario, packets will use tunnel mode. On each packet from 285 the protected endpoint, the outer IP header will contain the source 286 IP address associated with its current location (i.e., the address 287 that will get traffic routed to the endpoint directly) while the 288 inner IP header will contain the source IP address assigned by the 289 security gateway (i.e., the address that will get traffic routed to 290 the security gateway for forwarding to the endpoint). The outer 291 destination address will always be that of the security gateway, 292 while the inner destination address will be the ultimate destination 293 for the packet. 295 In this scenario, it is possible that the protected endpoint will be 296 behind a NAT. In that case, the IP address as seen by the security 297 gateway will not be the same as the IP address sent by the protected 298 endpoint, and packets will have to be UDP encapsulated in order to be 299 routed properly. 301 1.1.4 Other Scenarios 303 Other scenarios are possible, as are nested combinations of the 304 above. One notable example combines aspects of 1.1.1 and 1.1.3. A 305 subnet may make all external accesses through a remote security 306 gateway using an IPsec tunnel, where the addresses on the subnet are 307 routed to the security gateway by the rest of the Internet. An 308 example would be someone's home network being virtually on the 309 Internet with static IP addresses even though connectivity is 310 provided by an ISP that assigns a single dynamically assigned IP 311 address to the user's security gateway (where the static IP addresses 312 and an IPsec relay is provided by a third party located elsewhere). 314 1.2 The Initial Exchanges 316 Communication using IKE always begins with IKE_SA_INIT and IKE_AUTH 317 exchanges (known in IKEv1 as Phase 1). These initial exchanges 318 normally consist of four messages, though in some scenarios that 319 number can grow. All communications using IKE consist of 320 request/response pairs. We'll describe the base exchange first, 321 followed by variations. The first pair of messages (IKE_SA_INIT) 322 negotiate cryptographic algorithms, exchange nonces, and do a Diffie- 323 Hellman exchange. 325 The second pair of messages (IKE_AUTH) authenticate the previous 326 messages, exchange identities and certificates, and establish the 327 first CHILD_SA. Parts of these messages are encrypted and integrity 328 protected with keys established through the IKE_SA_INIT exchange, so 329 the identities are hidden from eavesdroppers and all fields in all 330 the messages are authenticated. 332 In the following description, the payloads contained in the message 333 are indicated by names such as SA. The details of the contents of 334 each payload are described later. Payloads which may optionally 335 appear will be shown in brackets, such as [CERTREQ], would indicate 336 that optionally a certificate request payload can be included. 338 The initial exchanges are as follows: 340 Initiator Responder 341 ----------- ----------- 342 HDR, SAi1, KEi, Ni --> 344 HDR contains the SPIs, version numbers, and flags of various sorts. 345 The SAi1 payload states the cryptographic algorithms the Initiator 346 supports for the IKE_SA. The KE payload sends the Initiator's 347 Diffie-Hellman value. Ni is the Initiator's nonce. 349 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 351 The Responder chooses a cryptographic suite from the Initiator's 352 offered choices and expresses that choice in the SAr1 payload, 353 completes the Diffie-Hellman exchange with the KEr payload, and sends 354 its nonce in the Nr payload. 356 At this point in the negotiation each party can generate SKEYSEED, 357 from which all keys are derived for that IKE_SA. All but the headers 358 of all the messages that follow are encrypted and integrity 359 protected. The keys used for the encryption and integrity protection 360 are derived from SKEYSEED and are known as SK_e (encryption) and SK_a 361 (authentication, a.k.a. integrity protection). A separate SK_e and 362 SK_a is computed for each direction. In addition to the keys SK_e 363 and SK_a derived from the DH value for protection of the IKE_SA, 364 another quantity SK_d is derived and used for derivation of further 365 keying material for CHILD_SAs. The notation SK { ... } indicates 366 that these payloads are encrypted and integrity protected using that 367 direction's SK_e and SK_a. 369 HDR, SK {IDi, [CERT,] [CERTREQ,] [IDr,] 370 AUTH, SAi2, TSi, TSr} --> 372 The Initiator asserts her identity with the IDi payload, proves 373 knowledge of the secret corresponding to IDi and integrity protects 374 the contents of the first two messages using the AUTH payload (see 375 section 2.15). She might also send her certificate(s) in CERT 376 payload(s) and a list of her trust anchors in CERTREQ payload(s). If 377 any CERT payloads are included, the first certificate provided MUST 378 contain the public key used to verify the AUTH field. The optional 379 payload IDr enables Alice to specify which of Bob's identities she 380 wants to talk to. This is useful when Bob is hosting multiple 381 identities at the same IP address. She begins negotiation of a 382 CHILD_SA using the SAi2 payload. The final fields (starting with 383 SAi2) are described in the description of the CREATE_CHILD_SA 384 exchange. 386 <-- HDR, SK {IDr, [CERT,] AUTH, 387 SAr2, TSi, TSr} 389 The Responder asserts his identity with the IDr payload, optionally 390 sends one or more certificates (again with the certificate containing 391 the public key used to verify AUTH listed first), authenticates his 392 identity with the AUTH payload, and completes negotiation of a 393 CHILD_SA with the additional fields described below in the 394 CREATE_CHILD_SA exchange. 396 The recipients of messages 3 and 4 MUST verify that all signatures 397 and MACs are computed correctly and that the names in the ID payloads 398 correspond to the keys used to generate the AUTH payload. 400 1.3 The CREATE_CHILD_SA Exchange 402 This exchange consists of a single request/response pair, and was 403 referred to as a phase 2 exchange in IKEv1. It MAY be initiated by 404 either end of the IKE_SA after the initial exchanges are completed. 406 All messages following the initial exchange are cryptographically 407 protected using the cryptographic algorithms and keys negotiated in 408 the first two messages of the IKE exchange using a syntax described 409 in section 3.14. 411 Either endpoint may initiate a CREATE_CHILD_SA exchange, so in this 412 section the term Initiator refers to the endpoint initiating this 413 exchange. 415 A CHILD_SA is created by sending a CREATE_CHILD_SA request. The 416 CREATE_CHILD_SA request MAY optionally contain a KE payload for an 417 additional Diffie-Hellman exchange to enable stronger guarantees of 418 forward secrecy for the CHILD_SA. The keying material for the 419 CHILD_SA is a function of SK_d established during the establishment 420 of the IKE_SA, the nonces exchanged during the CREATE_CHILD_SA 421 exchange, and the Diffie-Hellman value (if KE payloads are included 422 in the CREATE_CHILD_SA exchange). 424 In the CHILD_SA created as part of the initial exchange, a second KE 425 payload and nonce MUST NOT be sent. The nonces from the initial 426 exchange are used in computing the keys for the CHILD_SA. 428 The CREATE_CHILD_SA request contains: 430 Initiator Responder 431 ----------- ----------- 432 HDR, SK {[N], SA, Ni, [KEi], 433 [TSi, TSr]} --> 435 The Initiator sends SA offer(s) in the SA payload, a nonce in the Ni 436 payload, optionally a Diffie-Hellman value in the KEi payload, and 437 the proposed traffic selectors in the TSi and TSr payloads. If this 438 CREATE_CHILD_SA exchange is rekeying an existing SA other than the 439 IKE_SA, the leading N payload of type REKEY_SA MUST identify the SA 440 being rekeyed. If this CREATE_CHILD_SA exchange is not rekeying and 441 existing SA, the N payload MUST be omitted. If the SA offers include 442 different Diffie-Hellman groups, KEi MUST be an element of the group 443 the Initiator expects the responder to accept. If she guesses wrong, 444 the CREATE_CHILD_SA exchange will fail and she will have to retry 445 with a different KEi. 447 The message following the header is encrypted and the message 448 including the header is integrity protected using the cryptographic 449 algorithms negotiated for the IKE_SA. 451 The CREATE_CHILD_SA response contains: 453 <-- HDR, SK {SA, Nr, [KEr], 454 [TSi, TSr]} 456 The Responder replies (using the same Message ID to respond) with the 457 accepted offer in an SA payload, and a Diffie-Hellman value in the 458 KEr payload if KEi was included in the request and the selected 459 cryptographic suite includes that group. If the responder chooses a 460 cryptographic suite with a different group, it MUST reject the 461 request. The initiator SHOULD repeat the request, but now with a KEi 462 payload from the group the responder selected. 464 The traffic selectors for traffic to be sent on that SA are specified 465 in the TS payloads, which may be a subset of what the Initiator of 466 the CHILD_SA proposed. Traffic selectors are omitted if this 467 CREATE_CHILD_SA request is being used to change the key of the 468 IKE_SA. 470 1.4 The INFORMATIONAL Exchange 472 At various points during the operation of an IKE_SA, peers may desire 473 to convey control messages to each other regarding errors or 474 notifications of certain events. To accomplish this IKE defines an 475 INFORMATIONAL exchange. INFORMATIONAL exchanges MAY ONLY occur after 476 the initial exchanges and are cryptographically protected with the 477 negotiated keys. 479 Control messages that pertain to an IKE_SA MUST be sent under that 480 IKE_SA. Control messages that pertain to CHILD_SAs MUST be sent under 481 the protection of the IKE_SA which generated them (or its successor 482 if the IKE_SA was replaced for the purpose of rekeying). 484 Messages in an INFORMATIONAL Exchange contain zero or more 485 Notification, Delete, and Configuration payloads. The Recipient of an 486 INFORMATIONAL Exchange request MUST send some response (else the 487 Sender will assume the message was lost in the network and will 488 retransmit it). That response MAY be a message with no payloads. The 489 request message in an INFORMATIONAL Exchange MAY also contain no 490 payloads. This is the expected way an endpoint can ask the other 491 endpoint to verify that it is alive. 493 ESP and AH SAs always exist in pairs, with one SA in each direction. 494 When an SA is closed, both members of the pair MUST be closed. When 495 SAs are nested, as when data (and IP headers if in tunnel mode) are 496 encapsulated first with IPComp, then with ESP, and finally with AH 497 between the same pair of endpoints, all of the SAs MUST be deleted 498 together. Each endpoint MUST close its incoming SAs and allow the 499 other endpoint to close the other SA in each pair. To delete an SA, 500 an INFORMATIONAL Exchange with one or more delete payloads is sent 501 listing the SPIs (as they would be expected in the headers of inbound 502 packets) of the SAs to be deleted. The recipient MUST close the 503 designated SAs. Normally, the reply in the INFORMATIONAL Exchange 504 will contain delete payloads for the paired SAs going in the other 505 direction. There is one exception. If by chance both ends of a set 506 of SAs independently decide to close them, each may send a delete 507 payload and the two requests may cross in the network. If a node 508 receives a delete request for SAs for which it has already issued a 509 delete request, it MUST delete the outgoing SAs while processing the 510 request and the incoming SAs while processing the response. In that 511 case, the responses MUST NOT include delete payloads for the deleted 512 SAs, since that would result in duplicate deletion and could in 513 theory delete the wrong SA. 515 A node SHOULD regard half closed connections as anomalous and audit 516 their existence should they persist. Note that this specification 517 nowhere specifies time periods, so it is up to individual endpoints 518 to decide how long to wait. A node MAY refuse to accept incoming data 519 on half closed connections but MUST NOT unilaterally close them and 520 reuse the SPIs. If connection state becomes sufficiently messed up, a 521 node MAY close the IKE_SA which will implicitly close all SAs 522 negotiated under it. It can then rebuild the SAs it needs on a clean 523 base under a new IKE_SA. 525 The INFORMATIONAL Exchange is defined as: 527 Initiator Responder 528 ----------- ----------- 529 HDR, SK {[N,] [D,] [CP,] ...} --> 530 <-- HDR, SK {[N,] [D,] [CP], ...} 532 The processing of an INFORMATIONAL Exchange is determined by its 533 component payloads. 535 1.5 Informational Messages outside of an IKE_SA 537 If a packet arrives with an unrecognized SPI, it could be because the 538 receiving node has recently crashed and lost state or because of some 539 other system malfunction or attack. If the receiving node has an 540 active IKE_SA to the IP address from whence the packet came, it MAY 541 send a notification of the wayward packet over that IKE_SA. If it 542 does not, it MAY send an Informational message without cryptographic 543 protection to the source IP address and port to alert it to a 544 possible problem. 546 2 IKE Protocol Details and Variations 548 IKE normally listens and sends on UDP port 500, though IKE messages 549 may also be received on UDP port 4500 with a slightly different 550 format (see section 2.23). Since UDP is a datagram (unreliable) 551 protocol, IKE includes in its definition recovery from transmission 552 errors, including packet loss, packet replay, and packet forgery. IKE 553 is designed to function so long as (1) at least one of a series of 554 retransmitted packets reaches its destination before timing out; and 555 (2) the channel is not so full of forged and replayed packets so as 556 to exhaust the network or CPU capacities of either endpoint. Even in 557 the absence of those minimum performance requirements, IKE is 558 designed to fail cleanly (as though the network were broken). 560 2.1 Use of Retransmission Timers 562 All messages in IKE exist in pairs: a request and a response. The 563 setup of an IKE_SA normally consists of two request/response pairs. 564 Once the IKE_SA is set up, either end of the security association may 565 initiate requests at any time, and there can be many requests and 566 responses "in flight" at any given moment. But each message is 567 labelled as either a request or a response and for each 568 request/response pair one end of the security association is the 569 Initiator and the other is the Responder. 571 For every pair of IKE messages, the Initiator is responsible for 572 retransmission in the event of a timeout. The Responder MUST never 573 retransmit a response unless it receives a retransmission of the 574 request. In that event, the Responder MUST ignore the retransmitted 575 request except insofar as it triggers a retransmission of the 576 response. The Initiator MUST remember each request until it receives 577 the corresponding response. The Responder MUST remember each response 578 until it receives a request whose sequence number is larger than the 579 sequence number in the response plus his window size (see section 580 2.3). 582 IKE is a reliable protocol, in the sense that the Initiator MUST 583 retransmit a request until either it receives a corresponding reply 584 OR it deems the IKE security association to have failed and it 585 discards all state associated with the IKE_SA and any CHILD_SAs 586 negotiated using that IKE_SA. 588 2.2 Use of Sequence Numbers for Message ID 590 Every IKE message contains a Message ID as part of its fixed header. 591 This Message ID is used to match up requests and responses, and to 592 identify retransmissions of messages. 594 The Message ID is a 32 bit quantity, which is zero for the first IKE 595 request in each direction. The IKE_SA initial setup messages will 596 always be numbered 0 and 1. Each endpoint in the IKE Security 597 Association maintains two "current" Message IDs: the next one to be 598 used for a request it initiates and the next one it expects to see in 599 a request from the other end. These counters increment as requests 600 are generated and received. Responses always contain the same message 601 ID as the corresponding request. That means that after the initial 602 exchange, each integer n may appear as the message ID in four 603 distinct messages: The nth request from the original IKE Initiator, 604 the corresponding response, the nth request from the original IKE 605 Responder, and the corresponding response. If the two ends make very 606 different numbers of requests, the Message IDs in the two directions 607 can be very different. There is no ambiguity in the messages, 608 however, because the (I)nitiator and (R)esponse bits in the message 609 header specify which of the four messages a particular one is. 611 Note that Message IDs are cryptographically protected and provide 612 protection against message replays. In the unlikely event that 613 Message IDs grow too large to fit in 32 bits, the IKE_SA MUST be 614 closed. Rekeying an IKE_SA resets the sequence numbers. 616 2.3 Window Size for overlapping requests 618 In order to maximize IKE throughput, an IKE endpoint MAY issue 619 multiple requests before getting a response to any of them if the 620 other endpoint has indicated its ability to handle such requests. For 621 simplicity, an IKE implementation MAY choose to process requests 622 strictly in order and/or wait for a response to one request before 623 issuing another. Certain rules must be followed to assure 624 interoperability between implementations using different strategies. 626 After an IKE_SA is set up, either end can initiate one or more 627 requests. These requests may pass one another over the network. An 628 IKE endpoint MUST be prepared to accept and process a request while 629 it has a request outstanding in order to avoid a deadlock in this 630 situation. An IKE endpoint SHOULD be prepared to accept and process 631 multiple requests while it has a request outstanding. 633 An IKE endpoint MUST wait for a response to each of its messages 634 before sending a subsequent message unless it has received a 635 SET_WINDOW_SIZE Notify message from its peer informing it that the 636 peer is prepared to maintain state for multiple outstanding messages 637 in order to allow greater throughput. 639 An IKE endpoint MUST NOT exceed the peer's stated window size for 640 transmitted IKE requests. In other words, if Bob stated his window 641 size is N, then when Alice needs to make a request X, she MUST wait 642 until she has received responses to all requests up through request 643 X-N. An IKE endpoint MUST keep a copy of (or be able to regenerate 644 exactly) each request it has sent until it receives the corresponding 645 response. An IKE endpoint MUST keep a copy of (or be able to 646 regenerate exactly) the number of previous responses equal to its 647 declared window size in case its response was lost and the Initiator 648 requests its retransmission by retransmitting the request. 650 An IKE endpoint supporting a window size greater than one SHOULD be 651 capable of processing incoming requests out of order to maximize 652 performance in the event of network failures or packet reordering. 654 2.4 State Synchronization and Connection Timeouts 656 An IKE endpoint is allowed to forget all of its state associated with 657 an IKE_SA and the collection of corresponding CHILD_SAs at any time. 658 This is the anticipated behavior in the event of an endpoint crash 659 and restart. It is important when an endpoint either fails or 660 reinitializes its state that the other endpoint detect those 661 conditions and not continue to waste network bandwidth by sending 662 packets over discarded SAs and having them fall into a black hole. 664 Since IKE is designed to operate in spite of Denial of Service (DoS) 665 attacks from the network, an endpoint MUST NOT conclude that the 666 other endpoint has failed based on any routing information (e.g., 667 ICMP messages) or IKE messages that arrive without cryptographic 668 protection (e.g., Notify messages complaining about unknown SPIs). An 669 endpoint MUST conclude that the other endpoint has failed only when 670 repeated attempts to contact it have gone unanswered for a timeout 671 period or when a cryptographically protected INITIAL_CONTACT 672 notification is received on a different IKE_SA to the same 673 authenticated identity. An endpoint SHOULD suspect that the other 674 endpoint has failed based on routing information and initiate a 675 request to see whether the other endpoint is alive. To check whether 676 the other side is alive, IKE specifies an empty INFORMATIONAL message 677 that (like all IKE requests) requires an acknowledgment. If a 678 cryptographically protected message has been received from the other 679 side recently, unprotected notifications MAY be ignored. 680 Implementations MUST limit the rate at which they take actions based 681 on unprotected messages. 683 Numbers of retries and lengths of timeouts are not covered in this 684 specification because they do not affect interoperability. It is 685 suggested that messages be retransmitted at least a dozen times over 686 a period of at least several minutes before giving up on an SA, but 687 different environments may require different rules. If there has only 688 been outgoing traffic on all of the SAs associated with an IKE_SA, it 689 is essential to confirm liveness of the other endpoint to avoid black 690 holes. If no cryptographically protected messages have been received 691 on an IKE_SA or any of its CHILD_SAs recently, the system needs to 692 perform a liveness check in order to prevent sending messages to a 693 dead peer. Receipt of a fresh cryptographically protected message on 694 an IKE_SA or any of its CHILD_SAs assures liveness of the IKE_SA and 695 all of its CHILD_SAs. Note that this places requirements on the 696 failure modes of an IKE endpoint. An implementation MUST NOT continue 697 sending on any SA if some failure prevents it from receiving on all 698 of the associated SAs. If CHILD_SAs can fail independently from one 699 another without the associated IKE_SA being able to send a delete 700 message, then they MUST be negotiated by separate IKE_SAs. 702 There is a Denial of Service attack on the Initiator of an IKE_SA 703 that can be avoided if the Initiator takes the proper care. Since the 704 first two messages of an SA setup are not cryptographically 705 protected, an attacker could respond to the Initiator's message 706 before the genuine Responder and poison the connection setup attempt. 707 To prevent this, the Initiator MAY be willing to accept multiple 708 responses to its first message, treat each as potentially legitimate, 709 respond to it, and then discard all the invalid half open connections 710 when she receives a valid cryptographically protected response to any 711 one of her requests. Once a cryptographically valid response is 712 received, all subsequent responses should be ignored whether or not 713 they are cryptographically valid. 715 Note that with these rules, there is no reason to negotiate and agree 716 upon an SA lifetime. If IKE presumes the partner is dead, based on 717 repeated lack of acknowledgment to an IKE message, then the IKE SA 718 and all CHILD_SAs set up through that IKE_SA are deleted. 720 An IKE endpoint may at any time delete inactive CHILD_SAs to recover 721 resources used to hold their state. If an IKE endpoint chooses to do 722 so, it MUST send Delete payloads to the other end notifying it of the 723 deletion. It MAY similarly time out the IKE_SA. Closing the IKE_SA 724 implicitly closes all associated CHILD_SAs. In this case, an IKE 725 endpoint SHOULD send a Delete payload indicating that it has closed 726 the IKE_SA. 728 2.5 Version Numbers and Forward Compatibility 730 This document describes version 2.0 of IKE, meaning the major version 731 number is 2 and the minor version number is zero. It is likely that 732 some implementations will want to support both version 1.0 and 733 version 2.0, and in the future, other versions. 735 The major version number should only be incremented if the packet 736 formats or required actions have changed so dramatically that an 737 older version node would not be able to interoperate with a newer 738 version node if it simply ignored the fields it did not understand 739 and took the actions specified in the older specification. The minor 740 version number indicates new capabilities, and MUST be ignored by a 741 node with a smaller minor version number, but used for informational 742 purposes by the node with the larger minor version number. For 743 example, it might indicate the ability to process a newly defined 744 notification message. The node with the larger minor version number 745 would simply note that its correspondent would not be able to 746 understand that message and therefore would not send it. 748 If an endpoint receives a message with a higher major version number, 749 it MUST drop the message and SHOULD send an unauthenticated 750 notification message containing the highest version number it 751 supports. If an endpoint supports major version n, and major version 752 m, it MUST support all versions between n and m. If it receives a 753 message with a major version that it supports, it MUST respond with 754 that version number. In order to prevent two nodes from being tricked 755 into corresponding with a lower major version number than the maximum 756 that they both support, IKE has a flag that indicates that the node 757 is capable of speaking a higher major version number. 759 Thus the major version number in the IKE header indicates the version 760 number of the message, not the highest version number that the 761 transmitter supports. If A is capable of speaking versions n, n+1, 762 and n+2, and B is capable of speaking versions n and n+1, then they 763 will negotiate speaking n+1, where A will set the flag indicating 764 ability to speak a higher version. If they mistakenly (perhaps 765 through an active attacker sending error messages) negotiate to 766 version n, then both will notice that the other side can support a 767 higher version number, and they MUST break the connection and 768 reconnect using version n+1. 770 Note that IKEv1 does not follow these rules, because there is no way 771 in v1 of noting that you are capable of speaking a higher version 772 number. So an active attacker can trick two v2-capable nodes into 773 speaking v1. When a v2-capable node negotiates down to v1, it SHOULD 774 note that fact in its logs. 776 Also for forward compatibility, all fields marked RESERVED MUST be 777 set to zero by a version 2.0 implementation and their content MUST be 778 ignored by a version 2.0 implementation ("Be conservative in what you 779 send and liberal in what you receive"). In this way, future versions 780 of the protocol can use those fields in a way that is guaranteed to 781 be ignored by implementations that do not understand them. 782 Similarly, payload types that are not defined are reserved for future 783 use and implementations of version 2.0 MUST skip over those payloads 784 and ignore their contents. 786 IKEv2 adds a "critical" flag to each payload header for further 787 flexibility for forward compatibility. If the critical flag is set 788 and the payload type is unrecognized, the message MUST be rejected 789 and the response to the IKE request containing that payload MUST 790 include a Notify payload UNSUPPORTED_CRITICAL_PAYLOAD, indicating an 791 unsupported critical payload was included. If the critical flag is 792 not set and the payload type is unsupported, that payload MUST be 793 ignored. 795 While new payload types may be added in the future and may appear 796 interleaved with the fields defined in this specification, 797 implementations MUST send the payloads defined in this specification 798 in the order shown in the figures in section 2 and implementations 799 SHOULD reject as invalid a message with those payloads in any other 800 order. 802 2.6 Cookies 804 The term "cookies" originates with Karn and Simpson [RFC 2522] in 805 Photuris, an early proposal for key management with IPsec. It has 806 persisted because the IETF has never rejected a proposal involving 807 cookies. The ISAKMP fixed message header includes two eight octet 808 fields titled "cookies", and that syntax is used by both IKEv1 and 809 IKEv2 though in IKEv2 they are referred to as the IKE SPI and there 810 is a new separate field in a Notify payload holding the cookie. The 811 initial two eight octet fields in the header are used as a connection 812 identifier at the beginning of IKE packets. Each endpoint chooses one 813 of the two SPIs and SHOULD choose them so as to be unique identifiers 814 of an IKE_SA. An SPI value of zero is special and indicates that the 815 remote SPI value is not yet known by the sender. 817 Unlike ESP and AH where only the recipient's SPI appears in the 818 header of a message, in IKE the sender's SPI is also sent in every 819 message. Since the SPI chosen by the original initiator of the IKE_SA 820 is always sent first, an endpoint with multiple IKE_SAs open that 821 wants to find the appropriate IKE_SA using the SPI it assigned must 822 look at the I(nitiator) Flag bit in the header to determine whether 823 it assigned the first or the second eight octets. 825 In the first message of an initial IKE exchange, the initiator will 826 not know the responder's SPI value and will therefore set that field 827 to zero. 829 An expected attack against IKE is state and CPU exhaustion, where the 830 target is flooded with session initiation requests from forged IP 831 addresses. This attack can be made less effective if an 832 implementation of a responder uses minimal CPU and commits no state 833 to an SA until it knows the initiator can receive packets at the 834 address from which he claims to be sending them. To accomplish this, 835 a responder SHOULD - when it detects a large number of half-open 836 IKE_SAs - reject initial IKE messages unless they contain a Notify 837 payload of type COOKIE. It SHOULD instead send an unprotected IKE 838 message as a response and include COOKIE Notify payload with the 839 cookie data to be returned. Initiators who receive such responses 840 MUST retry the IKE_SA_INIT with a Notify payload of type COOKIE 841 containing the responder supplied cookie data as the first payload 842 and all other payloads unchanged. The initial exchange will then be 843 as follows: 845 Initiator Responder 846 ----------- ----------- 847 HDR(A,0), SAi1, KEi, Ni --> 849 <-- HDR(A,0), N(COOKIE) 851 HDR(A,0), N(COOKIE), SAi1, KEi, Ni --> 853 <-- HDR(A,B), SAr1, KEr, Nr, [CERTREQ] 855 HDR(A,B), SK {IDi, [CERT,] [CERTREQ,] [IDr,] 856 AUTH, SAi2, TSi, TSr} --> 858 <-- HDR(A,B), SK {IDr, [CERT,] AUTH, 859 SAr2, TSi, TSr} 861 The first two messages do not affect any initiator or responder state 862 except for communicating the cookie. In particular, the message 863 sequence numbers in the first four messages will all be zero and the 864 message sequence numbers in the last two messages will be one. 'A' is 865 the SPI assigned by the initiator, while 'B' is the SPI assigned by 866 the responder. 868 An IKE implementation SHOULD implement its responder cookie 869 generation in such a way as to not require any saved state to 870 recognize its valid cookie when the second IKE_SA_INIT message 871 arrives. The exact algorithms and syntax they use to generate 872 cookies does not affect interoperability and hence is not specified 873 here. The following is an example of how an endpoint could use 874 cookies to implement limited DOS protection. 876 A good way to do this is to set the responder cookie to be: 878 Cookie = | Hash(Ni | IPi | SPIi | ) 880 where is a randomly generated secret known only to the 881 responder and periodically changed. should be 882 changed whenever is regenerated. The cookie can be 883 recomputed when the IKE_SA_INIT arrives the second time and compared 884 to the cookie in the received message. If it matches, the responder 885 knows that SPIr was generated since the last change to and 886 that IPi must be the same as the source address it saw the first 887 time. Incorporating SPIi into the calculation assures that if 888 multiple IKE_SAs are being set up in parallel they will all get 889 different cookies (assuming the initiator chooses unique SPIi's). 890 Incorporating Ni into the hash assures that an attacker who sees only 891 message 2 can't successfully forge a message 3. 893 If a new value for is chosen while there are connections in 894 the process of being initialized, an IKE_SA_INIT might be returned 895 with other than the current . The responder in 896 that case MAY reject the message by sending another response with a 897 new cookie or it MAY keep the old value of around for a 898 short time and accept cookies computed from either one. The 899 responder SHOULD NOT accept cookies indefinitely after is 900 changed, since that would defeat part of the denial of service 901 protection. The responder SHOULD change the value of 902 frequently, especially if under attack. 904 2.7 Cryptographic Algorithm Negotiation 906 The payload type known as "SA" indicates a proposal for a set of 907 choices of protocols (IKE, ESP, and/or AH) for the SA as well as 908 cryptographic algorithms associated with each protocol. 910 An SA consists of one or more proposals. Each proposal includes one 911 or more protocols (usually one). Each protocol contains one or more 912 transforms - each specifying a cryptographic algorithm. Each 913 transform contains zero or more attributes (attributes are only 914 needed if the transform identifier does not completely specify the 915 cryptographic algorithm). 917 This hierarchical structure was designed to be able to efficiently 918 encode proposals for cryptographic suites when the number of 919 supported suites is large because multiple values are acceptable for 920 multiple transforms. The responder MUST choose a single suite, which 921 MAY be any subset of the SA proposal following the rules below: 923 Each proposal contains one or more protocols. If a proposal is 924 accepted, the SA response MUST contain the same protocols in the 925 same order as the proposal. At most one proposal MAY be accepted. 926 (Example: if a single proposal contains ESP and AH and that 927 proposal is accepted, both ESP and AH MUST be accepted. If ESP and 928 AH are included in separate proposals, only one of them MAY be 929 accepted). 931 Each protocol in a proposal contains one or more transforms. Each 932 transform contains a transform type. The accepted cryptographic 933 suite MUST contain exactly one transform of each type included in 934 the proposal. For example: if an ESP proposal includes transforms 935 ENCR_3DES, ENCR_AES w/keysize 128, ENCR_AES w/keysize 256, 936 AUTH_HMAC_MD5, and AUTH_HMAC_SHA, the accepted suite MUST contain 937 one of the ENCR_ transforms and one of the AUTH_ transforms. Thus 938 six combinations are acceptable). 940 Since Alice sends her Diffie-Hellman value in the IKE_SA_INIT, she 941 must guess at the Diffie-Hellman group that Bob will select from her 942 list of supported groups. If she guesses wrong, Bob will respond 943 with a Notify payload of type INVALID_KE_PAYLOAD indicating the 944 selected group. In this case, Alice MUST retry the IKE_SA_INIT with 945 the corrected Diffie-Hellman group. Alice MUST again propose her full 946 set of acceptable cryptographic suites because the rejection message 947 was unauthenticated and otherwise an active attacker could trick 948 Alice and Bob into negotiating a weaker suite than a stronger one 949 that they both prefer. 951 2.8 Rekeying 953 IKE, ESP, and AH security associations use secret keys which SHOULD 954 only be used for a limited amount of time and to protect a limited 955 amount of data. This limits the lifetime of the entire security 956 association. When the lifetime of a security association expires the 957 security association must not be used. If there is demand, new 958 security associations MAY be established. Reestablishment of 959 security associations to take the place of ones which expire is 960 referred to as "rekeying". 962 To allow for minimal IPsec implementations, the ability to rekey SAs 963 without restarting the entire IKE_SA is optional. An implementation 964 MAY refuse all CREATE_CHILD_SA requests within an IKE_SA. If an SA 965 has expired or is about to expire and rekeying attempts using the 966 mechanisms described here fail, an implementation MUST close the 967 IKE_SA and any associated CHILD_SAs and then MAY start new ones. 968 Implementations SHOULD support in place rekeying of SAs, since doing 969 so offers better performance and is likely to reduce the number of 970 packets lost during the transition. 972 To rekey a CHILD_SA within an existing IKE_SA, create a new, 973 equivalent SA (see section 2.17 below), and when the new one is 974 established, delete the old one. To rekey an IKE_SA, establish a new 975 equivalent IKE_SA (see section 2.18 below) with the peer to whom the 976 old IKE_SA is shared using a CREATE_CHILD_SA within the existing 977 IKE_SA. An IKE_SA so created inherits all of the original IKE_SA's 978 CHILD_SAs. Use the new IKE_SA for all control messages needed to 979 maintain the CHILD_SAs created by the old IKE_SA, and delete the old 980 IKE_SA. The Delete payload to delete itself MUST be the last request 981 sent over an IKE_SA. 983 SAs SHOULD be rekeyed proactively, i.e., the new SA should be 984 established before the old one expires and becomes unusable. Enough 985 time should elapse between the time the new SA is established and the 986 old one becomes unusable so that traffic can be switched over to the 987 new SA. 989 A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes 990 were negotiated. In IKEv2, each end of the SA is responsible for 991 enforcing its own lifetime policy on the SA and rekeying the SA when 992 necessary. If the two ends have different lifetime policies, the end 993 with the shorter lifetime will end up always being the one to request 994 the rekeying. If an SA bundle has been inactive for a long time and 995 if an endpoint would not initiate the SA in the absence of traffic, 996 the endpoint MAY choose to close the SA instead of rekeying it when 997 its lifetime expires. It SHOULD do so if there has been no traffic 998 since the last time the SA was rekeyed. 1000 If the two ends have the same lifetime policies, it is possible that 1001 both will initiate a rekeying at the same time (which will result in 1002 redundant SAs). To reduce the probability of this happening, the 1003 timing of rekeying requests SHOULD be jittered (delayed by a random 1004 amount of time after the need for rekeying is noticed). 1006 This form of rekeying may temporarily result in multiple similar SAs 1007 between the same pairs of nodes. When there are two SAs eligible to 1008 receive packets, a node MUST accept incoming packets through either 1009 SA. If redundant SAs are created though such a collision, the SA 1010 created with the lowest of the four nonces used in the two exchanges 1011 SHOULD be closed by the endpoint that created it. 1013 The node that initiated the surviving rekeyed SA SHOULD delete the 1014 replaced SA after the new one is established. 1016 There are timing windows - particularly in the presence of lost 1017 packets - where endpoints may not agree on the state of an SA. The 1018 responder to a CREATE_CHILD_SA MUST be prepared to accept messages on 1019 an SA before sending its response to the creation request, so there 1020 is no ambiguity for the initiator. The initiator may begin sending on 1021 an SA as soon as it processes the response. The initiator, however, 1022 cannot receive on a newly created SA until it receives and processes 1023 the response to its CREATE_CHILD_SA request. How, then, is the 1024 responder to know when it is OK to send on the newly created SA? 1026 From a technical correctness and interoperability perspective, the 1027 responder MAY begin sending on an SA as soon as it sends its response 1028 to the CREATE_CHILD_SA request. In some situations, however, this 1029 could result in packets unnecessarily being dropped, so an 1030 implementation MAY want to defer such sending. 1032 The responder can be assured that the initiator is prepared to 1033 receive messages on an SA if either (1) it has received a 1034 cryptographically valid message on the new SA, or (2) the new SA 1035 rekeys an existing SA and it receives an IKE request to close the 1036 replaced SA. When rekeying an SA, the responder SHOULD continue to 1037 send requests on the old SA until it one of those events occurs. When 1038 establishing a new SA, the responder MAY defer sending messages on a 1039 new SA until either it receives one or a timeout has occurred. If an 1040 initiator receives a message on an SA for which it has not received a 1041 response to its CREATE_CHILD_SA request, it SHOULD interpret that as 1042 a likely packet loss and retransmit the CREATE_CHILD_SA request. An 1043 initiator MAY send a dummy message on a newly created SA if it has no 1044 messages queued in order to assure the responder that the initiator 1045 is ready to receive messages. 1047 2.9 Traffic Selector Negotiation 1049 When an IP packet is received by an RFC2401 compliant IPsec subsystem 1050 and matches a "protect" selector in its SPD, the subsystem MUST 1051 protect that packet with IPsec. When no SA exists yet it is the task 1052 of IKE to create it. Maintenance of a system's SPD is outside the 1053 scope of IKE (see [PFKEY] for an example protocol), though some 1054 implementations might update their SPD in connection with the running 1055 of IKE (for an example scenario, see section 1.1.3). 1057 Traffic Selector (TS) payloads allow endpoints to communicate some of 1058 the information from their SPD to their peers. TS payloads specify 1059 the selection criteria for packets that will be forwarded over the 1060 newly set up SA. This can serve as a consistency check in some 1061 scenarios to assure that the SPDs are consistent. In others, it 1062 guides the dynamic update of the SPD. 1064 Two TS payloads appear in each of the messages in the exchange that 1065 creates a CHILD_SA pair. Each TS payload contains one or more Traffic 1066 Selectors. Each Traffic Selector consists of an address range (IPv4 1067 or IPv6), a port range, and a protocol ID. In support of the scenario 1068 described in section 1.1.3, an initiator may request that the 1069 responder assign an IP address and tell the initiator what it is. 1071 IKEv2 allows the responder to choose a subset of the traffic proposed 1072 by the initiator. This could happen when the configuration of the 1073 two endpoints are being updated but only one end has received the new 1074 information. Since the two endpoints may be configured by different 1075 people, the incompatibility may persist for an extended period even 1076 in the absence of errors. It also allows for intentionally different 1077 configurations, as when one end is configured to tunnel all addresses 1078 and depends on the other end to have the up to date list. 1080 The first of the two TS payloads is known as TSi (Traffic Selector- 1081 initiator). The second is known as TSr (Traffic Selector-responder). 1082 TSi specifies the source address of traffic forwarded from (or the 1083 destination address of traffic forwarded to) the initiator of the 1084 CHILD_SA pair. TSr specifies the destination address of the traffic 1085 forwarded from (or the source address of the traffic forwarded to) 1086 the responder of the CHILD_SA pair. For example, if Alice initiates 1087 the creation of the CHILD_SA pair from Alice to Bob, and wishes to 1088 tunnel all traffic from subnet 10.2.16.* on Alice's side to subnet 1089 18.16.*.* on Bob's side, Alice would include a single traffic 1090 selector in each TS payload. TSi would specify the address range 1091 (10.2.16.0 - 10.2.16.255) and TSr would specify the address range 1092 (18.16.0.0 - 18.16.255.255). Assuming that proposal was acceptable to 1093 Bob, he would send identical TS payloads back. 1095 The Responder is allowed to narrow the choices by selecting a subset 1096 of the traffic, for instance by eliminating or narrowing the range of 1097 one or more members of the set of traffic selectors, provided the set 1098 does not become the NULL set. 1100 It is possible for the Responder's policy to contain multiple smaller 1101 ranges, all encompassed by the Initiator's traffic selector, and with 1102 the Responder's policy being that each of those ranges should be sent 1103 over a different SA. Continuing the example above, Bob might have a 1104 policy of being willing to tunnel those addresses to and from Alice, 1105 but might require that each address pair be on a separately 1106 negotiated CHILD_SA. If Alice generated her request in response to an 1107 incoming packet from 10.2.16.43 to 18.16.2.123, there would be no way 1108 for Bob to determine which pair of addresses should be included in 1109 this tunnel, and he would have to make his best guess or reject the 1110 request with a status of SINGLE_PAIR_REQUIRED. 1112 To enable Bob to choose the appropriate range in this case, if Alice 1113 has initiated the SA due to a data packet, Alice SHOULD include as 1114 the first traffic selector in each of TSi and TSr a very specific 1115 traffic selector including the addresses in the packet triggering the 1116 request. In the example, Alice would include in TSi two traffic 1117 selectors: the first containing the address range (10.2.16.43 - 1118 10.2.16.43) and the source port and protocol from the packet and the 1119 second containing (10.2.16.0 - 10.2.16.255) with all ports and 1120 protocols. She would similarly include two traffic selectors in TSr. 1122 If Bob's policy does not allow him to accept the entire set of 1123 traffic selectors in Alice's request, but does allow him to accept 1124 the first selector of TSi and TSr, then Bob MUST narrow the traffic 1125 selectors to a subset that includes Alice's first choices. In this 1126 example, Bob might respond with TSi being (10.2.16.43 - 10.2.16.43) 1127 with all ports and protocols. 1129 If Alice creates the CHILD_SA pair not in response to an arriving 1130 packet, but rather - say - upon startup, then there may be no 1131 specific addresses Alice prefers for the initial tunnel over any 1132 other. In that case, the first values in TSi and TSr MAY be ranges 1133 rather than specific values, and Bob chooses a subset of Alice's TSi 1134 and TSr that are acceptable to him. If more than one subset is 1135 acceptable but their union is not, Bob MUST accept some subset and 1136 MAY include a Notify payload of type ADDITIONAL_TS_POSSIBLE to 1137 indicate that Alice might want to try again. This case will only 1138 occur when Alice and Bob are configured differently from one another. 1139 If Alice and Bob agree on the granularity of tunnels, she will never 1140 request a tunnel wider than Bob will accept. 1142 2.10 Nonces 1144 The IKE_SA_INIT messages each contain a nonce. These nonces are used 1145 as inputs to cryptographic functions. The CREATE_CHILD_SA request 1146 and the CREATE_CHILD_SA response also contain nonces. These nonces 1147 are used to add freshness to the key derivation technique used to 1148 obtain keys for CHILD_SA, and to extract strong pseudorandom bits 1149 from the Diffie-Hellman key. Nonces used in IKEv2 MUST be randomly 1150 chosen, MUST be at least 128 bits in size, and MUST be at least half 1151 the key size of the negotiated prf. If the same random number source 1152 is used for both keys and nonces, care must be taken to ensure that 1153 the latter use does not compromise the former. 1155 2.11 Address and Port Agility 1157 IKE runs over UDP ports 500 and 4500, and implicitly sets up ESP and 1158 AH associations for the same IP addresses it runs over. The IP 1159 addresses and ports in the outer header are, however, not themselves 1160 cryptographically protected, and IKE is designed to work even through 1161 Network Address Translation (NAT) boxes. An implementation MUST 1162 accept incoming requests even if not received from UDP port 500 or 1163 4500, and MUST respond to the address and port from which the request 1164 was received, and from the address and port at which the request was 1165 received. IKE functions identically over IPv4 or IPv6. 1167 2.12 Reuse of Diffie-Hellman Exponentials 1169 IKE generates keying material using an ephemeral Diffie-Hellman 1170 exchange in order to gain the property of "perfect forward secrecy". 1171 This means that once a connection is closed and its corresponding 1172 keys are forgotten, even someone who has recorded all of the data 1173 from the connection and gets access to all of the long term keys of 1174 the two endpoints cannot reconstruct the keys used to protect the 1175 conversation. 1177 Achieving perfect forward secrecy requires that when a connection is 1178 closed, each endpoint MUST forget not only the keys used by the 1179 connection but any information that could be used to recompute those 1180 keys. In particular, it MUST forget the secrets used in the Diffie- 1181 Hellman calculation and any state that may persist in the state of a 1182 pseudo-random number generator that could be used to recompute the 1183 Diffie-Hellman secrets. 1185 Since the computing of Diffie-Hellman exponentials is computationally 1186 expensive, an endpoint may find it advantageous to reuse those 1187 exponentials for multiple connection setups. There are several 1188 reasonable strategies for doing this. An endpoint could choose a new 1189 exponential only periodically though this could result in less-than- 1190 perfect forward secrecy if some connection lasts for less than the 1191 lifetime of the exponential. Or it could keep track of which 1192 exponential was used for each connection and delete the information 1193 associated with the exponential only when some corresponding 1194 connection was closed. This would allow the exponential to be reused 1195 without losing perfect forward secrecy at the cost of maintaining 1196 more state. 1198 Decisions as to whether and when to reuse Diffie-Hellman exponentials 1199 is a private decision in the sense that it will not affect 1200 interoperability. An implementation that reuses exponentials MAY 1201 choose to remember the exponential used by the other endpoint on past 1202 exchanges and if one is reused to avoid the second half of the 1203 calculation. 1205 2.13 Generating Keying Material 1207 In the context of the IKE_SA, four cryptographic algorithms are 1208 negotiated: an encryption algorithm, an integrity protection 1209 algorithm, a Diffie-Hellman group, and a pseudo-random function 1210 (prf). The pseudo-random function is used for the construction of 1211 keying material for all of the cryptographic algorithms used in both 1212 the IKE_SA and the CHILD_SAs. 1214 We assume that each encryption algorithm and integrity protection 1215 algorithm uses a fixed size key, and that any randomly chosen value 1216 of that fixed size can serve as an appropriate key. For algorithms 1217 that accept a variable length key, a fixed key size MUST be specified 1218 as part of the cryptographic transform negotiated. For integrity 1219 protection functions based on HMAC, the fixed key size is the size of 1220 the output of the underlying hash function. When the prf function 1221 takes a variable length key, variable length data, and produces a 1222 fixed length output (e.g., when using HMAC), the formulas in this 1223 document apply. When the key for the prf function has fixed length, 1224 the data provided as a key is truncated or padded with zeros as 1225 necessary unless exceptional processing is explained following the 1226 formula. 1228 Keying material will always be derived as the output of the 1229 negotiated prf algorithm. Since the amount of keying material needed 1230 may be greater than the size of the output of the prf algorithm, we 1231 will use the prf iteratively. We will use the terminology prf+ to 1232 describe the function that outputs a pseudo-random stream based on 1233 the inputs to a prf as follows: (where | indicates concatenation) 1235 prf+ (K,S) = T1 | T2 | T3 | T4 | ... 1237 where: 1239 T1 = prf (K, S | 0x01) 1240 T2 = prf (K, T1 | S | 0x02) 1241 T3 = prf (K, T2 | S | 0x03) 1242 T4 = prf (K, T3 | S | 0x04) 1244 continuing as needed to compute all required keys. The keys are taken 1245 from the output string without regard to boundaries (e.g., if the 1246 required keys are a 256 bit AES key and a 160 bit HMAC key, and the 1247 prf function generates 160 bits, the AES key will come from T1 and 1248 the beginning of T2, while the HMAC key will come from the rest of T2 1249 and the beginning of T3). 1251 The constant concatenated to the end of each string feeding the prf 1252 is a single octet. prf+ in this document is not defined beyond 255 1253 times the size of the prf output. 1255 2.14 Generating Keying Material for the IKE_SA 1257 The shared keys are computed as follows. A quantity called SKEYSEED 1258 is calculated from the nonces exchanged during the IKE_SA_INIT 1259 exchange and the Diffie-Hellman shared secret established during that 1260 exchange. SKEYSEED is used to calculate five other secrets: SK_d 1261 used for deriving new keys for the CHILD_SAs established with this 1262 IKE_SA; SK_ai and SK_ar used as a key to the integrity protection 1263 algorithm for authenticating the component messages of subsequent 1264 exchanges; and SK_ei and SK_er used for encrypting (and of course 1265 decrypting) all subsequent exchanges. SKEYSEED and its derivatives 1266 are computed as follows: 1268 SKEYSEED = prf(Ni | Nr, g^ir) 1270 {SK_d | SK_ai | SK_ar | SK_ei | SK_er} 1271 = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr ) 1273 (indicating that the quantities SK_d, SK_ai, SK_ar, SK_ei, and SK_er 1274 are taken in order from the generated bits of the prf+). g^ir is the 1275 shared secret from the ephemeral Diffie-Hellman exchange. g^ir is 1276 represented as a string of octets in big endian order padded with 1277 zeros if necessary to make it the length of the modulus. Ni and Nr 1278 are the nonces, stripped of any headers. If the negotiated prf takes 1279 a fixed length key and the lengths of Ni and Nr do not add up to that 1280 length, half the bits must come from Ni and half from Nr, taking the 1281 first bits of each. 1283 The two directions of flow use different keys. The keys used to 1284 protect messages from the original initiator are SK_ai and SK_ei. The 1285 keys used to protect messages in the other direction are SK_ar and 1286 SK_er. Each algorithm takes a fixed number of bits of keying 1287 material, which is specified as part of the algorithm. For integrity 1288 algorithms based on HMAC, the key size is always equal to the length 1289 of the output of the underlying hash function. 1291 2.15 Authentication of the IKE_SA 1293 When not using extended authentication (see section 2.16), the peers 1294 are authenticated by having each sign (or MAC using a shared secret 1295 as the key) a block of data. For the responder, the octets to be 1296 signed start with the first octet of the first SPI in the header of 1297 the second message and end with the last octet of the last payload in 1298 the second message. Appended to this (for purposes of computing the 1299 signature) are the initiator's nonce Ni (just the value, not the 1300 payload containing it), and the value prf(SK_ar,IDr') where IDr' is 1301 the responder's ID payload excluding the fixed header. Note that 1302 neither the nonce Ni nor the value prf(SK_ar,IDr') are transmitted. 1303 Similarly, the initiator signs the first message, starting with the 1304 first octet of the first SPI in the header and ending with the last 1305 octet of the last payload. Appended to this (for purposes of 1306 computing the signature) are the responder's nonce Nr, and the value 1307 prf(SK_ai,IDi'). In the above calculation, IDi' and IDr' are the 1308 entire ID payloads excluding the fixed header. It is critical to the 1309 security of the exchange that each side sign the other side's nonce 1310 (see [SIGMA]). 1312 Note that all of the payloads are included under the signature, 1313 including any payload types not defined in this document. If the 1314 first message of the exchange is sent twice (the second time with a 1315 responder cookie and/or a different Diffie-Hellman group), it is the 1316 second version of the message that is signed. 1318 Optionally, messages 3 and 4 MAY include a certificate, or 1319 certificate chain providing evidence that the key used to compute a 1320 digital signature belongs to the name in the ID payload. The 1321 signature or MAC will be computed using algorithms dictated by the 1322 type of key used by the signer, and specified by the Auth Method 1323 field in the Authentication payload. There is no requirement that 1324 the Initiator and Responder sign with the same cryptographic 1325 algorithms. The choice of cryptographic algorithms depends on the 1326 type of key each has. In particular, the initiator may be using a 1327 shared key while the responder may have a public signature key and 1328 certificate. It will commonly be the case (but it is not required) 1329 that if a shared secret is used for authentication that the same key 1330 is used in both directions. Note that it is a common but typically 1331 insecure practice to have a shared key derived solely from a user 1332 chosen password without incorporating another source of randomness. 1333 This is typically insecure because user chosen passwords are unlikely 1334 to have sufficient unpredictability to resist dictionary attacks and 1335 these attacks are not prevented in this authentication method. 1336 (Applications using password-based authentication for bootstrapping 1337 and IKE_SA should use the authentication method in section 2.16, 1338 which is designed to prevent off-line dictionary attacks). The pre- 1339 shared key SHOULD contain as much unpredictability as the strongest 1340 key being negotiated. In the case of a pre-shared key, the AUTH 1341 value is computed as: 1343 AUTH = prf(prf(Shared Secret,"Key Pad for IKEv2"), ) 1346 where the string "Key Pad for IKEv2" is ASCII encoded and not null 1347 terminated. The shared secret can be variable length. The pad string 1348 is added so that if the shared secret is derived from a password, the 1349 IKE implementation need not store the password in cleartext, but 1350 rather can store the value prf(Shared Secret,"Key Pad for IKEv2"), 1351 which could not be used as a password equivalent for protocols other 1352 than IKEv2. As noted above, deriving the shared secret from a 1353 password is not secure. This construction is used because it is 1354 anticipated that people will do it anyway. The management interface 1355 by which the Shared Secret is provided MUST accept ASCII strings of 1356 at least 64 octets and MUST NOT add a null terminator before using 1357 them as shared secrets. The management interface MAY accept other 1358 forms, like hex encoding. If the negotiated prf takes a fixed size 1359 key, the shared secret MUST be of that fixed size. 1361 2.16 Extended Authentication Protocol Methods 1363 In addition to authentication using public key signatures and shared 1364 secrets, IKE supports authentication using methods defined in RFC 1365 2284 [EAP]. Typically, these methods are asymmetric (designed for a 1366 user authenticating to a server), and they may not be mutual. For 1367 this reason, these protocols are typically used to authenticate the 1368 initiator to the responder and are used in addition to a public key 1369 signature based authentication of the responder to the initiator. 1370 These methods are also referred to as "Legacy Authentication" 1371 mechanisms. 1373 While this memo references [EAP] with the intent that new methods can 1374 be added in the future without updating this specification, the 1375 protocols expected to be used most commonly are fully documented here 1376 and in section 3.16. [EAP] defines an authentication protocol 1377 requiring a variable number of messages. Extended Authentication is 1378 implemented in IKE as additional IKE_AUTH exchanges that MUST be 1379 completed in order to initialize the IKE_SA. 1381 An initiator indicates a desire to use extended authentication by 1382 leaving out the AUTH payload from message 3. By including an IDi 1383 payload but not an AUTH payload, the initiator has declared an 1384 identity but has not proven it. If the responder is willing to use an 1385 extended authentication method, it will place an EAP payload in 1386 message 4 and defer sending SAr2, TSi, and TSr until initiator 1387 authentication is complete in a subsequent IKE_AUTH exchange. In the 1388 case of a minimal extended authentication, the initial SA 1389 establishment will appear as follows: 1391 Initiator Responder 1392 ----------- ----------- 1393 HDR, SAi1, KEi, Ni --> 1395 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 1397 HDR, SK {IDi, [CERTREQ,] [IDr,] 1398 SAi2, TSi, TSr} --> 1400 <-- HDR, SK {IDr, [CERT,] AUTH, 1401 EAP } 1403 HDR, SK {EAP, [AUTH] } --> 1405 <-- HDR, SK {EAP, [AUTH], 1406 SAr2, TSi, TSr } 1408 For EAP methods that create a shared key as a side effect of 1409 authentication, that shared key MUST be used by both the Initiator 1410 and Responder to generate an AUTH payload using the syntax for shared 1411 secrets specified in section 2.15. The shared key generated during an 1412 IKE exchange MUST NOT be used for any other purpose. For EAP methods 1413 that do not establish a shared key, there will be no AUTH payloads in 1414 the final messages. 1416 The Initiator of an IKE_SA using EAP SHOULD be capable of extending 1417 the initial protocol exchange to at least ten IKE_AUTH exchanges in 1418 the event the Responder sends notification messages and/or retries 1419 the authentication prompt. The protocol terminates when the Responder 1420 sends the Initiator an EAP payload containing either a success or 1421 failure type. 1423 2.17 Generating Keying Material for CHILD_SAs 1425 CHILD_SAs are created either by being piggybacked on the IKE_AUTH 1426 exchange, or in a CREATE_CHILD_SA exchange. Keying material for them 1427 is generated as follows: 1429 KEYMAT = prf+(SK_d, Ni | Nr) 1431 Where Ni and Nr are the Nonces from the IKE_SA_INIT exchange if this 1432 request is the first CHILD_SA created or the fresh Ni and Nr from the 1433 CREATE_CHILD_SA exchange if this is a subsequent creation. 1435 For CREATE_CHILD_SA exchanges with PFS the keying material is defined 1436 as: 1438 KEYMAT = prf+(SK_d, g^ir (new) | Ni | Nr ) 1440 where g^ir (new) is the shared secret from the ephemeral Diffie- 1441 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 1442 octet string in big endian order padded with zeros if necessary to 1443 make it the length of the modulus), 1445 A single CHILD_SA negotiation may result in multiple security 1446 associations. ESP and AH SAs exist in pairs (one in each direction), 1447 and four SAs could be created in a single CHILD_SA negotiation if a 1448 combination of ESP and AH is being negotiated. 1450 Keying material is taken from the expanded KEYMAT in the following 1451 order: 1453 All keys for SAs carrying data from the initiator to the responder 1454 are taken before SAs going in the reverse direction. 1456 If multiple protocols are negotiated, keying material is taken in 1457 the order in which the protocol headers will appear in the 1458 encapsulated packet. 1460 If a single protocol has both encryption and authentication keys, 1461 the encryption key is taken from the first octets of KEYMAT and 1462 the authentication key is taken from the next octets. 1464 Each cryptographic algorithm takes a fixed number of bits of keying 1465 material specified as part of the algorithm. 1467 2.18 Rekeying IKE_SAs using a CREATE_CHILD_SA exchange 1469 The CREATE_CHILD_SA exchange can be used to re-key an existing IKE_SA 1470 (see section 2.8). New Initiator and Responder SPIs are supplied in 1471 the SPI fields. The TS payloads are omitted when rekeying an IKE_SA. 1472 SKEYSEED for the new IKE_SA is computed using SK_d from the existing 1473 IKE_SA as follows: 1475 SKEYSEED = prf(SK_d (old), [g^ir (new)] | Ni | Nr) 1477 where g^ir (new) is the shared secret from the ephemeral Diffie- 1478 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 1479 octet string in big endian order padded with zeros if necessary to 1480 make it the length of the modulus) and Ni and Nr are the two nonces 1481 stripped of any headers. 1483 The new IKE_SA MUST reset its message counters to 0. 1485 SK_d, SK_ai, SK_ar, and SK_ei, and SK_er are computed from SKEYSEED 1486 as specified in section 2.14. 1488 2.19 Requesting an internal address on a remote network 1490 Most commonly occurring in the endpoint to security gateway scenario, 1491 an endpoint may need an IP address in the network protected by the 1492 security gateway, and may need to have that address dynamically 1493 assigned. A request for such a temporary address can be included in 1494 any request to create a CHILD_SA (including the implicit request in 1495 message 3) by including a CP payload. 1497 This function provides address allocation to an IRAC (IPsec Remote 1498 Access Client) trying to tunnel into a network protected by an IRAS 1499 (IPsec Remote Access Server). Since the IKE_AUTH exchange creates an 1500 IKE_SA and a CHILD_SA, the IRAC MUST request the IRAS controlled 1501 address (and optionally other information concerning the protected 1502 network) in the IKE_AUTH exchange. The IRAS may procure an address 1503 for the IRAC from any number of sources such as a DHCP/BOOTP server 1504 or its own address pool. 1506 Initiator Responder 1507 ----------------------------- --------------------------- 1508 HDR, SK {IDi, [CERT,] [CERTREQ,] 1509 [IDr,] AUTH, CP(CFG_REQUEST), 1510 SAi2, TSi, TSr} --> 1512 <-- HDR, SK {IDr, [CERT,] AUTH, 1513 CP(CFG_REPLY), SAr2, 1514 TSi, TSr} 1516 In all cases, the CP payload MUST be inserted before the SA payload. 1517 In variations of the protocol where there are multiple IKE_AUTH 1518 exchanges, the CP payloads MUST be inserted in the messages 1519 containing the SA payloads. 1521 CP(CFG_REQUEST) MUST contain at least an INTERNAL_ADDRESS attribute 1522 (either IPv4 or IPv6) but MAY contain any number of additional 1523 attributes the initiator wants returned in the response. 1525 For example, message from Initiator to Responder: 1526 CP(CFG_REQUEST)= 1527 INTERNAL_ADDRESS(0.0.0.0) 1528 INTERNAL_NETMASK(0.0.0.0) 1529 INTERNAL_DNS(0.0.0.0) 1530 TSi = (0, 0-65536,0.0.0.0-255.255.255.255) 1531 TSr = (0, 0-65536,0.0.0.0-255.255.255.255) 1533 NOTE: Traffic Selectors are a (protocol, port range, address range) 1535 Message from Responder to Initiator: 1537 CP(CFG_REPLY)= 1538 INTERNAL_ADDRESS(192.168.219.202) 1539 INTERNAL_NETMASK(255.255.255.0) 1540 INTERNAL_SUBNET(192.168.219.0/255.255.255.0) 1541 TSi = (0, 0-65536,192.168.219.202-192.168.219.202) 1542 TSr = (0, 0-65536,192.168.219.0-192.168.219.255) 1544 All returned values will be implementation dependent. As can be seen 1545 in the above example, the IRAS MAY also send other attributes that 1546 were not included in CP(CFG_REQUEST) and MAY ignore the non- 1547 mandatory attributes that it does not support. 1549 The responder MUST not send a CFG_REPLY without having first received 1550 a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS 1551 to perform an unnecessary configuration lookup if the IRAC cannot 1552 process the REPLY. In the case where the IRAS's configuration 1553 requires that CP be used for a given identity IDi, but IRAC has 1554 failed to send a CP(CFG_REQUEST), IRAS MUST fail the request, and 1555 terminate the IKE exchange with a FAILED_CP_REQUIRED error. 1557 2.20 Requesting the Peer's Version 1559 An IKE peer wishing to inquire about the other peer's IKE software 1560 version information MAY use the method below. This is an example of 1561 a configuration request within an INFORMATIONAL Exchange, after the 1562 IKE_SA and first CHILD_SA have been created. 1564 An IKE implementation MAY decline to give out version information 1565 prior to authentication or even after authentication to prevent 1566 trolling in case some implementation is known to have some security 1567 weakness. In that case, it MUST either return an empty string or no 1568 CP payload if CP is not supported. 1570 Initiator Responder 1571 ----------------------------- -------------------------- 1572 HDR, SK{CP(CFG_REQUEST)} --> 1573 <-- HDR, SK{CP(CFG_REPLY)} 1575 CP(CFG_REQUEST)= 1576 APPLICATION_VERSION("") 1578 CP(CFG_REPLY) 1579 APPLICATION_VERSION("foobar v1.3beta, (c) Foo Bar Inc.") 1581 2.21 Error Handling 1583 There are many kinds of errors that can occur during IKE processing. 1584 If a request is received that is badly formatted or unacceptable for 1585 reasons of policy (e.g., no matching cryptographic algorithms), the 1586 response MUST contain a Notify payload indicating the error. If an 1587 error occurs outside the context of an IKE request (e.g., the node is 1588 getting ESP messages on a nonexistent SPI), the node SHOULD initiate 1589 an INFORMATIONAL Exchange with a Notify payload describing the 1590 problem. 1592 Errors that occur before a cryptographically protected IKE_SA is 1593 established must be handled very carefully. There is a trade-off 1594 between wanting to be helpful in diagnosing a problem and responding 1595 to it and wanting to avoid being a dupe in a denial of service attack 1596 based on forged messages. 1598 If a node receives a message on UDP port 500 outside the context of 1599 an IKE_SA known to it (and not a request to start one), it may be the 1600 result of a recent crash of the node. If the message is marked as a 1601 response, the node MAY audit the suspicious event but MUST NOT 1602 respond. If the message is marked as a request, the node MAY audit 1603 the suspicious event and MAY send a response. If a response is sent, 1604 the response MUST be sent to the IP address and port from whence it 1605 came with the same IKE SPIs and the Message ID copied. The response 1606 MUST NOT be cryptographically protected and MUST contain a Notify 1607 payload indicating INVALID_IKE_SPI. 1609 A node receiving such an unprotected Notify payload MUST NOT respond 1610 and MUST NOT change the state of any existing SAs. The message might 1611 be a forgery or might be a response the genuine correspondent was 1612 tricked into sending. A node SHOULD treat such a message (and also a 1613 network message like ICMP destination unreachable) as a hint that 1614 there might be problems with SAs to that IP address and SHOULD 1615 initiate a liveness test for any such IKE_SA. An implementation 1616 SHOULD limit the frequency of such tests to avoid being tricked into 1617 participating in a denial of service attack. 1619 A node receiving a suspicious message from an IP address with which 1620 it has an IKE_SA MAY send an IKE Notify payload in an IKE 1621 INFORMATIONAL exchange over that SA. The recipient MUST NOT change 1622 the state of any SA's as a result but SHOULD audit the event to aid 1623 in diagnosing malfunctions. A node MUST limit the rate at which it 1624 will send messages in response to unprotected messages. 1626 2.22 IPComp 1628 Use of IP compression [IPCOMP] can be negotiated as part of the setup 1629 of a CHILD_SA. While IP compression involves an extra header in each 1630 packet and a CPI (compression parameter index), the virtual 1631 "compression association" has no life outside the ESP or AH SA that 1632 contains it. Compression associations disappear when the 1633 corresponding ESP or AH SA goes away, and is not explicitly mentioned 1634 in any DELETE payload. 1636 Negotiation of IP compression is separate from the negotiation of 1637 cryptographic parameters associated with a CHILD_SA. A node 1638 requesting a CHILD_SA MAY advertise its support for one or more 1639 compression algorithms though one or more Notify payloads of type 1640 IPCOMP_SUPPORTED. The response MAY indicate acceptance of a single 1641 compression algorithm with a Notify payload of type IPCOMP_SUPPORTED. 1642 These payloads MAY ONLY occur in the same messages that contain SA 1643 payloads. 1645 While there has been discussion of allowing multiple compression 1646 algorithms to be accepted and to have different compression 1647 algorithms available for the two directions of a CHILD_SA, 1648 implementations of this specification MUST NOT accept an IPComp 1649 algorithm that was not proposed, MUST NOT accept more than one, and 1650 MUST NOT compress using an algorithm other than one proposed and 1651 accepted in the setup of the CHILD_SA. 1653 A side effect of separating the negotiation of IPComp from 1654 cryptographic parameters is that it is not possible to propose 1655 multiple cryptographic suites and propose IP compression with some of 1656 them but not others. 1658 2.23 NAT Traversal 1660 NAT (Network Address Translation) gateways are a controversial 1661 subject. This section briefly describes what they are and how they 1662 are likely to act on IKE traffic. Many people believe that NATs are 1663 evil and that we should not design our protocols so as to make them 1664 work better. IKEv2 does specify some unintuitive processing rules in 1665 order that NATs are more likely to work. 1667 NATs exist primarily because of the shortage of IPv4 addresses, 1668 though there are other rationales. IP nodes that are "behind" a NAT 1669 have IP addresses that are not globally unique, but rather are 1670 assigned from some space that is unique within the network behind the 1671 NAT but which are likely to be reused by nodes behind other NATs. 1672 Generally, nodes behind NATs can communicate with other nodes behind 1673 the same NAT and with nodes with globally unique addresses, but not 1674 with nodes behind other NATs. There are exceptions to that rule. 1675 When those nodes make connections to nodes on the real Internet, the 1676 NAT gateway "translates" the IP source address to an address that 1677 will be routed back to the gateway. Messages to the gateway from the 1678 Internet have their destination addresses "translated" to the 1679 internal address that will route the packet to the correct endnode. 1681 NATs are designed to be "transparent" to endnodes. Neither software 1682 on the node behind the NAT nor the node on the Internet require 1683 modification to communicate through the NAT. Achieving this 1684 transparency is more difficult with some protocols than with others. 1685 Protocols that include IP addresses of the endpoints within the 1686 payloads of the packet will fail unless the NAT gateway understands 1687 the protocol and modifies the internal references as well as those in 1688 the headers. Such knowledge is inherently unreliable, is a network 1689 layer violation, and often results in subtle problems. 1691 Opening an IPsec connection through a NAT introduces special 1692 problems. If the connection runs in transport mode, changing the IP 1693 addresses on packets will cause the checksums to fail and the NAT 1694 cannot correct the checksums because they are cryptographically 1695 protected. Even in tunnel mode, there are routing problems because 1696 transparently translating the addresses of AH and ESP packets 1697 requires special logic in the NAT and that logic is heuristic and 1698 unreliable in nature. For that reason, IKEv2 can negotiate UDP 1699 encapsulation of IKE, ESP, and AH packets. This encoding is slightly 1700 less efficient but is easier for NATs to process. In addition, 1701 firewalls may be configured to pass IPsec traffic over UDP but not 1702 ESP/AH or vice versa. 1704 It is a common practice of NATs to translate TCP and UDP port numbers 1705 as well as addresses and use the port numbers of inbound packets to 1706 decide which internal node should get a given packet. For this 1707 reason, even though IKE packets MUST be sent from and to UDP port 1708 500, they MUST be accepted coming from any port and responses MUST be 1709 sent to the port from whence they came. This is because the ports may 1710 be modified as the packets pass through NATs. Similarly, IP addresses 1711 of the IKE endpoints are generally not included in the IKE payloads 1712 because the payloads are cryptographically protected and could not be 1713 transparently modified by NATs. 1715 Port 4500 is reserved for UDP encapsulated ESP, AH, and IKE. When 1716 working through a NAT, it is generally better to pass IKE packets 1717 over port 4500 because some older NATs modify IKE traffic on port 500 1718 in an attempt to transparently establish IPsec connections. Such NATs 1719 may interfere with the straightforward NAT traversal envisioned by 1720 this document, so an IPsec endpoint that discovers a NAT between it 1721 and its correspondent MUST send all subsequent traffic to and from 1722 port 4500, which NATs should not treat specially (as they might with 1723 port 500). 1725 The specific requirements for supporting NAT traversal are listed 1726 below. Support for NAT traversal is optional. In this section only, 1727 requirements listed as MUST only apply to implementations supporting 1728 NAT traversal. 1730 IKE MUST listen on port 4500 as well as port 500. IKE MUST respond 1731 to the IP address and port from which packets arrived. 1733 The IKE responder MUST include in its IKE_SA_INIT response Notify 1734 payloads of type NAT_DETECTION_SOURCE_IP and 1735 NAT_DETECTION_DESTINATION_IP. The IKE initiator MUST check these 1736 payloads if present and if they do not match the addresses in the 1737 outer packet MUST tunnel all future IKE, ESP, and AH packets 1738 associated with this IKE_SA over UDP port 4500. To tunnel IKE 1739 packets over UDP port 4500, the IKE header has four octets of zero 1740 prepended and the result immediately follows the UDP header. To 1741 tunnel ESP packets over UDP port 4500, the ESP header immediately 1742 follows the UDP header. Since the first four bytes of the ESP 1743 header contain the SPI, and the SPI cannot validly be zero, it is 1744 always possible to distinguish ESP and IKE messages. 1746 The original source and destination IP address required for the 1747 transport mode TCP and UDP packet checksum fixup (see [Hutt02]) 1748 obtained from the Traffic Selectors associated with the exchange. 1749 In the case of NAT-T, the Traffic Selectors MUST contain exactly 1750 one IP address which is then used as the original IP address. 1752 There are cases where a NAT box decides to remove mappings that 1753 are still alive (for example, the keepalive interval is too long, 1754 or the NAT box is rebooted). To recover in these cases, hosts that 1755 are not behind a NAT SHOULD send all packets (including retried 1756 packets) to the IP address and port from the last valid 1757 authenticated packet from the other end. A host not behind a NAT 1758 SHOULD NOT do this because it opens a DoS attack possibility. Any 1759 authenticated IKE packet or any authenticated IKE encapsulated ESP 1760 packet can be used to detect that the IP address or the port has 1761 changed. 1763 Note that similar but probably not identical actions will likely 1764 be needed to make IKE work with Mobile IP, but such processing is 1765 not addressed by this document. 1767 2.24 ECN Notification 1769 Sections 5.1.2.1 and 5.1.2.2 of [RFC 2401] specify that the IPv4 TOS 1770 octet and IPv6 traffic class octet are to be copied from the inner 1771 header to the outer header by the encapsulator and that the outer 1772 header is to be discarded (no change to inner header) by the 1773 decapsulator. If ECN (see [RFC 3168]) is in use, ECT codepoints will 1774 be copied to the outer header, but if a router within the tunnel 1775 changes an ECT codepoint to a CE codepoint to indicate congestion, 1776 that indication will be discarded by the decapsulator. This behavior 1777 is highly undesirable, and Section 9.2 of [RFC 3168] specifies 1778 changes to IPsec to avoid it. These changes include two ECN 1779 operating modes and negotiation support to detect and cope with IPsec 1780 decapsulators that discard ECN congestion indications; use of ECN in 1781 the outer IP header of IPsec tunnels is not permitted when such 1782 discarding is a possibility. 1784 In order to avoid multiple ECN operating modes and negotiation, 1785 tunnel decapsulators for tunnel-mode Security Associations (SAs) 1786 created by IKEv2 MUST implement the processing specified in 1787 [RFC2401bis] to prevent discarding of ECN congestion indications. 1789 3 Header and Payload Formats 1791 3.1 The IKE Header 1793 IKE messages use UDP ports 500 and/or 4500, with one IKE message per 1794 UDP datagram. Information from the UDP header is largely ignored 1795 except that the IP addresses and UDP ports from the headers are 1796 reversed and used for return packets. When sent on UDP port 500, IKE 1797 messages begin immediately following the UDP header. When sent on UDP 1798 port 4500, IKE messages have prepended four octets of zero. These 1799 four octets of zero are not part of the IKE message and are not 1800 included in any of the length fields or checksums defined by IKE. 1801 Each IKE message begins with the IKE header, denoted HDR in this 1802 memo. Following the header are one or more IKE payloads each 1803 identified by a "Next Payload" field in the preceding payload. 1804 Payloads are processed in the order in which they appear in an IKE 1805 message by invoking the appropriate processing routine according to 1806 the "Next Payload" field in the IKE header and subsequently according 1807 to the "Next Payload" field in the IKE payload itself until a "Next 1808 Payload" field of zero indicates that no payloads follow. If a 1809 payload of type "Encrypted" is found, that payload is decrypted and 1810 its contents parsed as additional payloads. An Encrypted payload MUST 1811 be the last payload in a packet and an encrypted payload MUST NOT 1812 contain another encrypted payload. 1814 The Recipient SPI in the header identifies an instance of an IKE 1815 security association. It is therefore possible for a single instance 1816 of IKE to multiplex distinct sessions with multiple peers. 1818 All multi-octet fields representing integers are laid out in big 1819 endian order (aka most significant byte first, or network byte 1820 order). 1822 The format of the IKE header is shown in Figure 4. 1823 1 2 3 1824 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 1825 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1826 ! IKE_SA Initiator's SPI ! 1827 ! ! 1828 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1829 ! IKE_SA Responder's SPI ! 1830 ! ! 1831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1832 ! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags ! 1833 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1834 ! Message ID ! 1835 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1836 ! Length ! 1837 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1839 Figure 4: IKE Header Format 1841 o Initiator's SPI (8 octets) - A value chosen by the 1842 initiator to identify a unique IKE security association. This 1843 value MUST NOT be zero. 1845 o Responder's SPI (8 octets) - A value chosen by the 1846 responder to identify a unique IKE security association. This 1847 value MUST be zero in the first message of an IKE Initial 1848 Exchange (including repeats of that message including a 1849 cookie) and MUST NOT be zero in any other message. 1851 o Next Payload (1 octet) - Indicates the type of payload that 1852 immediately follows the header. The format and value of each 1853 payload is defined below. 1855 o Major Version (4 bits) - indicates the major version of the IKE 1856 protocol in use. Implementations based on this version of IKE 1857 MUST set the Major Version to 2. Implementations based on 1858 previous versions of IKE and ISAKMP MUST set the Major Version 1859 to 1. Implementations based on this version of IKE MUST reject 1860 or ignore messages containing a version number greater than 1861 2. 1863 o Minor Version (4 bits) - indicates the minor version of the 1864 IKE protocol in use. Implementations based on this version of 1865 IKE MUST set the Minor Version to 0. They MUST ignore the minor 1866 version number of received messages. 1868 o Exchange Type (1 octet) - indicates the type of exchange being 1869 used. This constrains the payloads sent in each message and 1870 orderings of messages in an exchange. 1872 Exchange Type Value 1874 RESERVED 0-33 1875 IKE_SA_INIT 34 1876 IKE_AUTH 35 1877 CREATE_CHILD_SA 36 1878 INFORMATIONAL 37 1879 Reserved for IKEv2+ 38-239 1880 Reserved for private use 240-255 1882 o Flags (1 octet) - indicates specific options that are set 1883 for the message. Presence of options are indicated by the 1884 appropriate bit in the flags field being set. The bits are 1885 defined LSB first, so bit 0 would be the least significant 1886 bit of the Flags octet. In the description below, a bit 1887 being 'set' means its value is '1', while 'cleared' means 1888 its value is '0'. 1890 -- X(reserved) (bits 0-2) - These bits MUST be cleared 1891 when sending and MUST be ignored on receipt. 1893 -- I(nitiator) (bit 3 of Flags) - This bit MUST be set in 1894 messages sent by the original Initiator of the IKE_SA 1895 and MUST be cleared in messages sent by the original 1896 Responder. It is used by the recipient to determine 1897 which eight octets of the SPI was generated by the 1898 recipient. 1900 -- V(ersion) (bit 4 of Flags) - This bit indicates that 1901 the transmitter is capable of speaking a higher major 1902 version number of the protocol than the one indicated 1903 in the major version number field. Implementations of 1904 IKEv2 must clear this bit when sending and MUST ignore 1905 it in incoming messages. 1907 -- R(esponse) (bit 5 of Flags) - This bit indicates that 1908 this message is a response to a message containing 1909 the same message ID. This bit MUST be cleared in all 1910 request messages and MUST be set in all responses. 1912 An IKE endpoint MUST NOT generate a response to a 1913 message that is marked as being a response. 1915 -- X(reserved) (bits 6-7 of Flags) - These bits MUST be 1916 cleared when sending and MUST be ignored on receipt. 1918 o Message ID (4 octets) - Message identifier used to control 1919 retransmission of lost packets and matching of requests and 1920 responses. It is essential to the security of the protocol 1921 because it is used to prevent message replay attacks. 1922 See sections 2.1 and 2.2. 1924 o Length (4 octets) - Length of total message (header + payloads) 1925 in octets. 1927 3.2 Generic Payload Header 1929 Each IKE payload defined in sections 3.3 through 3.16 begins with a 1930 generic payload header, shown in Figure 5. Figures for each payload 1931 below will include the generic payload header but for brevity the 1932 description of each field will be omitted. 1934 1 2 3 1935 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 1936 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1937 ! Next Payload !C! RESERVED ! Payload Length ! 1938 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1940 Figure 5: Generic Payload Header 1942 The Generic Payload Header fields are defined as follows: 1944 o Next Payload (1 octet) - Identifier for the payload type of the 1945 next payload in the message. If the current payload is the last 1946 in the message, then this field will be 0. This field provides 1947 a "chaining" capability whereby additional payloads can be 1948 added to a message by appending it to the end of the message 1949 and setting the "Next Payload" field of the preceding payload 1950 to indicate the new payload's type. An Encrypted payload, 1951 which must always be the last payload of a message, is an 1952 exception. It contains data structures in the format of 1953 additional payloads. In the header of an Encrypted payload, 1954 the Next Payload field is set to the payload type of the first 1955 contained payload (instead of 0). 1957 Payload Type Values 1959 Next Payload Type Notation Value 1961 No Next Payload 0 1963 RESERVED 1-32 1964 Security Association SA 33 1965 Key Exchange KE 34 1966 Identification - Initiator IDi 35 1967 Identification - Responder IDr 36 1968 Certificate CERT 37 1969 Certificate Request CERTREQ 38 1970 Authentication AUTH 39 1971 Nonce Ni, Nr 40 1972 Notify N 41 1973 Delete D 42 1974 Vendor ID V 43 1975 Traffic Selector - Initiator TSi 44 1976 Traffic Selector - Responder TSr 45 1977 Encrypted E 46 1978 Configuration CP 47 1979 Extended Authentication EAP 48 1980 RESERVED TO IANA 49-127 1981 PRIVATE USE 128-255 1983 Payload type values 1-32 should not be used so that there is no 1984 overlap with the code assignments for IKEv1. Payload type values 1985 49-127 are reserved to IANA for future assignment in IKEv2 (see 1986 section 6). Payload type values 128-255 are for private use among 1987 mutually consenting parties. 1989 o Critical (1 bit) - MUST be set to zero if the sender wants 1990 the recipient to skip this payload if he does not 1991 understand the payload type code in the Next Payload field 1992 of the previous payload. MUST be set to one if the 1993 sender wants the recipient to reject this entire message 1994 if he does not understand the payload type. MUST be ignored 1995 by the recipient if the recipient understands the payload type 1996 code. MUST be set to zero for payload types defined in this 1997 document. Note that the critical bit applies to the current 1998 payload rather than the "next" payload whose type code 1999 appears in the first octet. The reasoning behind not setting 2000 the critical bit for payloads defined in this document is 2001 that all implementations MUST understand all payload types 2002 defined in this document and therefore must ignore the 2003 Critical bit's value. Skipped payloads are expected to 2004 have valid Next Payload and Payload Length fields. 2006 o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored on 2007 receipt. 2009 o Payload Length (2 octets) - Length in octets of the current 2010 payload, including the generic payload header. 2012 3.3 Security Association Payload 2014 The Security Association Payload, denoted SA in this memo, is used to 2015 negotiate attributes of a security association. Assembly of Security 2016 Association Payloads requires great peace of mind. An SA may contain 2017 multiple proposals, ordered from most preferred to least preferred. 2018 Each proposal may contain multiple protocols (where a protocol is 2019 IKE, ESP, or AH), each protocol may contain multiple transforms, and 2020 each transform may contain multiple attributes. When parsing an SA, 2021 an implementation MUST check that the total Payload Length is 2022 consistent with the payload's internal lengths and counts. 2023 Proposals, Transforms, and Attributes each have their own variable 2024 length encodings. They are nested such that the Payload Length of an 2025 SA includes the combined contents of the SA, Proposal, Transform, and 2026 Attribute information. The length of a Proposal includes the lengths 2027 of all Transforms and Attributes it contains. The length of a 2028 Transform includes the lengths of all Attributes it contains. 2030 The syntax of Security Associations, Proposals, Transforms, and 2031 Attributes is based on ISAKMP, however the semantics are somewhat 2032 different. The reason for the complexity and the hierarchy is to 2033 allow for multiple possible combinations of algorithms to be encoded 2034 in a single SA. Sometimes there is a choice of multiple algorithms, 2035 while other times there is a combination of algorithms. For example, 2036 an Initiator might want to propose using (AH w/MD5 and ESP w/3DES) OR 2037 (ESP w/MD5 and 3DES). 2039 One of the reasons the semantics of the SA payload has changed from 2040 ISAKMP and IKEv1 is to make the encodings more compact in common 2041 cases. 2043 The Proposal structure contains within it a Proposal # and a 2044 SECURITY_PROTOCOL_ID. Each structure MUST have the same Proposal # 2045 as the previous one or be one (1) greater. The first Proposal MUST 2046 have a Proposal # of one (1). If two successive structures have the 2047 same Proposal number, it means that the proposal consists of the 2048 first structure AND the second. So a proposal of AH AND ESP would 2049 have two proposal structures, one for AH and one for ESP and both 2050 would have Proposal #1. A proposal of AH OR ESP would have two 2051 proposal structures, one for AH with proposal #1 and one for ESP with 2052 proposal #2. 2054 Each Proposal/Protocol structure is followed by one or more transform 2055 structures. The number of different transforms is generally 2056 determined by the Protocol. AH generally has a single transform: an 2057 integrity check algorithm. ESP generally has two: an encryption 2058 algorithm AND an integrity check algorithm. IKE generally has four 2059 transforms: a Diffie-Hellman group, an integrity check algorithm, a 2060 prf algorithm, and an encryption algorithm. For each Protocol, the 2061 set of permissible transforms are assigned transform ID numbers, 2062 which appear in the header of each transform. 2064 If there are multiple transforms with the same Transform Type, the 2065 proposal is an OR of those transforms. If there are multiple 2066 Transforms with different Transform Types, the proposal is an AND of 2067 the different groups. For example, to propose ESP with (3DES or IDEA) 2068 and (HMAC_MD5 or HMAC_SHA), the ESP proposal would contain two 2069 Transform Type 1 candidates (one for 3DES and one for IDEA) and two 2070 Transform Type 2 candidates (one for HMAC_MD5 and one for HMAC_SHA). 2071 This effectively proposes four combinations of algorithms. If the 2072 Initiator wanted to propose only a subset of those - say (3DES and 2073 HMAC_MD5) or (IDEA and HMAC_SHA), there is no way to encode that as 2074 multiple transforms within a single Proposal. Instead, the Initiator 2075 would have to construct two different Proposals, each with two 2076 transforms. 2078 A given transform MAY have one or more Attributes. Attributes are 2079 necessary when the transform can be used in more than one way, as 2080 when an encryption algorithm has a variable key size. The transform 2081 would specify the algorithm and the attribute would specify the key 2082 size. Most transforms do not have attributes. 2084 Note that the semantics of Transforms and Attributes are quite 2085 different than in IKEv1. In IKEv1, a single Transform carried 2086 multiple algorithms for a protocol with one carried in the Transform 2087 and the others carried in the Attributes. 2089 1 2 3 2090 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 2091 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2092 ! Next Payload !C! RESERVED ! Payload Length ! 2093 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2094 ! ! 2095 ~ ~ 2096 ! ! 2097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2099 Figure 6: Security Association Payload 2101 o Proposals (variable) - one or more proposal substructures. 2103 The payload type for the Security Association Payload is thirty 2104 three (33). 2106 3.3.1 Proposal Substructure 2108 1 2 3 2109 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 2110 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2111 ! 0 (last) or 2 ! RESERVED ! Proposal Length ! 2112 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2113 ! Proposal # ! Protocol-Id ! SPI Size !# of Transforms! 2114 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2115 ~ SPI (variable) ~ 2116 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2117 ! ! 2118 ~ ~ 2119 ! ! 2120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2122 Figure 7: Proposal Substructure 2124 o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the 2125 last Proposal Substructure in the SA. This syntax is inherited 2126 from ISAKMP, but is unnecessary because the last Proposal 2127 could be identified from the length of the SA. The value (2) 2128 corresponds to a Payload Type of Proposal in IKEv1, and the 2129 first four octets of the Proposal structure are designed to 2130 look somewhat like the header of a Payload. 2132 o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored on 2133 receipt. 2135 o Proposal Length (2 octets) - Length of this proposal, 2136 including all transforms and attributes that follow. 2138 o Proposal # (1 octet) - When a proposal is made, the first 2139 proposal in an SA MUST be #1, and subsequent proposals 2140 MUST either be the same as the previous proposal (indicating 2141 an AND of the two proposals) or one more than the previous 2142 proposal (indicating an OR of the two proposals). When a 2143 proposal is accepted, all of the proposal numbers in the 2144 SA MUST be the same and MUST match the number on the 2145 proposal sent that was accepted. 2147 o Protocol-Id (1 octet) - Specifies the protocol identifier 2148 for the current negotiation. Zero (0) indicates IKE, 2149 one (1) indicated ESP, and two (2) indicates AH. 2151 o SPI Size (1 octet) - For an initial IKE_SA negotiation, 2152 this field MUST be zero; the SPI is obtained from the 2153 outer header. During subsequent negotiations, 2154 it is equal to the size, in octets, of the SPI of the 2155 corresponding protocol (8 for IKE, 4 for ESP and AH). 2157 o # of Transforms (1 octet) - Specifies the number of 2158 transforms in this proposal. 2160 o SPI (variable) - The sending entity's SPI. Even if the SPI 2161 Size is not a multiple of 4 octets, there is no padding 2162 applied to the payload. When the SPI Size field is zero, 2163 this field is not present in the Security Association 2164 payload. 2166 o Transforms (variable) - one or more transform substructures. 2168 3.3.2 Transform Substructure 2170 1 2 3 2171 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 2172 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2173 ! 0 (last) or 3 ! RESERVED ! Transform Length ! 2174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2175 !Transform Type ! RESERVED ! Transform ID ! 2176 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2177 ! ! 2178 ~ Transform Attributes ~ 2179 ! ! 2180 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2182 Figure 8: Transform Substructure 2184 o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the 2185 last Transform Substructure in the Proposal. This syntax is 2186 inherited from ISAKMP, but is unnecessary because the last 2187 Proposal could be identified from the length of the SA. The 2188 value (3) corresponds to a Payload Type of Transform in IKEv1, 2189 and the first four octets of the Transform structure are 2190 designed to look somewhat like the header of a Payload. 2192 o RESERVED - MUST be sent as zero; MUST be ignored on receipt. 2194 o Transform Length - The length (in octets) of the Transform 2195 Substructure including Header and Attributes. 2197 o Transform Type (1 octet) - The type of transform being specified 2198 in this transform. Different protocols support different 2199 transform types. For some protocols, some of the transforms 2200 may be optional. If a transform is optional and the initiator 2201 wishes to propose that the transform be omitted, no transform 2202 of the given type is included in the proposal. If the 2203 initiator wishes to make use of the transform optional to 2204 the responder, she includes a transform substructure with 2205 transform ID = 0 as one of the options. 2207 o Transform ID (1 octet) - The specific instance of the transform 2208 type being proposed. 2210 Transform Type Values 2212 Transform Used In 2213 Type 2214 Encryption Algorithm 1 (IKE and ESP) 2215 Pseudo-random Function 2 (IKE) 2216 Integrity Algorithm 3 (IKE, AH, and optional in ESP) 2217 Diffie-Hellman Group 4 (IKE and optional in AH and ESP) 2218 Extended Sequence Numbers 5 (Optional in AH and ESP) 2220 values 6-240 are reserved to IANA. Values 241-255 are for 2221 private use among mutually consenting parties. 2223 For Transform Type 1 (Encryption Algorithm), defined Transform IDs 2224 are: 2226 Name Number Defined In 2227 RESERVED 0 2228 ENCR_DES_IV64 1 (RFC1827) 2229 ENCR_DES 2 (RFC2405) 2230 ENCR_3DES 3 (RFC2451) 2231 ENCR_RC5 4 (RFC2451) 2232 ENCR_IDEA 5 (RFC2451) 2233 ENCR_CAST 6 (RFC2451) 2234 ENCR_BLOWFISH 7 (RFC2451) 2235 ENCR_3IDEA 8 (RFC2451) 2236 ENCR_DES_IV32 9 2237 ENCR_RC4 10 2238 ENCR_NULL 11 (RFC2410) 2239 ENCR_AES_CBC 12 2240 ENCR_AES_CTR 13 2242 values 14-1023 are reserved to IANA. Values 1024-65535 are for 2243 private use among mutually consenting parties. 2245 For Transform Type 2 (Pseudo-random Function), defined Transform IDs 2246 are: 2248 Name Number Defined In 2249 RESERVED 0 2250 PRF_HMAC_MD5 1 (RFC2104) 2251 PRF_HMAC_SHA1 2 (RFC2104) 2252 PRF_HMAC_TIGER 3 (RFC2104) 2253 PRF_AES_CBC 4 2255 values 5-1023 are reserved to IANA. Values 1024-65535 are for 2256 private use among mutually consenting parties. 2258 For Transform Type 3 (Integrity Algorithm), defined Transform IDs 2259 are: 2261 Name Number Defined In 2262 NONE 0 2263 AUTH_HMAC_MD5_96 1 (RFC2403) 2264 AUTH_HMAC_SHA1_96 2 (RFC2404) 2265 AUTH_DES_MAC 3 2266 AUTH_KPDK_MD5 4 (RFC1826) 2267 AUTH_AES_XCBC_96 5 2269 values 6-1023 are reserved to IANA. Values 1024-65535 are for 2270 private use among mutually consenting parties. 2272 For Transform Type 4 (Diffie-Hellman Group), defined Transform IDs 2273 are: 2275 Name Number 2276 NONE 0 2277 Defined in Appendix B 1 - 4 2278 Defined in [ADDGROUP] 5, 14 - 18 2279 values 6-13 and 19-1023 are reserved to IANA for new MODP, ECP 2280 or EC2N groups. Values 1024-65535 are for private use among 2281 mutually consenting parties. 2283 For Transform Type 5 (Extended Sequence Numbers), defined Transform 2284 IDs are: 2286 Name Number 2287 No Extended Sequence Numbers 0 2288 Extended Sequence Numbers 1 2289 RESERVED 2 - 65535 2291 If Transform Type 5 is not included in a proposal, use of 2292 Extended Sequence Numbers is assumed. 2294 3.3.3 Valid Transform Types by Protocol 2296 The number and type of transforms that accompany an SA payload are 2297 dependent on the protocol in the SA itself. An SA payload proposing 2298 the establishment of an SA has the following mandatory and optional 2299 transform types. A compliant implementation MUST understand all 2300 mandatory and optional types for each protocol it supports (though it 2301 need not accept proposals with unacceptable suites). A proposal MAY 2302 omit the optional types if the only value for them it will accept is 2303 NONE. 2305 Protocol Mandatory Types Optional Types 2306 IKE ENCR, PRF, INTEG, D-H 2307 ESP ENCR INTEG, D-H, ESN 2308 AH INTEG D-H, ESN 2310 3.3.4 Mandatory Transform IDs 2312 The specification of suites that MUST and SHOULD be supported for 2313 interoperability has been removed from this document because they are 2314 likely to change more rapidly than this document evolves. 2316 An important lesson learned from IKEv1 is that no system should only 2317 implement the mandatory algorithms and expect them to be the best 2318 choice for all customers. For example, at the time that this document 2319 was being written, many IKEv1 implementers are starting to migrate to 2320 AES in CBC mode for VPN applications. Many IPsec systems based on 2321 IKEv2 will implement AES, longer Diffie-Hellman keys, and additional 2322 hash algorithms, and some IPsec customers already require these 2323 algorithms in addition to the ones listed above. 2325 It is likely that IANA will add additional transforms in the future, 2326 and some users may want to use private suites, especially for IKE 2327 where implementations should be capable of supporting different 2328 parameters, up to certain size limits. In support of this goal, all 2329 implementations of IKEv2 SHOULD include a management facility that 2330 allows specification (by a user or system administrator) of Diffie- 2331 Hellman parameters (the generator, modulus, and exponent lengths and 2332 values) for new DH groups. Implementations SHOULD provide a 2333 management interface via which these parameters and the associated 2334 transform IDs may be entered (by a user or system administrator), to 2335 enable negotiating such groups. 2337 All implementations of IKEv2 MUST include a management facility that 2338 enables a user or system administrator to specify the suites that are 2339 acceptable for use with IKE. Upon receipt of a payload with a set of 2340 transform IDs, the implementation MUST compare the transmitted 2341 transform IDs against those locally configured via the management 2342 controls, to verify that the proposed suite is acceptable based on 2343 local policy. The implementation MUST reject SA proposals that are 2344 not authorized by these IKE suite controls. 2346 3.3.5 Transform Attributes 2348 Each transform in a Security Association payload may include 2349 attributes that modify or complete the specification of the 2350 transform. These attributes are type/value pairs and are defined 2351 below. For example, if an encryption algorithm has a variable length 2352 key, the key length to be used may be specified as an attribute. 2353 Attributes can have a value with a fixed two octet length or a 2354 variable length value. For the latter, the attribute is encoded as 2355 type/length/value. 2357 1 2 3 2358 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 2359 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2360 !A! Attribute Type ! AF=0 Attribute Length ! 2361 !F! ! AF=1 Attribute Value ! 2362 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2363 ! AF=0 Attribute Value ! 2364 ! AF=1 Not Transmitted ! 2365 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2367 Figure 9: Data Attributes 2369 o Attribute Type (2 octets) - Unique identifier for each type of 2370 attribute (see below). 2372 The most significant bit of this field is the Attribute Format 2373 bit (AF). It indicates whether the data attributes follow the 2374 Type/Length/Value (TLV) format or a shortened Type/Value (TV) 2375 format. If the AF bit is zero (0), then the Data Attributes 2376 are of the Type/Length/Value (TLV) form. If the AF bit is a 2377 one (1), then the Data Attributes are of the Type/Value form. 2379 o Attribute Length (2 octets) - Length in octets of the Attribute 2380 Value. When the AF bit is a one (1), the Attribute Value is 2381 only 2 octets and the Attribute Length field is not present. 2383 o Attribute Value (variable length) - Value of the Attribute 2384 associated with the Attribute Type. If the AF bit is a 2385 zero (0), this field has a variable length defined by the 2386 Attribute Length field. If the AF bit is a one (1), the 2387 Attribute Value has a length of 2 octets. 2389 Note that only a single attribute type (Key Length) is defined, and 2390 it is fixed length. The variable length encoding specification is 2391 included only for future extensions. The only algorithms defined in 2392 this document that accept attributes are the AES based encryption, 2393 integrity, and pseudo-random functions, which require a single 2394 attribute specifying key width. 2396 Attributes described as basic MUST NOT be encoded using the variable 2397 length encoding. Variable length attributes MUST NOT be encoded as 2398 basic even if their value can fit into two octets. NOTE: This is a 2399 change from IKEv1, where increased flexibility may have simplified 2400 the composer of messages but certainly complicated the parser. 2402 Attribute Type value Attribute Format 2403 -------------------------------------------------------------- 2404 RESERVED 0-13 2405 Key Length (in bits) 14 TV 2407 RESERVED 15-17 2409 RESERVED TO IANA 18-16383 2411 PRIVATE USE 16384-32767 2412 Values 0-13 and 15-17 were used in a similar context in IKEv1, and 2413 should not be assigned except to matching values. Values 18-16383 are 2414 reserved to IANA. Values 16384-32767 are for private use among 2415 mutually consenting parties. 2417 - Key Length 2419 When using an Encryption Algorithm that has a variable length key, 2420 this attribute specifies the key length in bits. (MUST use network 2421 byte order). This attribute MUST NOT be used when the specified 2422 Encryption Algorithm uses a fixed length key. 2424 3.3.6 Attribute Negotiation 2426 During security association negotiation Initiators present offers to 2427 Responders. Responders MUST select a single complete set of 2428 parameters from the offers (or reject all offers if none are 2429 acceptable). If there are multiple proposals, the Responder MUST 2430 choose a single proposal number and return all of the Proposal 2431 substructures with that Proposal number. If there are multiple 2432 Transforms with the same type the Responder MUST choose a single one. 2433 Any attributes of a selected transform MUST be returned unmodified. 2434 The Initiator of an exchange MUST check that the accepted offer is 2435 consistent with one of its proposals, and if not that response MUST 2436 be rejected. 2438 Negotiating Diffie-Hellman groups presents some special challenges. 2439 SA offers include proposed attributes and a Diffie-Hellman public 2440 number (KE) in the same message. If in the initial exchange the 2441 Initiator offers to use one of several Diffie-Hellman groups, it 2442 SHOULD pick the one the Responder is most likely to accept and 2443 include a KE corresponding to that group. If the guess turns out to 2444 be wrong, the Responder will indicate the correct group in the 2445 response and the Initiator SHOULD pick an element of that group for 2446 its KE value when retrying the first message. It SHOULD, however, 2447 continue to propose its full supported set of groups in order to 2448 prevent a man in the middle downgrade attack. 2450 Implementation Note: 2452 Certain negotiable attributes can have ranges or could have 2453 multiple acceptable values. These are the Diffie-Hellman group and 2454 the key length of a variable key length symmetric cipher. To 2455 further interoperability and to support upgrading endpoints 2456 independently, implementers of this protocol SHOULD accept values 2457 which they deem to supply greater security. For instance if a peer 2458 is configured to accept a variable lengthed cipher with a key 2459 length of X bits and is offered that cipher with a larger key 2460 length an implementation SHOULD accept the offer. 2462 Support of this capability allows an implementation to express a 2463 concept of "at least" a certain level of security-- "a key length of 2464 _at least_ X bits for cipher foo". 2466 3.4 Key Exchange Payload 2468 The Key Exchange Payload, denoted KE in this memo, is used to 2469 exchange Diffie-Hellman public numbers as part of a Diffie-Hellman 2470 key exchange. The Key Exchange Payload consists of the IKE generic 2471 payload header followed by the Diffie-Hellman public value itself. 2473 1 2 3 2474 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 2475 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2476 ! Next Payload !C! RESERVED ! Payload Length ! 2477 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2478 ! DH Group # ! RESERVED ! 2479 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2480 ! ! 2481 ~ Key Exchange Data ~ 2482 ! ! 2483 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2485 Figure 10: Key Exchange Payload Format 2487 A key exchange payload is constructed by copying one's Diffie-Hellman 2488 public value into the "Key Exchange Data" portion of the payload. 2489 The length of the Diffie-Hellman public value MUST be equal to the 2490 length of the prime modulus over which the exponentiation was 2491 performed, prepending zero bits to the value if necessary. 2493 The DH Group # identifies the Diffie-Hellman group in which the Key 2494 Exchange Data was computed (see Appendix B). If the selected 2495 proposal uses a different Diffie-Hellman group, the message MUST be 2496 rejected with a Notify payload of type INVALID_KE_PAYLOAD. 2498 The payload type for the Key Exchange payload is thirty four (34). 2500 3.5 Identification Payloads 2502 The Identification Payloads, denoted IDi and IDr in this memo, allow 2503 peers to assert an identity to one another. This identity may be used 2504 for policy lookup, but does not necessarily have to match anything in 2505 the CERT payload; both fields may be used by an implementation to 2506 perform access control decisions. 2508 NOTE: In IKEv1, two ID payloads were used in each direction to hold 2509 Traffic Selector information for data passing over the SA. In IKEv2, 2510 this information is carried in Traffic Selector (TS) payloads (see 2511 section 3.13). 2513 The Identification Payload consists of the IKE generic payload header 2514 followed by identification fields as follows: 2516 1 2 3 2517 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 2518 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2519 ! Next Payload !C! RESERVED ! Payload Length ! 2520 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2521 ! ID Type ! RESERVED | 2522 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2523 ! ! 2524 ~ Identification Data ~ 2525 ! ! 2526 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2528 Figure 11: Identification Payload Format 2530 o ID Type (1 octet) - Specifies the type of Identification being 2531 used. 2533 o RESERVED - MUST be sent as zero; MUST be ignored on receipt. 2535 o Identification Data (variable length) - Value, as indicated by 2536 the Identification Type. The length of the Identification Data 2537 is computed from the size in the ID payload header. 2539 The payload types for the Identification Payload are thirty five (35) 2540 for IDi and thirty six (36) for IDr. 2542 The following table lists the assigned values for the Identification 2543 Type field, followed by a description of the Identification Data 2544 which follows: 2546 ID Type Value 2547 ------- ----- 2548 RESERVED 0 2550 ID_IPV4_ADDR 1 2552 A single four (4) octet IPv4 address. 2554 ID_FQDN 2 2556 A fully-qualified domain name string. An example of a 2557 ID_FQDN is, "example.com". The string MUST not contain any 2558 terminators (e.g., NULL, CR, etc.). 2560 ID_RFC822_ADDR 3 2562 A fully-qualified RFC822 email address string, An example of 2563 a ID_RFC822_ADDR is, "jsmith@example.com". The string MUST 2564 not contain any terminators. 2566 ID_IPV6_ADDR 5 2568 A single sixteen (16) octet IPv6 address. 2570 ID_DER_ASN1_DN 9 2572 The binary DER encoding of an ASN.1 X.500 Distinguished Name 2573 [X.501]. 2575 ID_DER_ASN1_GN 10 2577 The binary DER encoding of an ASN.1 X.500 GeneralName 2578 [X.509]. 2580 ID_KEY_ID 11 2582 An opaque octet stream which may be used to pass an account 2583 name or to pass vendor-specific information necessary to do 2584 certain proprietary types of identification. 2586 Two implementations will interoperate only if each can generate a 2587 type of ID acceptable to the other. To assure maximum 2588 interoperability, implementations MUST be configurable to send at 2589 least one of ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, or ID_KEY_ID, and 2590 MUST be configurable to accept all of these types. Implementations 2591 SHOULD be capable of generating and accepting all of these types. 2593 3.6 Certificate Payload 2595 The Certificate Payload, denoted CERT in this memo, provides a means 2596 to transport certificates or other authentication related information 2597 via IKE. Certificate payloads SHOULD be included in an exchange if 2598 certificates are available to the sender unless the peer has 2599 indicated an ability to retrieve this information from elsewhere 2600 using an HTTP_CERT_LOOKUP_SUPPORTED Notify payload. Note that the 2601 term "Certificate Payload" is somewhat misleading, because not all 2602 authentication mechanisms use certificates and data other than 2603 certificates may be passed in this payload. 2605 The Certificate Payload is defined as follows: 2607 1 2 3 2608 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 2609 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2610 ! Next Payload !C! RESERVED ! Payload Length ! 2611 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2612 ! Cert Encoding ! ! 2613 +-+-+-+-+-+-+-+-+ ! 2614 ~ Certificate Data ~ 2615 ! ! 2616 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2618 Figure 12: Certificate Payload Format 2620 o Certificate Encoding (1 octet) - This field indicates the type 2621 of certificate or certificate-related information contained 2622 in the Certificate Data field. 2624 Certificate Encoding Value 2625 -------------------- ----- 2626 RESERVED 0 2627 PKCS #7 wrapped X.509 certificate 1 2628 PGP Certificate 2 2629 DNS Signed Key 3 2630 X.509 Certificate - Signature 4 2631 Kerberos Token 6 2632 Certificate Revocation List (CRL) 7 2633 Authority Revocation List (ARL) 8 2634 SPKI Certificate 9 2635 X.509 Certificate - Attribute 10 2636 Raw RSA Key 11 2637 Hash and URL of PKIX certificate 12 2638 Hash and URL of PKIX bundle 13 2639 RESERVED 14 - 200 2640 PRIVATE USE 201 - 255 2642 o Certificate Data (variable length) - Actual encoding of 2643 certificate data. The type of certificate is indicated 2644 by the Certificate Encoding field. 2646 The payload type for the Certificate Payload is thirty seven (37). 2648 Specific syntax is for some of the certificate type codes above is 2649 not defined in this document. The types whose syntax is defined in 2650 this document are: 2652 X.509 Certificate - Signature (4) contains a BER encoded X.509 2653 certificate. 2655 Certificate Revocation List (7) contains a BER encoded X.509 2656 certificate revocation list. 2658 Raw RSA Key (11) contains a PKCS #1 encoded RSA key. 2660 Hash and URL of PKIX certificate (12) contains a 20 octet SHA-1 2661 hash of a PKIX certificate followed by a variable length URL that 2662 resolves to the BER encoded certificate itself. 2664 Hash and URL of PKIX bundle (13) contains a 20 octet SHA-1 hash of 2665 a PKIX certificate bundle followed by a variable length URL the 2666 resolves to the BER encoded certificate bundle itself. The bundle 2667 is a BER encoded SEQUENCE of certificates and CRLs. 2669 Implementations MUST be capable of being configured to send and 2670 accept up to four X.509 certificates in support of authentication. 2671 Implementations SHOULD be capable of being configured to send and 2672 accept Raw RSA keys and the two Hash and URL formats. If multiple 2673 certificates are sent, the first certificate MUST contain the public 2674 key used to sign the AUTH payload. The other certificates may be sent 2675 in any order. 2677 3.7 Certificate Request Payload 2679 The Certificate Request Payload, denoted CERTREQ in this memo, 2680 provides a means to request preferred certificates via IKE and can 2681 appear in the IKE_INIT_SA response and/or the IKE_AUTH request. 2682 Certificate Request payloads MAY be included in an exchange when the 2683 sender needs to get the certificate of the receiver. If multiple CAs 2684 are trusted and the cert encoding does not allow a list, then 2685 multiple Certificate Request payloads SHOULD be transmitted. 2687 The Certificate Request Payload is defined as follows: 2689 1 2 3 2690 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 2691 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2692 ! Next Payload !C! RESERVED ! Payload Length ! 2693 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2694 ! Cert Encoding ! ! 2695 +-+-+-+-+-+-+-+-+ ! 2696 ~ Certification Authority ~ 2697 ! ! 2698 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2700 Figure 13: Certificate Request Payload Format 2702 o Certificate Encoding (1 octet) - Contains an encoding of the type 2703 or format of certificate requested. Values are listed in section 2704 3.6. 2706 o Certification Authority (variable length) - Contains an encoding 2707 of an acceptable certification authority for the type of 2708 certificate requested. 2710 The payload type for the Certificate Request Payload is thirty eight 2711 (38). 2713 The Certificate Encoding field has the same values as those defined 2714 in section 3.6. The Certification Authority field contains an 2715 indicator of trusted authorities for this certificate type. The 2716 Certification Authority value is a concatenated list of SHA-1 hashes 2717 of the public keys of trusted CAs. Each is encoded as the SHA-1 hash 2718 of the Subject Public Key Info element (see section 4.1.2.7 of [RFC 2719 3280]) from each Trust Anchor certificate. The twenty-octet hashes 2720 are concatenated and included with no other formatting. 2722 Note that the term "Certificate Request" is somewhat misleading, in 2723 that values other than certificates are defined in a "Certificate" 2724 payload and requests for those values can be present in a Certificate 2725 Request Payload. The syntax of the Certificate Request payload in 2726 such cases is not defined in this document. 2728 The Certificate Request Payload is processed by inspecting the "Cert 2729 Encoding" field to determine whether the processor has any 2730 certificates of this type. If so the "Certification Authority" field 2731 is inspected to determine if the processor has any certificates which 2732 can be validated up to one of the specified certification 2733 authorities. This can be a chain of certificates. If a certificate 2734 exists which satisfies the criteria specified in the Certificate 2735 Request Payload, the certificate MUST be sent back to the certificate 2736 requestor; if a certificate chain exists which goes back to the 2737 certification authority specified in the request the entire chain 2738 SHOULD be sent back to the certificate requestor. If multiple 2739 certificates or chains exist that satisfy the request, the sender 2740 MUST pick one. If no certificates exist then the Certificate Request 2741 Payload is ignored. This is not an error condition of the protocol. 2742 There may be cases where there is a preferred CA, but an alternate 2743 might be acceptable (perhaps after prompting a human operator). 2745 3.8 Authentication Payload 2747 The Authentication Payload, denoted AUTH in this memo, contains data 2748 used for authentication purposes. The syntax of the Authentication 2749 data varies according to the Auth Method as specified below. 2751 The Authentication Payload is defined as follows: 2753 1 2 3 2754 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 2755 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2756 ! Next Payload !C! RESERVED ! Payload Length ! 2757 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2758 ! Auth Method ! RESERVED ! 2759 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2760 ! ! 2761 ~ Authentication Data ~ 2762 ! ! 2763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2765 Figure 14: Authentication Payload Format 2767 o Auth Method (1 octet) - Specifies the method of authentication 2768 used. Values defined are: 2770 RSA Digital Signature (1) - Computed as specified in section 2771 2.15 using an RSA private key over a PKCS#1 padded hash. 2773 Shared Key Message Integrity Code (2) - Computed as specified in 2774 section 2.15 using the shared key associated with the identity 2775 in the ID payload and the negotiated prf function 2777 DSS Digital Signature (3) - Computed as specified in section 2778 2.15 using a DSS private key over a SHA-1 hash. 2780 The values 0 and 4-200 are reserved to IANA. The values 201-255 2781 are available for private use. 2783 o Authentication Data (variable length) - see section 2.15. 2785 The payload type for the Authentication Payload is thirty nine (39). 2787 3.9 Nonce Payload 2789 The Nonce Payload, denoted Ni and Nr in this memo for the Initiator's 2790 and Responder's nonce respectively, contains random data used to 2791 guarantee liveness during an exchange and protect against replay 2792 attacks. 2794 The Nonce Payload is defined as follows: 2796 1 2 3 2797 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 2798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2799 ! Next Payload !C! RESERVED ! Payload Length ! 2800 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2801 ! ! 2802 ~ Nonce Data ~ 2803 ! ! 2804 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2806 Figure 15: Nonce Payload Format 2808 o Nonce Data (variable length) - Contains the random data generated 2809 by the transmitting entity. 2811 The payload type for the Nonce Payload is forty (40). 2813 The size of a Nonce MUST be between 16 and 256 octets inclusive. 2814 Nonce values MUST NOT be reused. 2816 3.10 Notify Payload 2818 The Notify Payload, denoted N in this document, is used to transmit 2819 informational data, such as error conditions and state transitions, 2820 to an IKE peer. A Notify Payload may appear in a response message 2821 (usually specifying why a request was rejected), in an INFORMATIONAL 2822 Exchange (to report an error not in an IKE request), or in any other 2823 message to indicate sender capabilities or to modify the meaning of 2824 the request. 2826 The Notify Payload is defined as follows: 2828 1 2 3 2829 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 2830 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2831 ! Next Payload !C! RESERVED ! Payload Length ! 2832 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2833 ! S_Protocol_ID ! SPI Size ! Notify Message Type ! 2834 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2835 ! ! 2836 ~ Security Parameter Index (SPI) ~ 2837 ! ! 2838 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2839 ! ! 2840 ~ Notification Data ~ 2841 ! ! 2842 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2844 Figure 16: Notification Payload Format 2846 o SECURITY_PROTOCOL_ID (1 octet) - If this notification concerns 2847 an existing SA, this field indicates the type of that SA. 2848 For IKE_SA notifications, this field MUST be one (1). For 2849 notifications concerning IPsec SAs this field MUST contain 2850 either (2) to indicate AH or (3) to indicate ESP. For 2851 notifications which do not relate to an existing SA, this 2852 field MUST be sent as zero and MUST be ignored on receipt. 2853 All other values for this field are reserved to IANA for future 2854 assignment. 2856 o SPI Size (1 octet) - Length in octets of the SPI as defined by 2857 the SECURITY_PROTOCOL_ID or zero if no SPI is applicable. For a 2858 notification concerning the IKE_SA, the SPI Size MUST be zero. 2860 o Notify Message Type (2 octets) - Specifies the type of 2861 notification message. 2863 o SPI (variable length) - Security Parameter Index. 2865 o Notification Data (variable length) - Informational or error data 2866 transmitted in addition to the Notify Message Type. Values for 2867 this field are type specific (see below). 2869 The payload type for the Notification Payload is forty one (41). 2871 3.10.1 Notify Message Types 2873 Notification information can be error messages specifying why an SA 2874 could not be established. It can also be status data that a process 2875 managing an SA database wishes to communicate with a peer process. 2876 The table below lists the Notification messages and their 2877 corresponding values. The number of different error statuses was 2878 greatly reduced from IKE V1 both for simplification and to avoid 2879 giving configuration information to probers. 2881 Types in the range 0 - 16383 are intended for reporting errors. An 2882 implementation receiving a Notify payload with one of these types 2883 that it does not recognize in a response MUST assume that the 2884 corresponding request has failed entirely. Unrecognized error types 2885 in a request and status types in a request or response MUST be 2886 ignored except that they SHOULD be logged. 2888 Notify payloads with status types MAY be added to any message and 2889 MUST be ignored if not recognized. They are intended to indicate 2890 capabilities, and as part of SA negotiation are used to negotiate 2891 non-cryptographic parameters. 2893 NOTIFY MESSAGES - ERROR TYPES Value 2894 ----------------------------- ----- 2895 UNSUPPORTED_CRITICAL_PAYLOAD 1 2897 Sent if the payload has the "critical" bit set and the 2898 payload type is not recognized. Notification Data contains 2899 the one octet payload type. 2901 INVALID_IKE_SPI 4 2903 Indicates an IKE message was received with an unrecognized 2904 destination SPI. This usually indicates that the recipient 2905 has rebooted and forgotten the existence of an IKE_SA. 2907 INVALID_MAJOR_VERSION 5 2909 Indicates the recipient cannot handle the version of IKE 2910 specified in the header. The closest version number that the 2911 recipient can support will be in the reply header. 2913 INVALID_SYNTAX 7 2915 Indicates the IKE message was received was invalid because 2916 some type, length, or value was out of range or because the 2917 request was rejected for policy reasons. To avoid a denial 2918 of service attack using forged messages, this status may 2919 only be returned for and in an encrypted packet if the 2920 MESSAGE_ID and cryptographic checksum were valid. To avoid 2921 leaking information to someone probing a node, this status 2922 MUST be sent in response to any error not covered by one of 2923 the other status types. To aid debugging, more detailed 2924 error information SHOULD be written to a console or log. 2926 INVALID_MESSAGE_ID 9 2928 Sent when an IKE MESSAGE_ID outside the supported window is 2929 received. This Notify MUST NOT be sent in a response; the 2930 invalid request MUST NOT be acknowledged. Instead, inform 2931 the other side by initiating an INFORMATIONAL exchange with 2932 Notification data containing the four octet invalid 2933 MESSAGE_ID. Sending this notification is optional and 2934 notifications of this type MUST be rate limited. 2936 INVALID_SPI 11 2938 MAY be sent in an IKE INFORMATIONAL Exchange when a node 2939 receives an ESP or AH packet with an invalid SPI. The 2940 Notification Data contains the SPI of the invalid packet. 2941 This usually indicates a node has rebooted and forgotten an 2942 SA. If this Informational Message is sent outside the 2943 context of an IKE_SA, it should only be used by the 2944 recipient as a "hint" that something might be wrong (because 2945 it could easily be forged). 2947 NO_PROPOSAL_CHOSEN 14 2949 None of the proposed crypto suites was acceptable. 2951 INVALID_KE_PAYLOAD 17 2953 The D-H Group # field in the KE payload is not the group # 2954 selected by the responder for this exchange. There are two 2955 octets of data associated with this notification: the 2956 accepted D-H Group # in big endian order. 2958 AUTHENTICATION_FAILED 24 2960 Sent in the response to an IKE_AUTH message when for some 2961 reason the authentication failed. There is no associated 2962 data. 2964 SINGLE_PAIR_REQUIRED 34 2965 This error indicates that a CREATE_CHILD_SA request is 2966 unacceptable because its sender is only willing to accept 2967 traffic selectors specifying a single pair of addresses. 2968 The requestor is expected to respond by requesting an SA for 2969 only the specific traffic he is trying to forward. 2971 NO_ADDITIONAL_SAS 35 2973 This error indicates that a CREATE_CHILD_SA request is 2974 unacceptable because the Responder is unwilling to accept 2975 any more CHILD_SAs on this IKE_SA. Some minimal 2976 implementations may only accept a single CHILD_SA setup in 2977 the context of an initial IKE exchange and reject any 2978 subsequent attempts to add more. 2980 INTERNAL_ADDRESS_FAILURE 36 2981 Indicates an error assigning an internal address (i.e., 2982 INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS) during the 2983 processing of a Configuration Payload by a Responder. If 2984 this error is generated within an IKE_AUTH exchange no 2985 CHILD_SA will be created. 2987 FAILED_CP_REQUIRED 37 2988 Sent by responder in the case where CP(CFG_REQUEST) was 2989 expected but not received, and so is a conflict with locally 2990 configured policy. There is no associated data. 2992 TS_UNACCEPTABLE 38 2993 Indicates that none of the addresses/protocols/ports in the 2994 supplied traffic selectors is acceptable. 2996 RESERVED TO IANA - Error types 39 - 8191 2998 Private Use - Errors 8192 - 16383 3000 NOTIFY MESSAGES - STATUS TYPES Value 3001 ------------------------------ ----- 3003 INITIAL_CONTACT 16384 3005 This notification asserts that this IKE_SA is the only 3006 IKE_SA currently active between the authenticated 3007 identities. It MAY be sent when an IKE_SA is established 3008 after a crash, and the recipient MAY use this information to 3009 delete any other IKE_SAs it has to the same authenticated 3010 identity without waiting for a timeout. This notification 3011 MUST NOT be sent by an entity that may be replicated (e.g., 3012 a roaming user's credentials where the user is allowed to 3013 connect to the corporate firewall from two remote systems at 3014 the same time). 3016 SET_WINDOW_SIZE 16385 3018 This notification asserts that the sending endpoint is 3019 capable of keeping state for multiple outstanding exchanges, 3020 permitting the recipient to send multiple requests before 3021 getting a response to the first. The data associated with a 3022 SET_WINDOW_SIZE notification MUST be 4 octets long and 3023 contain the big endian representation of the number of 3024 messages the sender promises to keep. Window size is always 3025 one until the initial exchanges complete. 3027 ADDITIONAL_TS_POSSIBLE 16386 3029 This notification asserts that the sending endpoint narrowed 3030 the proposed traffic selectors but that other traffic 3031 selectors would also have been acceptable, though only in a 3032 separate SA (see section 2.9). There is no data associated 3033 with this Notify type. It may only be sent as an additional 3034 payload in a message including accepted TSs. 3036 IPCOMP_SUPPORTED 16387 3038 This notification may only be included in a message 3039 containing an SA payload negotiating a CHILD_SA and 3040 indicates a willingness by its sender to use IPComp on this 3041 SA. The data associated with this notification includes a 3042 two octet IPComp CPI followed by a one octet transform ID 3043 optionally followed by attributes whose length and format is 3044 defined by that transform ID. A message proposing an SA may 3045 contain multiple IPCOMP_SUPPORTED notifications to indicate 3046 multiple supported algorithms. A message accepting an SA may 3047 contain at most one. 3049 The transform IDs currently defined are: 3051 NAME NUMBER DEFINED IN 3052 ----------- ------ ----------- 3053 RESERVED 0 3054 IPCOMP_OUI 1 3055 IPCOMP_DEFLATE 2 RFC 2394 3056 IPCOMP_LZS 3 RFC 2395 3057 IPCOMP_LZJH 4 RFC 3051 3058 values 4-240 are reserved to IANA. Values 241-255 are 3059 for private use among mutually consenting parties. 3061 NAT_DETECTION_SOURCE_IP 16388 3063 This notification is used to by its recipient to determine 3064 whether the source is behind a NAT box. The data associated 3065 with this notification is a SHA-1 digest of the SPIs (in the 3066 order they appear in the header), IP address and port on 3067 which this packet was sent. There MAY be multiple Notify 3068 payloads of this type in a message if the sender does not 3069 know which of several network attachments will be used to 3070 send the packet. The recipient of this notification MAY 3071 compare the supplied value to a SHA-1 hash of the SPIs, 3072 source IP address and port and if they don't match it SHOULD 3073 enable NAT traversal (see section 2.23). Alternately, it 3074 MAY reject the connection attempt if NAT traversal is not 3075 supported. 3077 NAT_DETECTION_DESTINATION_IP 16389 3079 This notification is used to by its recipient to determine 3080 whether it is behind a NAT box. The data associated with 3081 this notification is a SHA-1 digest of the SPIs (in the 3082 order they appear in the header), IP address and port to 3083 which this packet was sent. The recipient of this 3084 notification MAY compare the supplied value to a hash of the 3085 SPIs, destination IP address and port and if they don't 3086 match it SHOULD invoke NAT traversal (see section 2.23). If 3087 they don't match, it means that this end is behind a NAT and 3088 this end SHOULD start start sending keepalive packets as 3089 defined in [Hutt02]. Alternately, it MAY reject the 3090 connection attempt if NAT traversal is not supported. 3092 COOKIE 16390 3094 This notification MAY be included in an IKE_SA_INIT 3095 response. It indicates that the request should be retried 3096 with a copy of this notification as the first payload. This 3097 notification MUST be included in an IKE_SA_INIT request 3098 retry if a COOKIE notification was included in the initial 3099 response. The data associated with this notification MUST 3100 be between 1 and 64 octets in length (inclusive). 3102 USE_TRANSPORT_MODE 16391 3104 This notification MAY be included in a request message that 3105 also includes an SA requesting a CHILD_SA. It requests that 3106 the CHILD_SA use transport mode rather than tunnel mode for 3107 the SA created. If the request is accepted, the response 3108 MUST also include a notification of type USE_TRANSPORT_MODE. 3109 If the responder declines the request, the CHILD_SA will be 3110 established in tunnel mode. If this is unacceptable to the 3111 initiator, the initiator MUST delete the SA. Note: except 3112 when using this option to negotiate transport mode, all 3113 CHILD_SAs will use tunnel mode. 3115 Note: The ECN decapsulation modifications specified in 3116 [RFC2401bis] MUST be performed for every tunnel mode SA 3117 created by IKEv2. 3118 HTTP_CERT_LOOKUP_SUPPORTED 16392 3120 This notification MAY be included in any message that can 3121 include a CERTREQ payload and indicates that the sender is 3122 capable of looking up certificates based on an HTTP-based 3123 URL (and hence presumably would prefer to receive 3124 certificate specifications in that format). 3126 REKEY_SA 16393 3128 This notification MUST be included in a CREATE_CHILD_SA 3129 exchange if the purpose of the exchange is to replace an 3130 existing ESP or AH SA. The SPI field identifies the SA being 3131 rekeyed. There is no data. 3133 RESERVED TO IANA - STATUS TYPES 16394 - 40959 3135 Private Use - STATUS TYPES 40960 - 65535 3137 3.11 Delete Payload 3139 The Delete Payload, denoted D in this memo, contains a protocol 3140 specific security association identifier that the sender has removed 3141 from its security association database and is, therefore, no longer 3142 valid. Figure 17 shows the format of the Delete Payload. It is 3143 possible to send multiple SPIs in a Delete payload, however, each SPI 3144 MUST be for the same protocol. Mixing of Protocol Identifiers MUST 3145 NOT be performed in a the Delete payload. It is permitted, however, 3146 to include multiple Delete payloads in a single INFORMATIONAL 3147 Exchange where each Delete payload lists SPIs for a different 3148 protocol. 3150 Deletion of the IKE_SA is indicated by a SECURITY_PROTOCOL_ID of 1 3151 (IKE) but no SPIs. Deletion of a CHILD_SA, such as ESP or AH, will 3152 contain the SECURITY_PROTOCOL_ID of that protocol (2 for AH, 3 for 3153 ESP) and the SPI is the SPI the sending endpoint would expect in 3154 inbound ESP or AH packets. 3156 The Delete Payload is defined as follows: 3158 1 2 3 3159 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 3160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3161 ! Next Payload !C! RESERVED ! Payload Length ! 3162 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3163 ! S_PROTOCOL_ID ! SPI Size ! # of SPIs ! 3164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3165 ! ! 3166 ~ Security Parameter Index(es) (SPI) ~ 3167 ! ! 3168 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3170 Figure 17: Delete Payload Format 3172 o SECURITY_PROTOCOL_ID (1 octet) - Must be 1 for an IKE_SA, 2 3173 for AH, or 3 for ESP. 3175 o SPI Size (1 octet) - Length in octets of the SPI as defined by 3176 the SECURITY_PROTOCOL_ID. Zero for IKE (SPI is in message 3177 header) or four for AH and ESP. 3179 o # of SPIs (2 octets) - The number of SPIs contained in the Delete 3180 payload. The size of each SPI is defined by the SPI Size field. 3182 o Security Parameter Index(es) (variable length) - Identifies the 3183 specific security association(s) to delete. The length of this 3184 field is determined by the SPI Size and # of SPIs fields. 3186 The payload type for the Delete Payload is forty two (42). 3188 3.12 Vendor ID Payload 3190 The Vendor ID Payload contains a vendor defined constant. The 3191 constant is used by vendors to identify and recognize remote 3192 instances of their implementations. This mechanism allows a vendor 3193 to experiment with new features while maintaining backwards 3194 compatibility. 3196 A Vendor ID payload MAY announce that the sender is capable to 3197 accepting certain extensions to the protocol, or it MAY simply 3198 identify the implementation as an aid in debugging. A Vendor ID 3199 payload MUST NOT change the interpretation of any information defined 3200 in this specification (i.e., it MUST be non-critical). Multiple 3201 Vendor ID payloads MAY be sent. An implementation is NOT REQUIRED to 3202 send any Vendor ID payload at all. 3204 A Vendor ID payload may be sent as part of any message. Reception of 3205 a familiar Vendor ID payload allows an implementation to make use of 3206 Private USE numbers described throughout this memo-- private 3207 payloads, private exchanges, private notifications, etc. Unfamiliar 3208 Vendor IDs MUST be ignored. 3210 Writers of Internet-Drafts who wish to extend this protocol MUST 3211 define a Vendor ID payload to announce the ability to implement the 3212 extension in the Internet-Draft. It is expected that Internet-Drafts 3213 which gain acceptance and are standardized will be given "magic 3214 numbers" out of the Future Use range by IANA and the requirement to 3215 use a Vendor ID will go away. 3217 The Vendor ID Payload fields are defined as follows: 3219 1 2 3 3220 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 3221 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3222 ! Next Payload !C! RESERVED ! Payload Length ! 3223 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3224 ! ! 3225 ~ Vendor ID (VID) ~ 3226 ! ! 3227 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3229 Figure 18: Vendor ID Payload Format 3231 o Vendor ID (variable length) - It is the responsibility of 3232 the person choosing the Vendor ID to assure its uniqueness 3233 in spite of the absence of any central registry for IDs. 3234 Good practice is to include a company name, a person name 3235 or some such. If you want to show off, you might include 3236 the latitude and longitude and time where you were when 3237 you chose the ID and some random input. A message digest 3238 of a long unique string is preferable to the long unique 3239 string itself. 3241 The payload type for the Vendor ID Payload is forty three (43). 3243 3.13 Traffic Selector Payload 3245 The Traffic Selector Payload, denoted TS in this memo, allows peers 3246 to identify packet flows for processing by IPsec security services. 3247 The Traffic Selector Payload consists of the IKE generic payload 3248 header followed by individual traffic selectors as follows: 3250 1 2 3 3251 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 3252 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3253 ! Next Payload !C! RESERVED ! Payload Length ! 3254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3255 ! Number of TSs ! RESERVED ! 3256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3257 ! ! 3258 ~ ~ 3259 ! ! 3260 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3262 Figure 19: Traffic Selectors Payload Format 3264 o Number of TSs (1 octet) - Number of traffic selectors 3265 being provided. 3267 o RESERVED - This field MUST be sent as zero and MUST be ignored 3268 on receipt. 3270 o Traffic Selectors (variable length) - one or more individual 3271 traffic selectors. 3273 The length of the Traffic Selector payload includes the TS header and 3274 all the traffic selectors. 3276 The payload type for the Traffic Selector payload is forty four (44) 3277 for addresses at the initiator's end of the SA and forty five (45) 3278 for addresses at the responder's end. 3280 3.13.1 Traffic Selector 3282 1 2 3 3283 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 3284 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3285 ! TS Type ! Protocol_ID* | Selector Length | 3286 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3287 | Start_Port* | End_Port* | 3288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3289 ! ! 3290 ~ Starting Address* ~ 3291 ! ! 3292 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3293 ! ! 3294 ~ Ending Address* ~ 3295 ! ! 3296 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3298 Figure 20: Traffic Selector 3300 *Note: all fields other than TS Type and Selector Length depend on 3301 the TS Type. The fields shown are for TS Types 7 and 8, the only two 3302 values currently defined. 3304 o TS Type (one octet) - Specifies the type of traffic selector. 3306 o Protocol ID (1 octet) - Value specifying an associated IP 3307 protocol ID (e.g., UDP/TCP/ICMP). A value of zero means that 3308 the Protocol ID is not relevant to this traffic selector-- 3309 the SA can carry all protocols. 3311 o Selector Length - Specifies the length of this Traffic 3312 Selector Substructure including the header. 3314 o Start_Port (2 octets) - Value specifying the smallest port 3315 number allowed by this Traffic Selector. For protocols for 3316 which port is undefined, or if all ports are allowed by 3317 this Traffic Selector, this field MUST be zero. For the 3318 ICMP protocol, the two one octet fields Type and Code are 3319 treated as a single 16 bit integer port number for the 3320 purposes of filtering based on this field. 3322 o End_Port (2 octets) - Value specifying the largest port 3323 number allowed by this Traffic Selector. For protocols for 3324 which port is undefined, or if all ports are allowed by 3325 this Traffic Selector, this field MUST be 65535. For the 3326 ICMP protocol, the two one octet fields Type and Code are 3327 treated as a single 16 bit integer port number for the 3328 purposed of filtering based on this field. 3330 o Starting Address - The smallest address included in this 3331 Traffic Selector (length determined by TS type). 3333 o Ending Address - The largest address included in this 3334 Traffic Selector (length determined by TS type). 3336 The following table lists the assigned values for the Traffic 3337 Selector Type field and the corresponding Address Selector Data. 3339 TS Type Value 3340 ------- ----- 3341 RESERVED 0-6 3343 TS_IPV4_ADDR_RANGE 7 3345 A range of IPv4 addresses, represented by two four (4) octet 3346 values. The first value is the beginning IPv4 address 3347 (inclusive) and the second value is the ending IPv4 address 3348 (inclusive). All addresses falling between the two specified 3349 addresses are considered to be within the list. 3351 TS_IPV6_ADDR_RANGE 8 3353 A range of IPv6 addresses, represented by two sixteen (16) 3354 octet values. The first value is the beginning IPv6 address 3355 (inclusive) and the second value is the ending IPv6 address 3356 (inclusive). All addresses falling between the two specified 3357 addresses are considered to be within the list. 3359 3.14 Encrypted Payload 3361 The Encrypted Payload, denoted SK{...} in this memo, contains other 3362 payloads in encrypted form. The Encrypted Payload, if present in a 3363 message, MUST be the last payload in the message. Often, it is the 3364 only payload in the message. 3366 The algorithms for encryption and integrity protection are negotiated 3367 during IKE_SA setup, and the keys are computed as specified in 3368 sections 2.14 and 2.18. 3370 The encryption and integrity protection algorithms are modelled after 3371 the ESP algorithms described in RFCs 2104, 2406, 2451. This document 3372 completely specifies the cryptographic processing of IKE data, but 3373 those documents should be consulted for design rationale. We assume a 3374 block cipher with a fixed block size and an integrity check algorithm 3375 that computes a fixed length checksum over a variable size message. 3377 The payload type for an Encrypted payload is forty six (46). The 3378 Encrypted Payload consists of the IKE generic payload header followed 3379 by individual fields as follows: 3381 1 2 3 3382 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 3383 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3384 ! Next Payload !C! RESERVED ! Payload Length ! 3385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3386 ! Initialization Vector ! 3387 ! (length is block size for encryption algorithm) ! 3388 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3389 ! Encrypted IKE Payloads ! 3390 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3391 ! ! Padding (0-255 octets) ! 3392 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 3393 ! ! Pad Length ! 3394 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3395 ~ Integrity Checksum Data ~ 3396 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3398 Figure 21: Encrypted Payload Format 3400 o Next Payload - The payload type of the first embedded payload. 3401 Note that this is an exception in the standard header format, 3402 since the Encrypted payload is the last payload in the 3403 message and therefore the Next Payload field would normally 3404 be zero. But because the content of this payload is embedded 3405 payloads and there was no natural place to put the type of 3406 the first one, that type is placed here. 3408 o Payload Length - Includes the lengths of the header, IV, 3409 Encrypted IKE Payloads, Padding, Pad Length and Integrity 3410 Checksum Data. 3412 o Initialization Vector - A randomly chosen value whose length 3413 is equal to the block length of the underlying encryption 3414 algorithm. Recipients MUST accept any value. Senders SHOULD 3415 either pick this value pseudo-randomly and independently for 3416 each message or use the final ciphertext block of the previous 3417 message sent. Senders MUST NOT use the same value for each 3418 message, use a sequence of values with low hamming distance 3419 (e.g., a sequence number), or use ciphertext from a received 3420 message. 3422 o IKE Payloads are as specified earlier in this section. This 3423 field is encrypted with the negotiated cipher. 3425 o Padding MAY contain any value chosen by the sender, and MUST 3426 have a length that makes the combination of the Payloads, the 3427 Padding, and the Pad Length to be a multiple of the encryption 3428 block size. This field is encrypted with the negotiated 3429 cipher. 3431 o Pad Length is the length of the Padding field. The sender 3432 SHOULD set the Pad Length to the minimum value that makes 3433 the combination of the Payloads, the Padding, and the Pad 3434 Length a multiple of the block size, but the recipient MUST 3435 accept any length that results in proper alignment. This 3436 field is encrypted with the negotiated cipher. 3438 o Integrity Checksum Data is the cryptographic checksum of 3439 the entire message starting with the Fixed IKE Header 3440 through the Pad Length. The checksum MUST be computed over 3441 the encrypted message. 3443 3.15 Configuration Payload 3445 The Configuration payload, denoted CP in this document, is used to 3446 exchange configuration information between IKE peers. Currently, the 3447 only defined uses for this exchange is for an IRAC to request an 3448 internal IP address from an IRAS or for either party to request 3449 version information from the other, but this payload is intended as a 3450 likely place for future extensions. 3452 Configuration payloads are of type CFG_REQUEST/CFG_REPLY or 3453 CFG_SET/CFG_ACK (see CFG Type in the payload description below). 3454 CFG_REQUEST and CFG_SET payloads may optionally be added to any IKE 3455 request. The IKE response MUST include either a corresponding 3456 CFG_REPLY or CFG_ACK or a Notify payload with an error type 3457 indicating why the request could not be honored. An exception is that 3458 a minimal implementation MAY ignore all CFG_REQUEST and CFG_SET 3459 payloads, so a response message without a corresponding CFG_REPLY or 3460 CFG_ACK MUST be accepted as an indication that the request was not 3461 supported. 3463 "CFG_REQUEST/CFG_REPLY" allows an IKE endpoint to request information 3464 from its peer. If an attribute in the CFG_REQUEST Configuration 3465 Payload is not zero length it is taken as a suggestion for that 3466 attribute. The CFG_REPLY Configuration Payload MAY return that 3467 value, or a new one. It MAY also add new attributes and not include 3468 some requested ones. Requestors MUST ignore returned attributes that 3469 they do not recognize. 3471 Some attributes MAY be multi-valued, in which case multiple attribute 3472 values of the same type are sent and/or returned. Generally, all 3473 values of an attribute are returned when the attribute is requested. 3474 For some attributes (in this version of the specification only 3475 internal addresses), multiple requests indicates a request that 3476 multiple values be assigned. For these attributes, the number of 3477 values returned SHOULD NOT exceed the number requested. 3479 If the data type requested in a CFG_REQUEST is not recognized or not 3480 supported, the responder MUST NOT return an error type but rather 3481 MUST either send a CFG_REPLY which MAY be empty or a reply not 3482 containing a CFG_REPLY payload at all. Error returns are reserved for 3483 cases where the request is recognized but cannot be performed as 3484 requested or the request is badly formatted. 3486 "CFG_SET/CFG_ACK" allows an IKE endpoint to push configuration data 3487 to its peer. In this case the CFG_SET Configuration Payload contains 3488 attributes the initiator wants its peer to alter. The responder MUST 3489 return a Configuration Payload if it accepted any of the 3490 configuration data and it MUST contain the attributes that the 3491 responder accepted with zero length data. Those attributes that it 3492 did not accept MUST NOT be in the CFG_ACK Configuration Payload. If 3493 no attributes were accepted, the responder MUST return either an 3494 empty CFG_ACK payload or a response message without a CFG_ACK 3495 payload. There are currently no defined uses for the CFG_SET/CFG_ACK 3496 exchange, though they may be used in connection with extensions based 3497 on Vendor IDs. An minimal implementation of this specification MAY 3498 ignore CFG_SET payloads. 3500 Extensions via the CP payload SHOULD NOT be used for general purpose 3501 management. Its main intent is to provide a bootstrap mechanism to 3502 exchange information within IPsec from IRAS to IRAC. While it MAY be 3503 useful to use such a method to exchange information between some 3504 Security Gateways (SGW) or small networks, existing management 3505 protocols such as DHCP [DHCP], RADIUS [RADIUS], SNMP or LDAP [LDAP] 3506 should be preferred for enterprise management as well as subsequent 3507 information exchanges. 3509 The Configuration Payload is defined as follows: 3511 1 2 3 3512 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 3513 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3514 ! Next Payload !C! RESERVED ! Payload Length ! 3515 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3516 ! CFG Type ! RESERVED ! 3517 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3518 ! ! 3519 ~ Configuration Attributes ~ 3520 ! ! 3521 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3523 Figure 22: Configuration Payload Format 3525 The payload type for the Configuration Payload is forty seven (47). 3527 o CFG Type (1 octet) - The type of exchange represented by the 3528 Configuration Attributes. 3530 CFG Type Value 3531 =========== ===== 3532 RESERVED 0 3533 CFG_REQUEST 1 3534 CFG_REPLY 2 3535 CFG_SET 3 3536 CFG_ACK 4 3538 values 5-127 are reserved to IANA. Values 128-255 are for private 3539 use among mutually consenting parties. 3541 o RESERVED (3 octets) - MUST be sent as zero; MUST be ignored on 3542 receipt. 3544 o Configuration Attributes (variable length) - These are type 3545 length values specific to the Configuration Payload and are 3546 defined below. There may be zero or more Configuration 3547 Attributes in this payload. 3549 3.15.1 Configuration Attributes 3551 1 2 3 3552 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 3553 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3554 !R| Attribute Type ! Length | 3555 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3556 | | 3557 ~ Value ~ 3558 | | 3559 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3561 Figure 23: Configuration Attribute Format 3563 o Reserved (1 bit) - This bit MUST be set to zero and MUST be 3564 ignored on receipt. 3566 o Attribute Type (7 bits) - A unique identifier for each of the 3567 Configuration Attribute Types. 3569 o Length (2 octets) - Length in octets of Value. 3571 o Value (0 or more octets) - The variable length value of this 3572 Configuration Attribute. 3574 The following attribute types have been defined: 3576 Multi- 3577 Attribute Type Value Valued Length 3578 ======================= ===== ====== ================== 3579 RESERVED 0 3580 INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets 3581 INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets 3582 INTERNAL_IP4_DNS 3 YES 0 or 4 octets 3583 INTERNAL_IP4_NBNS 4 YES 0 or 4 octets 3584 INTERNAL_ADDRESS_EXPIRY 5 NO 0 or 4 octets 3585 INTERNAL_IP4_DHCP 6 YES 0 or 4 octets 3586 APPLICATION_VERSION 7 NO 0 or more 3587 INTERNAL_IP6_ADDRESS 8 YES* 0 or 16 octets 3588 INTERNAL_IP6_NETMASK 9 NO 0 or 16 octets 3589 INTERNAL_IP6_DNS 10 YES 0 or 16 octets 3590 INTERNAL_IP6_NBNS 11 YES 0 or 16 octets 3591 INTERNAL_IP6_DHCP 12 YES 0 or 16 octets 3592 INTERNAL_IP4_SUBNET 13 NO 0 or 8 octets 3593 SUPPORTED_ATTRIBUTES 14 NO Multiple of 2 3594 INTERNAL_IP6_SUBNET 15 NO 17 octets 3596 * These attributes may be multi-valued on return only if 3597 multiple values were requested. 3599 Types 16-16383 are reserved to IANA. Values 16384-32767 are for 3600 private use among mutually consenting parties. 3602 o INTERNAL_IP4_ADDRESS, INTERNAL_IP6_ADDRESS - An address on the 3603 internal network, sometimes called a red node address or 3604 private address and MAY be a private address on the Internet. 3605 Multiple internal addresses MAY be requested by requesting 3606 multiple internal address attributes. The responder MAY only 3607 send up to the number of addresses requested. 3609 The requested address is valid until the expiry time defined 3610 with the INTERNAL_ADDRESS EXPIRY attribute or there are no 3611 IKE_SAs between the peers. 3613 o INTERNAL_IP4_NETMASK, INTERNAL_IP6_NETMASK - The internal 3614 network's netmask. Only one netmask is allowed in the request 3615 and reply messages (e.g., 255.255.255.0) and it MUST be used 3616 only with an INTERNAL_ADDRESS attribute. 3618 o INTERNAL_IP4_DNS, INTERNAL_IP6_DNS - Specifies an address of a 3619 DNS server within the network. Multiple DNS servers MAY be 3620 requested. The responder MAY respond with zero or more DNS 3621 server attributes. 3623 o INTERNAL_IP4_NBNS, INTERNAL_IP6_NBNS - Specifies an address of 3624 a NetBios Name Server (WINS) within the network. Multiple NBNS 3625 servers MAY be requested. The responder MAY respond with zero 3626 or more NBNS server attributes. 3628 o INTERNAL_ADDRESS_EXPIRY - Specifies the number of seconds that 3629 the host can use the internal IP address. The host MUST renew 3630 the IP address before this expiry time. Only one of these 3631 attributes MAY be present in the reply. 3633 o INTERNAL_IP4_DHCP, INTERNAL_IP6_DHCP - Instructs the host to 3634 send any internal DHCP requests to the address contained within 3635 the attribute. Multiple DHCP servers MAY be requested. The 3636 responder MAY respond with zero or more DHCP server attributes. 3638 o APPLICATION_VERSION - The version or application information of 3639 the IPsec host. This is a string of printable ASCII characters 3640 that is NOT null terminated. 3642 o INTERNAL_IP4_SUBNET - The protected sub-networks that this 3643 edge-device protects. This attribute is made up of two fields; 3644 the first being an IP address and the second being a netmask. 3646 Multiple sub-networks MAY be requested. The responder MAY 3647 respond with zero or more sub-network attributes. 3649 o SUPPORTED_ATTRIBUTES - When used within a Request, this 3650 attribute MUST be zero length and specifies a query to the 3651 responder to reply back with all of the attributes that it 3652 supports. The response contains an attribute that contains a 3653 set of attribute identifiers each in 2 octets. The length 3654 divided by 2 (octets) would state the number of supported 3655 attributes contained in the response. 3657 o INTERNAL_IP6_SUBNET - The protected sub-networks that this 3658 edge-device protects. This attribute is made up of two fields; 3659 the first being a 16 octet IPv6 address the second being a one 3660 octet prefix-length as defined in [ADDRIPV6]. Multiple 3661 sub-networks MAY be requested. The responder MAY respond with 3662 zero or more sub-network attributes. 3664 Note that no recommendations are made in this document how an 3665 implementation actually figures out what information to send in a 3666 reply. i.e., we do not recommend any specific method of an IRAS 3667 determining which DNS server should be returned to a requesting 3668 IRAC. 3670 3.16 Extended Authentication Protocol (EAP) Payload 3672 The Extended Authentication Protocol Payload, denoted EAP in this 3673 memo, allows IKE_SAs to be authenticated using the protocol defined 3674 in RFC 2284 [EAP] and subsequent extensions to that protocol. The 3675 full set of acceptable values for the payload are defined elsewhere, 3676 but a short summary of RFC 2284 is included here to make this 3677 document stand alone in the common cases. 3679 1 2 3 3680 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 3681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3682 ! Next Payload !C! RESERVED ! Payload Length ! 3683 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3684 ! ! 3685 ~ EAP Message ~ 3686 ! ! 3687 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3689 Figure 24: EAP Payload Format 3691 The payload type for an EAP Payload is forty eight (49). 3693 1 2 3 3694 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 3695 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3696 ! Code ! Identifier ! Length ! 3697 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3698 ! Type ! Type_Data... 3699 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 3701 Figure 25: EAP Message Format 3703 o Code (one octet) indicates whether this message is a 3704 Request (1), Response (2), Success (3), or Failure (4). 3706 o Identifier (one octet) is used in PPP to distinguish replayed 3707 messages from repeated ones. Since in IKE, EAP runs over a 3708 reliable protocol, it serves no function here. In a response 3709 message this octet MUST be set to match the identifier in the 3710 corresponding request. In other messages, this field MAY 3711 be set to any value. 3713 o Length (two octets) is the length of the EAP message and MUST 3714 be four less than the Payload Length of the encapsulating 3715 payload. 3717 o Type (one octet) is present only if the Code field is Request 3718 (1) or Response (2). For other types, the EAP message length 3719 MUST be four octets and the Type and Type_Data fields MUST NOT 3720 be present. In a Request (1) message, Type indicates the 3721 data being requested. In a Response (2) message, Type MUST 3722 either be NAC or match the type of the data requested. The 3723 following types are defined in RFC 2284: 3725 1 Identity 3726 2 Notification 3727 3 NAK (Response Only) 3728 4 MD5-Challenge 3729 5 One-Time Password (OTP) 3730 6 Generic Token Card 3732 o Type_Data (Variable Length) contains data depending on the Code 3733 and Type. In Requests other than MD5-Challenge, this field 3734 contains a prompt to be displayed to a human user. For NAK, it 3735 contains one octet suggesting the type of authentication the 3736 Initiator would prefer to use. For most other responses, it 3737 contains the authentication code typed by the human user. 3739 Note that since IKE passes an indication of initiator identity in 3740 message 3 of the protocol, EAP based prompts for Identity SHOULD NOT 3741 be used. 3743 4 Conformance Requirements 3745 In order to assure that all implementations of IKEv2 can 3746 interoperate, there are MUST support requirements in addition to 3747 those listed elsewhere. Of course, IKEv2 is a security protocol, and 3748 one of its major functions is preventing the bad guys from 3749 interoperating with one's systems. So a particular implementation may 3750 be configured with any of a number of restrictions concerning 3751 algorithms and trusted authorities that will prevent universal 3752 interoperability. 3754 IKEv2 is designed to permit minimal implementations that can 3755 interoperate with all compliant implementations. There are a series 3756 of optional features that can easily be ignored by a particular 3757 implementation if it does not support that feature. Those features 3758 include: 3760 Ability to negotiate SAs through a NAT and tunnel the resulting ESP 3761 SA over UDP. 3763 Ability to request (and respond to a request for) a temporary IP 3764 address on the remote end of a tunnel. 3766 Ability to support various types of legacy authentication. 3768 Ability to support window sizes greater than one. 3770 Ability to establish multiple ESP and/or AH SAs within a single 3771 IKE_SA. 3773 Ability to rekey SAs. 3775 To assure interoperability, all implementations MUST be capable of 3776 parsing all payload types (if only to skip over them) and to ignore 3777 payload types that it does not support unless the critical bit is set 3778 in the payload header. If the critical bit is set in an unsupported 3779 payload header, all implementations MUST reject the messages 3780 containing those payloads. 3782 Every implementation MUST be capable of doing four message 3783 IKE_SA_INIT and IKE_AUTH exchanges establishing two SAs (one for IKE, 3784 one for ESP and/or AH). Implementations MAY be initiate-only or 3785 respond-only if appropriate for their platform. Every implementation 3786 MUST be capable of responding to an INFORMATIONAL exchange, but a 3787 minimal implementation MAY respond to any INFORMATIONAL message with 3788 an empty INFORMATIONAL reply. A minimal implementation MAY support 3789 the CREATE_CHILD_SA exchange only in so far as to recognize requests 3790 and reject them with a Notify payload of type NO_ADDITIONAL_SAS. A 3791 minimal implementation need not be able to initiate CREATE_CHILD_SA 3792 or INFORMATIONAL exchanges. When an SA expires (based on locally 3793 configured values of either lifetime or octets passed), and 3794 implementation MAY either try to renew it with a CREATE_CHILD_SA 3795 exchange or it MAY delete (close) the old SA and create a new one. If 3796 the responder rejects the CREATE_CHILD_SA request with a 3797 NO_ADDITIONAL_SAS notification, the implementation MUST be capable of 3798 instead closing the old SA and creating a new one. 3800 Implementations are not required to support requesting temporary IP 3801 addresses or responding to such requests. If an implementation does 3802 support issuing such requests, it MUST include a CP payload in 3803 message 3 containing at least a field of type INTERNAL_IP4_ADDRESS or 3804 INTERNAL_IP6_ADDRESS. All other fields are optional. If an 3805 implementation supports responding to such requests, it MUST parse 3806 the CP payload of type CFG_REQUEST in message 3 and recognize a field 3807 of type INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. If it supports 3808 leasing an address of the appropriate type, it MUST return a CP 3809 payload of type CFG_REPLY containing an address of the requested 3810 type. The responder SHOULD include all of the other related 3811 attributes if it has them. 3813 A minimal IPv4 responder implementation will ignore the contents of 3814 the CP payload except to determine that it includes an 3815 INTERNAL_IP4_ADDRESS attribute and will respond with the address and 3816 other related attributes regardless of whether the initiator 3817 requested them. 3819 A minimal IPv4 initiator will generate a CP payload containing only 3820 an INTERNAL_IP4_ADDRESS attribute and will parse the response 3821 ignoring attributes it does not know how to use. The only attribute 3822 it MUST be able to process is INTERNAL_ADDRESS_EXPIRY, which it must 3823 use to bound the lifetime of the SA unless it successfully renews the 3824 lease before it expires. Minimal initiators need not be able to 3825 request lease renewals and minimal responders need not respond to 3826 them. 3828 For an implementation to be called conforming to this specification, 3829 it MUST be possible to configure it to accept the following: 3831 PKIX Certificates containing and signed by RSA keys of size 1024 or 3832 2048 bits, where the ID passed is any of ID_KEY_ID, ID_FQDN, 3833 ID_RFC822_ADDR, or ID_DER_ASN1_DN. 3835 Shared key authentication where the ID passes is any of ID_KEY_ID, 3836 ID_FQDN, or ID_RFC822_ADDR. 3838 Authentication where the responder is authenticated using PKIX 3839 Certificates and the initiator is authenticated using shared key 3840 authentication. 3842 5 Security Considerations 3844 Repeated re-keying using CREATE_CHILD_SA without PFS leaves all SAs 3845 vulnerable to cryptanalysis of a single key or overrun of either 3846 endpoint. Implementers should take note of this fact and set a limit 3847 on CREATE_CHILD_SA exchanges between exponentiations. This memo does 3848 not prescribe such a limit. 3850 The strength of a key derived from a Diffie-Hellman exchange using 3851 any of the groups defined here depends on the inherent strength of 3852 the group, the size of the exponent used, and the entropy provided by 3853 the random number generator used. Due to these inputs it is difficult 3854 to determine the strength of a key for any of the defined groups. 3855 Diffie-Hellman group number two, when used with a strong random 3856 number generator and an exponent no less than 200 bits, is sufficient 3857 for use with 3DES. Groups three through five provide greater 3858 security. Group one is for historic purposes only and does not 3859 provide sufficient strength except for use with DES, which is also 3860 for historic use only. Implementations should make note of these 3861 conservative estimates when establishing policy and negotiating 3862 security parameters. 3864 Note that these limitations are on the Diffie-Hellman groups 3865 themselves. There is nothing in IKE which prohibits using stronger 3866 groups nor is there anything which will dilute the strength obtained 3867 from stronger groups (limited by the strength of the other algorithms 3868 negotiated including the prf function). In fact, the extensible 3869 framework of IKE encourages the definition of more groups; use of 3870 elliptical curve groups may greatly increase strength using much 3871 smaller numbers. 3873 It is assumed that all Diffie-Hellman exponents are erased from 3874 memory after use. In particular, these exponents MUST NOT be derived 3875 from long-lived secrets like the seed to a pseudo-random generator 3876 that is not erased after use. 3878 The strength of all keys are limited by the size of the output of the 3879 negotiated prf function. For this reason, a prf function whose output 3880 is less than 128 bits (e.g., 3DES-CBC) MUST never be used with this 3881 protocol. 3883 The security of this protocol is critically dependent on the 3884 randomness of the randomly chosen parameters. These should be 3885 generated by a strong random or properly seeded pseudo-random source 3886 (see [RFC1750]). Implementers should take care to ensure that use of 3887 random numbers for both keys and nonces is engineered in a fashion 3888 that does not undermine the security of the keys. 3890 For information on the rationale of many of the cryptographic design 3891 choices in this protocol, see [SIGMA]. 3893 When using pre-shared keys, a critical consideration is how to assure 3894 the randomness of these secrets. The strongest practice is to ensure 3895 that any pre-shared key contain as much randomness as the strongest 3896 key being negotiated. Deriving a shared secret from a password, name, 3897 or other low entropy source is not secure. These sources are subject 3898 to dictionary and social engineering attacks, among others. 3900 The NAT_DETECTION_*_IP notifications contain a hash of the addresses 3901 and ports in an attempt to hide internal IP addresses behind a NAT 3902 from the IKE peer. As the IPv4 address space is only 32 bits, and it 3903 is usually very sparse, it might be possible for the attacker to find 3904 out the internal address used behind the NAT box by trying all 3905 possible IP-addresses and trying to find the matching hash. The port 3906 numbers are normally fixed to 500, and the SPIs can be extracted from 3907 the packet. This limits the hash calculations down to 2^32. If 3908 educated guess of use of private address space is done, then the 3909 number of hash calculations needed to find out the internal IP 3910 address goes down to the 2^24 + 2 * (2^16). 3912 6 IANA Considerations 3914 This document contains many "magic numbers" to be maintained by the 3915 Internet Assigned Numbers Authority (IANA). While in many cases the 3916 values were chosen so as to avoid collisions with other 3917 specifications, these should be considered a new IANA registry for 3918 IKEv2. The tables to be maintained are: 3920 Payload Types 3921 Transform Types 3922 For each Transform Type defined, the assigned Transform values 3923 Authentication Method 3924 Security Protocol ID 3925 Error types 3926 Status types 3927 IPComp Transform IDs 3928 Configuration request types 3929 Configuration attribute types 3931 7 Intellectual Property Rights 3933 The IETF has been notified of intellectual property rights claimed in 3934 regard to some or all of the specification contained in this 3935 document. For more information consult the online list of claimed 3936 rights. 3938 8 Acknowledgements 3940 This document is a collaborative effort of the entire IPsec WG. If 3941 there were no limit to the number of authors that could appear on an 3942 RFC, the following, in alphabetical order, would have been listed: 3943 Bill Aiello, Stephane Beaulieu, Steve Bellovin, Sara Bitan, Matt 3944 Blaze, Ran Canetti, Darren Dukes, Dan Harkins, Paul Hoffman, J. 3945 Ioannidis, Steve Kent, Angelos Keromytis, Tero Kivinen, Hugo 3946 Krawczyk, Andrew Krywaniuk, Radia Perlman, O. Reingold. Many other 3947 people contributed to the design. It is an evolution of IKEv1, 3948 ISAKMP, and the IPsec DOI, each of which has its own list of authors. 3949 Hugh Daniel suggested the feature of having the initiator, in message 3950 3, specify a name for the responder, and gave the feature the cute 3951 name "You Tarzan, Me Jane". David Faucher and Valery Smyzlov helped 3952 refine the design of the traffic selector negotiation. 3954 9 References 3956 9.1 Normative References 3958 [ADDGROUP] Kivinen, T., and Kojo, M., "More Modular Exponential 3959 (MODP) Diffie-Hellman groups for Internet Key 3960 Exchange (IKE)", RFC 3526, May 2003. 3962 [ADDRIPV6] Hinden, R., and Deering, S., 3963 "Internet Protocol Version 6 (IPv6) Addressing 3964 Architecture", RFC 3513, April 2003. 3966 [Bra96] Bradner, S., "The Internet Standards Process -- 3967 Revision 3", BCP 9, RFC 2026, October 1996. 3969 [Bra97] Bradner, S., "Key Words for use in RFCs to indicate 3970 Requirement Levels", BCP 14, RFC 2119, March 1997. 3972 [EAP] Blunk, L. and Vollbrecht, J., "PPP Extensible 3973 Authentication Protocol (EAP), RFC 2284, March 1998. 3975 [ESPCBC] Pereira, R., Adams, R., "The ESP CBC-Mode Cipher 3976 Algorithms", RFC 2451, November 1998. 3978 [RFC 3280] Housley, R., Polk, W., Ford, W., Solo, D., "Internet 3979 X.509 Public Key Infrastructure Certificate and 3980 Certificate Revocation List (CRL) Profile", RFC 3280, 3981 April 2002. 3983 9.2 Non-normative References 3985 [Ble98] Bleichenbacher, D., "Chosen Ciphertext Attacks against 3986 Protocols Based on RSA Encryption Standard PKCS#1", 3987 Advances in Cryptology Eurocrypt '98, Springer-Verlag, 3988 1998. 3990 [BR94] Bellare, M., and Rogaway P., "Optimal Asymmetric 3991 Encryption", Advances in Cryptology Eurocrypt '94, 3992 Springer-Verlag, 1994. 3994 [DES] ANSI X3.106, "American National Standard for Information 3995 Systems-Data Link Encryption", American National Standards 3996 Institute, 1983. 3998 [DH] Diffie, W., and Hellman M., "New Directions in 3999 Cryptography", IEEE Transactions on Information Theory, V. 4000 IT-22, n. 6, June 1977. 4002 [DHCP] R. Droms, "Dynamic Host Configuration Protocol", 4003 RFC2131 4005 [DSS] NIST, "Digital Signature Standard", FIPS 186, National 4006 Institute of Standards and Technology, U.S. Department of 4007 Commerce, May, 1994. 4009 [HC98] Harkins, D., Carrel, D., "The Internet Key Exchange 4010 (IKE)", RFC 2409, November 1998. 4012 [Hutt02] Huttunen, A. et. al., "UDP Encapsulation of IPsec 4013 Packets", draft-ietf-ipsec-udp-encaps-05.txt, December 4014 2002. 4016 [IDEA] Lai, X., "On the Design and Security of Block Ciphers," 4017 ETH Series in Information Processing, v. 1, Konstanz: 4018 Hartung-Gorre Verlag, 1992 4020 [IPCOMP] Shacham, A., Monsour, R., Pereira, R., and Thomas, M., "IP 4021 Payload Compression Protocol (IPComp)", RFC 3173, 4022 September 2001. 4024 [Ker01] Keromytis, A., Sommerfeld, B., "The 'Suggested ID' 4025 Extension for IKE", draft-keromytis-ike-id-00.txt, 2001 4027 [KBC96] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 4028 Hashing for Message Authentication", RFC 2104, February 4029 1997. 4031 [LDAP] M. Wahl, T. Howes, S. Kille., "Lightweight Directory 4032 Access Protocol (v3)", RFC2251 4034 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, 4035 April 1992. 4037 [MSST98] Maughhan, D., Schertler, M., Schneider, M., and Turner, J. 4038 "Internet Security Association and Key Management Protocol 4039 (ISAKMP)", RFC 2408, November 1998. 4041 [Orm96] Orman, H., "The Oakley Key Determination Protocol", RFC 4042 2412, November 1998. 4044 [PFKEY] McDonald, D., Metz, C., and Phan, B., "PFKEY Key 4045 Management API, Version 2", RFC2367, July 1998. 4047 [PKCS1] Kaliski, B., and J. Staddon, "PKCS #1: RSA Cryptography 4048 Specifications Version 2", September 1998. 4050 [PK01] Perlman, R., and Kaufman, C., "Analysis of the IPsec key 4051 exchange Standard", WET-ICE Security Conference, MIT,2001, 4052 http://sec.femto.org/wetice-2001/papers/radia-paper.pdf. 4054 [Pip98] Piper, D., "The Internet IP Security Domain Of 4055 Interpretation for ISAKMP", RFC 2407, November 1998. 4057 [RADIUS] C. Rigney, A. Rubens, W. Simpson, S. Willens, "Remote 4058 Authentication Dial In User Service (RADIUS)", RFC2138 4060 [RFC1750] Eastlake, D., Crocker, S., and Schiller, J., "Randomness 4061 Recommendations for Security", RFC 1750, December 1994. 4063 [RFC2401] Kent, S., and Atkinson, R., "Security Architecture for 4064 the Internet Protocol", RFC 2401, November 1998. 4066 [RFC2474] Nichols, K., Blake, S., Baker, F. and Black, D., 4067 "Definition of the Differentiated Services Field (DS 4068 Field) in the IPv4 and IPv6 Headers", RFC 2474, 4069 December 1998. 4071 [RFC2475] Blake, S., Black, D., Carlson, M., Davies, E., Wang, Z. 4072 and Weiss, W., "An Architecture for Differentiated 4073 Services", RFC 2475, December 1998. 4075 [RFC2522] Karn, P., and Simpson, W., "Photuris: Session-Key 4076 Management Protocol", RFC 2522, March 1999. 4078 [RFC3168] Ramakrishnan, K., Floyd, S., and Black, D., 4079 "The Addition of Explicit Congestion Notification (ECN) 4080 to IP", RFC 3168, September 2001. 4082 [RSA] Rivest, R., Shamir, A., and Adleman, L., "A Method for 4083 Obtaining Digital Signatures and Public-Key 4084 Cryptosystems", Communications of the ACM, v. 21, n. 2, 4085 February 1978. 4087 [SHA] NIST, "Secure Hash Standard", FIPS 180-1, National 4088 Institute of Standards and Technology, U.S. Department 4089 of Commerce, May 1994. 4091 [SIGMA] Krawczyk, H., "SIGMA: the `SIGn-and-MAc' Approach to 4092 Authenticated Diffie-Hellman and its Use in the IKE 4093 Protocols", in Advances in Cryptography - CRYPTO 2003 4094 Proceedings, LNCS 2729, Springer, 2003. Available at: 4095 http://www.ee.technion.ac.il/~hugo/sigma.html 4097 [SKEME] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange 4098 Mechanism for Internet", from IEEE Proceedings of the 4099 1996 Symposium on Network and Distributed Systems 4100 Security. 4102 [X.501] ITU-T Recommendation X.501: Information Technology - 4103 Open Systems Interconnection - The Directory: Models, 4104 1993. 4106 [X.509] ITU-T Recommendation X.509 (1997 E): Information 4107 Technology - Open Systems Interconnection - The 4108 Directory: Authentication Framework, June 1997. 4110 Appendix A: Summary of changes from IKEv1 4112 The goals of this revision to IKE are: 4114 1) To define the entire IKE protocol in a single document, replacing 4115 RFCs 2407, 2408, and 2409 and incorporating subsequent changes to 4116 support NAT Traversal, Extended Authentication, and Remote Address 4117 acquisition. 4119 2) To simplify IKE by replacing the eight different initial exchanges 4120 with a single four message exchange (with changes in authentication 4121 mechanisms affecting only a single AUTH payload rather than 4122 restructuring the entire exchange); 4124 3) To remove the Domain of Interpretation (DOI), Situation (SIT), and 4125 Labeled Domain Identifier fields, and the Commit and Authentication 4126 only bits; 4128 4) To decrease IKE's latency in the common case by making the initial 4129 exchange be 2 round trips (4 messages), and allowing the ability to 4130 piggyback setup of a CHILD-SA on that exchange; 4132 5) To replace the cryptographic syntax for protecting the IKE 4133 messages themselves with one based closely on ESP to simplify 4134 implementation and security analysis; 4136 6) To reduce the number of possible error states by making the 4137 protocol reliable (all messages are acknowledged) and sequenced. This 4138 allows shortening CREATE_CHILD_SA exchanges from 3 messages to 2; 4140 7) To increase robustness by allowing the responder to not do 4141 significant processing until it receives a message proving that the 4142 initiator can receive messages at its claimed IP address, and not 4143 commit any state to an exchange until the initiator can be 4144 cryptographically authenticated; 4146 8) To fix bugs such as the hash problem documented in [draft-ietf- 4147 ipsec-ike-hash-revised-02.txt]; 4149 9) To specify Traffic Selectors in their own payloads type rather 4150 than overloading ID payloads, and making more flexible the Traffic 4151 Selectors that may be specified; 4153 10) To specify required behavior under certain error conditions or 4154 when data that is not understood is received in order to make it 4155 easier to make future revisions in a way that does not break 4156 backwards compatibility; 4157 11) To incorporate ideas from draft-ietf-ipsec-nat-reqts-04.txt to 4158 allow IKE to negotiate through NAT gateways; 4160 12) To simplify and clarify how shared state is maintained in the 4161 presence of network failures and Denial of Service attacks; and 4163 13) To maintain existing syntax and magic numbers to the extent 4164 possible to make it likely that implementations of IKEv1 can be 4165 enhanced to support IKEv2 with minimum effort. 4167 Appendix B: Diffie-Hellman Groups 4169 There are 5 different Diffie-Hellman groups defined for use in IKE. 4170 These groups were generated by Richard Schroeppel at the University 4171 of Arizona. Properties of these primes are described in [Orm96]. 4173 The strength supplied by group one may not be sufficient for the 4174 mandatory-to-implement encryption algorithm and is here for historic 4175 reasons. 4177 Additional Diffie-Hellman groups have been defined in [ADDGROUP]. 4179 B.1 Group 1 - 768 Bit MODP 4181 This group is assigned id 1 (one). 4183 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 4184 Its hexadecimal value is: 4186 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 4187 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 4188 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 4189 A63A3620 FFFFFFFF FFFFFFFF 4191 The generator is 2. 4193 B.2 Group 2 - 1024 Bit MODP 4195 This group is assigned id 2 (two). 4197 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 4198 Its hexadecimal value is: 4200 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 4201 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 4202 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 4203 A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 4204 49286651 ECE65381 FFFFFFFF FFFFFFFF 4206 The generator is 2. 4208 B.3 Group 3 - 155 Bit EC2N 4210 This group is assigned id 3 (three). The curve is based on the Galois 4211 Field GF[2^155]. The field size is 155. The irreducible polynomial 4212 for the field is: 4213 u^155 + u^62 + 1. 4214 The equation for the elliptic curve is: 4215 y^2 + xy = x^3 + ax^2 + b. 4217 Field Size: 155 4218 Group Prime/Irreducible Polynomial: 4219 0x0800000000000000000000004000000000000001 4220 Group Generator One: 0x7b 4221 Group Curve A: 0x0 4222 Group Curve B: 0x07338f 4223 Group Order: 0x0800000000000000000057db5698537193aef944 4225 The data in the KE payload when using this group is the value x from 4226 the solution (x,y), the point on the curve chosen by taking the 4227 randomly chosen secret Ka and computing Ka*P, where * is the 4228 repetition of the group addition and double operations, P is the 4229 curve point with x coordinate equal to generator 1 and the y 4230 coordinate determined from the defining equation. The equation of 4231 curve is implicitly known by the Group Type and the A and B 4232 coefficients. There are two possible values for the y coordinate; 4233 either one can be used successfully (the two parties need not agree 4234 on the selection). 4236 B.4 Group 4 - 185 Bit EC2N 4238 This group is assigned id 4 (four). The curve is based on the Galois 4239 Field GF[2^185]. The field size is 185. The irreducible polynomial 4240 for the field is: 4241 u^185 + u^69 + 1. 4243 The equation for the elliptic curve is: 4244 y^2 + xy = x^3 + ax^2 + b. 4246 Field Size: 185 4247 Group Prime/Irreducible Polynomial: 4248 0x020000000000000000000000000000200000000000000001 4249 Group Generator One: 0x18 4250 Group Curve A: 0x0 4251 Group Curve B: 0x1ee9 4252 Group Order: 0x01ffffffffffffffffffffffdbf2f889b73e484175f94ebc 4254 The data in the KE payload when using this group will be identical to 4255 that as when using Oakley Group 3 (three). 4257 Change History (To be removed from RFC) 4259 H.1 Changes from IKEv2-00 to IKEv2-01 February 2002 4261 1) Changed Appendix B to specify the encryption and authentication 4262 processing for IKE rather than referencing ESP. Simplified the format 4263 by removing idiosyncrasies not needed for IKE. 4265 2) Added option for authentication via a shared secret key. 4267 3) Specified different keys in the two directions of IKE messages. 4268 Removed requirement of different cookies in the two directions since 4269 now no longer required. 4271 4) Change the quantities signed by the two ends in AUTH fields to 4272 assure the two parties sign different quantities. 4274 5) Changed reference to AES to AES_128. 4276 6) Removed requirement that Diffie-Hellman be repeated when rekeying 4277 IKE_SA. 4279 7) Fixed typos. 4281 8) Clarified requirements around use of port 500 at the remote end in 4282 support of NAT. 4284 9) Clarified required ordering for payloads. 4286 10) Suggested mechanisms for avoiding DoS attacks. 4288 11) Removed claims in some places that the first phase 2 piggybacked 4289 on phase 1 was optional. 4291 H.2 Changes from IKEv2-01 to IKEv2-02 April 2002 4293 1) Moved the Initiator CERTREQ payload from message 1 to message 3. 4295 2) Added a second optional ID payload in message 3 for the Initiator 4296 to name a desired Responder to support the case where multiple named 4297 identities are served by a single IP address. 4299 3) Deleted the optimization whereby the Diffie-Hellman group did not 4300 need to be specified in phase 2 if it was the same as in phase 1 (it 4301 complicated the design with no meaningful benefit). 4303 4) Added a section on the implications of reusing Diffie-Hellman 4304 expontentials 4305 5) Changed the specification of sequence numbers to being at 0 in 4306 both directions. 4308 6) Many editorial changes and corrections, the most significant being 4309 a global replace of "byte" with "octet". 4311 H.3 Changes from IKEv2-02 to IKEv2-03 October 2002 4313 1) Reorganized the document moving introductory material to the 4314 front. 4316 2) Simplified the specification of Traffic Selectors to allow only 4317 IPv4 and IPv6 address ranges, as was done in the JFK spec. 4319 3) Fixed the problem brought up by David Faucher with the fix 4320 suggested by Valery Smyslov. If Bob needs to narrow the selector 4321 range, but has more than one matching narrower range, then if Alice's 4322 first selector is a single address pair, Bob chooses the range that 4323 encompasses that. 4325 4) To harmonize with the JFK spec, changed the exchange so that the 4326 initial exchange can be completed in four messages even if the 4327 responder must invoke an anti-clogging defense and the initiator 4328 incorrectly anticipates the responder's choice of Diffie-Hellman 4329 group. 4331 5) Replaced the hierarchical SA payload with a simplified version 4332 that only negotiates suites of cryptographic algorithms. 4334 H.4 Changes from IKEv2-03 to IKEv2-04 January 2003 4336 1) Integrated NAT traversal changes (including Appendix A). 4338 2) Moved the anti-clogging token (cookie) from the SPI to a NOTIFY 4339 payload; changed negotiation back to 6 messages when a cookie is 4340 needed. 4342 3) Made capitalization of IKE_SA and CHILD_SA consistent. 4344 4) Changed how IPComp was negotiated. 4346 5) Added usage scenarios. 4348 6) Added configuration payload for acquiring internal addresses on 4349 remote networks. 4351 7) Added negotiation of tunnel vs transport mode. 4353 H.5 Changes from IKEv2-04 to IKEv2-05 February 2003 4355 1) Shortened Abstract 4357 2) Moved NAT Traversal from Appendix to section 2. Moved changes from 4358 IKEv2 to Appendix A. Renumbered sections. 4360 3) Made language more consistent. Removed most references to Phase 1 4361 and Phase 2. 4363 4) Made explicit the requirements for support of NAT Traversal. 4365 5) Added support for Extended Authentication Protocol methods. 4367 6) Added Response bit to message header. 4369 7) Made more explicit the encoding of Diffie-Hellman numbers in key 4370 expansion algorithms. 4372 8) Added ID payloads to AUTH payload computation. 4374 9) Expanded set of defined cryptographic suites. 4376 10) Added text for MUST/SHOULD support for ID payloads. 4378 11) Added new certificate formats and added MUST/SHOULD text. 4380 12) Clarified use of CERTREQ. 4382 13) Deleted "MUST SUPPORT" column in CP payload specification (it was 4383 inconsistent with surrounding text). 4385 14) Extended and clarified Conformance Requirements section, 4386 including specification of a minimal implementation. 4388 15) Added text to specify ECN handling. 4390 H.6 Changes from IKEv2-05 to IKEv2-06 March 2003 4392 1) Changed the suite based crypto negotiation back to ala carte. 4394 2) Eliminated some awkward page breaks, typographical errors, and 4395 other formatting issues. 4397 3) Tightened language describing cryptographic strength. 4399 4) Added references. 4401 5) Added more specific error codes. 4403 6) Added rationale for unintuitive key generation hash with shared 4404 secret based authentication. 4406 7) Changed the computation of the authenticating AUTH payload as 4407 proposed by Hugo Krawczyk. 4409 8) Changed the dashes (-) to underscores (_) in the names of fields 4410 and constants. 4412 H.7 Changes from IKEv2-06 to IKEv2-07 April 2003 4414 1) Added a list of payload types to section 3.2. 4416 2) Clarified use of SET_WINDOW_SIZE Notify payload. 4418 3) Removed references to COOKIE_REQUIRED Notify payload. 4420 4) Specified how to use a prf with a fixed key size. 4422 5) Removed g^ir from data processed by prf+. 4424 6) Strengthened cautions against using passwords as shared keys. 4426 7) Renamed Protocol_id field SECURITY_PROTOCOL_ID when it is not the 4427 Protocol ID from IP, and changed its values for consistency with 4428 IKEv1. 4430 8) Clarified use of ID payload in access control decisions. 4432 9) Gave IDr and TSr their own payload type numbers. 4434 10) Added Intellectual Property rights section. 4436 11) Clarified some issues in NAT Traversal. 4438 H.8 Changes from IKEv2-07 to IKEv2-08 May 2003 4440 1) Numerous editorial corrections and clarifications. 4442 2) Renamed Gateway to Security Gateway. 4444 3) Made explicit that the ability to rekey SAs without restarting IKE 4445 was optional. 4447 4) Removed last references to MUST and SHOULD ciphersuites. 4449 5) Changed examples to "example.com". 4451 6) Changed references to status codes to status types. 4453 7) Simplified IANA Considerations section 4455 8) Updated References 4457 H.9 Changes from IKEv2-08 to IKEv2-09 August 2003 4459 1) Numerous editorial corrections and clarifications. 4461 2) Added REKEY_SA notify payload to the first message of a 4462 CREATE_CHILD_SA exchange if the new exchange was rekeying an existing 4463 SA. 4465 3) Renamed AES_ENCR128 to AES_ENCR and made it take a single 4466 parameter that is the key size (which may be 128, 192, or 256 bits). 4468 4) Clarified when a newly created SA is useable. 4470 5) Added additional text to section 2.23 specifying how to negotiate 4471 NAT Traversal. 4473 6) Replaced specification of ECN handling with a reference to 4474 [RFC2401bis]. 4476 7) Renumbered payloads so that numbers would not collide with IKEv1 4477 payload numbers in hopes of making code implementing both protocols 4478 simpler. 4480 8) Expanded the Transform ID field (also referred to as Diffie- 4481 Hellman group number) from one byte to two bytes. 4483 9) Removed ability to negotiate Diffie-Hellman groups by explicitly 4484 passing parameters. They must now be negotiated using Transform IDs. 4486 10) Renumbered status codes to be contiguous. 4488 11) Specified the meaning of the "Port" fields in Traffic Selectors 4489 when the ICMP protocol is being used. 4491 12) Removed the specification of D-H Group #5 since it is already 4492 specified in [ADDGROUP]. 4494 Editor's Address 4496 Charlie Kaufman 4497 charlie_kaufman@notesdev.ibm.com 4498 IBM 4500 Full Copyright Statement 4502 "Copyright (C) The Internet Society (2003). All Rights Reserved. 4504 This document and translations of it may be copied and furnished to 4505 others, and derivative works that comment on or otherwise explain it 4506 or assist in its implementation may be prepared, copied, published 4507 and distributed, in whole or in part, without restriction of any 4508 kind, provided that the above copyright notice and this paragraph are 4509 included on all such copies and derivative works. However, this 4510 document itself may not be modified in any way, such as by removing 4511 the copyright notice or references to the Internet Society or other 4512 Internet organizations, except as needed for the purpose of 4513 developing Internet standards in which case the procedures for 4514 copyrights defined in the Internet Standards process must be 4515 followed, or as required to translate it into languages other than 4516 English. 4518 The limited permissions granted above are perpetual and will not be 4519 revoked by the Internet Society or its successors or assigns. 4521 This document and the information contained herein is provided on an 4522 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 4523 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 4524 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 4525 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 4526 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."