<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<rfc category="exp" ipr="trust200902" docName="draft-smyslov-ipsecme-ikev2-psp-01">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="no"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>

    <front>
        <title abbrev="IKEv2 for PSP Key Management">Using the Internet Key Exchange Protocol Version 2 (IKEv2) for PSP Key Management</title>
        <author initials='V.' surname="Smyslov" fullname='Valery Smyslov'>
            <organization>ELVIS-PLUS</organization>
            <address>
                <postal>
                    <country>RU</country>
                </postal>
                <phone></phone>
                <email>svan@elvis.ru</email>
            </address>
        </author>
        <date/>

        <abstract>
            <t> This document specifies how the Internet Key Exchange Version 2 (IKEv2) protocol can be used 
            for supplying keys for the PSP Security Protocol (PSP).
            </t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction">
            <t>Internet Key Exchange Version 2 (IKEv2) protocol <xref target="RFC7296" /> is used in 
            IPsec architecture <xref target="RFC4301" /> for the purpose SA negotiation and key management.
            It provides authenticated key exchange and calculates session keys for the Encapsulating 
            Security Payload (ESP) protocol <xref target="RFC4303" />.
            </t>

            <t> PSP Security Protocol (PSP) is defined in <xref target="PSP" />. The protocol utilizes
            the concept of so called "stateless encryption" by keeping only global state for decrypting
            incoming packets. This concept implies that the receiving side of Security Association (SA) 
            provides the sending side with a key at the time this SA is being created.
            </t>

            <t>PSP is considered as an alternative for ESP for high-speed communications (e.g., inside data centers).
            However, IKEv2 cannot directly be used for providing keys for PSP, since the way 
            IPsec keys are being obtained in IKEv2 implies that they are derived from the
            ephemeral key exchange and thus are unpredictable. This is incompatible
            with the way keys are used in PSP where each side must independently generate 
            keys used for decryption for a particular SA based on some global key.
            </t>
        </section>

        <section anchor="mustshouldmay" title="Terminology and Notation">
            <t> The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", 
            "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted 
            as described in BCP 14 <xref target="RFC2119" /> <xref target="RFC8174" /> when, and only when, 
            they appear in all capitals, as shown here.</t>
        </section>

        <section anchor="psp" title="PSP">
            <t>PSP <xref target="PSP" /> is a security protocol created by Google for encryption on IP level. 
            PSP was designed to address the high-speed encryption requirements of large-scale data centers. 
            To avoid storing per-SA decryption keys on the receiver side, the decryption keys are derived
            from the SPI (that is present in the packet) plus a global secret known only to the receiver side.
            </t>

            <t> PSP specification does not address key management issues. It assumes that at the time an SA 
            is being created the sender asks the receiver to create 
            an SA encryption key, which the receiver then somehow communicates securely to the sender.
            </t>
        </section>

        <section anchor="psp-ikev2" title="PSP Key Management Using IKEv2">
            <t> IKEv2 cannot directly be used for providing keys for PSP, because its specification <xref target="RFC7296" /> assumes
            that keying material for Child SAs is derived using initial ephemeral key exchange. Thus, peers contribute 
            to this keying material, but cannot control it and for this reason cannot provide each other with arbitrary keys.
            </t>

            <t> On the other hand, IKEv2 extension for group key management <xref target="RFC9838" /> does allow
            this functionality as it is needed for providing members of a group with identical keys. 
            This specification re-uses the ability to download arbitrary keys in IKEv2 from <xref target="RFC9838" />.
            Note that unlike <xref target="RFC9838" /> this specification is for unicast (peer-to-peer) communication.
            </t>

            <t> Since both peers have to provide each other with keying material, it is not possible to do that in the IKE_AUTH
            exchange (as in <xref target="RFC7296" />), since the initiator in this case would send its key (which is sensitive information)
            to the not-yet-authenticated responder. For this reason, peers <bcp14>MUST</bcp14> create IKE SA childless as specified
            in <xref target="RFC6023" />. Once childless IKE SA is created, peers can use the modified CREATE_CHILD_SA exchange
            to create or rekey Child SAs utilizing PSP.
            </t>

            <section anchor="ike_sa_init" title="The IKE_SA_INIT Exchange">
                <t> Peers wishing to use IKEv2 for providing keys for PSP <bcp14>MUST</bcp14> negotiate
                the Key Wrap Algorithm (KWA) transform (Section 4.4.2.1.2 of <xref target="RFC9838" />)
                in the IKE_SA_INIT exchange. If the initiator is not sure that the responder supports PSP and if using PSP is optional  
                for the initiator, then the initiator <bcp14>MAY</bcp14> include two proposals into the IKE_SA_INIT request - 
                one with the Key Wrap Algorithm transform (aiming for responders supporting PSP) and the other without it.
                </t>

                <t> The responder supporting PSP key management, besides negotiation of the KWA transform, <bcp14>MUST</bcp14> also
                include the CHILDLESS_IKEV2_SUPPORTED notification (Section 4 of <xref target="RFC6023" />) in the IKE_SA_INIT response.
                </t>

                <t> Even if the KWA transform is negotiated, it does not mean that this IKE SA is for creating PSP SAs only - 
                such an SA <bcp14>MAY</bcp14> be used for creating both ESP and PSP SAs.
                </t>
            </section>

            <section anchor="ike_auth" title="The IKE_AUTH Exchange">
                <t> The PSP Child SA cannot be created in the IKE_AUTH exchange. On the other hand, peers may create 
                the ESP Child SA in this exchange if they want to. Otherwise, the IKE SA is created childless
                and the IKE_AUTH exchange is as defined in Section 5 of <xref target="RFC6023" />.
                </t>
            </section>

            <section anchor="create_child_sa" title="The Modified CREATE_CHILD_SA Exchange">
                <t> Modified CREATE_CHILD_SA exchange is used for creating the PSP SA.
                The following modifications are made.
                <ul>
                    <li> The SA payload <bcp14>MUST</bcp14> contain one or more Proposal substructures with the Protocol ID field set to
                    a new Security Protocol Identifier PSP (&lt;TBA by IANA&gt;). Note that SPI Size
                    for PSP is the same as for ESP (4 octets). Proposals with other
                    Security Protocol Identifiers <bcp14>MUST NOT</bcp14> be present.
                    </li>

                    <li> These Proposal substructures <bcp14>MUST</bcp14> only contain one or more Transform substructures
                    with new Transform Type "PSP Parameters (PSP)" (&lt;TBA by IANA&gt;). See <xref target="PSP-params "/> for
                    Possible Transform IDs for this Transform Type. Transform substructures with other Transform Types
                    <bcp14>MUST NOT</bcp14> be present.
                    </li>

                    <li> The CREATE_CHILD_SA messages <bcp14>MUST NOT</bcp14> contain the Key Exchange (KE) and the Nonce (Ni and Nr) payloads.
                    Instead, both request and response <bcp14>MUST</bcp14> contain exactly one Key Download (KD) payload, 
                    defined in Section 4.5 of <xref target="RFC9838" />. The sender of a KD payload 
                    provides a keying material for the PSP SA that it will use as a receiver to its peer.
                    </li>

                    <li> The KD payloads <bcp14>MUST</bcp14> contain exactly one or more Group Key Bag substructure,
                    defined in Section 4.5.2 of <xref target="RFC9838" />. The Protocol
                    field of this substructures <bcp14>MUST</bcp14> be set to Security Protocol Identifier PSP (&lt;TBA by IANA&gt;),
                    the SPI <bcp14>MUST</bcp14> match that in one of the Proposal substructures in the SA payload.
                    </li>

                    <li> Each Key Bag <bcp14>MUST</bcp14> contain exactly one SA_KEY attribute, 
                    defined in Section 4.5.2.1 of <xref target="RFC9838" />,
                    in which the wrapped keying material (See Section 4.5.4 of <xref target="RFC9838" />) for the PSP SA is provided.
                    The Key ID and the KWK ID fields <bcp14>MUST</bcp14> be set to zero,
                    meaning that this attribute contains the keying material for an SA and this keying material is protected 
                    with the default Key Wrap Key SK_w that is calculated as 
