<?xmlversion="1.0" encoding="UTF-8"?>version='1.0' encoding='utf-8'?> <!DOCTYPE rfcSYSTEM "rfc2629.dtd"> <?rfc rfcedstyle="yes"?> <?rfc toc="yes"?> <?rfc tocindent="yes"?> <?rfc sortrefs="yes"?> <?rfc symrefs="yes"?> <?rfc strict="yes"?> <?rfc comments="yes"?> <?rfc inline="yes"?> <?rfc docmapping="yes"?>[ <!ENTITY nbsp " "> <!ENTITY zwsp "​"> <!ENTITY nbhy "‑"> <!ENTITY wj "⁠"> ]> <rfc xmlns:xi="http://www.w3.org/2001/XInclude" number="9333" category="info" docName="draft-ietf-lwig-minimal-esp-12"ipr="trust200902">ipr="trust200902" obsoletes="" updates="" submissionType="IETF" consensus="true" xml:lang="en" tocInclude="true" sortRefs="true" symRefs="true" version="3"> <!-- xml2rfc v2v3 conversion 3.15.0 --> <front> <title abbrev="Minimal IP ESP">Minimal IP Encapsulating Security Payload (ESP)</title> <seriesInfo name="RFC" value="9333"/> <author surname="Migault" initials="D." fullname="Daniel Migault"> <organization>Ericsson</organization> <address> <postal><street>8400 boulevard Decarie</street> <city>Montreal, QC H4P 2N2</city><street>8275 Rte Transcanadienne</street> <city>Saint-Laurent</city> <region>QC</region> <code>H4S 0B6</code> <country>Canada</country> </postal> <email>daniel.migault@ericsson.com</email> </address> </author> <author surname="Guggemos" initials="T." fullname="Tobias Guggemos"> <organization>LMU Munich</organization> <address> <postal> <street>MNM-Team</street> <street>Oettingenstr. 67</street> <city>80538 Munich</city> <country>Germany</country> </postal> <email>guggemos@mnm-team.org</email> </address> </author> <date year="2022" month="December" /><area>INTERNET</area><area>Internet</area> <workgroup>Light-Weight Implementation Guidance (lwig)</workgroup> <abstract> <t> This document describes the minimal properties that an IP Encapsulating Security Payload (ESP) implementation needs to meet to remain interoperable with the standardRFC4303 ESP. <!-- This document describes a minimal IP Encapsulation Security Payload (ESP) defined in RFC 4303. Its purpose is to enable implementation of ESP with a minimal set of options to remain compatible withESP asdescribeddefined in RFC 4303.-->Such a minimal version of ESP is not intended to become a replacement oftheESP in RFC4303 ESP.4303. Instead, a minimal implementation is expected to be optimized for constrained environments while remaining interoperable with implementations ofRFC 4303ESP. In addition, this documentalsoprovides some considerations for implementing minimal ESP in a constrainedenvironment which includesenvironment, such as limiting the number of flash writes, handling frequent wakeup/and sleep states, limiting wakeup time, and reducing the use of random generation. </t> <t> This document does not update or modify RFC 4303. It provides a compact description of how to implement the minimal version of that protocol. RFC 4303 remains the authoritative description.</t> </abstract> </front> <middle> <sectiontitle="Requirements notation"> <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t> </section> <section title="Introduction">numbered="true" toc="default"> <name>Introduction</name> <t>ESP <xreftarget="RFC4303"/>target="RFC4303" format="default"/> is part of the IPsec protocol suite <xreftarget="RFC4301"/>.target="RFC4301" format="default"/>. IPsec is used to provide confidentiality, data origin authentication, connectionless integrity, an anti-replayserviceservice, and limitedtraffic flow confidentialityTraffic Flow Confidentiality (TFC) padding.</t> <t><xreftarget="fig-esp-description"/>target="fig-esp-description" format="default"/> describes an ESPPacket.packet. Currently, ESP is implemented in the kernel of most major multipurpose Operating Systems(OS).(OSes). ESP is usually implemented with all of its features to fit themultiple purposemultipurpose usage of these OSes, at the expense of resources and with no considerations for code size. Constrained devices are likely to have their own implementation of ESP optimized and adapted to their specific use, such as limiting the number of flash writes (for each packet or across waketime), handlingtime), handling frequent wakeup and sleepstate,states, limiting wakeup time, and reducing the use of random generation. With the adoption of IPsec byIoTInternet of Things (IoT) devices with minimal IKEv2 <xreftarget="RFC7815"/>target="RFC7815" format="default"/> and ESP Header Compression (EHC)with<xreftarget="I-D.mglt-ipsecme-diet-esp"/> ortarget="I-D.mglt-ipsecme-diet-esp" format="default"/> <xreftarget="I-D.mglt-ipsecme-ikev2-diet-esp-extension"/>,target="I-D.mglt-ipsecme-ikev2-diet-esp-extension" format="default"/>, these ESP implementationsMUST<bcp14>MUST</bcp14> remain interoperable with standard ESP implementations. This document describes the minimal properties an ESP implementation needs to meet to remain interoperable with ESP <xreftarget="RFC4303"/> ESP.target="RFC4303" format="default"/>. In addition, this documentalsoprovidesadviseadvice to implementers for implementing ESP within constrained environments. This document does not update or modifyRFC 4303.</t> <t> For<xref target="RFC4303" format="default"/>.</t> <t>For each field of the ESP packet represented in <xreftarget="fig-esp-description"/>target="fig-esp-description" format="default"/>, this document provides recommendations and guidance for minimal implementations. The primary purpose ofMinimalminimal ESP is to remain interoperable with other nodes implementingRFC 4303 ESP,ESP <xref target="RFC4303" format="default"/>, while limiting the standard complexity of the implementation. </t> <figureanchor="fig-esp-description" title="ESPanchor="fig-esp-description"> <name>ESP PacketDescription"> <artwork><![CDATA[Description</name> <artwork name="" type="" align="left" alt=""><![CDATA[ 0 1 2 3 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---- | Security Parameters Index (SPI) | ^Int. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- | Sequence Number | |ered +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ---- | Payload Data* (variable) | | ^ ~ ~ | | | | |Conf. + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Cov- | | Padding (0-255 bytes) | |ered* +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | Pad Length | Next Header | v v +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ------ | Integrity CheckValue-ICVValue (ICV) (variable) | ~ ~ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ]]></artwork> </figure> </section> <section numbered="true" toc="default"> <name>Requirements Notation</name> <t> The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here. </t> </section> <section anchor="sec-spi"title="Security Parameternumbered="true" toc="default"> <name>Security Parameters Index(SPI) (32 bit)"> <!-- what is the spi / definition -->(SPI)</name> <t> <xreftarget="RFC4303"/>target="RFC4303" format="default"/> defines the SPI as a mandatory32 bits32-bit field. </t> <t> The SPI hasalocal significance to index the Security Association (SA).FromAs described in <xreftarget="RFC4301"/> section 4.1,target="RFC4301" sectionFormat="of" section="4.1"/>, nodes supporting only unicast communications can index their SA using only the SPI. Nodes supporting multicast communications also requireto usethe use of IPaddresses and thusaddresses; thus, SA lookupneedneeds to be performed using the longest match. </t> <t> For nodes supporting only unicast communications,it is RECOMMENDEDindexing the SA using only theSPI.SPI is <bcp14>RECOMMENDED</bcp14>. The index may be based on the full 32 bits of the SPI or a subset of these bits. The node may require a combination of the SPI as well as other parameters (like the IP address) to index the SA.</t> <t> Values 0-255MUST NOT<bcp14>MUST NOT</bcp14> be used. As persection 2.1 of<xreftarget="RFC4303"/>,target="RFC4303" sectionFormat="of" section="2.1"/>, values 1-255 arereservedreserved, and 0 is only allowed to be used internally andit MUST NOT<bcp14>MUST NOT</bcp14> be sent over the wire. </t><!-- generation of the spi --><t> <xreftarget="RFC4303"/>target="RFC4303" format="default"/> does not require the32 bit32-bit SPI to be randomly generated, although that is theRECOMMENDED<bcp14>RECOMMENDED</bcp14> way to generate SPIs as it provides some privacy and security benefits and avoids correlation between ESP communications. To obtain a usable random32 bit32-bit SPI, the node generates a random32 bit32-bit value and checks it does not fall within the 0-255 range. If the SPI has an acceptable value, it is used to index the inbound session.OtherwiseOtherwise, the generated value isdiscardeddiscarded, and the process repeats until a valid value is found. </t> <t>Some constrained devices are less concerned with the privacy properties associatedtowith randomly generated SPIs. Examples of such devices might include sensors looking to reduce their code complexity. The use of a predictive function to generate the SPI might be preferred over the generation and handling of random values. An implementation of such predictable function could use the combination of a fixed value and the memory address of theSADSecurity Association Database (SAD) structure. For every incoming packet, the node will be able to point to the SAD structure directly from the SPI value. This avoids having a separate and additional binding and lookup function for the SPI to its SAD entry for every incoming packet. </t><!-- privacy / security implication for non random SPIs --><sectiontitle="Considerations overnumbered="true" toc="default"> <name>Considerations for SPIgeneration">Generation</name> <t>SPIs that are not randomly generated over 32 bits may have privacy and security concerns. As a result, the use of alternative designs requires careful security and privacy reviews. This section provides some considerationsuponfor the adoption of alternative designs. </t> <t>The SPI value is only looked up for inbound traffic. The SPI negotiated with IKEv2 <xreftarget="RFC7296"/>target="RFC7296" format="default"/> orMinimalminimal IKEv2 <xreftarget="RFC7815"/>target="RFC7815" format="default"/> by a peer is the value used by the remote peer when it sends traffic. The main advantage of using a rekeying mechanism is to enable a rekey,thatwhich is performed by replacing an old SAbywith a new SA, both indexed with distinct SPIs.As theThe SPI is only used for inbound traffic by the peer,thiswhich allows each peer to manage the set of SPIs used for its inbound traffic. The necessary number ofSPISPIs reflects the number of inbound SAs as well as the ability to rekeythesethose SAs. Typically, rekeyingaan SA is performed by creating a new SA (with a dedicated SPI) before the old SA is deleted. This results in an additional SA and the need to support an additional SPI. Similarly, the privacy concerns associated with the generation of non-random SPIs is also limited to the incoming traffic. </t><!--Alternate designs that take less resources than fully random SPI's are likely using a limited list of possible SPIs. This limit should take into account the number of inbound SAs - possibly per IP addresses - as well as the requirement for rekeying which would briefly require 2 inbound SPIs to co-exist as the new SA is setup before the old SA is torn down. --><t> Alternatively, some constrained devices will not implement IKEv2 orMinimalminimal IKEv2andand, assuchsuch, will not be able to manage aroll-overrollover between two distinct SAs. In addition, some of these constrained devices arealsolikely to have a limited number ofSAs -SAs; for example, they are likely to be indexed over 3 bytesonly for example.only. One possible way to enable arekeyrekeying mechanism with these devices is to use the SPIwherewhere, forexampleexample, the first 3 bytes designates the SA while the remaining byte indicates a rekey index. SPI numbers can be used to implement tracking the inbound SAs when rekeying is taking place. When rekeyingaan SPI, the new SPI could use the SPI bytes to indicate the rekeying index. </t> <t>The use of asmallsmall, limited set of SPI numbers across communications comes with privacy and security concerns. Some specific values orsubsetsubsets of SPI values could reveal themodelsmodel or manufacturer of the node implementingESP. It could alsoESP or revealsomea state such as "not yet rekeyed" or "rekeyed 10 times". If a constrained host uses a very limitedor even just one application,number of applications, eventually a single one, the SPI itself could indicate what kind of traffic(egis transmitted (e.g., the kind of application typicallyrunning) is transmitted.running). This could also befurthercorrelatedbywith encrypted data size to further leak information to an observer on the network. In addition, use of specific hardcoded SPI numbers could reveal a manufacturer or device version. If updated devices use different SPI numbers, an attacker could locate vulnerable devices by their use of specific SPI numbers. </t> <t> A privacy analysis should consider at least the type of information as well as the traffic pattern before deciding whether non-random SPIs are safe to use.TypicallyTypically, temperaturesensors,and windsensors,sensors that are used outdoorsmaydo not leakprivacy sensitive informationprivacy-sensitive information, and most ofitstheir traffic is expected to be outbound traffic. When used indoors, a sensor that reports an encrypted status of a door (closed or opened) everyminute,minute might not leak sensitive information outside the local network. In these examples, the privacy aspect of the information itself might be limited. Being able to determine the version of the sensor to potentially take control of it may also have some limited security consequences. Ofcoursecourse, this depends on the context in which these sensors are beingused. Ifused. If the risks associated toprivacy andprivacy and security are acceptable, a non-randomized SPI can be used. </t> </section> </section> <section anchor="sec-sn"title="Sequence Number(SN) (32 bit)">numbered="true" toc="default"> <name>Sequence Number (SN)</name> <t> The Sequence Number (SN) in <xreftarget="RFC4303"/>target="RFC4303" format="default"/> is a mandatory32 bits32-bit field in the packet. </t> <t> The SN is set by the sender so the receiver can implement anti-replay protection. The SN is derived from any strictly increasing function thatguarantees:guarantees the following: if packet B is sent after packet A, then the SN of packet B is higher than the SN of packet A. </t> <t>Some constrained devices may establish communication with specific devices where it is known whether or not the peer implements anti-replay protection. As per <xreftarget="RFC4303"/>,target="RFC4303" format="default"/>, the senderMUST<bcp14>MUST</bcp14> still implement a strictly increasing function to generate the SN. </t><t>The RECOMMENDED way for<t> It is <bcp14>RECOMMENDED</bcp14> that multipurpose ESPimplementation is toimplementations increment a counter for each packet sent. However, a constrained device may avoid maintaining this context and use another source that is known to always increase. Typically, constrained devices use 802.15.4 Time Slotted Channel Hopping (TSCH). This communication is heavily dependent on time. Acontrainedconstrained device can take advantage of this clock mechanism to generate the SN. A lot of IoT devices are in a sleep state most of the time and wake up only to perform a specific operation before going back to sleep. These devicesdohave separate hardware that allows them to wake up after a certain timeout and typically also have timers that start running when the devicewasis booted up, so they might have a concept of time with certain granularity. This requires devices to store any information inastable storage- such as flash memory -that can be restored acrosssleeps.sleeps (e.g., flash memory). Storing information associated with the SAsuch(such asSNthe SN) requires some read and writeoperationoperations onastable storage after each packet is sent as opposed toaan SPI number or cryptographic keys that are only written to stable storage at the creation of the SA. Write operations wear out the flash storage. Write operations also slow down the system significantly, as writing to flash is much slower than reading from flash. While these devices have internal clocks or timers that might not be very accurate,thesethey are good enough to guarantee that each time the device wakes up fromsleep that theirsleep, the time is greater than what it was before the device went to sleep. Using time for the SN would guarantee a strictly increasing function and avoid storing any additional values or context related to the SN on flash. In addition to the time value, aRAM basedRAM-based counter can be used to ensure that the serial numbers are still increasing and unique if the device sends multiple packets over an SA within onewake up period, that the serial numbers are still increasing and unique. </t> <!-- Note that standard receivers are generally configured with incrementing counters and, if not appropriately configured, the use of a significantly larger SN than the previous packet can result in that packet falling outside of the peer's receiver window which could cause that packet to be discarded.wakeup period. </t>As a result, using time based SN should only be used when it is known that the remote peer supports this or when it is known that anti-replay windows are disabled.</t> --><t>For inbound traffic, it isRECOMMENDED<bcp14>RECOMMENDED</bcp14> that receivers implement anti-replay protection. The size of the window should depend on theproperty of thenetwork characteristic to deliver packets out of order. In an environment whereout of orderout-of-order packets are not possible, the window size can be set to one. An ESP implementation may choose to not implementananti-replay protection. An implementation of anti-replay protection may require the device to write the received SN for every packet to stable storage. This will have the same issues as discussed earlier with the SN. Some constrained device implementations may choose to not implement the optional anti-replay protection. A typical examplemight consideris an IoT device such as a temperature sensor thatis sendingsends a temperature measurement every 60seconds,seconds andthatreceives an acknowledgment from the receiver. Insuch cases,a case like this, the ability to spoof and replay an acknowledgement is of limited interest and might not justify the implementation of an anti-replay mechanism. Receiving peers may also use an ESP anti-replay mechanism adapted to a specific application. Typically, when the sending peer is using an SN based on time, anti-replay may be implemented by discarding any packets that presentaan SN whose value is too much in the past. Such mechanisms may consider clock drifting in various ways in addition to acceptable delay induced by the network to avoid theanti replayanti-replay windows rejecting legitimate packets.ItReceiving peers could accept any SN as long as it is higher than the previously received SN. Another mechanism could be used where only the received time on the device is used to consider a packetasto be valid, without looking at the SN at all. </t> <t>The SN can be represented as a32 bit number,32-bit number or as a64 bit64-bit number, known asExtendedan "Extended Sequence Number(ESN).(ESN)". As per <xreftarget="RFC4303"/>,target="RFC4303" format="default"/>, support of ESN is notmandatorymandatory, and its use is negotiated via IKEv2 <xreftarget="RFC7296"/>. Atarget="RFC7296" format="default"/>. An ESN is used forhigh speedhigh-speed links to ensure there can be more than2^322<sup>32</sup> packets before the SA needs to be rekeyed to prevent the SN from rolling over. This assumes the SN is incremented by 1 for each packet. When the SN is incremented differently--- such as when time is used--- rekeying needs to happen based on how the SN is incremented to prevent the SN from rolling over. The security of all data protected under a given key decreases slightly with eachmessagemessage, and a node must ensure the limit is notreached -reached, even though the SN would permit it. Estimation of the maximum number of packets to be sent by a node is not alwayspredicatablepredictable, and large margins should beused espciallyused, especially as nodes could be online for much more time than expected. Even for constrained devices, it isRECOMMENDED<bcp14>RECOMMENDED</bcp14> to implement somerekeyrekeying mechanisms (see <xreftarget="sec-security-considerations"/>).target="sec-security-considerations" format="default"/>). </t> </section> <section anchor="sec-padding"title="Padding">numbered="true" toc="default"> <name>Padding</name> <t> Padding is required to keep the32 bit32-bit alignment of ESP. It is also required for some encryption transforms that need a specific block size of input, such as ENCR_AES_CBC. ESP specifies padding in the Pad Length byte, followed by up to 255 bytes of padding. </t> <t> Checking the padding structure is not mandatory, so constrained devices may omit these checks on received ESP packets. For outgoing ESP packets, padding must be applied as required by ESP. </t> <t> In somesituationsituations, the padding bytes may take a fixed value. This would typically be the case when theDataPayload Data is of fixed size. </t> <t>ESP <xreftarget="RFC4303"/>target="RFC4303" format="default"/> additionally provides Traffic Flow Confidentiality (TFC) as a way to perform padding to hide traffic characteristics. TFC is not mandatory and is negotiated with the SA management protocol, such as IKEv2. TFC has been widelyimplementedimplemented, but it is not widely deployed for ESP traffic. It isNOT RECOMMENDED<bcp14>NOT RECOMMENDED</bcp14> to implement TFC foraminimal ESP. </t> <t>As a consequence, communication protection that relies on TFC would be more sensitive to traffic patterns without TFC. This can leak application information as well as themanifacturormanufacturer or model of the device used to a passive monitoring attacker. Such information can be used, for example, by an attackerin caseif a vulnerability is known for the specific device or application. In addition, someapplication use - suchapplications (such as healthapplications -applications) could leak importantprivacy oriented information.</t>privacy-oriented information. </t> <t>Constrained devices that have a limited battery lifetime may prefer to avoid sending extra padding bytes. In most cases, the payload carried by these devices is quite small, and the standard padding mechanism can be used as an alternative to TFC. Alternatively, any information leak based on the size--- or presence--- of the packet can also be addressed at the applicationlevel,level before the packet is encrypted with ESP. If application packets vary between 1 to 30 bytes, the application could always send32 byte32-byte responses to ensure all traffic sent is of identical length. To prevent leaking information that a sensor changed state, such as "temperature changed" or "door opened", an application could send this information at regular timeinterval,intervals, rather than when a specific event is happening, even if the sensor state did not change. </t> </section> <section anchor="sec-nh"title="Nextnumbered="true" toc="default"> <name>Next Header(8 bit)andDummy Packets">"Dummy" Packets</name> <t>ESP <xreftarget="RFC4303"/>target="RFC4303" format="default"/> defines the Next Header as a mandatory8 bits8-bit field in the packet. The Nextheader,Header, only visible after decryption, specifies the data contained in the payload. In addition, the Next Header mayalsocarry an indication on how to process the packet <xreftarget="I-D.nikander-esp-beet-mode"/>.target="I-D.nikander-esp-beet-mode" format="default"/>. The Next Header can point to adummy"dummy" packet,i.e. packetsi.e., a packet with the Next Header value set to5959, meaning "no next header". The data followingto"no next header" is unstructureddummy"dummy" data. (Note that this document uses the term “dummy” for consistency with <xref target="RFC4303" format="default"/>.) </t> <t>The ability togenerate and to receivegenerate, receive, and ignoredummy"dummy" packets is required by <xreftarget="RFC4303"/>.target="RFC4303" format="default"/>. An implementation can omit ever generating and sendingdummy"dummy" packets. For interoperability, a minimal ESP implementationMUST<bcp14>MUST</bcp14> be able to process and discarddummy"dummy" packets without indicating an error. </t> <t> In constrained environments, sendingdummy"dummy" packets may have too much impact on the device lifetime, in whichcase dummycase, "dummy" packets should not be generated and sent. On the other hand,Constrainedconstrained devices running specific applications that would leak too much information by not generating and sendingdummy"dummy" packets may implement this functionality or even implement something similar at the application layer. Note also that similarly to padding and TFC that can be used to hide some traffic characteristics (see <xreftarget="sec-padding"/>), dummy packettarget="sec-padding" format="default"/>), "dummy" packets may also reveal some patterns that can be used to identify the application. For example, an application may senddummy"dummy" data to hidesomea traffic pattern. Suppose suchsuchan application sends a1 byte1-byte data when a change occurs. This results in sending a packet notifying a change has occurred.Dummy packet"Dummy" packets may be used to prevent such informationto befrom being leaked by sending a1 byte1-byte packet every second when the information is not changed. After anupgradeupgrade, the data becomestwo2 bytes. At that point, thedummy"dummy" packets do not hideanythinganything, and having 1 byte regularly versus 2 bytesmakemakes even the identification of theapplication,application version easier to identify. Thisgeneralygenerally makes the use ofdummy"dummy" packets moreappropriatedappropriate onhigh speedhigh-speed links. </t><!-- Constrained devices running specific applications that would leak too much information by not generating and sending dummy packets could implement this functionality instead at the application layer. --><t> In some cases, devices are dedicated to a single application or a single transportprotocol, in whichprotocol. In this case, the Next Header has a fixed value.</t> <t>Specific processing indications have not been standardized yet <xreftarget="I-D.nikander-esp-beet-mode"/>target="I-D.nikander-esp-beet-mode" format="default"/> andisare expected to result from an agreement between the peers. As a result,it SHOULD NOTthey <bcp14>SHOULD NOT</bcp14> be part of a minimal implementation of ESP. </t> </section> <section anchor="sec-icv"title="ICV">numbered="true" toc="default"> <name>ICV</name> <t>The ICV depends on the cryptographic suite used. As detailed in <xreftarget="RFC8221"/>target="RFC8221" format="default"/>, authentication or authenticated encryptionare RECOMMENDEDis <bcp14>RECOMMENDED</bcp14>, and assuchsuch, the ICV field must be present with a size different from zero. Its length is defined by the security recommendations only. </t> </section> <section anchor="sec-encr"title="Cryptographic Suites">numbered="true" toc="default"> <name>Cryptographic Suites</name> <t> The recommended algorithms to use are expected to evolve overtimetime, and implementersSHOULD<bcp14>SHOULD</bcp14> follow the recommendations provided by <xreftarget="RFC8221"/>target="RFC8221" format="default"/> and updates. </t> <t> This section lists some of the criteria that may be considered to select an appropriate cryptographic suite. The list is not expected to be exhaustive and may also evolve overtime:time. </t><t><list style="numbers"> <t> Security:<ol spacing="normal" type="1"> <li>Security: Security is the criteria that should be considered first for the selection of encryption algorithmtransform.transforms. The security of encryption algorithm transforms is expected to evolve over time, and it is of primary importance to follow up-to-date security guidance and recommendations. The chosen encryption algorithmMUST NOT<bcp14>MUST NOT</bcp14> be vulnerable or weak (see <xreftarget="RFC8221"/>target="RFC8221" format="default"/> for outdated ciphers). ESP can be used to authenticate only (ENCR_NULL) or to encrypt the communication. In the latter case,authenticated encryptionAuthenticated Encryption with Associated Data (AEAD) isRECOMMENDED<bcp14>RECOMMENDED</bcp14> <xreftarget="RFC8221"/>.</t> <t>Resiliencetarget="RFC8221" format="default"/>.</li> <li>Resilience tononce re-use:Nonce Reuse: Sometransforms -including AES-GCM -transforms, including AES-GCM, are vulnerable to nonce collision with a given key. While the generation of the nonce may prevent such collision during a session, the mechanisms are unlikely to provide such protection across sleep states or reboot. This causes an issue for devices that are configured using static keys (calledmanual keying)"manual keying"), and manual keying should not be used with these encryption algorithms. When the key is likely to bere-usedreused across reboots, algorithms that are resistant to nonce misuseresistant such as, for(for example, AES-SIV <xreftarget="RFC5297"/>,target="RFC5297" format="default"/>, AES-GCM-SIV <xreftarget="RFC8452"/> ortarget="RFC8452" format="default"/>, and Deoxys-II <xreftarget="DeoxysII"/>target="DeoxysII" format="default"/>) areRECOMMENDED. Note however<bcp14>RECOMMENDED</bcp14>. Note, however, thatcurrentlynone of these areyetcurrently defined for use withESP. </t> <t> Interoperability: constrainedESP.</li> <li>Interoperability: Constrained devices usually only implement one or very few different encryption algorithm transforms. <xreftarget="RFC8221"/>target="RFC8221" format="default"/> takes the life cycle of encryption algorithm transforms and devicemanufactoringmanufacturing into consideration in its recommendations for mandatory-to-implement("MTI") algorithms. </t> <t> Power(MTI) algorithms.</li> <li>Power Consumption and Cipher Suite Complexity: Complexity of the encryption algorithm transform and the energy cost associated with it are especially important considerations for devices that have limited resources or are battery powered. The battery life might determine the lifetime of the entire device.The choice ofWhen choosing a cryptographicfunction should consider re-usingfunction, reusing specific libraries orto taketaking advantage of hardware acceleration provided by thedevice.device should be considered. For example, if the device benefits from AES hardware modules and uses ENCR_AES_CTR, it may prefer AUTH_AES-XCBC for its authentication. In addition, some devices mayalsoembed radio modules with hardware acceleration for AES-CCM, in which case, this transform may bepreferred.</t> <t> Powerpreferred.</li> <li><t>Power Consumption and Bandwidth Consumption: Reducing the payload sent may significantly reduce the energy consumption of the device. Encryption algorithm transforms with low overhead are strongly preferred. To reduce the overall payloadsizesize, one may, forexample: <list style="numbers"> <t> Use ofexample:</t> <ul spacing="normal"> <li>Use counter-based ciphers without fixed block length(e.g. AES-CTR,(e.g., AES-CTR orChaCha20-Poly1305).</t> <t>Use ofChaCha20-Poly1305).</li> <li>Use cipherswith capabilitycapable of using implicitIVs <xref target="RFC8750"/>.</t> <t>Use ofInitialization Vectors (IVs) <xref target="RFC8750" format="default"/>.</li> <li>Use ciphers recommended for IoT <xreftarget="RFC8221"/>.</t> <t>target="RFC8221" format="default"/>.</li> <li> AvoidPaddingpadding by sending payload datawhichthat are aligned to the cipher block length--- 2 bytes for the ESPtrailer.</t> </list></t> </list></t>trailer.</li> </ul> </li> </ol> </section> <sectiontitle="IANA Considerations"> <t>There arenumbered="true" toc="default"> <name>IANA Considerations</name> <t>This document has no IANAconsideration for this document.</t>actions.</t> </section> <section anchor="sec-security-considerations"title="Security Considerations">numbered="true" toc="default"> <name>Security Considerations</name> <t>Security Considerations are those ofThe security considerations in <xreftarget="RFC4303"/>.target="RFC4303" format="default"/> apply to this document as well. In addition, this documentprovidedprovides security recommendations and guidanceoverfor the implementation choices for each ESP field. </t> <t>The security of a communication provided by ESP is closely related to the security associated with the management of that key. This usually includes mechanisms to prevent a nonce from repeating, for example. When a node is provisioned with a session key that is used across reboot, the implementerMUST<bcp14>MUST</bcp14> ensure that the mechanisms put in place remain valid across reboot as well. </t> <t>It isRECOMMENDED<bcp14>RECOMMENDED</bcp14> to use ESP in conjunction with key management protocols suchasas, forexampleexample, IKEv2 <xreftarget="RFC7296"/>target="RFC7296" format="default"/> or minimal IKEv2 <xreftarget="RFC7815"/>.target="RFC7815" format="default"/>. Such mechanisms are responsible for negotiating fresh session keys as well aspreventpreventing a session key beinguseused beyond its lifetime. When such mechanisms cannot be implemented, such as when thethesession key is provisioned, the deviceMUST<bcp14>MUST</bcp14> ensure that keys are not used beyond their lifetime and that thethekey remains used in compliancewillwith all security requirements across reboots- e.g.(e.g., conditions on counters and noncesremains valid.remain valid). </t> <t>When a device generates its own key or when randomvaluevalues such as nonces are generated, the random generationMUST<bcp14>MUST</bcp14> follow <xreftarget="RFC4086"/>.target="RFC4086" format="default"/>. In addition, <xreftarget="SP-800-90A-Rev-1"/>target="SP-800-90A-Rev-1" format="default"/> provides guidance on how to build random generators based on deterministic random functions. </t> </section> <section anchor="sec-privacy-considerations"title="Privacy Considerations">numbered="true" toc="default"> <name>Privacy Considerations</name> <t>Preventing the leakage ofprivacy sensitiveprivacy-sensitive information is a hard problem to solve and usuallyresultresults in balancing the information potentially being leaked to the cost associated with the counter measures. This problem is not inherent to the minimal ESP described in this document and also concerns the use of ESP in general. </t> <t>This document targets minimal implementations of ESPandand, assuchsuch, describessomea minimalistic way to implement ESP. In some cases, this may result in potentially revealingprivacy sensitiveprivacy-sensitive pieces of information. This document describes these privacy implications so the implementer cantakemake the appropriate decisions given the specificities of a given environment and deployment. </t> <t>The mainrisksrisk associated with privacy is the ability to identify an application or a device by analyzing thetraffictraffic, which is designated astraffic shaping."traffic shaping". As discussed in <xreftarget="sec-spi"/>,target="sec-spi" format="default"/>, the use insomea very specific context ofnon randomlynon-randomly generatedSPISPIs mightin some casesease the determination of the device or theapplication.application in some cases. Similarly, padding provides limited capabilities to obfuscate the traffic compared to those provided by TFC. Suchconsequenceconsequences on privacyasare detailed in <xreftarget="sec-padding"/>. </t> </section> <section title="Acknowledgment"> <t> The authors would like to thank Daniel Palomares, Scott Fluhrer, Tero Kivinen, Valery Smyslov, Yoav Nir, Michael Richardson, Thomas Peyrin, Eric Thormarker, Nancy Cam-Winget and Bob Briscoe for their valuable comments. In particular Scott Fluhrer suggested including the rekey index in the SPI. Tero Kivinen also provided multiple clarifications and examples of deployment ESP within constrained devices with their associated optimizations. Thomas Peyrin Eric Thormarker and Scott Fluhrer suggested and clarified the use of transform resilient to nonce misuse.target="sec-padding" format="default"/>. </t> </section> </middle> <back><references title="Normative References"> <?rfc include="reference.RFC.2119.xml"?> <!--<?rfc include="reference.RFC.3602.xml"?>--> <!--<?rfc include="reference.RFC.3686.xml"?>--> <!--<?rfc include="reference.RFC.4106.xml"?>--> <?rfc include="reference.RFC.4086.xml"?> <?rfc include="reference.RFC.4301.xml"?> <?rfc include="reference.RFC.4303.xml"?> <!--<?rfc include="reference.RFC.4309.xml"?>--> <?rfc include="reference.RFC.7296.xml"?> <?rfc include="reference.RFC.7815.xml"?> <?rfc include="reference.RFC.8174.xml"?> <?rfc include="reference.RFC.8221.xml"?> <!--<?rfc include="reference.RFC.8247.xml"?>--> <?rfc include="reference.RFC.8750.xml"?><displayreference target="I-D.mglt-ipsecme-diet-esp" to="EHC-DIET-ESP"/> <displayreference target="I-D.mglt-ipsecme-ikev2-diet-esp-extension" to="EHC-IKEv2"/> <displayreference target="I-D.nikander-esp-beet-mode" to="BEET-ESP"/> <references> <name>References</name> <references> <name>Normative References</name> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4086.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4301.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4303.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7296.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7815.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8221.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8750.xml"/> </references><references title="Informative References"> <?rfc include="reference.I-D.nikander-esp-beet-mode.xml"?> <?rfc include="reference.I-D.mglt-ipsecme-diet-esp.xml"?> <?rfc include="reference.I-D.mglt-ipsecme-ikev2-diet-esp-extension.xml"?> <?rfc include="reference.RFC.8452.xml"?> <?rfc include="reference.RFC.5297.xml"?><references> <name>Informative References</name> <!-- [draft-nikander-esp-beet-mode] IESG state Expired. --> <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-nikander-esp-beet-mode.xml"/> <!-- [draft-mglt-ipsecme-diet-esp] IESG state I-D Exists. --> <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-mglt-ipsecme-diet-esp.xml"/> <!-- [draft-mglt-ipsecme-ikev2-diet-esp-extension] IESG state I-D Exists. --> <xi:include href="https://datatracker.ietf.org/doc/bibxml3/draft-mglt-ipsecme-ikev2-diet-esp-extension.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8452.xml"/> <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5297.xml"/> <reference anchor="SP-800-90A-Rev-1" target="https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final"> <front> <title>Recommendation for Random Number Generation Using Deterministic Random Bit Generators</title> <authorinitials="E. B." surname="Elain"initials="E." surname="Barker" fullname="Elaine Barker"><organization >NIST</organization><organization>NIST</organization> </author> <authorinitials="J. K."initials="J." surname="Kelsey" fullname="John Kelsey"><organization >NIST</organization><organization>NIST</organization> </author> <datemonth="" year="" />month="June" year="2015"/> </front> <seriesInfo name="NIST SP" value="800-90A Rev 1"/> <seriesInfo name="DOI" value="10.6028/NIST.SP.800-90Ar1"/> </reference> <reference anchor="DeoxysII" target="https://competitions.cr.yp.to/round3/deoxysv141.pdf"> <front> <title>Deoxys v1.41</title> <authorinitials="J. J." surname="Jeremy" fullname="Jeremyinitials="J." surname="Jean" fullname="Jérémy Jean"><organization >Nanyang<organization>ANSSI, Paris, France `&' Nanyang Technological University, Singapore</organization> </author> <authorinitials="I. N." surname="Ivica"initials="I." surname="Nikolić" fullname="IvicaNikolic"> <organization >NanyangNikolić"> <organization>Nanyang Technological University, Singapore</organization> </author> <authorinitials="T. P." surname="Thomas"initials="T." surname="Peyrin" fullname="Thomas Peyrin"><organization >Nanyang<organization>Nanyang Technological University, Singapore</organization> </author> <authorinitials="Y. S." surname="Yannick"initials="Y." surname="Seurin" fullname="Yannick Seurin"><organization >ANSSI,<organization>ANSSI, Paris, France</organization> </author> <date month="October"year="2016" />year="2016"/> </front> </reference> </references> </references> <section numbered="false" toc="default"> <name>Acknowledgments</name> <t>The authors would like to thank <contact fullname="Daniel Palomares"/>, <contact fullname="Scott Fluhrer"/>, <contact fullname="Tero Kivinen"/>, <contact fullname="Valery Smyslov"/>, <contact fullname="Yoav Nir"/>, <contact fullname="Michael Richardson"/>, <contact fullname="Thomas Peyrin"/>, <contact fullname="Eric Thormarker"/>, <contact fullname="Nancy Cam-Winget"/>, and <contact fullname="Bob Briscoe"/> for their valuable comments. In particular, <contact fullname="Scott Fluhrer"/> suggested including the rekey index in the SPI. <contact fullname="Tero Kivinen"/> also provided multiple clarifications and examples of ESP deployment within constrained devices with their associated optimizations. <contact fullname="Thomas Peyrin"/>, <contact fullname="Eric Thormarker"/>, and <contact fullname="Scott Fluhrer"/> suggested and clarified the use of transform resilient to nonce misuse. The authors would also like to thank <contact fullname="Mohit Sethi"/> for his support as the LWIG Working Group Chair. </t> </section> </back> </rfc>