idnits 2.17.1 draft-smyslov-ipsecme-ikev2-compression-03.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 date (March 7, 2017) is 2607 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 (-02) exists of draft-mglt-6lo-diet-esp-requirements-01 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group V. Smyslov 3 Internet-Draft ELVIS-PLUS 4 Intended status: Standards Track March 7, 2017 5 Expires: September 8, 2017 7 Compression in the Internet Key Exchange Protocol Version 2 (IKEv2) 8 draft-smyslov-ipsecme-ikev2-compression-03 10 Abstract 12 This document describes a method for reducing the size of the IKEv2 13 messages by using lossless compression. Making IKEv2 messages 14 smaller is desirable for low power consumption battery powered 15 devices. It also helps to avoid IP fragmentation of IKEv2 messages. 16 This document describes how compression is negotiated maintaining 17 backward compatibility and how it is used in IKEv2. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on September 8, 2017. 36 Copyright Notice 38 Copyright (c) 2017 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 55 3. Protocol Description . . . . . . . . . . . . . . . . . . . . 3 56 3.1. Using Compression in the IKE_SA_INIT Exchange . . . . . . 4 57 3.2. Using Compression in Subsequent Exchanges . . . . . . . . 6 58 4. Payload Formats . . . . . . . . . . . . . . . . . . . . . . . 7 59 4.1. Compressed Payload . . . . . . . . . . . . . . . . . . . 7 60 4.2. INVALID_COMPRESSION_ALGORITHM Notification . . . . . . . 8 61 5. Interaction with other IKEv2 Extensions . . . . . . . . . . . 8 62 5.1. Interaction with IKEv2 Fragmentation . . . . . . . . . . 9 63 5.2. Interaction with IKEv2 Resumption . . . . . . . . . . . . 9 64 5.3. Interaction with IKEv2 Redirect . . . . . . . . . . . . . 9 65 6. Security Considerations . . . . . . . . . . . . . . . . . . . 9 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 68 8.1. Normative References . . . . . . . . . . . . . . . . . . 10 69 8.2. Informative References . . . . . . . . . . . . . . . . . 11 70 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 11 72 1. Introduction 74 The Internet Key Exchange protocol version 2 (IKEv2) defined in 75 [RFC7296] is used in the IP Security (IPsec) architecture for the 76 purposes of Security Association (SA) parameters negotiation and 77 authenticated key exchange. The protocol uses UDP as the transport 78 for its messages. The size of the IKEv2 messages varies from 79 hundreds bytes to several kBytes. 81 Sending large UDP messages may cause IP fragmentation to take place, 82 which may interact badly with some Network Address Translators (NAT). 83 One of the possible solutions to the problem is IKEv2 fragmentation 84 described in [RFC7383]. However, the IKEv2 fragmentation cannot be 85 used for unencrypted messages and thus cannot be used in the initial 86 IKEv2 exchange called IKE_SA_INIT exchange. Usually the messages of 87 the IKE_SA_INIT exchange are relatively small and this restriction 88 doesn't cause problems. However with adoption more and more new 89 algorithms and new IKEv2 extensions there is a tendency for these 90 messages to become larger and larger for the implementations that 91 support new features. 93 The lossless compression can be used to reduce the size of IKEv2 94 messages. Each IKEv2 message contains different types of data 95 structured in payloads. Depending on the type of payload the 96 compressibility of the data it contains varies greatly. Some types 97 of payloads, like the Nonce payload, contain data that are almost 98 uncompressible. On the other hand, such payloads like the Security 99 Association payload or Notification payload usually have a lot of 100 redundancy in their encoding and hence are highly compressible. 101 Since many emerging IKEv2 extensions add new type of notification or 102 new parameter to the Security Association payload contained in the 103 IKE_SA_INIT messages, the ability to compress these messages would 104 help keep their size bounded. 106 Compression can also be applied to the messages followed the 107 IKE_SA_INIT exchange. In this case the reduced size of the messages 108 would make the necessity to use the IKEv2 fragmentation less likely 109 or would decrease the number of fragments the messages are divided 110 into, which would increase the protocol reliability and productivity. 112 The other field where using compression may be useful is the Internet 113 of Things (IoT) devices utilizing a lower power consumption 114 technology. For many such devices the power consumption for 115 transmitting extra bits over network is much higher than the power 116 consumption for spending extra CPU cycles to compress data before 117 transmission. The appendix A of [IPSEC-IOT-REQS] gives some estimate 118 data. Since many such devices are battery powered without an ability 119 to recharge or to replace the battery which serves for the lifecycle 120 of the device (a few years), the task of reducing the power 121 consuption for such devices is very important. 123 This document specifies how lossless compression is used in IKEv2. 124 In order to enable compression in the IKE_SA_INIT exchange a new 125 payload is introduced that contains other payloads in compressed 126 form. The processing of the Encrypted payload is modified to 127 accommodate compression in subsequent exchanges. The document also 128 specifies how the use of compression is negotiated between the peers 129 maintaining backward compatibility. 131 2. Requirements Language 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 135 document are to be interpreted as described in [RFC2119]. 137 3. Protocol Description 139 Compression is accomodated differently in the initial IKEv2 exchange 140 and in subsequent exchanges. The difference comes out from the fact, 141 that the messages of all the IKEv2 exchanges except the initial 142 exchange contain the Encrypted payload. In this case the compression 143 is added as an additional step while constructing the Encrypted 144 payload. The initial IKEv2 exchange requires introduction a new 145 payload, that would contain other payloads in compressed form. 147 3.1. Using Compression in the IKE_SA_INIT Exchange 149 The use of compression is not negotiated in a usual for IKEv2 manner 150 - by exchanging appropriate Notification or Vendor ID payloads. 151 Instead a different negotiation mechanism is used. 153 If an Initiator wants to use compression for the IKE SA being 154 created, it constructs the IKE_SA_INIT request message in a following 155 way. A new payload which is called Compressed payload and described 156 in the Section 4.1 is included into the request message. This 157 payload contains other payloads in compressed form as well as an 158 indication of what compression algorithm is used. When selecting 159 compression algorithm the Initiator must guess what algorithms are 160 supported by the peer and choose an appropriate one. If the guess is 161 wrong the Responder will inform about this fact and the mutually 162 appropriate algorithm will be negotiated by the cost of an extra 163 round trip and a message recompression. The Critical bit in the 164 Compressed payload header MUST be set to 1. 166 Initiator 167 --------- 168 HDR, C!{SA, KE, [N+], [V+]}, Ni, [N+], [V+] --> 170 Not all payloads that are usually present in the IKE_SA_INIT messages 171 are subject for compression. Some payloads contain random or pseudo- 172 random data that is almost uncompressible. Other payloads must be 173 processed as early as possible, before the responder spends resources 174 decompressing them. In particular, the Nonce payloda and the COOKIE 175 notification payload MUST NOT be included into the Compressed 176 payload. Obviously, if the compression algorithm ID is from private 177 range (241-255), then the corresponding Vendor ID payload MUST NOT be 178 included into the Compressed payload either. See Section 5 for more 179 details about interaction compression with other IKEv2 extensions. 181 If the Responder doesn't support IKEv2 compression, then it is 182 expected to return the UNSUPPORTED_CRITICAL_PAYLOAD notification in 183 response to such request message, as prescribed in the Section 2.5 of 184 [RFC7296]. Depending on the implementation it may also return the 185 INVALID_SYNTAX notification or doesn't respond at all. 187 Legacy Responder 188 ---------------- 189 <-- HDR, N(UNSUPPORTED_CRITICAL_PAYLOAD) 191 or 193 <-- HDR, N(INVALID_SYNTAX) 195 or 197 (No response) 199 If the Initiator receives the UNSUPPORTED_CRITICAL_PAYLOAD 200 notification with the Compressed payload type in its notification 201 data or if it receives the INVALID_SYNTAX notification or if it 202 receives no response after several retransmissions then the Initiator 203 MUST restart the IKE_SA_INIT exchange with no compression. 205 If the Responder supports IKEv2 compression, but doesn't support the 206 particular compression algorithm the Initiator has chosen, then the 207 Responder sends back a new error notification: 208 INVALID_COMPRESSION_ALGORITHM. This notification is described in the 209 Section 4.2. Its notification data contains the list of IDs of 210 compression algorithms supported by the Responder. 212 Responder 213 --------- 214 <-- HDR, N(INVALID_COMPRESSION_ALGORITHM) 216 If the Initiator receives the INVALID_COMPRESSION_ALGORITHM 217 notification, then it looks through the list of algorithms included 218 into the notification data and selects the appropriate one. After 219 that it MUST restart the IKE_SA_INIT exchange using the newly 220 selected algorithm for compression. If no mutually appropriate 221 algorithm found, then the Initiator MUST restart the IKE_SA_INIT 222 exchange with no compression. 224 Once the Responder receives the IKE_SA_INIT request with the 225 appropriate compression algorithm in the Compressed payload, the 226 included payloads are decompressed and along with the outer payloads 227 form the uncompressed request message, which is then processed as 228 usual. If the Responder agrees to use compression in the SA being 229 created then the Responder MUST include the Compressed payload in the 230 response message. The compression algorithm indicated in the 231 Compressed payload MUST be the algorithm from the request. 233 Responder 234 --------- 235 <-- HDR, C!{SA, KE, [N+], [V+]}, Nr, [N+], [V+] 237 If for some reason the Responder doesn't want to use compression in 238 the SA being created (e.g. using compression is disabled by 239 administrator) then it MUST send back an uncompressed IKE_SA_INIT 240 response message. In this case the endpoints MUST NOT use 241 compression in subsequent exchanges. 243 3.2. Using Compression in Subsequent Exchanges 245 Once the endpoints have used compression in the IKE_SA_INIT exchange, 246 they may continue to use it in subsequent exchanges. However 247 compression is used differently in these exchanges. Messages of 248 every IKEv2 exchange except for the initial exchange are protected by 249 an Encrypted payload. With compression the rules for forming and 250 processing of an Encrypted payload are modified as follows. 252 The content of an Encrypted payload is compressed before it is 253 encrypted and authenticated. According to the IKEv2 specification 254 the Next Payload field in an Encrypted payload indicates the payload 255 type of the first payload inside the Encrypted payload. If case of 256 using compression, the Next Payload field in the Encrypted payload 257 MUST be set to XXX (TBA by IANA) - the value for the payload type of 258 a Compressed payload. However, the Compressed payload itself MUST 259 NOT appear inside the Encrypted payload, only its payload type is 260 used to indicate that the content of the Encrypted payload was 261 compressed before encryption. 263 Since in this case the Next Payload field in an Encrypted payload no 264 longer indicates a type of the first inner payload, this information 265 is moved to the Next Payload field of the last inner payload (which 266 is set zero in the IKEv2 specification). This modification is done 267 before the payloads are compresed. 269 Uncompressed: SK(Next=P1) {P1(Next=P2), P2(Next=P3), ... Pn(Next=0)} 270 Compressed: SK(Next=C) {P1(Next=P2), P2(Next=P3), ... Pn(Next=P1)} 272 Preparing payloads for compression 274 This modification doesn't cause ambiguity on the receiver, since the 275 total size of the inner payloads can be easily determined after 276 decryption, and while walking through the list of them the receiver 277 always knows whether the current payload is the last or not. 279 After the use of compression is negotiated in the initial exchange 280 each endpoint is free to decide whether to apply compression or not 281 on per-message basis. However, if applying compression to the 282 content of an Encrypted payload doesn't reduce its size then the 283 compression MUST NOT be used for this message. Implementations MUST 284 be prepared to receive both compressed and uncompressed messages. 286 4. Payload Formats 288 4.1. Compressed Payload 290 The Compressed payload, denoted C!{...} in this document (the 291 exclamation mark means that this payload is critical), contains other 292 payloads in compressed form. The payload type for the Compressed 293 payload is XXX (TBA by IANA). 295 1 2 3 296 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 297 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 298 | Next Payload |C| RESERVED | Payload Length | 299 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 300 | First Payload | Algorithm | | 301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + 302 ~ Compressed Payloads ~ 303 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 305 Compressed Payload 307 o Next Payload (1 octet) - Identifier for the payload type of the 308 next payload in the message. 310 o Critical (1 bit) - MUST be set to 1. 312 o RESERVED (7 bits) - MUST be sent as zero; MUST be ignored on 313 receipt (as specified in [RFC7296]). 315 o Payload Length (2 octets, unsigned integer) - Length in octets of 316 the current payload, including the generic payload header. 318 o First Payload (1 octet) - Identifier for the payload type of the 319 first payload contained in Compressed Payloads field. 321 o Algorithm (1 octet) - ID of the algorithm used to compress inner 322 payloads. The possible values for compression algorithm ID are 323 listed in "IKEv2 Notification IPCOMP Transform IDs" registry in 324 [IKEV2-IANA]. 326 o Compressed Payloads (variable length) - This field contains IKEv2 327 payloads in compressed form. The Next Payload field of the last 328 included payload MUST be set to 0. 330 There MUST NOT be more than one Compressed payloads in a message. 331 The Compressed payload MUST NOT appear inside the Encrypted payload 332 and the Encrypted payload payload MUST NOT appear inside the 333 Compressed payload. 335 4.2. INVALID_COMPRESSION_ALGORITHM Notification 337 The INVALID_COMPRESSION_ALGORITHM notification is sent by Responder 338 if the compression algorithm chosen by Initiator is unappropriate. 339 The Notification Data contains the list of supported compression 340 algorithm IDs. 342 1 2 3 343 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 344 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 345 | Next Payload |C| RESERVED | Payload Length | 346 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 347 |Protocol ID(=0)| SPI Size (=0) | Notify Message Type | 348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 349 ~ Supported Compression Algorithms ~ 350 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 352 INVALID_COMPRESSION_ALGORITHM Notification 354 o Protocol ID (1 octet) - MUST be 0. 356 o SPI Size (1 octet) - MUST be 0, meaning no SPI is present. 358 o Notify Message Type (2 octets) - MUST be XXX (TBA by IANA), the 359 value assigned for the INVALID_COMPRESSION_ALGORITHM notification. 361 o Supported Compression Algorithms (variable length) - List of 362 compression algorithm IDs supported by the Responder. Each 363 algorithm ID occupies one octet. The possible values for 364 compression algorithm IDs are listed in "IKEv2 Notification IPCOMP 365 Transform IDs" registry in [IKEV2-IANA]. 367 5. Interaction with other IKEv2 Extensions 369 IKEv2 Compression is compatible with most of the IKEv2 extensions, 370 since It neither affect their operation, nor is affected by them. 371 However, some IKEv2 extensions require special handling. 373 5.1. Interaction with IKEv2 Fragmentation 375 When compression is used with IKEv2 Fragmentation [RFC7383] the 376 compression MUST take place before splitting the original content of 377 the Encrypted payload into chunks. In other words, the content of 378 the Encrypted payload must be compressed as a whole, before it is 379 fragmented. 381 The Compressed payload MUST NOT appear inside the Encrypted Fragment 382 payload and the Encrypted Fragment payload payload MUST NOT appear 383 inside the Compressed payload. 385 5.2. Interaction with IKEv2 Resumption 387 The IKEv2 Session Resumption [RFC5723] defines a mechanism for 388 restoring an IKE SA state after a failure. The newly defined 389 IKE_SESSION_RESUME exchange in conjunction with the usual IKE_AUTH 390 exchange is used to create a new IKE SA that is based on the 391 information contained in the resumption ticket. 393 Implementations supporting compression MUST store the flag whether 394 the compression was negotiated and the negotiated compression 395 algorithm in the resumption ticket and MUST restore these values from 396 the ticket while resuming IKE SA. It means that the use of 397 compression must not be re-negotiated in the IKE_SESSION_RESUME 398 exchange and thus the Compressed payload MUST NOT appear in this 399 exchange. 401 5.3. Interaction with IKEv2 Redirect 403 The IKEv2 Redirect mechanism defined in [RFC5685] allows the 404 responder to redirect the initiator to a different host. The 405 redirect can take place either in the IKE_SA_INIT exchange or later, 406 when IKE SA is already created. 408 All the notifications concerning IKEv2 Redirect that may appear in 409 the IKE_SA_INIT exchange, MUST be placed outside the Compressed 410 payload. This would allow the responder to make a decision whether 411 to redirect the initiator without spending additional recources on 412 decompression. 414 6. Security Considerations 416 It was shown in [COMP-LEAK] that using compression inside an 417 encrypted channel may result in a leakage of some information about a 418 plaintext. Recently some practical exploits were discovered that 419 rely on using compression in security protocols ([CRIME], [BREACH]). 420 However, it is believed that the way a compression is added to the 421 IKEv2 would not weaken the protocol security. The existing exploits 422 rely on an ability for an attacker to insert data into an encrypted 423 stream, i.e. to perform a chosen-plaintext attack. IKEv2 messages 424 don't contain application data, which restricts attacker's ability to 425 perform chosen-plaintext attack. Moreover, the data usually 426 exchanged over the IKE SA contain no secret information and in most 427 cases no sensitive information. The possible exceptions could be 428 some weak Extensible Authentication Protocol (EAP) methods, which 429 might transfer secret information within an IKE SA. It is 430 RECOMMENDED that implementations don't use the IKEv2 Compression for 431 the messages containing the EAP payload if there is a possibility 432 that the EAP method transfers secret information. 434 7. IANA Considerations 436 This document defines new Payload in the "IKEv2 Payload Types" 437 registry: 439 Compressed C 441 This document also defines new Notify Message Types in the "Notify 442 Message Types - Error Types" registry: 444 INVALID_COMPRESSION_ALGORITHM 446 8. References 448 8.1. Normative References 450 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 451 Requirement Levels", BCP 14, RFC 2119, 452 DOI 10.17487/RFC2119, March 1997, 453 . 455 [RFC5685] Devarapalli, V. and K. Weniger, "Redirect Mechanism for 456 the Internet Key Exchange Protocol Version 2 (IKEv2)", 457 RFC 5685, DOI 10.17487/RFC5685, November 2009, 458 . 460 [RFC5723] Sheffer, Y. and H. Tschofenig, "Internet Key Exchange 461 Protocol Version 2 (IKEv2) Session Resumption", RFC 5723, 462 DOI 10.17487/RFC5723, January 2010, 463 . 465 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 466 Kivinen, "Internet Key Exchange Protocol Version 2 467 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 468 2014, . 470 [RFC7383] Smyslov, V., "Internet Key Exchange Protocol Version 2 471 (IKEv2) Message Fragmentation", RFC 7383, 472 DOI 10.17487/RFC7383, November 2014, 473 . 475 [IKEV2-IANA] 476 "Internet Key Exchange Version 2 (IKEv2) Parameters", 477 . 479 8.2. Informative References 481 [IPSEC-IOT-REQS] 482 Migault, D. and T. Guggemos, "Requirements for Diet-ESP 483 the IPsec/ESP protocol for IoT", draft-mglt-6lo-diet-esp- 484 requirements-01 (work in progress), February 2015. 486 [COMP-LEAK] 487 Kelsey, J., "Compression and Information Leakage of 488 Plaintext", . 491 [CRIME] Rizzo, J. and T. Duong, "The CRIME attack", 492 . 495 [BREACH] Prado, A., Harris, N., and Y. Gluck, "SSL, gone in 30 496 seconds: A BREACH beyond CRIME", 497 . 500 Author's Address 502 Valery Smyslov 503 ELVIS-PLUS 504 PO Box 81 505 Moscow (Zelenograd) 124460 506 RU 508 Phone: +7 495 276 0211 509 Email: svan@elvis.ru