<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" submissionType="IETF" docName="draft-ietf-ipsecme-ikev2-rename-esn-05" number="9827" consensus="true" ipr="trust200902" updates="7296" obsoletes="" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3" xml:lang="en">

  <front>
    <title abbrev="Renaming ESN in IKEv2">Renaming the Extended Sequence Numbers
    (ESN) Transform Type in the Internet Key Exchange Protocol Version 2
    (IKEv2)</title>
    <seriesInfo name="RFC" value="9827"/>
    <author fullname="Valery Smyslov" initials="V." surname="Smyslov">
      <organization>ELVIS-PLUS</organization>
      <address>
        <postal>
          <country>Russian Federation</country>
        </postal>
        <email>svan@elvis.ru</email>
      </address>
    </author>
    <date month="November" year="2025"/>

    <area>SEC</area>
    <workgroup>ipsecme</workgroup>

<keyword>replay protection</keyword>
<keyword>anti-replay</keyword>
<keyword>IPsec</keyword>
<keyword>ESP</keyword>
<keyword>AH</keyword>



    <abstract>
      <t> This document clarifies and extends the meaning of Transform Type 5 in Internet Key Exchange Protocol Version 2 (IKEv2).
      It updates RFC 7296 by renaming Transform Type 5 from "Extended Sequence Numbers (ESN)" 
      to "Sequence Numbers (SN)". It also renames two currently defined values for this Transform Type: 
      value 0 from "No Extended Sequence Numbers" to "32-bit Sequential Numbers" and value 1 from 
      "Extended Sequence Numbers" to "Partially Transmitted 64-bit Sequential Numbers".
      </t>
    </abstract>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>The IP Security (IPsec) Architecture <xref target="RFC4301"/> defines a set of security services provided by the 
      Authentication Header (AH) <xref target="RFC4302"/> and Encapsulating Security Payload (ESP) <xref target="RFC4303"/>.
      One of these services is replay protection, which is referred to as "anti-replay" in these documents. In IPsec, the anti-replay service is optional;
      each receiver of AH and/or ESP packets can choose whether to enable it on a per Security Association (SA) basis.
      The replay protection in AH and ESP is achieved by means of a monotonically increasing counter that never wraps around and 
      is sent in each AH or ESP packet in the Sequence Number field. The receiver maintains a sliding window that allows 
      duplicate packets to be detected.
      </t>
      <t> Both AH and ESP allow use of either a 32-bit counter or a 64-bit counter.
      The latter case is referred to as Extended Sequence Numbers (ESN) in AH and ESP specifications.
      Since the Sequence Number field in both AH and ESP headers is only 32 bits in size, 
      in case of ESN the high-order 32 bits of the counter are not transmitted and are determined by the receiver 
      based on previously received packets.
      </t>
      <t>The receiver decides whether to enable the anti-replay service based only on the receiver's local policy, so
      the sender, in accordance with the specifications for AH (<xref target="RFC4302" sectionFormat="comma" section="3.3.2"/>) and ESP (<xref target="RFC4303" sectionFormat="comma" section="3.3.3"/>),
      should always assume that the replay protection is enabled on the receiving side. Thus, the sender should always send the increasing counter values 
      and should take care that the counter never wraps around. AH and ESP specifications also discuss situations in which
      replay protection is not possible to achieve, even if senders do all as prescribed -- like in multicast 
      Security Associations with multiple unsynchronized senders. Both AH and ESP specifications allow the sender to 
      avoid maintaining the counter if the sender has been notified that the anti-replay service 
      is disabled by the receiver or is not possible to achieve.
      </t>
      <t> AH and ESP Security Associations are usually established using  IKEv2 <xref target="RFC7296"/>. 
      The process of SA establishment includes calculation of a shared key and negotiation of various SA parameters, 
      such as cryptographic algorithms. This negotiation in IKEv2 is performed via transforms (see <xref target="RFC7296" sectionFormat="of" section="3.3.2"/>).
      The type of transform  determines what parameter is being negotiated. Each Transform Type has an associated list of possible values 
      (called Transform IDs) that determine the possible options for negotiation. See <xref target="IKEV2-IANA"/> for the list of Transform Types 
      and associated Transform IDs.
      </t>
      <t> Transform Type 5 ("Extended Sequence Numbers (ESN)") is used in IKEv2 to negotiate the way sequence numbers 
      for replay protection are generated, transmitted, and processed in the context of an SA. There are 
      two values are defined for this Transform Type -- "No Extended Sequence Numbers" and "Extended Sequence Numbers". 
      </t>
      <t> This document updates the IKEv2 specification <xref target="RFC7296"/> by renaming Transform Type 5 and the
      two associated Transform IDs.
      </t>
    </section>
    <section anchor="problem">
      <name>Problem Description</name>
      <t> IKEv2 currently has no means to negotiate the case when both peers agree that replay protection is not needed.
        Even when both peers locally disable anti-replay service as receivers, they still need to maintain increasing sequence numbers 
        as senders, taking care that they never wrap around (see <xref target="I-D.pan-ipsecme-anti-replay-notification"/>).
      </t>
      <t> There is also no way to inform receivers that replay protection is not possible for a particular SA
        (for example in case of a multicast SA with several unsynchronized senders).
      </t>
      <t>Future IPsec protocols may provide more options for the handling of anti-replay counters,
        like sending full 64-bit sequence numbers or completely omitting them in packets (see <xref target="I-D.ietf-ipsecme-eesp"/>).
        These options will require means to be negotiated in IKEv2.
      </t>
      <t> Transform Type 5 is the best candidate for addressing these issues:
        it is already used for negotiation of how sequence numbers are handled in AH and ESP, and 
        it is possible to define additional Transform IDs that could be used in the corresponding situations.
        However, the current definition of Transform Type 5 is too narrow -- its name implies that
        this transform can only be used for negotiation of using ESN.
      </t>
    </section>
    <section anchor="clarification">
      <name>Extending the Semantics of Transform Type 5</name>
      <t> This document extends the semantics of Transform Type 5 in IKEv2 to be defined as follows:
      </t>
     <t indent="3"> Transform Type 5 defines the set of properties of sequence numbers of IPsec packets of a given SA when these packets enter the network.
     </t>
      <t> This updated definition is clarified as follows: 
      </t>
      <ul>
        <li>
          <t>"Sequence numbers" in this definition are not necessarily the
   content of the Sequence Number field in the IPsec packets; they
   may also be some logical entities (e.g., counters) that could
   be constructed taking some information that is not transmitted on the wire into account.
          </t>
        </li>
        <li>

          <t> The properties are interpreted as characteristics of IPsec SA
          packets rather than the results of sender actions.  For example, in
          multicast SA with multiple unsynchronized senders, even if each
          sender ensures the uniqueness of sequence numbers it generates, the
          uniqueness of sequence numbers for all IPsec packets is not
          guaranteed.
          </t>
        </li>
        <li>
          <t> The properties are defined for the packets just entering the
          network and not for the packets that receivers get.  This is because
          network behavior may break some of these properties (e.g., packet duplication would break sequence number uniqueness).
          </t>
        </li>
        <li>
          <t> The properties of sequence numbers are interpreted in a broad
          sense, which includes the case when sequence numbers are absent.
          </t>
        </li>
      </ul>

      <t> Given this updated definition, Transform Type 5 in the "Transform Type
 Values" registry <xref target="IKEV2-IANA"/> has been renamed from "Extended Sequence
 Numbers (ESN)" to "Sequence Numbers (SN)" in the sense
 that it defines the properties of the sequence numbers in general.</t>
      <t> It is expected that new Transform IDs will be defined for this Transform Type in the future 
        (like in G-IKEv2 <xref target="RFC9838"/> for the case of multicast SAs).
        Documents defining new Transform IDs should include descriptions of the properties the sequence numbers 
        would have if the new Transform ID was selected. In particular, the descriptions should include discussion of whether these properties
        allow replay protection to be achieved. 
      </t>
      <t> Some existing protocols (like Implicit IV in ESP <xref target="RFC8750"/> or
        Aggregation and Fragmentation for ESP <xref target="RFC9347"/>) rely on properties that are guaranteed 
        for the currently defined Transform IDs; however, this might not be true for future Transform IDs. 
        When a new Transform ID is defined, its description should include  discussion about the possibility 
        of using the Transform ID in protocols that rely on some particular properties of sequence numbers.
      </t>
      <t>The two currently defined Transform IDs for Transform Type 5 define the following properties of sequence numbers.
      </t>

      <ul>
        <li>
          <t> Value 0 defines sequence numbers as
          monotonically increasing 32-bit counters that are transmitted in the
          Sequence Number field of AH and ESP packets. They never wrap around
          and are guaranteed to be unique, thus they are suitable for replay
          protection.  They can also be used with protocols that rely on
          sequence number uniqueness (e.g., <xref target="RFC8750"/>) or monotonically 
          increasing sequence numbers (e.g., <xref target="RFC9347"/>). The sender and
          the receiver actions are defined in Sections <xref target="RFC4302"
          sectionFormat="bare" section="3.3.2"/> and <xref target="RFC4302"
          sectionFormat="bare" section="3.4.3"/> of <xref target="RFC4302"/>
          for AH and in Sections <xref target="RFC4303" sectionFormat="bare"
          section="3.3.3"/> and <xref target="RFC4303" sectionFormat="bare"
          section="3.4.3"/> of <xref target="RFC4303"/> for ESP.
          </t>
        </li>
        <li>
          <t> Value 1 defines sequence numbers as
          monotonically increasing 64-bit counters. The low-order 32 bits are
          transmitted in the Sequence Number field of AH and ESP packets, and
          the high-order 32 bits are implicitly determined on receivers based
          on previously received packets. The sequence numbers never wrap
          around and are guaranteed to be unique, thus they are suitable for
          replay protection. They can also be used with protocols that rely on
          sequence number uniqueness (e.g., <xref target="RFC8750"/>) or their
          monotonic increase (e.g., <xref target="RFC9347"/>). To
          correctly process the incoming packets on receivers, the packets must
          be authenticated (even when the replay protection is not used).  The
          sender and the receiver actions are defined in Sections <xref
          target="RFC4302" sectionFormat="bare" section="3.3.2"/> and <xref
          target="RFC4302" sectionFormat="bare" section="3.4.3"/> of <xref
          target="RFC4302"/> for AH and in Sections <xref target="RFC4303"
          sectionFormat="bare" section="3.3.3"/> and <xref target="RFC4303"
          sectionFormat="bare" section="3.4.3"/> of <xref target="RFC4303"/>
          for ESP.
          </t>
        </li>
      </ul>
      <t> Given the descriptions above and the new definition of Transform Type 5, the two currently defined Transform IDs
        are renamed to better reflect the properties of sequence numbers they assume.
      </t>

      <ul>
        <li>
          <t> Transform ID 0 is renamed from "No Extended Sequence Numbers" to
          "32-bit Sequential Numbers".</t>
        </li>
        <li>
          <t> Transform ID 1 is renamed from "Extended Sequence Numbers" to
          "Partially Transmitted 64-bit Sequential Numbers".</t>
        </li>
      </ul>
      <t> Note that the above descriptions do not change the existing
      semantics of these Transform IDs, they only provide clarification.  Also note that ESP and AH packet processing for these Transform IDs is not
      affected, and bits on the wire do not change.
      </t>
    </section>
    <section>
      <name>Security Considerations</name>
      <t> This document does not affect security of the AH, ESP, and IKEv2 protocols.
      </t>
    </section>
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t> This document makes changes to registries within the "Internet Key Exchange Version 2 (IKEv2) Parameters" registry group
      <xref target="IKEV2-IANA"/>. 
      </t>