<figure align="center">
    <artwork align="left"><![CDATA[
SK_w = prf+(SK_d, "Key Wrap for PSP")
  ]]></artwork>
</figure>
                    </li>

                    <li> The size of the provided keying material <bcp14>MUST</bcp14> be sufficient to get keys for any of the 
                    proposed PSP parameters.
                    </li>
                </ul>

                The modified CREATE_CHILD_SA exchange is shown below.

<figure align="center" title="CREATE_CHILD_SA Exchange for PSP">
    <artwork align="left"><![CDATA[
Initiator                         Responder
------------------------------------------------------------------
HDR, SK {[N(REKEY_SA),] 
     SA, KD, TSi, TSr}   --->

                          <---    HDR, SK {SA, KD, TSi, TSr}
    ]]></artwork>
</figure>

                The USE_TRANSPORT_MODE notification can be used in case of PSP to indicate 
                that the PSP SA is to be created using transport mode, as with ESP.
                </t>

                <t> The REKEY_SA notification can be present and plays the same role as with ESP SA -
                indicates the SA to be replaced with a newly created SA.
                </t>

            </section>
        </section>

        <section anchor="security" title="Security Considerations">
            <t> To be added.
            </t>
        </section>

        <section anchor="iana" title="IANA Considerations">

            <t> This document requests IANA to make the following changes in the "Internet Key Exchange Version 2 (IKEv2) Parameters" 
            registry group <xref target="IKEV2-IANA" />.
            </t>

            <ol>
                <li anchor="PSP-params"> Create new registry "Transform Type &lt;TBA&gt; - PSP Parameters Transform IDs". 
                The registration policy for this registry is Expert Review Policy <xref target="RFC8126" />. 
                The initial values of the new registry are:

            <figure align="center">
                <artwork align="left"><![CDATA[
Value                   PSP Parameters
------------------------------------------
0                       Reserved
1                       PSP Header Version 0, AES-GCM-128
2                       PSP Header Version 0, AES-GCM-256
3                       PSP Header Version 0, AES-GMAC-128
4                       PSP Header Version 0, AES-GMAC-256
Unassigned             5-1023
Private Use         1024-65535
                ]]></artwork>
            </figure>
                </li>

                <li> Add new Transform Type "PSP Parameters (PSP)" in the "Transform Type Values" registry.

            <figure align="center">
                <artwork align="left"><![CDATA[
Type    Description                         Used In
---------------------------------------------------
<TBA>   PSP Parameters (PSP)                (PSP)
                ]]></artwork>
            </figure>
                </li>

                <li> Add new Security Protocol Identifier in the "IKEv2 Security Protocol Identifiers" registry.

            <figure align="center">
                <artwork align="left"><![CDATA[
Protocol ID       Protocol
--------------------------
<TBA>             PSP
                ]]></artwork>
            </figure>
                </li>

            </ol>

        </section>

    </middle>

    <back>
        <references title='Normative References'>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7296.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6023.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9838.xml" ?>
            <reference anchor="PSP" target="https://github.com/google/psp/blob/main/doc/PSP_Arch_Spec.pdf">
              <front>
                <title>PSP Architecture Specification</title>
                <author>
                  <organization/>
                </author>
                <date year="2022" month="November"/>
              </front>
            </reference>
        </references>

        <references title='Informative References'>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4301.xml" ?>
            <?rfc include="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4303.xml" ?>
            <reference anchor="IKEV2-IANA"
                     target="http://www.iana.org/assignments/ikev2-parameters/ikev2-parameters.xhtml">
                <front>
                    <title>Internet Key Exchange Version 2 (IKEv2) Parameters</title>
                    <author>
                        <organization>IANA</organization>
                    </author>
                    <date />
                </front>
            </reference>
        </references>

<!--        <section anchor="ack" numbered="false" title="Acknowledgements">
        </section> -->

    </back>
</rfc>


