<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-ipsecme-ikev2-intermediate-10" indexInclude="true" ipr="trust200902" number="9242" prepTime="2022-05-27T16:18:15" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-ipsecme-ikev2-intermediate-10" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc9242" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="Intermediate IKEv2 Exchange">Intermediate Exchange in the Internet Key Exchange Protocol Version 2 (IKEv2)</title>
    <seriesInfo name="RFC" value="9242" stream="IETF"/>
    <author initials="V" surname="Smyslov" fullname="Valery Smyslov">
      <organization showOnFrontPage="true">ELVIS-PLUS</organization>
      <address>
        <postal>
          <street>PO Box 81</street>
          <city>Moscow (Zelenograd)</city>
          <code>124460</code>
          <country>Russian Federation</country>
        </postal>
        <phone>+7 495 276 0211</phone>
        <email>svan@elvis.ru</email>
      </address>
    </author>
    <date month="05" year="2022"/>
    <area>sec</area>
    <workgroup>ipsecme</workgroup>
    <keyword>IKE_INTERMEDIATE</keyword>
    <keyword>Quantum Computer resistant key exchange method</keyword>
    <keyword>Post-quantum</keyword>
    <abstract pn="section-abstract">
      <t indent="0" pn="section-abstract-1"> This document defines a new exchange, called "Intermediate Exchange", for the Internet Key Exchange Protocol Version 2 (IKEv2). This exchange can be used for transferring large amounts of data in the process of IKEv2 
      Security Association (SA) establishment. An example of the need to do this is using key exchange methods resistant to Quantum Computers (QCs) for IKE SA establishment.


The Intermediate Exchange makes it possible to use the existing IKE
fragmentation mechanism (which cannot be used in the initial IKEv2 exchange),
helping to avoid IP fragmentation of large IKE messages if they need to be
sent before IKEv2 SA is established.



      </t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t indent="0" pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t indent="0" pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t indent="0" pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc9242" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t indent="0" pn="section-boilerplate.2-1">
            Copyright (c) 2022 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t indent="0" pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Revised BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Revised BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t indent="0" keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology-and-notation">Terminology and Notation</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t indent="0" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-intermediate-exchange-detai">Intermediate Exchange Details</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t indent="0" keepWithNext="true" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-support-for-intermediate-ex">Support for Intermediate Exchange Negotiation</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t indent="0" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-using-intermediate-exchange">Using Intermediate Exchange</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t indent="0" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-the-ike_intermediate-exchan">The IKE_INTERMEDIATE Exchange Protection and Authentication</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2.3.2">
                  <li pn="section-toc.1-1.3.2.3.2.1">
                    <t indent="0" pn="section-toc.1-1.3.2.3.2.1.1"><xref derivedContent="3.3.1" format="counter" sectionFormat="of" target="section-3.3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-protection-of-ike_intermedi">Protection of IKE_INTERMEDIATE Messages</xref></t>
                  </li>
                  <li pn="section-toc.1-1.3.2.3.2.2">
                    <t indent="0" pn="section-toc.1-1.3.2.3.2.2.1"><xref derivedContent="3.3.2" format="counter" sectionFormat="of" target="section-3.3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-authentication-of-ike_inter">Authentication of IKE_INTERMEDIATE Exchanges</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.3.2.4">
                <t indent="0" pn="section-toc.1-1.3.2.4.1"><xref derivedContent="3.4" format="counter" sectionFormat="of" target="section-3.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-error-handling-in-the-ike_i">Error Handling in the IKE_INTERMEDIATE Exchange</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t indent="0" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-interaction-with-other-ikev">Interaction with Other IKEv2 Extensions</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t indent="0" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t indent="0" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t indent="0" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.7.2">
              <li pn="section-toc.1-1.7.2.1">
                <t indent="0" pn="section-toc.1-1.7.2.1.1"><xref derivedContent="7.1" format="counter" sectionFormat="of" target="section-7.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.7.2.2">
                <t indent="0" pn="section-toc.1-1.7.2.2.1"><xref derivedContent="7.2" format="counter" sectionFormat="of" target="section-7.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.8">
            <t indent="0" pn="section-toc.1-1.8.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-example-of-ike_intermediate">Example of IKE_INTERMEDIATE Exchange</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t indent="0" pn="section-toc.1-1.9.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgements">Acknowledgements</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t indent="0" pn="section-toc.1-1.10.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-address">Author's Address</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t indent="0" pn="section-1-1"> The Internet Key Exchange Protocol       
