idnits 2.17.1 draft-ietf-lwig-minimal-esp-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 24, 2021) is 1126 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-12) exists of draft-mglt-ipsecme-diet-esp-07 == Outdated reference: A later version (-04) exists of draft-mglt-ipsecme-ikev2-diet-esp-extension-01 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Light-Weight Implementation Guidance (lwig) D. Migault 3 Internet-Draft Ericsson 4 Intended status: Informational T. Guggemos 5 Expires: September 25, 2021 LMU Munich 6 March 24, 2021 8 Minimal ESP 9 draft-ietf-lwig-minimal-esp-03 11 Abstract 13 This document describes a minimal implementation of the IP 14 Encapsulation Security Payload (ESP) defined in RFC 4303. Its 15 purpose is to enable implementation of ESP with a minimal set of 16 options to remain compatible with ESP as described in RFC 4303. A 17 minimal version of ESP is not intended to become a replacement of the 18 RFC 4303 ESP. Instead, a minimal implementation is expected to be 19 optimized for constrained environment while remaining interoperable 20 with implementations of RFC 4303 ESP. Constrains include among other 21 limiting the number of flash writes, handling frequent wakeup / sleep 22 states, limiting wakeup time, or reducing the use of random 23 generation. 25 This document describes what is required from RFC 4303 ESP as well as 26 various ways to optimize compliance with RFC 4303 ESP. 28 This document does not update or modify RFC 4303, but provides a 29 compact description of how to implement the minimal version of the 30 protocol. If this document and RFC 4303 conflicts, then RFC 4303 is 31 the authoritative description. 33 Status of This Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at https://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on September 25, 2021. 50 Copyright Notice 52 Copyright (c) 2021 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (https://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Requirements Notation . . . . . . . . . . . . . . . . . . . . 2 68 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 69 3. Security Parameter Index (SPI) (32 bit) . . . . . . . . . . . 4 70 4. Sequence Number(SN) (32 bit) . . . . . . . . . . . . . . . . 6 71 5. Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 72 6. Next Header (8 bit) . . . . . . . . . . . . . . . . . . . . . 9 73 7. ICV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 74 8. Cryptographic Suites . . . . . . . . . . . . . . . . . . . . 10 75 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 76 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 77 11. Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . 12 78 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 79 12.1. Normative References . . . . . . . . . . . . . . . . . . 12 80 12.2. Informative References . . . . . . . . . . . . . . . . . 13 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 83 1. Requirements Notation 85 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 86 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 87 "OPTIONAL" in this document are to be interpreted as described in 88 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 89 capitals, as shown here. 91 2. Introduction 93 ESP [RFC4303] is part of the IPsec protocol suite [RFC4301]. IPsec 94 is used to provide confidentiality, data origin authentication, 95 connectionless integrity, an anti-replay service (a form of partial 96 sequence integrity) and limited traffic flow confidentiality. 98 Figure 1 describes an ESP Packet. Currently ESP is implemented in 99 the kernel of major multipurpose Operating Systems (OS). The ESP and 100 IPsec suite is usually implemented in a complete way to fit multiple 101 purpose usage of these OS. However, completeness of the IPsec suite 102 as well as multipurpose scope of these OS is often performed at the 103 expense of resources, or a lack of performance. As a result, 104 constraint devices are likely to have their own implementation of ESP 105 optimized and adapted to their specificities such as limiting the 106 number of flash writes (for each packet or across wake 107 time), handling frequent wakeup and sleep state, limiting wakeup 108 time, or reducing the use of random generation. With the adoption of 109 IPsec by IoT devices with minimal IKEv2 [RFC7815] and ESP Header 110 Compression (EHC) with [I-D.mglt-ipsecme-diet-esp] or 111 [I-D.mglt-ipsecme-ikev2-diet-esp-extension], it becomes crucial that 112 ESP implementation designed for constraint devices remain inter- 113 operable with the standard ESP implementation to avoid a fragmented 114 usage of ESP. This document describes the minimal properties and ESP 115 implementation needs to meet. 117 For each field of the ESP packet represented in Figure 1 this 118 document provides recommendations and guidance for minimal 119 implementations. The primary purpose of Minimal ESP is to remain 120 interoperable with other nodes implementing RFC 4303 ESP, while 121 limiting the standard complexity of the implementation. 123 0 1 2 3 124 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 125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---- 126 | Security Parameters Index (SPI) | ^Int. 127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 128 | Sequence Number | |ered 129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ---- 130 | Payload Data* (variable) | | ^ 131 ~ ~ | | 132 | | |Conf. 133 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 134 | | Padding (0-255 bytes) | |ered* 135 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 136 | | Pad Length | Next Header | v v 137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ------ 138 | Integrity Check Value-ICV (variable) | 139 ~ ~ 140 | | 141 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 143 Figure 1: ESP Packet Description 145 3. Security Parameter Index (SPI) (32 bit) 147 According to the [RFC4303], the SPI is a mandatory 32 bits field and 148 is not allowed to be removed. 150 The SPI has a local significance to index the Security Association 151 (SA). From [RFC4301] section 4.1, nodes supporting only unicast 152 communications can index their SA only using the SPI. On the other 153 hand, nodes supporting multicast communications must also use the IP 154 addresses and thus SA lookup needs to be performed using the longest 155 match. 157 For nodes supporting only unicast communications, it is RECOMMENDED 158 to index SA with the SPI only. The index MAY be based on the full 32 159 bits of SPI or a subset of these bits. Some other local constraints 160 on the node may require a combination of the SPI as well as other 161 parameters to index the SA. 163 Values 0-255 MUST NOT be used. As per section 2.1 of [RFC4303], 164 values 1-255 are reserved and 0 is only allowed to be used internal 165 and it MUST NOT be sent on the wire. 167 It is RECOMMENDED to index each inbound session with a SPI randomly 168 generate over 32 bits. Upon the generation of a SPI the peer checks 169 the SPI is not already used and does not fall in the 0-255 range. If 170 the SPI has an acceptable value, it is used to index the inbound 171 session, otherwise the SPI is re-generated until an acceptable value 172 is found. A random generation provides a stateless way to generate 173 the SPIs, while keeping the probability of collision between SPIs 174 relatively low. 176 However, for some constrained nodes, generating and handling 32 bit 177 random SPI may consume too much resource, in which case SPI can be 178 generated using predictable functions or end up in a using a subset 179 of the possible values for SPI. In fact, the SPI does not 180 necessarily need to be randomly generated. A node provisioned with 181 keys by a third party - e.g. that does not generate them - and that 182 uses a transform that does not needs random data may not have such 183 random generators. However, nonrandom SPI and restricting their 184 possible values MAY lead to privacy and security concerns. As a 185 result, this alternative should be considered for devices that would 186 be strongly impacted by the generation of a random SPI and after 187 understanding the privacy and security impact of generating nonrandom 188 SPI. 190 When a constrained node limits the number of possible SPIs this limit 191 should both consider the number of inbound SAs - possibly per IP 192 addresses - as well as the ability for the node to rekey. SPI can 193 typically be used to proceed to clean key update and the SPI value 194 may be used to indicate which key is being used. This can typically 195 be implemented by a SPI being encoded with the Security Association 196 Database (SAD) entry on a subset of bytes (for example 3 bytes), 197 while the remaining byte is left to indicate the rekey index. 199 Note that SPI value is used only for inbound traffic, as such the SPI 200 negotiated with IKEv2 [RFC7296] or [RFC7815] by a peer, is the value 201 used by the remote peer when its sends traffic. As SPI are only used 202 for inbound traffic by the peer, this allows each peer to manage the 203 set of SPIs used for its inbound traffic. 205 The use of a limited number of SPIs or nonrandom SPIs come with 206 security or privacy drawbacks. Typically, a passive attacker may 207 derive information such as the number of constraint devices 208 connecting the remote peer, and in conjunction with data rate, the 209 attacker may eventually determine the application the constraint 210 device is associated to. If the SPIs are set by a manufacturer or by 211 some software application, the SPI may leak in an obvious way the 212 type of sensor, the application involved or the model of the 213 constraint device. When identification of the application or the 214 hardware is associated to privacy, the SPI MUST be randomly 215 generated. However, one needs to realize that in this case this is 216 likely not to be sufficient and a thorough privacy analysis is 217 required. More specifically, traffic pattern may also leak 218 significant privacy sensitive information. In other words, privacy 219 leakage is a complex and the use of random SPI is unlikely to be 220 sufficient. 222 As the general recommendation is to randomly generate the SPI, 223 constraint devices that will use a (very) limited number of SPIs are 224 expected to be very constraint devices with very limited 225 capabilities, where the use of randomly generated SPI may prevent 226 them to implement IPsec. In this case the ability to provision 227 nonrandom SPI enables these devices to secure their communications. 228 For example, the SPI could be -at least partially - generated based 229 on the SAD structure in memory which would simplify the 230 implementation. These devices, due to their limitations, are 231 expected to provide limited information and how the use of nonrandom 232 SPI impacts privacy requires further analysis. Typically, 233 temperature sensors, wind sensors, used outdoor do not leak privacy 234 sensitive information. When used indoor, a sensor that reports every 235 minute an encrypted status of the door (closed or opened) leaks truly 236 little privacy sensitive information outside the local network. 238 As far as security is concerned, revealing the type of application or 239 model of the constraint device could be used to identify the 240 vulnerabilities the constraint device is subject to. This is 241 especially sensitive for constraint devices where patches or software 242 updates will be challenging to operate. As a result, these devices 243 may remain vulnerable for relatively long period. In addition, 244 predictable SPIs enable an attacker to forge packets with a valid 245 SPI. Such packet will not be rejected due to an SPI mismatch, but 246 instead after the signature check which requires more resource and 247 thus make DoS more efficient, especially for devices powered by 248 batteries. 250 4. Sequence Number(SN) (32 bit) 252 According to [RFC4303], the Sequence Number (SN) is a mandatory 32 253 bits field in the packet. 255 The SN is set by the sender so the receiver can implement anti-replay 256 protection. The SN is derived from any strictly increasing function 257 that guarantees: if packet B is sent after packet A, then SN of 258 packet B is strictly greater than the SN of packet A. 260 Some constraint devices may establish communication with specific 261 devices, like a specific gateway, or nodes similar to them. As a 262 result, the sender may know whereas the receiver implements anti- 263 replay protection or not. Even though the sender may know the 264 receiver does not implement anti-replay protection, the sender MUST 265 implement an always increasing function to generate the SN. 267 Usually, SN is generated by incrementing a counter for each packet 268 sent. A constraint device may avoid maintaining this context and use 269 another source that is known to always increase. Typically, 270 constraint nodes using 802.15.4 Time Slotted Channel Hopping (TSCH), 271 whose communication is heavily dependent on time, can take advantage 272 of their clock to generate the SN. The problem with regular sequence 273 numbers is that you need to store them to stable storage every time 274 you go sleep. Storing the SA information (keys, SPIs etc) to the 275 flash once after the creation of the SA can be done, as that is just 276 one flash write per SA creation. Synchronizing sequence number to 277 flash after every packet would quickly wear out the flash, and likely 278 slow down the system greatly, as writing to flash is not as fast as 279 reading. Note, that lots of these IoT devices are in a sleep state 280 most of the time wake up and are only awake to perform a specific 281 operation before going back to sleep. They do have separate hardware 282 that allows them to wake up after certain timeout, and most likely 283 also timers that start running when the device was booted up, so they 284 might have concept of time with certain granularity. They might not 285 have real time clocks or any information how their internal clock 286 relates to real world clock, and their internal clocks/timers might 287 not be very accurate, but they should be enough to know that each 288 time they wake up their time is greater than what it was last time 289 they woke up. Using time for SN would guarantee a strictly 290 increasing function and avoid storing any additional values or 291 context related to the SN. When the use of a clock is considered, 292 one should take care that packets associated to a given SA are not 293 sent with the same time value. Note however that standard receivers 294 are generally configured with incrementing counters and, if not 295 appropriately configured, the use of a significantly larger SN may 296 result in the packet out of the receiver's windows and that packet 297 being discarded. 299 For inbound traffic, it is RECOMMENDED that any receiver provide a 300 anti-replay protection, and the size of the window depends on the 301 ability of the network to deliver packet out of order. As a result, 302 in environment where out of order packets is not possible the window 303 size can be set to one. However, while RECOMMENDED, there is no 304 requirements to implement an anti-replay protection mechanism 305 implemented by IPsec. If an IoT device such as a temperature sensor 306 is sending a temperature every 60 seconds, the implementation of an 307 anti-replay mechanism requires the sensor to receive an 308 acknowledgment for the receiver as well as storing an additional 309 value across sleep time. Such design is likely to be non optimal in 310 term of limiting the number of read/write on a flash card as well as 311 limiting the time the sensor needs to be awake. On the other hand, 312 the impact provided by an anti-replay mechanisms implemented on the 313 sensor is very limited and unlikely to change the way of working of 314 the sensor. A node MAY drop anti-replay protection provided by 315 IPsec, and instead implement its own internal mechanism. 317 SN can be encoded over 32 bits or 64 bits - known as Extended 318 Sequence Number (ESN). As per [RFC4303], the support ESN is not 319 mandatory. The determination of the use of ESN is based on the 320 largest possible value a SN can take over a session. When SN is 321 incremented for each packet, the number of packets sent over the 322 lifetime of a session may be considered. However, when the SN is 323 incremented differently - such as when time is used - the maximum 324 value SN needs to be considered instead. Note that the limit of 325 messages being sent is primary determined by the security associated 326 to the key rather than the SN. The security of all data protected 327 under a given key decreases slightly with each message and a node 328 MUST ensure the limit is not reached - even though the SN would 329 permit it. In a constrained environment, it is likely that the 330 implementation of a rekey mechanism is preferred over the use of ESN. 332 5. Padding 334 The purpose of padding is to respect the 32 bit alignment of ESP or 335 block size expected by an encryption transform - such as AES-CBC for 336 example. ESP MUST have at least one padding byte Pad Length that 337 indicates the padding length. ESP padding bytes are generated by a 338 succession of unsigned bytes starting with 1, 2, 3 with the last byte 339 set to Pad Length, where Pad Length designates the length of the 340 padding bytes. 342 Checking the padding structure is not mandatory, so the constraint 343 device may not proceed to such checks, however, in order to 344 interoperate with existing ESP implementations, it MUST build the 345 padding bytes as recommended by ESP. 347 In some situation the padding bytes may take a fix value. This would 348 typically be the case when the Data Payload is of fix size. 350 ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a 351 way to perform padding to hide traffic characteristics, which differs 352 from respecting a 32 bit alignment. TFC is not mandatory and MUST be 353 negotiated with the SA management protocol. TFC has not yet being 354 widely adopted for standard ESP traffic. One possible reason is that 355 it requires to shape the traffic according to one traffic pattern 356 that needs to be maintained. This is likely to require extra 357 processing as well as providing a "well recognized" traffic shape 358 which could end up being counterproductive. As such TFC is not 359 expected to be supported by a minimal ESP implementation. 361 As a result, TFC cannot be enabled with minimal ESP, and 362 communication protection that were rely on TFC will be more sensitive 363 to traffic shaping. This could expose the application as well as the 364 devices used to a passive monitoring attacker. Such information 365 could be used by the attacker in case a vulnerability is disclosed on 366 the specific device. In addition, some application use - such as 367 health applications - may also reveal important privacy oriented 368 information. 370 Some constrained nodes that have limited battery lifetime may also 371 prefer avoiding sending extra padding bytes. However, the same nodes 372 may also be very specific to an application and device. As a result, 373 they are also likely to be the main target for traffic shaping. In 374 most cases, the payload carried by these nodes is quite small, and 375 the standard padding mechanism may also be used as an alternative to 376 TFC, with a sufficient tradeoff between the require energy to send 377 additional payload and the exposure to traffic shaping attacks. In 378 addition, the information leaked by the traffic shaping may also be 379 addressed by the application level. For example, it is preferred to 380 have a sensor sending some information at regular time interval, 381 rather when a specific event is happening. Typically, a sensor 382 monitoring the temperature, or a door is expected to send regularly 383 the information - i.e. the temperature of the room or whether the 384 door is closed or open) instead of only sending the information when 385 the temperature has raised or when the door is being opened. 387 6. Next Header (8 bit) 389 According to [RFC4303], the Next Header is a mandatory 8 bits field 390 in the packet. Next header is intended to specify the data contained 391 in the payload as well as dummy packet, i.e. packets with the Next 392 Header with a value 59 meaning "no next header". In addition, the 393 Next Header may also carry an indication on how to process the packet 394 [I-D.nikander-esp-beet-mode]. 396 The ability to generate and receive dummy packet is required by 397 [RFC4303]. For interoperability, a minimal ESP implementation MUST 398 discard dummy packets. Note that such recommendation only applies 399 for nodes receiving packets, and that nodes designed to only send 400 data may not implement this capability. 402 As the generation of dummy packets is subject to local management and 403 based on a per-SA basis, a minimal ESP implementation may not 404 generate such dummy packet. More especially, in constraint 405 environment sending dummy packets may have too much impact on the 406 device lifetime, and so may be avoided. On the other hand, 407 constrained nodes may be dedicated to specific applications, in which 408 case, traffic pattern may expose the application or the type of node. 409 For these nodes, not sending dummy packet may have some privacy 410 implication that needs to be measured. However, for the same reasons 411 exposed in Section 5 traffic shaping at the IPsec layer may also 412 introduce some traffic pattern, and on constraint devices the 413 application is probably the most appropriated layer to limit the risk 414 of leaking information by traffic shaping. 416 In some cases, devices are dedicated to a single application or a 417 single transport protocol, in which case, the Next Header has a fix 418 value. 420 Specific processing indications have not been standardized yet 421 [I-D.nikander-esp-beet-mode] and is expected to result from an 422 agreement between the peers. As a result, it is not expected to be 423 part of a minimal implementation of ESP. 425 7. ICV 427 The ICV depends on the cryptographic suite used. Currently [RFC8221] 428 only recommends cryptographic suites with an ICV which makes the ICV 429 a mandatory field. 431 As detailed in Section 8 we recommend using authentication, the ICV 432 field is expected to be present that is to say with a size different 433 from zero. This makes it a mandatory field which size is defined by 434 the security recommendations only. 436 8. Cryptographic Suites 438 The cryptographic suites implemented are an important component of 439 ESP. The recommended algorithms to use are expected to evolve over 440 time and implementers SHOULD follow the recommendations provided by 441 [RFC8221] and updates. Recommendations are provided for standard 442 nodes as well as constrained nodes. 444 This section lists some of the criteria that may be considered. The 445 list is not expected to be exhaustive and may also evolve overtime. 446 As a result, the list is provided as indicative: 448 1. Security: Security is the criteria that should be considered 449 first for the selection of encryption algorithm transform. The 450 security of encryption algorithm transforms is expected to evolve 451 over time, and it is of primary importance to follow up-to-date 452 security guidance and recommendations. The chosen encryption 453 algorithm transforms MUST NOT be known vulnerable or weak (see 454 [RFC8221] for outdated ciphers). ESP can be used to authenticate 455 only or to encrypt the communication. In the latter case, 456 authenticated encryption must always be considered [RFC8221]. 458 2. Resilience to nonce re-use: Some transforms -including AES-GCM - 459 are very sensitive to nonce collision with a given key. While 460 the generation of the nonce may prevent such collision during a 461 session, the mechanisms are unlikely to provide such protection 462 across reboot. This causes an issue for devices that are 463 configured with a key. When the key is likely to be re-used 464 across reboots, it is RECOMMENDED to consider transforms that are 465 nonce misuse resistant such as AES-GCM-SIV for example[RFC8452] 467 3. Interoperability: Interoperability considers the encryption 468 algorithm transforms shared with the other nodes. Note that it 469 is not because an encryption algorithm transform is widely 470 deployed that it is secured. As a result, security SHOULD NOT be 471 weakened for interoperability. [RFC8221] and successors consider 472 the life cycle of encryption algorithm transforms sufficiently 473 long to provide interoperability. Constraint devices may have 474 limited interoperability requirements which makes possible to 475 reduces the number of encryption algorithm transforms to 476 implement. 478 4. Power Consumption and Cipher Suite Complexity: Complexity of the 479 encryption algorithm transform or the energy associated to it are 480 especially considered when devices have limited resources or are 481 using some batteries, in which case the battery determines the 482 life of the device. The choice of a cryptographic function may 483 consider re-using specific libraries or to take advantage of 484 hardware acceleration provided by the device. For example, if 485 the device benefits from AES hardware modules and uses AES-CTR, 486 it may prefer AUTH_AES-XCBC for its authentication. In addition, 487 some devices may also embed radio modules with hardware 488 acceleration for AES-CCM, in which case, this mode may be 489 preferred. 491 5. Power Consumption and Bandwidth Consumption: Similarly to the 492 encryption algorithm transform complexity, reducing the payload 493 sent, may significantly reduce the energy consumption of the 494 device. As a result, encryption algorithm transforms with low 495 overhead may be considered. To reduce the overall payload size 496 one may, for example: 498 1. Use of counter-based ciphers without fixed block length (e.g. 499 AES-CTR, or ChaCha20-Poly1305). 501 2. Use of ciphers with capability of using implicit IVs 502 [RFC8750]. 504 3. Use of ciphers recommended for IoT [RFC8221]. 506 4. Avoid Padding by sending payload data which are aligned to 507 the cipher block length - 2 for the ESP trailer. 509 9. IANA Considerations 511 There are no IANA consideration for this document. 513 10. Security Considerations 515 Security considerations are those of [RFC4303]. In addition, this 516 document provided security recommendations and guidance over the 517 implementation choices for each field. 519 The security of a communication provided by ESP is closely related to 520 the security associated to the management of that key. This usually 521 include mechanisms to prevent a nonce to repeat for example. When a 522 node is provisioned with a session key that is used across reboot, 523 the implementer MUST ensure that the mechanisms put in place remain 524 valid across reboot as well. 526 It is RECOMMENDED to use ESP in conjunction of key management 527 protocols such as for example IKEv2 [RFC7296] or minimal IKEv2 528 [RFC7815]. Such mechanisms are responsible to negotiate fresh 529 session keys as well as prevent a session key being use beyond its 530 lifetime. When such mechanisms cannot be implemented and the session 531 key is, for example, provisioned, the nodes MUST ensure that keys are 532 not used beyond their lifetime and that the appropriated use of the 533 key remains across reboots - e.g. conditions on counters and nonces 534 remains valid. 536 When a node generates its key or when random value such as nonces are 537 generated, the random generation MUST follow [RFC4086]. In addition 538 [SP-800-90A-Rev-1] provides appropriated guidance to build random 539 generators based on deterministic random functions. 541 11. Acknowledgment 543 The authors would like to thank Daniel Palomares, Scott Fluhrer, Tero 544 Kivinen, Valery Smyslov, Yoav Nir, Michael Richardson for their 545 valuable comments. In particular Scott Fluhrer suggested to include 546 the rekey index in the SPI as well as the use of transform resilient 547 to nonce misuse. Tero Kivinen provided also multiple clarifications 548 and examples of deployment ESP within constrained devices with their 549 associated optimizations. 551 12. References 553 12.1. Normative References 555 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 556 Requirement Levels", BCP 14, RFC 2119, 557 DOI 10.17487/RFC2119, March 1997, 558 . 560 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 561 "Randomness Requirements for Security", BCP 106, RFC 4086, 562 DOI 10.17487/RFC4086, June 2005, 563 . 565 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 566 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 567 December 2005, . 569 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 570 RFC 4303, DOI 10.17487/RFC4303, December 2005, 571 . 573 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 574 Kivinen, "Internet Key Exchange Protocol Version 2 575 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 576 2014, . 578 [RFC7815] Kivinen, T., "Minimal Internet Key Exchange Version 2 579 (IKEv2) Initiator Implementation", RFC 7815, 580 DOI 10.17487/RFC7815, March 2016, 581 . 583 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 584 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 585 May 2017, . 587 [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. 588 Kivinen, "Cryptographic Algorithm Implementation 589 Requirements and Usage Guidance for Encapsulating Security 590 Payload (ESP) and Authentication Header (AH)", RFC 8221, 591 DOI 10.17487/RFC8221, October 2017, 592 . 594 [RFC8750] Migault, D., Guggemos, T., and Y. Nir, "Implicit 595 Initialization Vector (IV) for Counter-Based Ciphers in 596 Encapsulating Security Payload (ESP)", RFC 8750, 597 DOI 10.17487/RFC8750, March 2020, 598 . 600 12.2. Informative References 602 [I-D.mglt-ipsecme-diet-esp] 603 Migault, D., Guggemos, T., Bormann, C., and D. Schinazi, 604 "ESP Header Compression and Diet-ESP", draft-mglt-ipsecme- 605 diet-esp-07 (work in progress), March 2019. 607 [I-D.mglt-ipsecme-ikev2-diet-esp-extension] 608 Migault, D., Guggemos, T., and D. Schinazi, "Internet Key 609 Exchange version 2 (IKEv2) extension for the ESP Header 610 Compression (EHC) Strategy", draft-mglt-ipsecme-ikev2- 611 diet-esp-extension-01 (work in progress), June 2018. 613 [I-D.nikander-esp-beet-mode] 614 Nikander, P. and J. Melen, "A Bound End-to-End Tunnel 615 (BEET) mode for ESP", draft-nikander-esp-beet-mode-09 616 (work in progress), August 2008. 618 [RFC8452] Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV: 619 Nonce Misuse-Resistant Authenticated Encryption", 620 RFC 8452, DOI 10.17487/RFC8452, April 2019, 621 . 623 [SP-800-90A-Rev-1] 624 Elain, E. and J. Kelsey, "Recommendation for Random Number 625 Generation Using Deterministic Random Bit Generators", 626 . 629 Authors' Addresses 631 Daniel Migault 632 Ericsson 633 8400 boulevard Decarie 634 Montreal, QC H4P 2N2 635 Canada 637 EMail: daniel.migault@ericsson.com 639 Tobias Guggemos 640 LMU Munich 641 MNM-Team 642 Oettingenstr. 67 643 80538 Munich, Bavaria 644 Germany 646 EMail: guggemos@mnm-team.org