draft-ietf-lwig-minimal-esp-03.txt   draft-ietf-lwig-minimal-esp-04.txt 
Light-Weight Implementation Guidance (lwig) D. Migault Light-Weight Implementation Guidance (lwig) D. Migault
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Informational T. Guggemos Intended status: Informational T. Guggemos
Expires: September 25, 2021 LMU Munich Expires: October 3, 2021 LMU Munich
March 24, 2021 April 1, 2021
Minimal ESP Minimal ESP
draft-ietf-lwig-minimal-esp-03 draft-ietf-lwig-minimal-esp-04
Abstract Abstract
This document describes a minimal implementation of the IP This document describes a minimal implementation of the IP
Encapsulation Security Payload (ESP) defined in RFC 4303. Its Encapsulation Security Payload (ESP) defined in RFC 4303. Its
purpose is to enable implementation of ESP with a minimal set of purpose is to enable implementation of ESP with a minimal set of
options to remain compatible with ESP as described in RFC 4303. A options to remain compatible with ESP as described in RFC 4303. A
minimal version of ESP is not intended to become a replacement of the minimal version of ESP is not intended to become a replacement of the
RFC 4303 ESP. Instead, a minimal implementation is expected to be RFC 4303 ESP. Instead, a minimal implementation is expected to be
optimized for constrained environment while remaining interoperable optimized for constrained environment while remaining interoperable
with implementations of RFC 4303 ESP. Constrains include among other with implementations of RFC 4303 ESP. Some constrains include
limiting the number of flash writes, handling frequent wakeup / sleep limiting the number of flash writes, handling frequent wakeup / sleep
states, limiting wakeup time, or reducing the use of random states, limiting wakeup time, or reducing the use of random
generation. generation.
This document describes what is required from RFC 4303 ESP as well as
various ways to optimize compliance with RFC 4303 ESP.
This document does not update or modify RFC 4303, but provides a This document does not update or modify RFC 4303, but provides a
compact description of how to implement the minimal version of the compact description of how to implement the minimal version of the
protocol. If this document and RFC 4303 conflicts, then RFC 4303 is protocol. RFC 4303 remains the authoritative description.
the authoritative description.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 25, 2021. This Internet-Draft will expire on October 3, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 25 skipping to change at page 2, line 25
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Requirements Notation . . . . . . . . . . . . . . . . . . . . 2 1. Requirements Notation . . . . . . . . . . . . . . . . . . . . 2
2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
3. Security Parameter Index (SPI) (32 bit) . . . . . . . . . . . 4 3. Security Parameter Index (SPI) (32 bit) . . . . . . . . . . . 4
3.1. Considerations over SPI generation . . . . . . . . . . . 4
4. Sequence Number(SN) (32 bit) . . . . . . . . . . . . . . . . 6 4. Sequence Number(SN) (32 bit) . . . . . . . . . . . . . . . . 6
5. Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5. Padding . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6. Next Header (8 bit) . . . . . . . . . . . . . . . . . . . . . 9 6. Next Header (8 bit) . . . . . . . . . . . . . . . . . . . . . 9
7. ICV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7. ICV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
8. Cryptographic Suites . . . . . . . . . . . . . . . . . . . . 10 8. Cryptographic Suites . . . . . . . . . . . . . . . . . . . . 10
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11
10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11
11. Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . 12 11. Acknowledgment . . . . . . . . . . . . . . . . . . . . . . . 12
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12
12.1. Normative References . . . . . . . . . . . . . . . . . . 12 12.1. Normative References . . . . . . . . . . . . . . . . . . 12
12.2. Informative References . . . . . . . . . . . . . . . . . 13 12.2. Informative References . . . . . . . . . . . . . . . . . 13
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14
1. Requirements Notation 1. Requirements Notation
skipping to change at page 3, line 10 skipping to change at page 3, line 10
ESP [RFC4303] is part of the IPsec protocol suite [RFC4301]. IPsec ESP [RFC4303] is part of the IPsec protocol suite [RFC4301]. IPsec
is used to provide confidentiality, data origin authentication, is used to provide confidentiality, data origin authentication,
connectionless integrity, an anti-replay service (a form of partial connectionless integrity, an anti-replay service (a form of partial
sequence integrity) and limited traffic flow confidentiality. sequence integrity) and limited traffic flow confidentiality.
Figure 1 describes an ESP Packet. Currently ESP is implemented in Figure 1 describes an ESP Packet. Currently ESP is implemented in
the kernel of major multipurpose Operating Systems (OS). The ESP and the kernel of major multipurpose Operating Systems (OS). The ESP and
IPsec suite is usually implemented in a complete way to fit multiple IPsec suite is usually implemented in a complete way to fit multiple
purpose usage of these OS. However, completeness of the IPsec suite purpose usage of these OS. However, completeness of the IPsec suite
as well as multipurpose scope of these OS is often performed at the as well as multipurpose scope of these OS is often performed at the
expense of resources, or a lack of performance. As a result, expense of resources, or performance. As a result, constrained
constraint devices are likely to have their own implementation of ESP devices are likely to have their own implementation of ESP optimized
optimized and adapted to their specificities such as limiting the and adapted to their specificities such as limiting the number of
number of flash writes (for each packet or across wake flash writes (for each packet or across wake time), handling frequent
time), handling frequent wakeup and sleep state, limiting wakeup wakeup and sleep state, limiting wakeup time, or reducing the use of
time, or reducing the use of random generation. With the adoption of random generation. With the adoption of IPsec by IoT devices with
IPsec by IoT devices with minimal IKEv2 [RFC7815] and ESP Header minimal IKEv2 [RFC7815] and ESP Header Compression (EHC) with
Compression (EHC) with [I-D.mglt-ipsecme-diet-esp] or [I-D.mglt-ipsecme-diet-esp] or
[I-D.mglt-ipsecme-ikev2-diet-esp-extension], it becomes crucial that [I-D.mglt-ipsecme-ikev2-diet-esp-extension], it becomes crucial that
ESP implementation designed for constraint devices remain inter- ESP implementation designed for constrained devices remains inter-
operable with the standard ESP implementation to avoid a fragmented operable with the standard ESP implementation to avoid a fragmented
usage of ESP. This document describes the minimal properties and ESP usage of ESP. This document describes the minimal properties an ESP
implementation needs to meet. implementation needs to meet to remain interoperable with [RFC4303]
ESP. In addition, this document also provides a set of options to
implement these properties under certain constrained environments.
For each field of the ESP packet represented in Figure 1 this For each field of the ESP packet represented in Figure 1 this
document provides recommendations and guidance for minimal document provides recommendations and guidance for minimal
implementations. The primary purpose of Minimal ESP is to remain implementations. The primary purpose of Minimal ESP is to remain
interoperable with other nodes implementing RFC 4303 ESP, while interoperable with other nodes implementing RFC 4303 ESP, while
limiting the standard complexity of the implementation. limiting the standard complexity of the implementation.
0 1 2 3 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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ---- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ----
skipping to change at page 4, line 27 skipping to change at page 4, line 27
For nodes supporting only unicast communications, it is RECOMMENDED For nodes supporting only unicast communications, it is RECOMMENDED
to index SA with the SPI only. The index MAY be based on the full 32 to index SA with the SPI only. The index MAY be based on the full 32
bits of SPI or a subset of these bits. Some other local constraints bits of SPI or a subset of these bits. Some other local constraints
on the node may require a combination of the SPI as well as other on the node may require a combination of the SPI as well as other
parameters to index the SA. parameters to index the SA.
Values 0-255 MUST NOT be used. As per section 2.1 of [RFC4303], Values 0-255 MUST NOT be used. As per section 2.1 of [RFC4303],
values 1-255 are reserved and 0 is only allowed to be used internal values 1-255 are reserved and 0 is only allowed to be used internal
and it MUST NOT be sent on the wire. and it MUST NOT be sent on the wire.
It is RECOMMENDED to index each inbound session with a SPI randomly [RFC4303] does not require the SPI to be randomly generated over 32
generate over 32 bits. Upon the generation of a SPI the peer checks bits. However, this is the RECOMMENDED way to generate SPIs as it
the SPI is not already used and does not fall in the 0-255 range. If provides some privacy benefits and avoids, for example, correlation
the SPI has an acceptable value, it is used to index the inbound between ESP communications. To randomly generate a 32 bit SPI, the
session, otherwise the SPI is re-generated until an acceptable value node generates a random 32 bit value, checks does not fall in the
is found. A random generation provides a stateless way to generate 0-255 range. If the SPI has an acceptable value, it is used to index
the SPIs, while keeping the probability of collision between SPIs the inbound session, otherwise the SPI is re-generated until an
relatively low. acceptable value is found.
However, for some constrained nodes, generating and handling 32 bit However, some constrained nodes may be less concerned by the privacy
random SPI may consume too much resource, in which case SPI can be properties associated to SPIs randomly generated. Examples of such
generated using predictable functions or end up in a using a subset nodes might include sensors looking to reduce their code complexity,
of the possible values for SPI. In fact, the SPI does not in which case the use of a predictive function to generate the SPI
necessarily need to be randomly generated. A node provisioned with might be preferred over the generation and handling of random values.
keys by a third party - e.g. that does not generate them - and that An example of such predictable function may consider the combination
uses a transform that does not needs random data may not have such of a fixed value and the memory address of the SAD structure. For
random generators. However, nonrandom SPI and restricting their every incoming packet, the node will be able to point the SAD
possible values MAY lead to privacy and security concerns. As a structure directly from the SPI value. This avoids having a separate
result, this alternative should be considered for devices that would and additional binding between SPI and SAD entries that is involved
be strongly impacted by the generation of a random SPI and after for every incoming packet.
understanding the privacy and security impact of generating nonrandom
SPI.
When a constrained node limits the number of possible SPIs this limit 3.1. Considerations over SPI generation
should both consider the number of inbound SAs - possibly per IP
addresses - as well as the ability for the node to rekey. SPI can SPI that are not randomly generated over 32 bits MAY lead to privacy
typically be used to proceed to clean key update and the SPI value and security concerns. As a result, the use of alternative designs
may be used to indicate which key is being used. This can typically requires careful security and privacy reviews. This section provides
be implemented by a SPI being encoded with the Security Association some considerations upon the adoption of alternative designs.
Database (SAD) entry on a subset of bytes (for example 3 bytes),
while the remaining byte is left to indicate the rekey index.
Note that SPI value is used only for inbound traffic, as such the SPI Note that SPI value is used only for inbound traffic, as such the SPI
negotiated with IKEv2 [RFC7296] or [RFC7815] by a peer, is the value negotiated with IKEv2 [RFC7296] or [RFC7815] by a peer, is the value
used by the remote peer when its sends traffic. As SPI are only used used by the remote peer when it sends traffic. As SPI is only used
for inbound traffic by the peer, this allows each peer to manage the for inbound traffic by the peer, this allows each peer to manage the
set of SPIs used for its inbound traffic. set of SPIs used for its inbound traffic. Similarly, the privacy
concerns associated with the generation of nonrandom SPI is also
limited to the incoming traffic.
The use of a limited number of SPIs or nonrandom SPIs come with When alternate designs are considered, it is likely that the number
security or privacy drawbacks. Typically, a passive attacker may of possible SPIs will be limited. This limit should both consider
derive information such as the number of constraint devices the number of inbound SAs - possibly per IP addresses - as well as
connecting the remote peer, and in conjunction with data rate, the the ability for the node to rekey. SPI can typically be used to
attacker may eventually determine the application the constraint proceed to clean key update and the SPI value may be used to indicate
device is associated to. If the SPIs are set by a manufacturer or by which key is being used. This can typically be implemented by a SPI
some software application, the SPI may leak in an obvious way the being encoded with the Security Association Database (SAD) entry on a
type of sensor, the application involved or the model of the subset of bytes (for example 3 bytes), while the remaining byte is
constraint device. When identification of the application or the left to indicate the rekey index.
hardware is associated to privacy, the SPI MUST be randomly
generated. However, one needs to realize that in this case this is
likely not to be sufficient and a thorough privacy analysis is
required. More specifically, traffic pattern may also leak
significant privacy sensitive information. In other words, privacy
leakage is a complex and the use of random SPI is unlikely to be
sufficient.
As the general recommendation is to randomly generate the SPI, The use of a smaller number of SPIs across communications comes with
constraint devices that will use a (very) limited number of SPIs are privacy and security concerns. Typically some specific values or
expected to be very constraint devices with very limited subset of SPI values may reveal the models or manufacturer of the
capabilities, where the use of randomly generated SPI may prevent node implementing ESP. This may raise some privacy issues as an
them to implement IPsec. In this case the ability to provision observer is likely to be able to determine the constrained devices of
nonrandom SPI enables these devices to secure their communications. the network. In some cases, these nodes may host a very limited
For example, the SPI could be -at least partially - generated based number of applications - typically a single application - in which
on the SAD structure in memory which would simplify the case the SPI would provide some information related to the
implementation. These devices, due to their limitations, are application of the user. In addition, the device or application may
expected to provide limited information and how the use of nonrandom be associated with some vulnerabilities, in which case specific SPI
SPI impacts privacy requires further analysis. Typically, values may be used by an attacker to discover vulnerabilities.
temperature sensors, wind sensors, used outdoor do not leak privacy
sensitive information. When used indoor, a sensor that reports every
minute an encrypted status of the door (closed or opened) leaks truly
little privacy sensitive information outside the local network.
As far as security is concerned, revealing the type of application or While the use of randomly generated SPI may reduce the leakage or
model of the constraint device could be used to identify the privacy or security related information by ESP itself, these
vulnerabilities the constraint device is subject to. This is information may also be leaked otherwise and a privacy analysis
especially sensitive for constraint devices where patches or software should consider at least the type of information as well the traffic
updates will be challenging to operate. As a result, these devices pattern. Typically, temperature sensors, wind sensors, used outdoors
may remain vulnerable for relatively long period. In addition, do not leak privacy sensitive information and mosty of its traffic is
predictable SPIs enable an attacker to forge packets with a valid expected to be outbound traffic. When used indoors, a sensor that
SPI. Such packet will not be rejected due to an SPI mismatch, but reports every minute an encrypted status of the door (closed or
instead after the signature check which requires more resource and opened) leaks truly little privacy sensitive information outside the
thus make DoS more efficient, especially for devices powered by local network.
batteries.
4. Sequence Number(SN) (32 bit) 4. Sequence Number(SN) (32 bit)
According to [RFC4303], the Sequence Number (SN) is a mandatory 32 According to [RFC4303], the Sequence Number (SN) is a mandatory 32
bits field in the packet. bits field in the packet.
The SN is set by the sender so the receiver can implement anti-replay The SN is set by the sender so the receiver can implement anti-replay
protection. The SN is derived from any strictly increasing function protection. The SN is derived from any strictly increasing function
that guarantees: if packet B is sent after packet A, then SN of that guarantees: if packet B is sent after packet A, then SN of
packet B is strictly greater than the SN of packet A. packet B is strictly greater than the SN of packet A.
Some constraint devices may establish communication with specific Some constrained devices may establish communication with specific
devices, like a specific gateway, or nodes similar to them. As a devices, like a specific gateway, or nodes similar to them. As a
result, the sender may know whereas the receiver implements anti- result, the sender may know whereas the receiver implements anti-
replay protection or not. Even though the sender may know the replay protection or not. Even though the sender may know the
receiver does not implement anti-replay protection, the sender MUST receiver does not implement anti-replay protection, the sender MUST
implement an always increasing function to generate the SN. implement an always increasing function to generate the SN.
Usually, SN is generated by incrementing a counter for each packet Usually, SN is generated by incrementing a counter for each packet
sent. A constraint device may avoid maintaining this context and use sent. A constrained device may avoid maintaining this context and
another source that is known to always increase. Typically, use another source that is known to always increase. Typically,
constraint nodes using 802.15.4 Time Slotted Channel Hopping (TSCH), constrained nodes using 802.15.4 Time Slotted Channel Hopping (TSCH),
whose communication is heavily dependent on time, can take advantage whose communication is heavily dependent on time, can take advantage
of their clock to generate the SN. The problem with regular sequence of their clock to generate the SN. A lot of IoT devices are in a
numbers is that you need to store them to stable storage every time sleep state most of the time wake up and are only awake to perform a
you go sleep. Storing the SA information (keys, SPIs etc) to the specific operation before going back to sleep. They do have separate
flash once after the creation of the SA can be done, as that is just hardware that allows them to wake up after a certain timeout, and
one flash write per SA creation. Synchronizing sequence number to most likely also timers that start running when the device was booted
flash after every packet would quickly wear out the flash, and likely up, so they might have a concept of time with certain granularity.
slow down the system greatly, as writing to flash is not as fast as This requires to store any information in a stable storage - such as
reading. Note, that lots of these IoT devices are in a sleep state flash memory - that can be restored across sleeps. Storing
most of the time wake up and are only awake to perform a specific information associated with the SA such as SN requires some read and
operation before going back to sleep. They do have separate hardware writing operation on a stable storage after each packet is sent as
that allows them to wake up after certain timeout, and most likely opposed to SPI or keys that are only written at the creation of the
also timers that start running when the device was booted up, so they SA. Such operations are likely to wear out the flash, and slow down
might have concept of time with certain granularity. They might not the system greatly, as writing to flash is not as fast as reading.
have real time clocks or any information how their internal clock Their internal clocks/timers might not be very accurate, but they
relates to real world clock, and their internal clocks/timers might should be enough to know that each time they wake up their time is
not be very accurate, but they should be enough to know that each greater than what it was last time they woke up. Using time for SN
time they wake up their time is greater than what it was last time would guarantee a strictly increasing function and avoid storing any
they woke up. Using time for SN would guarantee a strictly additional values or context related to the SN. When the use of a
increasing function and avoid storing any additional values or clock is considered, one should take care that packets associated
context related to the SN. When the use of a clock is considered, with a given SA are not sent with the same time value. Note however
one should take care that packets associated to a given SA are not that standard receivers are generally configured with incrementing
sent with the same time value. Note however that standard receivers counters and, if not appropriately configured, the use of a
are generally configured with incrementing counters and, if not significantly larger SN may result in the packet out of the
appropriately configured, the use of a significantly larger SN may receiver's windows and that packet being discarded.
result in the packet out of the receiver's windows and that packet
being discarded.
For inbound traffic, it is RECOMMENDED that any receiver provide a For inbound traffic, it is RECOMMENDED that any receiver provides
anti-replay protection, and the size of the window depends on the anti-replay protection, and the size of the window depends on the
ability of the network to deliver packet out of order. As a result, ability of the network to deliver packets out of order. As a result,
in environment where out of order packets is not possible the window in an environment where out of order packets is not possible the
size can be set to one. However, while RECOMMENDED, there is no window size can be set to one. However, while RECOMMENDED, there are
requirements to implement an anti-replay protection mechanism no requirements to implement an anti-replay protection mechanism
implemented by IPsec. If an IoT device such as a temperature sensor implemented by IPsec. Similarly to the SN the implementation of anti
is sending a temperature every 60 seconds, the implementation of an replay protection may require the device to write the received SN for
anti-replay mechanism requires the sensor to receive an every packet, which may in some cases come with the same drawbacks as
acknowledgment for the receiver as well as storing an additional those exposed for SN. As a result, some implementations MAY drop an
value across sleep time. Such design is likely to be non optimal in non required anti replay protection especially when the necessary
term of limiting the number of read/write on a flash card as well as resource involved overcomes the benefit of the mechanism. A typical
limiting the time the sensor needs to be awake. On the other hand, example might consider an IoT device such as a temperature sensor
the impact provided by an anti-replay mechanisms implemented on the that is sending a temperature every 60 seconds, and that receives an
sensor is very limited and unlikely to change the way of working of acknowledgment from the receiver. In such cases, the ability to
the sensor. A node MAY drop anti-replay protection provided by spoof and replay an acknowledgement is of limited interest and may
IPsec, and instead implement its own internal mechanism. not justify the implementation of an anti replay mechanism.
Receiving peers may also implement their own anti-replay mechanism.
Typically, when the sending peer is using SN based on time, anti-
replay may be implemented by discarding any packets that present a SN
whose value is too much in the past. Note that such mechanisms may
consider clock drifting in various ways in addition to acceptable
delay induced by the network to avoid the anti replay windows
rejecting legitimate packets. When a packet is received at a regular
time interval, some variant of time based mechanisms may not even use
the value of the SN, but instead only consider the receiving time of
the packet.
SN can be encoded over 32 bits or 64 bits - known as Extended SN can be encoded over 32 bits or 64 bits - known as Extended
Sequence Number (ESN). As per [RFC4303], the support ESN is not Sequence Number (ESN). As per [RFC4303], the support ESN is not
mandatory. The determination of the use of ESN is based on the mandatory. The determination of the use of ESN is based on the
largest possible value a SN can take over a session. When SN is largest possible value a SN can take over a session. When SN is
incremented for each packet, the number of packets sent over the incremented for each packet, the number of packets sent over the
lifetime of a session may be considered. However, when the SN is lifetime of a session may be considered. However, when the SN is
incremented differently - such as when time is used - the maximum incremented differently - such as when time is used - the maximum
value SN needs to be considered instead. Note that the limit of value SN needs to be considered instead. Note that the limit of
messages being sent is primary determined by the security associated messages being sent is primarily determined by the security
to the key rather than the SN. The security of all data protected associated with the key rather than the SN. The security of all data
under a given key decreases slightly with each message and a node protected under a given key decreases slightly with each message and
MUST ensure the limit is not reached - even though the SN would a node MUST ensure the limit is not reached - even though the SN
permit it. In a constrained environment, it is likely that the would permit it. Estimation of the maximum number of packets to be
implementation of a rekey mechanism is preferred over the use of ESN. sent by a node is always challenging and as such should be considered
cautiously as nodes could be online for much more time than expected.
Even for constrained devices, it is RECOMMENDED to implement some
rekey mechanisms (see Section 10).
5. Padding 5. Padding
The purpose of padding is to respect the 32 bit alignment of ESP or The purpose of padding is to respect the 32 bit alignment of ESP or
block size expected by an encryption transform - such as AES-CBC for block size expected by an encryption transform - such as AES-CBC for
example. ESP MUST have at least one padding byte Pad Length that example. ESP MUST have at least one padding byte Pad Length that
indicates the padding length. ESP padding bytes are generated by a indicates the padding length. ESP padding bytes are generated by a
succession of unsigned bytes starting with 1, 2, 3 with the last byte 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 set to Pad Length, where Pad Length designates the length of the
padding bytes. padding bytes.
Checking the padding structure is not mandatory, so the constraint Checking the padding structure is not mandatory, so the constrained
device may not proceed to such checks, however, in order to device may not proceed to such checks, however, in order to
interoperate with existing ESP implementations, it MUST build the interoperate with existing ESP implementations, it MUST build the
padding bytes as recommended by ESP. padding bytes as recommended by ESP.
In some situation the padding bytes may take a fix value. This would In some situation the padding bytes may take a fix value. This would
typically be the case when the Data Payload is of fix size. typically be the case when the Data Payload is of fix size.
ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a ESP [RFC4303] also provides Traffic Flow Confidentiality (TFC) as a
way to perform padding to hide traffic characteristics, which differs way to perform padding to hide traffic characteristics, which differs
from respecting a 32 bit alignment. TFC is not mandatory and MUST be from respecting a 32 bit alignment. TFC is not mandatory and MUST be
negotiated with the SA management protocol. TFC has not yet being negotiated with the SA management protocol. TFC has not yet being
widely adopted for standard ESP traffic. One possible reason is that widely adopted for standard ESP traffic. One possible reason is that
it requires to shape the traffic according to one traffic pattern it requires to shape the traffic according to one traffic pattern
that needs to be maintained. This is likely to require extra that needs to be maintained. This is likely to require extra
processing as well as providing a "well recognized" traffic shape processing as well as providing a "well recognized" traffic shape
which could end up being counterproductive. As such TFC is not which could end up being counterproductive. As such, it is NOT
expected to be supported by a minimal ESP implementation. RECOMMENDED that minimal ESP implementation supports TFC.
As a result, TFC cannot be enabled with minimal ESP, and As a result, TFC cannot be enabled with minimal ESP, and
communication protection that were rely on TFC will be more sensitive communication protection that were rely on TFC will be more sensitive
to traffic shaping. This could expose the application as well as the to traffic shaping. This could expose the application as well as the
devices used to a passive monitoring attacker. Such information devices used to a passive monitoring attacker. Such information
could be used by the attacker in case a vulnerability is disclosed on could be used by the attacker in case a vulnerability is disclosed on
the specific device. In addition, some application use - such as the specific device. In addition, some application use - such as
health applications - may also reveal important privacy oriented health applications - may also reveal important privacy oriented
information. information.
skipping to change at page 9, line 10 skipping to change at page 9, line 14
have a sensor sending some information at regular time interval, have a sensor sending some information at regular time interval,
rather when a specific event is happening. Typically, a sensor rather when a specific event is happening. Typically, a sensor
monitoring the temperature, or a door is expected to send regularly monitoring the temperature, or a door is expected to send regularly
the information - i.e. the temperature of the room or whether the the information - i.e. the temperature of the room or whether the
door is closed or open) instead of only sending the information when door is closed or open) instead of only sending the information when
the temperature has raised or when the door is being opened. the temperature has raised or when the door is being opened.
6. Next Header (8 bit) 6. Next Header (8 bit)
According to [RFC4303], the Next Header is a mandatory 8 bits field According to [RFC4303], the Next Header is a mandatory 8 bits field
in the packet. Next header is intended to specify the data contained in the packet. Next header specifies the data contained in the
in the payload as well as dummy packet, i.e. packets with the Next payload as well as dummy packet, i.e. packets with the Next Header
Header with a value 59 meaning "no next header". In addition, the with a value 59 meaning "no next header". In addition, the Next
Next Header may also carry an indication on how to process the packet Header may also carry an indication on how to process the packet
[I-D.nikander-esp-beet-mode]. [I-D.nikander-esp-beet-mode].
The ability to generate and receive dummy packet is required by The ability to generate and receive dummy packet is required by
[RFC4303]. For interoperability, a minimal ESP implementation MUST [RFC4303]. For interoperability, a minimal ESP implementation MUST
discard dummy packets. Note that such recommendation only applies discard dummy packets without indicating an error. Note that such
for nodes receiving packets, and that nodes designed to only send recommendation only applies for nodes receiving packets, and that
data may not implement this capability. nodes designed to only send data may not implement this capability.
As the generation of dummy packets is subject to local management and As the generation of dummy packets is subject to local management and
based on a per-SA basis, a minimal ESP implementation may not based on a per-SA basis, a minimal ESP implementation may not
generate such dummy packet. More especially, in constraint generate such dummy packet. More especially, in constrained
environment sending dummy packets may have too much impact on the environment sending dummy packets may have too much impact on the
device lifetime, and so may be avoided. On the other hand, device lifetime, and so may be avoided. On the other hand,
constrained nodes may be dedicated to specific applications, in which constrained nodes may be dedicated to specific applications, in which
case, traffic pattern may expose the application or the type of node. case, traffic pattern may expose the application or the type of node.
For these nodes, not sending dummy packet may have some privacy For these nodes, not sending dummy packet may have some privacy
implication that needs to be measured. However, for the same reasons implication that needs to be measured. However, for the same reasons
exposed in Section 5 traffic shaping at the IPsec layer may also exposed in Section 5 traffic shaping at the IPsec layer may also
introduce some traffic pattern, and on constraint devices the introduce some traffic pattern, and on constrained devices the
application is probably the most appropriated layer to limit the risk application is probably the most appropriated layer to limit the risk
of leaking information by traffic shaping. of leaking information by traffic shaping.
In some cases, devices are dedicated to a single application or a In some cases, devices are dedicated to a single application or a
single transport protocol, in which case, the Next Header has a fix single transport protocol, in which case, the Next Header has a fix
value. value.
Specific processing indications have not been standardized yet Specific processing indications have not been standardized yet
[I-D.nikander-esp-beet-mode] and is expected to result from an [I-D.nikander-esp-beet-mode] and is expected to result from an
agreement between the peers. As a result, it is not expected to be agreement between the peers. As a result, it SHOULD NOT be part of a
part of a minimal implementation of ESP. minimal implementation of ESP.
7. ICV 7. ICV
The ICV depends on the cryptographic suite used. Currently [RFC8221] The ICV depends on the cryptographic suite used. Currently [RFC8221]
only recommends cryptographic suites with an ICV which makes the ICV only recommends cryptographic suites with an ICV which makes the ICV
a mandatory field. a mandatory field.
As detailed in Section 8 we recommend using authentication, the ICV As detailed in [RFC8221] authentication or authenticated encryption
field is expected to be present that is to say with a size different are RECOMMENDED and as such the ICV field MUST be present with a size
from zero. This makes it a mandatory field which size is defined by different from zero. It length is defined by the security
the security recommendations only. recommendations only.
8. Cryptographic Suites 8. Cryptographic Suites
The cryptographic suites implemented are an important component of The cryptographic suites implemented are an important component of
ESP. The recommended algorithms to use are expected to evolve over ESP. The recommended algorithms to use are expected to evolve over
time and implementers SHOULD follow the recommendations provided by time and implementers SHOULD follow the recommendations provided by
[RFC8221] and updates. Recommendations are provided for standard [RFC8221] and updates.
nodes as well as constrained nodes.
This section lists some of the criteria that may be considered. The This section lists some of the criteria that may be considered. The
list is not expected to be exhaustive and may also evolve overtime. list is not expected to be exhaustive and may also evolve overtime.
As a result, the list is provided as indicative: As a result, the list is provided as indicative:
1. Security: Security is the criteria that should be considered 1. Security: Security is the criteria that should be considered
first for the selection of encryption algorithm transform. The first for the selection of encryption algorithm transform. The
security of encryption algorithm transforms is expected to evolve security of encryption algorithm transforms is expected to evolve
over time, and it is of primary importance to follow up-to-date over time, and it is of primary importance to follow up-to-date
security guidance and recommendations. The chosen encryption security guidance and recommendations. The chosen encryption
algorithm transforms MUST NOT be known vulnerable or weak (see algorithm MUST NOT be known vulnerable or weak (see [RFC8221] for
[RFC8221] for outdated ciphers). ESP can be used to authenticate outdated ciphers). ESP can be used to authenticate only or to
only or to encrypt the communication. In the latter case, encrypt the communication. In the latter case, authenticated
authenticated encryption must always be considered [RFC8221]. encryption must always be considered [RFC8221].
2. Resilience to nonce re-use: Some transforms -including AES-GCM - 2. Resilience to nonce re-use: Some transforms -including AES-GCM -
are very sensitive to nonce collision with a given key. While are very sensitive to nonce collision with a given key. While
the generation of the nonce may prevent such collision during a the generation of the nonce may prevent such collision during a
session, the mechanisms are unlikely to provide such protection session, the mechanisms are unlikely to provide such protection
across reboot. This causes an issue for devices that are across reboot. This causes an issue for devices that are
configured with a key. When the key is likely to be re-used configured with a key. When the key is likely to be re-used
across reboots, it is RECOMMENDED to consider transforms that are across reboots, it is RECOMMENDED to consider algorithms that are
nonce misuse resistant such as AES-GCM-SIV for example[RFC8452] nonce misuse resistant such as, for example, AES-SIV [RFC5297],
AES-GCM-SIV [RFC8452] or Deoxys-II [DeoxysII]. Note however that
currently none of them has yet been defined for ESP.
3. Interoperability: Interoperability considers the encryption 3. Interoperability: Interoperability considers the encryption
algorithm transforms shared with the other nodes. Note that it algorithm transforms shared with the other nodes. Note that it
is not because an encryption algorithm transform is widely is not because an encryption algorithm transform is widely
deployed that it is secured. As a result, security SHOULD NOT be deployed that it is secured. As a result, security SHOULD NOT be
weakened for interoperability. [RFC8221] and successors consider weakened for interoperability. [RFC8221] and successors consider
the life cycle of encryption algorithm transforms sufficiently the life cycle of encryption algorithm transforms sufficiently
long to provide interoperability. Constraint devices may have long to provide interoperability. Constraint devices may have
limited interoperability requirements which makes possible to limited interoperability requirements which makes possible to
reduces the number of encryption algorithm transforms to reduces the number of encryption algorithm transforms to
skipping to change at page 12, line 11 skipping to change at page 12, line 18
node is provisioned with a session key that is used across reboot, node is provisioned with a session key that is used across reboot,
the implementer MUST ensure that the mechanisms put in place remain the implementer MUST ensure that the mechanisms put in place remain
valid across reboot as well. valid across reboot as well.
It is RECOMMENDED to use ESP in conjunction of key management It is RECOMMENDED to use ESP in conjunction of key management
protocols such as for example IKEv2 [RFC7296] or minimal IKEv2 protocols such as for example IKEv2 [RFC7296] or minimal IKEv2
[RFC7815]. Such mechanisms are responsible to negotiate fresh [RFC7815]. Such mechanisms are responsible to negotiate fresh
session keys as well as prevent a session key being use beyond its session keys as well as prevent a session key being use beyond its
lifetime. When such mechanisms cannot be implemented and the session lifetime. When such mechanisms cannot be implemented and the session
key is, for example, provisioned, the nodes MUST ensure that keys are key is, for example, provisioned, the nodes MUST ensure that keys are
not used beyond their lifetime and that the appropriated use of the not used beyond their lifetime and that the appropriate use of the
key remains across reboots - e.g. conditions on counters and nonces key remains across reboots - e.g. conditions on counters and nonces
remains valid. remains valid.
When a node generates its key or when random value such as nonces are When a node generates its key or when random value such as nonces are
generated, the random generation MUST follow [RFC4086]. In addition generated, the random generation MUST follow [RFC4086]. In addition
[SP-800-90A-Rev-1] provides appropriated guidance to build random [SP-800-90A-Rev-1] provides appropriated guidance to build random
generators based on deterministic random functions. generators based on deterministic random functions.
11. Acknowledgment 11. Acknowledgment
skipping to change at page 13, line 34 skipping to change at page 13, line 42
<https://www.rfc-editor.org/info/rfc8221>. <https://www.rfc-editor.org/info/rfc8221>.
[RFC8750] Migault, D., Guggemos, T., and Y. Nir, "Implicit [RFC8750] Migault, D., Guggemos, T., and Y. Nir, "Implicit
Initialization Vector (IV) for Counter-Based Ciphers in Initialization Vector (IV) for Counter-Based Ciphers in
Encapsulating Security Payload (ESP)", RFC 8750, Encapsulating Security Payload (ESP)", RFC 8750,
DOI 10.17487/RFC8750, March 2020, DOI 10.17487/RFC8750, March 2020,
<https://www.rfc-editor.org/info/rfc8750>. <https://www.rfc-editor.org/info/rfc8750>.
12.2. Informative References 12.2. Informative References
[DeoxysII]
Jeremy, J., Ivica, I., Thomas, T., and Y. Yannick, "Deoxys
v1.41", October 2016,
<https://competitions.cr.yp.to/round3/deoxysv141.pdf>.
[I-D.mglt-ipsecme-diet-esp] [I-D.mglt-ipsecme-diet-esp]
Migault, D., Guggemos, T., Bormann, C., and D. Schinazi, Migault, D., Guggemos, T., Bormann, C., and D. Schinazi,
"ESP Header Compression and Diet-ESP", draft-mglt-ipsecme- "ESP Header Compression and Diet-ESP", draft-mglt-ipsecme-
diet-esp-07 (work in progress), March 2019. diet-esp-07 (work in progress), March 2019.
[I-D.mglt-ipsecme-ikev2-diet-esp-extension] [I-D.mglt-ipsecme-ikev2-diet-esp-extension]
Migault, D., Guggemos, T., and D. Schinazi, "Internet Key Migault, D., Guggemos, T., and D. Schinazi, "Internet Key
Exchange version 2 (IKEv2) extension for the ESP Header Exchange version 2 (IKEv2) extension for the ESP Header
Compression (EHC) Strategy", draft-mglt-ipsecme-ikev2- Compression (EHC) Strategy", draft-mglt-ipsecme-ikev2-
diet-esp-extension-01 (work in progress), June 2018. diet-esp-extension-01 (work in progress), June 2018.
[I-D.nikander-esp-beet-mode] [I-D.nikander-esp-beet-mode]
Nikander, P. and J. Melen, "A Bound End-to-End Tunnel Nikander, P. and J. Melen, "A Bound End-to-End Tunnel
(BEET) mode for ESP", draft-nikander-esp-beet-mode-09 (BEET) mode for ESP", draft-nikander-esp-beet-mode-09
(work in progress), August 2008. (work in progress), August 2008.
[RFC5297] Harkins, D., "Synthetic Initialization Vector (SIV)
Authenticated Encryption Using the Advanced Encryption
Standard (AES)", RFC 5297, DOI 10.17487/RFC5297, October
2008, <https://www.rfc-editor.org/info/rfc5297>.
[RFC8452] Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV: [RFC8452] Gueron, S., Langley, A., and Y. Lindell, "AES-GCM-SIV:
Nonce Misuse-Resistant Authenticated Encryption", Nonce Misuse-Resistant Authenticated Encryption",
RFC 8452, DOI 10.17487/RFC8452, April 2019, RFC 8452, DOI 10.17487/RFC8452, April 2019,
<https://www.rfc-editor.org/info/rfc8452>. <https://www.rfc-editor.org/info/rfc8452>.
[SP-800-90A-Rev-1] [SP-800-90A-Rev-1]
Elain, E. and J. Kelsey, "Recommendation for Random Number Elain, E. and J. Kelsey, "Recommendation for Random Number
Generation Using Deterministic Random Bit Generators", Generation Using Deterministic Random Bit Generators",
<https://csrc.nist.gov/publications/detail/sp/800-90a/rev- <https://csrc.nist.gov/publications/detail/sp/800-90a/rev-
1/final>. 1/final>.
 End of changes. 40 change blocks. 
175 lines changed or deleted 182 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/