Version 2 (IKEv2) defined in <xref target="RFC7296" format="default" sectionFormat="of" derivedContent="RFC7296"/>
            uses UDP as a transport for its messages. If the size of a message is larger than the Path MTU (PMTU), IP fragmentation
            takes place, which has been shown to cause operational challenges
            in certain network configurations and devices. The problem is described
            in more detail in <xref target="RFC7383" format="default" sectionFormat="of" derivedContent="RFC7383"/>, which also defines an extension to IKEv2 called "IKE fragmentation".
            This extension allows IKE messages to be fragmented at the IKE level, eliminating possible issues
            caused by IP fragmentation. However, IKE fragmentation cannot be used in the initial IKEv2 exchange 
            (IKE_SA_INIT). In most cases, this limitation is not a problem, since the IKE_SA_INIT
            messages are usually small enough not to cause IP fragmentation.
      </t>
      <t indent="0" pn="section-1-2"> However, the situation has been changing recently. One example of the need to transfer large amounts 
            of data before an IKE SA is created is using the QC-resistant key exchange methods in IKEv2. 

	    Recent progress in quantum computing has led to concern that classical Diffie-Hellman key
            exchange methods will become insecure in the relatively near future and should be replaced with 
            QC-resistant ones.

	    Currently, most QC-resistant key exchange methods have
            large public keys. If these keys are exchanged in the IKE_SA_INIT exchange, then
            IP fragmentation will probably take place; therefore, all the problems caused by it will become inevitable.
      </t>
      <t indent="0" pn="section-1-3"> A possible solution to this problem would be to use TCP as a transport for IKEv2, as defined
            in <xref target="RFC8229" format="default" sectionFormat="of" derivedContent="RFC8229"/>. However, this approach has significant drawbacks and is 
            intended to be a last resort when UDP transport is completely blocked by intermediate
            network devices. 
      </t>
      <t indent="0" pn="section-1-4"> This specification describes a way to transfer a large amount of data in IKEv2 using UDP transport.
            For this purpose, the document defines a new exchange for IKEv2 called "Intermediate Exchange" or "IKE_INTERMEDIATE".
            One or more of these exchanges may take place right after the IKE_SA_INIT exchange and prior
            to the IKE_AUTH exchange. The IKE_INTERMEDIATE exchange messages can be fragmented using the IKE fragmentation mechanism, 
            so these exchanges may be used to transfer large amounts of data that don't fit into the IKE_SA_INIT exchange 
            without causing IP fragmentation.
      </t>
      <t indent="0" pn="section-1-5"> The Intermediate Exchange can be used to transfer large public keys of QC-resistant key exchange methods, 
            but its application is not limited to this use case. This exchange can also be used 
            whenever some data needs to be transferred before the IKE_AUTH exchange and for some reason
            the IKE_SA_INIT exchange is not suited for this purpose.  This document defines the IKE_INTERMEDIATE
            exchange without tying it to any specific use case. It is expected that separate specifications will define 
            for which purposes and how the IKE_INTERMEDIATE exchange is used in IKEv2. Some considerations
            must be taken into account when designing such specifications:

      </t>
      <ul spacing="normal" bare="false" empty="false" indent="3" pn="section-1-6">
        <li pn="section-1-6.1"> The IKE_INTERMEDIATE exchange is not intended for 
              bulk transfer. This document doesn't set a hard cap on
              the amount of data that can be safely transferred using this mechanism, 
              as it depends on its application. However, in most cases, it is anticipated that
              the amount of data will be limited to tens of kilobytes (a few hundred kilobytes 
              in extreme cases), which is believed to cause no network problems
              (see <xref target="RFC6928" format="default" sectionFormat="of" derivedContent="RFC6928"/> as an example of experiments with sending
              similar amounts of data in the first TCP flight). See also 
              <xref target="security" format="default" sectionFormat="of" derivedContent="Section 5"/> for the discussion of possible DoS attack vectors 
              when the amount of data sent in the IKE_INTERMEDIATE exchange is too large.
              </li>
        <li pn="section-1-6.2"> It is expected that the IKE_INTERMEDIATE exchange will 
              only be used for transferring data that is needed to establish IKE SA
              and not for data that can be sent later when this SA is established.
              </li>
      </ul>
    </section>
    <section anchor="mustshouldmay" numbered="true" toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-terminology-and-notation">Terminology and Notation</name>
      <t indent="0" pn="section-2-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
      </t>
      <t indent="0" pn="section-2-2"> It is expected that readers are familiar with the terms used in the
      IKEv2 specification <xref target="RFC7296" format="default" sectionFormat="of" derivedContent="RFC7296"/>. Notation
      for the payloads contained in IKEv2 messages is defined in <xref target="RFC7296" sectionFormat="of" section="1.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-1.2" derivedContent="RFC7296"/>.
      </t>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-intermediate-exchange-detai">Intermediate Exchange Details</name>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.1">
        <name slugifiedName="name-support-for-intermediate-ex">Support for Intermediate Exchange Negotiation</name>
        <t indent="0" pn="section-3.1-1"> The initiator indicates its support for Intermediate Exchange by including a 
                notification of type INTERMEDIATE_EXCHANGE_SUPPORTED in the IKE_SA_INIT request message. 
                If the responder also supports this exchange, it includes this notification 
                in the response message.
        </t>
        <artwork align="left" name="" type="" alt="" pn="section-3.1-2">
Initiator                                 Responder
-----------                               -----------
HDR, SAi1, KEi, Ni,
[N(INTERMEDIATE_EXCHANGE_SUPPORTED)] --&gt;
                                   &lt;-- HDR, SAr1, KEr, Nr, [CERTREQ],
                                 [N(INTERMEDIATE_EXCHANGE_SUPPORTED)]
                </artwork>
        <t indent="0" pn="section-3.1-3">
The INTERMEDIATE_EXCHANGE_SUPPORTED is a Status Type IKEv2	
notification with Notify Message Type 16438. When it is sent, the Protocol ID	
and SPI Size fields in the Notify payload are both set to 0.

                This specification doesn't define any data that this notification may contain,
                so the Notification Data is left empty. However, future enhancements to this specification may override this.
                Implementations <bcp14>MUST</bcp14> ignore non-empty Notification Data if they don't understand its purpose.
        </t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.2">
        <name slugifiedName="name-using-intermediate-exchange">Using Intermediate Exchange</name>
        <t indent="0" pn="section-3.2-1"> If both peers indicated their support for the Intermediate Exchange, the initiator may
                use one or more these exchanges to transfer additional data. Using the Intermediate Exchange is optional; 
                the initiator may find it unnecessary even when support for this exchange has been negotiated.
        </t>
        <t indent="0" pn="section-3.2-2"> The Intermediate Exchange is denoted as IKE_INTERMEDIATE; its Exchange Type is 43.
        </t>
        <artwork align="left" name="" type="" alt="" pn="section-3.2-3">
