<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC3948 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3948.xml">
<!ENTITY RFC4301 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4301.xml">
<!ENTITY RFC4364 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4364.xml">
<!ENTITY RFC4761 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4761.xml">
<!ENTITY RFC4762 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4762.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
<!ENTITY RFC6513 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6513.xml">
<!ENTITY RFC6514 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6514.xml">
<!ENTITY RFC7209 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7209.xml">
<!ENTITY RFC7348 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7348.xml">
<!ENTITY RFC7432 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7432.xml">
<!ENTITY RFC7606 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY RFC8365 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8365.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="std" docName="draft-sajassi-bess-secure-evpn-06" ipr="trust200902">
 <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN" 
    they will automatically be output with "(if approved)" -->

 <!-- ***** FRONT MATTER ***** -->

 <front>
   <!-- The abbreviated title is used in the page header - it is only necessary if the 
        full title is longer than 39 characters -->

   <title abbrev="Secure EVPN" > 
                  Secure EVPN
   </title>

   <!-- add 'role="editor"' below for the editors if appropriate -->
       <author fullname="Ali Sajassi" initials="A.S."
               surname="Sajassi">
       <organization>Cisco</organization>
       <address>
       <postal>
         <street> 170 W Tasman Drive</street>
         <city>San Jose</city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone></phone>
       <email>sajassi@cisco.com</email>
       <!-- uri and facsimile elements may also be added -->
      </address>
      </author>


   <author fullname="Ayan Banerjee" initials="A.B."
           surname="Banerjee">
     <organization>Cisco</organization>
     <address>
       <postal>
         <street> 170 W Tasman Drive</street>
         <city>San Jose</city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone></phone>
       <email>ayabaner@cisco.com</email>


       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>
   <author fullname="Sameer Thoria" initials="S.T."
           surname="Thoria">
     <organization>Cisco</organization>
     <address>
       <postal>
         <street> 170 W Tasman Drive</street>
         <city>San Jose</city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone></phone>
       <email>sthoria@cisco.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <author fullname="David Carrel" initials="D.C."
           surname="Carrel">
     <organization>Graphiant</organization>
     <address>
       <postal>
         <street> </street>
         <city>   </city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone> </phone>
       <email>carrel@graphiant.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>


   <author fullname="Brian Weis" initials="B.W."
           surname="Weis">
     <organization>Independent</organization>
     <address>
       <postal>
         <street> </street>
         <city>   </city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone> </phone>
       <email>bew.stds@gmail.com</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>


   <author fullname="John Drake" initials="J.D."
           surname="Drake">
     <organization> Juniper Networks </organization>
     <address>
       <postal>
         <street> </street>
         <city>   </city>
         <region>CA</region>
         <code></code>
         <country>USA</country>
       </postal>
       <phone> </phone>
       <email>jdrake@juniper.net</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <date year="2023" />

   <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
        in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

   <!-- Meta-data Declarations -->

   <area>General</area>

   <workgroup>BESS Working Group</workgroup>

   <!-- WG name at the upperleft corner of the doc,
        IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->

   <keyword>evpn</keyword>

   <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
       <t> 
       The applications of EVPN-based solutions (<xref target="RFC7432"></xref> and 
       <xref target="RFC8365"></xref>)
       have become pervasive in Data Center, Service Provider, and
       Enterprise segments. It is being used for fabric overlays and 
       inter-site connectivity in the Data Center market segment, for Layer-2,
       Layer-3, and IRB VPN services in the Service Provider market segment,
       and for fabric overlay and WAN connectivity in Enterprise networks.
       For Data Center and Enterprise applications, there is a need to
       provide inter-site and WAN connectivity over public Internet in a
       secured manner with same level of privacy, integrity, and
       authentication for tenant's traffic as IPsec tunneling using IKEv2.
       This document presents a solution where BGP point-to-multipoint
       signaling is leveraged for key and policy exchange among PE devices
       to create private pair-wise IPsec Security Associations without IKEv2
       point-to-point signaling or any other direct peer-to-peer session
       establishment messages.
       </t>
   </abstract>
 </front>

 <middle>


   <section anchor="sec_intro" title="Introduction">
        <t> 
        The applications of EVPN-based solutions have become pervasive in
        Data Center, Service Provider, and Enterprise segments. It is being
        used for fabric overlays and inter-site connectivity in the Data
        Center market segment, for Layer-2, Layer-3, and IRB VPN services in
        the Service Provider market segment, and for fabric overlay and WAN
        connectivity in the Enterprise networks. For Data Center and
        Enterprise applications, there is a need to provide inter-site and
        WAN connectivity over public Internet in a secured manner with the
        same level of privacy, integrity, and authentication for tenant's
        traffic as used in IPsec tunneling using IKEv2. This document
        presents a solution where BGP point-to-multipoint signaling is
        leveraged for key and policy exchange among PE devices to create
        private pair-wise IPsec Security Associations without IKEv2 point-to-
        point signaling or any other direct peer-to-peer session
        establishment messages. This method is specially recommended for large scale
        deployment where large meshes of IKEv2 sessions among 
        PE devices are not appropriate.
        </t>

        <t>
        EVPN uses BGP as control-plane protocol for distribution of
        information needed for discovery of PEs participating in a VPN,
        discovery of PEs participating in a redundancy group, customer MAC
        addresses and IP prefixes/addresses, aliasing information, tunnel
        encapsulation types, multicast tunnel types, multicast group
        memberships, and other information. The advantages of using BGP control
        plane in EVPN are well understood including the following:

        <list style="numbers">

        <t> A full mesh of BGP sessions among PE devices can be avoided by
        using Route Reflector (RR) where a PE only needs to setup a single
        BGP session between itself and the RR as opposed to setting up N BGP
        sessions to N other remote PEs; therefore, reducing number of BGP
        sessions from O(N^2) to O(N) in the network. Furthermore, RR
        hierarchy can be leveraged to scale the number of BGP routes on the
        RR.
        </t>

        <t> MP-BGP route filtering and constrained route distribution can be
        leveraged to ensure that the control-plane traffic for a given VPN is
        only distributed to the PEs participating in that VPN.
        </t>
        </list>

        </t>

        <t>
        For setting up point-to-point security association (i.e., IPsec
        tunnel) between a pair of EVPN PEs, it is important to leverage BGP
        point-to-multipoint singling architecture using the RR along with its
        route filtering and constrain mechanisms to achieve the performance
        and the scale needed for large number of security associations (IPsec
        tunnels) along with their frequent re-keying requirements. Using BGP
        signaling along with the RR (instead of peer-to-peer protocol such as
        IKEv2) reduces number of message exchanges needed for SAs
        establishment and maintenance from O(N^2) to O(N) in the network. 
        </t>

        <t> Many key exchange methods (such as IKEv2) use a Diffie-Hellman (DH)
        algorithm to derive keys.  When combined with an authentication
        method, the key exchange method allows two network devices to
        generate private pair-wise keys with each other.  This document
        presents a key exchange method making use of the PE-to-RR
        trust model, where an RR is used to distribute keying material
        and policy between PE devices, also resulting in the PEs
        generating private pair-wise keys with each other.  DH public values
        are provided to controllers from IPsec devices, where the controller
        relays the DH public values to authorized peers of that IPsec device
        as defined by a centralized policy.  PE devices then create and
        install private pair-wise IPsec session keys to be used to secure
        communications with their peers.</t>

        <t> Although IKEv2 is not used in this approach, the key management
        interfaces between IKEv2 and IPsec defined in RFC 7296 are maintained
        as much as possible. </t>

       <section title="Requirements Language">
         <t>
            The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
            "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
            document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref> 
            <xref target="RFC8174">RFC 8174</xref> when, and only when, they appear in all
            capitals, as shown here.
         </t>
       </section>
     </section>


   <section anchor="terminology" title="Terminology">
    
        <t><list style="symbols">

        <t>  AC: Attachment Circuit.  </t> 

        <t>  ARP: Address Resolution Protocol. </t>

        <t>  BD: Broadcast Domain. As per <xref target="RFC7432">RFC7432</xref>, 
        an EVI consists of a single or multiple BDs. In case of VLAN-bundle and 
        VLAN-based service models (see <xref target="RFC7432">RFC7432</xref>), a
        BD is equivalent to an EVI. In case of VLAN-aware bundle service model, 
        an EVI contains multiple BDs. Also, in this document, BD and subnet are
        equivalent terms.  </t>

        <t> BD Route Target: refers to the Broadcast Domain assigned Route Target
        <xref target="RFC4364">RFC4364</xref>. In case of VLAN-aware bundle 
        service model, all the BD instances in the MAC-VRF share the same Route 
        Target.  </t>

        <t> BT: Bridge Table. The instantiation of a BD in a MAC-VRF, as per
        <xref target="RFC7432">RFC7432</xref>. </t>

        <t> DGW: Data Center Gateway. </t> 

        <t> Ethernet A-D route: Ethernet Auto-Discovery (A-D) route, as per
            [RFC7432].  </t>

        <t> Ethernet NVO tunnel: refers to Network Virtualization Overlay tunnels
            with Ethernet payload. Examples of this type of tunnels are VXLAN or
            <xref target="GENEVE">GENEVE</xref>.  </t>

        <t> EVI: EVPN Instance spanning the NVE/PE devices that are participating
            on that EVPN, as per [RFC7432].  </t>

        <t> EVPN: Ethernet Virtual Private Networks, as per [RFC7432].  </t>

        <t> GRE: Generic Routing Encapsulation.  </t>

        <t> GW IP: Gateway IP Address.  </t>

        <t> IPL: IP Prefix Length.  </t>

        <t> IP NVO tunnel: it refers to Network Virtualization Overlay tunnels
            with IP payload (no MAC header in the payload).  </t>

        <t> IP-VRF: A VPN Routing and Forwarding table for IP routes on an
            NVE/PE. The IP routes could be populated by EVPN and IP-VPN address
            families. An IP-VRF is also an instantiation of a layer 3 VPN in an
            NVE/PE.  </t>

        <t> IRB: Integrated Routing and Bridging interface. It connects an IP-VRF
            to a BD (or subnet).  </t>

        <t> MAC-VRF: A Virtual Routing and Forwarding table for Media Access
            Control (MAC) addresses on an NVE/PE, as per [RFC7432]. A MAC-VRF is
            also an instantiation of an EVI in an NVE/PE.  </t>

        <t> ML: MAC address length.  </t>

        <t> ND: Neighbor Discovery Protocol.  </t>

        <t> NVE: Network Virtualization Edge.  </t>

        <t> GENEVE: Generic Network Virtualization Encapsulation, [GENEVE].  </t>

        <t> NVO: Network Virtualization Overlays.  </t>

        <t> RT-2: EVPN route type 2, i.e., MAC/IP advertisement route, as defined
            in [RFC7432].  </t>

        <t> RT-5: EVPN route type 5, i.e., IP Prefix route. As defined in Section
            3 of [EVPN-PREFIX].  </t>

        <t> SBD: Supplementary Broadcast Domain. A BD that does not have any ACs,
        only IRB interfaces, and it is used to provide connectivity among all
        the IP-VRFs of the tenant. The SBD is only required in IP-VRF- to-IP-
        VRF use-cases (see Section 4.4.).  </t>

        <t> SN: Subnet.  </t>

        <t> TS: Tenant System.  </t>

        <t> VA: Virtual Appliance.  </t>

        <t> VNI: Virtual Network Identifier. As in [RFC8365], the term is used as
        a representation of a 24-bit NVO instance identifier, with the
        understanding that VNI will refer to a VXLAN Network Identifier in
        VXLAN, or Virtual Network Identifier in GENEVE, etc. unless it is
        stated otherwise.  </t>

        <t> VTEP: VXLAN Termination End Point, as in <xref target="RFC7348">RFC 7348</xref>.  </t>

        <t> VXLAN: Virtual Extensible LAN, as in <xref target="RFC7348">RFC 7348</xref>.  </t>



        </list>
      </t>

    <t> This document also assumes familiarity with the terminology of
   [RFC7432], [RFC8365], and [RFC7365]. </t>
   </section>


   <section anchor="requirements_overview" title="Requirements">
     <t> 
        The requirements for secured EVPN are captured in the following
        subsections.
     </t>

        <section title="Tenant's Layer-2 and Layer-3 data and control traffic">

            <t> Tenant's layer-2 and layer-3 data and control traffic must be
            protected by IPsec cryptographic methods. This implies not only
            tenant's data traffic must be protected by IPsec but also tenant's
            control and routing information that are advertised in BGP must also
            be protected by IPsec. This in turn implies that BGP session must be
            protected by IPsec.
            </t>
        </section>

        <section title="Tenant's Unicast and Multicast Data Protection">
            <t>
            Tenant's layer-2 and layer-3 unicast traffic must be protected by
            IPsec. In addition to that, tenant's layer-2 broadcast, unknown
            unicast, and multicast traffic as well as tenant's layer-3 multicast
            traffic must be protected by IPsec when ingress replication or
            assisted replication are used. The use of BGP P2MP signaling for
            setting up P2MP SAs in P2MP multicast tunnels is for future study.
            </t>
        </section>

        <section title="P2MP Signaling for SA setup and Maintenance">
            <t>

            BGP P2MP signaling must be used for IPsec SAs setup and maintenance.
            This reduces the number of message exchanges from O(N^2) to O(N) among the
            participating PE devices.
            </t>
        </section>

        <section title="Granularity of Security Association Tunnels">
            <t>

            The solution must support the setup and maintenance of IPsec SAs at
            the following level of granularities:
            <list style="symbols">


            <t> Per PE: A single IPsec tunnel between a pair of PEs to be used for
            all tenants' traffic supported by the pair of PEs. </t>

            <t> Per tenant: A single IPsec tunnel per tenant per pair of PEs. For
            example, if there are 1000 tenants supported on a pair of PEs, then
            1000 IPsec tunnels are required between that pair of PEs. </t>

            <t>Per subnet: A single IPsec tunnel per subnet (e.g., per VLAN/EVI)
            of a tenant on a pair of PEs. </t>

            <t>Per L3 flow: A single IPsec tunnel per pair of IP addresses of
            a tenant on a pair of PEs. </t>

            <t> Per L2 flow: A single IPsec tunnel per pair of MAC addresses
            of a tenant on a pair of PEs. </t>

            <t> Per AC pair: A single IPsec tunnel per pair of
            Attachment Circuits between a pair of PEs. </t>
            </list>
            </t>
        </section>


        <section title="Support for Policy and DH-Group List">

            <t>
            The solution must support a single policy and DH group for all SAs as
            well as supporting multiple policies and DH groups among the SAs. 
            </t>
        </section>  
       
   </section>

    

      <section anchor="SigFramework" title="SA and Key Management">

       <t> The BGP Route Reflector (RR) acts as a trusted third party, which
       relays policy and keying material between PE devices. Communications 
       between the RR and the PEs MUST be authenticated, encrypted, and 
       integrity-protected. All algorithms are selected by the management station
       associated with the RR.  The combination of the RR and
       a set of PE devices comprises of a cooperating group of devices that
       make up a VPN, where each PE device is authorized to communicate
       with other PE devices in the group. Policies can allow
       a PE device to communicate with all other PE devices in the
       group, or may restrict it to a subset of those devices. </t>

       <t> DH public values from each PE are distributed to other authorized peer 
	   PEs via the RR. Each PE device creates and maintains a DH pair,
       which it uses to communicate with other members of the VPN.  This
       distribution of DH public values (and other related values) is
       intended to be embedded into the BGP protocol as described later.
       In particular, the RR provides a mechanism for
       secure key management.  However, it does not provide
       policy information or configuration as that is assumed to be provided
       by the management station.  </t>


       <section anchor="InitSignaling" title="Generating Initial IPsec SAs">
   

       <t> When an PE device (PE) begins operation, it generates a private/public 
       DH pair, using
       an algorithm defined in the IKEv2 Diffie-Hellman Group Transform IDs
       [IKEV2-IANA].  If the device does not have any active peers it simply
       distributes its DH public value to the BGP RR, along with a nonce
       to be used during SA creation.  Whenever a private/public DH pair is created, 
       a new nonce MUST also be created.  Whenever DH public values are
       transmitted, they are transmitted with the corresponding nonce.
       Whenever a DH private or DH public value is used, it is used along
       with the corresponding nonce.  However, in the diagrams and
       descriptions below, the nonces are often left out for the sake of
       clarity. </t>

       <t> Upon receiving a peer's DH public value and nonce, the receiver
       creates IPsec SAs (as described in Section 5.2).  For each peer, a
       pair of IPsec SAs are created by combining the PE device's own DH
       private value with the DH public number received from the Controller. </t>


      <t>  
     <figure align="center" title="Generation of Initial IPsec SAs between two peers"
      anchor="initKeys">
        <!--
         <preamble>Preamble text - can be omitted or empty.</preamble>
          -->
       <artwork align="center"><![CDATA[
                      +---+    +----------+     +---+
                      | A |    |  BGP RR  |     | B |
                      +-+-+    +-----+----+     +-+-+
           +----------+ |            |            |
           |Generate  | |            |            | +----------+
           |DH pair a1| |            |            | |Generate  |
           +----------+ |  a1-pub    |            | |DH pair b1|
                        +----------> |    b1-pub  | +----------+
                        |            | <----------+
                        |            |            |
                        |            |  a1-pub    |
                        |    b1-pub  +----------> | +-----------+
          +-----------+ | <----------+            | |Create SA: |
          |Create SAs:| |            |            | |  Tx(b1-a1)|
          |  Tx(a1-b1)| |            |            | |  Rx(a1-b1)|
          |  Rx(b1-a1)| |            |            | +-----------+
          +-----------+ |            |            |
                        |            |            |
                        | IPsec ESP Tx(a1-b1)     |
                        +-----------------------> |
                        |            |            |
                        |     IPsec ESP Tx(b1-a1) |
                        | <-----------------------+
                        |            |            |
                        +            +            +]]></artwork>

     </figure>
     </t>

      <t> <xref target="initKeys"/> shows IPsec SA generation between a 
      pair of PE devices.
      Two PE devices (A and B shown in <xref target="initKeys"/>) join 
      the network.  Each
      creates it's own DH pair (labelled "a1" on A and "b1" on B), and
      distributes the DH public value (labelled a1-pub and b1-pub) to the
      BGP RR.  The BGP RR forwards the DH public value to all
      authorized peers, although for simplicity of exposition the figure
      only shows the two IPsec devices. </t> 

      <t> When each device receives the peer's DH public value, a pair of IPsec
      SAs are generated: one outbound and one inbound.  As shown in the
      figure, A generates an outbound SA labeled Tx(a1-b1), representing
      that it has been generated using A's DH pair labeled a1 and B's DH
      pair labeled b1.  B generates the same IPsec SA as an inbound SA,
      which is labeled Rx(a1-b1).  Similarly, A generates an inbound IPsec
      SA labelled Rx(b1-a1), which is the same IPsec SA on B which is labelled
      Tx(b1-a1). </t> 

      <t> This process repeats on both A and B as they discover other PE
      devices with which they are authorized to communicate. </t>

       </section> 


       <section anchor="RekeySignaling" title="Rekey of IPsec SAs">
   
          <t> Any IPsec device may initiate a rekey at any time.  Common reasons to
       perform a rekey include a local time or volume based policy, or may
       be the result of a cipher counter mode Initialization Vector (IV)
       counter nearing its final value.  The rekey process is performed
       individually for each remote peer.  If rekeying is performed with
       multiple peers simultaneously, then the decision process and rules
       described in this rekey are performed independently for each peer. </t>

          <t> A decision process choosing an outbound IPsec SA is followed when
       certain events occur, as described in the rules below.  The same
       decision process is followed regardless of whether the device is
       performing a rekey or responding to a peer's rekey.  The decision
       process is: </t>

          <t> <list style="numbers">

          <t> Determine the outbound SAs with the remote peer's most recently
          distributed DH public value. </t>

          <t> Determine which of those outbound SAs are "live".  A "live"
          outbound SA is one built from a DH value from the local peer for
          which it has observed inbound traffic using any SA based on the
          same local DH pair.  This proves that the remote peer is prepared
          to receive traffic protected by that DH pair. </t>

          <t> Choose the "live" outbound SA built from the local peer's most
          recent DH public value. </t>
          </list> 
          </t>

    <t>  A rekey operation follows these four basic rules. </t>


          <t> <list style="format Rule %d:">
          <t>  When an IPsec device needs to perform a rekey with a remote
      peer, it creates a new pair of IPsec SAs by combining the new DH
      private value with the peer's DH public values.  If the remote
      peer is also in the midst of a rollover and its DH public value
      has already been received, then this may result in creating two
      sets of SAs: one pair with the remote peer's old DH public value,
          and one pair with the remote peer's new DH public value. </t>

          <t>  When an IPsec device receives a new remote peer's DH public
      value from the controller it creates and installs a new pair of
      IPsec SAs by combining the remote peer's new DH public value with
      its own current local DH private values.  If both devices are in
      the midst of a rollover, this may result in creating two sets of
      SAs with the remote peer's new DH public value: one with the local
      old DH private value, and one with the local new DH private value.
          The outbound SA decision process is performed. </t>

          <t>  The first IPsec packet received by a rekeying IPsec device on
      an inbound SA using its new DH pair causes it to perform the
      outbound SA decision process.  It may also shorten the lifetime of
      IPsec SAs using its own old DH pair that are shared with this
      peer, as they are no longer in use (other than the inbound SA
          might receive packets in transit). </t>

          <t>  The first IPsec packet received from a remote rekeying IPsec
      device using the remote peer's new DH pair allows the IPsec device
      to shorten the lifetime of IPsec SAs shared with this peer using
          unused remote DH pairs. </t>

               </list> </t>

          <t>  Two examples follow: a single IPsec device performing a rekey with
   its peers, and two IPsec devices performing a simultaneous rekey.
   The same rekey operations described above are exhibited in both
          cases. </t>


            <section anchor="SingleDeviceSignaling" title="Single IPSec Device Rekey">

    <t> When a single IPsec device begins a rekey, it first generates a new
   DH pair and generates new IPsec SA pairs for each peer with which it
   is communicating.  It does this by combining the new DH private value
   with each peer's existing DH public value.  Only when the new IPsec
   SAs have been installed and the device is prepared to receive on
   those new SAs does it then distribute the new DH public value to the
   Controller, which forwards the new DH public value to its authorized
   peers.  The rekeying IPsec device continues to transmit on the old
   SAs for each peer until it observes that peer begin to transmit on
   the new SAs. </t>



      <t>  
     <figure align="center" title="Single IPSec Device Rekey between two peers"
      anchor="singleReKey">
        <!--
         <preamble>Preamble text - can be omitted or empty.</preamble>
          -->
       <artwork align="center"><![CDATA[
                      +---+    +----------+     +---+
                      | A |    |  BGP RR  |     | B |
                      +-+-+    +-----+----+     +-+-+
           +----------+ |            |            |
           |Generate  | |            |            |
           |DH pair a2| |            |            |
           +----------+ |            |            |
       +--------------+ |            |            |
       |Rule 1        | |            |            |
       | Create SAs   | |            |            |
       |  Tx(a2-b1)   | |            |            |
       |  Rx(b1-a2)   | |            |            |
       | Use Tx(a1-b1)| |  a2-pub    |            |
       +--------------+ +----------> |            |
                        |            |            |
                        | IPsec ESP Tx(a1-b1)     |
                        +-----------------------> |
                        |     IPsec ESP Tx(b1-a1) |
                        | <-----------------------+
                        |            |            |
                        |            |  a2-pub    |
                        |            +----------> | +--------------+
                        |            |            | |Rule 2        |
                        |            |            | | Create SAs   |
                        |            |            | |  Tx(b1-a2)   |
                        |            |            | |  Rx(a2-b1)   |
                        |     IPsec ESP Tx(b1-a2) | | Use Tx(b1-a2)|
       +--------------+ | <-----------------------+ +--------------+
       |Rule 3        | |            |            |
       | Use Tx(a2-b1)| |            |            |
       | Shorten life | |            |            |
       |  Tx(a1-b1)   | | IPsec ESP Tx(a2-b1)     |
       |  Rx(b1-a1)   | +---------------------->  | +--------------+
       +--------------+ |            |            | |Rule 4        |
                        |            |            | | Shorten life |
                        |            |            | |  Tx(b1-a1)   |
                        |            |            | |  Rx(a1-b1)   |
                        |            |            | +--------------+
                        +            +            +]]></artwork>

     </figure>
     </t>



   <t> In Figure 3, device A is shown as performing a rekey, and it creates
   a DH pair labelled "a2".  The following steps are followed.  </t> 


          <t> <list style="numbers">
     <t> Rule 1 requires creating new IPsec SAs for each peer.  In this
       example, A creates a new outbound IPsec SA to communicate with B
       labelled Tx(a2-b1), and a new inbound IPsec SA labelled
       Rx(b1-a2).  A continues to transmit on Tx(a1-b1) (generated as
       shown in Figure 2).  </t> 

      <t> A distributes the new public value (a2-pub) to the Controller who
       forwards it to A's authorized peers, which includes B.  During
       this time, both A and B continue to use the initial IPsec SAs
       setup between them using a1 and b1.  </t> 

      <t> When B receives a2 from the controller, B follows Rule 2 by
       creating Tx(b1-a2), Rx(a2-b1).  B also follows the outbound SA
       decision process, which causes it to change its outbound IPsec SA
       to A to Tx(b1-a2).  </t> 

      <t> When A receives a packet protected by Rx(b1-a2), it follows Rule
       3 and performs the outbound SA decision process.  This causes it
       to change its outbound IPsec SA to Use Tx(a2-b1).  It also
       optionally shortens the lifetime of the old IPsec SAs shared with
       this peer.  </t> 

      <t> When B receives a packet protected by Tx(a2-b1), it follows Rule
       4, in which it may shorten the lifetime of the old IPsec SAs
       shared with this peer using DH pairs that are no longer in use.  </t> 
      
      </list> </t>

      <t> At the end of the rekey, both A and B retain a single DH pair, and a
   single set of IPsec SAs between them.  </t> 


            </section> 


            <section anchor="MultiDeviceSignaling" title="Multiple IPSec Device Rekey">
   <t> When two or more IPsec device simultaneously begin a rekey, they each
   follow the rekeying method described in the previous section.  Every
   rekeying IPsec device generates a new DH pair and generates new IPsec
   SA pairs for each peer with which it is communicating by combining
   their new DH private value with each peer's existing DH public value.
   When this completes on a particular IPsec device, it distributes the
   new DH public value to the Controller, which forwards it to its
   authorized peers.  Each continues to transmit on the existing SAs for
   each peer until it observes that peer transmitting on the new SAs.
   During a simultaneous rekey up to four pairs of IPsec SAs may be
   temporarily created, but the four rules ensure that they converge on
   a single new set of IPsec SAs. </t>


      <t>  
     <figure align="center" title="Simultaneous IPsec Device Rekey between two peers" anchor="MultiReKey">
        <!--
         <preamble>Preamble text - can be omitted or empty.</preamble>
          -->
       <artwork align="left"><![CDATA[
                      +---+    +----------+     +---+
                      | A |    |  BGP RR  |     | B |
                      +-+-+    +-----+----+     +-+-+
 +---------------------+ |            |            | +--------------+
 |Generate DH pair a2  | |            |            | |Gen DH pair b2|
 +---------------------+ |            |            | +--------------+
 +---------------------+ |            |            | +--------------+
 |Rule 1               | |            |            | |Rule 1        |
 | Create SAs          | |            |            | | Create SAs   |
 |  Tx(a2-b1),Rx(b1-a2)| |            |            | |  Tx(b2-a1)   |
 | Use Tx(a1-b1)       | |  a2-pub    |            | |  Rx(a1-b2)   |
 +---------------------+ +----------> |    b2-pub  | | Use Tx(b1-a1)|
                         |            | <----------+ +--------------+
                         | IPsec ESP Tx(a1-b1)     |
                         +-----------------------> |
                         |     IPsec ESP Tx(b1-a1) |
                         | <-----------------------+
                         |            |  a2-pub    |
                         |  b2-pub    +----------> | +--------------+
 +---------------------+ | <----------+            | |Rule 2        |
 |Rule 2               | |            |            | | Create SAs   |
 | Create SAs          | |            |            | |  Tx(b1-a2)   |
 |  Tx(a1-b2),Rx(b2-a1)| |            |            | |  Rx(a2-b1)   |
 |  Tx(a2-b2),Rx(b2-a2)| |            |            | |  Tx(b2-a2)   |
 | Use Tx(a1-b2)       | |            |            | |  Rx(a2-b2)   |
 +---------------------+ |     IPsec ESP Tx(b1-a2) | | Use Tx(b1-a2)|
                         | <-----------------------+ +--------------+
                         | IPsec ESP Tx(a1-b2)     |
 +---------------------+ +-----------------------> | +--------------+
 |Rule 3               | |            |            | |Rule 3        |
 | Use Tx(a2-b2)       | |            |            | | Use Tx(b2-a2)|
 | Shorten life        | |            |            | | Shorten life |
 |  Tx(a1-b1),Rx(b1-a1)| |            |            | |  Tx(b1-a1)   |
 |  Tx(a1-b2),Rx(b2-a1)| |            |            | |  Rx(a1-b1)   |
 +---------------------+ | IPsec ESP Tx(a2-b2)     | |  Tx(b1-a2)   |
                         +---------------------->  | |  Rx(a2-b1)   |
                         |    IPsec ESP Tx(b2-a2)  | +--------------+
 +---------------------+  <-----------------------+  +--------------+
 | Rule 4              | |            |            | |Rule 4        |
 | Shorten life        | |            |            | | Shorten life |
 |  Tx(a2-b1),Rx(b1-a2)| |            |            | |  Tx(b1-a2)   |
 +---------------------+ |            |            | |  Rx(a2-b1)   |
                         +            +            + +--------------+]]></artwork>

     </figure>
     </t>



   <t> In Figure 4, device A and device B are both shown as performing a
   rekey.  Their initial state corresponds to the final state shown in
   Figure 2 (i.e., they are communicating using a single pair of IPsec
   SAs created from DH pairs "a1" and "b1". </t> 

          <t> <list style="numbers">

       <t>  A and B follow Rule 1, which includes creating new IPsec SAs for
       each peer.  In this example, A creates a new outbound IPsec SA to
       communicate with B labelled Tx(a2-b1), and a new inbound IPsec SA
       labelled Rx(b1-a2).  B creates a new outbound IPsec SA to
       communicate with B labelled Tx(a1-b2), and a new inbound IPsec SA
       labelled Rx(b2-a1).  A and B continue to transmit on IPsec SAs
       previously created from DH pairs "a1" and "b1". </t> 

       <t>  A distributes the new public value (a2-pub) to the Controller who
       forwards it to A's authorized peers, which includes B.  B also
       distributes the new public value (b2-pub) to the Controller who
       forwards it to B's authorized peers, which includes A. </t> 

       <t>  When A and B receive each other's new peer DH public value from
       the controller they follows Rule 2.  But because now there are
       four DH values that could be in used between A and B, they must
       be prepared to use IPsec SAs using each permutation of DH values:
       a1-b1, a1-b2, a2-b1, a2-b2.  Prior to implementing Rule 2, each
       has already created sets of IPsec SAs matching two of the
       permutations, so just two more sets must be generated during Rule
       2. 
       
       <list style="symbols">

          <t> One pair is created using the IPsec device's old DH pair with
          the peer's new DH pair.  This is necessary, because the peer
          may transmit on this pair. </t>

          <t>  One pair is created using the IPsec device's new DH pair with
          the peer's new DH pair.  This is the set of IPsec SAs that
          will be used at the end of the rekey process. </t>
       </list>

       Each peer begins transmitting on an IPsec SA that combines the
       remote peer's new DH pair and its own old DH pair, which is the
       most recent "live" SA on which it can transmit.  I.e., A begins
       transmitting on Tx(a1-b2) and B begins transmitting on Tx(b1-a2).  </t> 

       <t>   When A receives a packet protected by Rx(b1-a2), it understands
       that the remote peer has received its new DH public value.  A
       also understands that because of Rule 2 that B must have created
       IPsec SAs using a2-b2.  This allows A to follow Rule 3 and change
       its outbound IPsec SA to Use Tx(a2-b2).  Similarly, when B
       receives a packet protected by Rx(a1-b2), B recognizes that it
       can also begin to transmit using Tx(b2-a2).  Note that it also
       possible that A will receive a packet protected by Rx(b2-a2) or B
       will receive a packet protected by Rx(a2-b2), and then knows it
       can transmit on an IPsec SA using both of the new DH pairs. </t> 

       <t>   Also in Rule 3, Both A and B optionally shorten the lifetime of
       older IPsec SAs shared with this peer derived from unused DH
       pairs to be cleaned up.  A shortens the lifetime of SAs based on
       a1.  B shortens the lifetime of SAs based on b1. </t> 

       <t>  When A and B receive a packet protected by the remote peer's
       latest DH pair, they shortens the lifetime of SAs based on the
       remote peer's unused DH pair.  </t> 


            </list> </t>

            </section> 

       </section> 


    </section>



   <section anchor="DBGen" title="IPsec Database Generation">


   <t> The PAD, SPD, and SAD all need to be setup as defined in the IPsec
   Security Architecture [RFC4301]. </t>

         <section anchor="SPD" title="The Security Policy Database (SPD)">

         <t> The SPD is implemented using methods outside the scope of this
         document.  The SPD describes the type of traffic that will be
         protected between IPsec devices and the policy (e.g., ciphers) used
         to create SAs. </t>
         </section>

        <section anchor="SAD" title="Security Association Database (SAD)">

         <t> The SAD is constructed from IPsec policy (e.g., ciphers) obtained
             (depending on the controller protocol method) either from the
              controller or distributed by a peer (see Section 6). </t>

         <t> Keying Material is generated following the method defined in IKEv2,
             and depends on SPIs, nonces, and the Diffie-Hellman shared secret. </t>

         <t> The following sections describe how the necessary values are
             determined. </t>

        <section anchor="KeyGenSA" title="Generating Keying Material for IPsec SAs">

        <section anchor="SharedSecret" title="g^ir">

              <t> A DH public value is distributed from the peer. </t>

              <t> A DH shared secret (g^ir) is computed using the peer's public value,
   and the device's private value.  The DH group to be used must be
   known by the device.  Options include distribution by an SDN
   controller, or distribution by the peer with the DH public value (see
   Section 6). </t>

        </section> <!-- Level 3 Subsection -->

        <section anchor="Nonces" title="Nonces">

   <t> Nonces are distributed with a DH public value, and are used only with
   that value.  It is RECOMMENDED that nonces are generated as described
   in Section 2.10 of [RFC7296]. </t>


   <t> IKEv2 Key derivation specifies an initiator's nonce (Ni) and a
   responder's nonce (Nr).  While neither peer is truly initiating a
   session), in order to fit the IKE key material models the roles must
   be assigned.  The initiator is chosen as the peer with the larger
   nonce and the responder is the peer with the smaller.  This does mean
   that the roles can change for each rekey and for each SA within a
   rekey. </t>

        </section> <!-- Level 3 Subsection -->



        <section anchor="SPIs" title="SPIs">

   <t> SPI values that are unique to each generation of keying material need
   to be determined.  While each peer could distribute its own inbound
   SA value, the SPI value would be used by many peers.  Although this
   is not a problem for an SA lookup (lookup can include the source and
   destination IP addresses), experience has shown that this is sub-
   optimal for some hardware SA lookup algorithms.  Instead, this
   specification proposes generating values that are unpredictable and
   indistinguishable from randomly-generated SPI values. </t>

   <t> SPI values are generated using the IKEv2 prf+ function, where nonces
   are used as the input to the prf.  This produces a statistically
   random SPI value that should be unique.  However, with a 32 bit value
   there is still a very small, but non-zero, chance of SPIs repeating
   for a given pair of peers.  To prevent this and ensure uniqueness in
   the operational window, we also use the lower 2 bits from each peer's
   rekey counter. </t>

   <t> First the SPIs are taken from the prf+ function as 32 bit values and
   assigned based on which peer is taking the role of initiator and
   which is taking the role of responder.  The p_SPI_i is taken by the
   device providing Ni, where p_SPI_r is taken by the other device. </t>

     <t> <figure align="left"><artwork><![CDATA[
     {p_SPI_i | p_SPI_r } = prf+(Ni | Nr, "SPI generation")
     ]]></artwork></figure> </t>


   <t> Next p_SPI_i and p_SPI_r are mapped from initiator and responder
   roles to local and remote roles based on the choice of Ni and Nr in
   5.2.1.2 and are renamed to p_SPI_local and p_SPI_remote. </t>

   <t> Then, 2 2-bit Rotation Numbers (RN) are generated from the 2 least
   significant bits (LSB) of the 2 rekey counter values (see Section 6).
   These 4 bits replace the least significant bits of p_SPI_local and
   p_SPI_remote with the local RN bits taking the least significant
   position in p_SPI_local and the remote RN bits taking the least
   significant position in p_SPI_remote.  This shown in the following
   two diagrams with RN_local shown as R_l and RN_remote shown as R_r. </t>

          <t> <figure align="left"><artwork><![CDATA[
    (MSB)                                                       (LSB)
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              p_SPI_local bits from prf+               |R_r|R_l|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    (MSB)                                                       (LSB)
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              p_SPI_remote bits from prf+              |R_l|R_r|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork></figure> </t>

     <t>  The reason for changing terminology from initiator/responder to
   local/remote is because the roles of initiator/responder can change
   in every rekey.  The order of RN_local and RN_remote needs to remain
   constant.  If that order was based on initiator/responder, there's a
   risk that if the initiator and responder roles changed and the two
   peers re-keyed on different frequencies, they could end up with
   identical RN values. </t>

      <t> In some circumstances additional values may also need to be added to
   the prf for peers to ensure that they have implemented the same
   policy.  Appendix A.3.1 includes a discussion of when this might be
   needed.  In these cases, only the prf+ inputs are modified and the
   Rotation Numbers MUST still be added as above. </t>

      <t> Because a device is not choosing its inbound SPI, its SA lookup
   process needs to be aware that duplicates could occur across
   different peers.  In that case, the inbound SA Lookup SHOULD include
   a source IP address in addition to the SPI value (see Section 4.1 of
   [RFC4301]). </t>

        </section> <!-- Level 3 Subsection -->


        <section anchor="FinalKeyGen" title="IPsec key generation">

          <t> As described in previous sections, a DH public value and a nonce are
          distributed by peers.  These are used to generate IPsec keys
          following the method defined in the IKEv2.  SKEYSEED is generated
          following Section 2.14 of [RFC7296]: </t>

          <t> <figure align="left"><artwork><![CDATA[
          SKEYSEED = prf(Ni | Nr, g^ir)
          ]]></artwork></figure> </t>


          <t> KEYMAT can be similarly derived as defined by IKEv2 (Section 2.17 of
          [RFC7296]), although only SK_d is required to be generated (shown in
          Section 2.14 of [RFC7296]). </t> 


     <t> <figure align="left"><artwork><![CDATA[
     SK_d = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr)

     KEYMAT = prf+(SK_d, Ni | Nr)      
     ]]></artwork></figure> </t>


          <t> However, with the simplification where only SK_d is generated, it can
          be observed that the derivation of SK_d could be skipped entirely,
          and an optimized derivation of KEYMAT could be as follows: </t>


      <t> <figure align="left"><artwork><![CDATA[
     KEYMAT = prf+ (SKEYSEED, Ni | Nr | SPIi | SPIr)
      ]]></artwork></figure> </t>

          <t> Note: A single specification for generating KEYMAT will be determined
          in a future version of this document. </t>

        </section> <!-- Level 3 Subsection -->
        </section> <!-- Level 2 Subsection -->
        </section> <!-- Level 1 Subsection -->

        <section anchor="PAD" title="Peer Authorization Database (PAD)">


           <t> The PAD identifies authorized peers.  PAD entries are either
           statically configured, or may be dynamically updated by the
        controller.</t>

        <t> The PAD omits authentication data for each peer, because it has
        delegated authentication and authorization to the controller.</t>

        <t> The controller protocol MUST be able to describe an identity that a
        receiver can match against its local PAD database, to ensure that the
        peer is an authorized peer. </t>

        </section> <!-- Level 1 Subsection -->

   </section> <!-- Main Section --> 



   <section anchor="policyDistribution" title="Policy distributed through the BGP RR">

   <t> An IPsec device distributes to a controller a DH public value and the
   associated information and policy needed to create IPsec SAs in a
   Device Information Message (DIM).  The controller then distributes
   the DIM to all authorized peers of that device.  The following data
   elements MUST be embedded in a DIM message: </t> 

         <t> <list style="symbols">
      <t> DH public number (used for key computation) </t>

      <t> Nonce (used for key computation and SPI generation) </t>

      <t> Peer identity (used to identify a peer in the PAD) </t>

      <t> An Indication whether this is the initial distributed policy </t>

      <t> A rekey counter, which increases for each unique DIM sent </t>
            </list> </t>



    <t> In cases where a single fixed IPsec policy has been pre-distributed,
   it is not necessary for the peer to send or receive that policy in a
   DIM.  However, in cases where an IPsec device needs to indicate the
   policy it is willing to use, the following data elements SHOULD be
   included in a DIM: </t>

         <t> <list style="symbols">

      <t>  An IPsec policy or policies </t>

      <t> A lifetime bounding the use of the DH public number.  When this DH
      public number is used to create an IPsec SA, the shortest lifetime
      is used as an SA lifetime for the pair of generated IPsec SAs.
      When the lifetime expires, the local version of the DIM and IPsec
      SAs generated from it MUST be deleted. </t>
            </list> </t>

   <t> Appendix A suggests different ways that this policy may be included
   in a controller protocol.  This document does not define a normative
   protocol format, because the DIM very likely needs to be integrated
   into an existing controller protocol rather than be an independent
   key management protocol.  However, the controller protocol MUST
   provide a strong authentication between the device and the
   controller, and integrity of the messages MUST be provided.
   Confidentiality of the messages SHOULD also be provided.  It is
   important that the controller protocol be protected with algorithms
   that are at least as strong as the algorithms used to protect the
   IPsec packets. </t>

      <section anchor="policyNegotiation" title="IPsec policy negotiation">

   <t> In many controller based networks, there is a single IPsec policy
   used by all devices and there is no need to redistribute or select
   policy details.  However, in some circumstances, there may be a need
   to have multiple policy options.  This could happen when a controller
   changes the policy and wants to smoothly migrate all devices to the
   new policy.  Or it could happen if a network supports devices with
   different capabilities.  In these cases, devices need to be able to
   choose the correct policy to use for each other device, and must do
   this without sending additional messages and without sending
   individual messages to each peer.  When a device supports multiple
   policies, it MUST include those policies within the DIM.  This is
   done by sending multiple distinct policies, in order of preference,
   where the first policy is the most preferred.  The policy to use is
   selected by taking the receiver's list of policies (i.e., the list
   advertised by the device that generates Nr), starting with the first
   policy, compare against the initiator's (device that generates Ni)
   list, and choosing the first one found in common.  The method
   conforms to the IKEv2 Cryptographic Algorithm Negotiation described
   in Section 2.7 of [RFC7296].  (However, see additional discussion
   when IKEv2 payloads are used in Appendix A.3.1). </t>

   <t> If there is no match, this indicates a controller configuration
   error.  These devices MUST NOT establish new SAs until a DIM is
   received that does produce a match. </t>

   <t> When a device supports more than one DH group, then a unique DH
   public number MUST be specified for each in order of preference.  The
   selection of which DH group to use follows the same logic as Policy
   selection, using the receiver's list order until a match is found in
   the initiator's list. </t>

      </section>
      </section>



   <section anchor="bgp_requirements_overview" title="BGP Component">


        <t> The architecture that encompasses device-to-controller trust model,
        has several components among which is the signaling component. Secure
        EVPN Signaling, as defined in this document, is the BGP signaling
        component of the overall Architecture. We will briefly describe this
        Architecture here to further facilitate understanding how Secure EVPN
        fits into the overall architecture. The Architecture describes the
        components needed to create BGP based SD-WANs and how these
        components work together. Our intention is to list these components
        here along with their brief description and to describe this
        Architecture in details in a separate document where to specify the
        details for other parts of this architecture besides the BGP
        signaling component which is described in this document. </t>

        <t> The Architecture consists of four components.  These components are
        Zero Touch Bring-up, Configuration Management, Orchestration, and
        Signaling.  In addition to these components, secure communications
        must be provided between the edge nodes and all servers/devices
        providing the architecture components. </t>


        <section anchor="ztp" title="Zero Touch Bring-up (ZTB)">

        <t> The first component is a zero touch capability that allows an edge
        device to find and join its SD-WAN with little to no assistance other
        than power and network connectivity.  The goal is to use existing
        work in this area.  The requirements are that an edge device can
        locate its ZTB server/component of its SD-WAN controller in a secure
        manner and to proceed to receive its configuration. </t>

        </section> 


        <section anchor="config_mgmt" title="Configuration Management">

        <t> After an edge device joins its SD-WAN, it needs to be configured.
        Configuration covers all device configuration, not just the
        configuration related to Secure EVPN.  The previous Zero Touch Bring-
        up component will have directed the edge device, either directly or
        indirectly, to its configuration server/component.  One example of a
        configuration server is the I2NSF Controller. After a device has been
        configured, it can engage in the next two components.  Configuration
        may include updates over time and is not a one time only component.  </t>

        </section> 


        <section anchor="Orchestration" title="Orchestration">

        <t> This component is optional.  It allows for more dynamic updates of
        configuration and statistics information.  Orchestration can be more
        dynamic than configuration. </t>

        </section> 


        <section anchor="Signaling" title="Signaling">

        <t> Signaling is the component described in this document.  The
        functionality of a Route Reflector is well understood.  Here we
        describe the signaling component of BGP SD-WAN Architecture and the
        BGP extension/signaling for IPsec key management and policy. </t>
        </section> 


    </section> 

    <section anchor="SolutionDescription" title="Solution Description">

        <t> This solution uses BGP P2MP signaling where an originating PE only
        send a message to the Route Reflector (RR) and then the RR reflects
        that message to the interested recipient PEs. The framework for such
        signaling is described in section 4 and it is referred to as
        device-to-controller trust model. This trust model is significantly
        different than the traditional peer-to-peer trust model where a P2P
        signaling protocol such as IKEv2 [RFC7296] is used in which the PE
        devices directly authenticate each other and agree upon security
        policy and keying material to protect communications between
        themselves. The device-to-controller trust model leverages P2MP
        signaling via the controller (e.g., the RR) to achieve much better
        scale and performance for establishment and maintenance of large
        number of pair-wise Security Associations (SAs) among the PEs. </t>

      <t> This device-to-controller trust model first secures the control
   channel between each device and the controller using peer-to-peer
   protocol such as IKEv2 [RFC7296] to establish P2P SAs between each PE
   and the RR. It then uses this secured control channel for P2MP
   signaling in establishment of P2P SAs between each pair of PE
   devices. </t>


      <t> Each PE advertises to other PEs via the RR the information needed in
   establishment of pair-wise SAs between itself an every other remote
   PEs. These pieces of information are sent as Sub-TLVs of IPSec tunnel
   type in BGP Tunnel Encapsulation attribute. These Sub-TLVs are
   detailed in section 10 and are based on the DIM message components
   in section 5 and the IKEv2 specification [RFC7296]. The
   IPsec tunnel TLVs along with its Sub-TLVs are sent along with the BGP
   route (NLRI) for a given level of granularity. </t>

      <t> If only a single SA is required per pair of PE devices to multiplex
   user traffic for all tenants, then IPsec tunnel TLV is advertised
   along with IPv4 or IPv6 NLRI representing loopback address of the
   originating PE. It should be noted that this is not a VPN route but
   rather an IPv4 or IPv6 route. </t>

      <t> If a SA is required per tenant between a pair of PE devices, then
   IPsec tunnel TLV can be advertised along with EVPN IMET route
   representing the tenant or can be advertised along with a new EVPN
   route representing the tenant. </t>

        <t> If a SA is required per tenant's subnet (e.g., per VLAN) between a
        pair of PE devices, then IPsec tunnel TLV is advertised along with
        EVPN IMET route. </t>

        <t>  If a SA is required between a pair of tenant's devices represented by
        a pair of IP addresses, then IPsec tunnel TLV is advertised along
        with EVPN IP Prefix Advertisement Route or EVPN MAC/IP Advertisement
        route. </t>

        <t> If a SA is required between a pair of tenant's devices represented by
        a pair of MAC addresses, then IPsec tunnel TLV is advertised along
        with EVPN MAC/IP Advertisement route. </t>

        <t> If a SA is required between a pair of Attachment Circuits (ACs) on
        two PE devices (where an AC can be represented by {VLAN, port}), then
        IPsec tunnel TLV is advertised along with EVPN Ethernet AD route. </t>

    <section anchor="InheritanceSecPolicy" title="Inheritance of Security Policies">


      <t> Operationally, it is easy to configure a security association between
   a pair of PEs using BGP signaling. This is the default security
   association that is used for traffic that flows between peers.
   However, in the event more finer granularity of security association
   is desired on the traffic flows, it is possible to set up SAs between
   a pair of tenants, a pair of subnets within a tenant, a pair of IPs
   between a subnet, and a pair of MACs between a subnet using the
   appropriate EVPN routes as described above. In the event, there are
   no security TLVs associated with an EVPN route, there is a strict
   order in the manner security associations are inherited for such a
   route. This results in an EVPN route inheriting the security
   associations of the parent in a hierarchical fashion. For example,
   traffic between an IP pair is protected using security TLVs announced
   along with the EVPN IP Prefix Advertisement Route or EVPN MAC/IP
   Advertisement route as a first choice. If such TLVs are missing with
   the associated route, then one checks to see if the subnets the IPs
   are associated with has security TLVs with the EVPN IMET route. If
   they are present, those associations are used in securing the
   traffic. In the absence of them, the peer security associations are
   used. The order in which security associations are inherited are from
   the granular to the coarser, namely, IP/MAC associated TLVs with the
   EVPN route being the first preference, and the subnet, the tenant,
   and the peer associations preferred in that fashion. </t>

      <t> It should be noted that when a security association is made it is
   possible for it to be re-used by a large number of traffic flows. For
   example, a tenant security association may be associated with a
   number of child subnet routes. Clearly it is mandatory to keep a
   tenant security association alive, if there are one or more subnet
   routes that want to use that association. Logically, the security
   associations between a pair of entities creates a single secure
   tunnel. It is thus possible to classify the incoming traffic in the
   most granular sense {IP/MAC, subnet, tenant, peer} to a particular
   secure tunnel that falls within its route hierarchy. The policy that
   is applied to such traffic is independent from its use of an existing
   or a new secure tunnel. It is clear that since any number of
   classified traffic flows can use a security association, such a
   security association will not be torn down, if at least there is one
   policy using such a secure tunnel. </t>
   </section>

    <section anchor="DistSecPolicy" title="Distribution of Public Keys and Policies">

      <t> One of the requirements for this solution is to support a single DH
   group and a single policy for all SAs as well as to support multiple
   DH groups and policies among the SAs. The following subsections
   describe what pieces of information (what Sub-TLVs) are needed to be
   exchanged to support a single DH group and a single policy versus
   multiple DH groups and multiple policies. </t>

    <section anchor="MinimalDIM" title="Minimal DIM">

      <t> For SA establishment, at the minimum, a PE needs to advertise to
   other PEs, its DIM values as specified in section 5.  These
   include: </t>



      <t> <figure align="left"><artwork><![CDATA[
      ID   Tunnel ID
      N    Nonce
      RC   Rekey Counter
      I    Indication of initial policy distribution
      KE   DH public value.
            ]]></artwork></figure> </t>

      <t> When this minimal set of DIM values is sent, then it is assumed that
   all peer PEs share the same policy for which DH group to use, as well
   as which IPSec SA policy to employ. Section 5.1 defines the Minimal
   DIM sub-TLV as part of IPsec tunnel TLV in BGP Tunnel Encapsulation
   Attribute. </t>
   </section>

    <section anchor="MultiplePolicy" title="Multiple Policies">

      <t> There can be scenarios for which there is a need to have multiple
   policy options.  This can happen when there is a need for policy
   change and smooth migration among all PE devices to the new policy is
   required. It can also happen if different PE devices have different
   capabilities within the network. In these scenarios, PE devices need
   to be able to choose the correct policy to use for each other. This
   multi-policy scheme is described in section 6. In
   order to support this multi-policy feature, a PE device MUST
   distribute a policy list. This list consists of multiple distinct
   policies in order of preference, where the first policy is the most
   preferred one.  The receiving PE selects the policy by taking the
   received list (starting with the first policy) and comparing that
   against its own list and choosing the first one found in common. If
   there is no match, this indicates a configuration error and the PEs
   MUST NOT establish new SAs until a message is received that does
   produce a match. </t>
   </section>

        <section title="Multiple DH-groups">

      <t> It can be the case that not all peers use the same DH group.  When
   multiple DH groups are supported, the peer may include multiple KE
   Sub-TLVs.  The order of the KE Sub-TLVs determines the preference.
   The preference and selection methods are specified in section 6. </t>
        </section>

        <section title="Multiple or Single ESP SA policies">

      <t> In order to specify an ESP SA Policy, a DIM may include one or more
   SA Sub-TLVs. When all peers are configured by a controller with the
   same ESP SA policy, they MAY leave the SA out of the DIM.  This
   minimizes messaging when group configuration is static and known.
   However, it may also be desirable to include the SA.  If a single SA
   is included, the peer is indicating what ESP SA policy it uses, but
   is not willing to negotiate.  If multiple SA Sub-TLVs are included,
   the peer is indicating that it is willing to negotiate.  The order of
   the SA Sub-TLVs determines the preference.  The preference and
   selection methods are specified in section 6. </t>
         </section>
        </section>


    <section anchor="InitialSAGen" title="Initial IPsec SAs Generation">

      <t> The procedure for generation of initial IPsec SAs is described in
   section 4. This section gives a summary of it in
   context of BGP signaling. When a PE device first comes up and wants
   to setup an IPsec SA between itself and each of the interested remote
   PEs, it generates a DH pair along for each [what word here?
   "tennant"?] using an algorithm defined in the IKEv2 Diffie-Hellman
   Group Transform IDs [IKEv2-IANA]. The originating PE distributes the
   DH public value along with the other values in the DIM (using IPsec
   Tunnel TLV in Tunnel Encapsulation Attribute) to other remote PEs via
   the RR. Each receiving PE uses this DH public number and the
   corresponding nonce in creation of IPsec SA pair to the originating
   PE - i.e., an outbound SA and an inbound SA. The detail procedures
   are described in <xref target="InitSignaling"/>. </t>
        </section>


    <section anchor="Rekey" title="Re-Keying">

      <t> A PE can initiate re-keying at any time due to local time or volume
   based policy or due to the result of cipher counter nearing its final
   value. The rekey process is performed individually for each remote
   PE. If rekeying is performed with multiple PEs simultaneously, then
   the decision process and rules described in this rekey are performed
   independently for each PE. <xref target="RekeySignaling"/> describes
   this rekeying process in details and gives examples for a single
   IPsec device (e.g., a single PE) rekey versus multiple PE devices
   rekey simultaneously. </t>
       </section>


    <section anchor="IPSecDBs" title="IPsec Databases">

      <t> The Peer Authorization Database (PAD), the Security Policy Database
   (SPD), and the Security Association Database (SAD) all need to be
   setup as defined in the IPsec Security Architecture <xref target="RFC4301">RFC 4301</xref>.
   Section 5 of this document gives a summary description of how
   these databases are setup where key is
   exchanged via P2MP signaling through the RR and the policy can be either 
   signaled via the RR (in case of multiple
   policies) or configured by the management station (in case of single
   policy). </t>

   </section> 
   </section> 



