idnits 2.17.1 draft-ietf-ipsecme-ddos-protection-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to use 'NOT RECOMMENDED' as an RFC 2119 keyword, but does not include the phrase in its RFC 2119 key words list. -- The document date (July 5, 2015) is 3211 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'IKEV2-IANA' == Outdated reference: A later version (-08) exists of draft-iab-crypto-alg-agility-05 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPSecME Working Group Y. Nir 3 Internet-Draft Check Point 4 Intended status: Standards Track V. Smyslov 5 Expires: January 6, 2016 ELVIS-PLUS 6 July 5, 2015 8 Protecting Internet Key Exchange (IKE) Implementations from Distributed 9 Denial of Service Attacks 10 draft-ietf-ipsecme-ddos-protection-02 12 Abstract 14 This document recommends implementation and configuration best 15 practices for Internet-connected IPsec Responders, to allow them to 16 resist Denial of Service and Distributed Denial of Service attacks. 17 Additionally, the document introduces a new mechanism called "Client 18 Puzzles" that help accomplish this task. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on January 6, 2016. 37 Copyright Notice 39 Copyright (c) 2015 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 1.1. Conventions Used in This Document . . . . . . . . . . . . 3 56 2. The Vulnerability . . . . . . . . . . . . . . . . . . . . . . 3 57 3. Puzzles . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 58 3.1. The Keyed-Cookie Notification . . . . . . . . . . . . . . 8 59 3.2. The Puzzle-Required Notification . . . . . . . . . . . . 8 60 4. Retention Periods for Half-Open SAs . . . . . . . . . . . . . 8 61 5. Rate Limiting . . . . . . . . . . . . . . . . . . . . . . . . 8 62 6. Plan for Defending a Responder . . . . . . . . . . . . . . . 9 63 6.1. Session Resumption . . . . . . . . . . . . . . . . . . . 11 64 7. Operational Considerations . . . . . . . . . . . . . . . . . 12 65 8. Using Puzzles in the Protocol . . . . . . . . . . . . . . . . 12 66 8.1. Puzzles in IKE_SA_INIT Exchange . . . . . . . . . . . . . 12 67 8.1.1. Presenting Puzzle . . . . . . . . . . . . . . . . . . 13 68 8.1.2. Solving Puzzle and Returning the Solution . . . . . . 15 69 8.1.3. Analyzing Repeated Request . . . . . . . . . . . . . 16 70 8.1.4. Making Decision whether to Serve the Request . . . . 17 71 8.2. Puzzles in IKE_AUTH Exchange . . . . . . . . . . . . . . 18 72 8.2.1. Presenting Puzzle . . . . . . . . . . . . . . . . . . 19 73 8.2.2. Solving Puzzle and Returning the Solution . . . . . . 20 74 8.2.3. Receiving Puzzle Solution . . . . . . . . . . . . . . 20 75 9. DoS Protection after IKE SA is created . . . . . . . . . . . 21 76 10. Payload Formats . . . . . . . . . . . . . . . . . . . . . . . 22 77 10.1. PUZZLE Notification . . . . . . . . . . . . . . . . . . 22 78 10.2. Puzzle Solution Payload . . . . . . . . . . . . . . . . 23 79 11. Security Considerations . . . . . . . . . . . . . . . . . . . 24 80 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 81 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 82 13.1. Normative References . . . . . . . . . . . . . . . . . . 24 83 13.2. Informative References . . . . . . . . . . . . . . . . . 24 85 1. Introduction 87 The IKE_SA_INIT Exchange described in section 1.2 of [RFC7296] 88 involves the Initiator sending a single message. The Responder 89 replies with a single message and also allocates memory for a 90 structure called a half-open IKE SA (Security Association). This 91 half-open SA is later authenticated in the IKE_AUTH Exchange, but if 92 that IKE_AUTH request never comes, the half-open SA is kept for an 93 unspecified amount of time. Depending on the algorithms used and 94 implementation, such a half-open SA will use from around 100 bytes to 95 several thousands bytes of memory. 97 This creates an easy attack vector against an Internet Key Exchange 98 (IKE) Responder. Generating the Initial request is cheap, and 99 sending multiple such requests can either cause the Responder to 100 allocate too much resources and fail, or else if resource allocation 101 is somehow throttled, legitimate Initiators would also be prevented 102 from setting up IKE SAs. 104 An obvious defense, which is described in Section 5, is limiting the 105 number of half-open SAs opened by a single peer. However, since all 106 that is required is a single packet, an attacker can use multiple 107 spoofed source IP addresses. 109 Section 2.6 of RFC 7296 offers a mechanism to mitigate this DoS 110 attack: the stateless cookie. When the server is under load, the 111 Responder responds to the Initial request with a calculated 112 "stateless cookie" - a value that can be re-calculated based on 113 values in the Initial request without storing Responder-side state. 114 The Initiator is expected to repeat the Initial request, this time 115 including the stateless cookie. 117 Attackers that have multiple source IP addresses with return 118 routability, such as bot-nets can fill up a half-open SA table 119 anyway. The cookie mechanism limits the amount of allocated state to 120 the size of the bot-net, multiplied by the number of half-open SAs 121 allowed for one peer address, multiplied by the amount of state 122 allocated for each half-open SA. With typical values this can easily 123 reach hundreds of megabytes. 125 The mechanism described in Section 3 adds a proof of work for the 126 Initiator, by calculating a pre-image for a partial hash value. This 127 sets an upper bound, determined by the attacker's CPU to the number 128 of negotiations it can initiate in a unit of time. 130 1.1. Conventions Used in This Document 132 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 133 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 134 document are to be interpreted as described in [RFC2119]. 136 2. The Vulnerability 138 If we break down what a responder has to do during an initial 139 exchange, there are three stages: 141 1. When the Initial request arrives, the responder: 143 * Generates or re-uses a D-H private part. 145 * Generates a responder SPI. 147 * Stores the private part and peer public part in a half-open SA 148 database. 150 2. When the Authentication request arrives, the responder: 152 * Derives the keys from the half-open SA. 154 * Decrypts the request. 156 3. If the Authentication request decrypts properly: 158 * Validates the certificate chain (if present) in the auth 159 request. 161 Yes, there's a stage 4 where the responder actually creates Child 162 SAs, but when talking about (D)DoS, we never get to this stage. 164 Stage #1 is pretty light on CPU power, but requires some storage, and 165 it's very light for the initiator as well. Stage #2 includes 166 private-key operations, so it's much heavier CPU-wise, but it 167 releases the storage allocated in stage #1. Stage #3 includes a 168 public key operation, and possibly many of them. 170 To attack such a server, an attacker can attempt to either exhaust 171 memory or to exhaust CPU. Without any protection, the most efficient 172 attack is to send multiple Initial requests and exhaust memory. This 173 should be easy because those Initial requests are cheap. 175 There are obvious ways for the responder to protect itself even 176 without changes to the protocol. It can reduce the time that an 177 entry remains in the half-open SA database, and it can limit the 178 amount of concurrent half-open SAs from a particular address or 179 prefix. The attacker can overcome this by using spoofed source 180 addresses. 182 The stateless cookie mechanism from section 2.6 of RFC 7296 prevents 183 an attack with spoofed source addresses. This doesn't solve the 184 issue, but it makes the limiting of half-open SAs by address or 185 prefix work. Puzzles do the same thing only more of it. They make 186 it harder for an attacker to reach the goal of getting a half-open 187 SA. They don't have to be so hard that an attacker can't afford to 188 solve them - it's enough that they increase the cost of a half-open 189 SAs for the attacker. 191 Reducing the amount of time an abandoned half-open SA is kept attacks 192 the issue from the other side. It reduces the value the attacker 193 gets from managing to create a half-open SA. So if a half-open SA 194 takes 1 KB and it's kept for 1 minute and the capacity is 60,000 195 half-open SAs, an attacker would need to create 1,000 half-open SAs 196 per second. Reduce the retention time to 3 seconds, and the attacker 197 needs to create 20,000 half-open SAs per second. Make each of those 198 more expensive by introducing a puzzle, and you're likely to thwart 199 an exhaustion attack against responder memory. 201 At this point, filling up the half-open SA database in no longer the 202 most efficient DoS attack. The attacker has two ways to do better: 204 1. Go back to spoofed addresses and try to overwhelm the CPU that 205 deals with generating cookies, or 207 2. Take the attack to the next level by also sending an 208 Authentication request. 210 It seems that the first thing cannot be dealt with at the IKE level. 211 It's probably better left to Intrusion Prevention System (IPS) 212 technology. 214 On the other hand sending an Authentication request is surprisingly 215 cheap. It requires a proper IKE header with the correct IKE SPIs, 216 and it requires a single encrypted payload. The content of the 217 payload might as well be junk. The responder has to perform the 218 relatively expensive key derivation, only to find that the 219 Authentication request does not decrypt. Depending on the responder 220 implementation, this can be repeated with the same half-open SA (if 221 the responder does not delete the half-open SA following an 222 unsuccessful decryption - see discussion in Section 4). 224 Here too, the number of half-open SAs that the attacker can achieve 225 is crucial, because each one of them allows the attacker to waste 226 some CPU time. So making it hard to make many half-open SAs is 227 important. 229 A strategy against DDoS has to rely on at least 4 components: 231 1. Hardening the half-open SA database by reducing retention time. 233 2. Hardening the half-open SA database by rate-limiting single IPs/ 234 prefixes. 236 3. Guidance on what to do when an Authentication request fails to 237 decrypt. 239 4. Increasing cost of half-open SA up to what is tolerable for 240 legitimate clients. 242 Puzzles have their place as part of #4. 244 3. Puzzles 246 The puzzle introduced here extends the cookie mechanism from RFC 247 7296. It is loosely based on the proof-of-work technique used in 248 BitCoins ([bitcoins]). 250 A puzzle is sent to the Initiator in two cases: 252 o The Responder is so overloaded, than no half-open SAs are allowed 253 to be created without the puzzle, or 255 o The Responder is not too loaded, but the rate-limiting in 256 Section 5 prevents half-open SAs from being created with this 257 particular peer address or prefix without first solving a puzzle. 259 When the Responder decides to send the challenge notification in 260 response to a IKE_SA_INIT request, the notification includes three 261 fields: 263 1. Cookie - this is calculated the same as in RFC 7296. As in RFC 264 7296, the process of generating the cookie is not specified. 266 2. Algorithm, this is the identifier of a PRF algorithm, one of 267 those proposed by the Initiator in the SA payload. 269 3. Zero Bit Count. This is a number between 8 and 255 (or a special 270 value - 0, see Section 8.1.1.1) that represents the length of the 271 zero-bit run at the end of the output of the PRF function 272 calculated over the Keyed-Cookie payload that the Initiator is to 273 send. Since the mechanism is supposed to be stateless for the 274 Responder, either the same value is sent to all Initiators who 275 are receiving this challenge or the value is somehow encoded in 276 the cookie. The values 1-8 are explicitly excluded, because they 277 create a puzzle that is too easy to solve for it to make any 278 difference in mitigating DDoS attacks. 280 Upon receiving this challenge payload, the Initiator attempts to 281 calculate the PRF using different keys. When a key is found such 282 that the resulting PRF output has a sufficient number of trailing 283 zero bits, that result is sent to the Responder in a Keyed-Cookie 284 notification, as described in Section 3.1. 286 When receiving a request with a Keyed-Cookie, the Responder verifies 287 two things: 289 o That the cookie part is indeed valid. 291 o That the PRF of the transmitted cookie calculated with the 292 transmitted key has a sufficient number of trailing zero bits. 294 Example 1: Suppose the calculated cookie is 295 fdbcfa5a430d7201282358a2a034de0013cfe2ae (20 octets), the algorithm 296 is HMAC-SHA256, and the required number of zero bits is 18. After 297 successively trying a bunch of keys, the Initiator finds that the key 298 that is all-zero except for the last three bytes which are 02fc95 299 yields HMAC_SHA256(k, cookie) = 300 843ab73f35c5b431b1d8f80bedcd1cb9ef46832f799c1d4250a49f683c580000, 301 which has 19 trailing zero bits, so it is an acceptable solution. 303 Example 2: Same cookie, but this time the required number of zero 304 bits is 22. The first key to satisfy that requirement ends in 305 960cbb, which yields a hash with 23 trailing zero bits. Finding this 306 requires 9,833,659 invocations of the PRF. 308 +----------+--------------------------+----------+------------------+ 309 | key | Last 24 Hex PRF Digits | # 0-bits | Time To | 310 | | | | Calculate | 311 +----------+--------------------------+----------+------------------+ 312 | 00 | 0cbbbd1e105f5a177f9697d4 | 2 | 0.000 | 313 | 08 | 34cdedf89560f600aab93c68 | 3 | 0.000 | 314 | 0b | 6153a5131b879a904cd7fbe0 | 5 | 0.000 | 315 | 2b | 0098af3e9422aa40a6f7b140 | 6 | 0.000 | 316 | 0147 | c8bf4a65fc8b974046b97c00 | 10 | 0.001 | 317 | 06e2 | 541487a10cbdf3b21c382800 | 11 | 0.005 | 318 | 0828 | 48719bd62393fcf9bc172000 | 13 | 0.006 | 319 | 0204a7 | 3dce3414477c2364d5198000 | 15 | 0.186 | 320 | 185297 | c19385bb7b9566e5fdf00000 | 20 | 2.146 | 321 | 69dc34 | 1b61ecb347cb2e0cba200000 | 21 | 9.416 | 322 | 960cbb | e48274bfac2b7e1930800000 | 23 | 13.300 | 323 | 01597972 | 39a0141d0fe4b87aea000000 | 25 | 30.749 | 324 | 0b13cd9a | 00b97bb323d6d33350000000 | 28 | 247.914 | 325 | 37dc96e4 | 1e24babc92234aa3a0000000 | 29 | 1237.170 | 326 | 7a1a56d8 | c98f0061e380a49e00000000 | 33 | 2726.150 | 327 +----------+--------------------------+----------+------------------+ 329 Table 1: COOKIE=fdbcfa5a430d7201282358a2a034de0013cfe2ae 331 The figures above were obtained on a 2.4 GHz single core i5. Run 332 times can be halved or quartered with multi-core code, but would be 333 longer on mobile phone processors, even if those are multi-core as 334 well. With these figures 20 bits is believed to be a reasonable 335 choice for puzzle level difficulty for all Initiators, with 24 bits 336 acceptable for specific hosts/prefixes. 338 3.1. The Keyed-Cookie Notification 340 To be added 342 3.2. The Puzzle-Required Notification 344 To be added 346 4. Retention Periods for Half-Open SAs 348 As a UDP-based protocol, IKEv2 has to deal with packet loss through 349 retransmissions. Section 2.4 of RFC 7296 recommends "that messages 350 be retransmitted at least a dozen times over a period of at least 351 several minutes before giving up". Retransmission policies in 352 practice wait at least one or two seconds before retransmitting for 353 the first time. 355 Because of this, setting the timeout on a half-open SA too low will 356 cause it to expire whenever even one IKE_AUTH request packet is lost. 357 When not under attack, the half-open SA timeout SHOULD be set high 358 enough that the Initiator will have enough time to send multiple 359 retransmissions, minimizing the chance of transient network 360 congestion causing IKE failure. 362 When the system is under attack, as measured by the amount of half- 363 open SAs, it makes sense to reduce this lifetime. The Responder 364 should still allow enough time for the round-trip, enough time for 365 the Initiator to derive the Diffie-Hellman shared value, and enough 366 time to derive the IKE SA keys and the create the IKE_AUTH request. 367 Two seconds is probably as low a value as can realistically be used. 369 It could make sense to assign a shorter value to half-open SAs 370 originating from IP addresses or prefixes from which are considered 371 suspect because of multiple concurrent half-open SAs. 373 5. Rate Limiting 375 Even with DDoS, the attacker has only a limited amount of nodes 376 participating in the attack. By limiting the amount of half-open SAs 377 that are allowed to exist concurrently with each such node, the total 378 amount of half-open SAs is capped, as is the total amount of key 379 derivations that the Responder is forced to complete. 381 In IPv4 it makes sense to limit the number of half-open SAs based on 382 IP address. Most IPv4 nodes are either directly attached to the 383 Internet using a routable address or are hidden behind a NAT device 384 with a single IPv4 external address. IPv6 networks are currently a 385 rarity, so we can only speculate on what their wide deployment will 386 be like, but the current thinking is that ISP customers will be 387 assigned whole subnets, so we don't expect the kind of NAT deployment 388 that is common in IPv4. For this reason it makes sense to use a 389 64-bit prefix as the basis for rate limiting in IPv6. 391 The number of half-open SAs is easy to measure, but it is also 392 worthwhile to measure the number of failed IKE_AUTH exchanges. If 393 possible, both factors should be taken into account when deciding 394 which IP address or prefix is considered suspicious. 396 There are two ways to rate-limit a peer address or prefix: 398 1. Hard Limit - where the number of half-open SAs is capped, and any 399 further IKE_SA_INIT requests are rejected. 401 2. Soft Limit - where if a set number of half-open SAs exist for a 402 particular address or prefix, any IKE_SA_INIT request will 403 require solving a puzzle. 405 The advantage of the hard limit method is that it provides a hard cap 406 on the amount of half-open SAs that the attacker is able to create. 407 The downside is that it allows the attacker to block IKE initiation 408 from small parts of the Internet. For example, if a certain purveyor 409 of beverages resembling coffee provides Internet connectivity to its 410 customers through an IPv4 NAT device, a single malicious customer can 411 create enough half-open SAs to fill the quota for the NAT device 412 external IP address. Legitimate Initiators on the same network will 413 not be able to initiate IKE. 415 The advantage of a soft limit is that legitimate clients can always 416 connect. The disadvantage is that a sufficiently resourceful (in the 417 sense that they have a lot of resources) adversary can still 418 effectively DoS the Responder. 420 Regardless of the type of rate-limiting used, there is a huge 421 advantage in blocking the DoS attack using rate-limiting in that 422 legitimate clients who are away from the attacking nodes should not 423 be adversely affected by either the attack or by the measures used to 424 counteract it. 426 6. Plan for Defending a Responder 428 This section outlines a plan for defending a Responder from a DDoS 429 attack based on the techniques described earlier. The numbers given 430 here are not normative, and their purpose is to illustrate the 431 configurable parameters needed for defeating the DDoS attack. 433 Implementations may be deployed in different environments, so it is 434 RECOMMENDED that the parameters be settable. As an example, most 435 commercial products are required to undergo benchmarking where the 436 IKE SA establishment rate is measured. Benchmarking is 437 indistinguishable from a DoS attack and the defenses described in 438 this document may defeat the benchmark by causing exchanges to fail 439 or take a long time to complete. Parameters should be tunable to 440 allow for benchmarking (if only by turning DDoS protection off). 442 Since all countermeasures may cause delays and work on the 443 initiators, they SHOULD NOT be deployed unless an attack is likely to 444 be in progress. To minimize the burden imposed on Initiators, the 445 Responder should monitor incoming IKE requests, searching for two 446 things: 448 1. A general DDoS attack. Such an attack is indicated by a high 449 number of concurrent half-open SAs, a high rate of failed 450 IKE_AUTH exchanges, or a combination of both. For example, 451 consider a Responder that has 10,000 distinct peers of which at 452 peak 7,500 concurrently have VPN tunnels. At the start of peak 453 time, 600 peers might establish tunnels at any given minute, and 454 tunnel establishment (both IKE_SA_INIT and IKE_AUTH) takes 455 anywhere from 0.5 to 2 seconds. For this Responder, we expect 456 there to be less than 20 concurrent half-open SAs, so having 100 457 concurrent half-open SAs can be interpreted as an indication of 458 an attack. Similarly, IKE_AUTH request decryption failures 459 should never happen. Supposing the the tunnels are established 460 using EAP (see section 2.16 or RFC 7296), users enter the wrong 461 password about 20% of the time. So we'd expect 125 wrong 462 password failures a minute. If we get IKE_AUTH decryption 463 failures from multiple sources more than once per second, or EAP 464 failure more than 300 times per minute, that can also be an 465 indication of a DDoS attack. 467 2. An attack from a particular IP address or prefix. Such an attack 468 is indicated by an inordinate amount of half-open SAs from that 469 IP address or prefix, or an inordinate amount of IKE_AUTH 470 failures. A DDoS attack may be viewed as multiple such attacks. 471 If they are mitigated well enough, there will not be a need enact 472 countermeasures on all Initiators. Typical figures might be 5 473 concurrent half-open SAs, 1 decrypt failure, or 10 EAP failures 474 within a minute. 476 Note that using counter-measures against an attack from a particular 477 IP address may be enough to avoid the load on the half-open SA 478 database and the amount of failed IKE_AUTH exchanges to never exceed 479 the threshold of attack detection. This is a good thing as it 480 prevent Initiators that are not close to the attackers from being 481 affected. 483 When there is no general DDoS attack, it is suggested that no Cookie 484 or puzzles be used. At this point the only defensive measure is the 485 monitoring, and setting a soft limit per peer IP or prefix. The soft 486 limit can be set to 3-5, and the puzzle difficulty should be set to 487 such a level (number of zero-bits) that all legitimate clients can 488 handle it without degraded user experience. 490 As soon as any kind of attack is detected, either a lot of 491 initiations from multiple sources or a lot of initiations from a few 492 sources, it is best to begin by requiring stateless cookies from all 493 Initiators. This will force the attacker to use real source 494 addresses, and help avoid the need to impose a greater burden in the 495 form of cookies on the general population of initiators. This makes 496 the per-node or per-prefix soft limit more effective. 498 When Cookies are activated for all requests and the attacker is still 499 managing to consume too many resources, the Responder MAY increase 500 the difficulty of puzzles imposed on IKE_SA_INIT requests coming from 501 suspicious nodes/prefixes. It should still be doable by all 502 legitimate peers, but it can degrade experience, for example by 503 taking up to 10 seconds to solve the puzzle. 505 If the load on the Responder is still too great, and there are many 506 nodes causing multiple half-open SAs or IKE_AUTH failures, the 507 Responder MAY impose hard limits on those nodes. 509 If it turns out that the attack is very widespread and the hard caps 510 are not solving the issue, a puzzle MAY be imposed on all Initiators. 511 Note that this is the last step, and the Responder should avoid this 512 if possible. 514 6.1. Session Resumption 516 When the Responder is under attack, it MAY choose to prefer 517 previously authenticated peers who present a session resumption 518 [RFC5723] ticket. The Responder MAY require such Initiators to pass 519 a return routability check by including the COOKIE notification in 520 the IKE_SESSION_RESUME response message, as allowed by RFC 5723, Sec. 521 4.3.2. Note that the Responder SHOULD cache tickets for a short time 522 to reject reused tickets (Sec. 4.3.1), and therefore there should be 523 no issue of half-open SAs resulting from replayed IKE_SESSION_RESUME 524 messages 526 7. Operational Considerations 528 [This section needs a lot of expanding] 530 The difficulty level should be set by balancing the requirement to 531 minimize the latency for legitimate initiators and making things 532 difficult for attackers. A good rule of thumb is for taking about 1 533 second to solve the puzzle. A typical initiator or bot-net member in 534 2014 can perform slightly less than a million hashes per second per 535 core, so setting the difficulty level to n=20 is a good compromise. 536 It should be noted that mobile initiators, especially phones are 537 considerably weaker than that. Implementations should allow 538 administrators to set the difficulty level, and/or be able to set the 539 difficulty level dynamically in response to load. 541 Initiators should set a maximum difficulty level beyond which they 542 won't try to solve the puzzle and log or display a failure message to 543 the administrator or user. 545 8. Using Puzzles in the Protocol 547 8.1. Puzzles in IKE_SA_INIT Exchange 549 IKE initiator indicates the desire to create a new IKE SA by sending 550 IKE_SA_INIT request message. The message may optionally contain 551 COOKIE notification if this is a repeated request performed after the 552 responder's demand to return a cookie. 554 HDR, [N(COOKIE),] SA, KE, Ni, [V+][N+] --> 556 According to the plan, described in Section 6, IKE responder should 557 monitor incoming requests to detect whether it is under attack. If 558 the responder learns that (D)DoS attack is likely to be in progress, 559 then it either requests the initiator to return a cookie or, if the 560 volume is so high, that puzzles need to be used for defense, it 561 requests the initiator to solve a puzzle. 563 The responder MAY choose to process some fraction of IKE_SA_INIT 564 requests without presenting a puzzle even being under attack to allow 565 legacy clients, that don't support puzzles, to have chances to be 566 served. The decision whether to process any particular request must 567 be probabilistic, with the probability depending on the responder's 568 load (i.e. on the volume of attack). Only those requests, that 569 contain COOKIE notification, must participate in this lottery. In 570 other words, the responder MUST first perform return routability 571 check before allowing any legacy client to be served if it is under 572 attack. See Section 8.1.3 for details. 574 8.1.1. Presenting Puzzle 576 If the responder takes a decision to use puzzles, then it includes 577 two notifications in its response message - the COOKIE notification 578 and the PUZZLE notification. The format of the PUZZLE notification 579 is described in Section 10.1. 581 <-- HDR, N(COOKIE), N(PUZZLE), [V+][N+] 583 The presence of these notifications in an IKE_SA_INIT response 584 message indicates to the initiator that it should solve the puzzle to 585 get better chances to be served. 587 8.1.1.1. Selecting Puzzle Difficulty Level 589 The PUZZLE notification contains the difficulty level of the puzzle - 590 the minimum number of trailing zero bits that the result of PRF must 591 contain. In diverse environments it is next to impossible for the 592 responder to set any specific difficulty level that will result in 593 roughly the same amount of work for all initiators, because 594 computation power of different initiators may vary by the order of 595 magnitude, or even more. The responder may set difficulty level to 596 0, meaning that the initiator is requested to spend as much power to 597 solve puzzle, as it can afford. In this case no specific number of 598 trailing zero bits is required from the initiator, however the more 599 bits initiator is able to get, the higher chances it will have to be 600 served by the responder. In diverse environments it is RECOMMENDED 601 that the initiator sets difficulty level to 0, unless the attack 602 volume is very high. 604 If the responder sets non-zero difficulty level, then the level 605 should be determined by analyzing the volume of the attack. The 606 responder MAY set different difficulty levels to different requestd 607 depending on the IP address the request has come from. 609 8.1.1.2. Selecting Puzzle Algorithm 611 The PUZZLE notification also contains identificator of the algorithm, 612 that must be used by initiator to compute puzzle. 614 Cryptographic algorithm agility is considered an important feature 615 for modern protocols ([ALG-AGILITY]). This feature ensures that 616 protocol doesn't rely on a single build-in set of cryptographic 617 algorithms, but has a means to replace one set with another and 618 negotiate new set with the peer. IKEv2 fully supports cryptographic 619 algorithm agility for its core operations. 621 To support this feature in case of puzzles the algorithm, that is 622 used to compute puzzle, needs to be negotiated during IKE_SA_INIT 623 exchange. The negotiation is done as follows. The initial request 624 message sent by initiator contains SA payload with the list of 625 transforms the initiator supports and is willing to use in the IKE SA 626 being established. The responder parses received SA payload and 627 finds mutually supported set of transforms of type PRF. It selects 628 most preferred transform from this set and includes it into the 629 PUZZLE notification. There is no requirement that the PRF selected 630 for puzzles be the same, as the PRF that is negotiated later for the 631 use in core IKE SA crypto operations. If there are no mutually 632 supported PRFs, then negotiation will fail anyway and there is no 633 reason to return a puzzle. In this case the responder returns 634 NO_PROPOSAL_CHOSEN notification. Note that PRF is a mandatory 635 transform type for IKE SA (see Sections 3.3.2 and 3.3.3 of [RFC7296]) 636 and at least one transform of this type must always be present in SA 637 payload in IKE_SA_INIT exchange. 639 8.1.1.3. Generating Cookie 641 If responder supports puzzles then cookie should be computed in such 642 a manner, that the responder is able to learn some important 643 information from the sole cookie, when it is later returned back by 644 initiator. In particular - the responder should be able to learn the 645 following information: 647 o Whether the puzzle was given to the initiator or only the cookie 648 was requested. 650 o The difficulty level of the puzzle given to the initiator. 652 o The number of consecutive puzzles given to the initiator. 654 o The amount of time the initiator spent to solve the puzzles. This 655 can be calculated if the cookie is timestamped. 657 This information helps the responder to make a decision whether to 658 serve this request or demand more work from the initiator. 660 One possible approach to get this information is to encode it in the 661 cookie. The format of such encoding is a local matter of responder, 662 as the cookie would remain an opaque blob to the initiator. If this 663 information is encoded in the cookie, then the responder MUST make it 664 integrity protected, so that any intended or accidental alteration of 665 this information in returned cookie is detectable. So, the cookie 666 would be generated as: 668 Cookie = | | 669 Hash(Ni | IPi | SPIi | | ) 671 Alternatively the responder may continue to generate cookie as 672 suggested in Section 2.6 of [RFC7296], but associate the additional 673 information, that would be stored locally, with the particular 674 version of the secret. In this case the responder should have 675 different secret for every combination of difficulty level and number 676 of consecutive puzzles, and should change the secrets periodically, 677 keeping a few previous versions, to be able to calculate how long ago 678 the cookie was generated. 680 The responder may also combine these approaches. This document 681 doesn't mandate how the responder learns this information from the 682 cookie. 684 8.1.2. Solving Puzzle and Returning the Solution 686 If initiator receives puzzle but it doesn't support puzzles, then it 687 will ignore PUZZLE notification as unrecognized status notification 688 (in accordance to Section 3.10.1 of [RFC7296]). The initiator also 689 MAY ignore puzzle if it is not willing to spend resources to solve 690 puzzle of requested difficulty, even if it supports puzzles. In both 691 cases the initiator acts as described in Section 2.6 of [RFC7296] - 692 it restarts the request and includes the received COOKIE notification 693 into it. The responder should be able to distinguish the situation 694 when it just requested a cookie from the situation when the puzzle 695 was given to the initiator, but the initiator for some reason ignored 696 it. 698 If the received message contains PUZZLE notification, but doesn't 699 contain cookie, then this message is malformed, because it requests 700 to solve the puzzle, but doesn't provide enough information to do it. 701 In this case the initiator SHOULD resend IKE_SA_INIT request. If 702 this situation repeats several times, then it means that something is 703 wrong and IKE SA cannot be established. 705 If initiator supports puzzles and is ready to deal with them, then it 706 tries to solve the given puzzle. After the puzzle is solved the 707 initiator restarts the request and returns the puzzle solution in a 708 new payload called Puzzle Solution payload (denoted as PS, see 709 Section 10.2) along with the received COOKIE notification back to the 710 responder. 712 HDR, N(COOKIE), [PS,] SA, KE, Ni, [V+][N+] --> 714 8.1.2.1. Computing Puzzle 716 General principals of constructing puzzles in IKEv2 are described in 717 Section 3. They can be summarized as follows: given unpredictable 718 string S and pseudo-random function PRF find the key K for that PRF 719 so that the result of PRF(K,S) has the specified number of trailing 720 zero bits. 722 In the IKE_SA_INIT exchange it is the cookie that plays the role of 723 unpredictable string S. In other words, in IKE_SA_INIT the task for 724 IKE initiator is to find the key K for the agreed upon PRF such that 725 the result of PRF(K,cookie) has sufficient number of trailing zero 726 bits. Only the content of the COOKIE notification is used in puzzle 727 calculation, i.e. the header of the Notification payload is not 728 included. 730 8.1.3. Analyzing Repeated Request 732 The received request must at least contain COOKIE notification. 733 Otherwise it is an initial request and it must be processed according 734 to Section 8.1. First, the cookie MUST be checked for validity. If 735 the cookie is invalid then the request is treated as initial and is 736 processed according to Section 8.1. If the cookie is valid then some 737 important information is learned from it or from local state based on 738 identifier of the cookie's secret (see Section 8.1.1.3 for details). 739 This information would allow the responder to sort out incoming 740 requests, giving more priority to those of them, which were created 741 spending more initiator's resources. 743 First, the responder determines if it requested only a cookie, or 744 presented a puzzle to the initiator. If no puzzle was given, then it 745 means that at the time the responder requested a cookie it didn't 746 detect the (D)DoS attack or the attack volume was low. In this case 747 the received request message must not contain the PS payload, and 748 this payload MUST be ignored if for any reason the message contains 749 it. Since no puzzle was given, the responder marks the request with 750 the lowest priority since the initiator spent a little resources 751 creating it. 753 If the responder learns from the cookie that puzzle was given to the 754 initiator, then it looks for the PS payload to determine whether its 755 request to solve the puzzle was honored or not. If the incoming 756 message doesn't contain PS payload, then it means that the initiator 757 either doesn't support puzzles or doesn't want to deal with them. In 758 either case the request is marked with the lowest priority since the 759 initiator spent a little resources creating it. 761 If PS payload is found in the message then the responder MUST verify 762 the puzzle solution that it contains. The result must contain at 763 least the requested number of trailing zero bits (that is also 764 learned from the cookie, as well as the PRF algorithm used in puzzle 765 solution). If the result of the solution contais fewer bits, than 766 were requested, it means that initiator spent less resources, than 767 expected by the responder. This request is marked with the lowest 768 priority. 770 If the initiator provided the solution to the puzzle satisfying the 771 requested difficulty level, or if the responder didn't indicate any 772 particular difficulty level (by requesting zero level) and the 773 initiator was free to select any difficulty level it can afford, then 774 the priority of the request is calculated based on the following 775 considerations. 777 o The higher zero bits the initiator got, the higher priority its 778 request should achieve. 780 o The more consecutive puzzles the initiator solved (it must be 781 learned from the cookie), the higher priority its request should 782 achieve. 784 o The more time the initiator spent solving the puzzles (it must be 785 learned from the cookie), the higher priority its request should 786 achieve. 788 After the priority of the request is determined the final decision 789 whether to serve it or not is made. 791 8.1.4. Making Decision whether to Serve the Request 793 The responder decides what to do with the request based on its 794 priority and responder's current load. There are three possible 795 actions: 797 o Accept request. 799 o Reject request. 801 o Demand more work from initiator by giving it a new puzzle. 803 The responder SHOULD accept incoming request if its priority is high 804 - it means that the initiator spent quite a lot of resources. The 805 responder MAY also accept some of low-priority requests where the 806 initiators don't support puzzles. The percentage of accepted legacy 807 requests depends on the responder's current load. 809 If initiator solved the puzzle, but didn't spend much resources for 810 it (the selected puzzle difficulty level appeared to be low and the 811 initiator solved it quickly), then the responder SHOULD give it 812 another puzzle. The more puzzles the initiator solves the higher 813 would be its chances ro be served. 815 The details of how the responder takes decision on any particular 816 request are implementation dependant. The responder can collect all 817 the incoming requests for some short period of time, sort them out 818 based on their priority, calculate the number of alailable memory 819 slots for half-open IKE SAs and then serve that number of the 820 requests from the head of the sorted list. The rest of requests can 821 be either discarded or responded to with new puzzles. 823 Alternatively the responder may decide whether to accept every 824 incoming request with some kind of lottery, taking into account its 825 priority and the available resources. 827 8.2. Puzzles in IKE_AUTH Exchange 829 Once the IKE_SA_INIT exchange is completed, the responder has created 830 a state and is awaiting for the first message of the IKE_AUTH 831 exchange from initiator. At this point the initiator has already 832 passed return routability check and has proved that it has performed 833 some work to complete IKE_SA_INIT exchange. However, the initiator 834 is not yet authenticated and this fact allows malicious initiator to 835 perform an attack, described in Section 2. Unlike DoS attack in 836 IKE_SA_INIT exchange, which is targeted on the responder's memory 837 resources, the goal of this attack is to exhaust responder's CPU 838 power. The attack is performed by sending the first IKE_AUTH message 839 containing garbage. This costs nothing to the initiator, but the 840 responder has to do relatively costly operations of computing the 841 Diffie-Hellman shared secret and deriving SK_* keys to be able to 842 verify authenticity of the message. If the responder doesn't keep 843 the computed keys after unsuccessful verification of IKE_AUTH 844 message, then the attack can be repeated several times on the same 845 IKE SA. 847 The responder can use puzzles to make this attack more costly for the 848 initiator. The idea is that the responder includes puzzle in the 849 IKE_SA_INIT response message and the initiator includes puzzle 850 solution in the first IKE_AUTH request message outside the Encrypted 851 payload, so that the responder is able to verify puzzle solution 852 before computing Diffie-Hellman shared secret. The difficulty level 853 of the puzzle should be selected so, that the initiator would spend 854 substantially more time to solve the puzzle, than the responder to 855 compute the shared secret. 857 The responder should constantly monitor the amount of the half-open 858 IKE SA states, that receive IKE_AUTH messages, but cannot decrypt 859 them due to the integrity check failures. If the percentage of such 860 states is high and it takes an essential fraction of responder's 861 computing power to calculate keys for them, then the responder can 862 assume that it is under attack and can use puzzles to make it harder 863 for attackers. 865 8.2.1. Presenting Puzzle 867 The responder requests the initiator to solve a puzzle by including 868 the PUZZLE notification in the IKE_SA_INIT response message. The 869 responder MUST NOT use puzzles in the IKE_AUTH exchange unless the 870 puzzle has been previously presented and solved in the preceeding 871 IKE_SA_INIT exchange. 873 <-- HDR, SA, KE, Nr, N(PUZZLE), [V+][N+] 875 8.2.1.1. Selecting Puzzle Difficulty Level 877 The difficulty level of the puzzle in IKE_AUTH should be chosen so, 878 that the initiator would spend more time to solve the puzzle, than 879 the responder to compute Diffie-Hellman shared secret and the keys, 880 needed to decrypt and verify the IKE_AUTH request message. On the 881 other hand, the difficulty level should not be too high, otherwise 882 the legitimate clients would experience additional delay while 883 establishing IKE SA. 885 Note, that since puzzles in the IKE_AUTH exchange are only allowed to 886 be used if they were used in the preceeding IKE_SA_INIT exchange, the 887 responder would be able to estimate the computing power of the 888 initiator and to select the difficulty level accordingly. Unlike 889 puzzles in IKE_SA_INIT, the requested difficulty level for IKE_AUTH 890 puzzles MUST NOT be zero. In other words, the responder must always 891 set specific difficulty level and must not let the initiator to 892 choose it on its own. 894 8.2.1.2. Selecting Puzzle Algorithm 896 The algorithm for the puzzle is selected as described in 897 Section 8.1.1.2. There is no requirement, that the algorithm for the 898 puzzle in the IKE_SA INIT exchange be the same, as the algorithm for 899 the puzzle in IKE_AUTH exchange, however it is expected that in most 900 cases they will be the same. 902 8.2.2. Solving Puzzle and Returning the Solution 904 If the IKE_SA_INIT response message contains the PUZZLE notification 905 and the initiator supports puzzles, it MUST solve the puzzle. Puzzle 906 construction on the IKE_AUTH exchange differs from the puzzle in the 907 IKE_SA_INIT exchange and is described in Section 8.2.2.1. Once the 908 puzzle is solved the initiator sends the IKE_AUTH request message, 909 containing the Puzzle Solution payload. 911 HDR, PS, SK {IDi, [CERT,] [CERTREQ,] 912 [IDr,] AUTH, SA, TSi, TSr} --> 914 The Puzzle Solution payload is placed outside the Encrypted payload, 915 so that the responder would be able to verify the puzzle before 916 calculating the Diffie-Hellman shared secret and the SK_* keys. 918 If IKE Fragmentation [RFC7383] is used in IKE_AUTH exchange, then the 919 PS payload MUST be present only in the first IKE Fragment message, in 920 accordance with the Section 2.5.3 of RFC7383. Note, that calculation 921 of the puzzle in the IKE_AUTH exchange doesn't depend on the content 922 of the IKE_AUTH message (see Section 8.2.2.1). Thus the responder 923 has to solve the puzzle only once and the solution is valid for both 924 unfragmented and fragmented IKE messages. 926 8.2.2.1. Computing Puzzle 928 The puzzle in the IKE_AUTH exchange is computed differently, than in 929 the IKE_SA_INIT exchange (see Section 8.1.2.1). The general 930 principle is the same, the difference is in constructing of the 931 string S. Unlike the IKE_SA_INIT exchange, where S is the cookie, in 932 the IKE_AUTH exchange S is a concatenation of Nr and SPIr. In other 933 words, the task for IKE initiator is to find the key K for the agreed 934 upon PRF such that the result of PRF(K,Nr | SPIr) has sufficient 935 number of trailing zero bits. Nr is a nonce used by the responder in 936 IKE_SA_INIT exchange, stripped of any headers. SPIr is IKE responder 937 SPI in the SA being established. 939 8.2.3. Receiving Puzzle Solution 941 If the responder requested the initiator to solve puzzle in the 942 IKE_AUTH exchange, then it SHOULD silently discard all the IKE_AUTH 943 request messages without the Puzzle Solution payload. 945 Once the message containing solution for the puzzle is received the 946 responder SHOULD verify the solution before performing computationly 947 intensive operations - computing the Diffie-Hellman shared secret and 948 the SK_* keys. The responder MUST silently discard the received 949 message if the puzzle solution is not correct (has insufficient 950 number of trailing zero bits). If the puzzle is successfully 951 verified and the SK_* key are calculated, but the message 952 authenticity check fails, the responder SHOULD save the calculated 953 keys in the IKE SA state while waiting for the retransmissions from 954 the initiator. In this case the responder may skip verification of 955 the puzzle solution and ignore the Puzzle Solution payload in the 956 retransmitted messages. 958 If the initiator uses IKE Fragmentation, then it is possible, that 959 due to packets loss and/or reordering the responder would receive 960 non-first IKE Fragment messages before receiving the first one, 961 containing the PS payload. In this case the responder MAY choose to 962 keep the received fragments until the first fragment containing the 963 solution to the puzzle is received. However in this case the 964 responder SHOULD NOT try to verify authenticity of the kept fragments 965 untill the first fragment with the PS payload is received and the 966 solution to the puzzle is verified. After successful verification of 967 the puzzle the responder would calculate the SK_* key and verify 968 authenticity of the collected fragments. 970 9. DoS Protection after IKE SA is created 972 Once IKE SA is created there is usually no much traffic over it. In 973 most cases this traffic consists of exchanges aimed to create 974 additional Child SAs, rekey or delete them and check the liveness of 975 the peer. With a typical setup and typical Child SA lifetimes there 976 must be no more than a few such exchanges in a minute, often less. 977 Some of these exchanges require relatively little resources (like 978 liveness check), while others may be resource consuming (like 979 creating or rekeying Child SA with Diffie-Hellman exchange). 981 Since any endpoint can initiate new exchange, there is a possibility 982 that a peer would initiate too many exchanges, that could exhaust 983 host resources. For example the peer can perform endless continuous 984 Child SA rekeying or create overwhelming number of Child SAs with the 985 same Traffic Selectors etc. Such behaviour may be caused by buggy 986 implementation, misconfiguration or be intentional. The latter 987 becomes more real threat if the peer uses NULL Authentication, 988 described in [NULL-AUTH]. In this case the peer remains anonymous, 989 that allow it to escape any resposibility for its actions. 991 The following recommendations for defense against possible DoS 992 attacks after IKE SA is established are mostly intended for 993 implementations that allow unauthenticated IKE sessions. However 994 they may also be useful in other cases. 996 o If the IKEv2 window size is greater than one, then the peer could 997 initiate multiple simultaneous exchanges, that would potentially 998 increase host resourse consumption. Since currently there is no 999 way in IKEv2 to decrease window size once it was increased (see 1000 Section 2.3 of [RFC7296]), the window size cannot be dynamically 1001 adjusted depending on the load. For that reason if is NOT 1002 RECOMMENDED to ever increase IKEv2 window size above its default 1003 value of one if the peer uses NULL Authentication. 1005 o If the peer initiates requests to rekey IKE SA or Child SA too 1006 often, implementations can respond to some of these requests with 1007 the TEMPORARY_FAILURE notification, indicating that the request 1008 should be retried after some period of time. 1010 o If the peer creates too many Child SA with the same or overlapping 1011 Traffic Selectors, implementations can respond with the 1012 NO_ADDITIONAL_SAS notification. 1014 o If the peer initiates too many exchanges of any kind, 1015 implementations can introduce artificial delay before responding 1016 to request messages. This delay would decrease the rate the 1017 implementation need to process requests from any particular peer, 1018 making possible to process requests from the others. The delay 1019 should not be too long not to cause IKE SA to be deleted on the 1020 other end due to timeout. It is believed that a few seconds is 1021 enough. Note, that if the responder receives retransmissions of 1022 the request message during the delay period, the retransmitted 1023 messages should be silently discarded. 1025 o If these counter-measures are inefficient, implementations can 1026 delete IKE SA with an offending peer by sending Delete Payload. 1028 10. Payload Formats 1030 10.1. PUZZLE Notification 1032 The PUZZLE notification is used by IKE responder to inform the 1033 initiator about the necessity to solve the puzzle. It contains the 1034 difficulty level of the puzzle and the PRF the initiator should use. 1036 1 2 3 1037 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 1038 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1039 | Next Payload |C| RESERVED | Payload Length | 1040 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1041 |Protocol ID(=0)| SPI Size (=0) | Notify Message Type | 1042 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1043 | PRF | Difficulty | 1044 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1045 o Protocol ID (1 octet) - MUST be 0. 1047 o SPI Size (1 octet) - MUST be 0, meaning no Security Parameter 1048 Index (SPI) is present. 1050 o Notify Message Type (2 octets) - MUST be , the value 1051 assigned for the PUZZLE notification. 1053 o PRF (2 octets) - Transform ID of the PRF algorithm that must be 1054 used to solve the puzzle. Readers should refer to the section 1055 "Transform Type 2 - Pseudo-random Function Transform IDs" in 1056 [IKEV2-IANA] for the list of possible values. 1058 o Difficulty (1 octet) - Difficulty Level of the puzzle. Specifies 1059 minimum number of trailing zero bit, that the result of PRF must 1060 contain. Value 0 means that the responder doesn't request any 1061 specific difficulty level and the initiator is free to select 1062 appropriate difficulty level of its own (see Section 8.1.1.1 for 1063 details). 1065 This notification contains no data. 1067 10.2. Puzzle Solution Payload 1069 The solution to the puzzle is returned back to the responder in a 1070 dedicated payload, called Puzzle Solution payload and denoted as PS 1071 in this document. 1073 1 2 3 1074 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 1075 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1076 | Next Payload |C| RESERVED | Payload Length | 1077 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1078 | | 1079 ~ Puzzle Solution Data ~ 1080 | | 1081 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1083 o Puzzle Solution Data (variable length) - Contains the solution to 1084 the puzzle - i.e. the key for the PRF. This field MUST NOT be 1085 empty. If the selected PRF has a fixed-size key, then the size of 1086 the Puzzle Solution Data MUST be equal to the size of the key. If 1087 the PRF agreed upon accepts keys of any size, then then the size 1088 of the Puzzle Solution Data MUST be between 1 octet and the 1089 preferred key length of the PRF (inclusive). 1091 The payload type for the Puzzle Solution payload is . 1093 11. Security Considerations 1095 To be added. 1097 12. IANA Considerations 1099 This document defines a new payload in the "IKEv2 Payload Types" 1100 registry: 1102 Puzzle Solution PS 1104 This document also defines a new Notify Message Type in the "IKEv2 1105 Notify Message Types - Status Types" registry: 1107 PUZZLE 1109 13. References 1111 13.1. Normative References 1113 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1114 Requirement Levels", BCP 14, RFC 2119, March 1997. 1116 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 1117 Kivinen, "Internet Key Exchange Protocol Version 2 1118 (IKEv2)", STD 79, RFC 7296, October 2014. 1120 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 1121 (IKEv2) Message Fragmentation", RFC 7383, November 2014. 1123 [IKEV2-IANA] 1124 "Internet Key Exchange Version 2 (IKEv2) Parameters", 1125 . 1127 13.2. Informative References 1129 [RFC5723] Sheffer, Y. and H. Tschofenig, "Internet Key Exchange 1130 Protocol Version 2 (IKEv2) Session Resumption", RFC 5723, 1131 January 2010. 1133 [bitcoins] 1134 Nakamoto, S., "Bitcoin: A Peer-to-Peer Electronic Cash 1135 System", October 2008, . 1137 [ALG-AGILITY] 1138 Housley, R., "Guidelines for Cryptographic Algorithm 1139 Agility", draft-iab-crypto-alg-agility-05 (work in 1140 progress), December 2014. 1142 [NULL-AUTH] 1143 Smyslov, V. and P. Wouters, "The NULL Authentication 1144 Method in IKEv2 Protocol", draft-ietf-ipsecme-ikev2-null- 1145 auth-07 (work in progress), January 2015. 1147 Authors' Addresses 1149 Yoav Nir 1150 Check Point Software Technologies Ltd. 1151 5 Hasolelim st. 1152 Tel Aviv 6789735 1153 Israel 1155 EMail: ynir.ietf@gmail.com 1157 Valery Smyslov 1158 ELVIS-PLUS 1159 PO Box 81 1160 Moscow (Zelenograd) 124460 1161 Russian Federation 1163 Phone: +7 495 276 0211 1164 EMail: svan@elvis.ru