Initiator                                 Responder
-----------                               -----------
HDR, ..., SK {...}  --&gt;
                                     &lt;--  HDR, ..., SK {...}
                </artwork>
        <t indent="0" pn="section-3.2-4"> The initiator may use several IKE_INTERMEDIATE exchanges if necessary.
                Since window size is initially set to 1 for both peers (<xref target="RFC7296" sectionFormat="of" section="2.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.3" derivedContent="RFC7296"/>), these exchanges <bcp14>MUST</bcp14> be sequential 
                and <bcp14>MUST</bcp14> all be completed before the IKE_AUTH exchange is initiated.
                The IKE SA <bcp14>MUST NOT</bcp14> be considered as established until the IKE_AUTH
                exchange is successfully completed.
        </t>
        <t indent="0" pn="section-3.2-5"> The Message IDs for IKE_INTERMEDIATE exchanges <bcp14>MUST</bcp14> be chosen according to the standard
                IKEv2 rule, described in <xref target="RFC7296" sectionFormat="of" section="2.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.2" derivedContent="RFC7296"/>, i.e.,
                it is set to 1 for the first IKE_INTERMEDIATE exchange, 2 for the next (if any), and so on.
                Implementations <bcp14>MUST</bcp14> verify that Message IDs in the IKE_INTERMEDIATE messages they receive actually follow this rule.
                The Message ID for the first pair of IKE_AUTH messages is one more 
                than the value used in the last IKE_INTERMEDIATE exchange.
        </t>
        <t indent="0" pn="section-3.2-6"> If the presence of NAT is detected in the IKE_SA_INIT exchange via NAT_DETECTION_SOURCE_IP and
                NAT_DETECTION_DESTINATION_IP notifications, then the peers switch to port 4500 in the first IKE_INTERMEDIATE exchange
                and use this port for all subsequent exchanges, as described in <xref target="RFC7296" sectionFormat="of" section="2.23" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.23" derivedContent="RFC7296"/>.
        </t>
        <t indent="0" pn="section-3.2-7"> The content of the IKE_INTERMEDIATE exchange messages depends on the data being transferred
                and will be defined by specifications utilizing this exchange.
                However, since the main motivation for the IKE_INTERMEDIATE exchange is to avoid
                IP fragmentation when large amounts of data need to be transferred
                prior to the IKE_AUTH exchange, the Encrypted payload <bcp14>MUST</bcp14> be present in the 
                IKE_INTERMEDIATE exchange messages, and payloads containing large amounts of data
                <bcp14>MUST</bcp14> be placed inside it. This will allow IKE fragmentation 
                <xref target="RFC7383" format="default" sectionFormat="of" derivedContent="RFC7383"/> to take place, provided it is supported 
                by the peers and negotiated in the initial exchange.
        </t>
        <t indent="0" pn="section-3.2-8"> <xref target="example" format="default" sectionFormat="of" derivedContent="Appendix A"/> contains an example of using an IKE_INTERMEDIATE exchange
                in creating an IKE SA.
        </t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.3">
        <name slugifiedName="name-the-ike_intermediate-exchan">The IKE_INTERMEDIATE Exchange Protection and Authentication</name>
        <section anchor="protection" numbered="true" toc="include" removeInRFC="false" pn="section-3.3.1">
          <name slugifiedName="name-protection-of-ike_intermedi">Protection of IKE_INTERMEDIATE Messages</name>
          <t indent="0" pn="section-3.3.1-1"> The keys SK_e[i/r] and SK_a[i/r] for the protection of IKE_INTERMEDIATE exchanges
                    are computed in the standard fashion, as defined in <xref target="RFC7296" sectionFormat="of" section="2.14" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.14" derivedContent="RFC7296"/>. 
          </t>
          <t indent="0" pn="section-3.3.1-2"> Every subsequent IKE_INTERMEDIATE exchange uses the most recently calculated IKE SA keys before 
                    this exchange is started. So, the first IKE_INTERMEDIATE exchange always uses SK_e[i/r] and SK_a[i/r] keys 
                    that were computed as a result of the IKE_SA_INIT exchange. If additional key exchange is performed 
                    in the first IKE_INTERMEDIATE exchange, resulting in the update of SK_e[i/r] and SK_a[i/r], 
                    then these updated keys are used for protection of the second IKE_INTERMEDIATE exchange. 
                    Otherwise, the original SK_e[i/r] and SK_a[i/r] keys are used again, and so on.
          </t>
          <t indent="0" pn="section-3.3.1-3"> Once all the IKE_INTERMEDIATE exchanges are completed, the most recently calculated
                    SK_e[i/r] and SK_a[i/r] keys are used for protection of the IKE_AUTH exchange and all subsequent exchanges.
          </t>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-3.3.2">
          <name slugifiedName="name-authentication-of-ike_inter">Authentication of IKE_INTERMEDIATE Exchanges</name>
          <t indent="0" pn="section-3.3.2-1"> The IKE_INTERMEDIATE messages must be authenticated in the IKE_AUTH exchange,
                    which is performed by adding their content into the AUTH payload calculation. It is anticipated that in many use cases, IKE_INTERMEDIATE 
                    messages will be fragmented using the IKE fragmentation <xref target="RFC7383" format="default" sectionFormat="of" derivedContent="RFC7383"/> mechanism. According to <xref target="RFC7383" format="default" sectionFormat="of" derivedContent="RFC7383"/>, 
                    when IKE fragmentation is negotiated, the initiator may first send a request message in unfragmented form, 
                    but later turn on IKE fragmentation and resend it fragmented if no response is received after a few retransmissions. 
                    In addition, peers may resend a fragmented message using different fragment sizes to perform simple PMTU discovery.
          </t>
          <t indent="0" pn="section-3.3.2-2"> The requirement to support this behavior makes authentication challenging: it is not appropriate to add 
                    on-the-wire content of the IKE_INTERMEDIATE messages into the AUTH payload calculation,
                    because implementations are generally unaware of which form these messages are received by peers. 
                    Instead, a more complex scheme is used; authentication is performed by adding the content of these messages before
                    their encryption and possible fragmentation, so that the data to be authenticated doesn't depend on the form
                    the messages are delivered in.
          </t>
          <t indent="0" pn="section-3.3.2-3">
If one or more IKE_INTERMEDIATE exchanges took place, the definition of the
blob to be signed (or MACed) from <xref target="RFC7296" sectionFormat="of" section="2.15" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.15" derivedContent="RFC7296"/> is modified as follows:
	    
          </t>
          <sourcecode markers="false" pn="section-3.3.2-4">
InitiatorSignedOctets = RealMsg1 | NonceRData | MACedIDForI | IntAuth
ResponderSignedOctets = RealMsg2 | NonceIData | MACedIDForR | IntAuth

IntAuth =  IntAuth_iN | IntAuth_rN | IKE_AUTH_MID

