idnits 2.17.1 draft-ietf-lwig-minimal-esp-05.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 (April 13, 2021) is 1103 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: October 15, 2021 LMU Munich 6 April 13, 2021 8 Minimal ESP 9 draft-ietf-lwig-minimal-esp-05 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. Some constrains include 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 does not update or modify RFC 4303, but provides a 26 compact description of how to implement the minimal version of the 27 protocol. RFC 4303 remains the authoritative description. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at https://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on October 15, 2021. 46 Copyright Notice 48 Copyright (c) 2021 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (https://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Requirements Notation . . . . . . . . . . . . . . . . . . . . 2 64 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 65 3. Security Parameter Index (SPI) (32 bit) . . . . . . . . . . . 4 66 3.1. Considerations over SPI generation . . . . . . . . . . . 5 67 4. Sequence Number(SN) (32 bit) . . . . . . . . . . . . . . . . 6 68 5. Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 69 6. Next Header (8 bit) . . . . . . . . . . . . . . . . . . . . . 9 70 7. ICV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 71 8. Cryptographic Suites . . . . . . . . . . . . . . . . . . . . 10 72 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12 73 10. Security Considerations . . . . . . . . . . . . . . . . . . . 12 74 11. Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . 12 75 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 76 12.1. Normative References . . . . . . . . . . . . . . . . . . 13 77 12.2. Informative References . . . . . . . . . . . . . . . . . 14 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 80 1. Requirements Notation 82 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 83 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 84 "OPTIONAL" in this document are to be interpreted as described in 85 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 86 capitals, as shown here. 88 2. Introduction 90 ESP [RFC4303] is part of the IPsec protocol suite [RFC4301]. IPsec 91 is used to provide confidentiality, data origin authentication, 92 connectionless integrity, an anti-replay service (a form of partial 93 sequence integrity) and limited traffic flow confidentiality. 95 Figure 1 describes an ESP Packet. Currently ESP is implemented in 96 the kernel of major multipurpose Operating Systems (OS). The ESP and 97 IPsec suite is usually implemented in a complete way to fit multiple 98 purpose usage of these OS. However, completeness of the IPsec suite 99 as well as multipurpose scope of these OS is often performed at the 100 expense of resources, or performance. As a result, constrained 101 devices are likely to have their own implementation of ESP optimized 102 and adapted to their specificities such as limiting the number of 103 flash writes (for each packet or across wake time), handling frequent 104 wakeup and sleep state, limiting wakeup time, or reducing the use of 105 random generation. With the adoption of IPsec by IoT devices with 106 minimal IKEv2 [RFC7815] and ESP Header Compression (EHC) with 107 [I-D.mglt-ipsecme-diet-esp] or 108 [I-D.mglt-ipsecme-ikev2-diet-esp-extension], it becomes crucial that 109 ESP implementation designed for constrained devices remains inter- 110 operable with the standard ESP implementation to avoid a fragmented 111 usage of ESP. This document describes the minimal properties an ESP 112 implementation needs to meet to remain interoperable with [RFC4303] 113 ESP. In addition, this document also provides a set of options to 114 implement these properties under certain constrained environments. 115 This document does not update or modify RFC 4303, but provides a 116 compact description of how to implement the minimal version of the 117 protocol. RFC 4303 remains the authoritative description. 119 For each field of the ESP packet represented in Figure 1 this 120 document provides recommendations and guidance for minimal 121 implementations. The primary purpose of Minimal ESP is to remain 122 interoperable with other nodes implementing RFC 4303 ESP, while 123 limiting the standard complexity of the implementation. 125 0 1 2 3 126 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 127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---- 128 | Security Parameters Index (SPI) | ^Int. 129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 130 | Sequence Number | |ered 131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ---- 132 | Payload Data* (variable) | | ^ 133 ~ ~ | | 134 | | |Conf. 135 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- 136 | | Padding (0-255 bytes) | |ered* 137 +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | 138 | | Pad Length | Next Header | v v 139 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ------ 140 | Integrity Check Value-ICV (variable) | 141 ~ ~ 142 | | 143 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 145 Figure 1: ESP Packet Description 147 3. Security Parameter Index (SPI) (32 bit) 149 According to the [RFC4303], the SPI is a mandatory 32 bits field and 150 is not allowed to be removed. 152 The SPI has a local significance to index the Security Association 153 (SA). From [RFC4301] section 4.1, nodes supporting only unicast 154 communications can index their SA only using the SPI. On the other 155 hand, nodes supporting multicast communications must also use the IP 156 addresses and thus SA lookup needs to be performed using the longest 157 match. 159 For nodes supporting only unicast communications, it is RECOMMENDED 160 to index SA with the SPI only. The index MAY be based on the full 32 161 bits of SPI or a subset of these bits. Some other local constraints 162 on the node may require a combination of the SPI as well as other 163 parameters to index the SA. 165 Values 0-255 MUST NOT be used. As per section 2.1 of [RFC4303], 166 values 1-255 are reserved and 0 is only allowed to be used internal 167 and it MUST NOT be sent on the wire. 169 [RFC4303] does not require the SPI to be randomly generated over 32 170 bits. However, this is the RECOMMENDED way to generate SPIs as it 171 provides some privacy benefits and avoids, for example, correlation 172 between ESP communications. To randomly generate a 32 bit SPI, the 173 node generates a random 32 bit value, checks does not fall in the 174 0-255 range. If the SPI has an acceptable value, it is used to index 175 the inbound session, otherwise the SPI is re-generated until an 176 acceptable value is found. 178 However, some constrained nodes may be less concerned by the privacy 179 properties associated to SPIs randomly generated. Examples of such 180 nodes might include sensors looking to reduce their code complexity, 181 in which case the use of a predictive function to generate the SPI 182 might be preferred over the generation and handling of random values. 183 An example of such predictable function may consider the combination 184 of a fixed value and the memory address of the SAD structure. For 185 every incoming packet, the node will be able to point the SAD 186 structure directly from the SPI value. This avoids having a separate 187 and additional binding between SPI and SAD entries that is involved 188 for every incoming packet. 190 3.1. Considerations over SPI generation 192 SPI that are not randomly generated over 32 bits MAY lead to privacy 193 and security concerns. As a result, the use of alternative designs 194 requires careful security and privacy reviews. This section provides 195 some considerations upon the adoption of alternative designs. 197 Note that SPI value is used only for inbound traffic, as such the SPI 198 negotiated with IKEv2 [RFC7296] or [RFC7815] by a peer, is the value 199 used by the remote peer when it sends traffic. As SPI is only used 200 for inbound traffic by the peer, this allows each peer to manage the 201 set of SPIs used for its inbound traffic. Similarly, the privacy 202 concerns associated with the generation of nonrandom SPI is also 203 limited to the incoming traffic. 205 When alternate designs are considered, it is likely that the number 206 of possible SPIs will be limited. This limit should both consider 207 the number of inbound SAs - possibly per IP addresses - as well as 208 the ability for the node to rekey. SPI can typically be used to 209 proceed to clean key update and the SPI value may be used to indicate 210 which key is being used. This can typically be implemented by a SPI 211 being encoded with the Security Association Database (SAD) entry on a 212 subset of bytes (for example 3 bytes), while the remaining byte is 213 left to indicate the rekey index. 215 The use of a smaller number of SPIs across communications comes with 216 privacy and security concerns. Typically some specific values or 217 subset of SPI values may reveal the models or manufacturer of the 218 node implementing ESP. This may raise some privacy issues as an 219 observer is likely to be able to determine the constrained devices of 220 the network. In some cases, these nodes may host a very limited 221 number of applications - typically a single application - in which 222 case the SPI would provide some information related to the 223 application of the user. In addition, the device or application may 224 be associated with some vulnerabilities, in which case specific SPI 225 values may be used by an attacker to discover vulnerabilities. 227 While the use of randomly generated SPI may reduce the leakage or 228 privacy or security related information by ESP itself, these 229 information may also be leaked otherwise and a privacy analysis 230 should consider at least the type of information as well the traffic 231 pattern. Typically, temperature sensors, wind sensors, used outdoors 232 do not leak privacy sensitive information and mosty of its traffic is 233 expected to be outbound traffic. When used indoors, a sensor that 234 reports every minute an encrypted status of the door (closed or 235 opened) leaks truly little privacy sensitive information outside the 236 local network. 238 4. Sequence Number(SN) (32 bit) 240 According to [RFC4303], the Sequence Number (SN) is a mandatory 32 241 bits field in the packet. 243 The SN is set by the sender so the receiver can implement anti-replay 244 protection. The SN is derived from any strictly increasing function 245 that guarantees: if packet B is sent after packet A, then SN of 246 packet B is strictly greater than the SN of packet A. 248 Some constrained devices may establish communication with specific 249 devices, like a specific gateway, or nodes similar to them. As a 250 result, the sender may know whereas the receiver implements anti- 251 replay protection or not. Even though the sender may know the 252 receiver does not implement anti-replay protection, the sender MUST 253 implement an always increasing function to generate the SN. 255 Usually, SN is generated by incrementing a counter for each packet 256 sent. A constrained device may avoid maintaining this context and 257 use another source that is known to always increase. Typically, 258 constrained nodes using 802.15.4 Time Slotted Channel Hopping (TSCH), 259 whose communication is heavily dependent on time, can take advantage 260 of their clock to generate the SN. A lot of IoT devices are in a 261 sleep state most of the time wake up and are only awake to perform a 262 specific operation before going back to sleep. They do have separate 263 hardware that allows them to wake up after a certain timeout, and 264 most likely also timers that start running when the device was booted 265 up, so they might have a concept of time with certain granularity. 266 This requires to store any information in a stable storage - such as 267 flash memory - that can be restored across sleeps. Storing 268 information associated with the SA such as SN requires some read and 269 writing operation on a stable storage after each packet is sent as 270 opposed to SPI or keys that are only written at the creation of the 271 SA. Such operations are likely to wear out the flash, and slow down 272 the system greatly, as writing to flash is not as fast as reading. 273 Their internal clocks/timers might not be very accurate, but they 274 should be enough to know that each time they wake up their time is 275 greater than what it was last time they woke up. Using time for SN 276 would guarantee a strictly increasing function and avoid storing any 277 additional values or context related to the SN. When the use of a 278 clock is considered, one should take care that packets associated 279 with a given SA are not sent with the same time value. Note however 280 that standard receivers are generally configured with incrementing 281 counters and, if not appropriately configured, the use of a 282 significantly larger SN may result in the packet out of the 283 receiver's windows and that packet being discarded. 285 For inbound traffic, it is RECOMMENDED that any receiver provides 286 anti-replay protection, and the size of the window depends on the 287 ability of the network to deliver packets out of order. As a result, 288 in an environment where out of order packets is not possible the 289 window size can be set to one. However, while RECOMMENDED, there are 290 no requirements to implement an anti-replay protection mechanism 291 implemented by IPsec. Similarly to the SN the implementation of anti 292 replay protection may require the device to write the received SN for 293 every packet, which may in some cases come with the same drawbacks as 294 those exposed for SN. As a result, some implementations MAY drop an 295 non required anti replay protection especially when the necessary 296 resource involved overcomes the benefit of the mechanism. A typical 297 example might consider an IoT device such as a temperature sensor 298 that is sending a temperature every 60 seconds, and that receives an 299 acknowledgment from the receiver. In such cases, the ability to 300 spoof and replay an acknowledgement is of limited interest and may 301 not justify the implementation of an anti replay mechanism. 302 Receiving peers may also implement their own anti-replay mechanism. 303 Typically, when the sending peer is using SN based on time, anti- 304 replay may be implemented by discarding any packets that present a SN 305 whose value is too much in the past. Note that such mechanisms may 306 consider clock drifting in various ways in addition to acceptable 307 delay induced by the network to avoid the anti replay windows 308 rejecting legitimate packets. When a packet is received at a regular 309 time interval, some variant of time based mechanisms may not even use 310 the value of the SN, but instead only consider the receiving time of 311 the packet. 313 SN can be encoded over 32 bits or 64 bits - known as Extended 314 Sequence Number (ESN). As per [RFC4303], the support ESN is not 315 mandatory. The determination of the use of ESN is based on the 316 largest possible value a SN can take over a session. When SN is 317 incremented for each packet, the number of packets sent over the 318 lifetime of a session may be considered. However, when the SN is 319 incremented differently - such as when time is used - the maximum 320 value SN needs to be considered instead. Note that the limit of 321 messages being sent is primarily determined by the security 322 associated with the key rather than the SN. The security of all data 323 protected under a given key decreases slightly with each message and 324 a node MUST ensure the limit is not reached - even though the SN 325 would permit it. Estimation of the maximum number of packets to be 326 sent by a node is always challenging and as such should be considered 327 cautiously as nodes could be online for much more time than expected. 328 Even for constrained devices, it is RECOMMENDED to implement some 329 rekey mechanisms (see Section 10). 331 5. Padding 333 The purpose of padding is to respect the 32 bit alignment of ESP or 334 block size expected by an encryption transform - such as AES-CBC for 335 example. ESP MUST have at least one padding byte Pad Length that 336 indicates the padding length. ESP padding bytes are generated by a 337 succession of unsigned bytes starting with 1, 2, 3 with the last byte 338 set to Pad Length, where Pad Length designates the length of the 339 padding bytes. 341 Checking the padding structure is not mandatory, so the constrained 342 device may not proceed to such checks, however, in order to 343 interoperate with existing ESP implementations, it MUST build the 344 padding bytes as recommended by ESP. 346 In some situation the padding bytes may take a fix value. This would 347 typically be the case when the Data Payload is of fix size. 349 ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a 350 way to perform padding to hide traffic characteristics, which differs 351 from respecting a 32 bit alignment. TFC is not mandatory and MUST be 352 negotiated with the SA management protocol. TFC has not yet being 353 widely adopted for standard ESP traffic. One possible reason is that 354 it requires to shape the traffic according to one traffic pattern 355 that needs to be maintained. This is likely to require extra 356 processing as well as providing a "well recognized" traffic shape 357 which could end up being counterproductive. As such, it is NOT 358 RECOMMENDED that minimal ESP implementation supports TFC. 360 As a result, TFC cannot be enabled with minimal ESP, and 361 communication protection that were rely on TFC will be more sensitive 362 to traffic shaping. This could expose the application as well as the 363 devices used to a passive monitoring attacker. Such information 364 could be used by the attacker in case a vulnerability is disclosed on 365 the specific device. In addition, some application use - such as 366 health applications - may also reveal important privacy oriented 367 information. 369 Some constrained nodes that have limited battery lifetime may also 370 prefer avoiding sending extra padding bytes. However, the same nodes 371 may also be very specific to an application and device. As a result, 372 they are also likely to be the main target for traffic shaping. In 373 most cases, the payload carried by these nodes is quite small, and 374 the standard padding mechanism may also be used as an alternative to 375 TFC, with a sufficient tradeoff between the require energy to send 376 additional payload and the exposure to traffic shaping attacks. In 377 addition, the information leaked by the traffic shaping may also be 378 addressed by the application level. For example, it is preferred to 379 have a sensor sending some information at regular time interval, 380 rather when a specific event is happening. Typically, a sensor 381 monitoring the temperature, or a door is expected to send regularly 382 the information - i.e. the temperature of the room or whether the 383 door is closed or open) instead of only sending the information when 384 the temperature has raised or when the door is being opened. 386 6. Next Header (8 bit) 388 According to [RFC4303], the Next Header is a mandatory 8 bits field 389 in the packet. Next header specifies the data contained in the 390 payload as well as dummy packet, i.e. packets with the Next Header 391 with a value 59 meaning "no next header". In addition, the Next 392 Header may also carry an indication on how to process the packet 393 [I-D.nikander-esp-beet-mode]. 395 The ability to generate and receive dummy packet is required by 396 [RFC4303]. For interoperability, a minimal ESP implementation MUST 397 discard dummy packets without indicating an error. Note that such 398 recommendation only applies for nodes receiving packets, and that 399 nodes designed to only send data may not implement this capability. 401 As the generation of dummy packets is subject to local management and 402 based on a per-SA basis, a minimal ESP implementation may not 403 generate such dummy packet. More especially, in constrained 404 environment sending dummy packets may have too much impact on the 405 device lifetime, and so may be avoided. On the other hand, 406 constrained nodes may be dedicated to specific applications, in which 407 case, traffic pattern may expose the application or the type of node. 408 For these nodes, not sending dummy packet may have some privacy 409 implication that needs to be measured. However, for the same reasons 410 exposed in Section 5 traffic shaping at the IPsec layer may also 411 introduce some traffic pattern, and on constrained devices the 412 application is probably the most appropriated layer to limit the risk 413 of leaking information by traffic shaping. 415 In some cases, devices are dedicated to a single application or a 416 single transport protocol, in which case, the Next Header has a fix 417 value. 419 Specific processing indications have not been standardized yet 420 [I-D.nikander-esp-beet-mode] and is expected to result from an 421 agreement between the peers. As a result, it SHOULD NOT be part of a 422 minimal implementation of ESP. 424 7. ICV 426 The ICV depends on the cryptographic suite used. Currently [RFC8221] 427 only recommends cryptographic suites with an ICV which makes the ICV 428 a mandatory field. 430 As detailed in [RFC8221] authentication or authenticated encryption 431 are RECOMMENDED and as such the ICV field MUST be present with a size 432 different from zero. It length is defined by the security 433 recommendations only. 435 8. Cryptographic Suites 437 The cryptographic suites implemented are an important component of 438 ESP. The recommended algorithms to use are expected to evolve over 439 time and implementers SHOULD follow the recommendations provided by 440 [RFC8221] and updates. 442 This section lists some of the criteria that may be considered. The 443 list is not expected to be exhaustive and may also evolve overtime. 444 As a result, the list is provided as indicative: 446 1. Security: Security is the criteria that should be considered 447 first for the selection of encryption algorithm transform. The 448 security of encryption algorithm transforms is expected to evolve 449 over time, and it is of primary importance to follow up-to-date 450 security guidance and recommendations. The chosen encryption 451 algorithm MUST NOT be known vulnerable or weak (see [RFC8221] for 452 outdated ciphers). ESP can be used to authenticate only or to 453 encrypt the communication. In the latter case, authenticated 454 encryption must always be considered [RFC8221]. 456 2. Resilience to nonce re-use: Some transforms -including AES-GCM - 457 are very sensitive to nonce collision with a given key. While 458 the generation of the nonce may prevent such collision during a 459 session, the mechanisms are unlikely to provide such protection 460 across reboot. This causes an issue for devices that are 461 configured with a key. When the key is likely to be re-used 462 across reboots, it is RECOMMENDED to consider algorithms that are 463 nonce misuse resistant such as, for example, AES-SIV [RFC5297], 464 AES-GCM-SIV [RFC8452] or Deoxys-II [DeoxysII]. Note however that 465 currently none of them has yet been defined for ESP. 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 appropriate 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 552 12.1. Normative References 554 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 555 Requirement Levels", BCP 14, RFC 2119, 556 DOI 10.17487/RFC2119, March 1997, 557 . 559 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 560 "Randomness Requirements for Security", BCP 106, RFC 4086, 561 DOI 10.17487/RFC4086, June 2005, 562 . 564 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 565 Internet Protocol", RFC 4301, DOI 10.17487/RFC4301, 566 December 2005, . 568 [RFC4303] Kent, S., "IP Encapsulating Security Payload (ESP)", 569 RFC 4303, DOI 10.17487/RFC4303, December 2005, 570 . 572 [RFC7296] Kaufman, C., Hoffman, P., Nir, Y., Eronen, P., and T. 573 Kivinen, "Internet Key Exchange Protocol Version 2 574 (IKEv2)", STD 79, RFC 7296, DOI 10.17487/RFC7296, October 575 2014, . 577 [RFC7815] Kivinen, T., "Minimal Internet Key Exchange Version 2 578 (IKEv2) Initiator Implementation", RFC 7815, 579 DOI 10.17487/RFC7815, March 2016, 580 . 582 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 583 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 584 May 2017, . 586 [RFC8221] Wouters, P., Migault, D., Mattsson, J., Nir, Y., and T. 587 Kivinen, "Cryptographic Algorithm Implementation 588 Requirements and Usage Guidance for Encapsulating Security 589 Payload (ESP) and Authentication Header (AH)", RFC 8221, 590 DOI 10.17487/RFC8221, October 2017, 591 . 593 [RFC8750] Migault, D., Guggemos, T., and Y. Nir, "Implicit 594 Initialization Vector (IV) for Counter-Based Ciphers in 595 Encapsulating Security Payload (ESP)", RFC 8750, 596 DOI 10.17487/RFC8750, March 2020, 597 . 599 12.2. Informative References 601 [DeoxysII] 602 Jeremy, J., Ivica, I., Thomas, T., and Y. Yannick, "Deoxys 603 v1.41", October 2016, 604 . 606 [I-D.mglt-ipsecme-diet-esp] 607 Migault, D., Guggemos, T., Bormann, C., and D. Schinazi, 608 "ESP Header Compression and Diet-ESP", draft-mglt-ipsecme- 609 diet-esp-07 (work in progress), March 2019. 611 [I-D.mglt-ipsecme-ikev2-diet-esp-extension] 612 Migault, D., Guggemos, T., and D. Schinazi, "Internet Key 613 Exchange version 2 (IKEv2) extension for the ESP Header 614 Compression (EHC) Strategy", draft-mglt-ipsecme-ikev2- 615 diet-esp-extension-01 (work in progress), June 2018. 617 [I-D.nikander-esp-beet-mode] 618 Nikander, P. and J. Melen, "A Bound End-to-End Tunnel 619 (BEET) mode for ESP", draft-nikander-esp-beet-mode-09 620 (work in progress), August 2008. 622 [RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV) 623 Authenticated Encryption Using the Advanced Encryption 624 Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October 625 2008, . 627 [RFC8452] Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV: 628 Nonce Misuse-Resistant Authenticated Encryption", 629 RFC 8452, DOI 10.17487/RFC8452, April 2019, 630 . 632 [SP-800-90A-Rev-1] 633 Elain, E. and J. Kelsey, "Recommendation for Random Number 634 Generation Using Deterministic Random Bit Generators", 635 . 638 Authors' Addresses 640 Daniel Migault 641 Ericsson 642 8400 boulevard Decarie 643 Montreal, QC H4P 2N2 644 Canada 646 EMail: daniel.migault@ericsson.com 647 Tobias Guggemos 648 LMU Munich 649 MNM-Team 650 Oettingenstr. 67 651 80538 Munich, Bavaria 652 Germany 654 EMail: guggemos@mnm-team.org