One document matched: draft-mglt-lwig-minimal-esp-03.xml


<?xml version="1.0" encoding="US-ASCII"?>
<?rfc linefile="1:/tmp/CGI11956.1"?>
<?rfc linefile="1:/tmp/CGI11956.1"?>
<?rfc toc="yes"?>
<!-- generate a table of contents -->
<?rfc symrefs="yes"?>
<!-- use anchors instead of numbers for references -->
<?rfc sortrefs="yes" ?>
<!-- alphabetize the references -->
<?rfc compact="yes" ?>
<!-- conserve vertical whitespace -->
<?rfc subcompact="no" ?>
<!-- but keep a blank line between list items -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
        <!ENTITY RFC2404 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2404.xml">
        <!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <!ENTITY RFC2403 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2403.xml">
        <!ENTITY RFC3566 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3566.xml">
        <!ENTITY RFC3686 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3686.xml">
        <!ENTITY RFC3602 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3602.xml">
        <!ENTITY RFC4106 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4106.xml">
        <!ENTITY RFC4301 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4301.xml">
        <!ENTITY RFC4303 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4303.xml">
        <!ENTITY RFC4309 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4309.xml">
        <!ENTITY RFC4494 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4494.xml">
        <!ENTITY RFC4835 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4835.xml">
        <!ENTITY RFC5856 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5856.xml">
        <!ENTITY RFC5996 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5996.xml">
        <!ENTITY RFC7296 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7296.xml">
        <!ENTITY RFC7815 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7815.xml">
        <!ENTITY I-D.raza-6lowpan-ipsec PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.raza-6lowpan-ipsec.xml">
        <!ENTITY I-D.mglt-ipsecme-implicit-iv PUBLIC "" "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-mglt-ipsecme-implicit-iv-00.xml">
        <!ENTITY I-D.mglt-ipsecme-rfc7321bis PUBLIC "" "http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.draft-mglt-ipsecme-rfc7321bis-00.xml">
]>

<rfc category="info"
     docName="draft-mglt-lwig-minimal-esp-03.txt"
     ipr="trust200902">
  <front>
    <title abbrev="Minimal ESP">Minimal ESP</title>
    <author fullname="Daniel Migault" initials="D." surname="Migault" role="editor">
      <organization>Ericsson</organization>
      <address>
        <postal>
          <street>8400 boulevard Decarie</street>
          <city>Montreal, QC H4P 2N2</city>
          <country>Canada</country>
        </postal>
        <!--<phone>+33 1 45 29 60 52</phone>-->
        <facsimile/>
        <email>daniel.migault@ericsson.com</email>
        <uri/>
      </address>
    </author>

<author fullname="Tobias Guggemos" initials="T." surname="Guggemos">
      <organization>LMU Munich</organization>
  <address>
    <postal>
      <street>MNM-Team</street>
      <street>Oettingenstr. 67</street>
      <city>80538 Munich</city>
      <region>Bavaria</region>
      <country>Germany</country>
    </postal>
    <phone/>
    <facsimile/>
    <email>guggemos@mnm-team.org</email>
    <uri/>
  </address>
