idnits 2.17.1 draft-ietf-ipsec-ikev2-06.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 92 longer pages, the longest (page 2) being 61 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 93 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 4 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 4084 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). == 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, "lounge.org". 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, "lizard@lounge.org". 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 (March 2003) is 7706 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'CERTREQ' is mentioned on line 1318, but not defined == Missing Reference: 'KEi' is mentioned on line 425, but not defined == Missing Reference: 'KEr' is mentioned on line 443, but not defined == Missing Reference: 'CP' is mentioned on line 519, but not defined == Missing Reference: 'RFC 2522' is mentioned on line 791, but not defined == Missing Reference: 'AUTH' is mentioned on line 1328, but not defined == Missing Reference: 'IPCOMP' is mentioned on line 1548, but not defined == Missing Reference: 'RFC 2401' is mentioned on line 1661, but not defined ** Obsolete undefined reference: RFC 2401 (Obsoleted by RFC 4301) == Missing Reference: 'RFC 3168' is mentioned on line 1669, but not defined == Missing Reference: 'IKEv2' is mentioned on line 1681, but not defined == Missing Reference: 'RFC 2474' is mentioned on line 1703, but not defined == Missing Reference: 'RFC 2475' is mentioned on line 1704, but not defined == Missing Reference: 'RFC2401' is mentioned on line 1712, but not defined ** Obsolete undefined reference: RFC 2401 (Obsoleted by RFC 4301) == Missing Reference: 'P' is mentioned on line 2170, but not defined == Missing Reference: 'ADDRIPV6' is mentioned on line 3560, but not defined == Missing Reference: 'ADDGROUP' is mentioned on line 4014, but not defined == Unused Reference: 'ESPCBC' is defined on line 3852, but no explicit reference was found in the text == Unused Reference: 'Ble98' is defined on line 3858, but no explicit reference was found in the text == Unused Reference: 'BR94' is defined on line 3862, but no explicit reference was found in the text == Unused Reference: 'DES' is defined on line 3866, but no explicit reference was found in the text == Unused Reference: 'DH' is defined on line 3870, but no explicit reference was found in the text == Unused Reference: 'DSS' is defined on line 3877, but no explicit reference was found in the text == Unused Reference: 'HC98' is defined on line 3881, but no explicit reference was found in the text == Unused Reference: 'IDEA' is defined on line 3884, but no explicit reference was found in the text == Unused Reference: 'Ker01' is defined on line 3888, but no explicit reference was found in the text == Unused Reference: 'KBC96' is defined on line 3891, but no explicit reference was found in the text == Unused Reference: 'MD5' is defined on line 3898, but no explicit reference was found in the text == Unused Reference: 'MSST98' is defined on line 3901, but no explicit reference was found in the text == Unused Reference: 'PKCS1' is defined on line 3911, but no explicit reference was found in the text == Unused Reference: 'PK01' is defined on line 3914, but no explicit reference was found in the text == Unused Reference: 'Pip98' is defined on line 3918, but no explicit reference was found in the text == Unused Reference: 'RSA' is defined on line 3926, but no explicit reference was found in the text == Unused Reference: 'SHA' is defined on line 3930, but no explicit reference was found in the text == Unused Reference: 'SKEME' is defined on line 3939, but no explicit reference was found in the text ** Obsolete normative reference: RFC 2284 (ref. 'EAP') (Obsoleted by RFC 3748) -- Obsolete informational reference (is this intentional?): RFC 2409 (ref. 'HC98') (Obsoleted by RFC 4306) -- No information found for draft-keronytis-ike-id - is the name correct? -- 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) Summary: 9 errors (**), 0 flaws (~~), 45 warnings (==), 9 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-06.txt March 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 Gateway to Gateway Tunnel..............................5 59 1.1.2 Endpoint to Endpoint Transport.........................5 60 1.1.3 Endpoint to 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.............11 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...............15 72 2.6 Cookies.................................................17 73 2.7 Cryptographic Algorithm Negotiation.....................19 74 2.8 Rekeying................................................20 75 2.9 Traffic Selector Negotiation............................21 76 2.10 Nonces.................................................23 77 2.11 Address and Port Agility...............................23 78 2.12 Reuse of Diffie-Hellman Exponentials...................24 79 2.13 Generating Keying Material.............................24 80 2.14 Generating Keying Material for the IKE_SA..............25 81 2.15 Authentication of the IKE_SA...........................26 82 2.16 Extended Authentication Protocol Methods...............27 83 2.17 Generating Keying Material for CHILD_SAs...............29 84 2.18 Rekaying IKE_SAs using a CREATE_CHILD_SA exchange......29 85 2.19 Requesting an internal address on a remote network.....30 86 2.20 Requesting a Peer's Version............................31 87 2.21 Error Handling.........................................32 88 2.22 IPcomp.................................................33 89 2.23 NAT Traversal..........................................33 90 2.24 ECN Notification.......................................34 91 3 Header and Payload Formats................................36 92 3.1 The IKE Header..........................................36 93 3.2 Generic Payload Header..................................39 94 3.3 Security Association Payload............................40 95 3.3.1 Proposal Substructure.................................42 96 3.3.2 Transform Substructure................................44 97 3.3.3 Mandatory Transform Types.............................46 98 3.3.4 Mandatory Transform IDs...............................47 99 3.3.5 Transform Attributes..................................48 100 3.3.6 Attribute Negotiation.................................50 101 3.4 Key Exchange Payload....................................51 102 3.5 Identification Payload..................................52 103 3.6 Certificate Payload.....................................53 104 3.7 Certificate Request Payload.............................55 105 3.8 Authentication Payload..................................57 106 3.9 Nonce Payload...........................................58 107 3.10 Notify Payload.........................................58 108 3.10.1 Notify Message Types.................................59 109 3.11 Delete Payload.........................................64 110 3.12 Vendor ID Payload......................................66 111 3.13 Traffic Selector Payload...............................67 112 3.13.1 Traffic Selector.....................................68 113 3.14 Encrypted Payload......................................69 114 3.15 Configuration Payload..................................71 115 3.15.1 Configuration Attributes.............................74 116 3.16 Extended Authentication Protocol (EAP) Payload.........76 117 3.17 Other Payload types....................................78 118 4 Conformance Requirements..................................78 119 5 Security Considerations...................................80 120 6 IANA Considerations.......................................81 121 7 Acknowledgements..........................................81 122 8 References................................................82 123 8.1 Normative References....................................82 124 8.2 Non-normative References................................82 125 Appendix A: Summary of Changes from IKEv1...................85 126 Appendix B: Diffie-Hellman Groups...........................87 127 Change History..............................................90 128 Editor's Address............................................93 129 Full Copyright Statement....................................93 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 (RFC 2406) and/or AH (RFC 2402). It also negotiates use of IPcomp 158 (RFC 2393) in connection with an ESP and/or AH SA. We call the IKE 159 SA an "IKE_SA". The SAs for ESP and/or AH that get set up through 160 that IKE_SA we call "CHILD_SA"s. 162 All IKE communications consist of pairs of messages: a request and a 163 response. The pair is called an "exchange". We call the first 164 messages establishing an IKE_SA IKE_SA_INIT and IKE_AUTH exchanges 165 and subsequent IKE exchanges CREATE_CHILD_SA or INFORMATIONAL 166 exchanges. In the common case, there is a single IKE_SA_INIT exchange 167 and a single IKE_AUTH exchange (a total of four messages) to 168 establish the IKE_SA and the first CHILD_SA. In exceptional cases, 169 there may be more than one of each of these exchanges. In all cases, 170 all IKE_SA_INIT exchanges MUST complete before any other exchange 171 type, then all IKE_AUTH exchanges MUST complete, and following that 172 any number of CREATE_CHILD_SA and INFORMATIONAL exchanges may occur 173 in any order. In some scenarios, only a single CHILD_SA is needed 174 between the IPsec endpoints and therefore there would be no 175 additional exchanges. Subsequent exchanges MAY be used to establish 176 additional CHILD_SAs between the same authenticated pair of endpoints 177 and to perform housekeeping functions. 179 IKE message flow always consists of a request followed by a response. 180 It is the responsibility of the requester to ensure reliability. If 181 the response is not received within a timeout interval, the requester 182 MUST retransmit the request (or abandon the connection). 184 The first request/response of an IKE session negotiates security 185 parameters for the IKE_SA, sends nonces, and sends Diffie-Hellman 186 values. We call the initial exchange IKE_SA_INIT (request and 187 response). 189 The second request/response, which we'll call IKE_AUTH transmits 190 identities, proves knowledge of the secrets corresponding to the two 191 identities, and sets up an SA for the first (and often only) AH 192 and/or ESP CHILD_SA. 194 The types of subsequent exchanges are CREATE_CHILD_SA (which creates 195 a CHILD_SA), or and INFORMATIONAL (which deletes an SA, reports error 196 conditions, or does other housekeeping). Every request requires a 197 response. An INFORMATIONAL request with no payloads is commonly used 198 as a check for liveness. These subsequent exchanges cannot be used 199 until the initial exchanges have completed. 201 In the description that follows, we assume that no errors occur. 202 Modifications to the flow should errors occur are described in 203 section 2.21. 205 1.1 Usage Scenarios 207 IKE is expected to be used to negotiate ESP and/or AH SAs in a number 208 of different scenarios, each with its own special requirements. 210 1.1.1 Gateway to Gateway Tunnel 212 +-+-+-+-+-+ +-+-+-+-+-+ 213 ! ! IPsec ! ! 214 Protected !Tunnel ! Tunnel !Tunnel ! Protected 215 Subnet <-->!Endpoint !<---------->!Endpoint !<--> Subnet 216 ! ! ! ! 217 +-+-+-+-+-+ +-+-+-+-+-+ 219 Figure 1: Firewall to Firewall Tunnel 221 In this scenario, neither endpoint of the IP connection implements 222 IPsec, but network nodes between them protect traffic for part of the 223 way. Protection is transparent to the endpoints, and depends on 224 ordinary routing sending packets through the tunnel endpoints for 225 processing. Each endpoint would announce the set of addresses 226 "behind" it, and packets would be sent in Tunnel Mode where the inner 227 IP header would contain the IP addresses of the actual endpoints. 229 1.1.2 Endpoint to Endpoint Transport 231 +-+-+-+-+-+ +-+-+-+-+-+ 232 ! ! IPsec ! ! 233 !Protected! Tunnel !Protected! 234 !Endpoint !<---------------------------------------->!Endpoint ! 235 ! ! ! ! 236 +-+-+-+-+-+ +-+-+-+-+-+ 238 Figure 2: Endpoint to Endpoint 240 In this scenario, both endpoints of the IP connection implement 241 IPsec. These endpoints may implement application layer access 242 controls based on the authenticated identities of the participants. 243 Transport mode will commonly be used with no inner IP header. If 244 there is an inner IP header, the inner addresses will be the same as 245 the outer addresses. A single pair of addresses will be negotiated 246 for packets to be sent over this SA. 248 It is possible in this scenario that one or both of the protected 249 endpoints will be behind a network address translation (NAT) node, in 250 which case the tunnelled packets will have to be UDP encapsulated so 251 that port numbers in the UDP headers can be used to identify 252 individual endpoints "behind" the NAT. 254 1.1.3 Endpoint to Gateway Transport 256 +-+-+-+-+-+ +-+-+-+-+-+ 257 ! ! IPsec ! ! Protected 258 !Protected! Tunnel !Tunnel ! Subnet 259 !Endpoint !<------------------------>!Endpoint !<--- and/or 260 ! ! ! ! Internet 261 +-+-+-+-+-+ +-+-+-+-+-+ 263 Figure 3: Endpoint to Gateway 265 In this scenario, a protected endpoint (typically a portable roaming 266 computer) connects back to its corporate network through an IPsec 267 protected tunnel. It might use this tunnel only to access information 268 on the corporate network or it might tunnel all of its traffic back 269 through the corporate network in order to take advantage of 270 protection provided by a corporate firewall against Internet based 271 attacks. In either case, the protected endpoint will want an IP 272 address associated with the gateway so that packets returned to it 273 will go to the gateway and be tunnelled back. This IP address may be 274 static or may be dynamically allocated by the gateway. In support of 275 the latter case, IKEv2 includes a mechanism for the initiator to 276 request an IP address owned by the gateway for use for the duration 277 of its SA. 279 In this scenario, packets will use tunnel mode. On each packet from 280 the protected endpoint, the outer IP header will contain the source 281 IP address associated with its current location (i.e. the address 282 that will get traffic routed to the endpoint directly) while the 283 inner IP header will contain the source IP address assigned by the 284 gateway (i.e. the address that will get traffic routed to the gateway 285 for forwarding to the endpoint). The outer destination address will 286 always be that of the gateway, while the inner destination address 287 will be the ultimate destination for the packet. 289 In this scenario, it is possible that the protected endpoint will be 290 behind a NAT. In that case, the IP address as seen by the gateway 291 will not be the same as the IP address sent by the protected 292 endpoint, and packets will have to be UDP encapsulated in order to be 293 routed properly. 295 1.1.4 Other Scenarios 297 Other scenarios are possible, as are nested combinations of the 298 above. One noteable example combines aspects of 1.1.1 and 1.1.3. A 299 subnet may make all external accesses through a remote gateway using 300 an IPsec tunnel, where the addresses on the subnet are routed to the 301 gateway by the rest of the Internet. An example would be someones 302 home network being virtually on the Internet with static IP addresses 303 even though connectivity is provided by an ISP that assigns a single 304 dynamically assigned IP address (where the static IP addresses and an 305 IPsec relay is provided by a third party located elsewhere). 307 1.2 The Initial Exchanges 309 Communication using IKE always begins with IKE_SA_INIT and IKE_AUTH 310 exchanges (known in IKEv1 as Phase 1). These initial exchanges 311 normally consist of four messages, though in some scenarios that 312 number can grow. All communications using IKE consist of 313 request/response pairs. We'll describe the base exchange first, 314 followed by variations. The first pair of messages (IKE_SA_INIT) 315 negotiate cryptographic algorithms, exchange nonces, and do a 316 Diffie-Hellman exchange. 318 The second pair of messages (IKE_AUTH) authenticate the previous 319 messages, exchange identities and certificates, and establish the 320 first CHILD_SA. Parts of these messages are encrypted and integrity 321 protected with keys established through the IKE_SA_INIT exchange, so 322 the identities are hidden from eavesdroppers and all fields in all 323 the messages are authenticated. 325 In the following description, the payloads contained in the message 326 are indicated by names such as SA. The details of the contents of 327 each payload are described later. Payloads which may optionally 328 appear will be shown in brackets, such as [CERTREQ], would indicate 329 that optionally a certificate request payload can be included. 331 The initial exchanges are as follows: 333 Initiator Responder 334 ----------- ----------- 335 HDR, SAi1, KEi, Ni --> 337 HDR contains the SPIs, version numbers, and flags of various sorts. 338 The SAi1 payload states the cryptographic algorithms the Initiator 339 supports for the IKE_SA. The KE payload sends the Initiator's 340 Diffie-Hellman value. Ni is the Initiator's nonce. 342 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 344 The Responder chooses a cryptographic suite from the Initiator's 345 offered choices and expresses that choice in the SAr1 payload, 346 completes the Diffie-Hellman exchange with the KEr payload, and sends 347 its nonce in the Nr payload. 349 At this point in the negotiation each party can generate SKEYSEED, 350 from which all keys are derived for that IKE_SA. All but the headers 351 of all the messages that follow are encrypted and integrity 352 protected. The keys used for the encryption and integrity protection 353 are derived from SKEYSEED and are known as SK_e (encryption) and SK_a 354 (authentication, a.k.a. integrity protection). A separate SK_e and 355 SK_a is computed for each direction. In addition to the keys SK_e 356 and SK_a derived from the DH value for protection of the IKE_SA, 357 another quantity SK_d is derived and used for derivation of further 358 keying material for CHILD_SAs. The notation SK { ... } indicates 359 that these payloads are encrypted and integrity protected using that 360 direction's SK_e and SK_a. 362 HDR, SK {IDi, [CERT,] [CERTREQ,] [IDr,] 363 AUTH, SAi2, TSi, TSr} --> 365 The Initiator asserts her identity with the IDi payload, proves 366 knowledge of the secret corresponding to IDi and integrity protects 367 the contents of the first two messages using the AUTH payload (see 368 section 2.15). She might also send her certificate(s) in CERT 369 payload(s) and a list of her trust anchors in CERTREQ payload(s). If 370 any CERT payloads are included, the first certificate provided must 371 contain the public key used to verify the AUTH field. The optional 372 payload IDr enables Alice to specify which of Bob's identities she 373 wants to talk to. This is useful when Bob is hosting multiple 374 identities at the same IP address. She begins negotiation of a 375 CHILD_SA using the SAi2 payload. The final fields (starting with 376 SAi2) are described in the description of the CREATE_CHILD_SA 377 exchange. 379 <-- HDR, SK {IDr, [CERT,] AUTH, 380 SAr2, TSi, TSr} 382 The Responder asserts his identity with the IDr payload, optionally 383 sends one or more certificates (again with the certificate containing 384 the public key used to verify AUTH listed first), authenticates his 385 identity with the AUTH payload, and completes negotiation of a 386 CHILD_SA with the additional fields described below in the 387 CREATE_CHILD_SA exchange. 389 The recipients of messages 3 and 4 MUST verify that all signatures 390 and MACs are computed correctly and that the names in the ID payloads 391 correspond to the keys used to generate the AUTH payload. 393 1.3 The CREATE_CHILD_SA Exchange 395 This exchange consists of a single request/response pair, and was 396 referred to as a phase 2 exchange in IKEv1. It MAY be initiated by 397 either end of the IKE_SA after the initial exchanges are completed. 399 All messages following the initial exchange are cryptographically 400 protected using the cryptographic algorithms and keys negotiated in 401 the first two messages of the IKE exchange using a syntax described 402 in section 3.14. 404 Either endpoint may initiate a CREATE_CHILD_SA exchange, so in this 405 section the term Initiator refers to the endpoint initiating this 406 exchange. 408 A CHILD_SA is created by sending a CREATE_CHILD_SA request. The 409 CREATE_CHILD_SA request MAY optionally contain a KE payload for an 410 additional Diffie-Hellman exchange to enable stronger guarantees of 411 forward secrecy for the CHILD_SA. The keying material for the 412 CHILD_SA is a function of SK_d established during the establishment 413 of the IKE_SA, the nonces exchanged during the CREATE_CHILD_SA 414 exchange, and the Diffie-Hellman value (if KE payloads are included 415 in the CREATE_CHILD_SA exchange). 417 In the CHILD_SA created as part of the initial exchange, a second KE 418 payload and nonce MUST NOT be sent. The nonces from the initial 419 exchange are used in computing the keys for the CHILD_SA. 421 The CREATE_CHILD_SA request contains: 423 Initiator Responder 424 ----------- ----------- 425 HDR, SK {SA, Ni, [KEi], 426 [TSi, TSr]} --> 428 The Initiator sends SA offer(s) in the SA payload, a nonce in the Ni 429 payload, optionally a Diffie-Hellman value in the KEi payload, and 430 the proposed traffic selectors in the TSi and TSr payloads. If the SA 431 offers include different Diffie-Hellman groups, KEi must be an 432 element of the group the Initiator expects the responder to accept. 434 If she guesses wrong, the CREATE_CHILD_SA exchange will fail and she 435 will have to retry with a different KEi. 437 The message following the header is encrypted and the message 438 including the header is integrity protected using the cryptographic 439 algorithms negotiated for the IKE_SA. 441 The CREATE_CHILD_SA response contains: 443 <-- HDR, SK {SA, Nr, [KEr], 444 [TSi, TSr]} 446 The Responder replies (using the same Message ID to respond) with the 447 accepted offer in an SA payload, and a Diffie-Hellman value in the 448 KEr payload if KEi was included in the request and the selected 449 cryptographic suite includes that group. If the responder chooses a 450 cryptographic suite with a different group, it MUST reject the 451 request and have the initiator make another one. 453 The traffic selectors for traffic to be sent on that SA are specified 454 in the TS payloads, which may be a subset of what the Initiator of 455 the CHILD_SA proposed. Traffic selectors are omitted if this 456 CREATE_CHILD_SA request is being used to change the key of the 457 IKE_SA. 459 1.4 The INFORMATIONAL Exchange 461 At various points during the operation of an IKE_SA, peers may desire 462 to convey control messages to each other regarding errors or 463 notifications of certain events. To accomplish this IKE defines an 464 INFORMATIONAL exchange. INFORMATIONAL exchanges MAY ONLY occur after 465 the initial exchanges and are cryptographically protected with the 466 negotiated keys. 468 Control messages that pertain to an IKE_SA MUST be sent under that 469 IKE_SA. Control messages that pertain to CHILD_SAs MUST be sent under 470 the protection of the IKE_SA which generated them (or its successor 471 if the IKE_SA was replaced for the purpose of rekeying). 473 Messages in an INFORMATIONAL Exchange contain zero or more 474 Notification, Delete, and Configuration payloads. The Recipient of an 475 INFORMATIONAL Exchange request MUST send some response (else the 476 Sender will assume the message was lost in the network and will 477 retransmit it). That response MAY be a message with no payloads. The 478 request message in an INFORMATIONAL Exchange MAY also contain no 479 payloads. This is the expected way an endpoint can ask the other 480 endpoint to verify that it is alive. 482 ESP and AH SAs always exist in pairs, with one SA in each direction. 483 When an SA is closed, both members of the pair MUST be closed. When 484 SAs are nested, as when data (and IP headers if in tunnel mode) are 485 encapsulated first with IPcomp, then with ESP, and finally with AH 486 between the same pair of endpoints, all of the SAs MUST be deleted 487 together. Each endpoint MUST close the SAs it receives on and allow 488 the other endpoint to close the other SA in each pair. To delete an 489 SA, an INFORMATIONAL Exchange with one or more delete payloads is 490 sent listing the SPIs (as they would be expected in the headers of 491 inbound packets) of the SAs to be deleted. The recipient MUST close 492 the designated SAs. Normally, the reply in the INFORMATIONAL Exchange 493 will contain delete payloads for the paired SAs going in the other 494 direction. There is one exception. If by chance both ends of a set 495 of SAs independently decide to close them, each may send a delete 496 payload and the two requests may cross in the network. If a node 497 receives a delete request for SAs for which it has already issued a 498 delete request, it MUST delete the outgoing SAs while processing the 499 request and the incoming SAs while processing the response. In that 500 case, the responses MUST NOT include delete payloads for the deleted 501 SAs, since that would result in duplicate deletion and could in 502 theory delete the wrong SA. 504 A node SHOULD regard half closed connections as anomalous and audit 505 their existence should they persist. Note that this specification 506 nowhere specifies time periods, so it is up to individual endpoints 507 to decide how long to wait. A node MAY refuse to accept incoming data 508 on half closed connections but MUST NOT unilaterally close them and 509 reuse the SPIs. If connection state becomes sufficiently messed up, a 510 node MAY close the IKE_SA which will implicitly close all SAs 511 negotiated under it. It can then rebuild the SAs it needs on a clean 512 base under a new IKE_SA. 514 The INFORMATIONAL Exchange is defined as: 516 Initiator Responder 517 ----------- ----------- 518 HDR, SK {[N,] [D,] [CP,] ...} --> 519 <-- HDR, SK {[N,] [D,] [CP], ...} 521 The processing of an INFORMATIONAL Exchange is determined by its 522 component payloads. 524 1.5 Informational Messages outside of an IKE_SA 526 If a packet arrives with an unrecognised SPI, it could be because the 527 receiving node has recently crashed and lost state or because of some 528 other system malfunction or attack. If the receiving node has an 529 active IKE_SA to the IP address from whence the packet came, it MAY 530 send a notification of the wayward packet over that IKE_SA. If it 531 does not, it MAY send an Informational message without cryptographic 532 protection to the source IP address and port to alert it to a 533 possible problem. 535 2 IKE Protocol Details and Variations 537 IKE normally listens and sends on UDP port 500, though IKE messages 538 may also be received on UDP port 4500 with a slightly different 539 format (see section 2.23). Since UDP is a datagram (unreliable) 540 protocol, IKE includes in its definition recovery from transmission 541 errors, including packet loss, packet replay, and packet forgery. IKE 542 is designed to function so long as (1) at least one of a series of 543 retransmitted packets reaches its destination before timing out; and 544 (2) the channel is not so full of forged and replayed packets so as 545 to exhaust the network or CPU capacities of either endpoint. Even in 546 the absence of those minimum performance requirements, IKE is 547 designed to fail cleanly (as though the network were broken). 549 2.1 Use of Retransmission Timers 551 All messages in IKE exist in pairs: a request and a response. The 552 setup of an IKE_SA normally consists of two request/response pairs. 553 Once the IKE_SA is set up, either end of the security association may 554 initiate requests at any time, and there can be many requests and 555 responses "in flight" at any given moment. But each message is 556 labelled as either a request or a response and for each 557 request/response pair one end of the security association is the 558 Initiator and the other is the Responder. 560 For every pair of messages, the Initiator is responsible for 561 retransmission in the event of a timeout. The Responder MUST never 562 retransmit a response unless it receives a retransmission of the 563 request. In that event, the Responder MUST ignore the retransmitted 564 request except insofar as it triggers a retransmission of the 565 response. The Initiator MUST remember each request until it receives 566 the corresponding response. The Responder MUST remember each response 567 until it receives a request whose sequence number is larger than the 568 sequence number in the response plus his window size (see section 569 2.3). 571 IKE is a reliable protocol, in the sense that the Initiator MUST 572 retransmit a request until either it receives a corresponding reply 573 OR it deems the IKE security association to have failed and it 574 discards all state associated with the IKE_SA and any CHILD_SAs 575 negotiated using that IKE_SA. 577 2.2 Use of Sequence Numbers for Message ID 579 Every IKE message contains a Message ID as part of its fixed header. 580 This Message ID is used to match up requests and responses, and to 581 identify retransmissions of messages. 583 The Message ID is a 32 bit quantity, which is zero for the first IKE 584 request in each direction. The IKE_SA initial setup messages will 585 always be numbered 0 and 1. Each endpoint in the IKE Security 586 Association maintains two "current" Message IDs: the next one to be 587 used for a request it initiates and the next one it expects to see in 588 a request from the other end. These counters increment as requests 589 are generated and received. Responses always contain the same message 590 ID as the corresponding request. That means that after the initial 591 exchange, each integer n may appear as the message ID in four 592 distinct messages: The nth request from the original IKE Initiator, 593 the corresponding response, the nth request from the original IKE 594 Responder, and the corresponding response. If the two ends make very 595 different numbers of requests, the Message IDs in the two directions 596 can be very different. There is no ambiguity in the messages, 597 however, because each the (I)nitiator and (R)esponse bits in the 598 message header specify which of the four messages a particular one 599 is. 601 Note that Message IDs are cryptographically protected and provide 602 protection against message replays. In the unlikely event that 603 Message IDs grow too large to fit in 32 bits, the IKE SA MUST be 604 closed. Rekeying an IKE SA resets the sequence numbers. 606 2.3 Window Size for overlapping requests 608 In order to maximize IKE throughput, an IKE endpoint MAY issue 609 multiple requests before getting a response to any of them. For 610 simplicity, an IKE implementation MAY choose to process requests 611 strictly in order and/or wait for a response to one request before 612 issuing another. Certain rules must be followed to assure 613 interoperability between implementations using different strategies. 615 After an IKE_SA is set up, either end can initiate one or more 616 requests. These requests may pass one another over the network. An 617 IKE endpoint MUST be prepared to accept and process a request while 618 it has a request outstanding in order to avoid a deadlock in this 619 situation. An IKE endpoint SHOULD be prepared to accept and process 620 multiple requests while it has a request outstanding. 622 An IKE endpoint MUST wait for a response to each of its messages 623 before sending a subsequent message unless it has received a Notify 624 message from its peer informing it that the peer is prepared to 625 maintain state for multiple outstanding messages in order to allow 626 greater throughput. 628 An IKE endpoint MUST NOT exceed the peer's stated window size for 629 transmitted IKE requests. In other words, if Bob stated his window 630 size is N, then when Alice needs to make a request X, she MUST wait 631 until she has received responses to all requests up through request 632 X-N. An IKE endpoint MUST keep a copy of (or be able to regenerate 633 exactly) each request it has sent until it receives the corresponding 634 response. An IKE endpoint MUST keep a copy of (or be able to 635 regenerate exactly) the number of previous responses equal to its 636 declared window size in case its response was lost and the Initiator 637 requests its retransmission by retransmitting the request. 639 An IKE endpoint supporting a window size greater than one SHOULD be 640 capable of processing incoming requests out of order to maximize 641 performance in the event of network failures or packet reordering. 643 2.4 State Synchronization and Connection Timeouts 645 An IKE endpoint is allowed to forget all of its state associated with 646 an IKE_SA and the collection of corresponding CHILD_SAs at any time. 647 This is the anticipated behavior in the event of an endpoint crash 648 and restart. It is important when an endpoint either fails or 649 reinitializes its state that the other endpoint detect those 650 conditions and not continue to waste network bandwidth by sending 651 packets over discarded SAs and having them fall into a black hole. 653 Since IKE is designed to operate in spite of Denial of Service (DoS) 654 attacks from the network, an endpoint MUST NOT conclude that the 655 other endpoint has failed based on any routing information (e.g. ICMP 656 messages) or IKE messages that arrive without cryptographic 657 protection (e.g., notify messages complaining about unknown SPIs). An 658 endpoint MUST conclude that the other endpoint has failed only when 659 repeated attempts to contact it have gone unanswered for a timeout 660 period or when a cryptographically protected INITIAL_CONTACT 661 notification is received on a different IKE_SA to the same 662 authenticated identity. An endpoint SHOULD suspect that the other 663 endpoint has failed based on routing information and initiate a 664 request to see whether the other endpoint is alive. To check whether 665 the other side is alive, IKE specifies an empty INFORMATIONAL message 666 that (like all IKE requests) requires an acknowledgment. If a 667 cryptographically protected message has been received from the other 668 side recently, unprotected notifications MAY be ignored. 669 Implementations MUST limit the rate at which they take actions based 670 on unprotected messages. 672 Numbers of retries and lengths of timeouts are not covered in this 673 specification because they do not affect interoperability. It is 674 suggested that messages be retransmitted at least a dozen times over 675 a period of at least several minutes before giving up on an SA, but 676 different environments may require different rules. If there has only 677 been outgoing traffic on all of the SAs associated with an IKE_SA, it 678 is essential to confirm liveness of the other endpoint to avoid black 679 holes. If no cryptographically protected messages have been received 680 on an IKE_SA or any of its CHILD_SAs recently, a liveness check MUST 681 be performed. Receipt of a fresh cryptographically protected message 682 on an IKE_SA or any of its CHILD_SAs assures liveness of the IKE_SA 683 and all of its CHILD_SAs. Note that this places requirements on the 684 failure modes of an IKE endpoint. An implementation MUST NOT continue 685 sending on any SA if some failure prevents it from receiving on all 686 of the associated SAs. If CHILD_SAs can fail independently from one 687 another without the associated IKE_SA being able to send a delete 688 message, then they MUST be negotiated by separate IKE_SAs. 690 There is a Denial of Service attack on the Initiator of an IKE_SA 691 that can be avoided if the Initiator takes the proper care. Since the 692 first two messages of an SA setup are not cryptographically 693 protected, an attacker could respond to the Initiator's message 694 before the genuine Responder and poison the connection setup attempt. 695 To prevent this, the Initiator MAY be willing to accept multiple 696 responses to its first message, treat each as potentially legitimate, 697 respond to it, and then discard all the invalid half open connections 698 when she receives a valid cryptographically protected response to any 699 one of her requests. Once a cryptographically valid response is 700 received, all subsequent responses should be ignored whether or not 701 they are cryptographically valid. 703 Note that with these rules, there is no reason to negotiate and agree 704 upon an SA lifetime. If IKE presumes the partner is dead, based on 705 repeated lack of acknowledgment to an IKE message, then the IKE SA 706 and all CHILD_SAs set up through that IKE_SA are deleted. 708 An IKE endpoint may at any time delete inactive CHILD_SAs to recover 709 resources used to hold their state. If an IKE endpoint chooses to do 710 so, it MUST send Delete payloads to the other end notifying it of the 711 deletion. It MAY similarly time out the IKE_SA. Closing the IKE_SA 712 implicitly closes all associated CHILD_SAs. In this case, an IKE 713 endpoint SHOULD send a Delete payload indicating that it has closed 714 the IKE_SA. 716 2.5 Version Numbers and Forward Compatibility 718 This document describes version 2.0 of IKE, meaning the major version 719 number is 2 and the minor version number is zero. It is likely that 720 some implementations will want to support both version 1.0 and 721 version 2.0, and in the future, other versions. 723 The major version number should only be incremented if the packet 724 formats or required actions have changed so dramatically that an 725 older version node would not be able to interoperate with a newer 726 version node if it simply ignored the fields it did not understand 727 and took the actions specified in the older specification. The minor 728 version number indicates new capabilities, and MUST be ignored by a 729 node with a smaller minor version number, but used for informational 730 purposes by the node with the larger minor version number. For 731 example, it might indicate the ability to process a newly defined 732 notification message. The node with the larger minor version number 733 would simply note that its correspondent would not be able to 734 understand that message and therefore would not send it. 736 If an endpoint receives a message with a higher major version number, 737 it MUST drop the message and SHOULD send an unauthenticated 738 notification message containing the highest version number it 739 supports. If an endpoint supports major version n, and major version 740 m, it MUST support all versions between n and m. If it receives a 741 message with a major version that it supports, it MUST respond with 742 that version number. In order to prevent two nodes from being tricked 743 into corresponding with a lower major version number than the maximum 744 that they both support, IKE has a flag that indicates that the node 745 is capable of speaking a higher major version number. 747 Thus the major version number in the IKE header indicates the version 748 number of the message, not the highest version number that the 749 transmitter supports. If A is capable of speaking versions n, n+1, 750 and n+2, and B is capable of speaking versions n and n+1, then they 751 will negotiate speaking n+1, where A will set the flag indicating 752 ability to speak a higher version. If they mistakenly (perhaps 753 through an active attacker sending error messages) negotiate to 754 version n, then both will notice that the other side can support a 755 higher version number, and they MUST break the connection and 756 reconnect using version n+1. 758 Note that IKEv1 does not follow these rules, because there is no way 759 in v1 of noting that you are capable of speaking a higher version 760 number. So an active attacker can trick two v2-capable nodes into 761 speaking v1. When a v2-capable node negotiates down to v1, it SHOULD 762 note that fact in its logs. 764 Also for forward compatibility, all fields marked RESERVED MUST be 765 set to zero by a version 2.0 implementation and their content MUST be 766 ignored by a version 2.0 implementation ("Be conservative in what you 767 send and liberal in what you receive"). In this way, future versions 768 of the protocol can use those fields in a way that is guaranteed to 769 be ignored by implementations that do not understand them. 770 Similarly, payload types that are not defined are reserved for future 771 use and implementations of version 2.0 MUST skip over those payloads 772 and ignore their contents. 774 IKEv2 adds a "critical" flag to each payload header for further 775 flexibility for forward compatibility. If the critical flag is set 776 and the payload type is unrecognised, the message MUST be rejected 777 and the response to the IKE request containing that payload MUST 778 include a notify payload UNSUPPORTED_CRITICAL_PAYLOAD, indicating an 779 unsupported critical payload was included. If the critical flag is 780 not set and the payload type is unsupported, that payload MUST be 781 ignored. 783 While new payload types may be added in the future and may appear 784 interleaved with the fields defined in this specification, 785 implementations MUST send the payloads defined in this specification 786 in the order shown in section 3 and implementations SHOULD reject as 787 invalid a message with payloads in any other order. 789 2.6 Cookies 791 The term "cookies" originates with Karn and Simpson [RFC 2522] in 792 Photuris, an early proposal for key management with IPsec. It has 793 persisted because the IETF has never rejected a proposal involving 794 cookies. The ISAKMP fixed message header includes two eight octet 795 fields titled "cookies", and that syntax is used by both IKEv1 and 796 IKEv2 though in IKEv2 they are referred to as the IKE SPI and there 797 is a new separate field in a NOTIFY payload holding the cookie. The 798 initial two eight octet fields in the header are used as a connection 799 identifier at the beginning of IKE packets. Each endpoint chooses one 800 of the two SPIs and SHOULD choose them so as to be unique identifiers 801 of an IKE_SA. An SPI value of zero is special and indicates that the 802 remote SPI value is not yet known by the sender. 804 Unlike ESP and AH where only the recipient's SPI appears in the 805 header of a message, in IKE the sender's SPI is also sent in every 806 message. Since the SPI chosen by the original initiator of the IKE_SA 807 is always sent first, an endpoint with multiple IKE_SAs open that 808 wants to find the appropriate IKE_SA using the SPI it assigned must 809 look at the I(nitiator) Flag bit in the header to determine whether 810 it assigned the first or the second eight octets. 812 In the first message of an initial IKE exchange, the initiator will 813 not know the responder's SPI value and will therefore set that field 814 to zero. 816 An expected attack against IKE is state and CPU exhaustion, where the 817 target is flooded with session initiation requests from forged IP 818 addresses. This attack can be made less effective if an 819 implementation of a responder uses minimal CPU and commits no state 820 to an SA until it knows the initiator can receive packets at the 821 address from which he claims to be sending them. To accomplish this, 822 a responder SHOULD - when it detects a large number of half-open 823 IKE_SAs - reject initial IKE messages unless they contain a notify 824 payload of type "cookie". It SHOULD instead send an unprotected IKE 825 message as a response and include its cookie in a notify payload. 826 Initiators who receive such responses MUST retry the IKE_SA_INIT with 827 the responder supplied cookie as the first payload. The initial 828 exchange will then be as follows: 830 Initiator Responder 831 ----------- ----------- 832 HDR(A,0), SAi1, KEi, Ni --> 834 <-- HDR(A,0), N(COOKIE_REQUIRED), 835 N(COOKIE) 837 HDR(A,0), N(COOKIE), SAi1, KEi, Ni --> 839 <-- HDR(A,B), SAr1, KEr, Nr, [CERTREQ] 841 HDR(A,B), SK {IDi, [CERT,] [CERTREQ,] [IDr,] 842 AUTH, SAi2, TSi, TSr} --> 844 <-- HDR(A,B), SK {IDr, [CERT,] AUTH, 845 SAr2, TSi, TSr} 847 The first two messages do not affect any initiator or responder state 848 except for communicating the cookie. In particular, the message 849 sequence numbers in the first four messages will all be zero and the 850 message sequence numbers in the last two messages will be one. 852 An IKE implementation SHOULD implement its responder cookie 853 generation in such a way as to not require any saved state to 854 recognise its valid cookie when the second IKE_SA_INIT message 855 arrives. The exact algorithms and syntax they use to generate 856 cookies does not affect interoperability and hence is not specified 857 here. The following is an example of how an endpoint could use 858 cookies to implement limited DOS protection. 860 A good way to do this is to set the responder cookie to be: 862 Cookie = | Hash(Ni | IPi | SPIi | ) 864 where is a randomly generated secret known only to the 865 responder and periodically changed. should be 866 changed whenever is regenerated. The cookie can be 867 recomputed when the IKE_SA_INIT arrives the second time and compared 868 to the cookie in the received message. If it matches, the responder 869 knows that SPIr was generated since the last change to and 870 that IPi must be the same as the source address it saw the first 871 time. Incorporating SPIi into the calculation assures that if 872 multiple IKE_SAs are being set up in parallel they will all get 873 different cookies (assuming the initiator chooses unique SPIi's). 874 Incorporating Ni into the hash assures that an attacker who sees only 875 message 2 can't successfully forge a message 3. 877 If a new value for is chosen while there are connections in 878 the process of being initialized, an IKE_SA_INIT might be returned 879 with other than the current . The responder in 880 that case MAY reject the message by sending another response with a 881 new cookie or it MAY keep the old value of around for a 882 short time and accept cookies computed from either one. The 883 responder SHOULD NOT accept cookies indefinitely after is 884 changed, since that would defeat part of the denial of service 885 protection. The responder SHOULD change the value of 886 frequently, especially if under attack. 888 2.7 Cryptographic Algorithm Negotiation 890 The payload type known as "SA" indicates a proposal for a set of 891 choices of protocols (IKE, ESP, and/or AH) for the SA as well as 892 cryptographic algorithms associated with each protocol. 894 An SA consists of one or more proposals. Each proposal includes one 895 or more protocols (usually one). Each protocol contains one or more 896 transforms - each specifying a cryptographic algorithm. Each 897 transform contains zero or more attributes (attributes are only 898 needed if the transform identifier does not completely specify the 899 cryptographic algorithm). 901 This hierarchical structure was designed to be able to efficiently 902 encode proposals for cryptographic suites when the number of 903 supported suites is large because multiple values are acceptable for 904 multiple transforms. The responder MUST choose a single suite, which 905 MAY be any subset of the SA proposal following the rules below: 907 Each proposal contains one or more protocols. If a proposal is 908 accepted, the SA response must contain the same protocols in the 909 same order as the proposal. At most one proposal MAY be accepted. 910 (Example: if a single proposal contains ESP and AH and that 911 proposal is accepted, both ESP and AH MUST be accepted. If ESP and 912 AH are included in separate proposals, only one of them MAY be 913 accepted). 915 Each protocol contains one or more transforms. Each transform 916 contains a transform type. The accepted crytographic suite MUST 917 contain exactly one transform of each type included in the 918 proposal. (Example: if an ESP proposal includes transforms 919 ENCR_3DES, ENCR_AES128, AUTH_HMAC_MD5, and AUTH_HMAC_SHA, the 920 accepted suite MUST contain one of the ENCR_ transforms and one of 921 the AUTH_ transforms. Thus four combinations are acceptable). 923 Since Alice sends her Diffie-Hellman value in the IKE_SA_INIT, she 924 must guess at the Diffie-Hellman group that Bob will select from her 925 list of supported groups. If she guesses wrong, Bob will respond 926 with a NOTIFY payload of type INVALID_KE_PAYLOAD indicating the 927 selected group. In this case, Alice MUST retry the IKE_SA_INIT with 928 the corrected Diffie-Hellman group. Alice MUST again propose her full 929 set of acceptable cryptographic suites because the rejection message 930 was unauthenticated and otherwise an active attacker could trick 931 Alice and Bob into negotiating a weaker suite than a stronger one 932 that they both prefer. 934 2.8 Rekeying 936 IKE, ESP, and AH security associations use secret keys which SHOULD 937 only be used for a limited amount of time and to protect a limited 938 amount of data. This limits the lifetime of the entire security 939 association. When the lifetime of a security association expires the 940 security association MUST NOT be used. If there is demand, new 941 security associations MAY be established. Reestablishment of 942 security associations to take the place of ones which expire is 943 referred to as "rekeying". 945 To rekey a CHILD_SA, create a new, equivalent SA (see section 2.17 946 below), and when the new one is established, delete the old one. To 947 rekey an IKE_SA, establish a new equivalent IKE_SA (see section 2.18 948 below) with the peer to whom the old IKE_SA is shared using a 949 CREATE_CHILD_SA within the existing IKE_SA. An IKE_SA so created 950 inherits all of the original IKE_SA's CHILD_SAs. Use the new IKE_SA 951 for all control messages needed to maintain the CHILD_SAs created by 952 the old IKE_SA, and delete the old IKE_SA. The Delete payload to 953 delete itself MUST be the last request sent over an IKE_SA. 955 SAs SHOULD be rekeyed proactively, i.e., the new SA should be 956 established before the old one expires and becomes unusable. Enough 957 time should elapse between the time the new SA is established and the 958 old one becomes unusable so that traffic can be switched over to the 959 new SA. 961 A difference between IKEv1 and IKEv2 is that in IKEv1 SA lifetimes 962 were negotiated. In IKEv2, each end of the SA is responsible for 963 enforcing its own lifetime policy on the SA and rekeying the SA when 964 necessary. If the two ends have different lifetime policies, the end 965 with the shorter lifetime will end up always being the one to request 966 the rekeying. If an SA bundle has been inactive for a long time and 967 if an endpoint would not initiate the SA in the absense of traffic, 968 the endpoint MAY choose to close the SA instead of rekeying it when 969 its lifetime expires. It SHOULD do so if there has been no traffic 970 since the last time the SA was rekeyed. 972 If the two ends have the same lifetime policies, it is possible that 973 both will initiate a rekeying at the same time (which will result in 974 redundant SAs). To reduce the probability of this happening, the 975 timing of rekeying requests SHOULD be jittered (delayed by a random 976 amount of time after the need for rekeying is noticed). 978 This form of rekeying may temporarily result in multiple similar SAs 979 between the same pairs of nodes. When there are two SAs eligible to 980 receive packets, a node MUST accept incoming packets through either 981 SA. If redundant SAs are created though such a collision, the SA 982 created with the lowest of the four nonces used in the two exchanges 983 SHOULD be closed by the endpoint that created it. 985 The node that initiated the surviving rekeyed SA SHOULD delete the 986 replaced SA after the new one is established. 988 2.9 Traffic Selector Negotiation 990 When an IP packet is received by an RFC2401 compliant IPsec subsystem 991 and matches a "protect" selector in its SPD, the subsystem MUST 992 protect that packet with IPsec. When no SA exists yet it is the task 993 of IKE to create it. Maintenance of of a system's SPD is outside the 994 scope of IKE (see [PFKEY] for an example protocol), though some 995 implementations might update their SPD in connection with the running 996 of IKE (for an example scenario, see section 1.1.3). 998 Traffic Selector (TS) payloads allow endpoints to communicate some of 999 the information from their SPD to their peers. TS payloads specify 1000 the selection criteria for packets that will be forwarded over the 1001 newly set up SA. This can serve as a consistency check in some 1002 scenarios to assure that the SPDs are consistent. In others, it 1003 guides the dynamic update of the SPD. 1005 Two TS payloads appear in each of the messages in the exchange that 1006 creates a CHILD_SA pair. Each TS payload contains one or more Traffic 1007 Selectors. Each Traffic Selector consists of an address range (IPv4 1008 or IPv6), a port range, and a protocol ID. In support of the scenario 1009 described in section 1.1.3, an initiator may request that the 1010 responder assign an IP address and tell the initiator what it is. 1012 IKEv2 allows the responder to choose a subset of the traffic proposed 1013 by the initiator. This could happen when the configuration of the 1014 two endpoints are being updated but only one end has received the new 1015 information. Since the two endpoints may be configured by different 1016 people, the incompatibility may persist for an extended period even 1017 in the absense of errors. It also allows for intentionally different 1018 configurations, as when one end is configured to tunnel all addresses 1019 and depends on the other end to have the up to date list. 1021 The first of the two TS payloads is known as TSi (Traffic Selector- 1022 initiator). The second is known as TSr (Traffic Selector-responder). 1023 TSi specifies the source address of traffic forwarded from (or the 1024 destination address of traffic forwarded to) the initiator of the 1025 CHILD_SA pair. TSr specifies the destination address of the traffic 1026 forwarded from (or the source address of the traffic forwarded to) 1027 the responder of the CHILD_SA pair. For example, if Alice initiates 1028 the creation of the CHILD_SA pair from Alice to Bob, and wishes to 1029 tunnel all traffic from subnet 10.2.16.* on Alice's side to subnet 1030 18.16.*.* on Bob's side, Alice would include a single traffic 1031 selector in each TS payload. TSi would specify the address range 1032 (10.2.16.0 - 10.2.16.255) and TSr would specify the address range 1033 (18.16.0.0 - 18.16.255.255). Assuming that proposal was acceptable to 1034 Bob, he would send identical TS payloads back. 1036 The Responder is allowed to narrow the choices by selecting a subset 1037 of the traffic, for instance by eliminating or narrowing the range of 1038 one or more members of the set of traffic selectors, provided the set 1039 does not become the NULL set. 1041 It is possible for the Responder's policy to contain multiple smaller 1042 ranges, all encompassed by the Initiator's traffic selector, and with 1043 the Responder's policy being that each of those ranges should be sent 1044 over a different SA. Continuing the example above, Bob might have a 1045 policy of being willing to tunnel those addresses to and from Alice, 1046 but might require that each address pair be on a separately 1047 negotiated CHILD_SA. If Alice generated her request in response to an 1048 incoming packet from 10.2.16.43 to 18.16.2.123, there would be no way 1049 for Bob to determine which pair of addresses should be included in 1050 this tunnel, and he would have to make his best guess or reject the 1051 request with a status of SINGLE_PAIR_REQUIRED. 1053 To enable Bob to choose the appropriate range in this case, if Alice 1054 has initiated the SA due to a data packet, Alice MAY include as the 1055 first traffic selector in each of TSi and TSr a very specific traffic 1056 selector including the addresses in the packet triggering the 1057 request. In the example, Alice would include in TSi two traffic 1058 selectors: the first containing the address range (10.2.16.43 - 1059 10.2.16.43) and the source port and protocol from the packet and the 1060 second containing (10.2.16.0 - 10.2.16.255) with all ports and 1061 protocols. She would similarly include two traffic selectors in TSr. 1063 If Bob's policy does not allow him to accept the entire set of 1064 traffic selectors in Alice's request, but does allow him to accept 1065 the first selector of TSi and TSr, then Bob MUST narrow the traffic 1066 selectors to a subset that includes Alice's first choices. In this 1067 example, Bob might respond with TSi being (10.2.16.43 - 10.2.16.43) 1068 with all ports and protocols. 1070 If Alice creates the CHILD_SA pair not in response to an arriving 1071 packet, but rather - say - upon startup, then there may be no 1072 specific addresses Alice prefers for the initial tunnel over any 1073 other. In that case, the first values in TSi and TSr MAY be ranges 1074 rather than specific values, and Bob chooses a subset of Alice's TSi 1075 and TSr that are acceptable to him. If more than one subset is 1076 acceptable but their union is not, Bob MUST accept some subset and 1077 MAY include a NOTIFY payload of type ADDITIONAL_TS_POSSIBLE to 1078 indicate that Alice might want to try again. This case will only 1079 occur when Alice and Bob are configured differently from one another. 1080 If Alice and Bob agree on the granularity of tunnels, she will never 1081 request a tunnel wider than Bob will accept. 1083 2.10 Nonces 1085 The IKE_SA_INIT messages each contain a nonce. These nonces are used 1086 as inputs to cryptographic functions. The CREATE_CHILD_SA request 1087 and the CREATE_CHILD_SA response also contain nonces. These nonces 1088 are used to add freshness to the key derivation technique used to 1089 obtain keys for CHILD_SAs. Nonces used in IKEv2 MUST therefore be 1090 randomly chosen and be at least 128 bits in size. 1092 2.11 Address and Port Agility 1094 IKE runs over UDP ports 500 and 4500, and implicitly sets up ESP and 1095 AH associations for the same IP addresses it runs over. The IP 1096 addresses and ports in the outer header are, however, not themselves 1097 cryptographically protected, and IKE is designed to work even through 1098 Network Address Translation (NAT) boxes. An implementation MUST 1099 accept incoming connection requests even if not received from UDP 1100 port 500 or 4500, and MUST respond to the address and port from which 1101 the request was received. IKE functions identically over IPv4 or 1102 IPv6. 1104 2.12 Reuse of Diffie-Hellman Exponentials 1106 IKE generates keying material using an ephemeral Diffie-Hellman 1107 exchange in order to gain the property of "perfect forward secrecy". 1108 This means that once a connection is closed and its corresponding 1109 keys are forgotten, even someone who has recorded all of the data 1110 from the connection and gets access to all of the long term keys of 1111 the two endpoints cannot reconstruct the keys used to protect the 1112 conversation. 1114 Achieving perfect forward secrecy requires that when a connection is 1115 closed, each endpoint must forget not only the keys used by the 1116 connection but any information that could be used to recompute those 1117 keys. In particular, it must forget the secrets used in the Diffie- 1118 Hellman calculation and any state that may persist in the state of a 1119 pseudo-random number generater that could be used to recompute the 1120 Diffie-Hellman secrets. 1122 Since the computing of Diffie-Hellman exponentials is computationally 1123 expensive, an endpoint may find it advantageous to reuse those 1124 exponentials for multiple connection setups. There are several 1125 reasonable strategies for doing this. An endpoint could choose a new 1126 exponential only periodically though this could result in less-than- 1127 perfect forward secrecy if some connection lasts for less than the 1128 lifetime of the exponential. Or it could keep track of which 1129 exponential was used for each connection and delete the information 1130 associated with the exponential only when some corresponding 1131 connection was closed. This would allow the exponential to be reused 1132 without losing perfect forward secrecy at the cost of maintaining 1133 more state. 1135 Decisions as to whether and when to reuse Diffie-Hellman exponentials 1136 is a private decision in the sense that it will not affect 1137 interoperability. An implementation that reuses exponentials MAY 1138 choose to remember the exponential used by the other endpoint on past 1139 exchanges and if one is reused to avoid the second half of the 1140 calculation. 1142 2.13 Generating Keying Material 1144 In the context of the IKE_SA, four cryptographic algorithms are 1145 negotiated: an encryption algorithm, an integrity protection 1146 algorithm, a Diffie-Hellman group, and a pseudo-random function 1147 (prf). The pseudo-random function is used for the construction of 1148 keying material for all of the cryptographic algorithms used in both 1149 the IKE_SA and the CHILD_SAs. 1151 We assume that each encryption algorithm and integrity protection 1152 algorithm uses a fixed size key, and that any randomly chosen value 1153 of that fixed size can serve as an appropriate key. For algorithms 1154 that accept a variable length key, a fixed key size MUST be specified 1155 as part of the cryptographic transform negotiated. For integrity 1156 protection functions based on HMAC, the fixed key size is the size of 1157 the output of the underlying hash function. We assume that the prf 1158 function takes a variable length key and produces a fixed length 1159 output. When the key for the prf function has fixed length, its 1160 specification for use in IKEv2 must include a procedure for deriving 1161 its required fixed length key from a variable length key. 1163 Keying material will always be derived as the output of the 1164 negotiated prf algorithm. Since the amount of keying material needed 1165 may be greater than the size of the output of the prf algorithm, we 1166 will use the prf iteratively. We will use the terminology prf+ to 1167 describe the function that outputs a pseudo-random stream based on 1168 the inputs to a prf as follows: (where | indicates concatenation) 1170 prf+ (K,S) = T1 | T2 | T3 | T4 | ... 1172 where: 1173 T1 = prf (K, S | 0x01) 1174 T2 = prf (K, T1 | S | 0x02) 1175 T3 = prf (K, T2 | S | 0x03) 1176 T4 = prf (K, T3 | S | 0x04) 1178 continuing as needed to compute all required keys. The keys are taken 1179 from the output string without regard to boundaries (e.g. if the 1180 required keys are a 256 bit AES key and a 160 bit HMAC key, and the 1181 prf function generates 160 bits, the AES key will come from T1 and 1182 the beginning of T2, while the HMAC key will come from the rest of T2 1183 and the beginning of T3). 1185 The constant concatenated to the end of each string feeding the prf 1186 is a single octet. prf+ in this document is not defined beyond 255 1187 times the size of the prf output. 1189 2.14 Generating Keying Material for the IKE_SA 1191 The shared keys are computed as follows. A quantity called SKEYSEED 1192 is calculated from the nonces exchanged during the IKE_SA_INIT 1193 exchange and the Diffie-Hellman shared secret established during that 1194 exchange. SKEYSEED is used to calculate five other secrets: SK_d 1195 used for deriving new keys for the CHILD_SAs established with this 1196 IKE_SA; SK_ai and SK_ar used as a key to the integrity protection 1197 algorithm for authenticating the component messages of subsequent 1198 exchanges; and SK_ei and SK_er used for encrypting (and of course 1199 decrypting) all subsequent exchanges. SKEYSEED and its derivatives 1200 are computed as follows: 1202 SKEYSEED = prf(Ni | Nr, g^ir) 1204 {SK_d, SK_ai, SK_ar, SK_ei, SK_er} 1205 = prf+ (SKEYSEED, g^ir | Ni | Nr | SPIi | SPIr ) 1207 (indicating that the quantities SK_d, SK_ai, SK_ar, SK_ei, and SK_er 1208 are taken in order from the generated bits of the prf+). g^ir is the 1209 shared secret from the ephemeral Diffie-Hellman exchange. g^ir is 1210 represented as a string of octets in big endian order padded with 1211 zeros if necessary to make it the length of the modulus. Ni and Nr 1212 are the nonces, stripped of any headers. 1214 The two directions of flow use different keys. The keys used to 1215 protect messages from the original initiator are SK_ai and SK_ei. The 1216 keys used to protect messages in the other direction are SK_ar and 1217 SK_er. Each algorithm takes a fixed number of bits of keying 1218 material, which is specified as part of the algorithm. For integrity 1219 algorithms based on HMAC, the key size is always equal to the length 1220 of the output of the underlying hash function. 1222 2.15 Authentication of the IKE_SA 1224 When not using extended authentication (see section 2.16), the peers 1225 are authenticated by having each sign (or MAC using a shared secret 1226 as the key) a block of data. For the responder, the octets to be 1227 signed start with the first octet of the first SPI in the header of 1228 the second message and end with the last octet of the last payload in 1229 the second message. Appended to this (for purposes of computing the 1230 signature) are the initiator's nonce Ni (just the value, not the 1231 payload containing it), and the value prf(SK_ar,IDr') where IDr' is 1232 the responder's ID payload excluding the fixed header. Note that 1233 neither the nonce Ni nor the value prf(SK_ar,IDr') are transmitted. 1234 Similarly, the initiator signs the first message, starting with the 1235 first octet of the first SPI in the header and ending with the last 1236 octet of the last payload. Appended to this (for purposes of 1237 computing the signature) are the responder's nonce Nr, and the value 1238 prf(SK_ai,IDi'). In the above calculation, IDi' and IDr' are the 1239 entire ID payloads excluding the fixed header. It is critical to the 1240 security of the exchange that each side sign the other side's nonce 1241 (see [SIGMA]). 1243 Note that all of the payloads are included under the signature, 1244 including any payload types not defined in this document. If the 1245 first message of the exchange is sent twice (the second time with a 1246 responder cookie and/or a different Diffie-Hellman group), it is the 1247 second version of the message that is signed. 1249 Optionally, messages 3 and 4 MAY include a certificate, or 1250 certificate chain providing evidence that the key used to compute a 1251 digital signature belongs to the name in the ID payload. The 1252 signature or MAC will be computed using algorithms dictated by the 1253 type of key used by the signer, an RSA-signed PKCS1-padded-hash for 1254 an RSA digital signature, a DSS-signed SHA1-hash for a DSA digital 1255 signature, or the negotiated prf function for a pre-shared key. 1256 There is no requirement that the Initiator and Responder sign with 1257 the same cryptographic algorithms. The choice of cryptographic 1258 algorithms depends on the type of key each has. This type is either 1259 indicated in the certificate supplied or, if the keys were exchanged 1260 out of band, the key types must have been similarly learned. In 1261 particular, the initiator may be using a shared key while the 1262 responder may have a public signature key and certificate. It will 1263 commonly be the case (but it is not required) that if a shared secret 1264 is used for authentication that the same key is used in both 1265 directions. Note that it is a common but insecure practice to have a 1266 shared key derived from a user chosen password. This is insecure 1267 because user chosen passwords are unlikely to have sufficient 1268 randomness to resist dictionary attacks. The pre-shared key SHOULD 1269 contain as much randomness as the strongest key being negotiated. In 1270 the case of a pre-shared key, the AUTH value is computed as: 1272 AUTH = prf(Shared Secret | "Key Pad for IKEv2", ) 1274 where the string "Key Pad for IKEv2" is ASCII encoded and not null 1275 terminated. The shared secret can be variable length. The pad string 1276 is added so that if the shared secret is derived from a password, the 1277 IKE implementation need not store the password in cleartext, but 1278 rather can store a one way transformation of it that could not be 1279 used as a password equivalent for protocols other than IKEv2. As 1280 noted above, deriving the shared secret from a password is not 1281 secure. This construction is used because it is anticipated that 1282 people will do it anyway. 1284 2.16 Extended Authentication Protocol Methods 1286 In addition to authentication using public key signatures and shared 1287 secrets, IKE supports authentication using methods defined in RFC 1288 2284 [EAP]. Typically, these methods are asymmetric (designed for a 1289 user authenticating to a server), and they may not be mutual. For 1290 this reason, these protocols are typically used to authenticate the 1291 initiator to the responder and are used in addition to a public key 1292 signature based authentication of the responder to the initator. 1293 These methods are also referred to as "Legacy Authentication" 1294 mechanisms. 1296 While this memo references [EAP] with the intent that new methods can 1297 be added in the future without updating this specification, the 1298 protocols expected to be used most commonly are fully documented here 1299 and in section 3.16. [EAP] defines an authentication protocol 1300 requiring a variable number of messages. Extended Authentication is 1301 implemented in IKE as additional IKE_AUTH exchanges that MUST be 1302 completed in order to initialize the IKE_SA. 1304 An initiator indicates a desire to use extended authentication by 1305 leaving out the AUTH payload from message 3. By including an IDi 1306 payload but not an AUTH payload, the initiator has declared an 1307 identity but has not proven it. If the responder is willing to use an 1308 extended authentication method, it will place an EAP payload in 1309 message 4 and defer sending SAr2, TSi, and TSr until initiator 1310 authentication is complete in a subsequent IKE_AUTH exchange. In the 1311 case of a minimal extended authentication, the initial SA 1312 establishment will appear as follows: 1314 Initiator Responder 1315 ----------- ----------- 1316 HDR, SAi1, KEi, Ni --> 1318 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 1320 HDR, SK {IDi, [CERTREQ,] [IDr,] 1321 SAi2, TSi, TSr} --> 1323 <-- HDR, SK {IDr, [CERT,] AUTH, 1324 EAP } 1326 HDR, SK {EAP, [AUTH] } --> 1328 <-- HDR, SK {EAP, [AUTH], 1329 SAr2, TSi, TSr } 1331 For EAP methods that create a shared key as a side effect of 1332 authentication, that shared key MUST be used by both the Initiator 1333 and Responder to generate an AUTH payload using the syntax for shared 1334 secrets specified in section 2.15. This shared key MUST NOT be used 1335 for any other purpose. 1337 The Initiator of an IKE_SA using EAP SHOULD be capable of extending 1338 the initial protocol exchange to at least ten IKE_AUTH exchanges in 1339 the event the Responder sends notification messages and/or retries 1340 the authentication prompt. The protocol terminates when the Responder 1341 sends the Initiator and EAP payload containing either a success or 1342 failure type. 1344 2.17 Generating Keying Material for CHILD_SAs 1346 CHILD_SAs are created either by being piggybacked on the IKE_AUTH 1347 exchange, or in a CREATE_CHILD_SA exchange. Keying material for them 1348 is generated as follows: 1350 KEYMAT = prf+(SK_d, Ni | Nr) 1352 Where Ni and Nr are the Nonces from the IKE_SA_INIT exchange if this 1353 request is the first CHILD_SA created or the fresh Ni and Nr from the 1354 CREATE_CHILD_SA exchange if this is a subsequent creation. 1356 For CREATE_CHILD_SA exchanges with PFS the keying material is defined 1357 as: 1359 KEYMAT = prf+(SK_d, g^ir (ph2) | Ni | Nr ) 1361 where g^ir (ph2) is the shared secret from the ephemeral Diffie- 1362 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 1363 octet string in big endian order padded with zeros if necessary to 1364 make it the length of the modulus), 1366 A single CHILD_SA negotiation may result in multiple security 1367 associations. ESP and AH SAs exist in pairs (one in each direction), 1368 and four SAs could be created in a single CHILD_SA negotiation if a 1369 combination of ESP and AH is being negotiated. 1371 Keying material is taken from the expanded KEYMAT in the following 1372 order: 1374 All keys for SAs carrying data from the initiator to the responder 1375 are taken before SAs going in the reverse direction. 1377 If multiple protocols are negotiated, keying material is taken in 1378 the order in which the protocol headers will appear in the 1379 encapsulated packet. 1381 If a single protocol has both encryption and authentication keys, 1382 the encryption key is taken from the first octets of KEYMAT and 1383 the authentication key is taken from the next octets. 1385 Each cryptographic algorithm takes a fixed number of bits of keying 1386 material specified as part of the algorithm. 1388 2.18 Rekeying IKE_SAs using a CREATE_CHILD_SA exchange 1390 The CREATE_CHILD_SA exchange can be used to re-key an existing IKE_SA 1391 (see section 2.8). New Initiator and Responder SPIs are supplied in 1392 the SPI fields. The TS payloads are omitted when rekeying an IKE_SA. 1393 SKEYSEED for the new IKE_SA is computed using SK_d from the existing 1394 IKE_SA as follows: 1396 SKEYSEED = prf(SK_d (old), [g^ir (new)] | Ni | Nr) 1398 where g^ir (new) is the shared secret from the ephemeral Diffie- 1399 Hellman exchange of this CREATE_CHILD_SA exchange (represented as an 1400 octet string in big endian order padded with zeros if necessary to 1401 make it the length of the modulus) and Ni and Nr are the two nonces 1402 stripped of any headers. 1404 The new IKE_SA MUST reset its message counters to 0. 1406 SK_d, SK_ai, SK_ar, and SK_ei, and SK_er are computed from SKEYSEED 1407 as specified in section 2.14. 1409 2.19 Requesting an internal address on a remote network 1411 Most commonly in the endpoint to gateway scenario, an endpoint may 1412 need an IP address on the gateway's internal network, and may need to 1413 have that address dynamically assigned. A request for such a 1414 temporary address can be included in any request to create a CHILD_SA 1415 (including the implicit request in message 3) by including a CP 1416 payload. 1418 This function provides address allocation to an IRAC trying to tunnel 1419 into a network protected by an IRAS. Since the IKE_AUTH exchange 1420 creates an IKE_SA and a CHILD_SA the IRAC MUST request the internal 1421 address, and optionally other information concerning the internal 1422 network, in the IKE_AUTH exchange. The may IRAS procure an internal 1423 address for the IRAC from any number of sources such as a DHCP/BOOTP 1424 server or its own address pool. 1426 Initiator Responder 1427 ----------------------------- --------------------------- 1428 HDR, SK {IDi, [CERT,] [CERTREQ,] 1429 [IDr,] AUTH, CP(CFG_REQUEST), 1430 SAi2, TSi, TSr} --> 1432 <-- HDR, SK {IDr, [CERT,] AUTH, 1433 CP(CFG_REPLY), SAr2, 1434 TSi, TSr} 1436 In all cases, the CP payload MUST be inserted immediately before the 1437 SA payload. In variations of the protocol where there are multiple 1438 IKE_AUTH exchanges, the CP payloads MUST be inserted in the messages 1439 containing the SA payloads. 1441 CP(CFG_REQUEST) MUST contain at least an INTERNAL_ADDRESS attribute 1442 (either IPv4 or IPv6) but MAY contain any number of additional 1443 attributes the initiator wants returned in the response. 1445 For example, message from Initiator to Responder: 1446 CP(CFG_REQUEST)= 1447 INTERNAL_ADDRESS(0.0.0.0) 1448 INTERNAL_NETMASK(0.0.0.0) 1449 INTERNAL_DNS(0.0.0.0) 1450 TSi = (0, 0-65536,0.0.0.0-255.255.255.255) 1451 TSr = (0, 0-65536,0.0.0.0-255.255.255.255) 1453 NOTE: Traffic Selectors are a (protocol, port range, address range) 1455 Message from Responder to Initiator: 1457 CP(CFG_REPLY)= 1458 INTERNAL_ADDRESS(192.168.219.202) 1459 INTERNAL_NETMASK(255.255.255.0) 1460 INTERNAL_SUBNET(192.168.219.0/255.255.255.0) 1461 TSi = (0, 0-65536,192.168.219.202-192.168.219.202) 1462 TSr = (0, 0-65536,192.168.219.0-192.168.219.255) 1464 All returned values will be implementation dependent. As can be seen 1465 in the above example, the IRAS MAY also send other attributes that 1466 were not included in CP(CFG_REQUEST) and MAY ignore the non- 1467 mandatory attributes that it does not support. 1469 The responder MUST not send a CFG_REPLY without having first received 1470 a CP(CFG_REQUEST) from the initiator, because we do not want the IRAS 1471 to perform an unnecessary configuration lookup if the IRAC cannot 1472 process the REPLY. In the case where the IRAS's configuration 1473 requires that CP be used for a given identity IDi, but IRAC has 1474 failed to send a CP(CFG_REQUEST), IRAS MUST fail the request, and 1475 terminate the IKE exchange with a FAILED_CP_REQUIRED error. 1477 2.20 Requesting the Peer's Version 1479 An IKE peer wishing to inquire about the other peer's version 1480 information MUST use the method below. This is an example of a 1481 configuration request within an INFORMATIONAL Exchange, after the 1482 IKE_SA and first CHILD_SA have been created. 1484 An IKE implementation MAY decline to give out version information 1485 prior to authentication or even after authentication to prevent 1486 trolling in case some implementation is known to have some security 1487 weakness. In that case, it MUST either return an empty string or no 1488 CP payload if CP is not supported. 1490 Initiator Responder 1491 ----------------------------- -------------------------- 1492 HDR, SK{CP(CFG_REQUEST)} --> 1493 <-- HDR, SK{CP(CFG_REPLY)} 1495 CP(CFG_REQUEST)= 1496 APPLICATION_VERSION("") 1498 CP(CFG_REPLY) 1499 APPLICATION_VERSION("foobar v1.3beta, (c) Foo Bar Inc.") 1501 2.21 Error Handling 1503 There are many kinds of errors that can occur during IKE processing. 1504 If a request is received that is badly formatted or unacceptable for 1505 reasons of policy (e.g. no matching cryptographic algorithms), the 1506 response MUST contain a Notify payload indicating the error. If an 1507 error occurs outside the context of an IKE request (e.g. the node is 1508 getting ESP messages on a non-existent SPI), the node SHOULD initiate 1509 an INFORMATIONAL Exchange with a Notify payload describing the 1510 problem. 1512 Errors that occur before a cryptographically protected IKE_SA is 1513 established must be handled very carefully. There is a trade-off 1514 between wanting to be helpful in diagnosing a problem and responding 1515 to it and wanting to avoid being a dupe in a denial of service attack 1516 based on forged messages. 1518 If a node receives a message on UDP port 500 outside the context of 1519 an IKE_SA known to it (and not a request to start one), it may be the 1520 result of a recent crash of the node. If the message is marked as a 1521 response, the node MAY audit the suspicious event but MUST NOT 1522 respond. If the message is marked as a request, the node MAY audit 1523 the suspicious event and MAY send a response. If a response is sent, 1524 the response MUST be sent to the IP address and port from whence it 1525 came with the same IKE SPIs and the Message ID copied. The response 1526 MUST NOT be cryptographically protected and MUST contain a notify 1527 payload indicating INVALID_IKE_SPI. 1529 A node receiving such an unprotected NOTIFY payload MUST NOT respond 1530 and MUST NOT change the state of any existing SAs. The message might 1531 be a forgery or might be a response the genuine correspondent was 1532 tricked into sending. A node SHOULD treat such a message (and also a 1533 network message like ICMP destination unreachable) as a hint that 1534 there might be problems with SAs to that IP address and SHOULD 1535 initiate a liveness test for any such IKE_SA. An implementation 1536 SHOULD limit the frequency of such tests to avoid being tricked into 1537 participating in a denial of service attack. 1539 A node receiving a suspicious message from an IP address with which 1540 it has an IKE_SA MAY send an IKE notify payload in an IKE 1541 INFORMATIONAL exchange over that SA. The recipient MUST NOT change 1542 the state of any SA's as a result but SHOULD audit the event to aid 1543 in diagnosing malfunctions. A node MUST limit the rate at which it 1544 will send messages in response to unprotected messages. 1546 2.22 IPcomp 1548 Use of IP compression [IPCOMP] can be negotiated as part of the setup 1549 of a CHILD_SA. While IP compression involves an extra header in each 1550 packet and a CPI (compression parameter index), the virtual 1551 "compression association" has no life outside the ESP or AH SA that 1552 contains it. Compression associations disappear when the 1553 corresponding ESP or AH SA goes away, and is not explicitly mentioned 1554 in any DELETE payload. 1556 Negotiation of IP compression is separate from the negotiation of 1557 cryptographic parameters associated with a CHILD_SA. A node 1558 requesting a CHILD_SA MAY advertise its support for one or more 1559 compression algorithms though one or more NOTIFY payloads of type 1560 IPCOMP_SUPPORTED. The response MAY indicate acceptance of a single 1561 compression algorithm with a NOTIFY payload of type IPCOMP_SUPPORTED. 1562 These payloads MAY ONLY occur in the same messages that contain SA 1563 payloads. 1565 While there has been discussion of allowing multiple compression 1566 algorithms to be accepted and to have different compression 1567 algorithms available for the two directions of a CHILD_SA, 1568 implementations of this specification MUST NOT accept an IPcomp 1569 algorithm that was not proposed, MUST NOT accept more than one, and 1570 MUST NOT compress using an algorithm other than one proposed and 1571 accepted in the setup of the CHILD_SA. 1573 A side effect of separating the negotiation of IPcomp from 1574 cryptographic parameters is that it is not possible to propose 1575 multiple cryptographic suites and propose IP compression with some of 1576 them but not others. 1578 2.23 NAT Traversal 1580 NAT (Network Address Translation) gateways are a controversial 1581 subject. This section briefly describes what they are and how they 1582 are likely to act on IKE traffic. Many people believe that NATs are 1583 evil and that we should not design our protocols so as to make them 1584 work better. IKEv2 does specify some unintuitive processing rules in 1585 order that NATs are more likely to work. 1587 NATs exist primarily because of the shortage of IPv4 addresses, 1588 though there are other rationales. IP nodes that are "behind" a NAT 1589 have IP addresses that are not globally unique, but rather are 1590 assigned from some space that is unique within the network behind the 1591 NAT but which are likely to be reused by nodes behind other NATs. 1592 Generally, nodes behind NATs can communicate with other nodes behind 1593 the same NAT and with nodes with globally unique addresses, but not 1594 with nodes behind other NATs. There are exceptions to that rule. 1595 When those nodes make connections to nodes on the real Internet, the 1596 NAT gateway "translates" the IP source address to an address that 1597 will be routed back to the gateway. Messages to the gateway from the 1598 Internet have their destination addresses "translated" to the 1599 internal address that will route the packet to the correct endnode. 1601 NATs are designed to be "transparent" to endnodes. Neither software 1602 on the node behind the NAT nor the node on the Internet require 1603 modification to communicate through the NAT. Achieving this 1604 transparency is more difficult with some protocols than with others. 1605 Protocols that include IP addresses of the endpoints within the 1606 payloads of the packet will fail unless the NAT gateway understands 1607 the protocol and modifies the internal references as well as those in 1608 the headers. Such knowledge is inherently unreliable, is a network 1609 layer violation, and often results in subtle problems. 1611 Opening an IPsec connection through a NAT introduces special 1612 problems. If the connection runs in transport mode, changing the IP 1613 addresses on packets will cause the checksums to fail and the NAT 1614 cannot correct the checksums because they are cryptographically 1615 protected. Even in tunnel mode, there are routing problems because 1616 transparently translating the addresses of AH and ESP packets 1617 requires special logic in the NAT and that logic is heuristic and 1618 unreliable in nature. For that reason, IKEv2 can negotiate UDP 1619 encapsulation of IKE, ESP, and AH packets. This encoding is slightly 1620 less efficient but is easier for NATs to process. In addition, 1621 firewalls may be configured to pass IPsec traffic over UDP but not 1622 ESP/AH or vice versa. 1624 It is a common practice of NATs to translate TCP and UDP port numbers 1625 as well as addresses and use the port numbers of inbound packets to 1626 decide which internal node should get a given packet. For this 1627 reason, even though IKE packets MUST be sent from and to UDP port 1628 500, they SHOULD be accepted coming from any port and responses 1629 SHOULD be sent to the port from whence they came. This is because the 1630 ports may be modified as the packets pass through NATs. Similarly, IP 1631 addresses of the IKE endpoints are generally not included in the IKE 1632 payloads because the payloads are cryptographically protected and 1633 could not be transparently modified by NATs. 1635 Port 4500 is reserved for UDP encapsulated ESP, AH, and IKE. When 1636 working through a NAT, it is generally better to pass IKE packets 1637 over port 4500 because some older NATs modify IKE traffic on port 500 1638 in an attempt to transparently establish IPsec connections. Such NATs 1639 may interfere with the straightforward NAT traversal envisioned by 1640 this document, so an IPsec endpoint that discovers a NAT between it 1641 and its correspondent SHOULD send all subsequent traffic to and from 1642 port 4500, which all NATs should know run the NAT-friendly protocol. 1644 The specific requirements for supporting NAT traversal are listed 1645 below. Support for NAT traversal is optional. In this section only, 1646 requirements listed as MUST only apply to implementations supporting 1647 NAT. 1649 IKE MUST listen on port 4500 as well as port 500. IKE MUST respond 1650 to the IP address and port from which packets arrived. 1652 The IKE responder MUST include in its IKE_SA_INIT response Notify 1653 payloads of type NAT_DETECTION_SOURCE_IP and 1654 NAT_DETECTION_DESTINATION_IP. The IKE initiator MUST check these 1655 payloads if present and if they do not match the addresses in the 1656 outer packet MUST tunnel all future IKE, ESP, and AH packets 1657 associated with this IKE_SA over UDP port 4500. 1659 2.24 ECN Notification 1661 Sections 5.1.2.1 and 5.1.2.2 of [RFC 2401] specify that the IPv4 TOS 1662 octet and IPv6 traffic class octet are to be copied from the inner 1663 header to the outer header by the encapsulator and that the outer 1664 header is to be discarded (no change to inner header) by the 1665 decapsulator. If ECN is in use, ECT codepoints will be copied to the 1666 outer header, but if a router within the tunnel changes an ECT 1667 codepoint to a CE codepoint to indicate congestion, that indication 1668 will be discarded by the decapsulator. This behavior is highly 1669 undesirable, and Section 9.2 of [RFC 3168] specifies changes to IPsec 1670 to avoid it. These changes include two ECN operating modes and 1671 negotiation support to detect and cope with IPsec decapsulators that 1672 discard ECN congestion indications; use of ECN in the outer IP header 1673 of IPsec tunnels is not permitted when such discarding is a 1674 possibility. 1676 In order to avoid multiple ECN operating modes and negotiation, 1677 tunnel decapsulators for tunnel-mode Security Associations (SAs) 1678 created by IKEv2 MUST implement the following modifications to 1679 prevent discarding of ECN congestion indications. IKEv2 tunnel- mode 1680 SA negotiation is handled by the USE_TRANSPORT_MODE notify message 1681 type (see Section 5.10.1 of [IKEv2]). The following modifications 1682 *replace* Section 9.2 of RFC 3168 and *update* Sections 5.1.2.1 and 1683 5.1.2.2 of RFC 2401. 1685 Encapsulation and Decapsulation of packets for a tunnel-mode SA 1686 created by IKEv2 MUST NOT follow the modifications specified by 1687 Section 9.2 of RFC 3168 and its subsections. Instead, the following 1688 modifications to encapsulation and decapsulation in Sections 5.1.2.1 1689 and 5.1.2.2 of RFC 2401 MUST be performed: 1691 Outer Hdr at Inner Hdr at 1692 IPv4 Encapsulator Decapsulator 1693 Header fields: -------------------- ------------ 1694 DS Field copied from inner hdr (5) no change 1695 ECN Field copied from inner hdr constructed (7) 1696 IPv6 1697 Header fields: 1698 DS Field copied from inner hdr (6) no change 1699 ECN Field copied from inner hdr constructed (7) 1701 (5)(6) If the packet will immediately enter a domain for which the 1702 DSCP value in the outer header is not appropriate, that value MUST 1703 be mapped to an appropriate value for the domain [RFC 2474]. Also 1704 see [RFC 2475] for further information. 1706 (7) If the ECN field in the inner header is set to ECT(0) or 1707 ECT(1) and the ECN field in the outer header is set to CE, then 1708 set the ECN field in the inner header to CE, otherwise make no 1709 change to the ECN field in the inner header. 1711 (5) and (6) are identical to match usage in [RFC2401], although 1712 they are different in [RFC2401]. These actions are not related to 1713 ECN, but are required for Differentiated Services support. They 1714 are carried over to this document from RFC 3168 so that all of RFC 1715 3168's changes to IPsec can be made non-applicable to SAs created 1716 by IKEv2. 1718 3 Header and Payload Formats 1720 3.1 The IKE Header 1722 IKE messages use UDP ports 500 and/or 4500, with one IKE message per 1723 UDP datagram. Information from the UDP header is largely ignored 1724 except that the IP addresses and UDP ports from the headers are 1725 reversed and used for return packets. When sent on UDP port 500, IKE 1726 messages begin immediately following the UDP header. When sent on UDP 1727 port 4500, IKE messages have prepended four octets of zero. These 1728 four octets of zero are not part of the IKE message and are not 1729 included in any of the length fields or checksums defined by IKE. 1731 Each IKE message begins with the IKE header, denoted HDR in this 1732 memo. Following the header are one or more IKE payloads each 1733 identified by a "Next Payload" field in the preceding payload. 1734 Payloads are processed in the order in which they appear in an IKE 1735 message by invoking the appropriate processing routine according to 1736 the "Next Payload" field in the IKE header and subsequently according 1737 to the "Next Payload" field in the IKE payload itself until a "Next 1738 Payload" field of zero indicates that no payloads follow. If a 1739 payload of type "Encrypted" is found, that payload is decrypted and 1740 its contents parsed as additional payloads. An Encrypted payload MUST 1741 be the last payload in a packet and an encrypted payload MUST NOT 1742 contain another encrypted payload. 1744 The Recipient SPI in the header identifies an instance of an IKE 1745 security association. It is therefore possible for a single instance 1746 of IKE to multiplex distinct sessions with multiple peers. 1748 All multi-octet fields representing integers are laid out in big 1749 endian order (aka most significant byte first, or network byte 1750 order). 1752 The format of the IKE header is shown in Figure 4. 1753 1 2 3 1754 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 1755 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1756 ! IKE_SA Initiator's SPI ! 1757 ! ! 1758 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1759 ! IKE_SA Responder's SPI ! 1760 ! ! 1761 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1762 ! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags ! 1763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1764 ! Message ID ! 1765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1766 ! Length ! 1767 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1769 Figure 4: IKE Header Format 1771 o Initiator's SPI (8 octets) - A value chosen by the 1772 initiator to identify a unique IKE security association. This 1773 value MUST NOT be zero. 1775 o Responder's SPI (8 octets) - A value chosen by the 1776 responder to identify a unique IKE security association. This 1777 value MUST be zero in the first message of an IKE Initial 1778 Exchange and MUST NOT be zero in any other message other 1779 than a cookie request (see section 2.6). 1781 o Next Payload (1 octet) - Indicates the type of payload that 1782 immediately follows the header. The format and value of each 1783 payload is defined below. 1785 o Major Version (4 bits) - indicates the major version of the IKE 1786 protocol in use. Implementations based on this version of IKE 1787 MUST set the Major Version to 2. Implementations based on 1788 previous versions of IKE and ISAKMP MUST set the Major Version 1789 to 1. Implementations based on this version of IKE MUST reject 1790 (or ignore) messages containing a version number greater than 1791 2. 1793 o Minor Version (4 bits) - indicates the minor version of the 1794 IKE protocol in use. Implementations based on this version of 1795 IKE MUST set the Minor Version to 0. They MUST ignore the minor 1796 version number of received messages. 1798 o Exchange Type (1 octet) - indicates the type of exchange being 1799 used. This dictates the payloads sent in each message and 1800 message orderings in the exchanges. 1802 Exchange Type Value 1804 RESERVED 0 1805 Reserved for ISAKMP 1-31 1806 Reserved for IKEv1 32-33 1807 IKE_SA_INIT 34 1808 IKE_AUTH 35 1809 CREATE_CHILD_SA 36 1810 INFORMATIONAL 37 1811 Reserved for IKEv2+ 38-239 1812 Reserved for private use 240-255 1814 o Flags (1 octet) - indicates specific options that are set 1815 for the message. Presence of options are indicated by the 1816 appropriate bit in the flags field being set. The bits are 1817 defined LSB first, so bit 0 would be the least significant 1818 bit of the Flags octet. In the description below, a bit 1819 being 'set' means its value is '1', while 'cleared' means 1820 its value is '0'. 1822 -- X(reserved) (bits 0-2) - These bits MUST be cleared 1823 when sending and MUST be ignored on receipt. 1825 -- I(nitiator) (bit 3 of Flags) - This bit MUST be set in 1826 messages sent by the original Initiator of the IKE_SA 1827 and MUST be cleared in messages sent by the original 1828 Responder. It is used by the recipient to determine 1829 which eight octets of the SPI was generated by the 1830 recipient. 1832 -- V(ersion) (bit 4 of Flags) - This bit indicates that 1833 the transmitter is capable of speaking a higher major 1834 version number of the protocol than the one indicated 1835 in the major version number field. Implementations of 1836 IKEv2 must clear this bit when sending and MUST ignore 1837 it in incoming messages. 1839 -- R(esponse) (bit 5 of Flags) - This bit indicates that 1840 this message is a response to a message containing 1841 the same message ID. This bit MUST be cleared in all 1842 request messages and MUST be set in all responses. 1843 An IKE endpoint MUST NOT generate a response to a 1844 message that is marked as being a response. 1846 -- X(reserved) (bits 6-7 of Flags) - These bits MUST be 1847 cleared when sending and MUST be ignored on receipt. 1849 o Message ID (4 octets) - Message identifier used to control 1850 retransmission of lost packets and matching of requests and 1851 responses. It is essential to the security of the protocol 1852 because it is used to prevent message replay attacks. 1853 See section 2.2. 1855 o Length (4 octets) - Length of total message (header + payloads) 1856 in octets. 1858 3.2 Generic Payload Header 1860 Each IKE payload defined in sections 3.3 through 3.16 begins with a 1861 generic header, shown in Figure 5. Figures for each payload below 1862 will include the generic payload header but for brevity the 1863 description of each field will be omitted. 1865 1 2 3 1866 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 1867 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1868 ! Next Payload !C! RESERVED ! Payload Length ! 1869 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1871 Figure 5: Generic Payload Header 1873 The Generic Payload Header fields are defined as follows: 1875 o Next Payload (1 octet) - Identifier for the payload type of the 1876 next payload in the message. If the current payload is the last 1877 in the message, then this field will be 0. This field provides 1878 a "chaining" capability whereby additional payloads can be 1879 added to a message by appending it to the end of the message 1880 and setting the "Next Payload" field of the preceding payload 1881 to indicate the new payload's type. For an Encrypted payload, 1882 which must always be the last payload of a message, the Next 1883 Payload field is set to the payload type of the first contained 1884 payload. 1886 o Critical (1 bit) - MUST be set to zero if the sender wants 1887 the recipient to skip this payload if he does not 1888 understand the payload type code in the Next Payload field 1889 of the previous payload. MUST be set to one if the 1890 sender wants the recipient to reject this entire message 1891 if he does not understand the payload type. MUST be ignored 1892 by the recipient if the recipient understands the payload type 1893 code. MUST be set to zero for payload types defined in this 1894 document. Note that the critical bit applies to the current 1895 payload rather than the "next" payload whose type code 1896 appears in the first octet. The reasoning behind not setting 1897 the critical bit for payloads defined in this document is 1898 that all implementations MUST understand all payload types 1899 defined in this document and therefore must ignore the 1900 Critical bit's value. Skipped payloads are expected to 1901 have valid Next Payload and Payload Length fields. 1903 o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored. 1905 o Payload Length (2 octets) - Length in octets of the current 1906 payload, including the generic payload header. 1908 3.3 Security Association Payload 1910 The Security Association Payload, denoted SA in this memo, is used to 1911 negotiate attributes of a security association. Assembly of Security 1912 Association Payloads requires great peace of mind. An SA may contain 1913 multiple proposals. Each proposal may contain multiple protocols 1914 (where a protocol is IKE, ESP, or AH), each protocol may contain 1915 multiple transforms, and each transform may contain multiple 1916 attributes. When parsing an SA, an implementation MUST check that the 1917 total Payload Length is consistent with the payload's internal 1918 lengths and counts. Proposals, Transforms, and Attributes each have 1919 their own variable length encodings. They are nested such that the 1920 Payload Length of an SA includes the combined contents of the SA, 1921 Proposal, Transform, and Attribute information. The length of a 1922 Proposal includes the lengths of all Transforms and Attributes it 1923 contains. The length of a Transform includes the lengths of all 1924 Attributes it contains. 1926 The syntax of Security Associations, Proposals, Transforms, and 1927 Attributes is based on ISAKMP, however the semantics are somewhat 1928 different. The reason for the complexity and the hierarchy is to 1929 allow for multiple possible combinations of algorithms to be encoded 1930 in a single SA. Sometimes there is a choice of multiple algorithms, 1931 while other times there is a combination of algorithms. For example, 1932 an Initiator might want to propose using (AH w/MD5 and ESP w/3DES) OR 1933 (ESP w/MD5 and 3DES). 1935 One of the reasons the semantics of the SA payload has changed from 1936 ISAKMP and IKEv1 is to make the encodings more compact in common 1937 cases. 1939 The Proposal structure contains within it a Proposal # and a 1940 Protocol_id. Each structure MUST have the same Proposal # as the 1941 previous one or one greater. The first Proposal MUST have a Proposal 1942 # of one. If two successive structures have the same Proposal number, 1943 it means that the proposal consists of the first structure AND the 1944 second. So a proposal of AH AND ESP would have two proposal 1945 structures, one for AH and one for ESP and both would have Proposal 1946 #1. A proposal of AH OR ESP would have two proposal structures, one 1947 for AH with proposal #1 and one for ESP with proposal #2. 1949 Each Proposal/Protocol structure is followed by one or more transform 1950 structures. The number of different transforms is generally 1951 determined by the Protocol. AH generally has a single transform: an 1952 integrity check algorithm. ESP generally has two: an encryption 1953 algorithm AND an integrity check algorithm. IKE generally has four 1954 transforms: a Diffie-Hellman group, an integrity check algorithm, a 1955 PRF algorithm, and an encryption algorithm. For each Protocol, the 1956 set of permissible transforms are assigned transform ID numbers, 1957 which appear in the header of each transform. 1959 If there are multiple transforms with the same Transform Type, the 1960 proposal is an OR of those transforms. If there are multiple 1961 Transforms with different Transform Types, the proposal is an AND of 1962 the different groups. For example, to propose ESP with (3DES or IDEA) 1963 and (HMAC_MD5 or HMAC_SHA), the ESP proposal would contain two 1964 Transform Type 1 candidates (one for 3DES and one for IDEA) and two 1965 Transform Type 2 candidates (one for HMAC_MD5 and one for HMAC_SHA). 1966 This effectively proposes four combinations of algorithms. If the 1967 Initiator wanted to propose only a subset of those - say (3DES and 1968 HMAC_MD5) or (IDEA and HMAC_SHA), there is no way to encode that as 1969 multiple transforms within a single Proposal. Instead, the Initiator 1970 would have to construct two different Proposals, each with two 1971 transforms. 1973 A given transform MAY have one or more Attributes. Attributes are 1974 necessary when the transform can be used in more than one way, as 1975 when an encryption algorithm has a variable key size. The transform 1976 would specify the algorithm and the attribute would specify the key 1977 size. Most transforms do not have attributes. 1979 Note that the semantics of Transforms and Attributes are quite 1980 different than in IKEv1. In IKEv1, a single Transform carried 1981 multiple algorithms for a protocol with one carried in the Transform 1982 and the others carried in the Attributes. 1984 1 2 3 1985 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 1986 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1987 ! Next Payload !C! RESERVED ! Payload Length ! 1988 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1989 ! ! 1990 ~ ~ 1991 ! ! 1992 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1994 Figure 6: Security Association Payload 1996 o Proposals (variable) - one or more proposal substructures. 1998 The payload type for the Security Association Payload is one (1). 2000 3.3.1 Proposal Substructure 2002 1 2 3 2003 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 2004 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2005 ! 0 (last) or 2 ! RESERVED ! Proposal Length ! 2006 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2007 ! Proposal # ! Protocol-Id ! SPI Size !# of Transforms! 2008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2009 ~ SPI (variable) ~ 2010 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2011 ! ! 2012 ~ ~ 2013 ! ! 2014 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2016 Figure 7: Proposal Substructure 2018 o 0 (last) or 2 (more) (1 octet) - Specifies whether this is the 2019 last Proposal Substructure in the SA. This syntax is inherited 2020 from ISAKMP, but is unnecessary because the last Proposal 2021 could be identified from the length of the SA. The value (2) 2022 corresponds to a Payload Type of Proposal, and the first 2023 four octets of the Proposal structure are designed to look 2024 somewhat like the header of a Payload. 2026 o RESERVED (1 octet) - MUST be sent as zero; MUST be ignored. 2028 o Proposal Length (2 octets) - Length of this proposal, 2029 including all transforms and attributes that follow. 2031 o Proposal # (1 octet) - When a proposal is made, the first 2032 proposal in an SA MUST be #1, and subsequent proposals 2033 MUST either be the same as the previous proposal (indicating 2034 an AND of the two proposals) or one more than the previous 2035 proposal (indicating an OR of the two proposals). When a 2036 proposal is accepted, all of the proposal numbers in the 2037 SA must be the same and must match the number on the 2038 proposal sent that was accepted. 2040 o Protocol-Id (1 octet) - Specifies the protocol identifier 2041 for the current negotiation. Zero (0) indicates IKE, 2042 one (1) indicated ESP, and two (2) indicates AH. 2044 o SPI Size (1 octet) - For an initial IKE_SA negotiation, 2045 this field MUST be zero; the SPI is obtained from the cookie 2046 field of the outer header. During subsequent negotiations, 2047 it is equal to the size, in octets, of the SPI of the 2048 corresponding protocol (8 for IKE, 4 for ESP and AH). 2050 o # of Transforms (1 octet) - Specifies the number of 2051 transforms in this proposal. 2053 o SPI (variable) - The sending entity's SPI. Even if the SPI 2054 Size is not a multiple of 4 octets, there is no padding 2055 applied to the payload. When the SPI Size field is zero, 2056 this field is not present in the Security Association 2057 payload. 2059 o Transforms (variable) - one or more transform substructures. 2061 3.3.2 Transform Substructure 2063 1 2 3 2064 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 2065 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2066 ! 0 (last) or 3 ! RESERVED ! Transform Length ! 2067 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2068 !Transform Type ! RESERVED ! Transform ID ! 2069 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2070 ! ! 2071 ~ Transform Attributes ~ 2072 ! ! 2073 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2075 Figure 8: Transform Substructure 2077 o 0 (last) or 3 (more) (1 octet) - Specifies whether this is the 2078 last Transform Substructure in the Proposal. This syntax is 2079 inherited from ISAKMP, but is unnecessary because the last 2080 Proposal could be identified from the length of the SA. The 2081 value (3) corresponds to a Payload Type of Transform, and 2082 the first four octets of the Transform structure are designed 2083 to look somewhat like the header of a Payload. 2085 o RESERVED - MUST be sent as zero; MUST be ignored. 2087 o Transform Length - The length (in octets) of the Transform 2088 Substructure including Header and Attributes. 2090 o Transform Type (1 octet) - The type of transform being specified 2091 in this transform. Different protocols support different 2092 transform types. For some protocols, some of the transforms 2093 may be optional. If a transform is optional and the initiator 2094 wishes to propose that the transform be omitted, no transform 2095 of the given type is included in the proposal. If the 2096 initiator wishes to make use of the transform optional to 2097 the responder, she includes a transform substructure with 2098 transform ID = 0 as one of the options. 2100 o Transform ID (1 octet) - The specific instance of the transform 2101 type being proposed. 2103 Transform Type Values 2105 Transform Used In 2106 Type 2107 Encryption Algorithm 1 (IKE and ESP) 2108 Pseudo-random Function 2 (IKE) 2109 Integrity Algorithm 3 (IKE, AH, and optional in ESP) 2110 Diffie-Hellman Group 4 (IKE and optional in AH and ESP) 2111 Extended Sequence Numbers 5 (Optional in AH and ESP) 2113 values 8-240 are reserved to IANA. Values 241-255 are for 2114 private use among mutually consenting parties. 2116 For Transform Type 1 (Encryption Algorithm), defined Transform IDs 2117 are: 2119 Name Number Defined In 2120 RESERVED 0 2121 ENCR_DES_IV64 1 (RFC1827) 2122 ENCR_DES 2 (RFC2405) 2123 ENCR_3DES 3 (RFC2451) 2124 ENCR_RC5 4 (RFC2451) 2125 ENCR_IDEA 5 (RFC2451) 2126 ENCR_CAST 6 (RFC2451) 2127 ENCR_BLOWFISH 7 (RFC2451) 2128 ENCR_3IDEA 8 (RFC2451) 2129 ENCR_DES_IV32 9 2130 ENCR_RC4 10 2131 ENCR_NULL 11 (RFC2410) 2132 ENCR_AES_128_CBC 12 2133 ENCR_AES_128_CTR 13 2135 values 13-240 are reserved to IANA. Values 241-255 are for 2136 private use among mutually consenting parties. 2138 For Transform Type 2 (Pseudo-random Function), defined Transform IDs 2139 are: 2141 Name Number Defined In 2142 RESERVED 0 2143 PRF_HMAC_MD5 1 (RFC2104) 2144 PRF_HMAC_SHA1 2 (RFC2104) 2145 PRF_HMAC_TIGER 3 (RFC2104) 2146 PRF_AES128_CBC 4 2148 values 4-240 are reserved to IANA. Values 241-255 are for 2149 private use among mutually consenting parties. 2151 For Transform Type 3 (Integrity Algorithm), defined Transform IDs 2152 are: 2154 Name Number Defined In 2155 NONE 0 2156 AUTH_HMAC_MD5_96 1 (RFC2403) 2157 AUTH_HMAC_SHA1_96 2 (RFC2404) 2158 AUTH_DES_MAC 3 2159 AUTH_KPDK_MD5 4 (RFC1826) 2160 AUTH_AES_XCBC_96 5 2162 For Transform Type 4 (Diffie-Hellman Group), defined Transform IDs 2163 are: 2165 Name Number 2166 NONE 0 2167 Pre-defined (see Appendix B) 1 - 5 2168 RESERVED 6 - 200 2169 MODP (exponentiation) 201 (w/attributes) 2170 ECP (elliptic curve over GF[P] 202 (w/attributes) 2171 EC2N (elliptic curve over GF[2^N]) 203 (w/attributes) 2173 values 6-200 are reserved to IANA for new MODP, ECP or EC2N 2174 groups. Values 204-255 are for private use among mutually 2175 consenting parties. Specification of values 201, 202 or 203 2176 allow peers to define a new Diffie-Hellman group in-line as 2177 part of the exchange. Private use of values 204-255 may entail 2178 complete definition of a group or may require attributes to 2179 accompany them. 2181 For Transform Type 5 (Extended Sequence Numbers), defined Transform 2182 IDs are: 2184 Name Number 2185 No Extended Sequence Numbers 0 2186 Extended Sequence Numbers 1 2187 RESERVED 2 - 255 2189 If Transform Type 5 is not included in a proposal, use of 2190 Extended Sequence Numbers is assumed. 2192 3.3.3 Mandatory Transform Types 2194 The number and type of transforms that accompany an SA payload are 2195 dependent on the protocol in the SA itself. An SA payload proposing 2196 the establishment of an SA has the following mandatory and optional 2197 transform types. A compliant implementation MUST support all 2198 mandatory and optional types for each protocol it supports. Whether 2199 the optional types are present in a particular proposal depends 2200 solely on the discretion of the sender. 2202 Protocol Mandatory Types Optional Types 2203 IKE 1, 2, 3, 4 2204 ESP 1 3, 4, 5 2205 AH 3 4, 5 2207 3.3.4 Mandatory Transform IDs 2209 The specification of suites that MUST and SHOULD be supported for 2210 interoperability has been removed from this document because they are 2211 likely to change more rapidly than this document evolves. 2213 The previously-MUST ciphersuites (3DES/HMAC_SHA1/DH Group 2) are 2214 based on currently-deployed hardware that meets the security 2215 requirements of the vast majority of current IPsec users, and should 2216 be useful for at least a decade according to cryptographic estimates 2217 from NIST for business user scenarios. The previously-SHOULD 2218 ciphersuites (AES/HMAC_SHA1/DH Group 5) are based on expectations of 2219 where the security industry is moving (namely, to the AES encryption 2220 suite) and where more security-conscious users are moving as current 2221 key lengths become more attackable due to the steady lowering of cost 2222 to mount brute-force attacks. 2224 An important lesson learned from IKEv1 is that no system should only 2225 implement the mandatory algorithms and expect them to be the best 2226 choice for all customers. For example, at the time that this document 2227 was being written, many IKEv1 implementers are starting to migrate to 2228 AES in CBC mode for VPN applications. Many IPsec systems based on 2229 IKEv2 will implement AES, longer Diffie-Hellman keys, and additional 2230 hash algorithms, and some IPsec customers already require these 2231 algorithms in addition to the ones listed above. 2233 It is likely that IANA will add additional transforms in the future, 2234 and some users may want to use private suites, especially for IKE 2235 where implementations should be capable of supporting different 2236 parameters, up to certain size limits. In support of this goal, all 2237 implementations of IKEv2 SHOULD include a management facility that 2238 allows specification (by a user or system administrator) of Diffie- 2239 Hellman parameters (the generator, modulus, and exponent lengths and 2240 values) for new DH groups. Implementations SHOULD provide a 2241 management interface via which these parameters and the associated 2242 transform IDs may be entered (by a user or system administrator), to 2243 enable negotiating such groups. 2245 All implementations of IKEv2 MUST include a management facility that 2246 enables a user or system administrator to specify the suites that are 2247 acceptable for use with IKE. Upon receipt of a payload with a set of 2248 transform IDs, the implementation MUST compare the transmitted 2249 transform IDs against those locally configured via the management 2250 controls, to verify that the proposed suite is acceptable based on 2251 local policy. The implementation MUST reject key exchange payloads 2252 that are not authorized by these IKE suite controls. 2253 3.3.5 Transform Attributes 2255 Each transform in a Security Association payload may include 2256 attributes that modify or complete the specification of the 2257 transform. These attributes are type/value pairs and are defined 2258 below. For example, if an encryption algorithm has a variable length 2259 key, the key length to be used may be specified as an attribute. 2260 Attributes can have a value with a fixed two octet length or a 2261 variable length value. For the latter the attribute is the form of 2262 type/length/value. 2264 1 2 3 2265 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 2266 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2267 !A! Attribute Type ! AF=0 Attribute Length ! 2268 !F! ! AF=1 Attribute Value ! 2269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2270 ! AF=0 Attribute Value ! 2271 ! AF=1 Not Transmitted ! 2272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2274 Figure 9: Data Attributes 2276 o Attribute Type (2 octets) - Unique identifier for each type of 2277 attribute (see below). 2279 The most significant bit of this field is the Attribute Format 2280 bit (AF). It indicates whether the data attributes follow the 2281 Type/Length/Value (TLV) format or a shortened Type/Value (TV) 2282 format. If the AF bit is zero (0), then the Data Attributes 2283 are of the Type/Length/Value (TLV) form. If the AF bit is a 2284 one (1), then the Data Attributes are of the Type/Value form. 2286 o Attribute Length (2 octets) - Length in octets of the Attribute 2287 Value. When the AF bit is a one (1), the Attribute Value is 2288 only 2 octets and the Attribute Length field is not present. 2290 o Attribute Value (variable length) - Value of the Attribute 2291 associated with the Attribute Type. If the AF bit is a 2292 zero (0), this field has a variable length defined by the 2293 Attribute Length field. If the AF bit is a one (1), the 2294 Attribute Value has a length of 2 octets. 2296 Note that while quite a few attribute types are defined, the only 2297 algorithms defined in this document that accept attributes are the 2298 defined on the fly Diffie-Hellman groups, whose use is optional and 2299 likely unusual. An IKEv2 implementation MAY ignore attributes if it 2300 does not support any algorithms that use them. 2302 Attributes described as basic MUST NOT be encoded as variable. 2303 Variable length attributes MUST NOT be encoded as basic even if their 2304 value can fit into two octets. NOTE: This is a change from IKEv1, 2305 where increased flexibility may have simplified the composer of 2306 messages but certainly complicated the parser. 2308 Attribute Type value Attribute Format 2309 -------------------------------------------------------------- 2310 RESERVED 0-5 2311 Group Prime/Irreducible Polynomial 6 TLV 2312 Group Generator One 7 TLV 2313 Group Generator Two 8 TLV 2314 Group Curve A 9 TLV 2315 Group Curve B 10 TLV 2316 RESERVED 11-13 2317 Key Length 14 TV 2318 Field Size 15 TV 2319 Group Order 16 TLV 2320 Block Size 17 TV 2322 values 0-5, 11-13, and 18-16383 are reserved to IANA. Values 2323 16384-32767 are for private use among mutually consenting parties. 2325 - Group Prime/Irreducible Polynomial 2327 The prime number of a MODP Diffie-Hellman group or the irreducible 2328 polynomial of an elliptic curve when specifying a private Diffie- 2329 Hellman group. 2331 - Generator One, Generator Two 2333 The X- and Y-coordinate of a point on an elliptic curve. When the 2334 Y-coordinate (generator two) is not given it can be computed with 2335 the X-coordinate and the definition of the curve. 2337 - Curve A, Curve B 2339 Coefficients from the definition of an elliptic curve: 2341 y^2 + xy = x^3 + (curve A)x^2 + (curve B) 2343 - Key Length 2345 When using an Encryption Algorithm that has a variable length key, 2346 this attribute specifies the key length in bits. (MUST use network 2347 byte order). This attribute MUST NOT be used when the specified 2348 Encryption Algorithm uses a fixed length key. 2350 - Field Size 2352 The field size, in bits, of a Diffie-Hellman group. 2354 - Group Order 2356 The group order of an elliptic curve group. Note the length of 2357 this attribute depends on the field size. 2359 - Block Size 2361 The number of bits per block of a cipher with a variable block 2362 length. 2364 3.3.6 Attribute Negotiation 2366 During security association negotiation Initiators present offers to 2367 Responders. Responders MUST select a single complete set of 2368 parameters from the offers (or reject all offers if none are 2369 acceptable). If there are multiple proposals, the Responder MUST 2370 choose a single proposal number and return all of the Proposal 2371 substructures with that Proposal number. If there are multiple 2372 Transforms with the same type the Responder MUST choose a single one. 2373 Any attributes of a selected transform MUST be returned unmodified. 2374 The Initiator of an exchange MUST check that the accepted offer is 2375 consistent with one of its proposals, and if not that response MUST 2376 be rejected. 2378 Negotiating Diffie-Hellman groups presents some special challenges. 2379 Diffie-Hellman groups are specified either using a defined group 2380 description (see Appendix B) or by defining all attributes of a group 2381 in an IKE policy offer. Group attributes, such as group type or prime 2382 number MUST NOT be offered in conjunction with a previously defined 2383 group. SA offers include proposed attributes and a Diffie-Hellman 2384 public number (KE) in the same message. If the Initiator offers to 2385 use one of several Diffie-Hellman groups, it SHOULD pick the one the 2386 Responder is most likely to accept and include a KE corresponding to 2387 that group. If the guess turns out to be wrong, the Responder will 2388 indicate the correct group in the response and the Initiator SHOULD 2389 pick an element of that group for its KE value in the third message. 2390 If the Initiator guesses wrong in a CREATE_CHILD_SA negotiation, no 2391 SA is created and the Initiator SHOULD retry with the correct group. 2393 Implementation Note: 2395 Certain negotiable attributes can have ranges or could have 2396 multiple acceptable values. These are the Diffie-Hellman group and 2397 the key length of a variable key length symmetric cipher. To 2398 further interoperability and to support upgrading endpoints 2399 independently, implementers of this protocol SHOULD accept values 2400 which they deem to supply greater security. For instance if a peer 2401 is configured to accept a variable lengthed cipher with a key 2402 length of X bits and is offered that cipher with a larger key 2403 length an implementation SHOULD accept the offer. 2405 Support of this capability allows an implementation to express a 2406 concept of "at least" a certain level of security-- "a key length of 2407 _at least_ X bits for cipher foo". 2409 3.4 Key Exchange Payload 2411 The Key Exchange Payload, denoted KE in this memo, is used to 2412 exchange Diffie-Hellman public numbers as part of a Diffie-Hellman 2413 key exchange. The Key Exchange Payload consists of the IKE generic 2414 header followed by the Diffie-Hellman public value itself. 2416 1 2 3 2417 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 2418 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2419 ! Next Payload !C! RESERVED ! Payload Length ! 2420 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2421 ! DH Group # ! RESERVED (MBZ) ! 2422 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2423 ! ! 2424 ~ Key Exchange Data ~ 2425 ! ! 2426 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2428 Figure 10: Key Exchange Payload Format 2430 A key exchange payload is constructed by copying ones Diffie-Hellman 2431 public value into the "Key Exchange Data" portion of the payload. 2432 The length of the Diffie-Hellman public value MUST be equal to the 2433 length of the prime modulus over which the exponentiation was 2434 performed, prepending zero bits to the value if necessary. 2436 The DH Group # identifies the Diffie-Hellman group in which the Key 2437 Exchange Data was computed. If the selected proposal uses a 2438 different Diffie-Hellman group, the message MUST be rejected with a 2439 Notify payload of type INVALID_KE_PAYLOAD. 2441 The payload type for the Key Exchange payload is four (4). 2443 3.5 Identification Payload 2445 The Identification Payload, denoted ID in this memo, allows peers to 2446 assert an identify to one another. The ID Payload names the identity 2447 to be authenticated with the AUTH payload. 2449 NOTE: In IKEv1, two ID payloads were used in each direction to hold 2450 Traffic Selector information for data passing over the SA. In IKEv2, 2451 this information is carried in Traffic Selector (TS) payloads (see 2452 section 3.13). 2454 The Identification Payload consists of the IKE generic header 2455 followed by identification fields as follows: 2457 1 2 3 2458 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 2459 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2460 ! Next Payload !C! RESERVED ! Payload Length ! 2461 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2462 ! ID Type ! RESERVED | 2463 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2464 ! ! 2465 ~ Identification Data ~ 2466 ! ! 2467 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2469 Figure 11: Identification Payload Format 2471 o ID Type (1 octet) - Specifies the type of Identification being 2472 used. 2474 o RESERVED - MUST be sent as zero; MUST be ignored. 2476 o Identification Data (variable length) - Value, as indicated by 2477 the Identification Type. The length of the Identification Data 2478 is computed from the size in the ID payload header. 2480 The payload type for the Identification Payload is five (5). 2482 The following table lists the assigned values for the Identification 2483 Type field, followed by a description of the Identification Data 2484 which follows: 2486 ID Type Value 2487 ------- ----- 2488 RESERVED 0 2490 ID_IPV4_ADDR 1 2491 A single four (4) octet IPv4 address. 2493 ID_FQDN 2 2495 A fully-qualified domain name string. An example of a 2496 ID_FQDN is, "lounge.org". The string MUST not contain any 2497 terminators (e.g. NULL, CR, etc.). 2499 ID_RFC822_ADDR 3 2501 A fully-qualified RFC822 email address string, An example of 2502 a ID_RFC822_ADDR is, "lizard@lounge.org". The string MUST 2503 not contain any terminators. 2505 ID_IPV6_ADDR 5 2507 A single sixteen (16) octet IPv6 address. 2509 ID_DER_ASN1_DN 9 2511 The binary DER encoding of an ASN.1 X.500 Distinguished Name 2512 [X.501]. 2514 ID_DER_ASN1_GN 10 2516 The binary DER encoding of an ASN.1 X.500 GeneralName 2517 [X.509]. 2519 ID_KEY_ID 11 2521 An opaque octet stream which may be used to pass an account 2522 name or to pass vendor-specific information necessary to do 2523 certain proprietary forms of identification. 2525 Two implementations will interoperate only if each can generate a 2526 form of ID acceptable to the other. To assure maximum 2527 interoperability, implementations MUST be configurable to send at 2528 least one of ID_IPV4_ADDR, ID_FQDN, ID_RFC822_ADDR, or ID_KEY_ID, and 2529 MUST be configurable to accept all of these forms. Implementations 2530 SHOULD be capable of generating and accepting all of these forms. 2532 3.6 Certificate Payload 2534 The Certificate Payload, denoted CERT in this memo, provides a means 2535 to transport certificates or other authentication related information 2536 via IKE. Certificate payloads SHOULD be included in an exchange if 2537 certificates are available to the sender unless the peer has 2538 indicated an ability to retrieve this information from elsewhere. 2539 Note that the term "Certificate Payload" is somewhat misleading, 2540 because not all authentication mechanisms use certificates and data 2541 other than certificates may be passed in this payload. 2543 The Certificate Payload is defined as follows: 2545 1 2 3 2546 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 2547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2548 ! Next Payload !C! RESERVED ! Payload Length ! 2549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2550 ! Cert Encoding ! ! 2551 +-+-+-+-+-+-+-+-+ ! 2552 ~ Certificate Data ~ 2553 ! ! 2554 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2556 Figure 12: Certificate Payload Format 2558 o Certificate Encoding (1 octet) - This field indicates the type 2559 of certificate or certificate-related information contained 2560 in the Certificate Data field. 2562 Certificate Encoding Value 2563 -------------------- ----- 2564 RESERVED 0 2565 PKCS #7 wrapped X.509 certificate 1 2566 PGP Certificate 2 2567 DNS Signed Key 3 2568 X.509 Certificate - Signature 4 2569 Kerberos Token 6 2570 Certificate Revocation List (CRL) 7 2571 Authority Revocation List (ARL) 8 2572 SPKI Certificate 9 2573 X.509 Certificate - Attribute 10 2574 Raw RSA Key 11 2575 Hash and URL of PKIX certificate 12 2576 Hash and URL of PKIX bundle 13 2577 RESERVED 14 - 200 2578 PRIVATE USE 201 - 255 2580 o Certificate Data (variable length) - Actual encoding of 2581 certificate data. The type of certificate is indicated 2582 by the Certificate Encoding field. 2584 The payload type for the Certificate Payload is six (6). 2586 Specific syntax is for some of the certificate type codes above is 2587 not defined in this document. The types whose syntax is defined in 2588 this document are: 2590 X.509 Certificate - Signature (4) contains a BER encoded X.509 2591 certificate. 2593 Certificate Revocation List (7) contains a BER encoded X.509 2594 certificate revocation list. 2596 Raw RSA Key (11) contains a PKCS #1 encoded RSA key. 2598 Hash and URL of PKIX certificate (12) contains a 20 octet SHA-1 2599 hash of a PKIX certificate followed by a variable length URL that 2600 resolves to the BER encoded certificate itself. 2602 Hash and URL of PKIX bundle (13) contains a 20 octet SHA-1 hash of 2603 a PKIX certificate bundle followed by a variable length URL the 2604 resolves to the BER encoded certificate bundle itself. The bundle 2605 is a BER encoded SEQUENCE of certificates and CRLs. 2607 Implementations MUST be capable of being configured to send and 2608 accept up to four X.509 certificates in support of authentication. 2609 Implementations SHOULD be capable of being configured to send and 2610 accept Raw RSA keys and the two Hash and URL formats. If multiple 2611 certificates are sent, the first certificate MUST contain the public 2612 key used to sign the AUTH payload. 2614 3.7 Certificate Request Payload 2616 The Certificate Request Payload, denoted CERTREQ in this memo, 2617 provides a means to request preferred certificates via IKE and can 2618 appear in the second and/or third message of the initial exchanges. 2619 Certificate Request payloads SHOULD be included in an exchange 2620 whenever the peer may have multiple certificates, some of which might 2621 be trusted while others are not or when multiple formats might be 2622 acceptable. If multiple root CAs are trusted, then multiple 2623 Certificate Request payloads SHOULD be transmitted. 2625 Empty (zero length) CA names MUST NOT be generated and SHOULD be 2626 ignored. 2628 The Certificate Request Payload is defined as follows: 2630 1 2 3 2631 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 2632 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2633 ! Next Payload !C! RESERVED ! Payload Length ! 2634 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2635 ! Cert Encoding ! ! 2636 +-+-+-+-+-+-+-+-+ ! 2637 ~ Certification Authority ~ 2638 ! ! 2639 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2641 Figure 13: Certificate Request Payload Format 2643 o Certificate Encoding (1 octet) - Contains an encoding of the type 2644 or format of certificate requested. Values are listed in section 2645 3.6. 2647 o Certification Authority (variable length) - Contains an encoding 2648 of an acceptable certification authority for the type of 2649 certificate requested. 2651 The payload type for the Certificate Request Payload is seven (7). 2653 The Certificate Encoding field has the same values as those defined 2654 in section 3.6. The value field contains an indicator of trusted 2655 authorities for this certificate type. For certificate encoding four 2656 (4) (X.509 signing certificate), the CA value is a concatenated list 2657 of SHA-1 hashes of the public keys of trusted root CAs. 2659 Note that the term "Certificate Request" is somewhat misleading, in 2660 that values other than certificates are defined in a "Certificate" 2661 payload and requests for those values can be present in a Certificate 2662 Request Payload. 2664 The Certificate Request Payload is processed by inspecting the "Cert 2665 Encoding" field to determine whether the processor has any 2666 certificates of this type. If so the "Certification Authority" field 2667 is inspected to determine if the processor has any certificates which 2668 can be validated up to the specified certification authority. This 2669 can be a chain of certificates. If a certificate exists which 2670 satisfies the criteria specified in the Certificate Request Payload 2671 it MUST be sent back to the certificate requestor; if a certificate 2672 chain exists which goes back to the certification authority specified 2673 in the request the entire chain SHOULD be sent back to the 2674 certificate requestor. If no certificates exist then no further 2675 processing is performed-- this is not an error condition of the 2676 protocol. There may be cases where there is a preferred CA, but an 2677 alternate might be acceptable (perhaps after prompting a human 2678 operator). 2680 3.8 Authentication Payload 2682 The Authentication Payload, denoted AUTH in this memo, contains data 2683 used for authentication purposes. The syntax of the Authentication 2684 data varies according the the Auth Method as specified below. 2686 The Authentication Payload is defined as follows: 2688 1 2 3 2689 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 2690 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2691 ! Next Payload !C! RESERVED ! Payload Length ! 2692 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2693 ! Auth Method ! RESERVED ! 2694 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2695 ! ! 2696 ~ Authentication Data ~ 2697 ! ! 2698 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2700 Figure 14: Authentication Payload Format 2702 o Auth Method (1 octet) - Specifies the method of authentication 2703 used. Values defined are: 2705 RSA Digital Signature (1) - Computed as specified in section 2706 2.15 using an RSA private key over a PKCS#1 padded hash. 2708 Shared Key Message Integrity Code (2) - Computed as specified in 2709 section 2.15 using the shared key associated with the identity 2710 in the ID payload and the negotiated prf function 2712 DSS Digital Signature (3) - Computed as specified in section 2713 2.15 using a DSS private key over a SHA-1 hash. 2715 The values 0 and 4-200 are reserved to IANA. The values 201-255 2716 are available for private use. 2718 o Authentication Data (variable length) - see section 2.15. 2720 The payload type for the Authentication Payload is nine (9). 2722 3.9 Nonce Payload 2724 The Nonce Payload, denoted Ni and Nr in this memo for the Initiator's 2725 and Responder's nonce respectively, contains random data used to 2726 guarantee liveness during an exchange and protect against replay 2727 attacks. 2729 The Nonce Payload is defined as follows: 2731 1 2 3 2732 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 2733 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2734 ! Next Payload !C! RESERVED ! Payload Length ! 2735 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2736 ! ! 2737 ~ Nonce Data ~ 2738 ! ! 2739 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2741 Figure 15: Nonce Payload Format 2743 o Nonce Data (variable length) - Contains the random data generated 2744 by the transmitting entity. 2746 The payload type for the Nonce Payload is ten (10). 2748 The size of a Nonce MUST be between 8 and 256 octets inclusive. Nonce 2749 values MUST NOT be reused. 2751 3.10 Notify Payload 2753 The Notify Payload, denoted N in this document, is used to transmit 2754 informational data, such as error conditions and state transitions, 2755 to an IKE peer. A Notify Payload may appear in a response message 2756 (usually specifying why a request was rejected), in an INFORMATIONAL 2757 Exchange (to report an error not in an IKE request), or in any other 2758 message to indicate sender capabilities or to modify the meaning of 2759 the request. 2761 The Notify Payload is defined as follows: 2763 1 2 3 2764 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 2765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2766 ! Next Payload !C! RESERVED ! Payload Length ! 2767 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2768 ! Protocol_ID ! SPI Size ! Notify Message Type ! 2769 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2770 ! ! 2771 ~ Security Parameter Index (SPI) ~ 2772 ! ! 2773 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2774 ! ! 2775 ~ Notification Data ~ 2776 ! ! 2777 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2779 Figure 16: Notification Payload Format 2781 o Protocol_Id (1 octet) - Specifies the protocol about which 2782 this notification is being sent. For IKE_SA notifications, 2783 this field MUST be zero (0). For notifications 2784 concerning IPsec SAs this field will contain either (1) 2785 to indicate ESP or (2) to indicate AH. For notifications 2786 for which no protocol ID is relevant, this field MUST be 2787 sent as zero and MUST be ignored. 2789 o SPI Size (1 octet) - Length in octets of the SPI as defined by 2790 the Protocol_Id or zero if no SPI is applicable. For a 2791 notification concerning the IKE_SA, the SPI Size MUST be zero. 2793 o Notify Message Type (2 octets) - Specifies the type of 2794 notification message. 2796 o SPI (variable length) - Security Parameter Index. 2798 o Notification Data (variable length) - Informational or error data 2799 transmitted in addition to the Notify Message Type. Values for 2800 this field are message specific, see below. 2802 The payload type for the Notification Payload is eleven (11). 2804 3.10.1 Notify Message Types 2806 Notification information can be error messages specifying why an SA 2807 could not be established. It can also be status data that a process 2808 managing an SA database wishes to communicate with a peer process. 2810 The table below lists the Notification messages and their 2811 corresponding values. The number of different error statuses was 2812 greatly reduced from IKE V1 both for simplication and to avoid giving 2813 configuration information to probers. 2815 Types in the range 0 - 16383 are intended for reporting errors. An 2816 implementation receiving a Notify payload with one of these types 2817 that it does not recognise in a response MUST assume that the 2818 corresponding request has failed entirely. Unrecognised error types 2819 in a request and status types in a request or response MUST be 2820 ignored except that they SHOULD be logged. 2822 Notify payloads with status types MAY be added to any message and 2823 MUST be ignored if not recognised. They are intended to indicate 2824 capabilities, and as part of SA negotiation are used to negotiate 2825 non-cryptographic parameters. 2827 NOTIFY MESSAGES - ERROR TYPES Value 2828 ----------------------------- ----- 2829 UNSUPPORTED_CRITICAL_PAYLOAD 1 2831 Sent if the payload has the "critical" bit set and the 2832 payload type is not recognised. Notification Data contains 2833 the one octet payload type. 2835 INVALID_IKE_SPI 4 2837 Indicates an IKE message was received with an unrecognized 2838 destination SPI. This usually indicates that the recipient 2839 has rebooted and forgotten the existence of an IKE_SA. 2841 INVALID_MAJOR_VERSION 5 2843 Indicates the recipient cannot handle the version of IKE 2844 specified in the header. The closest version number that the 2845 recipient can support will be in the reply header. 2847 INVALID_SYNTAX 7 2849 Indicates the IKE message was received was invalid because 2850 some type, length, or value was out of range or because the 2851 request was rejected for policy reasons. To avoid a denial 2852 of service attack using forged messages, this status may 2853 only be returned for and in an encrypted packet if the 2854 MESSAGE_ID and cryptographic checksum were valid. To avoid 2855 leaking information to someone probing a node, this status 2856 MUST be sent in response to any error not covered by one of 2857 the other status codes. To aid debugging, more detailed 2858 error information SHOULD be written to a console or log. 2860 INVALID_MESSAGE_ID 9 2862 Sent when an IKE MESSAGE_ID outside the supported window is 2863 received. This Notify MUST NOT be sent in a response; the 2864 invalid request MUST NOT be acknowledged. Instead, inform 2865 the other side by initiating an INFORMATIONAL exchange with 2866 Notification data containing the four octet invalid 2867 MESSAGE_ID. Sending this notification is optional, MUST be 2868 rate limited, and MUST NOT be sent unless an IKE_SA exists 2869 to the sending address and port. 2871 INVALID_SPI 11 2873 MAY be sent in an IKE INFORMATIONAL Exchange when a node 2874 receives an ESP or AH packet with an invalid SPI. The 2875 Notification Data contains the SPI of the invalid packet. 2876 This usually indicates a node has rebooted and forgotten an 2877 SA. If this Informational Message is sent outside the 2878 context of an IKE_SA, it should only be used by the 2879 recipient as a "hint" that something might be wrong (because 2880 it could easily be forged). 2882 NO_PROPOSAL_CHOSEN 14 2884 None of the proposed crypto suites was acceptable. 2886 AUTHENTICATION_FAILED 24 2888 Sent in the response to an IKE_AUTH message when for some 2889 reason the authentication failed. There is no associated 2890 data. 2892 SINGLE_PAIR_REQUIRED 34 2894 This error indicates that a CREATE_CHILD_SA request is 2895 unacceptable because the Responder is willing to accept 2896 traffic selectors specifying a single pair of addresses. 2897 The Initiator is expected to respond by requesting an SA for 2898 only the specific traffic he is trying to forward. 2900 NO_ADDITIONAL_SAS 35 2902 This error indicates that a CREATE_CHILD_SA request is 2903 unacceptable because the Responder is unwilling to accept 2904 any more CHILD_SAs on this IKE_SA. Some minimal 2905 implementations may only accept a single CHILD_SA setup in 2906 the context of an initial IKE exchange and reject any 2907 subsequent attempts to add more. 2909 INTERNAL_ADDRESS_FAILURE 36 2910 Indicates an error assigning an internal address (i.e., 2911 INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS) during the 2912 processing of a Configuration Payload by a Responder. If 2913 this error is generated within an IKE_AUTH exchange no 2914 CHILD_SA will be created. 2916 FAILED_CP_REQUIRED 37 2917 Sent by responder in the case where CP(CFG_REQUEST) was 2918 expected but not received, and so is a conflict with locally 2919 configured policy. There is no associated data. 2921 TS_UNACCEPTABLE 38 2922 Indicates that none of the addresses/protocols/ports in the 2923 supplied traffic selectors is acceptable. 2925 RESERVED TO IANA - Errors 39 - 8191 2927 Private Use - Errors 8192 - 16383 2929 NOTIFY MESSAGES - STATUS TYPES Value 2930 ------------------------------ ----- 2932 RESERVED TO IANA - STATUS 16384 - 24577 2934 INITIAL_CONTACT 24578 2936 This notification asserts that this IKE_SA is the only 2937 IKE_SA currently active between the authenticated 2938 identities. It MAY be sent when an IKE_SA is established 2939 after a crash, and the recipient MAY use this information to 2940 delete any other IKE_SAs it has to the same authenticated 2941 identity without waiting for a timeout. This notification 2942 MUST NOT be sent by an entity that may be replicated (e.g. a 2943 roaming user's credentials where the user is allowed to 2944 connect to the corporate firewall from two remote systems at 2945 the same time). 2947 SET_WINDOW_SIZE 24579 2949 This notification asserts that the sending endpoint is 2950 capable of keeping state for multiple outstanding exchanges, 2951 permitting the recipient to send multiple requests before 2952 getting a response to the first. The data associated with a 2953 SET_WINDOW_SIZE notification MUST be 4 octets long and 2954 contain the big endian represention of the number of 2955 messages the sender promises to keep. Window size is always 2956 one until the initial exchanges complete. 2958 ADDITIONAL_TS_POSSIBLE 24580 2960 This notification asserts that the sending endpoint narrowed 2961 the proposed traffic selectors but that other traffic 2962 selectors would also have been acceptable, though only in a 2963 separate SA. There is no data associated with this notify 2964 type. It may only be sent as an additional payload in a 2965 message including accepted TSs. 2967 IPCOMP_SUPPORTED 24581 2969 This notification may only be included in a message 2970 containing an SA payload negotiating a CHILD_SA and 2971 indicates a willingness by its sender to use IPcomp on this 2972 SA. The data associated with this notification includes a 2973 two octet IPcomp CPI followed by a one octet transform ID 2974 optionally followed by attributes whose length and format is 2975 defined by that transform ID. A message proposing an SA may 2976 contain multiple IPCOMP_SUPPORTED notifications to indicate 2977 multiple supported algorithms. A message accepting an SA may 2978 contain at most one. 2980 The transform IDs currently defined are: 2982 NAME NUMBER DEFINED IN 2983 ----------- ------ ----------- 2984 RESERVED 0 2985 IPCOMP_OUI 1 2986 IPCOMP_DEFLATE 2 RFC 2394 2987 IPCOMP_LZS 3 RFC 2395 2989 values 4-240 are reserved to IANA. Values 241-255 are 2990 for private use among mutually consenting parties. 2992 NAT_DETECTION_SOURCE_IP 24582 2994 This notification is used to by its recipient to determine 2995 whether the source is behind a NAT box. The data associated 2996 with this notification is a SHA-1 digest of the SPIs, IP 2997 address and port on which this packet was sent. There MAY 2998 be multiple notify payloads of this type in a message if the 2999 sender does not know which of several network attachments 3000 will be used to send the packet. The recipient of this 3001 notification MAY compare the supplied value to a hash of the 3002 source IP address and port and if they don't match it MAY 3003 invoke NAT specific handling (like using UDP encapsulation 3004 of ESP packets and subsequent IKE packets). Alternately, it 3005 MAY reject the connection attempt if NAT traversal is not 3006 supported. 3008 NAT_DETECTION_DESTINATION_IP 24583 3010 This notification is used to by its recipient to determine 3011 whether it is behind a NAT box. The data associated with 3012 this notification is a SHA-1 digest of the SPIs, IP address 3013 and port to which this packet was sent. The recipient of 3014 this notification MAY compare the supplied value to a hash 3015 of the destination IP address and port and if they don't 3016 match it MAY invoke NAT specific handling (like using UDP 3017 encapsulation of ESP packets and subsequent IKE packets). 3018 Alternately, it MAY reject the connection attempt if NAT 3019 traversal is not supported. 3021 COOKIE 24584 3023 This notification MAY be included in an IKE_SA_INIT request 3024 or response. In the response, it indicates that the request 3025 should be retried with the COOKIE included in the request. 3026 That data associated with this notification MUST be between 3027 1 and 64 octets in length (inclusive). 3029 USE_TRANSPORT_MODE 24585 3031 This notification MAY be included in a request message that 3032 also includes an SA requesting a CHILD_SA. It requests that 3033 the CHILD_SA use transport mode rather than tunnel mode for 3034 the SA created. If the request is accepted, the response 3035 MUST also include a notification of type USE_TRANSPORT_MODE. 3036 If the responder declines the request, the CHILD_SA can 3037 still be established, but will use tunnel mode. If this is 3038 unacceptable to the initiator, the initiator MUST delete the 3039 SA. Note: except when using this option to negotiate 3040 transport mode, all CHILD_SAs will use tunnel mode. 3042 HTTP_CERT_LOOKUP_SUPPORTED 24586 3044 This notification MAY be included any message that can 3045 include a CERTREQ payload and indicates that the sender is 3046 capable of looking up certificates based on an HTTP-based 3047 URL (and hence presumeably would prefer to receive 3048 certificate specifications in that format). 3050 RESERVED TO IANA - STATUS 24587 - 40959 3052 Private Use - STATUS 40960 - 65535 3054 3.11 Delete Payload 3056 The Delete Payload, denoted D in this memo, contains a protocol 3057 specific security association identifier that the sender has removed 3058 from its security association database and is, therefore, no longer 3059 valid. Figure 17 shows the format of the Delete Payload. It is 3060 possible to send multiple SPIs in a Delete payload, however, each SPI 3061 MUST be for the same protocol. Mixing of Protocol Identifiers MUST 3062 NOT be performed in a the Delete payload. It is permitted, however, 3063 to include multiple Delete payloads in a single INFORMATIONAL 3064 Exchange where each Delete payload lists SPIs for a different 3065 protocol. 3067 Deletion of the IKE_SA is indicated by a Protocol_Id of 0 (IKE) but 3068 no SPIs. Deletion of a CHILD_SA, such as ESP or AH, will contain the 3069 Protocol_Id of that protocol (1 for ESP, 2 for AH) and the SPI is the 3070 SPI the sending endpoint would expect in inbound ESP or AH packets. 3072 The Delete Payload is defined as follows: 3074 1 2 3 3075 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 3076 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3077 ! Next Payload !C! RESERVED ! Payload Length ! 3078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3079 ! Protocol-Id ! SPI Size ! # of SPIs ! 3080 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3081 ! ! 3082 ~ Security Parameter Index(es) (SPI) ~ 3083 ! ! 3084 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3086 Figure 17: Delete Payload Format 3088 o Protocol_Id (1 octet) - Must be zero for an IKE_SA, 1 for 3089 ESP, or 2 for AH. 3091 o SPI Size (1 octet) - Length in octets of the SPI as defined by 3092 the Protocol_Id. Zero for IKE (SPI is in message header) 3093 or four for AH and ESP. 3095 o # of SPIs (2 octets) - The number of SPIs contained in the Delete 3096 payload. The size of each SPI is defined by the SPI Size field. 3098 o Security Parameter Index(es) (variable length) - Identifies the 3099 specific security association(s) to delete. The length of this 3100 field is determined by the SPI Size and # of SPIs fields. 3102 The payload type for the Delete Payload is twelve (12). 3104 3.12 Vendor ID Payload 3106 The Vendor ID Payload contains a vendor defined constant. The 3107 constant is used by vendors to identify and recognize remote 3108 instances of their implementations. This mechanism allows a vendor 3109 to experiment with new features while maintaining backwards 3110 compatibility. 3112 A Vendor ID payload MAY announce that the sender is capable to 3113 accepting certain extensions to the protocol, or it MAY simply 3114 identify the implementation as an aid in debugging. If parameter 3115 values "reserved for use by consenting parties" are used, they must 3116 be preceded by a Vendor ID payload that disambiguates them. A Vendor 3117 ID payload MUST NOT change the interpretation of any information 3118 defined in this specification (i.e. it MUST be non-critical). 3119 Multiple Vendor ID payloads MAY be sent. An implementation is NOT 3120 REQUIRED to send any Vendor ID payload at all. 3122 A Vendor ID payload may be sent as part of any message. Reception of 3123 a familiar Vendor ID payload allows an implementation to make use of 3124 Private USE numbers described throughout this memo-- private 3125 payloads, private exchanges, private notifications, etc. Unfamiliar 3126 Vendor IDs MUST be ignored. 3128 Writers of Internet-Drafts who wish to extend this protocol MUST 3129 define a Vendor ID payload to announce the ability to implement the 3130 extension in the Internet-Draft. It is expected that Internet-Drafts 3131 which gain acceptance and are standardized will be given "magic 3132 numbers" out of the Future Use range by IANA and the requirement to 3133 use a Vendor ID will go away. 3135 The Vendor ID Payload fields are defined as follows: 3137 1 2 3 3138 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 3139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3140 ! Next Payload !C! RESERVED ! Payload Length ! 3141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3142 ! ! 3143 ~ Vendor ID (VID) ~ 3144 ! ! 3145 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3147 Figure 18: Vendor ID Payload Format 3149 o Vendor ID (variable length) - It is the responsibility of 3150 the person choosing the Vendor ID to assure its uniqueness 3151 in spite of the absence of any central registry for IDs. 3152 Good practice is to include a company name, a person name 3153 or some such. If you want to show off, you might include 3154 the latitude and longitude and time where you were when 3155 you chose the ID and some random input. A message digest 3156 of a long unique string is preferable to the long unique 3157 string itself. 3159 The payload type for the Vendor ID Payload is thirteen (13). 3161 3.13 Traffic Selector Payload 3163 The Traffic Selector Payload, denoted TS in this memo, allows peers 3164 to identify packet flows for processing by IPsec security services. 3165 The Traffic Selector Payload consists of the IKE generic header 3166 followed by individual traffic selectors as follows: 3168 1 2 3 3169 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 3170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3171 ! Next Payload !C! RESERVED ! Payload Length ! 3172 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3173 ! Number of TSs ! RESERVED ! 3174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3175 ! ! 3176 ~ ~ 3177 ! ! 3178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3180 Figure 19: Traffic Selectors Payload Format 3182 o Number of TSs (1 octet) - Number of traffic selectors 3183 being provided. 3185 o RESERVED - This field MUST be sent as zero and MUST be ignored. 3187 o Traffic Selectors (variable length) - one or more individual 3188 traffic selectors. 3190 The length of the Traffic Selector payload includes the TS header and 3191 all the traffic selectors. 3193 The payload type for the Traffic Selector payload is fourteen (14). 3195 3.13.1 Traffic Selector 3197 1 2 3 3198 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 3199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3200 ! TS Type ! Protocol_ID | Selector Length | 3201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3202 | Start_Port | End_Port | 3203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3204 ! ! 3205 ~ Starting Address ~ 3206 ! ! 3207 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3208 ! ! 3209 ~ Ending Address ~ 3210 ! ! 3211 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3213 Figure 20: Traffic Selector 3215 o TS Type (one octet) - Specifies the type of traffic selector. 3217 o Protocol ID (1 octet) - Value specifying an associated IP 3218 protocol ID (e.g. UDP/TCP). A value of zero means that the 3219 Protocol ID is not relevant to this traffic selector-- 3220 the SA can carry all protocols. 3222 o Selector Length - Specifies the length of this Traffic 3223 Selector Substructure including the header. 3225 o Start_Port (2 octets) - Value specifying the smallest port 3226 number allowed by this Traffic Selector. For protocols for 3227 which port is undefined, or if all ports are allowed by 3228 this Traffic Selector, this field MUST be zero. 3230 o End_Port (2 octets) - Value specifying the largest port 3231 number allowed by this Traffic Selector. For protocols for 3232 which port is undefined, or it all ports are allowed by 3233 this Traffic Selector, this field MUST be 65535. 3235 o Starting Address - The smallest address included in this 3236 Traffic Selector (length determined by TS type). 3238 o Ending Address - The largest address included in this 3239 Traffic Selector (length determined by TS type). 3241 The following table lists the assigned values for the Traffic 3242 Selector Type field and the corresponding Address Selector Data. 3244 TS Type Value 3245 ------- ----- 3246 RESERVED 0 3248 TS_IPV4_ADDR_RANGE 7 3250 A range of IPv4 addresses, represented by two four (4) octet 3251 values. The first value is the beginning IPv4 address 3252 (inclusive) and the second value is the ending IPv4 address 3253 (inclusive). All addresses falling between the two specified 3254 addresses are considered to be within the list. 3256 TS_IPV6_ADDR_RANGE 8 3258 A range of IPv6 addresses, represented by two sixteen (16) 3259 octet values. The first value is the beginning IPv6 address 3260 (inclusive) and the second value is the ending IPv6 address 3261 (inclusive). All addresses falling between the two specified 3262 addresses are considered to be within the list. 3264 3.14 Encrypted Payload 3266 The Encrypted Payload, denoted SK{...} in this memo, contains other 3267 payloads in encrypted form. The Encrpted Payload, if present in a 3268 message, must be the last payload in the message. Often, it is the 3269 only payload in the message. 3271 The algorithms for encryption and integrity protection are negotiated 3272 during IKE_SA setup, and the keys are computed as specified in 3273 sections 2.14 and 2.18. 3275 The encryption and integrity protection algorithms are modelled after 3276 the ESP algorithms described in RFCs 2104, 2406, 2451. This document 3277 completely specifies the cryptographic processing of IKE data, but 3278 those documents should be consulted for design rationale. We assume a 3279 block cipher with a fixed block size and an integrity check algorithm 3280 that computes a fixed length checksum over a variable size message. 3282 The Payload Type for an Encrypted payload is fifteen (15). The 3283 Encrypted Payload consists of the IKE generic header followed by 3284 individual fields as follows: 3286 1 2 3 3287 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 3288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3289 ! Next Payload !C! RESERVED ! Payload Length ! 3290 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3291 ! Initialization Vector ! 3292 ! (length is block size for encryption algorithm) ! 3293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3294 ! Encrypted IKE Payloads ! 3295 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3296 ! ! Padding (0-255 octets) ! 3297 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ 3298 ! ! Pad Length ! 3299 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3300 ~ Integrity Checksum Data ~ 3301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3303 Figure 21: Encrypted Payload Format 3305 o Next Payload - The payload type of the first embedded payload. 3306 Since the Encrypted payload must be last in a message, there 3307 is no need to specify a payload type for a payload beyond it. 3309 o Payload Length - Includes the lengths of the IV, Padding, and 3310 Authentication data. 3312 o Initialization Vector - A randomly chosen value whose length 3313 is equal to the block length of the underlying encryption 3314 algorithm. Recipients MUST accept any value. Senders SHOULD 3315 either pick this value pseudo-randomly and independently for 3316 each message or use the final ciphertext block of the previous 3317 message sent. Senders MUST NOT use the same value for each 3318 message, use a sequence of values with low hamming distance 3319 (e.g. a sequence number), or use ciphertext from a received 3320 message. 3322 o IKE Payloads are as specified earlier in this section. This 3323 field is encrypted with the negotiated cipher. 3325 o Padding may contain any value chosen by the sender, and must 3326 have a length that makes the combination of the Payloads, the 3327 Padding, and the Pad Length to be a multiple of the encryption 3328 block size. This field is encrypted with the negotiated 3329 cipher. 3331 o Pad Length is the length of the Padding field. The sender 3332 SHOULD set the Pad Length to the minimum value that makes 3333 the combination of the Payloads, the Padding, and the Pad 3334 Length a multiple of the block size, but the recipient MUST 3335 accept any length that results in proper alignment. This 3336 field is encrypted with the negotiated cipher. 3338 o Integrity Checksum Data is the cryptographic checksum of 3339 the entire message starting with the Fixed IKE Header 3340 through the Pad Length. The checksum MUST be computed over 3341 the encrypted message. 3343 3.15 Configuration Payload 3345 The Configuration payload, denoted CP in this document, is used to 3346 exchange configuration information between IKE peers. Currently, the 3347 only defined uses for this exchange is for an IRAC to request an 3348 internal IP address from an IRAS or for either party to request 3349 version information from the other, but this payload is intended as a 3350 likely place for future extensions. 3352 Configuration payloads are of type CFG_REQUEST/CFG_REPLY or 3353 CFG_SET/CFG_ACK (see CFG Type in the payload description below). 3354 CFG_REQUEST and CFG_SET payloads may optionally be added to any IKE 3355 request. The IKE response MUST include either a corresponding 3356 CFG_REPLY or CFG_ACK or a Notify payload with an error code 3357 indicating why the request could not be honored. An exception is that 3358 a minimal implementation MAY ignore all CFG_REQUEST and CFG_SET 3359 payloads, so a response message without a corresponding CFG_REPLY or 3360 CFG_ACK MUST be accepted as an indication that the request was not 3361 supported. 3363 "CFG_REQUEST/CFG_REPLY" allows an IKE endpoint to request information 3364 from its peer. If an attribute in the CFG_REQUEST Configuration 3365 Payload is not zero length it is taken as a suggestion for that 3366 attribute. The CFG_REPLY Configuration Payload MAY return that 3367 value, or a new one. It MAY also add new attributes and not include 3368 some requested ones. Requestors MUST ignore returned attributes that 3369 they do not recognise. 3371 Some attributes MAY be multi-valued, in which case multiple attribute 3372 values of the same type are sent and/or returned. Generally, all 3373 values of an attribute are returned when the attribute is requested. 3375 For some attributes (in this version of the specification only 3376 internal addresses), multiple requests indicates a request that 3377 multiple values be assigned. For these attributes, the number of 3378 values returned SHOULD NOT exceed the number requested. 3380 If the data type requested in a CFG_REQUEST is not recognised or not 3381 supported, the responder MUST NOT return an error code but rather 3382 MUST either send a CFG_REPLY which MAY be empty or a reply not 3383 containing a CFG_REPLY payload at all. Error returns are reserved for 3384 cases where the request is recognised but cannot be performed as 3385 requested or the request is badly formatted. 3387 "CFG_SET/CFG_ACK" allows an IKE endpoint to push configuration data 3388 to its peer. In this case the CFG_SET Configuration Payload contains 3389 attributes the initiator wants its peer to alter. The responder MUST 3390 return a Configuration Payload if it accepted any of the 3391 configuration data and it MUST contain the attributes that the 3392 responder accepted with zero length data. Those attributes that it 3393 did not accept MUST NOT be in the CFG_ACK Configuration Payload. If 3394 no attributes were accepted, the responder MUST return either an 3395 empty CFG_ACK payload or a response message without a CFG_ACK 3396 payload. There are currently no defined uses for the CFG_SET/CFG_ACK 3397 exchange, though they may be used in connection with extensions based 3398 on Vendor IDs. An minimal implementation of this specification MAY 3399 ignore CFG_SET payloads. 3401 Extensions via the CP payload SHOULD NOT be used for general purpose 3402 management. Its main intent is to provide a bootstrap mechanism to 3403 exchange information within IPSec from IRAS to IRAC. While it MAY be 3404 useful to use such a method to exchange information between some 3405 Security Gateways (SGW) or small networks, existing management 3406 protocols such as DHCP [DHCP], RADIUS [RADIUS], SNMP or LDAP [LDAP] 3407 should be preferred for enterprise management as well as subsequent 3408 information exchanges. 3410 The Configuration Payload is defined as follows: 3412 1 2 3 3413 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 3414 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3415 ! Next Payload !C! RESERVED ! Payload Length ! 3416 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3417 ! CFG Type ! RESERVED ! 3418 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3419 ! ! 3420 ~ Configuration Attributes ~ 3421 ! ! 3422 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3424 Figure 22: Configuration Payload Format 3426 The payload type for the Configuration Payload is 16. 3428 o CFG Type (1 octet) - The type of exchange represented by the 3429 Configuration Attributes. 3431 CFG Type Value 3432 =========== ===== 3433 RESERVED 0 3434 CFG_REQUEST 1 3435 CFG_REPLY 2 3436 CFG_SET 3 3437 CFG_ACK 4 3439 values 5-127 are reserved to IANA. Values 128-255 are for private 3440 use among mutually consenting parties. 3442 o RESERVED (3 octets) - MUST be sent as zero; MUST be ignored. 3444 o Configuration Attribute (variable length) - These are type length 3445 values specific to the Configuration Payload and are defined 3446 below. There may be zero or more Configuration Attributes in this 3447 payload. 3449 3.15.1 Configuration Attributes 3451 1 2 3 3452 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 3453 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3454 !R| Attribute Type ! Length | 3455 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3456 | | 3457 ~ Value ~ 3458 | | 3459 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3461 Figure 23: Configuration Attribute Format 3463 o Reserved (1 bit) - This bit MUST be set to zero and MUST be 3464 ignored. 3466 o Attribute Type (7 bits) - A unique identifier for each of the 3467 Configuration Attribute Types. 3469 o Length (2 octets) - Length in octets of Value. 3471 o Value (0 or more octets) - The variable length value of this 3472 Configuration Attribute. 3474 The following attribute types have been defined: 3476 Multi- 3477 Attribute Type Value Valued Length 3478 ======================= ===== ====== ================== 3479 RESERVED 0 3480 INTERNAL_IP4_ADDRESS 1 YES* 0 or 4 octets 3481 INTERNAL_IP4_NETMASK 2 NO 0 or 4 octets 3482 INTERNAL_IP4_DNS 3 YES 0 or 4 octets 3483 INTERNAL_IP4_NBNS 4 YES 0 or 4 octets 3484 INTERNAL_ADDRESS_EXPIRY 5 NO 0 or 4 octets 3485 INTERNAL_IP4_DHCP 6 YES 0 or 4 octets 3486 APPLICATION_VERSION 7 NO 0 or more 3487 INTERNAL_IP6_ADDRESS 8 YES* 0 or 16 octets 3488 INTERNAL_IP6_NETMASK 9 NO 0 or 16 octets 3489 INTERNAL_IP6_DNS 10 YES 0 or 16 octets 3490 INTERNAL_IP6_NBNS 11 YES 0 or 16 octets 3491 INTERNAL_IP6_DHCP 12 YES 0 or 16 octets 3492 INTERNAL_IP4_SUBNET 13 NO 0 or 8 octets 3493 SUPPORTED_ATTRIBUTES 14 NO Multiple of 2 3494 INTERNAL_IP6_SUBNET 15 NO 17 octets 3496 * These attributes may be multi-valued on return only if 3497 multiple values were requested. 3499 Types 16-16383 are reserved to IANA. Values 16384-32767 are for 3500 private use among mutually consenting parties. 3502 o INTERNAL_IP4_ADDRESS, INTERNAL_IP6_ADDRESS - An address on the 3503 internal network, sometimes called a red node address or 3504 private address and MAY be a private address on the Internet. 3505 Multiple internal addresses MAY be requested by requesting 3506 multiple internal address attributes. The responder MAY only 3507 send up to the number of addresses requested. 3509 The requested address is valid until the expiry time defined 3510 with the INTERNAL_ADDRESS EXPIRY attribute or there are no 3511 IKE_SAs between the peers. 3513 o INTERNAL_IP4_NETMASK, INTERNAL_IP6_NETMASK - The internal 3514 network's netmask. Only one netmask is allowed in the request 3515 and reply messages (e.g. 255.255.255.0) and it MUST be used 3516 only with an INTERNAL_ADDRESS attribute. 3518 o INTERNAL_IP4_DNS, INTERNAL_IP6_DNS - Specifies an address of a 3519 DNS server within the network. Multiple DNS servers MAY be 3520 requested. The responder MAY respond with zero or more DNS 3521 server attributes. 3523 o INTERNAL_IP4_NBNS, INTERNAL_IP6_NBNS - Specifies an address of 3524 a NetBios Name Server (WINS) within the network. Multiple NBNS 3525 servers MAY be requested. The responder MAY respond with zero 3526 or more NBNS server attributes. 3528 o INTERNAL_ADDRESS_EXPIRY - Specifies the number of seconds that 3529 the host can use the internal IP address. The host MUST renew 3530 the IP address before this expiry time. Only one of these 3531 attributes MAY be present in the reply. 3533 o INTERNAL_IP4_DHCP, INTERNAL_IP6_DHCP - Instructs the host to 3534 send any internal DHCP requests to the address contained within 3535 the attribute. Multiple DHCP servers MAY be requested. The 3536 responder MAY respond with zero or more DHCP server attributes. 3538 o APPLICATION_VERSION - The version or application information of 3539 the IPSec host. This is a string of printable ASCII characters 3540 that is NOT null terminated. 3542 o INTERNAL_IP4_SUBNET - The protected sub-networks that this 3543 edge-device protects. This attribute is made up of two fields; 3544 the first being an IP address and the second being a netmask. 3546 Multiple sub-networks MAY be requested. The responder MAY 3547 respond with zero or more sub-network attributes. 3549 o SUPPORTED_ATTRIBUTES - When used within a Request, this 3550 attribute must be zero length and specifies a query to the 3551 responder to reply back with all of the attributes that it 3552 supports. The response contains an attribute that contains a 3553 set of attribute identifiers each in 2 octets. The length 3554 divided by 2 (octets) would state the number of supported 3555 attributes contained in the response. 3557 o INTERNAL_IP6_SUBNET - The protected sub-networks that this 3558 edge-device protects. This attribute is made up of two fields; 3559 the first being a 16 octet IPv6 address the second being a one 3560 octet prefix-mask as defined in [ADDRIPV6]. Multiple 3561 sub-networks MAY be requested. The responder MAY respond with 3562 zero or more sub-network attributes. 3564 Note that no recommendations are made in this document how an 3565 implementation actually figures out what information to send in a 3566 reply. i.e. we do not recommend any specific method of an IRAS 3567 determining which DNS server should be returned to a requesting 3568 IRAC. 3570 3.16 Extended Authentication Protocol (EAP) Payload 3572 The Extended Authentication Protocol Payload, denoted EAP in this 3573 memo, allows IKE SAs to be authenticated using the protocol defined 3574 in RFC 2284 [EAP] and subsequent extensions to that protocol. The 3575 full set of acceptable values for the payload are defined elsewhere, 3576 but a short summary of RFC 2284 is included here to make this 3577 document stand alone in the common cases. 3579 1 2 3 3580 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 3581 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3582 ! Next Payload !C! RESERVED ! Payload Length ! 3583 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3584 ! ! 3585 ~ EAP Message ~ 3586 ! ! 3587 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3589 Figure 24: EAP Payload Format 3590 1 2 3 3591 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 3592 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3593 ! Code ! Identifier ! Length ! 3594 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3595 ! Type ! Type_Data... 3596 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 3598 Figure 25: EAP Message Format 3600 o Code (one octet) indicates whether this message is a 3601 Request (1), Response (2), Success (3), or Failure (4). 3603 o Identifier (one octet) is used in PPP to distinguish replayed 3604 messages from repeated ones. Since in IKE, EAP runs over a 3605 reliable protocol, it serves no function here. In a response 3606 message this octet MUST be set to match the identifier in the 3607 corresponding request. In other messages, this field MAY 3608 be set to any value. 3610 o Length (two octets) is the length of the EAP message and MUST 3611 be four less than the Payload Length of the encapsulating 3612 payload. 3614 o Type (one octet) is present only if the Code field is Request 3615 (1) or Response (2). For other types, the EAP message length 3616 MUST be four octets and the Type and Type_Data fields MUST NOT 3617 be present. In a Request (1) message, Type indicates the 3618 data being requested. In a Response (2) message, Type must 3619 either be NAC or match the type of the data requested. The 3620 following types are defined in RFC 2284: 3622 1 Identity 3623 2 Notification 3624 3 NAK (Response Only) 3625 4 MD5-Challenge 3626 5 One-Time Password (OTP) 3627 6 Generic Token Card 3629 o Type_Data (Variable Length) contains data depending on the Code 3630 and Type. In Requests other than MD5-Challenge, this field 3631 contains a prompt to be displayed to a human user. For NAK, it 3632 contains one octet suggesting the form of authentication the 3633 Initiator would prefer to use. For most other responses, it 3634 contains the authentication code typed by the human user. 3636 Note that since IKE passes an indication of initiator identity in 3637 message 3 of the protocol, EAP based prompts for Identity SHOULD NOT 3638 be used. 3640 3.17 Other Payload Types 3642 Payload type values 17-127 are reserved to IANA for future assignment 3643 in IKEv2 (see section 10). Payload type values 128-255 are for 3644 private use among mutually consenting parties. 3646 4 Conformance Requirements 3648 In order to assure that all implementations of IKEv2 can 3649 interoperate, there are MUST support requirements in addition to 3650 those listed elsewhere. Of course, IKEv2 is a security protocol, and 3651 one of its major functions is preventing the bad guys from 3652 interoperating with one's systems. So a particular implementation may 3653 be configured with any of a number of restrictions concerning 3654 algorithms and trusted authorities that will prevent universal 3655 interoperability. 3657 IKEv2 is designed to permit minimal implementations that can 3658 interoperate with all compliant implementations. There are a series 3659 of optional features that can easily be ignored by a particular 3660 implementation if it does not support that feature. Those features 3661 include: 3663 Ability to negotiate SAs through a NAT and tunnel the resulting ESP 3664 SA over UDP. 3666 Ability to request (and respond to a request for) a temporary IP 3667 address on the remote end of a tunnel. 3669 Ability to support various forms of legacy authentication. 3671 Ability to support window sizes greater than one. 3673 Ability to establish multiple ESP and/or AH SAs within a single IKE 3674 SA. 3676 Ability to rekey SAs. 3678 To assure interoperability, all implementations MUST be capable of 3679 parsing all payload types (if only to skip over them) and to ignore 3680 payload types that it does not support unless the critical bit is set 3681 in the payload header. If the critical bit is set in an unsupported 3682 payload header, all implementations MUST reject the messages 3683 containing those payloads. 3685 Every implementation MUST be capable of doing four message 3686 IKE_SA_INIT and IKE_AUTH exchanges establishing two SAs (one for IKE, 3687 one for ESP and/or AH). Implementations MAY be initiate-only or 3688 respond-only if appropriate for their platform. Every implementation 3689 MUST be capable of responding to an INFORMATIONAL exchange, but a 3690 minimal implementation MAY respond to any INFORMATIONAL message with 3691 an empty INFORMATIONAL reply. A minimal implementation MAY support 3692 the CREATE_CHILD_SA exchange only in so far as to recognise requests 3693 and reject them with a Notify payload of type NO_ADDITIONAL_SAS. A 3694 minimal implementation need not be able to initiate CREATE_CHILD_SA 3695 or INFORMATIONAL exchanges. When an SA expires (based on either 3696 lifetime or octets passed), and implementation MAY either try to 3697 renew it with a CREATE_CHILD_SA exchange or it MAY delete (close) the 3698 old SA and create a new one. If the responder rejects the 3699 CREATE_CHILD_SA request with a NO_ADDITIONAL_SAS notification, the 3700 implementation MUST be capable of instead closing the old SA and 3701 creating a new one. 3703 Implementations are not required to support requesting temporary IP 3704 addresses or responding to such requests. If an implementation does 3705 support issuing such requests, it MUST include a CP payload in 3706 message 3 containing at least a field of type INTERNAL_IP4_ADDRESS or 3707 INTERNAL_IP6_ADDRESS. All other fields are optional. If an 3708 implementation supports responding to such requests, it MUST parse 3709 the CP payload of type CFG_REQUEST in message 3 and recognise a field 3710 of type INTERNAL_IP4_ADDRESS or INTERNAL_IP6_ADDRESS. If it supports 3711 leasing an address of the appropriate type, it MUST return a CP 3712 payload of type CFG_REPLY containing an address of the requested 3713 type. The responder SHOULD include all of the other related 3714 attributes if it has them. 3716 A minimal responder implementation will ignore the contents of the CP 3717 payload except to determine that it includes an INTERNAL_IP4_ADDRESS 3718 attribute and will respond with the address and other related 3719 attributes regardless of whether the initiator requested them. 3721 A minimal initiator will generate a CP payload containing only an 3722 INTERNAL_IP4_ADDRESS attribute and will parse the response ignoring 3723 attributes it does not know how to use. The only attribute it MUST be 3724 able to process is INTERNAL_ADDRESS_EXPIRY, which it must use to 3725 bound the lifetime of the SA unless it successfully renews the lease 3726 before it expires. Minimal initiators need not be able to request 3727 lease renewals and minimal responders need not respond to them. 3729 For an implementation to be called conforming to this specification, 3730 it MUST be possible to configure it to accept the following: 3732 PKIX Certificates containing and signed by RSA keys of size 1024 or 3733 2048 bits, where the ID passed is any of ID_KEY_ID, ID_FQDN, 3734 ID_RFC822_ADDR, or ID_DER_ASN1_DN. 3736 Shared key authentication where the ID passes is any of ID_KEY_ID, 3737 ID_FQDN, or ID_RFC822_ADDR. 3739 Authentication where the responder authenticates using PKIX 3740 Certificates and the initiator authenticates using shared key 3741 authentication. 3743 5 Security Considerations 3745 Repeated re-keying using CREATE_CHILD_SA without PFS leave all SAs 3746 vulnerable to cryptanalysis of a single key or overrun of either 3747 endpoint. Implementers should take note of this fact and set a limit 3748 on CREATE_CHILD_SA exchanges between exponentiations. This memo does 3749 not prescribe such a limit. 3751 The strength of a key derived from a Diffie-Hellman exchange using 3752 any of the groups defined here depends on the inherent strength of 3753 the group, the size of the exponent used, and the entropy provided by 3754 the random number generator used. Due to these inputs it is difficult 3755 to determine the strength of a key for any of the defined groups. 3756 Diffie-Hellman group number two when used with a strong random number 3757 generator and an exponent no less than 200 bits is sufficient to use 3758 for 3DES. Groups three through five provide greater security. Group 3759 one is for historic purposes only and does not provide sufficient 3760 strength to the required cipher (although it is sufficient for use 3761 with DES, which is also for historic use only). Implementations 3762 should make note of these conservative estimates when establishing 3763 policy and negotiating security parameters. 3765 Note that these limitations are on the Diffie-Hellman groups 3766 themselves. There is nothing in IKE which prohibits using stronger 3767 groups nor is there anything which will dilute the strength obtained 3768 from stronger groups (limited by the strength of the other algorithms 3769 negotiated including the prf function). In fact, the extensible 3770 framework of IKE encourages the definition of more groups; use of 3771 elliptical curve groups may greatly increase strength using much 3772 smaller numbers. 3774 It is assumed that the Diffie-Hellman exponents in this exchange are 3775 erased from memory after use. In particular, these exponents MUST NOT 3776 be derived from long-lived secrets like the seed to a pseudo-random 3777 generator that is not erased after use. 3779 The security of this protocol is critically dependent on the 3780 randomness of the randomly chosen parameters. These should be 3781 generated by a strong random or properly seeded pseudo-random source 3782 (see [RFC1715]). 3784 6 IANA Considerations 3786 This document contains many "magic numbers" to be maintained by the 3787 IANA. This section explains the criteria to be used by the IANA to 3788 assign additional numbers in each of these lists. 3790 Cryptographic Algorithm types, codes, and attributes 3791 Error Codes 3792 Status Codes 3793 IPcomp Transform IDs 3794 Configuration request types 3795 Configuration attribute types 3796 Payload Types 3797 IKE Exchange Types 3799 Values of the Cryptographic Suite-ID define a set of cryptographic 3800 algorithms to be used in an IKE, ESP, or AH SA. Requests for 3801 assignment of new values must be accompanied by a reference to an RFC 3802 that describes how to use these algorithms. 3804 This memo defines four exchange types for use with IKEv2. Requests 3805 for assignment of new exchange types MUST be accompanied by an RFC 3806 which defines the following: 3808 - the purpose of and need for the new exchange. 3809 - the payloads (mandatory and optional) that accompany 3810 messages in the exchange. 3811 - when the exchange may take place. 3812 - requirements the new exchange has on existing 3813 exchanges which have assigned numbers. 3815 Payloads are defined in this memo to convey information between 3816 peers. New payloads may be required when defining a new 3817 authentication method or exchange. Requests for new payload types 3818 MUST be accompanied by an RFC which defines the physical layout of 3819 the payload and the fields it contains. All payloads MUST use the 3820 same generic header defined in Figure 5. 3822 7 Acknowledgements 3824 This document is a collaborative effort of the entire IPsec WG. If 3825 there were no limit to the number of authors that could appear on an 3826 RFC, the following, in alphabetical order, would have been listed: 3827 Bill Aiello, Stephane Beaulieu, Steve Bellovin, Sara Bitan, Matt 3828 Blaze, Ran Canetti, Darren Dukes, Dan Harkins, Paul Hoffman, J. 3830 Ioannidis, Steve Kent, Angelos Keromytis, Tero Kivinen, Hugo 3831 Krawczyk, Andrew Krywaniuk, Radia Perlman, O. Reingold. Many other 3832 people contributed to the design. It is an evolution of IKEv1, 3833 ISAKMP, and the IPSec DOI, each of which has its own list of authors. 3834 Hugh Daniel suggested the feature of having the initiator, in message 3835 3, specify a name for the responder, and gave the feature the cute 3836 name "You Tarzan, Me Jane". David Faucher and Valery Smyzlov helped 3837 refine the design of the traffic selector negotiation. 3839 8 References 3841 8.1 Normative References 3843 [Bra96] Bradner, S., "The Internet Standards Process -- Revision 3", 3844 BCP 9, RFC 2026, October 1996. 3846 [Bra97] Bradner, S., "Key Words for use in RFCs to indicate 3847 Requirement Levels", BCP 14, RFC 2119, March 1997. 3849 [EAP] Blunk, L. and Volibrecht, J., "PPP Extensible Authentication 3850 Protocol (EAP), RFC 2284, March 1998. 3852 [ESPCBC] Pereira, R., Adams, R., "The ESP CBC-Mode Cipher 3853 Algorithms", 3854 RFC 2451, November 1998. 3856 8.2 Non-normative References 3858 [Ble98] Bleichenbacher, D., "Chosen Ciphertext Attacks against 3859 Protocols Based on RSA Encryption Standard PKCS#1", Advances 3860 in Cryptology Eurocrypt '98, Springer-Verlag, 1998. 3862 [BR94] Bellare, M., and Rogaway P., "Optimal Asymmetric 3863 Encryption", Advances in Cryptology Eurocrypt '94, 3864 Springer-Verlag, 1994. 3866 [DES] ANSI X3.106, "American National Standard for Information 3867 Systems-Data Link Encryption", American National Standards 3868 Institute, 1983. 3870 [DH] Diffie, W., and Hellman M., "New Directions in 3871 Cryptography", IEEE Transactions on Information Theory, V. 3872 IT-22, n. 6, June 1977. 3874 [DHCP] R. Droms, "Dynamic Host Configuration Protocol", 3875 RFC2131 3877 [DSS] NIST, "Digital Signature Standard", FIPS 186, National 3878 Institute of Standards and Technology, U.S. Department of 3879 Commerce, May, 1994. 3881 [HC98] Harkins, D., Carrel, D., "The Internet Key Exchange (IKE)", 3882 RFC 2409, November 1998. 3884 [IDEA] Lai, X., "On the Design and Security of Block Ciphers," ETH 3885 Series in Information Processing, v. 1, Konstanz: Hartung- 3886 Gorre Verlag, 1992 3888 [Ker01] Keronytis, A., Sommerfeld, B., "The 'Suggested ID' Extension 3889 for IKE", draft-keronytis-ike-id-00.txt, 2001 3891 [KBC96] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 3892 Hashing for Message Authentication", RFC 2104, February 3893 1997. 3895 [LDAP] M. Wahl, T. Howes, S. Kille., "Lightweight Directory 3896 Access Protocol (v3)", RFC2251 3898 [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, 3899 April 1992. 3901 [MSST98] Maughhan, D., Schertler, M., Schneider, M., and Turner, J. 3902 "Internet Security Association and Key Management Protocol 3903 (ISAKMP)", RFC 2408, November 1998. 3905 [Orm96] Orman, H., "The Oakley Key Determination Protocol", RFC 3906 2412, November 1998. 3908 [PFKEY] McDonald, D., Metz, C., and Phan, B., "PFKEY Key Management 3909 API, Version 2", RFC2367, July 1998. 3911 [PKCS1] Kaliski, B., and J. Staddon, "PKCS #1: RSA Cryptography 3912 Specifications Version 2", September 1998. 3914 [PK01] Perlman, R., and Kaufman, C., "Analysis of the IPsec key 3915 exchange Standard", WET-ICE Security Conference, MIT, 2001, 3916 http://sec.femto.org/wetice-2001/papers/radia-paper.pdf. 3918 [Pip98] Piper, D., "The Internet IP Security Domain Of 3919 Interpretation for ISAKMP", RFC 2407, November 1998. 3921 [RADIUS] C. Rigney, A. Rubens, W. Simpson, S. Willens, "Remote 3922 Authentication Dial In User Service (RADIUS)", RFC2138 3924 [RFC1715] 3926 [RSA] Rivest, R., Shamir, A., and Adleman, L., "A Method for 3927 Obtaining Digital Signatures and Public-Key Cryptosystems", 3928 Communications of the ACM, v. 21, n. 2, February 1978. 3930 [SHA] NIST, "Secure Hash Standard", FIPS 180-1, National Institute 3931 of Standards and Technology, U.S. Department of Commerce, 3932 May 1994. 3934 [SIGMA] Krawczyk, H., "SIGMA: the `SIGn-and-MAc' Approach to 3935 Authenticated Diffie-Hellman and its Use in the IKE 3936 Protocols", Nov. 2002. 3937 http://www.ee.technion.ac.il/~hugo/sigma.html 3939 [SKEME] Krawczyk, H., "SKEME: A Versatile Secure Key Exchange 3940 Mechanism for Internet", from IEEE Proceedings of the 1996 3941 Symposium on Network and Distributed Systems Security. 3943 Appendix A: Summary of changes from IKEv1 3945 The goals of this revision to IKE are: 3947 1) To define the entire IKE protocol in a single document, replacing 3948 RFCs 2407, 2408, and 2409 and incorporating subsequent changes to 3949 support NAT Traversal, Extended Authentication, and Remote Address 3950 acquisition. 3952 2) To simplify IKE by replacing the eight different initial exchanges 3953 with a single four message exchange (with changes in authentication 3954 mechanisms affecting only a single AUTH payload rather than 3955 restructuring the entire exchange); 3957 3) To remove the Domain of Interpretation (DOI), Situation (SIT), and 3958 Labeled Domain Identifier fields, and the Commit and Authentication 3959 only bits; 3961 4) To decrease IKE's latency in the common case by making the initial 3962 exchange be 2 round trips (4 messages), and allowing the ability to 3963 piggyback setup of a CHILD-SA on that exchange; 3965 5) To replace the cryptographic syntax for protecting the IKE 3966 messages themselves with one based closely on ESP to simplify 3967 implementation and security analysis; 3969 6) To reduce the number of possible error states by making the 3970 protocol reliable (all messages are acknowledged) and sequenced. This 3971 allows shortening CREATE_CHILD_SA exchanges from 3 messages to 2; 3973 7) To increase robustness by allowing the responder to not do 3974 significant processing until it receives a message proving that the 3975 initiator can receive messages at its claimed IP address, and not 3976 commit any state to an exchange until the initiator can be 3977 cryptographically authenticated; 3979 8) To fix bugs such as the hash problem documented in [draft-ietf- 3980 ipsec-ike-hash-revised-02.txt]; 3982 9) To specify Traffic Selectors in their own payloads type rather 3983 than overloading ID payloads, and making more flexible the Traffic 3984 Selectors that may be specified; 3986 10) To specify required behavior under certain error conditions or 3987 when data that is not understood is received in order to make it 3988 easier to make future revisions in a way that does not break 3989 backwards compatibility; 3990 11) To incorporate ideas from draft-ietf-ipsec-nat-reqts-02.txt to 3991 allow IKE to negotiate through NAT gateways; 3993 12) To simplify and clarify how shared state is maintained in the 3994 presence of network failures and Denial of Service attacks; and 3996 13) To maintain existing syntax and magic numbers to the extent 3997 possible to make it likely that implementations of IKEv1 can be 3998 enhanced to support IKEv2 with minimum effort. 4000 Appendix B: Diffie-Hellman Groups 4002 There are 5 groups different Diffie-Hellman groups defined for use in 4003 IKE. These groups were generated by Richard Schroeppel at the 4004 University of Arizona. Properties of these primes are described in 4005 [Orm96]. 4007 The strength supplied by group one may not be sufficient for the 4008 mandatory-to-implement encryption algorithm and is here for historic 4009 reasons. 4011 Additional Diffie-Hellman groups have been defined in [ADDGROUP]. 4012 Future IANA-registered and private use Suite-IDs MAY use Diffie- 4013 Hellman groups that have modulus values and generators that are 4014 different than those in this document or in [ADDGROUP]. 4016 B.1 Group 1 - 768 Bit MODP 4018 IKE implementations MAY support a MODP group with the following prime 4019 and generator. This group is assigned id 1 (one). 4021 The prime is: 2^768 - 2 ^704 - 1 + 2^64 * { [2^638 pi] + 149686 } 4022 Its hexadecimal value is: 4024 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 4025 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 4026 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 4027 A63A3620 FFFFFFFF FFFFFFFF 4029 The generator is 2. 4031 B.2 Group 2 - 1024 Bit MODP 4033 IKE implementations SHOULD support a MODP group with the following 4034 prime and generator. This group is assigned id 2 (two). 4036 The prime is 2^1024 - 2^960 - 1 + 2^64 * { [2^894 pi] + 129093 }. 4037 Its hexadecimal value is: 4039 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 4040 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 4041 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 4042 A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 4043 49286651 ECE65381 FFFFFFFF FFFFFFFF 4045 The generator is 2. 4047 B.3 Group 3 - 155 Bit EC2N 4049 IKE implementations MAY support a EC2N group with the following 4050 characteristics. This group is assigned id 3 (three). The curve is 4051 based on the Galois Field GF[2^155]. The field size is 155. The 4052 irreducible polynomial for the field is: 4053 u^155 + u^62 + 1. 4054 The equation for the elliptic curve is: 4055 y^2 + xy = x^3 + ax^2 + b. 4057 Field Size: 155 4058 Group Prime/Irreducible Polynomial: 4059 0x0800000000000000000000004000000000000001 4060 Group Generator One: 0x7b 4061 Group Curve A: 0x0 4062 Group Curve B: 0x07338f 4063 Group Order: 0x0800000000000000000057db5698537193aef944 4065 The data in the KE payload when using this group is the value x from 4066 the solution (x,y), the point on the curve chosen by taking the 4067 randomly chosen secret Ka and computing Ka*P, where * is the 4068 repetition of the group addition and double operations, P is the 4069 curve point with x coordinate equal to generator 1 and the y 4070 coordinate determined from the defining equation. The equation of 4071 curve is implicitly known by the Group Type and the A and B 4072 coefficients. There are two possible values for the y coordinate; 4073 either one can be used successfully (the two parties need not agree 4074 on the selection). 4076 B.4 Group 4 - 185 Bit EC2N 4078 IKE implementations MAY support a EC2N group with the following 4079 characteristics. This group is assigned id 4 (four). The curve is 4080 based on the Galois Field GF[2^185]. The field size is 185. The 4081 irreducible polynomial for the field is: 4082 u^185 + u^69 + 1. 4084 The equation for the elliptic curve is: 4085 y^2 + xy = x^3 + ax^2 + b. 4087 Field Size: 185 4088 Group Prime/Irreducible Polynomial: 4089 0x020000000000000000000000000000200000000000000001 4090 Group Generator One: 0x18 4091 Group Curve A: 0x0 4092 Group Curve B: 0x1ee9 4093 Group Order: 0x01ffffffffffffffffffffffdbf2f889b73e484175f94ebc 4095 The data in the KE payload when using this group will be identical to 4096 that as when using Oakley Group 3 (three). 4098 B.5 Group 5 - 1536 Bit MODP 4100 IKE implementations MUST support a MODP group with the following 4101 prime and generator. This group is assigned id 5 (five). 4103 The prime is 2^1536 - 2^1472 - 1 + 2^64 * {[2^1406 pi] + 741804}. 4104 Its hexadecimal value is 4106 FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 4107 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 4108 302B0A6D F25F1437 4FE1356D 6D51C245 E485B576 625E7EC6 F44C42E9 4109 A637ED6B 0BFF5CB6 F406B7ED EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 4110 49286651 ECE45B3D C2007CB8 A163BF05 98DA4836 1C55D39A 69163FA8 4111 FD24CF5F 83655D23 DCA3AD96 1C62F356 208552BB 9ED52907 7096966D 4112 670C354E 4ABC9804 F1746C08 CA237327 FFFFFFFF FFFFFFFF 4114 The generator is 2. 4116 Change History 4118 H.1 Changes from IKEv2-00 to IKEv2-01 February 2002 4120 1) Changed Appendix B to specify the encryption and authentication 4121 processing for IKE rather than referencing ESP. Simplified the format 4122 by removing idiosyncracies not needed for IKE. 4124 2) Added option for authentication via a shared secret key. 4126 3) Specified different keys in the two directions of IKE messages. 4127 Removed requirement of different cookies in the two directions since 4128 now no longer required. 4130 4) Change the quantities signed by the two ends in AUTH fields to 4131 assure the two parties sign different quantities. 4133 5) Changed reference to AES to AES_128. 4135 6) Removed requirement that Diffie-Hellman be repeated when rekeying 4136 IKE_SA. 4138 7) Fixed typos. 4140 8) Clarified requirements around use of port 500 at the remote end in 4141 support of NAT. 4143 9) Clarified required ordering for payloads. 4145 10) Suggested mechanisms for avoiding DoS attacks. 4147 11) Removed claims in some places that the first phase 2 piggybacked 4148 on phase 1 was optional. 4150 H.2 Changes from IKEv2-01 to IKEv2-02 April 2002 4152 1) Moved the Initiator CERTREQ payload from message 1 to message 3. 4154 2) Added a second optional ID payload in message 3 for the Initiator 4155 to name a desired Responder to support the case where multiple named 4156 identities are served by a single IP address. 4158 3) Deleted the optimization whereby the Diffie-Hellman group did not 4159 need to be specified in phase 2 if it was the same as in phase 1 (it 4160 complicated the design with no meaningful benefit). 4162 4) Added a section on the implications of reusing Diffie-Hellman 4163 expontentials 4164 5) Changed the specification of sequence numbers to being at 0 in 4165 both directions. 4167 6) Many editorial changes and corrections, the most significant being 4168 a global replace of "byte" with "octet". 4170 H.3 Changes from IKEv2-02 to IKEv2-03 October 2002 4172 1) Reorganized the document moving introductory material to the 4173 front. 4175 2) Simplified the specification of Traffic Selectors to allow only 4176 IPv4 and IPv6 address ranges, as was done in the JFK spec. 4178 3) Fixed the problem brought up by David Faucher with the fix 4179 suggested by Valery Smyslov. If Bob needs to narrow the selector 4180 range, but has more than one matching narrower range, then if Alice's 4181 first selector is a single address pair, Bob chooses the range that 4182 encompasses that. 4184 4) To harmonize with the JFK spec, changed the exchange so that the 4185 initial exchange can be completed in four messages even if the 4186 responder must invoke an anti-clogging defense and the initiator 4187 incorrectly anticipates the responder's choice of Diffie-Hellman 4188 group. 4190 5) Replaced the hierarchical SA payload with a simplified version 4191 that only negotiates suites of cryptographic algorithms. 4193 H.4 Changes from IKEv2-03 to IKEv2-04 January 2003 4195 1) Integrated NAT traversal changes (including Appendix A). 4197 2) Moved the anti-clogging token (cookie) from the SPI to a NOTIFY 4198 payload; changed negotation back to 6 messages when a cookie is 4199 needed. 4201 3) Made capitalization of IKE_SA and CHILD_SA consistent. 4203 4) Changed how IPcomp was negotiated. 4205 5) Added usage scenarios. 4207 6) Added configuration payload for acquiring internal addresses on 4208 remote networks. 4210 7) Added negotiation of tunnel vs transport mode. 4212 H.5 Changes from IKEv2-04 to IKEv2-05 February 2003 4214 1) Shortened Abstract 4216 2) Moved NAT Traversal from Appendix to section 2. Moved changes from 4217 IKEv2 to Appendix A. Renumbered sections. 4219 3) Made language more consistent. Removed most references to Phase 1 4220 and Phase 2. 4222 4) Made explicit the requirements for support of NAT Traversal. 4224 5) Added support for Extended Authentication Protocol methods. 4226 6) Added Response bit to message header. 4228 7) Made more explicit the encoding of Diffie-Hellman numbers in key 4229 expansion algorithms. 4231 8) Added ID payloads to AUTH payload computation. 4233 9) Expanded set of defined cryptographic suites. 4235 10) Added text for MUST/SHOULD support for ID payloads. 4237 11) Added new certificate formats and added MUST/SHOULD text. 4239 12) Clarified use of CERTREQ. 4241 13) Deleted "MUST SUPPORT" column in CP payload specification (it was 4242 inconsistent with surrounding text). 4244 14) Extended and clarified Conformance Requirements section, 4245 including specification of a minimal implementation. 4247 15) Added text to specify ECN handling. 4249 H.6 Changes from IKEv2-05 to IKEv2-06 March 2003 4251 1) Changed the suite based crypto negotiation back to ala carte. 4253 2) Eliminated some awkward page breaks, typographical errors, and 4254 other formatting issues. 4256 3) Tightened language describing cryptographic strength. 4258 4) Added references. 4260 5) Added more specific error codes. 4262 6) Added rationale for unintuitive key generation hash with shared 4263 secret based authentication. 4265 7) Changed the computation of the authenticating AUTH payload as 4266 proposed by Hugo Krawczyk. 4268 8) Changed the dashes (-) to underscores (_) in the names of fields 4269 and constants. 4270 Editor's Address 4272 Charlie Kaufman 4273 charlie_kaufman@notesdev.ibm.com 4274 IBM 4276 Full Copyright Statement 4278 "Copyright (C) The Internet Society (2003). All Rights Reserved. 4280 This document and translations of it may be copied and furnished to 4281 others, and derivative works that comment on or otherwise explain it 4282 or assist in its implementation may be prepared, copied, published 4283 and distributed, in whole or in part, without restriction of any 4284 kind, provided that the above copyright notice and this paragraph are 4285 included on all such copies and derivative works. However, this 4286 document itself may not be modified in any way, such as by removing 4287 the copyright notice or references to the Internet Society or other 4288 Internet organizations, except as needed for the purpose of 4289 developing Internet standards in which case the procedures for 4290 copyrights defined in the Internet Standards process must be 4291 followed, or as required to translate it into languages other than 4292 English. 4294 The limited permissions granted above are perpetual and will not be 4295 revoked by the Internet Society or its successors or assigns. 4297 This document and the information contained herein is provided on an 4298 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 4299 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING 4300 BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION 4301 HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 4302 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."