IntAuth_i1 = prf(SK_pi1,              IntAuth_i1A [| IntAuth_i1P])
IntAuth_i2 = prf(SK_pi2, IntAuth_i1 | IntAuth_i2A [| IntAuth_i2P])
IntAuth_i3 = prf(SK_pi3, IntAuth_i2 | IntAuth_i3A [| IntAuth_i3P])
...
IntAuth_iN = prf(SK_piN, IntAuth_iN-1 | IntAuth_iNA [| IntAuth_iNP])

IntAuth_r1 = prf(SK_pr1,              IntAuth_r1A [| IntAuth_r1P])
IntAuth_r2 = prf(SK_pr2, IntAuth_r1 | IntAuth_r2A [| IntAuth_r2P])
IntAuth_r3 = prf(SK_pr3, IntAuth_r2 | IntAuth_r3A [| IntAuth_r3P])
...
IntAuth_rN = prf(SK_prN, IntAuth_rN-1 | IntAuth_rNA [| IntAuth_rNP])
</sourcecode>
          <t indent="0" pn="section-3.3.2-5"> The essence of this modification is that a new chunk called "IntAuth" is appended to the string of octets that is signed (or MACed) by the peers.
                    IntAuth consists of three parts: IntAuth_iN, IntAuth_rN, and IKE_AUTH_MID. 
          </t>
          <t indent="0" pn="section-3.3.2-6"> The IKE_AUTH_MID chunk is a value of the Message ID field from the IKE Header of the first round of the IKE_AUTH exchange. 
                    It is represented as a four-octet integer in network byte order (in other words, exactly as it appears on the wire).
          </t>
          <t indent="0" pn="section-3.3.2-7"> The IntAuth_iN and IntAuth_rN chunks represent the cumulative result of applying the negotiated Pseudorandom Function (PRF)
                    to all IKE_INTERMEDIATE exchange messages sent during IKE SA establishment by the initiator and the responder, respectively.
                    After the first IKE_INTERMEDIATE exchange is complete, peers calculate the IntAuth_i1 value
                    by applying the negotiated PRF to the content of the request message from this exchange and
                    calculate the IntAuth_r1 value by applying the negotiated PRF to the content of the response message.
                    For every subsequent IKE_INTERMEDIATE exchange (if any), peers recalculate these values as follows:
                    after the nth exchange is complete, they compute IntAuth_[i/r]n by applying the negotiated 
                    PRF to the concatenation of IntAuth_[i/r](n-1) (computed for the previous IKE_INTERMEDIATE exchange) and 
                    the content of the request (for IntAuth_in) or response (for IntAuth_rn) messages from this exchange. After all IKE_INTERMEDIATE exchanges
                    are over, the resulted IntAuth_[i/r]N values (assuming N exchanges took place) are used in computing the AUTH payload.
          </t>
          <t indent="0" pn="section-3.3.2-8"> For the purpose of calculating the IntAuth_[i/r]* values, the content of the IKE_INTERMEDIATE messages 
                    is represented as two chunks of data: mandatory IntAuth_[i/r]*A, optionally followed by IntAuth_[i/r]*P.
          </t>
          <t indent="0" pn="section-3.3.2-9"> The IntAuth_[i/r]*A chunk consists of the sequence of octets from the first octet of the IKE Header (not including the prepended four octets of zeros, 
                    if UDP encapsulation or TCP encapsulation of ESP packets is used) to the last octet of the generic header of the Encrypted payload. 
                    The scope of IntAuth_[i/r]*A is identical to the scope of Associated Data defined for the use of AEAD algorithms in IKEv2 
                    (see <xref target="RFC5282" sectionFormat="of" section="5.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc5282#section-5.1" derivedContent="RFC5282"/>), which is stressed by using the "A" suffix in its name. Note that calculation of IntAuth_[i/r]*A
                    doesn't depend on whether an AEAD algorithm or a plain cipher is used in IKE SA.
          </t>
          <t indent="0" pn="section-3.3.2-10"> The IntAuth_[i/r]*P chunk is present if the Encrypted payload is not empty. It consists of the content of the Encrypted payload 
                    that is fully formed but not yet encrypted. The Initialization Vector, Padding, Pad Length, and Integrity Checksum Data fields
                    (see <xref target="RFC7296" sectionFormat="of" section="3.14" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-3.14" derivedContent="RFC7296"/>) are not included into the calculation. 
                    In other words, the IntAuth_[i/r]*P chunk is the inner payloads of the Encrypted payload in plaintext form,
                    which is stressed by using the "P" suffix in its name.
          </t>
          <figure anchor="layout" align="left" suppress-title="false" pn="figure-1">
            <name slugifiedName="name-data-to-authenticate-in-the">Data to Authenticate in the IKE_INTERMEDIATE Exchange Messages</name>
            <artwork align="left" name="" type="" alt="" pn="section-3.3.2-11.1">
                     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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ^ ^
|                       IKE SA Initiator's SPI                  | | |
|                                                               | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ I |
|                       IKE SA Responder's SPI                  | K |
|                                                               | E |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |
|  Next Payload | MjVer | MnVer | Exchange Type |     Flags     | H |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ d |
|                          Message ID                           | r A
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
|                       Adjusted Length                         | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ v |
|                                                               |   |
~                 Unencrypted payloads (if any)                 ~   |
|                                                               |   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ^ |
| Next Payload  |C|  RESERVED   |    Adjusted Payload Length    | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | v
|                                                               | |
~                     Initialization Vector                     ~ E
|                                                               | E
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ c ^
|                                                               | r |
~             Inner payloads (not yet encrypted)                ~   P
|                                                               | P |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ l v
|              Padding (0-255 octets)           |  Pad Length   | d
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|                                                               | |
~                    Integrity Checksum Data                    ~ |
|                                                               | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ v
                    </artwork>
          </figure>
          <t indent="0" pn="section-3.3.2-12"> <xref target="layout" format="default" sectionFormat="of" derivedContent="Figure 1"/> illustrates the layout of the IntAuth_[i/r]*A (denoted as A) 
                    and the IntAuth_[i/r]*P (denoted as P) chunks in case the Encrypted payload is not empty.
          </t>
          <t indent="0" pn="section-3.3.2-13"> For the purpose of prf calculation, the Length field in the IKE Header and the Payload Length 
                    field in the Encrypted payload header are adjusted so that they don't count the lengths
                    of Initialization Vector, Integrity Checksum Data, Padding, and Pad Length fields.
                    In other words, the Length field in the IKE Header (denoted as Adjusted Length in <xref target="layout" format="default" sectionFormat="of" derivedContent="Figure 1"/>)
                    is set to the sum of the lengths of IntAuth_[i/r]*A and IntAuth_[i/r]*P, and the Payload Length
                    field in the Encrypted payload header (denoted as Adjusted Payload Length in <xref target="layout" format="default" sectionFormat="of" derivedContent="Figure 1"/>)
                    is set to the length of IntAuth_[i/r]*P plus the size of the Encrypted payload header (four octets).
          </t>
          <t indent="0" pn="section-3.3.2-14"> The prf calculations <bcp14>MUST</bcp14> be applied to whole messages only, before possible IKE fragmentation. 
                    This ensures that the IntAuth will be the same regardless of whether or not IKE fragmentation takes place.
                    If the message was received in fragmented form, it <bcp14>MUST</bcp14> be reconstructed before calculating the prf as if it were received unfragmented.
                    While reconstructing, the RESERVED field in the reconstructed Encrypted payload header <bcp14>MUST</bcp14> be set to the value of the RESERVED 
                    field in the Encrypted Fragment payload header from the first fragment (with the Fragment Number field set to 1).
          </t>
          <t indent="0" pn="section-3.3.2-15"> Note that it is possible to avoid actual reconstruction of the message by incrementally calculating prf on 
                    decrypted (or ready to be encrypted) fragments. However, care must be taken to properly replace the content of the Next Header and the Length fields 
                    so that the result of computing the prf is the same as if it were computed on the reconstructed message.
          </t>
          <t indent="0" pn="section-3.3.2-16"> Each calculation of IntAuth_[i/r]* uses its own keys SK_p[i/r]*, which are the most recently updated SK_p[i/r] keys 
                    available before the corresponded IKE_INTERMEDIATE exchange is started. The first IKE_INTERMEDIATE exchange 
                    always uses the SK_p[i/r] keys that were computed in the IKE_SA_INIT exchange as SK_p[i/r]1. If the first IKE_INTERMEDIATE exchange performs
                    additional key exchange resulting in an SK_p[i/r] update, then these updated SK_p[i/r] keys are used as SK_p[i/r]2; otherwise, the original 
                    SK_p[i/r] keys are used, and so on. Note that if keys are updated, then for any given IKE_INTERMEDIATE exchange, the keys SK_e[i/r] and SK_a[i/r] 
                    used for protection of its messages (see <xref target="protection" format="default" sectionFormat="of" derivedContent="Section 3.3.1"/>) and the key SK_p[i/r] for its authentication are always 
                    from the same generation.
          </t>
        </section>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.4">
        <name slugifiedName="name-error-handling-in-the-ike_i">Error Handling in the IKE_INTERMEDIATE Exchange</name>
        <t indent="0" pn="section-3.4-1"> Since messages of the IKE_INTERMEDIATE exchange are not authenticated until the IKE_AUTH exchange successfully 
                completes, possible errors need to be handled with care. There is a trade-off between providing
                better diagnostics of the problem and risk of becoming part of a DoS attack.
                Sections <xref target="RFC7296" sectionFormat="bare" section="2.21.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.21.1" derivedContent="RFC7296"/> and <xref target="RFC7296" sectionFormat="bare" section="2.21.2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7296#section-2.21.2" derivedContent="RFC7296"/> of <xref target="RFC7296" format="default" sectionFormat="of" derivedContent="RFC7296"/> describe how errors are handled
                in initial IKEv2 exchanges; these considerations are also applied to the IKE_INTERMEDIATE exchange
                with the qualification that not all error notifications may appear in the IKE_INTERMEDIATE
                exchange (for example, errors concerning authentication are generally only applicable to the IKE_AUTH exchange).
        </t>
      </section>
    </section>
    <section anchor="interaction" numbered="true" toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-interaction-with-other-ikev">Interaction with Other IKEv2 Extensions</name>
      <t indent="0" pn="section-4-1"> The IKE_INTERMEDIATE exchanges <bcp14>MAY</bcp14> be used during the IKEv2 Session Resumption <xref target="RFC5723" format="default" sectionFormat="of" derivedContent="RFC5723"/>
            between the IKE_SESSION_RESUME and the IKE_AUTH exchanges. To be able to use it, peers <bcp14>MUST</bcp14> negotiate 
            support for Intermediate Exchange by including INTERMEDIATE_EXCHANGE_SUPPORTED notifications in the 
            IKE_SESSION_RESUME messages. Note that a flag denoting whether peers supported the IKE_INTERMEDIATE exchange 
            is not stored in the resumption ticket and is determined each time from the IKE_SESSION_RESUME exchange.
      </t>
    </section>
    <section anchor="security" numbered="true" toc="include" removeInRFC="false" pn="section-5">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t indent="0" pn="section-5-1"> The data that is transferred by means of the IKE_INTERMEDIATE exchanges is not authenticated
            until the subsequent IKE_AUTH exchange is complete. However, if the data is placed inside
            the Encrypted payload, then it is protected from passive eavesdroppers. In addition, the peers
            can be certain that they receive messages from the party they performed the IKE_SA_INIT exchange with
            if they can successfully verify the Integrity Checksum Data of the Encrypted payload.
      </t>
      <t indent="0" pn="section-5-2"> The main application for the Intermediate Exchange is to transfer
      large amounts of data before an IKE SA is set up, without causing IP
      fragmentation. For that reason, it is expected that IKE fragmentation
      will be employed in IKE_INTERMEDIATE exchanges in most cases. <xref target="RFC7383" sectionFormat="of" section="5" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7383#section-5" derivedContent="RFC7383"/>
      contains security considerations for IKE fragmentation.
      </t>
      <t indent="0" pn="section-5-3"> Since authentication of peers occurs only in the IKE_AUTH exchange, a malicious initiator
            may use the Intermediate Exchange to mount a DoS attack on the responder. In this case, it 
            starts creating an IKE SA, negotiates using the Intermediate Exchanges, and transfers a lot
            of data to the responder that may also require computationally expensive processing. 
            Then, it aborts the SA establishment before the IKE_AUTH exchange.
            Specifications utilizing the Intermediate Exchange <bcp14>MUST NOT</bcp14> allow an unlimited number of these exchanges to take
            place at the initiator's discretion. It is recommended that these
            specifications be defined in such a way that the responder would
            know (possibly via negotiation with the initiator) the exact
            number of these exchanges that need to take place.

In other words, after the IKE_SA_INIT exchange is
complete, it is preferred that both the initiator and the responder
know the exact number of IKE_INTERMEDIATE exchanges they have to
perform; it is possible that some IKE_INTERMEDIATE exchanges are
optional and are performed at the initiator's discretion, but if a specification
defines optional use of IKE_INTERMEDIATE, then the maximum number 
of these exchanges must be hard capped by the corresponding specification.



	    In addition, <xref target="RFC8019" format="default" sectionFormat="of" derivedContent="RFC8019"/> provides guidelines for the responder of how to
            deal with DoS attacks during IKE SA establishment.
      </t>
      <t indent="0" pn="section-5-4"> Note that if an attacker was able to break the key exchange in real time
            (e.g., by means of a quantum computer), then the security of the IKE_INTERMEDIATE exchange would degrade.
            In particular, such an attacker would be able to both read data contained in the 
            Encrypted payload and forge it. The forgery would become evident in the IKE_AUTH
            exchange (provided the attacker cannot break the employed authentication mechanism),
            but the ability to inject forged IKE_INTERMEDIATE exchange messages with a valid Integrity Check Value (ICV) would allow
            the attacker to mount a DoS attack. Moreover, in this situation, if the negotiated
            PRF was not secure against a second preimage attack with known key, then the attacker could 
            forge the IKE_INTERMEDIATE exchange messages without later being detected in the IKE_AUTH exchange.
            To do this, the attacker would find the same IntAuth_[i/r]* value for the forged message as for the original.
      </t>
    </section>
    <section anchor="iana" numbered="true" toc="include" removeInRFC="false" pn="section-6">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t indent="0" pn="section-6-1">This document defines a new Exchange Type in the "IKEv2 Exchange Types" registry:</t>
      <table align="left" anchor="IKE_INTERMEDIATE" pn="table-1">
        <name slugifiedName="name-ikev2-exchange-types">IKEv2 Exchange Types</name>
        <thead>
          <tr>
            <th align="left" colspan="1" rowspan="1">Value</th>
            <th align="left" colspan="1" rowspan="1">Exchange Type</th>
            <th align="left" colspan="1" rowspan="1">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">43</td>
            <td align="left" colspan="1" rowspan="1">IKE_INTERMEDIATE</td>
            <td align="left" colspan="1" rowspan="1">RFC 9242</td>
          </tr>
        </tbody>
      </table>
      <t indent="0" pn="section-6-3">This document also defines a new Notify Message Type in the "IKEv2 Notify Message Types - Status Types" registry:</t>
      <table align="left" anchor="INTERMEDIATE_EXCHANGE_SUPPORTED" pn="table-2">
        <name slugifiedName="name-ikev2-notify-message-types-">IKEv2 Notify Message Types - Status Types</name>
        <thead>
          <tr>
            <th align="left" colspan="1" rowspan="1">Value</th>
            <th align="left" colspan="1" rowspan="1">NOTIFY MESSAGES - STATUS TYPES</th>
            <th align="left" colspan="1" rowspan="1">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">16438</td>
            <td align="left" colspan="1" rowspan="1">INTERMEDIATE_EXCHANGE_SUPPORTED</td>
            <td align="left" colspan="1" rowspan="1">RFC 9242</td>
          </tr>
        </tbody>
      </table>
    </section>
  </middle>
  <back>
    <references pn="section-7">
      <name slugifiedName="name-references">References</name>
      <references pn="section-7.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t indent="0">In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC7296" target="https://www.rfc-editor.org/info/rfc7296" quoteTitle="true" derivedAnchor="RFC7296">
          <front>
            <title>Internet Key Exchange Protocol Version 2 (IKEv2)</title>
            <author initials="C." surname="Kaufman" fullname="C. Kaufman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Hoffman" fullname="P. Hoffman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="Y." surname="Nir" fullname="Y. Nir">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Eronen" fullname="P. Eronen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="T." surname="Kivinen" fullname="T. Kivinen">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2014" month="October"/>
            <abstract>
              <t indent="0">This document describes version 2 of the Internet Key Exchange (IKE) protocol.  IKE is a component of IPsec used for performing mutual authentication and establishing and maintaining Security Associations (SAs).  This document obsoletes RFC 5996, and includes all of the errata for it.  It advances IKEv2 to be an Internet Standard.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="79"/>
          <seriesInfo name="RFC" value="7296"/>
          <seriesInfo name="DOI" value="10.17487/RFC7296"/>
        </reference>
        <reference anchor="RFC7383" target="https://www.rfc-editor.org/info/rfc7383" quoteTitle="true" derivedAnchor="RFC7383">
          <front>
            <title>Internet Key Exchange Protocol Version 2 (IKEv2) Message Fragmentation</title>
            <author initials="V." surname="Smyslov" fullname="V. Smyslov">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2014" month="November"/>
            <abstract>
              <t indent="0">This document describes a way to avoid IP fragmentation of large Internet Key Exchange Protocol version 2 (IKEv2) messages.  This allows IKEv2 messages to traverse network devices that do not allow IP fragments to pass through.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7383"/>
          <seriesInfo name="DOI" value="10.17487/RFC7383"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="May"/>
            <abstract>
              <t indent="0">RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references pn="section-7.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC5282" target="https://www.rfc-editor.org/info/rfc5282" quoteTitle="true" derivedAnchor="RFC5282">
          <front>
            <title>Using Authenticated Encryption Algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) Protocol</title>
            <author initials="D." surname="Black" fullname="D. Black">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="D." surname="McGrew" fullname="D. McGrew">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2008" month="August"/>
            <abstract>
              <t indent="0">An authenticated encryption algorithm combines encryption and integrity into a single operation; such algorithms may also be referred to as combined modes of an encryption cipher or as combined mode algorithms.  This document describes the use of authenticated encryption algorithms with the Encrypted Payload of the Internet Key Exchange version 2 (IKEv2) protocol.</t>
              <t indent="0">The use of two specific authenticated encryption algorithms with the IKEv2 Encrypted Payload is also described; these two algorithms are the Advanced Encryption Standard (AES) in Galois/Counter Mode (AES GCM) and AES in Counter with CBC-MAC Mode (AES CCM).  Additional documents may describe the use of other authenticated encryption algorithms with the IKEv2 Encrypted Payload.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5282"/>
          <seriesInfo name="DOI" value="10.17487/RFC5282"/>
        </reference>
        <reference anchor="RFC5723" target="https://www.rfc-editor.org/info/rfc5723" quoteTitle="true" derivedAnchor="RFC5723">
          <front>
            <title>Internet Key Exchange Protocol Version 2 (IKEv2) Session Resumption</title>
            <author initials="Y." surname="Sheffer" fullname="Y. Sheffer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="H." surname="Tschofenig" fullname="H. Tschofenig">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2010" month="January"/>
            <abstract>
              <t indent="0">The Internet Key Exchange version 2 (IKEv2) protocol has a certain computational and communication overhead with respect to the number of round trips required and the cryptographic operations involved. In remote access situations, the Extensible Authentication Protocol (EAP) is used for authentication, which adds several more round trips and consequently latency.</t>
              <t indent="0">To re-establish security associations (SAs) upon a failure recovery condition is time consuming especially when an IPsec peer (such as a VPN gateway) needs to re-establish a large number of SAs with various endpoints.  A high number of concurrent sessions might cause additional problems for an IPsec peer during SA re-establishment.</t>
              <t indent="0">In order to avoid the need to re-run the key exchange protocol from scratch, it would be useful to provide an efficient way to resume an IKE/IPsec session.  This document proposes an extension to IKEv2 that allows a client to re-establish an IKE SA with a gateway in a highly efficient manner, utilizing a previously established IKE SA.</t>
              <t indent="0">A client can reconnect to a gateway from which it was disconnected. The proposed approach encodes partial IKE state into an opaque ticket, which can be stored on the client or in a centralized store, and is later made available to the IKEv2 responder for re-authentication.  We use the term ticket to refer to the opaque data that is created by the IKEv2 responder.  This document does not specify the format of the ticket but examples are provided.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5723"/>
          <seriesInfo name="DOI" value="10.17487/RFC5723"/>
        </reference>
        <reference anchor="RFC6928" target="https://www.rfc-editor.org/info/rfc6928" quoteTitle="true" derivedAnchor="RFC6928">
          <front>
            <title>Increasing TCP's Initial Window</title>
            <author initials="J." surname="Chu" fullname="J. Chu">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="N." surname="Dukkipati" fullname="N. Dukkipati">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="Y." surname="Cheng" fullname="Y. Cheng">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Mathis" fullname="M. Mathis">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2013" month="April"/>
            <abstract>
              <t indent="0">This document proposes an experiment to increase the permitted TCP initial window (IW) from between 2 and 4 segments, as specified in RFC 3390, to 10 segments with a fallback to the existing recommendation when performance issues are detected.  It discusses the motivation behind the increase, the advantages and disadvantages of the higher initial window, and presents results from several large-scale experiments showing that the higher initial window improves the overall performance of many web services without resulting in a congestion collapse.  The document closes with a discussion of usage and deployment for further experimental purposes recommended by the IETF TCP Maintenance and Minor Extensions (TCPM) working group.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6928"/>
          <seriesInfo name="DOI" value="10.17487/RFC6928"/>
        </reference>
        <reference anchor="RFC8019" target="https://www.rfc-editor.org/info/rfc8019" quoteTitle="true" derivedAnchor="RFC8019">
          <front>
            <title>Protecting Internet Key Exchange Protocol Version 2 (IKEv2) Implementations from Distributed Denial-of-Service Attacks</title>
            <author initials="Y." surname="Nir" fullname="Y. Nir">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="V." surname="Smyslov" fullname="V. Smyslov">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="November"/>
            <abstract>
              <t indent="0">This document recommends implementation and configuration best practices for Internet Key Exchange Protocol version 2 (IKEv2) Responders, to allow them to resist Denial-of-Service and Distributed Denial-of-Service attacks.  Additionally, the document introduces a new mechanism called "Client Puzzles" that helps accomplish this task.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8019"/>
          <seriesInfo name="DOI" value="10.17487/RFC8019"/>
        </reference>
        <reference anchor="RFC8229" target="https://www.rfc-editor.org/info/rfc8229" quoteTitle="true" derivedAnchor="RFC8229">
          <front>
            <title>TCP Encapsulation of IKE and IPsec Packets</title>
            <author initials="T." surname="Pauly" fullname="T. Pauly">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="S." surname="Touati" fullname="S. Touati">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Mantha" fullname="R. Mantha">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="August"/>
            <abstract>
              <t indent="0">This document describes a method to transport Internet Key Exchange Protocol (IKE) and IPsec packets over a TCP connection for traversing network middleboxes that may block IKE negotiation over UDP.  This method, referred to as "TCP encapsulation", involves sending both IKE packets for Security Association establishment and Encapsulating Security Payload (ESP) packets over a TCP connection.  This method is intended to be used as a fallback option when IKE cannot be negotiated over UDP.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8229"/>
          <seriesInfo name="DOI" value="10.17487/RFC8229"/>
        </reference>
      </references>
    </references>
    <section anchor="example" numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-example-of-ike_intermediate">Example of IKE_INTERMEDIATE Exchange</name>
      <t indent="0" pn="section-appendix.a-1"> This appendix contains an example of the messages using IKE_INTERMEDIATE exchanges. 
          This appendix is purely informative; if it disagrees with the body of this document, 
          the other text is considered correct.
      </t>
      <t indent="0" pn="section-appendix.a-2"> In this example, there is one IKE_SA_INIT exchange and two IKE_INTERMEDIATE exchanges,
          followed by the IKE_AUTH exchange to authenticate all initial exchanges. The xxx in the HDR(xxx,MID=yyy)
          indicates the Exchange Type, and yyy indicates the Message ID used for that exchange. 
          The keys used for each SK {} payload are indicated in the parenthesis after the SK. 
          Otherwise, the payload notation is the same as is used in <xref target="RFC7296" format="default" sectionFormat="of" derivedContent="RFC7296"/>.
      </t>
      <artwork align="left" name="" type="" alt="" pn="section-appendix.a-3">