<section anchor="encapsulation" title="Encapsulation">
 
     <t> 
        Vast majority of Encapsulation for Network Virtualization Overlay
   (NVO) networks in deployment are based on UDP/IP with UDP destination
   port ID indicating the type of NVO encapsulation (e.g., VxLAN, GPE,
   GENEVE, GUE) and UDP source port ID representing flow entropy for
   load-balancing of the traffic within the fabric based on n-tuple that
   includes UDP header. When encrypting NVO encapsulated packets using
   IP Encapsulating Security Payload (ESP), the following two options
   can be used:  a) adding a UDP header before ESP header (e.g., UDP
   header in clear) and b) no UDP header before ESP header (e.g.,
   standard ESP encapsulation). The following subsection describe these
   encapsulation in further details.
     </t>


<section anchor="StandardESPEncapsulation" title="Standard ESP Encapsulation">

     <t>
   When standard IP Encapsulating Security Payload (ESP) is used
   (without outer UDP header) for encryption of NVO packets, it is used
   in transport mode as depicted below. When such encapsulation is used,
   for BGP signaling, the Tunnel Type of Tunnel Encapsulation TLV is set
   to ESP-Transport and the Tunnel Type of Encapsulation Extended
   Community is set to NVO encapsulation type (e.g., VxLAN, GENEVE, GPE,
   etc.). This implies that the customer packets are first encapsulated
   using NVO encapsulation type and then it is further encapsulated and
   encrypted using ESP-Transport mode.
     </t> 

      <t>  
     <figure align="center" anchor="stdencap">
        <!--
         <preamble>Preamble text - can be omitted or empty.</preamble>
          -->
       <artwork align="left"><![CDATA[
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       |       MAC Header      |          |      MAC Header       |
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       | Eth Type = IPv4/IPv6  |          | Eth Type = IPv4/IPv6  |
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       |    IP Header          |          |    IP Header          |
       |    Protocol = UDP     |          |    Protocol = ESP     |
       +-----------------------+          +-----------------------+
       |      UDP Header       |          |    ESP Header         |
       | Dest Port = VxLAN     |          +-----------------------+
       +-----------------------+          |     UDP Header        |
       |     VxLAN Header      |          | Dest Port = VxLAN     |
       +-----------------------+          +-----------------------+
       |    Inner MAC Header   |          |   VxLAN Header        |
       +-----------------------+          +-----------------------+
       |    Inner Eth Payload  |          |   Inner MAC Header    |
       +-----------------------+          +-----------------------+
       |        CRC            |          |   Inner Eth Payload   |
       +-----------------------+          +-----------------------+
                                          |  ESP Trailer (NP=UDP) |
                                          +-----------------------+
                                          |        CRC            |
                                          +-----------------------+
]]></artwork>

     </figure>
     </t>

     </section>

    <section anchor="ESPEncapwithUDP" title="ESP Encapsulation within UDP packet">

      <t>
             In scenarios where NAT traversal is required 
             (<xref target="RFC3948">RFC 3948</xref>) or where
   load balancing using UDP header is required, then ESP encapsulation
   within UDP packet as depicted in the following figure is used. The
   ESP for NVO applications is in transport mode. The outer UDP header
   (before the ESP header) has its source port set to flow entropy and
   its destination port set to 4500 (indicating ESP header follows). A
   non-zero SPI value in ESP header implies that this is a data packet
   (i.e., it is not an IKE packet). The Next Protocol field in the ESP
   trailer indicates what follows the ESP header, is a UDP header. This
   inner UDP header has a destination port ID that identifies NVO
   encapsulation type (e.g., VxLAN). Optimization of this packet format
   where only a single UDP header is used (only the outer UDP header) is
   for future study. </t>

   <t> When such encapsulation is used, for BGP signaling, the Tunnel Type
   of Tunnel Encapsulation TLV is set to ESP-in-UDP-Transport and the
   Tunnel Type of Encapsulation Extended Community is set to NVO
   encapsulation type (e.g., VxLAN, GENEVE, GPE, etc.). This implies
   that the customer packets are first encapsulated using NVO
   encapsulation type and then it is further encapsulated and encrypted
   using ESP-in-UDP with Transport mode.
     </t>

      <t>  
     <figure align="center" anchor="encapwithudp">

       <artwork align="left"><![CDATA[
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       |       MAC Header      |          |      MAC Header       |
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       | Eth Type = IPv4/IPv6  |          | Eth Type = IPv4/IPv6  |
       +-+-+-+-+-+-+-+-+-+-+-+-+          +-+-+-+-+-+-+-+-+-+-+-+-+
       |    IP Header          |          |    IP Header          |
       |    Protocol = UDP     |          |    Protocol = UDP     |
       +-----------------------+          +-----------------------+
       |      UDP Header       |          |    UDP Header         |
       | Dest Port = VxLAN     |          | Dest Port = 4500(ESP) |
       +-----------------------+          +-----------------------+
       |     VxLAN Header      |          |    ESP Header         |
       +-----------------------+          +-----------------------+
       |    Inner MAC Header   |          |     UDP Header        |
       +-----------------------+          | Dest Port = VxLAN     |
       |    Inner Eth Payload  |          +-----------------------+
       +-----------------------+          |   VxLAN Header        |
       |        CRC            |          +-----------------------+
       +-----------------------+          |   Inner MAC Header    |
                                          +-----------------------+
                                          |   Inner Eth Payload   |
                                          +-----------------------+
                                          |  ESP Trailer (NP=UDP) |
                                          +-----------------------+
                                          |        CRC            |
                                          +-----------------------+]]></artwork>

     </figure>
     </t>


    </section>
    </section>


   <section anchor="bgpencoding" title ="BGP Encoding">
	 <t>
             
   This document defines two new Tunnel Types along with its associated
   sub-TLVs for The Tunnel Encapsulation Attribute [TUNNEL-ENCAP]. These
   tunnel types correspond to ESP-Transport and ESP-in-UDP-Transport as
   described in section 4. The following sub-TLVs apply to both tunnel
   types unless stated otherwise.
         </t>
		
 
      <section title="The Base (Minimal Set) DIM Sub-TLV">
       <t>
                    The Base DIM is described in 3.2.1. One and only one Base DIM may be
   sent in the IPSec Tunnel TLV.
       </t>

      <t>  
     <figure align="center" anchor="minimalDIMTLV">

       <artwork align="left"><![CDATA[
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   ID Length   |       Nonce Length            |I|   Flags     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                             Rekey                             |
    |                            Counter                            |
    +---------------------------------------------------------------+
    |                                                               |
    ~  Originator ID + (Tenant ID) + (Subnet ID) + (Tenant Address) ~
    |                                                               |
    +---------------------------------------------------------------+
    |                                                               |
    ~                          Nonce Data                           ~
    |                                                               |
    +---------------------------------------------------------------+]]></artwork>

     </figure>
     </t>