</author>

    <date/>
    <area>INTERNET</area>

    <workgroup>Light-Weight Implementation Guidance (lwig)</workgroup>

    <abstract>
    <t>This document describes a minimal version of the IP
       Encapsulation Security Payload (ESP) described in
       RFC 4303 which is part of the IPsec suite.</t>

    <t>ESP is used to provide
       confidentiality, data origin authentication, connectionless
       integrity, an anti-replay service (a form of partial sequence
       integrity), and limited traffic flow confidentiality. </t>

   <t>This document does not update or modify RFC 4303, but provides a
      compact description of how to implement the minimal version of 
      the protocol.  If this
      document and RFC 4303 conflicts then RFC 4303 is the authoritative
      description.</t>
    </abstract>
  </front>

  <middle>

    <section title="Requirements notation">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref target="RFC2119"/>.</t>
    </section>
    <section title="Introduction">

    <t>ESP <xref target="RFC4303"/>  is part of the IPsec suite protocol <xref target="RFC4301"/> .
       It is used to provide confidentiality, data origin authentication,
       connectionless integrity, an anti-replay service (a form of partial
       sequence integrity) and limited traffic flow confidentiality.</t>

    <t><xref target="fig-esp-description"/> describes an ESP Packet. Currently ESP is implemented in the kernel of IPsec aware devices. This document provides a minimal ESP implementation guideline so that smaller devices like sensors without kernel and with hardware restrictions can implement ESP and benefit from IPsec.</t>
    <t>For each field of the ESP packet represented in <xref target="fig-esp-description"/> this document provides recommendations and guidance for minimal implementations.</t>


      <figure title="ESP Packet Description" anchor="fig-esp-description">
        <artwork><![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 Check Value-ICV   (variable)                |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>
    </section>

    <section anchor="sec:spi" title="Security Parameter Index (SPI) (32 bit)">

        <t>According to the <xref target="RFC4303"/>, the SPI is a mandatory 32 bits field and is not allowed to be removed.</t>

        <t>The SPI is used to index the Security Association and as such is unidirectional. The SPI MUST be unique so that any incoming ESP packet can appropriately be bound to its association. Uniqueness of the SPI may be provided by random functions. However, the SPI does not need to be unpredictable. As a result, if random functions are too costly for some constraint devices, the SPI can be generated using predictable functions or even fixed values.</t>

    <t>A constraint device setting a unique ESP session with each remote peer may use a fix SPI value. Such configuration may result in two kind of collisions. SPI collision between inbound and outbound SPI of a given session with a given remote peer or SPI collision across sessions between different remote peers.</t> 

    <t>Inbound and outbound SPI collision: when IKEv2 <xref target="RFC7296"/> or <xref target="RFC7815"/> is use to agree the session key materials, the SPI proposed by the constraint device will be used by the constraint device in order to index its inbound traffic. The use of a fixed value SPI may result in collision between inbound and outbound traffic if the remote peer proposes the same SPI value for its inbound traffic. Such collisions are not an issue as for outbound traffic SPI value is not used by the sending device. Instead, it will be used by the remote peer to bing the inbound traffic to the appropriated SA.</t>

    <t>Inter session SPI collisions: The SPI is mostly used for inbound traffic so the peer can identify the corresponding SA. Binding between inbound traffic and SA should first consider the SPI and the IP addresses, so as long as the constraint device does not have more then one ESP session per IP address, the IP address is sufficient to bind incoming packets to the SA. </t>

   <t>Even though, the use of a single SPI value is possible as long as the device has only an single ESP session per remote node, it may also come with security or privacy drawbacks. The use of a fix SPI value may identify the constraint device communications from a passive attacker. This may provide such an attacker information such as the number of constraint devices connecting the remote peer, and in conjunction with data rate, the attacker may eventually determine the application the constraint device is associated to. In addition, if the fix value SPI is fixed by a manufacturer or by some software application, the SPI may leak in an obvious way the type of sensor, the application involved or the model of the constraint device. As a result, the use of a unpredictable SPI is preferred to provide better privacy.</t>
<t>Similarly, the use of a fixed SPI value may also come with some security issues. First of all, any information that reveals the type of application or model of the constraint device could be used to identify the vulnerabilities the constraint device is subject to. This is especially sensitive for constraint device where patches or software updates will be challenging to operate. As a result, these devices may remain vulnerable for relatively long period. In addition, predictable SPI enable an attacker to forge packets with a valid SPI. Such packet will not be rejected due to an SPI mismatch, but instead after the signature check which requires more resource and thus make DoS more efficient, especially for devices powered by batteries.</t>  

<t>Values 0-255 SHOULD NOT be used. Values 1-255 are reserved and 0 is only allowed to be used internal and it MUST NOT be send on the wire.</t>


       <t> <xref target="RFC4303"/> mentions :
           <list style="hanging" hangIndent="3">
           <t hangText=" - "> "The SPI is an arbitrary 32-bit value that is used by a receiver to identify the SA to which an incoming packet is bound. The SPI field is mandatory. [...]"</t>
           <t hangText=" - "> "For a unicast SA, the SPI can be used by itself to specify an SA, or it may be used in conjunction with the IPsec protocol type (in this case ESP). Because the SPI value is generated by the receiver for a unicast SA, whether the value is sufficient to identify an SA by itself or whether it must be used in conjunction with the IPsec protocol value is a local matter. This mechanism for mapping inbound traffic to unicast SAs MUST be supported by all ESP implementations."</t>
             </list>
        </t>

    </section>

    <section anchor="sec-sn" title="Sequence Number(SN) (32 bit)">

    <t>According to  <xref target="RFC4303"/>, the sequence number is a mandatory 32 bits 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 that guarantees: if packet B is sent after packet A, then SN of packet B is strictly greater then the SN of packet A.</t>
    <t>In IoT, constraint devices are expected to establish communication with specific devices, like a specific gateway, or nodes similar to them. As a result, the sender may know whereas the receiver implements anti-replay protection or not. Even though the sender may know the receiver does not implement anti replay protection, the sender MUST implement a always increasing function to generate the SN.</t>
    <t>Usually, SN is generated by incrementing a counter for each packet sent. A constraint device may avoid maintaining this context. If the device has a clock, it may use the time indicated by the clock has a SN. This guarantees a strictly increasing function, and avoid storing any additional values or context related to the SN. When the use of a clock is considered, one should take care that packets associated to a given SA are not sent with the same time value.</t>
       <t> <xref target="RFC4303"/> mentions :
           <list style="hanging" hangIndent="3">
           <t hangText=" - ">
             "This unsigned 32-bit field contains a counter value that increases by one for each packet sent, i.e., a per-SA packet sequence number. For a unicast SA or a single-sender multicast SA, the sender MUST increment this field for every transmitted packet. Sharing an SA among multiple senders is permitted, though generally not recommended. [...] The field is mandatory and MUST always be present even if the receiver does not elect to enable the anti-replay service for a specific SA."</t>
    </list>
    </t>
    </section>



    <section anchor="sec-padding" title="Padding">

    <t>The purpose of padding is to respect the 32 byte alignment of ESP. Padding is not mandatory in ESP and may be performed by the encryption algorithm. As a result, when ESP is designed with encryption algorithms that considers the padding, padding does not need to implement padding. AES in CBC mode <xref target="RFC3602"/> is one of these algorithms. Note that <xref target="RFC3602"/> does not specify how the padding bytes should be generated. </t>
    <t>On the other hand, encryption algorithms like AES in CTR <xref target="RFC3686"/> or GCM<xref target="RFC4106"/> or CCM <xref target="RFC4309"/> mode do not consider Padding. As a result, when such algorithms are used, Padding must be done by ESP. ESP defines that padding bytes MUST be generated by a succession of unsigned bytes starting with 1, 2, 3 with the last byte set to Pad Length, where Pad Length designates the length of the padding bytes. Checking the padding structure is not mandatory, so the constraint device may not proceed to such checks, however, in order ton interoperate with existing ESP implementations, it MUST build the padding bytes as recommended by ESP.</t>
       <t> <xref target="RFC4303"/> mentions :
           <list style="hanging" hangIndent="3">
           <t hangText=" - ">
           "If Padding bytes are needed but the encryption algorithm does not
specify the padding contents, then the following default processing
MUST be used. The Padding bytes are initialized with a series of
(unsigned, 1-byte) integer values. The first padding byte appended
to the plaintext is numbered 1, with subsequent padding bytes making
up a monotonically increasing sequence: 1, 2, 3, .... When this
padding scheme is employed, the receiver SHOULD inspect the Padding
field. (This scheme was selected because of its relative simplicity,
ease of implementation in hardware, and because it offers limited
protection against certain forms of "cut and paste" attacks in the
absence of other integrity measures, if the receiver checks the
padding values upon decryption.)"</t>
    </list>
    </t>
    </section>

    <section anchor="sec-nh" title="Next Header (8 bit)">

    <t> According to <xref target="RFC4303"/>, the Next Header is a mandatory 8 bits field in the packet. In some cases, devices are dedicated to a single application or a single transport protocol, in which case, the Next Header has a fix value.</t>

       <t> <xref target="RFC4303"/> mentions :
           <list style="hanging" hangIndent="3">
           <t hangText=" - ">
            "The Next Header is a mandatory, 8-bit field that identifies the type of data contained in the Payload Data field, e.g., an IPv4 or IPv6 packet, or a next layer header and data. [...] the protocol value 59 (which means "no next header") MUST be used to designate a "dummy" packet.  A transmitter MUST be capable of generating dummy packets marked with this value in the next protocol field, and a receiver MUST be prepared to discard such packets, without indicating an error."</t>
    </list>
    </t>

   </section>

    <section anchor="sec-icv" title="ICV">

   <t>The ICV is an optional value with variable length. Unless the crypto-suite provides authentication without the use of the ICV field, the ICV field is used to host the authentication part of the packet.</t>
   <t>As detailed in <xref target="sec-encr"/> we recommend to use authentication, the ICV field is expected to be present that is to say with a size different from zero. This makes it a mandatory field which size is defined by the security recommendations only.</t>
 
       <t> <xref target="RFC4303"/> mentions :
           <list style="hanging" hangIndent="3">
           <t hangText=" - ">"The Integrity Check Value is a variable-length field computed over the ESP header, Payload, and ESP trailer fields. Implicit ESP trailer fields (integrity padding and high-order ESN bits, if applicable) are included in the ICV computation. The ICV field is optional. It is present only if the integrity service is selected and is provided by either a separate integrity algorithm or a combined mode algorithm that uses an ICV. The length of the field is specified by the integrity algorithm selected and associated with the SA. The integrity algorithm specification MUST specify the length of the ICV and the comparison rules and processing steps for validation."</t>
    </list>
    </t>

    </section>

    <section anchor="sec-encr" title="Cryptographic Suites">
    
    <t>Light implementations of ESP will probably implement a reduced number of cipher suites. When choosing the cipher suites it is recommended to balance the number of cipher suites as well as the cipher itself with other criteria. This section attempts to provide some generic guidances for choosing the appropriated cipher suites. Some recommended and for IoT relevant ciphers are marked in <xref target="I-D.mglt-ipsecme-rfc7321bis"/> with the tag "IoT"</t>

   <t>This section lists some of the criteria that may be considered. The list is not expected to be exhaustive and may also evolve overtime. As a result, the list is provided as indicative:
<list style="hanging" hangIndent="6">
    <t hangText="- Security : ">Security is the criteria that should be considered first when a selection of cipher suites is performed. The security of cipher suites is expected to evolve over time, and it is of primary importance to follow up-to-date security guidances and recommendations. The chosen cipher suites MUST NOT be known vulnerable or weak (see <xref target="I-D.mglt-ipsecme-rfc7321bis"/> for outdated ciphers). ESP can be used to authenticate only or to encrypt the communication. In the later case, encryption should be always considered in conjunction with authentication.  <xref target="I-D.mglt-ipsecme-rfc7321bis"/> allows combined encryption and authentication ciphers, which enables the use of modes like GCM <xref target="RFC4106"/>  or CCM <xref target="RFC4309"/>.</t>
<!--
 Note that the use of AES-CTR for encryption requires the authentication with a non zero length ICV. <xref target="I-D.mglt-ipsecme-rfc7321bis"/> supports counter mode ciphers with 8, 12 and 16 byte ICV.</t>
-->
    <t hangText="- Interoperability : ">Interoperability considers the cipher suites shared by the greatest number of nodes. Note that it is not because a cipher suite is widely deployed that is secured. As a result, security SHOULD NOT be weaken for interoperability. Life cycle of cipher suites is expected to be long enough so interoperability can still be provided with secure cipher suites. Cipher sweets marked with "MUST" in <xref target="I-D.mglt-ipsecme-rfc7321bis"/> are considered to be deployed in all ESP applications and therefore mostly interoperable. On the other hand, constraint devices may have limited interoperability requirements which makes possible to reduces the number of cipher suites to implement.</t>
    <t hangText="- Power Consumption and Cipher Suite Complexity : ">Complexity of the cipher suite or the energy associated to it are especially considered when devices have limited resources or are using some batteries, in which case the battery determine the life of the device. The choice of a cryptographic function may consider re-using specific libraries or to take advantage of hardware acceleration provided by the device. For example if the device benefits from AES hardware modules and uses AES-CTR, it may prefer AUTH_AES-XCBC for its authentication. In addition, some devices may also embed radio modules with hardware acceleration for AES-CCM, in which case, this mode may be preferred. </t>
    <t hangText="- Power Consumption and Bandwidth Consumption : ">Similarly to the cipher suite complexity, reducing the payload sent, may significantly reduce the energy consumption of the device. As a result, cipher suites with low overhead may be considered. To reduce the overall payload size one may for example, one MAY consider:
        <list style="format %c" hangIndent="6">
            <t>Use of counter-based ciphers without fixed block length (e.g. AES-CTR, or ChaCha20-Poly1305)</t>
            <t>Use of ciphers with capability of using implicit IVs <xref target="I-D.mglt-ipsecme-implicit-iv"/></t>
            <t>Use of ciphers recommended for IoT <xref target="I-D.mglt-ipsecme-rfc7321bis"/>. Note that the size of the ICV must not be performed at the expense of acceptable security. As a result, reducing the size of the ICV MUST follow the security recommendations.</t>
            <t>Sending payload data which are aligned to the cipher block length -2 for the ESP trailer</t>
        </list>
    </t>
</list>
</t>



<!--    
    <t> At the time this document is written, <xref target="RFC7321"/> is the document providing recommendations for the cryptographic suites to implement. <xref target="RFC7321"/> specifies the following mandatory to implement encryption algorythms with a MUST status: NULL <xref target="RFC2410"/> and AES-CBC <xref target="RFC3602"/>. AES-CBC is does not provide authentication and <xref target="RFC7321"/> recommedns HMAC-SHA1-96 <xref target="RFC2404"/> as the mandatory to implement algorithm for authentication.</t>

<t>As a result, for maximum interoperability with existing ESP implementation, at the time this document is written, it is recommended to implement AES-CBC and HMAC-SHA1-96 when encryption is needed and HMAC-SHA1-96 only.</t>      

<t>On the other hand, HMAC-SHA1-96 is being downgraded by recent recommendations[draft-ietf-ipsecme-rfc4307bis] as there is an industry-wide trend to deprecate its usage. In addition,
 AES-CBC consumes a lot of bandwidth compared to other proposed modes. AES in CBC mode has a 128 bit alignment which for small packets of a few bytes length generates a large overhead in term of extra padding bytes. For constraint devices especially those relying on battery, sending these unnecessary bytes may be avoided as it reduces their life time.</t>

<t>The AES-CBC mode may then be abandoned and modes like CCM <xref target="RFC4309"/> or CTR <xref target="RFC3686"/> may be used instead. If AES-CTR is considered, it may be recommended to take advantage of AES hardware acceleration and use AUTH_AES-XCBC instead of for example SHA2 based fucntions.</t> 
-->
    </section>

    <section title="IANA Considerations">
    <t> There are no IANA consideration for this document.</t>
    </section>

    <section anchor="sec-security-considerations" title="Security Considerations">

    <t>Security considerations are those of <xref target="RFC4303"/>.</t>


    </section>

    <section title="Acknowledgment">
    </section>

  </middle>

  <back>
    <references title="Normative References">
        &RFC2119;
        &RFC3602;
        &RFC3686;
        &RFC4106;
        &RFC4301;
        &RFC4303;
        &RFC4309;
        &RFC7296;
        &RFC7815;
    </references>

    <references title="Informative References">
        &I-D.mglt-ipsecme-implicit-iv;
        &I-D.mglt-ipsecme-rfc7321bis;
    </references>

    <section title="Document Change Log">
        <t>[RFC Editor: This section is to be removed before publication]</t>
        <t>-00: First version published.</t>
        <t>-01: Clarified description</t>
        <t>-02: Clarified description</t>
    </section>
  </back>
</rfc>

PAFTECH AB 2003-20262026-04-24 02:56:50