<t>The "Transform Type Values" registry has been updated as follows: </t>
<ul> 
       <li>
          <t>renamed Transform Type 5 from "Extended Sequence Numbers (ESN)" 
          to "Sequence Numbers (SN)".
          </t>
        </li>
        <li>
          <t>added as a reference to this RFC for Transform Type 5.</t>
        </li>
        <li>
          <t>added the following note:</t>
            <blockquote><t>The "Sequence Numbers (SN)" Transform Type was originally named
            "Extended Sequence Numbers (ESN)" and was referenced by that name
            in a number of RFCs published prior to [RFC9827], which gave it
            the current title.</t></blockquote>
        </li>
</ul>
<t>The "Transform Type 5 - Extended Sequence Numbers Transform IDs" registry has been updated as follows: </t>

<ul>

        <li>
          <t>renamed the registry from "Transform Type 5 - Extended Sequence Numbers Transform IDs" to
          "Transform Type 5 - Sequence Numbers Transform IDs" and added this document as a reference. 
          </t>
        </li>
        <li><t>split the "Reserved" (2-65535) range of numbers as shown below.</t>

<table>
  <thead>
    <tr>
      <th>Number</th>
      <th>Name</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>2-1023</td>
      <td colspan="2">Unassigned</td>
    </tr>
    <tr>
      <td>1024-65535</td>
      <td>Reserved for Private Use</td>
      <td>[RFC9827]</td>
    </tr>
  </tbody>