<t>
ID Length (16 bits) is the length of the Originator ID + (Tenant ID)
   + (Subnet ID) + (Tenant Address) in bytes.

   Nonce Length (8 bits) is the length of the Nonce Data in bytes

   I (1 bit) is the initial contact flag

   Flags (7 bits) are reserved and MUST be set to zero on transmit and
   ignored on receipt.

   The Rekey Counter is a 64 bit rekey counter

   The Originator ID + (Tenant ID) + (Subnet ID) + (Tenant Address) is
   the tunnel identifier and uniquely identifies the tunnel. Depending
   on the granularity of the tunnel, the fields in () may not be used -
   i.e., for a tunnel at the PE level of granularity, only Originator ID
   is required.

   The Nonce Data is the nonce. Its
   length is a multiple of 32 bits.  Nonce lengths should be chosen to
   meet minimum requirements described in IKEv2 [RFC7296].

</t>

       </section>

      <section title="The Key Exchange Sub-TLV">

     <t> The KE Sub-TLV is described in 3.2.1 and 3.2.2.1.  A KE is always
   required.  One or more KE Sub-TLVs may be included in the IPSec
   Tunnel TLV. </t>

      <t>  
     <figure align="center" anchor="keyexchangeTLV">
       <artwork align="left"><![CDATA[
     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Diffie-Hellman Group Num    |          Reserved             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    ~                       Key Exchange Data                       ~
    |                                                               |
    +---------------------------------------------------------------+]]></artwork>
     </figure>
     </t>


   <t> Diffie-Hellman Group Num 916 bits) identifies the Diffie-Hellman
   group in the Key Exchange Data was computed.  Diffie-Hellman group
   numbers are discussed in IKEv2 [RFC7296] Appendix B and [RFC5114]. </t>

   <t> The Key Exchange payload is constructed by copying one's Diffie-
   Hellman public value into the "Key Exchange Data" portion of the
   payload. The length of the Diffie-Hellman public value is described
   for MOPD groups in [RFC7296] and for ECP groups in [RFC4753]. </t>

       </section> 



      <section title="ESP SA Proposals Sub-TLV">

     <t> The SA Sub-TLV is described in 3.2.2.2.  Zero or more SA Sub-TLVs may
   be included in the IPSec Tunnel TLV. </t>

      <t>  
     <figure align="center" anchor="espsaTLV">
       <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   ||Num Transforms|               Reserved                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                           Transforms                          ~
   |                                                               |
   +---------------------------------------------------------------+]]></artwork>
     </figure>

     </t>


   <t>    Num Transforms is the number of transforms included.

   Reserved is not used and MUST be set to zero on transmit and MUST be
   ignored on receipt. </t>


      <section title="Transform Substructure">


      <t>  
     <figure align="center" anchor="transformsubLV">
       <artwork align="left"><![CDATA[
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Transform Attr Length       |Transform Type |    Reserved.  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |          Transform ID         |            Reserved           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   ~                     Transform Attributes                      ~
   |                                                               |
   +---------------------------------------------------------------+]]></artwork>
     </figure>

     </t>


   <t>      The Transform Attr Length is the length of the Transform Attributes
   field.

   The Transform Type is from Section 3.3.2 of [RFC7296] and
   [IKEV2IANA].  Only the values ENCR, INTEG, and ESN are allowed.

   The Transform ID specifies the transform identification value from
   [IKEV2IANA].

   Reserved is unused and MUST be zero on transmit and MUST be ignored
   on receipt.

   The Transform Attributes are taken directly from 3.3.5 of [RFC7296]. </t>





      </section> 


      </section> 