Initiator                         Responder
-----------                       -----------
HDR(IKE_SA_INIT,MID=0),
SAi1, KEi, Ni,
N(INTERMEDIATE_EXCHANGE_SUPPORTED)  --&gt;

                             &lt;--  HDR(IKE_SA_INIT,MID=0),
                                  SAr1, KEr, Nr, [CERTREQ],
                                  N(INTERMEDIATE_EXCHANGE_SUPPORTED)
          </artwork>
      <t indent="0" pn="section-appendix.a-4"> At this point, peers calculate SK_* and store them as SK_*1.
          SK_e[i/r]1 and SK_a[i/r]1 will be used to protect the first IKE_INTERMEDIATE exchange,
          and SK_p[i/r]1 will be used for its authentication.
      </t>
      <artwork align="left" name="" type="" alt="" pn="section-appendix.a-5">
Initiator                         Responder
-----------                       -----------
HDR(IKE_INTERMEDIATE,MID=1),
SK(SK_ei1,SK_ai1) {...}  --&gt;

         &lt;Calculate IntAuth_i1 = prf(SK_pi1, ...)&gt;

                             &lt;--  HDR(IKE_INTERMEDIATE,MID=1),
                                  SK(SK_er1,SK_ar1) {...}

         &lt;Calculate IntAuth_r1 = prf(SK_pr1, ...)&gt;
          </artwork>
      <t indent="0" pn="section-appendix.a-6"> If the SK_*1 keys are updated (e.g., as a result of a new key exchange) after completing this IKE_INTERMEDIATE exchange, 
          then the peers store the updated keys as SK_*2; otherwise, they use SK_*1 as SK_*2.
          SK_e[i/r]2 and SK_a[i/r]2 will be used to protect the second IKE_INTERMEDIATE exchange,
          and SK_p[i/r]2 will be used for its authentication.
      </t>
      <artwork align="left" name="" type="" alt="" pn="section-appendix.a-7">