</table>
          </li>

        <li>
          <t>renamed Transform ID 0 from "No Extended Sequence Numbers" 
          to "32-bit Sequential Numbers".
          </t>
        </li>
        <li>
          <t>renamed Transform ID 1 from "Extended Sequence Numbers" 
          to "Partially Transmitted 64-bit Sequential Numbers".
          </t>
        </li>
        <li>
          <t>added a reference to this RFC for Transform ID 0 and Transform ID 1.</t>
        </li>
        <li>
          <t>added the following registry notes:</t>
          <blockquote><t>This registry was originally named "Transform Type 5 - Extended
          Sequence Numbers Transform IDs" and was referenced using that name
          in a number of RFCs published prior to [RFC9827], which gave it the
          current title.
          </t></blockquote>
          <blockquote><t>The "32-bit Sequential Numbers" Transform ID was originally named "No
          Extended Sequence Numbers" and was referenced by that name in a
          number of RFCs published prior to [RFC9827], which gave it the
          current title.
          </t></blockquote>
          <blockquote><t>The "Partially Transmitted 64-bit Sequential Numbers" Transform ID
          was originally named "Extended Sequence Numbers" and was referenced
          by that name in a number of RFCs published prior to [RFC9827], which
          gave it the current title.
          </t></blockquote>
          <blockquote><t>Numbers in the range 2-65535 were originally marked
          as "Reserved" and were reclassified as "Unassigned" and "Reserved
          for Private Use" by [RFC9827].
        </t></blockquote>
        </li>
      </ul>
    </section>
  </middle>

  <back>