</section>








   <section anchor="applicability" title="Applicability">

    <t> 	   Although P2MP BGP signaling for establishment and maintenance of SAs
   among PE devices is described in this document in context of EVPN,
   there is no reason why it cannot be extended to other VPN
   technologies such as IP-VPN <xref target="RFC4364">RFC 4364</xref>, 
   VPLS <xref target="RFC4761">RFC 4761</xref> and 
   <xref target="RFC4762">RFC 4762</xref>, and MVPN
   <xref target="RFC6513">RFC 6513</xref> and
   <xref target="RFC6514">RFC 6514</xref>
    with ingress replication. The reason
   EVPN has been chosen is because of its pervasiveness in DC, SP, and
   Enterprise applications and because of its ability to support SA
   establishment at different granularity levels such as: per PE, Per
   tenant, per subnet, per Ethernet Segment, per IP address, and per
   MAC. For other VPN technology types, a much smaller granularity
   levels can be supported. For example for VPLS, only the granularity
   of per PE and per subnet can be supported. For per-PE granularity
   level, the mechanism is the same among all the VPN technologies as
   IPsec tunnel type (and its associated TLV and sub-TLVs) are sent
   along with the PE's loopback IPv4 (or IPv6) address. For VPLS, if
   per-subnet (per bridge domain) granularity level needs to be
   supported, then the IPsec tunnel type and TLV are sent along with
   VPLS AD route. </t>

   <t> The following table lists what level of granularity can be supported
   by a given VPN technology and with what BGP route. </t>


      <t>  
     <figure align="center" anchor="comparison">
       <artwork align="center"><![CDATA[
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  | Functionality |     EVPN    |   IP-VPN    |    MVPN   |   VPLS  |
  +---------------+-------------+-------------+-----------+---------+
  | per PE        |IPv4/v6 route|IPv4/v6 route|IPv4/v6 rte|IPv4/v6  |
  +---------------+-------------+-------------+-----------+---------+
  | per tenant    |IMET (or new)|lpbk (or new)|  I-PMSI   | N/A     |
  +---------------+-------------+-------------+-----------+---------+
  | per subnet    |   IMET      |     N/A     |    N/A    | VPLS AD |
  +---------------+-------------+-------------+-----------+---------+
  | per IP        |EVPN RT2/RT5 |  VPN IP rt  | *,G or S,G|  N/A    |
  +---------------+-------------+-------------+-----------+---------+
  | per MAC       |  EVPN RT2   |     N/A     |    N/A    |  N/A    |
  +---------------+-------------+-------------+-----------+---------+]]></artwork>
     </figure>

     </t>

   </section>




   <section anchor="Acknowledgements" title="Acknowledgements">
     <t>TBD.</t>
   </section>

   <!-- Possibly a 'Contributors' section ... -->

   <section anchor="IANA" title="IANA Considerations">
     <t>   A new transitive extended community Type of 0x06 and Sub-Type of TBD
   for EVPN Attachment Circuit Extended Community needs to be allocated
   by IANA. </t>

   </section>

   <section anchor="Security" title="Security Considerations">


   <t> This document proposes that a device re-use an ephemeral Diffie-
   Hellman exponential with multiple peers.  There are some known
   potential vulnerabilities to this approach, which can be mitigated by
   the device first validating a peer's public value to be a safe public
   value before combining its own private value with it.  The tests
   which MUST be performed are described in [RFC6989].  See [REUSE] for
   additional security considerations when reusing ephemeral Diffie-
   Hellman keys. </t> 

   <t> A controller acts as a "trusted third party", which asserts that a
   particular Diffie-Hellman public value is associated with a
   particular entity.  A device receiving the public key is not required
   to validate the assertion. </t> 

   <t> A subverted controller can act as a "man-in-the-middle" between a
   pair of devices.  The easiest attack would be for the attacker to
   adjust the routing for the desired traffic through a compromised
   gateway and directly observe the cleartext.  It is also possible that
   a subverted controller could provide a device with a Diffie-Hellman
   public value that actually belongs to a compromised gateway rather
   than the intended gateway, but doing so does not seem to be
   necessary.  Nonetheless, the attack of a subverted controller can be
   mitigated by having a device sign its Diffie-Hellman public value
   (e.g, as a CMS Signed data object), where the receiver validates the
   digital signature on the object.  However, this adds significant
   processing cost to a rekey and does not fit the controller-based
   network architecture model. </t> 

   <t> A subverted IPsec device whose DH pair has been compromised would be
   vulnerable to all of its IPsec traffic using that DH pair being
   compromised.  Assuming the use of strong DH algorithms (including
   quantum resistant algorithms as they become available), the
   compromise would most likely be due to the device itself being
   compromised.  Such a compromised device is also vulnerable to a
   direct plaintext compromise. </t> 

   <t> PFS is achieved between rekey periods, as DH pairs are required to be
   generated independently.  However, because a device uses the same
   long-term key to generate session key with multiple peers, there is
   no PFS between sessions within the same rekey period.  To reduce key
   exposure outside of a rekey period, when a connection is closed each
   endpoint MUST forget not only the keys used by the connection but
   also any information that could be used to recompute those keys.
   However, the DH private key value and the nonce distributed with it
   may be forgotten only once the last IPsec SA that uses the private
   key value is removed from the SAD and there is no chance that a new
   IPsec SA could be setup that requires the private key value. </t> 

   <t> If quantum resistance is considered to be an issue, the controller
   can distribute a PSK, which could be used to create the SK_d in the
   manner shown in [I-D.ietf-ipsecme-qr-ikev2]. </t> 


   </section>
 </middle>

 <!--  *****BACK MATTER ***** -->

 <back>
   <!-- References split into informative and normative -->

   <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
    2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
       (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included files in the same
    directory as the including file. You can also define the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

   <references title="Normative References">
     <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     &RFC2119;
     &RFC3948;
     &RFC4301;
     &RFC7432;
     &RFC8174;
     &RFC8365;

<!-- 

   [IKEV2-IANA] IANA, "Internet Key Exchange Version 2 (IKEv2)
              Parameters", February 2016,
              www.iana.org/assignments/ikev2-parameters/ikev2-
              parameters.xhtml.

   [TUNNEL-ENCAP] Rosen et al., "The BGP Tunnel Encapsulation
              Attribute", draft-ietf-idr-tunnel-encaps-03, November
              2016.


   [IKEV2IANA] IANA, "Internet Key Exchange Version 2 (IKEv2)
              Parameters", <http://www.iana.org/assignments/ikev2-
              parameters/>.

       <reference anchor="DCI-OVERLAY"
                target="https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-07">
       <front>
         <title>A Network Virtualization Overlay Solution using EVPN</title>

         <author>
           <organization>A. Sajassi et. al.</organization>
         </author>

         <date year="2018" />
       </front>
     </reference>

       <reference anchor="EVPN-IPVPN-INTERWORKING"
                target="https://tools.ietf.org/html/draft-rabadan-sajassi-bess-evpn-ipvpn-interworking-00">
       <front>
         <title>EVPN Interworking with IPVPN</title>

         <author>
           <organization>A. Sajassi et. al.</organization>
         </author>

         <date year="2018" />
       </front>
     </reference>
-->


       <reference anchor="GENEVE"
                target="https://tools.ietf.org/html/draft-ietf-nvo3-geneve-06">
       <front>
         <title>Geneve: Generic Network Virtualization Encapsulation</title>

         <author>
           <organization>Gross, J., et al.</organization>
         </author>

         <date year="2018" />
       </front>
     </reference>

   </references>

   <references title="Informative References">
     <!-- Here we use entities that we defined at the beginning. -->

     &RFC4364;
     &RFC4761;
     &RFC4762;
     &RFC6513;
     &RFC6514;
     &RFC7348;

<!-- 

   [802.1Q] "IEEE Standard for Local and metropolitan area networks -
   Media Access Control (MAC) Bridges and Virtual Bridged Local Area
   Networks", IEEE Std 802.1Q(tm), 2014 Edition, November 2014.

-->


     <!-- A reference written by by an organization not a person. -->

     </references>

   <section anchor="app-additional" title="Additional Stuff">
     <t>TBD.</t>
   </section>

   <!-- Change Log

v00 2006-03-15  EBD   Initial version

v01 2006-04-03  EBD   Moved PI location back to position 1 -
                     v3.1 of XMLmind is better with them at this location.
v02 2007-03-07  AH    removed extraneous nested_list attribute,
                     other minor corrections
v03 2007-03-09  EBD   Added comments on null IANA sections and fixed heading capitalization.
                     Modified comments around figure to reflect non-implementation of
                     figure indent control.  Put in reference using anchor="DOMINATION".
                     Fixed up the date specification comments to reflect current truth.
v04 2007-03-09 AH     Major changes: shortened discussion of PIs,
                     added discussion of rfc include.
v05 2007-03-10 EBD    Added preamble to C program example to tell about ABNF and alternative 
                     images. Removed meta-characters from comments (causes problems).

v06 2010-04-01 TT     Changed ipr attribute values to latest ones. Changed date to
                     year only, to be consistent with the comments. Updated the 
                     IANA guidelines reference from the I-D to the finished RFC.  -->
 </back>
</rfc>