Initiator                         Responder
-----------                       -----------
HDR(IKE_INTERMEDIATE,MID=2),
SK(SK_ei2,SK_ai2) {...}  --&gt;

         &lt;Calculate IntAuth_i2 = prf(SK_pi2, ...)&gt;

                             &lt;--  HDR(IKE_INTERMEDIATE,MID=2),
                                  SK(SK_er2,SK_ar2) {...}

         &lt;Calculate IntAuth_r2 = prf(SK_pr2, ...)&gt;
          </artwork>
      <t indent="0" pn="section-appendix.a-8"> If the SK_*2 keys are updated (e.g., as a result of a new key exchange) after completing the second IKE_INTERMEDIATE exchange,
          then the peers store the updated keys as SK_*3; otherwise, they use SK_*2 as SK_*3.
          SK_e[i/r]3 and SK_a[i/r]3 will be used to protect the IKE_AUTH exchange, SK_p[i/r]3 will be used for authentication, and
          SK_d3 will be used for derivation of other keys (e.g., for Child SAs).
      </t>
      <artwork align="left" name="" type="" alt="" pn="section-appendix.a-9">
Initiator                         Responder
-----------                       -----------
HDR(IKE_AUTH,MID=3),
SK(SK_ei3,SK_ai3) 
{IDi, [CERT,] [CERTREQ,]
[IDr,] AUTH, SAi2, TSi, TSr}  --&gt;
                             &lt;--  HDR(IKE_AUTH,MID=3),
                                  SK(SK_er3,SK_ar3) 
                                  {IDr, [CERT,] AUTH, SAr2, TSi, TSr}
          </artwork>
      <t indent="0" pn="section-appendix.a-10"> In this example, two IKE_INTERMEDIATE exchanges took place; therefore, SK_*3 keys would be used as SK_* keys for 
          further cryptographic operations in the context of the created IKE SA, as defined in <xref target="RFC7296" format="default" sectionFormat="of" derivedContent="RFC7296"/>.
      </t>
    </section>
    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgements">Acknowledgements</name>
      <t indent="0" pn="section-appendix.b-1"> The idea to use an Intermediate Exchange between the IKE_SA_INIT and IKE_AUTH exchanges was first suggested by <contact fullname="Tero Kivinen"/>.
            He also helped to write the example IKE_INTERMEDIATE exchange shown in <xref target="example" format="default" sectionFormat="of" derivedContent="Appendix A"/>.
            <contact fullname="Scott Fluhrer"/> and <contact fullname="Daniel Van Geest"/> identified a possible problem with authentication of the IKE_INTERMEDIATE exchange and helped to resolve it.
            The author is grateful to <contact fullname="Tobias Brunner"/>, who raised good questions concerning authentication of the IKE_INTERMEDIATE exchange
            and proposed how to make the size of authentication chunks constant regardless of the number of exchanges. 
            The author is also grateful to <contact fullname="Paul Wouters"/> and <contact fullname="Benjamin Kaduk"/>, who suggested a lot of text improvements for the document.
      </t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-address">Author's Address</name>
      <author initials="V" surname="Smyslov" fullname="Valery Smyslov">
        <organization showOnFrontPage="true">ELVIS-PLUS</organization>
        <address>
          <postal>
            <street>PO Box 81</street>
            <city>Moscow (Zelenograd)</city>
            <code>124460</code>
            <country>Russian Federation</country>
          </postal>
          <phone>+7 495 276 0211</phone>
          <email>svan@elvis.ru</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