<displayreference target="I-D.ietf-ipsecme-eesp" to="EESP"/>
<displayreference target="I-D.pan-ipsecme-anti-replay-notification" to="ANTIREPLAY"/>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <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.4302.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"/>
        <reference anchor="IKEV2-IANA" target="http://www.iana.org/assignments/ikev2-parameters">
          <front>
            <title>Internet Key Exchange Version 2 (IKEv2) Parameters</title>
            <author>
              <organization>IANA</organization>
            </author>
            <date/>
          </front>
        </reference>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8750.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9347.xml"/>
<!--  [I-D.ietf-ipsecme-g-ikev2] 
draft-ietf-ipsecme-g-ikev2-21 
-->
<reference anchor="RFC9838" target="https://www.rfc-editor.org/info/rfc9838">
<front>
<title>Group Key Management Using the Internet Key Exchange Protocol Version 2 (IKEv2)</title>
<author initials='V' surname='Smyslov' fullname='Valery Smyslov'>
  <organization/>
</author>
<author initials='B' surname='Weis' fullname='Brian Weis'>
  <organization/>
</author>

<date month='November' year='2025'/>
</front>
<seriesInfo name="RFC" value="9838"/>
<seriesInfo name="DOI" value="10.17487/RFC9838"/>
</reference>


<!-- [I-D.klassert-ipsecme-eesp] 
draft-klassert-ipsecme-eesp-02 became ietf-ipsecme-eesp
-->
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-ipsecme-eesp.xml"/>

<!-- [I-D.pan-ipsecme-anti-replay-notification]
draft-pan-ipsecme-anti-replay-notification-01 
expired -->
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.pan-ipsecme-anti-replay-notification.xml"/>
      </references>
    </references>

    <section anchor="Acknowledgements" numbered="false"> 
      <name>Acknowledgements</name>
      <t>This document was created as a result of discussions with <contact
      fullname="Russ Housley"/>, <contact fullname="Tero Kivinen"/>, <contact
      fullname="Paul Wouters"/>, and <contact fullname="Antony Antony"/> about
      the best way to extend the meaning of the Extended Sequence Numbers
      transform in IKEv2.
      </t>
    </section>

  </back>

</rfc>
