<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?Pub Inc?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-idr-sdwan-edge-discovery-23"
     ipr="trust200902">
  <front>
    <title abbrev="SDWAN Edge Discovery">BGP UPDATE for SD-WAN Edge Discovery</title>

    <author fullname="Linda Dunbar" initials="L. " surname="Dunbar">
      <organization>Futurewei</organization>

      <address>
		<postal>
          <city>Dallas, TX</city>
          <country>USA</country>
		</postal>
        <email>ldunbar@futurewei.com</email>
      </address>
    </author>
	
    <author fullname="Susan Hares" initials="S. " surname="Hares">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street></street>
          <city> </city>
          <country>USA</country>
        </postal>
        <email>shares@ndzh.com</email>
      </address>
    </author>
    
	<author fullname="Kausik Majumdar" initials="K." surname="Majumdar">
      <organization>Oracle</organization>

      <address>
        <postal>
          <street/>

          <city>California</city>

          <country>USA</country>
        </postal>

        <email>kmajumdar@microsoft.com</email>
      </address>
    </author>



    <author fullname="Robert Raszuk" initials="R. " surname="Raszuk">
      <organization>Arrcus</organization>

      <address>
        <postal>
          <street></street>

          <code></code>

          <country>USA</country>
        </postal>

        <email>robert@raszuk.net</email>
      </address>
    </author>

    <author fullname="Venkit Kasiviswanathan" initials="V" surname="Kasiviswanathan">
      <organization>Arista</organization>

      <address>
        <postal>
          <street/>

          <city></city>

          <country>USA</country>
        </postal>

        <email>venkit@arista.com</email>
      </address>
    </author>


    <date year="2025"/>

    <abstract>
     <t>The document describes the BGP mechanisms for SD-WAN (Software Defined Wide Area Network)
	 edge node attribute discovery. These mechanisms include a new 
	 tunnel type and sub-TLVs for the BGP Tunnel-Encapsulation Attribute [RFC9012] and 
	 set of NLRI (network layer reachability information) for Software-Defined Wide-Area
     Network (SD-WAN) underlay information. 
	 </t> 
	<t>In the context of this document, BGP Route Reflector (RR) is 
	the component of the SD-WAN Controller that receives the BGP UPDATE from SD-WAN edges 
	and in turn propagates the information to the intended peers 
	that are authorized to communicate via the SD-WAN overlay network.</t>

    </abstract>

    <note 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"></xref> <xref target="RFC8174"></xref>
      when, and only when, they appear in all
      capitals, as shown here.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>BGP [RFC4271] can be used as a control plane for a SD-WAN to support Secure VPNs or simply to support
	  a set of Secure links in a network. This section provides an overview of (1) L3VPN services supported by SD-WAN overlays and (2) SD-WAN Secure Links as an alternative tunneling mechanism for simpler deployments. Section 2 describes the BGP framework in terms 
	  of NLRIs supported, example topologies, and objectives for the BGP mechanisms. 
	  Section 3 describes the BGP mechanisms, and section 4 describes error handling  
      for this mechanism. 	  
      </t>
	  <t> The BGP mechanisms supporting SD-WAN require that the Route Reflector (RR) establish a secure transport connection with each SD-WAN edge operating under the same BGP control plane instance. 
	  The establishment of a Secure Transport Connection between each BGP Peer and the RR is
	  outside the scope of this specification.
	  </t>
	  <t>This document describes the BGP mechanisms for SD-WAN edge nodes to established 
      a BGP peering with other SD-WAN edge nodes, and pass information in order to establish 
	  and update SD-WAN overlay tunnels, as described in [Net2Cloud]. These mechanisms include a new 
	 tunnel type and sub-TLVs for the BGP Tunnel-Encapsulation Attribute [RFC9012] and 
	 a set of NLRIs for SD-WAN underlay information. 
	  </t>
	  <section title="Secure L3VPN Services over SD-WAN">
	  <t> A SD-WAN network defined in [MEF70.1] and [MEF70.2], refers to a policy-driven network  
	  over multiple heterogeneous underlay networks to get better WAN bandwidth  
	  management, visibility, and control. In many deployments, L3VPN services are offered over SD-WAN overlays to provide site-to-site connectivity with traffic segmentation, security, and performance guarantees. These L3VPN services leverage SD-WAN Secure Links, i.e. encrypted data plane tunnels established between SD-WAN edge nodes using mechanisms such as IPsec, to carry user traffic between endpoints.</t>

	   <t>This document describes the BGP mechanisms used to support such L3VPN deployments by enabling SD-WAN edge nodes to advertise underlay attributes, tunnel characteristics, and security association metadata. These mechanisms enable dynamic tunnel selection, service-level steering, and secure endpoint discovery.</t>
	   
	   <t>The SD-WAN usage model, including its deployment scenarios and BGP requirements, is detailed in <xref target="SD-WAN-BGP-USAGE"></xref> and not repeated here. This document focuses solely on the signaling extensions and encapsulation mechanisms required to support those scenarios in BGP. 
      </t>
	  </section> 
	  <section title="SD-WAN Secure Links">  
      <t><xref target="RFC9012"></xref> defines a BGP mechanisms 
	  that links routes (prefix and Next Hop) to a specific tunnels using a specific encapsulation. 
	  The SD-WAN Secure Links Topology uses a single Hybrid logical link on 
      a SD-WAN Peer to represent multiple underlay topology links. The SD-WAN
      peer distributes IPsec security association (IPsec-SA) [RFC4301] related information 
	  regarding the hybrid link or individual underlay links. 
	  </t>
	  <t>The traffic is routed via normal IPv4/IPv6 forwarding without 
	  any VPN addition. The SD-WAN Secure Links provides some link security for some simple
      cases of the three scenarios from [SD-WAN-BGP-USAGE] that do not require L3VPN addresses
      (RD, prefix). 	  
	  </t>
	  </section> 
   <section title="Conventions used in this document">
     <t>The following acronyms and terms are used in this document: </t>
	 <t>
	 <list style="hanging">
	       <t hangText="Authorized BGP peer:">A BGP peer that a given BGP speaker is permitted to exchange SD-WAN-related information with, based on local configuration or policy. This term is used in the context of SD-WAN edge discovery to indicate that not all discovered peers are automatically eligible for overlay connectivity.</t>
          <t hangText="Cloud DC:"> Off-premises data centers that host applications and workloads, typically across multiple tenants or organizations, as defined in [Net2Cloud].</t>
 
		  <t hangText="Controller:">Refers to the SD-WAN Controller as defined in [SD-WAN-BGP-USAGE]. It is responsible for managing SD-WAN control-plane operations, including overlay path setup, teardown, policy enforcement, and route advertisement via BGP.</t>
		 <t hangText="C-PE:">Customer Premises Equipment that participates in the SD-WAN overlay network. As defined in [SD-WAN-BGP-USAGE], the term is used in this document to emphasize the role of a Provider Edge (PE) device functioning as the SD-WAN edge node, responsible for forming secure overlays across diverse underlay networks within the provider's infrastructure. </t>
		  <t hangText="CPE-Based VPN:">Virtual Private Secure network formed among C-PEs. This is to differentiate such VPNs from most commonly used PE-based VPNs discussed in [RFC4364].</t>

		  <t hangText="IPsec-SA:">IPsec Security Association [RFC4301].</t> 		  
		  <t hangText="MP_REACH_NLRI:">A BGP Path Attribute used to advertise reachability information for multiple address families, as defined in <xref target="RFC4760"></xref>. This document uses MP_REACH_NLRI for carrying SD-WAN-specific NLRIs.</t>
		 
		  <t hangText="SD-WAN:"> Software-Defined Wide Area Network, as defined in [MEF 70.1] and [MEF 70.2], refers to a policy-driven overlay connectivity service that operates over one or more underlay networks.</t>

		   <t hangText="SD-WAN Hybrid tunnel:">A single logical tunnel that combines several links of different 
		   encapsulation into a single tunnel. This logical tunnel MAY exist as part of a SD-WAN Secure L3VPN or 
		   simply be a SD-WAN secure link for a flat network. </t>
	       
		  <t hangText = "Secure Transport Connection:"> A transport layer security mechanism (e.g., IPsec, TLS, or SSL) layered under the BGP session to provide confidentiality, integrity, and authenticity of routing updates over untrusted networks.</t>
 		  <t hangText="TEA:"> Abbreviation for Tunnel Encapsulation Path Attribute [RFC9012].Used in this document for brevity.</t>

	</list> 
	</t>
	<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC8174] when, and only when, they appear in all capitals, as shown here.
	</t>
   </section>
   </section> 
	<section title="Framework of BGP SD-WAN Edge Discovery">
	<t> This section provides a framework to describe the overall solution 
	parts based on the reference diagram shown in Figure 1.
	The framework covers the following: client routes supported, example 
	topologies, objectives of the SD-WAN Edge discovery, comparison of 
	SD-WAN Secure VPNs with Pure IPsec VPNS, and what SD-WAN segmentation means in
	this SD-WAN context. 
   </t>	
    <section title="Supported Client Routes ">
	 <t> Tunnel Encapsulation Attribute [RFC9012] MAY be attached to the prefixes carried in BGP UPDATEs for IPv4 and IPv6 unicast routes (AFI/SAFI 1/1 and 2/1), as well as for IPv4 and IPv6 L3VPNs (AFI/SAFI 1/128 and 2/128), as specified in [RFC4364] and [RFC4659]. In the context of this specification, these NLRIs are used to signal SD-WAN tunnel information and endpoint properties associated with specific prefixes. 
	</t>
	<t>As described in Section 1.1, this document builds on the SD-WAN Secure VPN model defined in [SD-WAN-BGP-USAGE], [MEF-70.1], and [MEF70.2] to support L3VPN services. In this context, SD-WAN Secure L3VPNs leverage IPv4 and IPv6 L3VPNs ([RFC4364], [RFC4659]) extended with SD-WAN-specific mechanisms, including SD-WAN Hybrid Tunnel support and signaling of IPsec Security Association (IPsec-SA) metadata for underlay tunnel establishment. 
    </t>
	<t>As described in Section 1.2, the SD-WAN Secure Links model uses SD-WAN tunnels to create secure hybrid overlay connections between SD-WAN edge nodes. Unlike SD-WAN Secure L3VPNs, this application does not identify VPNs via the L3VPN NLRI. Instead, SD-WAN edge nodes use BGP to advertise unicast IPv4 and IPv6 prefixes (AFI/SAFI 1/1 and 2/1) along with the Tunnel Encapsulation Attribute (TEA) [RFC9012] containing an SD-WAN Hybrid Tunnel TLV (see Section 3.1.1). The SD-WAN Secure Links model also includes IPsec-SA metadata for underlay tunnels carried in BGP.
    </t> 
    <t>This document specifies the BGP mechanism for SD-WAN Secure L3VPN
     and SD-WAN Secure Links.
   </t>	 
    </section> 
	<section title="Topologies of SD-WAN Edge Discovery">
	<t>This section describes how the topologies for SD-WAN Secure L3VPN
	and SD-WAN Secure Links can be served by the BGP SD-WAN logical 
	Tunnel links. </t>
	<section title="SD-WAN Secure L3VPN Example Topology">
	<t>This section summarizes how a BGP-based control plane, using the BGP Tunnel Encapsulation Attribute [RFC9012], can support three deployment scenarios described in [SD-WAN-BGP-USAGE]. These scenarios focus on different ways encrypted tunnels are used in SD-WAN service delivery. While Section 1.1 lists five BGP-specific control-plane requirements, the following list highlights service-level SD-WAN deployment models that BGP can support through tunnel advertisement and associated metadata.</t> 	
      <list style="symbols">
	  <t>Homogeneous Encrypted SD-WAN, </t>
	  <t>Differential Encrypted SD-WAN, and </t>
	  <t>Private VPN PE based SD-WAN. </t>
	  </list> 
	
	 <t>Based on <xref target="SD-WAN-BGP-USAGE"></xref>, it is easy 
    to see how Figure 1 matches scenario 1 (Homogeneneous Encrypted SD-WAN)
    and scenario 2 (Differential Encrypted SD-WAN). Recasting Figure 1
    as a logical BGP peering topology results in a BGP topology   
    between PEs and CN (CE at customer site) results in Figure 2. 
    Scenario 3 (Private VPNs based on SD-WAN) from 
    <xref target="SD-WAN-BGP-USAGE"></xref> aligns with the Figure 2. 
    </t>    
  <t>
   Hybrid SD-WAN tunnel infrastructure requires that the 
   PEs (C-PE1, C-PE2, C-PE3, and C-PE4) have an existing topology 
   that the Hybrid SD-WAN tunnel overlays. These PEs use local policy 
   to sending the appropriate traffic across the appropriate network 
   based on local policy.    
  </t>
   <t>
    <list style="hanging">
	<t hangText="Hybrid SD-WAN Secure L3VPN:">Sample Topology
	<figure
       anchor="Hybrid SD-WAN L3VPN"
       title="Hybrid SD-WAN Secure L3VPN">
       <artwork><![CDATA[ 
	 
     BGP over Secure Transport  +---+  BGP over Secure Transport
                   +------------|RR |---------+
                  / BGP Peer    +-+-+ BGP Peer \
                 /                              \
                /                                \
        +---------+                              +-------+   
 +---+  | C-PE1   |--P1--( MPLS L3VPN Net1 )--P1-| C-PE2 | +---+
 |CN3|--|         |--P2--( MPLS L2VPN Net2 )--P2-|       |-|CN3|
 +---+  |         |                              |       |
 +---+  |         |                              |       | +---+
 |CN2|--| Addr    |--P3 --( WAN L3 Net3)------P3-|       |-|CN1|
 +---+  |         |--P4---(L2 direct path)----P4-|       | +---+
    |   +---------+                              +-------+    |
    \                                                         /
     \  +---------+                              +-------+  /
      +-|         |                              |       |-+
 +---+  | C-PE3   |--P1---( MPLS L3VPN Net1 )--P1| C-PE4 | +---+
 |CN2|--|         |--P2---( MPLS L2VPN Net2 )--P2|       |-|CN1|
 +---+  |         |                              |       | +---+
 +---+  |         |                              |       | +---+
 |CN1|--| Addr    |--P3 --( WAN L3 Net3)------P3-|       |-|CN2|
 +---+  |         |--P4---(L2 direct path)----P4-|       | +---+
        +---------+                              +-------+    
               \                                 /
                \                               /
                 \ BGP Peer    +-+-+ BGP Peer  /
                  +------------|RR |----------+	
     BGP over Secure Transport +---+  BGP over Secure Transport
	 
	 Please note that RR MAY be one RR, but for clarity of diagram
	 the RR has been displayed as two parts. 
	 
     
]]></artwork>
	</figure>  
	</t>
	<t hangText="Hybrid SD-WAN BGP Mesh :">Logical BGP Topology for SD-WAN 
	<figure anchor="Hybrid SD-WAN BGP Mesh" 
	        title="Hybrid SD-WAN BGP Mesh">
       <artwork><![CDATA[ 		
     
                 Logical topology for BGP peers 

                             +----+
                   +---------| RR |---------+
                  /          +--+-+          \
                 /                            \
          +------+                         +------+
   +---+  |      |------SDWAN hybrid-------|      |  +---+
   |CN3|--|CE-PE1|                         |CE-PE2|--|CN3|
   +---+  |      |           /-------------|      |  +---+  
   +---+  |      |---\      /              |      |  +---+
   |CN2|--|      |    \	   SDWAN Hybrid    |      |--|CN1| 
   +---+  |      |     \ /                 |      |  +---+
          +------+     /\                  +------+  
                      /  \
          +------+   /    \                +------+
   +---+  |      |--/    SDWAN Hybrid      |      |  +---+
   |CN2|--|CE-PE |          \------------- |CE-PE4|--|CN1|
   +---+  |      |                         |      |  +---+  
   +---+  |      |                         |      |  +---+
   |CN1|--|      |                         |      |--|CN2| 
   +---+  |      |------SDWAN hybrid-------|      |  +---+
          +------+                         +------+  
               \                                /
                \                              /
                 \ BGP Peer  +-+--+ BGP Peer  /
                  +----------| RR |----------+	
                             +----+
	
     Please note that RR MAY be one RR, but for clarity of diagram
	 the RR has been displayed as two parts. 
	 The BGP connections to the RR are over Secure Transport Connection. 
						
]]></artwork>
	</figure> 
	</t>
	</list>
	</t>
	<t>Note that the Figure 1 SD-WAN node BGP peers (C-PE) are connected in the underlay
	by both trusted VPNs and untrusted public networks. For trusted VPNs, IPsec Security
	associations MAY not be set-up.	In some circumstances, 
	some SD-WAN node peers MAY be connected only by untrusted public networks. 
	For the traffic over untrusted networks, IPsec Security Associations (IPsec SA) 
	must be established and maintained. If an edge node has network ports behind a NAT, 
	the NAT properties need to be discovered by the authorized SD-WAN peers.
	</t>
	</section> 
	<section title="SD-WAN Secure Links Example Topology">
	<t>Suppose the SD-WAN network topology from Figure 1 removes 
	the L3VPN links. Instead the links are simply a combination 
	of L3 WAN Networks (unsecured) and physically secure 
	direct L2 and L3 links. The topology in Figure 1 becomes 
	the underlay physical topology in Figure 3. 
	The unsecured links need IPSec encryptions so the 
	IPsec links must be configured. An SD-WAN Hybrid 
	tunnel allows connections between the C-PEs 
	(C-PE1, C-PE2, C-PE3, and C-PE) to be a single logical link.
    </t>
    <t>Therefore, the logical topology in Figure 3, 
    reduces to the SD-WAN logical topology shown in Figure 2. 	
    <list style="hanging">
	<t hangText="Hybrid SD-WAN Secure Links:">Sample Topology
	<figure
       anchor="Hybrid SD-WAN Links"
       title="Hybrid SD-WAN Secure Links">
       <artwork><![CDATA[ 
	 
     BGP over Secure Transport  +---+  BGP over Secure Transport
                   +------------|RR |---------+
                  / BGP Peer    +-+-+ BGP Peer \
                 /                              \
                /                                \
        +---------+                              +-------+   
 +---+  | C-PE1   |--P1--( WAN L3 Net1)-------P1-| C-PE2 | +---+
 |CN3|--|         |--P2--( L3 Direct Path)----P2-|       |-|CN3|
 +---+  |         |                              |       |
 +---+  |         |                              |       | +---+
 |CN2|--| Addr    |--P3 --( WAN L3 Net3)------P3-|       |-|CN1|
 +---+  |         |--P4---(L2 direct Path)----P4-|       | +---+
    |   +---------+                              +-------+    |
    \                                                         /
     \  +---------+                              +-------+  /
      +-|         |                              |       |-+
 +---+  | C-PE3   |--P1--( WAN L3 Net1 )------P1-| C-PE4 | +---+
 |CN2|--|         |--P2--( L3 Direct Path )---P2-|       |-|CN1|
 +---+  |         |                              |       | +---+
 +---+  |         |                              |       | +---+
 |CN1|--| Addr    |--P3 --( WAN L3 Net3)------P3-|       |-|CN2|
 +---+  |         |--P4---(L2 direct Path)----P4-|       | +---+
        +---------+                              +-------+    
               \                                 /
                \                               /
                 \ BGP Peer    +-+-+ BGP Peer  /
                  +------------|RR |----------+	
     BGP over Secure Transport +---+  BGP over Secure Transport
	 
	 Please note that RR MAY be one RR, but for clarity of diagram
	 the RR has been displayed as two parts. 
	   
]]></artwork>
	</figure>  
	</t>
	</list>
	</t>
	</section>
	<section title="RR connections to BGP Peers in SD-WAN">
	<t>For both the SD-WAN Secure L3VPN network and the SD-WAN Secure Links, 
	the BGP Peers are assumed to be connected to a Route Reflector via  
	Secure Transport Connection.  For an SD-WAN deployment with multiple RRs, it is assumed that 
	there are Secure Transport Connection among those RRs. 
	</t>
	<t> How Secure Transport Connections are established between the BGP Peer and the RR, 
	or between the multiple RRs is out of the scope of this document. 
	The existing BGP UPDATE propagation mechanisms control the edge properties propagation among the RRs.</t>
	<t>For some environments where the communication to RR is highly secured [RFC7018], 
	IKE-less can be deployed to simplify IPsec SA establishment among edge nodes.
	</t>
	</section> 
	</section> 
	<section title="The Objectives of SD-WAN Edge Discovery">
	<t>
	The objectives of SD-WAN edge discovery for an SD-WAN edge node are to 
	discover its authorized BGP peers and each peer's associated properties in 
	order to establish secure overlay tunnels [Net2Cloud].  The attributes to 
    be propagated for the SD-WAN Secure L3VPN case are:  
	<list style="symbols">
	<t>the SD-WAN (client) VPN information, </t>
	<t>the attached client routes per VPN, and </t>
	<t>the properties of the underlay networks over which the client routes can be carried.</t>
    </list>
    Like any VPN network, client routes within specific SD-WAN VPNs can only be exchanged between authenticated SD-WAN peer nodes. Authentication mechanisms, such as those provided by IPsec or TLS, ensure that only valid peers participate in route exchange.</t>
	<t> The attributes to be propagated for the SD-WAN Secure L3 Links are:
   	<list style="symbols">
	<t>the attached client routes and </t>
	<t>the properties of the underlay networks over which the client routes can be carried.</t>
    </list>	
	</t>
	<t>	The properities of the underlay network MAY include the following:
	IPsec-SA information, information needed for NAT transversal with IPsec, and link speeds. 
   </t> 
   	<t>Some SD-WAN peers are connected by both trusted VPNs and untrusted public networks. 
	Some SD-WAN peers are connected only by untrusted public networks. 
	For the traffic over untrusted networks, IPsec Security Associations (IPsec SA) 
	must be established and maintained. For the trusted VPNs, IPsec Security
	associations MAY not be set-up. If an edge node has network ports behind a NAT, 
	the NAT properties need to be discovered by the authorized SD-WAN peers.
	</t>
	</section>
    <section title="Examples of SD-WAN Edge Discovery"> 
	<t>Suppose the environment is Figure 1 with the logical 
	SD-WAN Hybrid link topology of Figure 2.  These 
	topologies are set-up via configuration with IPsec-SA 
	pre-configured. Suppose that C-PE1 and C-PE2 have 10 pre-shared keys
    to use on IPsec links.  Currently P3 is using IPSec-SA ID-1. 
	C-PE1 wants to receive traffic flowing from C-PE2 over the Hybrid SD-WAN links.  
	</t> 
	<t> 
	<list style="hanging">
	<t hangText="Step 1: Send Client Route with TEA to RR:">Refering to the Figure 2, 
	the C-PE1 routers send customer routes (L3VPN v4 route) to the RR with 
    <list style="symbols">
    <t>NextHop set to self (C-PE1), and </t>
	<t>attaching a Tunnel Encapsulation attribute specifying a 
	Hybrid SD-WAN tunnel to the RR over a Secure Transport Connection</t>
	</list>
	</t>
	<t hangText="Step 2: RR forwards the Client route to C-PEs:"> Based on RR policy,
	the RR forwards routes to other BGP peers that support 
	SD-WAN discovery for that AFI/SAFI (L3VPN v4).  
    Using the Figure 2 example with the L3VPN for v4, RR would 
	forward client routes with TEA of SD-WAN tunnel TLV and Next-Hop of C-PE1. </t>
	<t hangText="Step 3: Remote C-PE checks link:">	Prior to CE-P2 
	installing the L3VPN Unicast Routes (1/128), 
	the C-PE2 MUST verify at least one of the underlay connections exist
    between C-PE1 and C-PE2. Local policy will define which 
	links (or links) the traffic for this route goes over
    between C-PE1 and C-PE2.  
	</t>
	</list> 
	</t>
    <t>Suppose for some reason the L2 link between C-PE1 and C-PE2
	has encounter attacks, and the IPsec encryption must now 
	run on links P3 and P4. C-PE1 detects the problem and 
    to change the encryption on P3 and add encryption on P4.  
	C-PE1 and C-PE2 MUST agree upon the next encryption
	on the list, and will send the IPsec-SA information in-band via BGP. 
	</t>
	<t> 
	<list style="hanging">
	<t hangText="Step 1: CE-P1 Send Underlay Route with TEA to RR:">
	C-PE1 sends two SD-WAN NLRIs in an BGP Update 
	with a TEA with SD-WAN Hybrid Tunnel TLV with 
	an IPsec-SA-ID TLV with 4 IPsec SA Identifiers (4, 5, 6, 7).  
    The first SD-WAN NLRI contains Port P3's information 
	(Port-local-ID P3, SD-WAN Color Gold (1), and SD-WAN Node-ID CE-PE1).
	The second SD-WAN NLRI contains Port P4's information 
	(Port-local-id P4, SD-WAN Color Gold (1), and SD-WAN Node-ID CE-PE1). 
	</t>
	<t hangText="Step 2: RR forwards Underlay route to C-PEs:"> The RR 
	forwards the 2 underlay routes to C-PEs (C-PE1, C-PE2, C-PE3, C-PE4). 
	</t>
	<t hangText="Step 3: C-PE2 receives the route and processes IPsec-SA">
	After receiving C-PE1 update, C-PE2 process the update, and 
	switches the IPsec-SA on Port 3 to IPsec-SA 4, and the IPsec-SA on 
	P4 to IPsec-SA 4. 
    </t> 
	</list>
	</t>
    <t>This simple examples shows the value of rotating the pre-shared keys. 
	Future IPsec SA can also be set-up, negotiated,	or rekeyed in the same manner. 
	</t> 
	<t>The following question MAY occur to the observant reader:
	<list style="symbols">
	<t>Why is IPsec related information passed on a different AFI/SAFI? </t> 
	<t>Why do you do to support IPsec combined with NATs? </t>
	<t>Is this the best way to support NATs? </t>
	</list>
	</t>
	<t>The BGP SD-WAN Nodes can attach the TEA with a Hybrid SD-WAN TLV
    attached to the client routes (AFI/SAFI 1/1, 2/1, 1/128, 2/128) or 
    attached to the SD-WAN NLRI (AFI/SAFI 1/74 or 2/74).  The SD-WAN NLRI
	allows the passing of IPsec information on a unique AFI/SAFI.  How
	implementation prioritize the processing of client routes versus 
	underlay routes (SD-WAN NLRI) is an implementation matter, and out 
	of scope for this document. 
	</t>
	<t>For NATs, the Extended Port Sub-TLV (see section 3.4) represents the 
	information the first deployment thought it needed to identify the 
	NAT port for a IPsec Security Association. The deployments of 
    this SD-WAN technology found the amount of data gave enough 
	information, but suggested future work might be able to 
	send less information. However, those revisions are outside the scope of this document. 
	</t> 
	</section> 
	<section title="Comparing SD-WAN Secure L3VPN with Pure IPsec VPN">
    <t>This section describes why this document chose to pass IPSec-SA information 
	via a new BGP AFI/SAFI with a TEA [RFC9012] instead of using traditional IPsec mechanisms. </t>
	<t> A pure IPsec VPN has IPsec tunnels connecting all edge nodes over public networks. 
	Therefore, it requires stringent authentication and authorization (i.e., IKE Phase 1 [RFC7296]) 
	before other properties of IPsec SA can be exchanged. The IPsec Security Association (SA) 
	between two untrusted nodes typically requires the following configurations and message exchanges:
	</t>
	<t>
	<list>
	<t>
	<list style="hanging">
	<t hangText="IPsec IKEV2:"> Messages are sent to authenticate with each other. </t> 
	<t hangText="Establish IPsec SA:"> Establishing the IPsec SA requires the following set-up  
		<list style="symbol">
		<t>Local key configuration, </t>
		<t>Setting the Remote Peer address,  </t>
		<t>Information from IKEv2 Proposal directly sent to peer (encryption method, integrity sha512, etc.), and</t>
		<t>Transform set. </t>
		</list>	
	 </t>
	<t hangText="Attached client prefixes discovery achieved by:"> 
		<list style="symbol">
		<t>Running routing protocol within each IPsec SA. </t>
		<t>If multiple IPsec SAs between two peer nodes are established to achieve load sharing, 
		each IPsec tunnel needs to run its own routing protocol to exchange client routes attached to the edges.</t>
		</list>	
		</t>
	<t hangText="Set-up Access List or Traffic Selector:"> Access Lists permit specific Local-IP1, 
	Remote-IP2, and other IPsec parameters.</t>
	</list>
	</t>
	</list>
	</t>
	<t>In a BGP-controlled SD-WAN network over hybrid MPLS VPN and public internet underlay networks, 
	all edge nodes and RRs are already connected by private secure paths. The RRs have the policies 
	to manage the authentication of all peer nodes. More importantly, when an edge node needs to 
	establish multiple IPsec tunnels to many edge nodes, all the management information can 
	be multiplexed into the secure management tunnel between RR and the edge node operating as a BGP peer.   
	Therefore, the amount of authentication in a BGP-Controlled SD-WAN network can be significantly reduced.
	</t> 
	<t>Client VPNs are configured via VRFs, just like the configuration of the existing MPLS VPN. 
	The IPsec equivalent traffic selectors for local and remote routes are achieved by 
	importing/exporting VPN Route Targets. The binding of client routes to IPsec SA is dictated by policies. 
	As a result, the IPsec configuration for a BGP controlled SD-WAN (with mixed MPLS VPN) can be simplified
	in the following manner:</t>
	<t>
	<list style="symbol">
	<t>The SD-WAN controller has the authority to authenticate edges and peers 
	so the Remote Peer association is controlled by the SD-WAN Controller (RR).  </t>
	<t>The IKEv2 proposals (including the IPsec Transform set) 
	   can be sent directly to peers, or incorporated in a BGP UPDATE. </t>		
	<t>The BGP UPDATE announces the client route reachability through 
	   the SDWAN hybrid tunnels.  A SDWAN hybrid tunnel combines several 
	   other tunnels into a single logical tunnel.  The SD-WAN Hybrid
       tunnel implementations insure that all tunnels within are 
       either running over secure network links or secured by IPsec. 	   
    </t>
	<t>Importing/exporting Route Targets under each client VPN (VRF) achieves the traffic selection 
	(or permission) among clients' routes attached to multiple edge nodes.</t>
	</list>
	</t>
	<t> Note: The web of SDWAN hybrid tunnels in a network is denoted in this 
        document as an SD-WAN underlay.  BGP passes information about the 
        SDWAN hybrid tunnels between BGP peers by passing an 
        SD-WAN Underlay NLRI paired with the tunnel encapsulation attribute (TEA)
        with an SDWAN tunnel type SD-WAN-Hybrid TLV. 
     </t>
     <t>Also, note that with this method there is no need to run multiple routing protocols in each IPsec tunnel.
	</t>	
	</section>
    <section title="SD-WAN Segmentation, Virtual Topology and Client VPN">
	<t>In SD-WAN Secure L3VPN deployments, SD-WAN Segmentation is a frequently 
	used term which refers to partitioning a network into multiple subnetworks, 
	just like MPLS VPNs. SD-WAN Segmentation is achieved by creating 
	SD-WAN virtual topologies and SD-WAN VPNs. 
	</t>
	<t>
	An SD-WAN virtual topology consists of a set of edge nodes 
	and the tunnels (a.k.a. underlay paths) interconnecting those edge nodes. These tunnels forming the 
	underlay paths can be IPsec tunnels, or MPLS VPN tunnels, or other tunnels. 
	Figure 4 (top) illustrates an SD-WAN L3VPN underlay topology and Figure 4 (bottom)
    show the same topology as the virtual topology based on SD-WAN Links. 
	</t> 
	<t>An SD-WAN VPN is configured in the same way as the VRFs of an MPLS VPN. One SD-WAN client VPN 
	can be mapped to multiple SD-WAN virtual topologies. A Route Target is used to differentiate between the
	SD-WAN VPNs. For example, in figure 4 below, the Payment-Flow on C-PE2 is only mapped to the virtual 
	topology of C-PEs to/from Payment Gateway, whereas other flows can be mapped to a multipoint-to-multipoint
	virtual topology.</t>	
	<t> SD-WAN Controller for the SD-WAN Secure L3VPN governs the policies of mapping
	a client VPN to SD-WAN virtual topologies.</t>
	<t>Each SD-WAN edge node MAY need to support multiple VPNs. Route Target is used to differentiate the
	SD-WAN VPNs. For example, in the picture below, the Payment-Flow on C-PE2 is only mapped to the virtual 
	topology of C-PEs to/from Payment Gateway, whereas other flows can be mapped to a multipoint-to-multipoint
	virtual topology.</t>
	<t>
	<figure
       anchor="SD-WAN Virtual Topology and VPN"
       title="SD-WAN Virtual Topology and VPN">
       <artwork><![CDATA[ 

     BGP over Secure Transport  +---+  BGP over Secure Transport
                   +------------|RR |---------+
                  / BGP Peer    +-+-+ BGP Peer \
                 /                              \
                /                                \
        +---------+                              +-------+   
 +---+  | C-PE1   |--P1--( MPLS L3VPN Net1 )--P1-| C-PE2 | +---+
 |CN3|--|         |--P2--( MPLS L2VPN Net2 )--P2-|       |-|CN3|
 +---+  |         |                              |       |
 +---+  |         |                              |       | +---+
 |CN2|--| Addr    |--P3 --( WAN L3 Net3)------P3-|       |-|CN1|
 +---+  |         |--P4---(L2 direct path)----P4-|       | +---+
        +---------+                              +-------+  
            |
            | P5 (L3 Direct path) 
            |
            |
			P1
            |
          +-------+
          |Payment| 
		  |gateway|
          +-------+
		  
	Tunnel exist C-PE2 port P4 on L2 direct path 
	with encryption to P1 port on Payment gateway.  
	
	        
Virtual topology 
        +---------+                 +-------+   
 +---+  | C-PE1   |-----------------+ C-PE2 | 
 |CN3|--|         |                 |       |-|CN3|
 +---+  |         |                 |       |    			
        +---------+                 +-------+	
             \                      /
              \                    /
               \                  /
                \               /
                  \       +----+----+ 
                   +------| payment |				
                          | Gateway |
                          +---------+
]]></artwork>
	</figure>
    </t>	
   </section>
   </section>
<section title="BGP SD-WAN Mechanisms">
<t> The BGP mechanisms have two functions: 
<list style="hanging">
<t hangText="Pass Client routes with Hybrid SD-WAN tunnel:"> A BGP peer supporting SD-WAN 
re-announces the routes passed by client routers with a 
next hop self and an BGP attribute indicating the SD-WAN Hybrid Tunnel. Clients routes 
MAY be one of the following AFI/SAFIs: Unicast IPv4/IPv6(1/1, 2/1) and L3VPN IPv4/IPv6 
(1/128, 2/128). The term "next hop self" means the routers sets the next Hop Address 
to an address indicating the BGP Peer. The following two BGP Path attributes can pass the Tunnel indication:
the Encapsulation Extended Community (Encap-EC) and the Tunnel Encapsulation attribute (TEA).
</t>
<t hangText="Pass Underlay Routes (SD-WAN NLRIs) with Hybrid SD-WAN TEA:"> A BGP peer sends the 
SD-WAN NLRI v4/v6 (AFI/SAFI 1/74 or 2/74)  with Next Hop set to Next-Hop-self 
and an BGP attribute indicating the Hybrid Tunnel. The SD-WAN NLRI identifies 
the port or (ports) within the Hybrid SD-WAN Tunnel that the BGP peer 
is sending encapsulation or IPsec-SA related information via the Hybrid SD-WAN TEA.
The Hybrid SD-WAN TEA contains the IPsec-SA and optionally NAT information. </t>
</list>
</t>
<t>
This section describes the Hybrid SD-WAN tunnel, the SD-WAN NLRIs, 
the new sub-TLVs for SD-WAN Tunnel IPSec-SA, sub-TLVs for Port attributes,  
the procedures for the client routes, the procedures for underlay routes, 
error handling, and considerations for managing SD-WAN technologies. 
</t>
<section title="SD-WAN-Hybrid Tunnel Encoding">
<t> 
<list style="hanging">
<t hangText="Name:">SD-WAN Hybrid Tunnel </t>
<t hangText="Code:"> 25 (IANA assigned) </t>
<t hangText="Description:">The SD-WAN-Hybrid tunnel identifies a hybrid 
tunnel that overlays a virtual path over a set of links between two BGP Peers
comprised of various technologies (e.g. MPLS, L2 direct link, or L3 through Public 
Internet, and others).  These links between the two BGP peers are denoted 
as underlay links. The underlay links MAY or MAY not need encryption. 
If some of these underlay links need encryption, the SD-WAN Hybrid Tunnel 
provides a mechanism to pass this information via BGP.  Passage of the 
IPsec-SA information is optional.</t>
<t hangText="Encoding:">Per <xref target="RFC9012"></xref>, the following two BGP attributes that MAY 
encode a Tunnel Encapsulation attribute information: the Tunnel Encapsulation Attribute, 
and the Encapsulation Extended Community (Encap-EC) as a "barebones" tunnel identification. 
The encoding for the SD-WAN Hybrid tunnel is described for both BGP attributes. 
<list style="hanging">
<t hangText="SD-WAN Encoding in Encap-EC"> 
 <figure anchor="SD-WAN Encap-EC"
     title="SD-WAN Hybrid tunnel encoding in Encap-EC">
     <artwork><![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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | 0x03 (1 octet)| 0x0c (1 octet)|       Reserved (2 octets)     |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |     Reserved (2 octets)       |    Tunnel Type=25  (2 octets) |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Encapsulation Extended Community

		]]></artwork>
 </figure>
 The NextHop Field in the BGP update is the tunnel egress Endpoint, 
 and this SHOULD be set to the BGP Peer Address for the SD-WAN Peer. 
</t>
<t hangText="SD-WAN Encoding in TEA">
 <figure
           anchor="SD-WAN Hybrid Value Field"
           title="SD-WAN Hybrid Value Field">
           <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Tunnel-Type=25(SD-WAN-Hybrid )| Length (2 Octets)             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           Sub-TLVs                            |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

		]]></artwork>
 </figure>
</t>
</list> 
</t>
<t hangText="Valid Sub-TLVs for Encap-EC form of Hybrid SD-WAN Tunnel:"> The Encap-EC format (barebones) 
of the tunnel encapsulation attribute cannot attach any sub-TLVs. </t>
<t hangText="Valid Sub-TLVs for the TEA form of the Hybrid SD-WAN Tunnel:"> The valid sub-TLV for the TEA 
form of the Hybrid SD-WAN Tunnel TLV depends whether the TEA is attached to a client route or an underlay route. 
Table 1 provides a list of valid sub-TLVs per NLRI type (client or underlay). 
The valid sub-TLVs specified [RFC9012] are Color (3) and Tunnel Egress End Point (6).  
The valid sub-TLV specified in this  document are: Extended Port Attributes, IPsec SA-ID, IPSec SA Rekey, 
IPsec Public Key, IPsec SA Proposal sub-TLV, and 
Simplified IPsec SA SubTLV.    
</t> 
<t hangText="Validation Procedure:">The validation procedure for the SD-WAN 
tunnel TLV has the following components:
<list> 
<t> 1) validation of tunnel TLV encoding,</t>
<t>2) Check that sub-TLVs are valid for NLRI (see Table 1), and </t>
<t>3) Egress tunnel End Point Check. </t>
 </list> 
Prior to installing a route with a SD-WAN tunnel as an 
active route, the BGP peer installing the route MUST
also validate that the SD-WAN tunnel and underlay links are active. 
</t> 
</list>
</t>
<t> 
 <figure anchor="sub-TLV list"
           title="Table 1: sub-TLV list ">
           <artwork><![CDATA[  
               Table 1 
		   
Client Routes AFI/SAFI = 1/1, 2/1, 1/128, 2/128
Underlay Routes AFI/SAFI = 1/74 and 2/74 
                         
sub-TLV            Code  Client Routes  Underlay Routes      
------            ----  -------------  ---------------
Encapsulation        1   not valid     not valid  
Protocol             2   not valid     not valid  
Color                3   valid *1      not valid *2          
Load-Balancing Bk    5   not valid     not valid *2
Tunnel Egress EP     6   required      required
DS Field             7   not valid     not valid *2    
UDP Dest. Port       8   not valid     not valid *2 
Embeded Label H.     9   not valid     not valid *2 
MPLS label Stack    10   not valid     not valid *2 
Prefix-SID          11   not valid     not valid *2  
Preference          12   not valid     not valid *2 
Binding SID         13   not valid     not valid *2 
ENLP                14   not valid     not valid *2 
Priority            15   not valid     not valid *2 
SPI/SI              16   not valid     not valid *2 
SRv6 Binding SID    20   not valid     not valid *2 
IPsec-SA-ID         64   valid *3      valid *3 
Extended Port       65   not valid     valid *4
Underlay ISP        66   not valid     valid *4  
IPsec SA Nonce      67   valid *3      valid *3
IPsec Public Key    68   valid *3      valid *3 
IPsec SA Proposal   69   valid *3      valid *3 
Simplified IPSec SA 70   valid *3      valid *3 
 

           
		]]></artwork>
 </figure>
</t>
<t>Notes
<list style="symbols">
<t>*1 - For client traffic, the Color sub-TLV defined in this document must be validated using the same procedures specified in [RFC9012] for the Color Extended Community. When both the Color Extended Community and the Color sub-TLV are present, the value in the Color Extended Community [RFC9012] takes precedence and must be used for forwarding and policy decisions. 
</t>
<t>*2 - In the future, the SD-WAN TEA could specify more details on Underlay links beyond protocol.
However, those future extensions are outside the scope of this document. </t>
<t>*3 - Encodings and validation of syntax are defined in 
section 3.3. Section 3.5 provides content processing and 
validation procedures for client routes, and section 3.6 
provides content processing and validation procedures for underlay routes </t>
<t>*4 - Encoding and mechanisms are defined 3.3.6. Section 3.6 
provides error handling procedures in case of sub-TLV being MALFORMED 
or included with the wrong NLRI. 
</t>
</list>
</t>
</section> 
 <section title="SD-WAN Underlay UPDATE">
 <t>The Edge BGP Peer using BGP SD-WAN discovery sends the hybrid SD-WAN NLRI with the SD-WAN Hybrid 
 tunnel attribute to advertise the detailed properties associated with the 
 public facing WAN ports and IPsec tunnels. The Edge BGP Peer sends this information to 
 its designated RR via the Secure Transport Connection. Each BGP Update message with a 
 SD-WAN Underlay NLRI MUST contain a Tunnel Encapsulation Attribute (TEA) for a Hybrid Tunnel type.   The TEA 
 can include sub-TLVs for Extended Port attribute (see section 7) or IP Sec information (see section 8). 
 The IPsec information sub-TLVs include: IPsec-SA-ID, IPsec SA Nonce, IPsec Public Key, 
  IPsec SA Proposal, and Simplified IPsec SA.  
 </t>
<section title="The NLRI for SD-WAN Underlay Tunnel Update">
<t>A new NLRI SAFI (SD-WAN SAFI=74) is introduced within the MP_REACH_NLRI Path 
	Attribute of [RFC4760] for advertising the detailed properties of the SD-WAN tunnels 
	terminated at the edge node:</t>
<t>
 <figure  anchor="SD-WAN NLRI Encode"  
          title="SD-WAN NLRI Encoding ">
        <artwork><![CDATA[  
+------------------+
|    Route Type    | 2 octets
+------------------+  
|     Length       | 2 octets
+------------------+   
|   Type Specific  |  
~ Value (Variable) ~  
|                  |  
+------------------+
]]></artwork>
</figure>
</t>
<t>where:
	<list style="hanging">
	<t hangText="Route (NLRI) Type:"> 2 octet value to define the encoding of the rest of the SD-WAN the NLRI.
	The SD-WAN Secure Links use case MAY have many different formats, the route type was assigned two octets. 
	</t>
	<t hangText="Length:">2 octets of length expressed in bits as defined in [RFC4760].</t>
	</list>
</t>
<t></t>
<t>This document defines the following SD-WAN Route type:</t>
     <t>
	<list style="hanging">
	 <t hangText="NLRI Route-Type = 1:"> For advertising the detailed properties of the SD-WAN 
	 tunnels terminated at the edge, where the transport network port can be uniquely identified by a 
	 tuple of three values (Port-Local-ID, SD-WAN-Color, SD-WAN-Node-ID). 
	 The SD-WAN NLRI Route-Type =1 has the following encoding:
	<figure anchor="SD-WAN NLRI Route Type 1" title="SD-WAN NLRI Route Type 1">
           <artwork><![CDATA[  
     +------------------+
     |  Route Type = 1  | 2 octets
     +------------------+
     |     Length       | 2 octets
     +------------------+
     |   Port-Local-ID  | 4 octets
     +------------------+
     |   SD-WAN-Color   | 4 octets
     +------------------+
     |  SD-WAN-Node-ID  | 4 or 16 octets
     +------------------+
		]]></artwork>
	</figure>
	</t>
	<t hangText="Port-local-ID:"> SD-WAN edge node Port identifier, which is locally significant. 
		If the SD-WAN NLRI applies to multiple WAN ports, this field is zero.</t>
	<t hangText="SD-WAN-Color:"> represents a group of tunnels, which correlate 
		with the Color-Extended-community included in the client routes UPDATE. 
		When a client route can be reached by multiple SD-WAN edges co-located at one site, 
		the SD-WAN-Color can represent a group of tunnels terminated at those SD-WAN edges co-located at the site.
        If an SD-WAN-Color represents all the tunnels at a site, then the SD-WAN-Color effectively represents the site.</t>
	<t hangText="SD-WAN Node ID:"> The node's IPv4 or IPv6 address.  For IPv4 SD-WAN NLRI (1/74)
	the length is 4.  For IPv6 SD-WAN NLRI (1/76), the length is 16. </t>
	</list>
	</t>
	<t> Route Type values outside of 1 are out of scope for this document. 	 
	</t>
 </section>
 <section title="Validation of SD-WAN NLRI">
 <t> The SD-WAN Node-ID field carries the Tunnel Endpoint.  
The Tunnel Egress Endpoint in the Tunnel Encapsulation Attribute (TEA)
is not used to validate the tunnel indicated by the SD-WAN NLRI.
The Next Hop within the UPDATE message MAY be tested by local policy 
for validity as a BGP Peer source, but the validation of the tunnel 
endpoint depends solely on the SD-WAN Node-ID.
 </t>
 </section> 
 <section title="BGP Path Attributes attached to SD-WAN NLRI">
 <t>The BGP Path Attributes for the SD-WAN NLRIs which are required to be supported are:  
 
 <list style="symbols">
 <t>Origin, AS_PATH, Next_HOP, MULTI_EXIT_DISC, LOCAL_PREF (<xref target="RFC4271"></xref>),
 </t>
 <t>Originator_ID and Cluster-LIST (<xref target="RFC4456"></xref>),  </t>
 <t>Tunnel Encapsulation Attribute (<xref target="RFC9012"></xref>), </t> 
 <t> Extended Communities (<xref target="RFC4360"></xref>). </t>
</list>
Per <xref target="RFC9012"></xref>, the Encapsulation Extended Community 
and the Color Extended Community MUST be supported. 
</t>
<t>The following optional BGP attributes MAY be attached to an BGP UDPATE with 
the Hybrid SD-WAN NLRI in the MP-REACH-NLRI or MP_UNREACH_NLRI:
<list style="symbols">
<t>Community (<xref target="RFC1997"></xref>), </t>
<t>Large Community (<xref target="RFC8092"></xref>), </t>
<t>IPv6 Address Specific Extended Community (<xref target="RFC5701"></xref>), </t>
<t>AS4_Path and AS4_Aggregator (<xref target="RFC6793"></xref>) - ensures support of 4-byte ASNs where needed.  </t>
</list>
These attributes are extensions of required AS_PATH and BGP 
Community support that MAY be used to set in local policy evaluations for 
the Hybrid SD-WAN Underlay. However, the actions of local Policy
regarding these BGP attributes is outside scope of this document. 
</t>
<t>All other optional BGP attributes MAY also be attached to the NLRI, 
but the meaning of these attributes when attached to the 
NLRI is outside the scope of this document.
</t>
 </section> 
</section> 
 
 <section title="IPsec SA Property Sub-TLVs">
 <t> This section describes the sub-TLVs that pass data regarding IPsec parameters for 
 the Hybrid SD-WAN tunnel.  During set-up of the Hybrid SD-WAN tunnels, the IPsec 
 parameters need to be securely passed to set-up secure association. For hybrid SD-WAN tunnels, 
 the IPsec security association for IPsec links MAY change to different 
 security associations over time. 
</t>
<t>The sub-TLVs related to IPsec supported by the TEA TLV for the SD-WAN Hybrid Tunnel type are: 
IPSec-SA-ID, IPsec SA Nonce,  IPsec Public Key, IPsec Proposal, and Simplified IPSec SA. 
The IPSec-SA-ID sub-TLV provides a way to indicate the IPsec SA Identifiers (section 3.3.1) 
for pre-configured security association.   The other four sub-TLVs provide different ways to pass details regarding IPsec security associations.  
 The IPsec SA Nonce passes Nonce and rekey counters for a Secure Association identified by IPsec SA Identifier
 (see section 3.3.2). The IPSec Public Key sub-TLV passes IPsec Public Key data with a time duration
 (see section 3.3.3).  The IPsec Proposal sub-TLV provides Transform attributes and Transform IDs 
 (see section 3.3.4).   The Simplified IP SEC SA passes the information that identifies configuration 
 for 2 keys (see section 3.3.5).  The NAT-related portion infromation is carried in the Extended Port 
sub-TLV (see section 3.3.6) 
</t>
<t> If any sub-TLV is MALFORMED, the implementation MUST follow the procedure in <xref target="RFC9012"></xref>
 in section 13. 
</t>  
<t>For a quick rotation between security associations, the SDWAN NLRI (port-id, color, node)
can quickly distribute a switch to a set of new security association using the BGP Update message.  
 In this case, the BGP UPDATE message would like Figure 10</t> 
<t>
 	<figure
      anchor="SD-WAN-NLRI-IPsec1"
      title="SD-WAN NLRI IPsec rotation in attack">
        <artwork><![CDATA[  
    SDWAN NLRI
	   Route-type: 1
	   length: 12 
	   port-id - 0.0.0.0 
	   SD-WAN-Color - 0.0.0.1 
	   node-id - 2.2.2.2 
    TEA:
     Tunnel TLV: (type: SD-WAN Hybrid) 
	   Tunnel Egress Endpoint SubTLV: 2.2.2.2
	   IPsec-SA-ID SubTLV: 20, 30 	
]]></artwork>
</figure>
</t> 
 <section title="IPsec-SA-ID Sub-TLV">
<t>
<list style="hanging">
<t hangText="SubTLV Name:"> IPsec-SA-ID - Send IPsec SA-IDs</t>
<t hangText="SubTLV Code:"> 64 (IANA assigned) </t>
<t hangText="SubTLV Description:"> IPsec-SA-ID Sub-TLV within the Hybrid Underlay 
   Tunnel UPDATE indicates one or more pre-established IPsec SAs by using their identifiers, 
   instead of listing all the detailed attributes of the IPsec SAs. 
  Using an IPsec-SA-ID sub-TLV not only greatly reduces the size of BGP UPDATE messages, 
  but also allows the pairwise IPsec rekeying process to be performed independently.</t>
<t hangText="Sub-TLV Encoding:"> 
  <figure
    anchor="IPsec-SA-ID sub-TLV"
    title="IPsec-SA-ID sub-TLV">
     <artwork><![CDATA[  
 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 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IPSec-SA-ID Sub|   Length      |  Reserved                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|                      IPsec SA Identifier #1                   |      
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|                      IPsec SA Identifier #2                   |      
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|                                                               |
~                                                               ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
|                      IPsec SA Identifier #n                   |      
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   
		]]></artwork>
	</figure>
    where: 	
	<list style="symbols">
	<t>IPSec-SA-ID Sub-Type (8 bits): 64(IANA Assigned). </t>  
	<t>length (8 bits): Specifies the total length in octets of
            the value field (not including the Type and Length fields). 
			For the IPSec-SA-ID Sub-Type, the length SHOULD be the 2 + 4 *(number of IPsec SA IDs) .
	</t>
	<t>Reserved: Reserved for future use. In this version
	    of the document, the Reserved field MUST be set to zero and MUST be
	    ignored upon receipt.  Received values MUST be propagated without
	    change.</t>
	<t> Value field: The value field consists of a sequence of IPsec SA Identifiers, each 4 octets long. As shown in figure above, n IPsec SAs are attached in the IPsec-SA-ID sub-TLV: 
	<list style="symbols"> 
	<t>IPSec SA Identifier #1: A 4 octet identifier for a pre-established IP security association. 
	</t>
	<t>IPSec SA Identifier #2: A 4 octet identifier for a pre-established IP security association. 
	</t>
	<t>IPSec SA Identifier #n: A 4 octet identifier for a pre-established IP security association. 
	</t>
	</list>
	</t>
	</list> 
	</t> 
  <t hangText="SubTLV Error Handling:"> A IPsec-SA-ID Sub-TLV is a MALFORMED if the fields do not fit the limits 
  specified above. Per <xref target="RFC9012"></xref> a MALFORMED Sub-TLV is ignored.
  The procedures for content check for the IPsec-SA-ID Sub-TLV is specified in section 3.4 for client routes, 
  and section 3.5 for underlay routes. </t>
  <t hangText="Tunnel End Point Validation:"> The IPsec-SA-ID Sub-TLV does not 
    help validate the Tunnel Egress EndPoint. However, the IPSec-SA provides the security 
	information associated with set of routes sent from a peer which MUST be correctly 
	handled upon reception of the data. </t>
 </list> 
</t>   
  </section>
 <section title="IPsec SA Rekey Counter Sub-TLV"> 
 <t>
 <list style="hanging">
<t hangText="Sub-TLV Name:"> IPsec SA ReKey Counter - Rekey Counter for a IPsec SA</t>
<t hangText="Sub-TLV Code:"> 67 (IANA assigned) </t>
<t hangText="Sub-TLV Description:"> The IPsec SA Rekey Counter Sub-TLV provides the rekey counter 
 for a security association (identified by IPsec SA Identifier).  </t> 
 <t hangText="Sub-TLV Encoding:"> The encoding is shown in the figure below: 
	<figure
    anchor="IPsec SA Rekey Counter Sub-TLV Value Field"
    title="IPsec SA Rekey Counter Sub-TLV Value Field">
     <artwork><![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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |IPSec-SA-ID Sub|   Length      |  Reserved                     |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |   ID Length   |       Nonce Length            |I|   Flags     |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                             Rekey                             |
       |                            Counter                            |
       +---------------------------------------------------------------+
       |                IPsec SA Identifier                            |
       +---------------------------------------------------------------+
       |                                                               |
       ~                          Nonce Data                           ~
       |                                                               |
       +---------------------------------------------------------------+
		]]></artwork>
	</figure>
	where:
	<list> 
 	<t>IPSec-SA-ID Sub-Type (8 bits): 67 (IANA assigned) </t>  
	<t>length (8 bits): Specifies the total length in octets of the value field 
	     (not including the Type and Length fields). The total length is variable 
         with the value equal to 16 plus Nonce length. 
	</t>
	<t>Reserved: Reserved for future use. In this version
	    of the document, the Reserved field MUST be set to zero and MUST be
	    ignored upon receipt.  Received values MUST be propagated without
	    change.</t>
	<t> ID Length (8 bits): indicates the length in octets of SA-Identifer. This length SHOULD be 4 octets. 
	</t> 
	<t> Nonce Length (16 bits): indicates the length in octets of the Nonce Data.
	</t>
	<t> I Flag: when set to 1, the I-flag indicates that the communication being established is new. when set to 0, it signals that the communication is a continuation of an existing session. 
	</t> 
	<t>Flags (7 bits): Reserved for future use. In this version
	    of the document, the Reserved field MUST be set to zero and MUST be
	    ignored upon receipt.  Received values MUST be propagated without
	    change. </t> 
	<t>Rekey Counter (64 bits): the number of key updates or rekeys that have occurred. Each time a key is rotated or replaced, the ReKey Counter is incremented.</t>
	<t>IPsec SA Identifier (IPSec-SA-ID): a specific IPsec SAs terminated at the edge. The length of this 
     field is specified in ID Length. For this specification, the length is 4. Other lengths are outside 
	 of the scope of this document.</t> 
	<t>Nonce Data: a random or pseudo-random number for preventing replay attacks. 
	Its length is a multiple of 32 bits[RFC7296].
	</t>
    </list>
	</t>
  <t hangText="Sub-TLV Error Handling:"> A  IPsec SA Rekey Counter Sub-TLV s a MALFORMED if the fields 
  do not fit the limits specified above. Per <xref target="RFC9012"></xref> a MALFORMED SubTLV is ignored.
  The procedures for content checks for this sub-TLV are specified in section 3.4 for client routes, 
  and section 3.5 for underlay routes. Please note that: 
  <list> 
	<t> The IPsec-SA-ID MAY also refer to the values carried in the same TEA in 
    the same Tunnel TLV (type SD-WAN Hybrid) as the IPsec SA Rekey Counter sub-TLV
    in either the IPsec Public Key sub-TLV or the IPsec SA Proposal sub-TLV.   
	The IPsec SA Rekey Counter, IPsec Public Key, and IPsec SA Proposal 
	Sub-TLVs work together to create security associations.   
	</t> 
	<t>The IPsec-SA-ID MAY refer to an IPsec SA-ID in another SD-WAN Hybrid Tunnel TLV in the 
	same TEA as the IPsec SA Rekey Counter sub-TLV, 
	</t>
	<t> The IPsec SA-ID MAY refer to a preconfigured IPsec SA-ID preconfigured 
	associated with this SD-WAN Hybrid Tunnel Endpoint. 
	</t>
  </list>
  </t>
  <t hangText="Tunnel End Point Validation:"> The IPsec SA Rekey SubTLV 
   does not help validate the Tunnel Egress EndPoint. </t>	
   </list>
 </t>
 </section>
 <section title="IPsec Public Key Sub-TLV"> 
 <t>
<list style="hanging">
<t hangText="SubTLV Name:"> IPsec Public Key - IPsec Public Key information</t>
<t hangText="SubTLV Code:"> 68 (IANA assigned) </t>
<t hangText="SubTLV Description:"> The IPsec Public Key Sub-TLV provides the 
   Public Key exchange information and the life span for the Diffie-Hellman Key. </t> 
<t hangText="SubTLV Encoding:"> The encoding is shown in the figure below: 
	<figure
    anchor="IPsec SA Public Key Sub-TLV Value Field"
    title="IPsec SA Public Key Sub-TLV Value Field">
     <artwork><![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
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |IPSec-SA-ID Sub|   Length      |  Reserved                     |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |   Diffie-Hellman Group Num    |          Reserved             |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       |                                                               |
       ~                       Key Exchange Data                       ~
       |                                                               |
       +---------------------------------------------------------------+
       |                            Duration                           |
       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
		]]></artwork>
	</figure>
	where: 
    <list> 
	<t>IPSec-SA-ID Sub-Type (8 bits): 68 (IANA assigned)  </t>  
	<t>length (8 bits): Specifies the total length in octets of the value field 
	     (not including the Type and Length fields). The total length is variable 
         with the length being 14 + the Key Exchange Data length.  
	</t>
	<t> Diffie-Hellman Group Num (16-bits): identifies the Diffie-Hellman group used to compute the Key Exchange Data. Details on Diffie-Hellman group numbers can be found in Appendix B of IKEv2 [RFC7296] and [RFC5114]. </t>
	<t> The Key Exchange data: This refers to a copy of the sender's Diffie-Hellman public value. 
	The length of the Diffie-Hellman public value is defined for MODP groups in [RFC 7296] 
	and for ECP groups in [RFC 5903].  
    </t> 	
	<t> Duration (32 bits): a 4-octet value specifying the life span of the Diffie-Hellman key in seconds.  
	</t> 
	</list> 
	</t> 
<t hangText="SubTLV Error Handling:"> A IPsec Public Key SubTLV is a MALFORMED SubTLV if the fields 
	do not fit the limits  specified above. Per <xref target="RFC9012"></xref> a MALFORMED SubTLV is ignored.
    The procedures for content checks for the IPsec Public is specified in section 3.4 for client routes, 
    and section 3.5 for underlay routes. 
  </t>
 <t hangText="Tunnel End Point Validation:"> The IPsec SA Rekey SubTLV 
   does not help validate the Tunnel Egress EndPoint. </t>	
</list>
   </t>
 </section>
  <section title="IPsec SA Proposal Sub-TLV"> 
   <t>
   <list style="hanging">
   <t hangText="SubTLV Name:"> IPsec SA Proposal - Indicates number of IPsec Transforms</t>
   <t hangText="SubTLV Code:"> 69 (IANA assigned) </t>
   <t hangText="SubTLV Description:">The IPsec SA Proposal Sub-TLV is to indicate the number of Transform Sub-TLVs. 
   </t> 
    <t hangText="SubTLV Encoding:"> The encoding is shown in the figure below: 
  	<figure
    anchor="IPsec SA Proposal Sub-TLV Value Field"
    title="IPsec SA Proposal Sub-TLV Value Field">
     <artwork><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|IPSec-SA-ID Sub|   Length      |       Reserved-Cnt            |          
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    Transform Attr Length      |Transform Type |    Reserved.  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     Transform ID              |          Reserved             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                        Transform Attributes                   ~
|                                                               |
+---------------------------------------------------------------+
		]]></artwork>
	</figure>
    where:
	<list> 
    <t>IPSec-SA-ID Sub-Type (8 bits): 69 (IANA assigned) </t>  
	<t>length (8 bits): Specifies the total length in octets of the value field 
	     (not including the Type and Length fields). The total length is variable 
         with the length being 10 + the Transform attribute length. 
	</t>
    <t>Reserved-Cnt (16 bits): reserved for future use. These bits are ignored upon receipt 
	and set to zero when transmitted.     </t> 
	<t>Transform Attr Length (16 bits):  indicates the length of the Transform Attributes field. 
	</t>
	<t> Transform Type (8 bits): The Transform Type values are defined in Section 3.3.2 of [RFC7296] and [IKEV2IANA]. 
	Only ENCR, INTEG, and ESN values are permitted.
	</t>
	<t>Reserved (8 bits): reserved for future use. These bits are ignored upon receipt and set to zero when transmitted. 
    </t> 
	<t>Transform ID (16 bits): An identifer for the transform defined by the associated transform attributes. 
	</t> 
    <t> Transform Attributes: These Sub-SubTLV are defined in section 3.3.5 of [RFC7296].</t>
	</list>
	</t>
  <t hangText="SubTLV Error Handling:"> A IPsec SA Proposal Sub-TLV is a MALFORMED Sub-TLV if the fields 
	do not fit the limits  specified above. Per <xref target="RFC9012"></xref> a MALFORMED Sub-TLV is ignored.
    The procedure for content checks for the IPsec SA Proposal SubTLV is specified in 
	section 3.4 for client routes, and section 3.5 for underlay routes. 
   </t>
   <t hangText="Tunnel End Point Validation:"> The IPsec SA Rekey SubTLV 
      not help validate the Tunnel Egress EndPoint. </t>
   <t hangText="Compatibility:"> The Reserved-Cnt field was allocated to allow future compatiability with 
    <xref target="Secure-EVPN"></xref> field for SA-Proposals. Currently only 1 transform  
    is allowed per IPsec SA Proposal SubTLV.  Multiple IPsec SA-Proposal SubTLVs MAY be included in a 
    Tunnel-encapsulation Attribute. </t>	
   </list>
  </t>
  </section>
  <section title="Simplified IPsec SA Sub-TLV">
   <t>
   <list style="hanging">
   <t hangText="SubTLV Name:"> Simplified IPsec SA - Provides simple key for 2 keys  </t>
   <t hangText="SubTLV Code:"> 69 (IANA assigned) </t>
   <t hangText="SubTLV Description:">For a simple SD-WAN network with edge nodes 
   supporting only a few pre-defined encryption algorithms, a simple IPsec sub-TLV 
   can be used to encode the pre-defined algorithms.
  </t> 
    <t hangText="SubTLV Encoding:"> The encoding is shown in the figure below:   
  	<figure
    anchor="Simplifed IPsec SA Sub-TLV"
    title="Simplified IPsec SA Sub-TLV">
     <artwork><![CDATA[  
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |IPsec-simType  |IPsecSA Length |             Reserved          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | Transform     | Mode          | AH algorithms |ESP algorithms |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |         ReKey Counter (SPI)                                   |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | key1 length   |         Key 1                                 ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    | key2 length   |         Key 2                                 ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | nonce length  |         Nonce                                 ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |        Duration                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
		]]></artwork>
	</figure>
   where:
  <list style="hanging">
  <t>IPSec-SA-ID Sub-Type (8 bits): 70 </t>  
  <t hangText="Length (8 bits):">  variable (based on key length) </t>
  <t hangText="Reserved (16 bits):"> Reserved for future use. 
	 These bits SHOULD be set to zero on transmission and MUST be ignored on receipt.</t>
  <t hangText="Transform (8 bits):"> 
	<list style="symbol">
		<t>Transform = 1 means AH,</t> 
		<t>Transform = 2 means ESP, or</t> 
		<t>Transform = 3 means AH+ESP.</t> 
	</list>
	All other transform values are outside the scope of this document. 
  </t>
	<t hangText="IPsec Mode (8 bits):">
	<list style="symbol">
		<t>Mode = 1 indicates that the Tunnel Mode is used.</t>
		<t>Mode = 2 indicates that the Transport mode is used.</t>
	</list>
	All mode values besides 1 and 2 are outside the scope of this document. 
	</t>
	<t hangText="AH algorithms (8 bits):"> AH authentication algorithms supported. The values are specified by [IANA-AH]. 
	Each SD-WAN edge node can support multiple authentication algorithms; send to its peers to negotiate the strongest one.</t> 	
	<t hangText="ESP algorithms (8 bits):"> the ESP algorithms supported. Its values are specified by [IANA-ESP]. 
	One SD-WAN edge node can support multiple ESP algorithms and send them to its peers to negotiate the strongest one. 
	The default algorithm is AES-256.
	<list>
	<t>	When a node supports multiple authentication algorithms, the initial UPDATE needs 
	    to include the "Transform Sub-TLV"</t> 
	</list>
	</t>
	<t hangText="Rekey Counter (Security Parameter Index) (4 octet):">  indicates the count for rekeying.</t>
	<t hangText="key1 length (8 bits):"> indicates the IPsec public key 1 length</t>
	<t hangText="Public Key 1:"> IPsec public key 1</t>
	<t hangText="key2 length (8 bits):"> indicates the IPsec public key 2 length</t>
	<t hangText="Public Key 2:"> IPsec public key 2</t>
	<t hangText="none-length (8 bits):"> indicates the Nonce key length</t>
	<t hangText="Nonce:"> IPsec Nonce</t>
	<t hangText="Duration (32 bits):"> specifying the security association (SA) life span in seconds. 
	</t> 
  </list>
  </t>
  <t hangText="SubTLV Error Handling:"> A Simplified IPsec SA Sub-TLV is a MALFORMED Sub-TLV if the fields 
	do not fit the limits  specified above. Per <xref target="RFC9012"></xref> a MALFORMED Sub-TLV is ignored.
    The procedures for content checks for the IPsec SA Proposal SubTLV is specified in 
	section 3.4 for client routes, and section 3.5 for underlay routes. 
   </t>
   <t hangText="Tunnel End Point Validation:"> Simplified IPsec SA does not participate in 
   Tunnel End Point Validation.</t>
  </list>
  </t>
  </section>
 <section title="Extended Port Attribute Sub-TLV">
   <t>
   <list style="hanging">
   <t hangText="SubTLV Name:"> Extended Port Attribute - Provides information related to IPsec and NATs </t>
   <t hangText="SubTLV Code:"> 65 (IANA assigned) </t>
   <t hangText="SubTLV Description:"> The Extended Port Attribute Sub-TLV advertises the 
   properties associated with a public Internet-facing WAN port that might be behind NAT.  
   A SD-WAN edge node can query a STUN Server (Session Traversal of UDP 
   through Network address translation [RFC8489]) to get the NAT properties, 
    including the public IP address and the Public Port number, to pass to its peers. 
	<list>
    <t>The location of a NAT device can be:
     	<list style="symbol">
		<t>Only the initiator is behind a NAT device. Multiple initiators can be behind separate NAT devices. 
		Initiators can also connect to the responder through multiple NAT devices.</t>
		<t>Only the responder is behind a NAT device.</t>
		<t>Both the initiator and the responder are behind a NAT device.</t>
	    </list>
      </t>
     <t>The initiator's address and/or responder's address can be dynamically assigned 
      by an ISP or when their connection crosses a dynamic NAT device that allocates 
      addresses from a dynamic address pool.</t> 
    <t>As one SD-WAN edge can connect to multiple peers, the pair-wise NAT exchange as IPsec's 
    IKE[RFC7296] is not efficient. In the BGP Controlled SD-WAN, NAT properties for a WAN port are 
    encoded in the Extended Port Attribute sub-TLV.</t>
	</list>
 </t>
  <t hangText="SubTLV Encoding:"> The encoding is shown in the figure below:  
  <figure
    anchor="Extended Port Attribute  Sub-TLV"
    title="Extended Port Attribute  Sub-TLV">
     <artwork><![CDATA[  
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Type=65(extPort| ExtPort Length| Reserved      |I|O|R|R|R|R|R|R|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | NAT Type      |  Encap-Type   |Trans networkID|     RD ID     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                  Local  IP Address                            | 
    |        32-bits for IPv4, 128-bits for Ipv6                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                  Local  Port                                  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                Public IP                                      | 
    |        32-bits for IPv4, 128-bits for Ipv6                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                Public Port                                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
    |               Extended SubSub-TLV                             | 
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
		]]></artwork>
	</figure>
	where:
	<list style="symbol">
		<t>Extended Port Attribute Type (=65): indicating it is the Extended Port Attribute Sub-TLV</t>
		<t>ExtPort Length: the length of the sub-TLV in octets (variable). If IPv4, the 
         length is 32 (8 header, 32 address, 8 for 1 subSubTLV).  If IPv6, the length is 64  
         (8 header, 48 addresses, 8 for 1 subSubTLV).  </t>
		<t>Flags:
			<list style="symbol">
			<t>I bit (C-PE port address or Inner address scheme):
			    <list> 
				<t>If set to 0, indicate the inner (private) address is IPv4.</t> 
				<t>If set to 1, indicates the inner address is IPv6. </t>
				</list>
			</t>
			<t>O bit (Outer address scheme):
			    <list>
				<t>If set to 0, indicate the inner (private) address is IPv4.</t> 
				<t>If set to 1, indicates the inner address is IPv6. </t>
				</list>
			</t>
			<t>R bits: reserved for future use. MUST be set to 0, and ignored upon reception.</t>
			</list>
		</t>
		<t>NAT Type: the NAT type can be one of the following values: 
		  <list style="symbols"> 
		  <t>1: without NAT ;  </t>
		  <t>2: 1-to-1 static NAT; </t>
	      <t>3: Full Cone; </t> 
		  <t>4: Restricted Cone; </t>
		  <t>5: Port Restricted Cone; </t>
 		  <t>6: Symmetric; or </t> 
		  <t>7: Unknown (i.e. no response from the STUN server).</t>
		  </list>
		NAT type values outside of 1-7 are invalid for this Sub-TLV.  
		</t>
		<t>Encap-Type: the supported encapsulation types for the port. 
		  <list>
		  <t>Encap-Type=1: GRE;</t>
		  <t>Encap-Type=2: VxLAN;</t> 
		  </list>
		Notes: 	
		<list>
	     <t>The Encap-Type inside the Extended Port Attribute Sub-TLV is different from the RFC9012's 
		 BGP-Tunnel-Encapsulation type. The port can indicate the specific encapsulations, such as:
		 <list style="symbols"> 
		  <t>If the IPsec-SA-ID sub-TLV or the IPsec SA detailed sub-TLVs (Nonce/publicKey/Proposal) 
		     are included in the SD-WAN-Hybrid tunnel, the Encap-Type indicates the 
		     encapsulation type within the IPsec payload.</t>
		  <t>If the IPsec SA sub-TLVs are not included in the SD-WAN-Hybrid Tunnel, 
		     the Encap-Type indicates the encapsulation of the payload without IPsec encryption.</t> 
		  </list> 
		</t>
		<t>Encapsulation types outside of GRE and VxLAN are outside of the scope of this specification. 
		</t>
		<t>The Extended Port attribute SubTLV cannot support 6to4NAT encoding.
		</t> 
		</list>
		</t> 
		<t>Transport Network ID: Central Controller assigns a global unique ID to each transport network.
		Any value in this octet is valid  </t>
		<t>RD ID: Routing Domain ID, need to be globally unique. Any value in this octet is valid. 
		<list>
		<t>Some SD-WAN deployment might have multiple levels, zones, or regions that are represented as logical 
		domains. Policies can govern if tunnels can be established across domains.  For example, a hub node 
		can establish tunnels with different logical domains but the spoke nodes cannot establish 
		tunnels with nodes in different domains.</t>
		</list>
		</t>
		<t>Local IP: The local (or private) IP address of the WAN port.</t>
		<t>Local Port: used by Remote SD-WAN edge node for establishing IPsec to this specific port.</t>
		<t>Public IP: The IP address after the NAT. If NAT is not used, this field is set to all-zeros</t>
		<t>Public Port: The Port after the NAT. If NAT is not used, this field is set to all-zeros.</t>
		<t>Extended SubSub-TLV: for carrying additional information about the underlay networks.</t> 
	</list>
	</t>
  <t hangText="SubTLV Error Handling:"> A IPsec SA Proposal Sub-TLV is a MALFORMED Sub-TLV if the fields 
	do not fit the limits  specified above. Per <xref target="RFC9012"></xref> a MALFORMED Sub-TLV is ignored.
    The procedures for content checks for the IPsec SA Proposal SubTLV is specified in 
	section 3.4 for client routes, and section 3.5 for underlay routes. 
   </t>
   <t hangText="Tunnel End Point Validation:"> Simplified IPsec SA does not participate in 
   Tunnel End Point Validation.</t> 
 </list>
 </t>
  <section title="Extended SubSub-TLV">
  <t>One Extended SubSub-TLVs is specified in this document: Underlay Network Transport SubSub-TLV. 
  </t>
  <section title="Underlay Network Transport SubSub-TLV">
  <t>
     <list style="hanging">
   <t hangText="SubSubTLV Name:">Underlay Network Transport - caries WAN port types and speed  </t>
   <t hangText="SubTLV Code:"> 66 (IANA Assigned) </t>
   <t hangText="SubTLV Description:"> The Underlay Network Transport SubSub-TLV 
    is an optional SubSub-TLV to carry the WAN port connection types and bandwidth, 
	 such as LTE, DSL, Ethernet, and other types.  It is only valid for the 
	 Tunnel Type Hybrid SD-WAN in the Extended Port Attributes Sub-TLV. </t>
	<t hangText="SubTLV Encoding:"> The encoding is shown in the figure below:   
	<figure
    anchor="Underlay Network SubSub-TLV"
    title="Underlay Network SubSub-TLV">
     <artwork><![CDATA[  
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | UnderlayType  |      Length   |      Reserved                 | 
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Connection Type|   Port Type   |        Port Speed             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
		]]></artwork>
	</figure>
    Where:
    <list style="hanging">
	  <t hangText="Underlay Network Properties:"> sub Type=66 </t>
      <t hangText="Length:"> always 6 bytes</t>
      <t hangText="Reserved:"> 2 octet of reserved bits. It SHOULD be set to zero on
       transmission and MUST be ignored on receipt.</t>
	  <t hangText="Connection Type:"> are listed below as:
			<list style="symbol">
			<t>1 = Wired</t>
			<t>2 = WIFI</t>
			<t>3 = LTE </t>
			<t>4 = 5G </t>
			<t>Any value outside of 1-4 is outside the scope of this specification. </t>
		    </list>
	  </t>
	  <t hangText="Port Type:">Port type define as follows: 
			<list style="symbol">
			<t>1 = Ethernet </t>
			<t>2 = Fiber Cable </t>
			<t>3 = Coax Cable </t>
			<t>4 = Cellular </t>
			<t>Any value outside of values 1-4 are outside the scope of this specification.</t> 
			</list>
	  </t>
	 <t hangText="Port Speed:">The port seed is defined as 2 octet value. The values are defined in megabit speed. For example, a value of 1000 would mean 1 gigabit (1000 Mbps). The port speed of "0" is not valid.</t>
    </list>
   The connection types of equipment and port types will continue to grow with technology change. 
  Future specifications MAY specify additional connection types or port types. 
  </t>
  <t hangText="SubSub-TLV Error Handling:">Underlay Network Transport SubSub-TLV is a MALFORMED SubSub-TLV 
    if the fields do not fit the limits specified above. If a MALFORMED SubSubTLV is contained in the 
	Extended Port Attribute SubTLV, then the Extended Port Attribute SubTLV is MALFORMED. 
	Per <xref target="RFC9012"></xref> a MALFORMED Sub-TLV is ignored.
    The procedures for content checks for the IPsec SA Proposal SubTLV is specified in 
	section 3.4 for client routes, and section 3.5 for underlay routes. 
   </t>
   <t hangText="Tunnel End Point Validation:">Underlay Network Transport SubSub-TLV does NOT
    contribute to Tunnel End Point Validation. </t>
  </list> 
  </t>
</section> 
 </section>  
  </section>
</section> 
 
<section title="Procedure for Client Routes with Hybrid SD-WAN Tunnel">
<t>The Tunnel Encapsulation Attribute for the SD-WAN Hybrid Tunnel Type 
 MAY be associated with BGP UPDATE messages with NLRI with AFI/SAFI  
IPv4 Unicast (1/1), IPv6 (2/1), L3VPN v4 Unicast (1/128), and
IPv6 L3VPN (2/128). 
</t>
<t>The SD-WAN Secure Links topology is supported by the 
Unicast IPv4/IPv6 prefixes. The L3VPN topologies support
forming the SD-WAN Secure L3VPN described in <xref target="SD-WAN-BGP-USAGE"></xref> 
and MEF ([MEF 70.1][MEF70.2]). 
</t>
<t>
Based on [RFC9012], there are two forms a Tunnel Encapsulation 
Attribute (TEA) can take: "Barebones" using the Encapsulation 
Extended Community and a normal Tunnel Encapsulation form. 
</t> 
<section title="SD-WAN Tunnel in Encapsulation Extended Community">  
<t>
The SD-WAN Client routes are sent with a the Encapsulation Extended Community [RFC9012] 
BGP attribute that identifies the the Hybrid SD-WAN tunnel type. 
Per [RFC9012], the Encapsulation Extended Community uses the NextHop Field 
in the BGP UPDATE as the Tunnel Egress EndPoint. The validation for 
the Tunnel Egress Endpoint uses the validation 
in sections 6, 8, and 13 applied to the NextHop.   
</t>
<t>
A Color Extended Community [RFC9012] or local policy applied to the 
client route directs the traffic for the client route 
to across appropriate interface within the Hybrid SD-WAN Tunnel
to the Tunnel Egress Endpoint.   
</t>
</section> 
<section title="SD-WAN Tunnel in Tunnel Encapsulation Path Attribute (TEA) ">
<t> The procedures for validating a client route with a TEA does the following: 
<list style="hanging">
<t hangText="1. Check for Well-formed SD-WAN Hybrid Tunnel TLV:">
<list>
<t>A well-formed Hybrid SD-WAN Tunnel TLV MUST have a Tunnel Engress Endpoint SubTLV. 
The validation for the Tunnel Egress Endpoint uses the <xref target="RFC9012"></xref>
validation in section 6, 8, and 13. An invalid Tunnel Egress Endpoint, 
cause the Hybrid SD-WAN Tunnel TLV to be invalid, and the TLV is ignored. 
</t> 
<t>It MAY also have any of the following SubTLVs: 
<list style="symbols">
<t>the Color SubTLV defined in <xref target="RFC9012"></xref>, </t>
<t> IPsec-SA-ID, </t>
<t> IPsec SA Nonce, </t>
<t> IPsec Public Key, </t>
<t> IPSec SA Proposal, or </t>
<t> Simplified IPsec SA) </t>
</list>
</t>
<t>A MALFORMED SubTLV is ignored in the Tunnel TLV is ignored.
</t>
<t>SubTLV with an unknown type is ignored. 
</t>
</list>
</t>
<t hangText="2. Check for multiple instances of SubTLVs: ">
<list>
<t>As specified in [RFC9012], only the first instance of a SubTLV is processed; subsequent ones are ignored.
</t>
<t>A Hybrid SD-WAN tunnel TLV MAY have multiple instances of the IPsec-SA-ID if the IPsec SA Identifiers are unique.
If all the IPsec SA Identifies are not unique, the second SubTLV is ignored and not propagated. 
</t>
</list>
</t>
<t hangText="3. Validate Tunnel Egress Endpoint: ">The Tunnel Egress Endpoint MUST link to 
the remote end of one of the underlay links to be used. This validation adheres
to the <xref target="RFC9012"></xref> Tunnel Egress Endpoint validation. The tunnel link 
MAY be active or inactive. 
</t>
<t hangText="4. Validate each NLRI:"> Local policy is run to validate routes.  </t>
<t hangText="5. Validate Hext Hop:"> The next hop MUST be be reachable via the tunnel."</t>
</list>
</t> 
<t> If a tunnel encapsulation attribute is malformed, it MUST be ignored per [RFC9012]. However, in SD-WAN environments where secure tunnels are required, traffic forwarding MUST be contingent on tunnel liveness. If a required secure tunnel is unavailable, the associated route MUST NOT be installed in the forwarding table or used to forward traffic. The route MAY still exist in the BGP control plane but MUST be marked as unusable for forwarding until a valid secure tunnel is established.</t>
</section> 
<section title=" Multiple tunnels attached to One Client Route"> 
<t>A single SD-WAN client route MAY be attached to multiple SD-WAN Hybrid tunnels. 
An Update with an SD-WAN client route MAY express these tunnels as 
an Encapsulation Extended Community[RFC9012] or a TEA. Each of these tunnel descriptions is treated as a 
unique Hybrid SD-WAN tunnel with a unique Egress Endpoint. 
Local Policy on the BGP Peer determines which tunnel the client data traffic will use. 
</t>
</section> 
 <section title="SD-WAN VPN ID in the Client Route Update">  
 <t>An SD-WAN VPN ID is the same as a client VPN ID in a BGP controlled SD-WAN network. 
 The Route Target Extended Community SHOULD be included in a Client Route UPDATE message to 
 differentiate the client routes from routes belonging to other VPNs.
  Route Target value is taken as the VPN ID (for 1/1 and 2/1).  
 For 1/128 and 2/128, the RD from the NLRI identifies the VPN ID. 
 For EVPN, picking up the VPN-ID from EVPN SAFI. 
 </t> 
 </section>
  <section title="SD-WAN VPN ID in Data Plane">  
  <t>SD-WAN edge node can be reached by either 
    an MPLS path or an IPsec path within the hybrid SD-WAN tunnel. 
   If client packets are sent via a secure MPLS network 
	within the Hybrid SD-WAN tunnel, then the data packets 
	will have MPLS headers with the MPLS Labels based on the scheme specified 
	by [RFC8277]. It is assumed the secure MPLS network assures
	the security outer MPLS Label header.
	</t>
   <t>If the packets are sent via a link with IPsec outer encryption 
      across a public network, the payload is still encrypted with 
	  GRE or VXLAN encryption. For GRE Encapsulation within an IPsec tunnel, 
	the GRE key field can be used to carry the SD-WAN VPN ID. 
	For network virtual overlay (VxLAN, GENEVE, etc.) encapsulation 
	within the IPsec tunnel, the Virtual Network Identifier (VNI) field is 
	used to carry the SD-WAN VPN ID.
</t>
 </section>
</section>
 <section title="Procedure for Underlay Routes with Hybrid SD-WAN Tunnel TLV ">
 <section title="Hybrid SD-WAN NLRI with a Encapsulation Extended Community">
 <t>The Hybrid SD-WAN NLRI MUST be accompanied with the TEA, and 
 MUST NOT be accompanied by an Encapsulation Extended Community. 
 </t>
 </section> 
 <section title="Underlay Route with a TEA ">
 <t>An underlay routes contains Hybrid SD-WAN NLRIs with TEA attached. 
 The procedures for processing underlay routes follows the following steps:
 <list style="hanging">
 <t hangText="1. Check for Well-Formed SD-WAN Hybrid Tunnel TLV:">
 An Hybrid SD-WAN Tunnel TLV is well-formed using only SubTLVs valid for association 
 with the underlay Route.
 <list> 
 <t> A well-formed SD-WAN Hybrid Tunnel TLV MUST contain a valid Tunnel Egress 
 Endpoint sub-TLV to be a valid SD-WAN Hybrid TLV. <xref target="RFC9012"></xref>
 provides validation guidelines for the Tunnel Egress Endpoint in sections
 13. 
 </t>
 <t> The SD-WAN Hybrid Tunnel TLV MAY contain the following  
 sub-TLVs: Tunnel Egress, IPsec-SA-ID, Extended Port sub-TLV, IPsec Nonce, 
 IPsec Public Key, IPsec SA Proposal, and Simplified IPsec SA. 
 </t>
<t>Following <xref target="RFC9012"></xref> intent, a 
 MALFORMED Sub-TLV is ignored, and a sub-TLV with an 
 unknown type is ignored. 
 </t>
 </list>
 </t>
 <t hangText="2. Multiple instances of SubTLVs within a SD-WAN Tunnel TLV"> 
  As specified in [RFC9012], only the first instance of a Sub-TLV is processed; subsequent ones are ignored. The IPsec-SA-ID
  sub-TLVs MAY have multiple instances of the sub-TLV if the IPsec SA Identifiers are 
  unique, but if the IPsec SA Identifiers are not unique the second sub-TLV is ignored
  and not propagated. If multiple Extended Port SubTLVs exist, the TLVs
  must be validated in step 4. </t>
 <t hangText="3. Validate Tunnel Egress Endpoint"> The Tunnel Egress Endpoint MUST link to remote end point of 
 one of the underlay links from the router receiving the link. 
 </t>
 <t hangText="4. Validate Extended Port SubTLV(s)"> If a single
  Extended Port SubTLV exist, then validate that the port information 
  provides needed information to establish a connection to the 
  remote port. A SD-WAN edge node MAY utilize local policy, local 
  configuration, and the information from the SubTLV.  The exact
  mechanism of local port validation is outside the scope of this document. 
  If the Extended Port SubTLV is invalid, the SD-WAN tunnel TLV
  must be considered to be invalid. </t>
 <t hangText="5. Validate each NLRI"> The typed NLRI in the SD-WAN 
 Underlay MUST be Well-Formed having the format specified in 
 section 3.2.1. A MALFORMED NLRI MUST cause the NLRI to be discarded. 
 An implementation MAY log an error for a MALFORMED NLRI. 
 The local policy configuration in the BGP peer receiving this NLRI 
 MUST determine the validity of the route based on policy. 
 </t>
 <t hangText="6. Validate Next Hop"> The IP address specified in the 
 Next Hop field MUST be reachable by the Tunnels. 
 </t>
 </list>
 </t>
 </section> 
 <section title="Underlay Routes with Port-Local-ID of zero">
 <t> Section 3.2.1 specifies that Route Type 1 has a tuple of (Port-Local-ID, SD-WAN-Color, SD-WAN-Node-ID).
Port-Local-ID MAY be zero if the NLRI applies to multiple ports.  The BGP Peer receiving the NLRI 
MUST have pre-configured inbound filters to set the preference for the SD-WAN NLRI tuple.
</t>
<t>Since a Port-Local-ID value of zero indicates the NLRI applies to multiple ports, it is possible 
to have the following NLRI within a packet (or received in multiple packets): 
<list>
<t> Port-Local-ID (0), SD-WAN-Color (10), SD-WAN-Node-ID (2.2.2.2),
</t> 
<t> Port-Local-ID (0), SD-WAN-Color (20), SD-WAN-Node-ID (2.2.2.2), and
</t>
<t> Port-Local-ID (0), SD-WAN-Color (30), SD-WAN-Node-ID (2.2.2.2).
</t>
</list>
These NLRI MAY simply indicate that there are three groups of tunnels 
for SD-WAN-Node-ID (2.2.2.2) assigned three colors.  For example, 
these tunnels could represent three types of gold, silver and bronze network service. 
</t>
 </section>
<section title="Multiple Tunnels attached to One Underlay Route">
<t>An underlay route (SD-WAN NLRI) MAY only attach to one Hybrid SD-WAN Tunnel. 
If there are more than one Hybrid SD-WAN Tunnel TLV within a single 
TEA, the first is processed and the subsequent Hybrid SD-WAN Tunnel TLVs are ignored.  
</t>
</section> 
 </section>
 <section title="Error handling">
 <t>The Error handling for SD-WAN VPN support has two components: 
 error handling for Tunnel Encapsulation signaling 
 (Encapsulation Extended Community and TEA) and the SD-WAN NLRI. An SD-WAN NLRI,
 a Tunnel Encapsulation attribute MUST always accompany the SD-WAN NLRI.
</t>
<t>The previous sections (3.4 and 3.5) provide the normal procedures for 
handling client routes and undelay routes.  
</t>
<section title="Error handling for the Tunnel Encapsulation Signaling">
<t> The error handling for the tunnel encapsulation signaling (Encapsulation Extended Community and 
TEA) in this document follows the procedures specified in [RFC9012], Sections 6, 8, and 13. Unless otherwise stated, malformed or unrecognized Sub-TLVs MUST be handled as specified in [RFC9012]. This document defines new Sub-TLVs for Tunnel Type 25 (SD-WAN-Hybrid), but does not alter the validation behavior established in RFC 9012.
</t>
<t>
The Tunnel encapsulation signaled with the client routes indicates
the Egress endpoint via Next Hop in the Encapsulation Extended Community or the TEA SubTLV 
for Tunnel Egress Endpoints.  As indicated in the procedure in 
sections 3.4.2 and 3.5.2, the SD-WAN Hybrid tunnel follows 
the validation section 6, 8, and 13 from [RFC9012]. 
</t>
<t>The SD-WAN client routes associate some of the NLRIs that [RFC9012] associates
with the Encapsulation Extended Community and the TEA using the validation specified in [RFC9012] in 
sections 6, 8, and 13. When the SD-WAN Hybrid Tunnel is associated with the SD-WAN NLRI, and 
all RFC9012 validation rules in section 6, 8, and 13 are extended to 
apply to the SD-WAN NLRI. 
</t> 
<t> 
[RFC9012] contains the necessary detail to specify validation for 
the new SubTLVs present for the SD-WAN Tunnel type.  However, to aid 
users of this document the following recap of validation 
of [RFC9012] is provided below. The validation from section 13 of 
[RFC9012] includes: 
<list style="symbols">
<t> Invalid tunnel type MUST be treated if the TLV was not present. 
</t>
<t>A malformed sub-TLVs MUST be handled per [RFC9012] Section 13. If Tunnel Egress Endpoint is malformed, the 
entire TLV MUST be ignored. For security-sensitive attributes, such as those related to IPsec SA setup, malformed or invalid values MUST be discarded and MUST NOT be used in security association processing. The BGP UPDATE containing such attributes SHOULD still be processed if other attributes remain valid. Implementations SHOULD log the error for operational awareness and MAY trigger a session reset or rekeying if required by local policy. Unlike general BGP attributes, failure to process security-related information correctly could lead to misconfigurations or weakened security.
</t> 
<t>Multiple incidents of Tunnel Egress Endpoint Sub-TLV cause the first incident of 
these sub-TLVs to be utilized. Subsequent TLVs after the first one per type are ignored
(per RFC9012), but propagated.  
</t> 
<t>If a sub-TLV is meaningless for a tunnel type, the 
sub-TLV is ignored, but the sub-TLV is not considered malformed or removed
from the Tunnel Attribute propagated with the NLRI. 
</t>
</list> 
</t>
<t>For SD-WAN client routes with a TEA with a SD-WAN Hybrid Tunnel type TLV,  
the IPSec SubTLVs (IPsec SA-ID, IPSec nonce, IPSec Public Key, IPsec Proposal, 
and Simplified IPsec SA) are meaningful, but MAY be rarely sent. 
Incorrect fields within any of these 5 TLVs. Per [RFC9012], a malformed sub-TLV
is treated as an unrecognized sub-TLV.  
</t> 
<t>For SD-WAN NLRI underlay routes, the Extended Port sub-TLV 
and the IPSec sub-TLVs (IPsec SA-ID, IPSec nonce, IPSec Public Key, IPsec Proposal, 
and Simplified IPsec SA) are valid and meaningful. 
Incorrect fields within any of these 6 TLVs or subSubTLVs within the TLVs SHOULD cause the sub-TLV
to be treated as malformed sub-TLV.  Per [RFC9012], a malformed sub-TLV
is treated as an unrecognized sub-TLV.  
</t>
<t> If multiple instances of the IPsec nonce, IPsec Public Key, IPsec Proposal, and 
Simplified IPsec are received within a SD-WAN Tunnel TLV , only the first is processed.  
The second instance is ignored and not propagated.  The IPsec SA-ID MAY have multiple 
copies, but the IPsec SA Identifiers sent in the second sub-TLV MUST be different
than any in the first IPsec-SA ID sub-TLV. 
</t>
<t>If multiple instances of the Extended Port sub-TLV are received, the local 
policy MUST determine which is to be used. 
</t>
 </section> 
 <section title="Error Handling for NLRI">
 <t>
The SD-WAN NLRI [AFI 1/SAFI = 74] utilizes a route type field to describe the format of the NLRI. 
This specification only allows an NLRI with a type value of 1. An NLRI with a type of field of 
another value is ignored and not processed.  The implementation MAY log an error upon 
the reception of a type value outside of Route Type 1. Error handling for the SD-WAN NLRI 
also adheres to the BGP Update error handling specified in [RFC7606].     
</t>
<t>The local policy configuration in the BGP peer receiving this 
NLRI MUST determine the validity of the route based on policy. 
Local configuration and policy MUST carefully constrain 
the SD-WAN-NLRI, tunnels, and IPsec security associations
to create a "walled garden".  
</t>
<t>In the future, other proposals for a SD-WAN NLRI MAY specify a different route type. 
Those proposals MUST specify the following:
<list>
<t> validation for new Route Type in the SD-WAN-NLRI, and 
</t>
<t> how the new Route Type interacts with the Route Type 1.
</t>
</list>
</t>
 </section> 
 <section title="SDWAN NLRI and Tunnel Encapsulation Attribute">
 <t> The SD-WAN NLRI (AFI=1/SAFI=74) MUST be paired with  
 Tunnel Encapsulation attribute with a tunnel TLV for 
 tunnel type SD-WAN-Hybrid.  If the SD-WAN NLRI exist in an 
 BGP UPDATE without a Tunnel Encapsulation Attribute (TEA) 
 with a tunnel TLV for tunnel type SD-WAN-Hybrid, the 
 NLRI is considered malformed and Treat-as-withdraw approach (per RFC7606).  
 </t>
 <t>The SD-WAN NLRI SHOULD not be paired with an Encapsulation Extended Community. 
 If an SD-WAN NLRI is paried with an Encapsulation Extended Community rather than 
 a Tunnel Encapsulation Attribute, the SD-WAN NLRI is considered malformed
 and the Treat-as-withdraw approach (per <xref target="RFC7606"></xref>) SHOULD be used.
</t>
 </section>
</section>  
 </section> 
 <section title="Operational Consistency and Tunnel Validation"> 
 <t>Unlike MPLS VPN whose PE nodes are all controlled by the network operators, 
 SD-WAN edge nodes can be installed anywhere, in shopping malls, in 3rd party Cloud DCs, etc.</t> 
 <t>It is very important to ensure that client routes advertisement from an SD-WAN edge 
 node are legitimate. The RR needs to ensure the SD-WAN Hybrid Tunnels and routes 
run over the appropriate Security associations. </t>   
 <section title="Detecting Misaligned Tunnels  "> 
 <t>It is critical that the Hybrid SD-WAN Tunnel correctly forward traffic
 based on the local policy on the client routes, the tunnel egress and tunnel 
ingress, and the security association.  The RR reflector and the BGP peer 
MUST check that the client routes, tunnel egress, tunnel ingress, and security 
associations align with expected values for a tunnel. 
 </t>
 </section> 
 <section title="IPsec Attributes Mismatch"> 
 <t>Each BGP peer (e.g. a C-PE) advertises a SD-WAN SAFI Underlay NLRI to the other 
 BGP peers via a BGP Route Reflector to establish pairwise IPsec Security Associations (SA)  
 between itself and other remote BGP Peers.  During the SD-WAN SAFI NLRI advertisement, 
 the BGP Peer originating MAY pass information about security association in one of 
 three forms: 
 <list style="symbols">
<t>an identifier for a pre-configured and established IPsec Security Association,  
</t>  
<t>a simplified set of security parameters for setting up a IPsec Security association 
(Transform, IPsec Mode, AH and ESP Algorithms, rekey counter, 
2 public keys, nonce, and duration of security association), or 
</t>
<t>a flexible set of security parameters where Nonce, Public Key, and SA Proposal 
are uniquely specified. 
</t>
</list>
</t>
<t>For existing IPsec Security associations, the receiving BGP peer can simply 
utilize one of these existing security associations to pass data. 
If multiple IPsec associations are pre-configured, the local policy 
on the SD-WAN Edge Node MAY help select which security association is chosen
for the SD-WAN Hybrid Tunnel. 
</t>
<t>If the receiving and originating BGP peer engage in a set-up for the 
IPsec security associations for the link within the SD-WAN Hybrid tunnel,  IPsec
mechanisms require that there are matching IPsec transforms.  Without common 
IPsec transforms, the IPsec set-up process cannot operate. 
</t>
<section title="SD-WAN Hybrid Tunnel Mechanisms for Passing IPSec Security Association Info">
<t>
The TEA passes in the Tunnel TLV for the SD-WAN Hybrid Tunnel these three
sets of information in the following sub-TLVs: 
<list style="hanging">
<t hangText="IPsec-SA-ID:"> passes the previous configured (pre-configured or generated)
 IPsec SA identifiers. 
</t>
<t hangText="Simplified IPsec SA SubTLV:"> specifies a simplified set of information 
upon which to set-up the IPsec security associations for the tunnel.
</t> 
<t hangText="A sequence of the following SubTLVs:"> IPsec SA Rekey Counter SubTLV, IPsec Public Key SubTLV, 
and a IPSec Proposal SubTLV. Configuration on the local node uses this information 
and any information in the underlay to create security associations. 
</t>
</list>
</t>
 <t>Each BGP Peer needs to send the IPSec SA attributes received on the SD-WAN NLRI in the 
TEA between the local and remote WAN ports. 
If there is a match on the SA Attributes between the two ports, the IPSec Tunnel is established.
If there is a mismtach on the SA Attributes, no IPsec Tunnel is established. 
</t>
 <t>The C-PE devices do not try to negotiate the base IPSec-SA parameters between the local 
 and the remote ports in the case of simple IPSec SA exchange or the Transform sets between local 
 and remote ports.  If there is a mismatch in the IPsec SA, then no IPsec Tunnel is created. 
 If there is a mismatch on the Transform sets in the case of full-set of IPSec SA Sub-TLVs, 
 no tunnel is created.
 </t>
 </section>
<section title="Example creation of IPsec Security Association over SD-WAN Hybrid tunnel">
<t>This section provides one example of how IPsec Security associations are created over 
the SD-WAN Hybrid tunnel.  Figure 1 in Section 3 shows an establish an IPsec Tunnel being 
created between C-PE1 and C-PE2 WAN Ports A2 and B2 (A2: 192.168.1.10 - B2:192.168.2.1).</t>
 <t>To create this tunnel C-PE1 needs to advertise the following attributes for establishing the IPsec SA:</t>
<t> 
 <list style="symbols">
 <t>NextHop: 192.168.1.10</t>
 <t>SD-WAN Node ID: 1.1.1.1  </t>
 <t>SD-WAN-Site-ID: 15.0.0.2</t> 
 <t>Tunnel Encap Attr (Type=SD-WAN) - 
	<list style="symbols">
	<t>Extended Port Attribute Sub-TLV containing
	  <list>
	   <t>Transport SubSubTLV - with information on ISP3. </t>
      </list>
    </t>	
	<t>IPSec information for detailed information about the ISP3</t>
	<t>IPsec SA Rekey Counter Sub-TLV,</t> 
	<t>IPsec SA Public Key Sub-TLV,</t>
	<t>Proposal Sub-TLV (type = ENCR, transform ID = 1) 
	  <list>
	  <t>type: ENCR </t>
	  <t>Transform ID: 1 </t> 
	  <t>Tranform attributes = trans 1 [from RFC7296]</t>
	  </list>
    </t>
    </list>
 </t>
 </list>
</t> 
<t>C-PE2 needs to advertise the following attributes for establishing IPsec SA:
<list style="hanging">
<t hangText="Next Hop:"> 192.168.2.1</t>
<t hangText="SD-WAN Node ID:"> 2.2.2.2 </t>
<t hangText="SD-WAN-Site-ID:"> 1500 </t>
<t hangText="Tunnel Encap Attr (Type=SD-WAN)">
	<list style="symbols">
	<t>Extended Port Attribute SubTLV
	  <list>
	  <t>Transport SubSubTLV - with information on ISP3. </t>
      </list>
	</t>
	<t>IPsec SA Rekey Counter Sub-TLV, </t>
	<t>IPsec SA Public Key Sub-TLV,</t>
	<t>IPSec Proposal Sub-TLV with 
  	  <list>
      <t> transform type: ENCR </t>  
	  <t> Transform ID = 1 </t>
	  <t> Transform attributes = trans 2 </t> 
	  </list>
	</t> 
    </list>
</t>
</list>
</t>
<t>As there is no matching transform between the WAN ports A2 and B2 in C-PE1 and C-PE2, 
respectively, no IPsec Tunnel will be established.</t>
 </section>
 </section> 
 </section>
 
 <section title = "Manageability Considerations">
 <t>The BGP-based signaling mechanisms described in this document are primarily intended to enable SD-WAN edge nodes to advertise underlay transport and tunnel parameters to their Route Reflector (RR). These parameters, once received, can be monitored and validated using existing BGP monitoring tools such as BMP or route policy inspection frameworks. Operators SHOULD implement logging and alerting mechanisms for cases where inconsistent or malformed Sub-TLVs are received, as specified in Section 3.6. Misaligned parameters, such as mismatched IPsec-SA-IDs or invalid NAT indicators, should trigger operational alerts to aid troubleshooting. No new MIB modules or YANG models are introduced in this document, but implementations are expected to expose relevant state (e.g., tunnel type, advertised properties) via standard operational interfaces. The use of secure transport connections (e.g., BGP over IPsec/TLS) is RECOMMENDED to ensure manageability in untrusted environments.</t>
 
 </section>
 
  <section title="Security Considerations"> 
 <t>The document describes the encoding for SD-WAN edge nodes to advertise its properties 
 to their peers to its RR, which propagates to the intended peers via a Secure Transport Connection across an 
 untrusted network.</t> 
 <t>SD-WAN edge nodes MUST use secure transport connections to the Route Reflector to protect control-plane messages, especially when operating over public or untrusted networks. Failure to secure these BGP sessions may expose the SD-WAN fabric to route injection, impersonation, or metadata leakage. The use of IPsec, TLS, or SSL is RECOMMENDED to mitigate these threats.</t>


 <t>It is assumed that the 
 SD-WAN edges communication will result in aligned IPsec Attributes. Please see section 4.2
 for a discussion of what happens if the IPsec Attributes are mismatched.  
 </t> 
 <t>SD-WAN edge nodes MUST establish a secure transport connection to the RR. This can be achieved by running BGP over TCP secured with IPsec, SSL, or TLS. While BGP itself does not typically run over TLS, TLS can secure the underlying transport layer in specific SD-WAN environments. This secure transport also protects nonces exchanged in BGP messages, minimizing the risk of tampering and replay attacks, particularly in multi-hop environments. In such cases, BGP sessions MAY be established over TLS-based tunnels as part of a broader transport security framework.</t>  
  
 <t>
 In a walled garden SD-WAN deployment where all SD-WAN edges and the central controller are under one 
 administrative control and the network operates within a closed environment, the threat model 
 is primarily on internal threats, misconfigurations, and localized physical risks. 
 Unauthorized physical access to SD-WAN edge devices in remote locations is a concern. 
 Such access might allow attackers to compromise the edge devices and potentially manipulate the 
 advertised Client prefixes with VPN IDs (or Route Targets) that do not belong to them. 
 This can lead to unauthorized data interception and traffic redirection.
 </t>
 <t>
 Ensuring secure communication between SD-WAN edge nodes and the central controller within a 
walled garden deployment is crucial. It is essential to utilize secure communication channels 
such as TLS, SSL or  TCP over IPsec for all communications between edge nodes and the controller.
 </t>
 <t>
Therefore, it is necessary to ensure physical security controls are in place at remote locations, 
including locks, surveillance, and access controls. Additionally, the RR needs to verify the BGP 
advertisements from each SD-WAN edge to ensure in the SD-WAN Secure L3VPN that their 
advertised VPN IDs (and Route Targets) are truly theirs. In addition, local BGP policy SHOULD
careful set-up access lists for the routes received and propagated. These verifications help prevent 
unauthorized advertisement of prefixes and ensures the integrity of the routing information
within the SD-WAN environment.  
</t>
<t>This document does not specify a SD-WAN deployment outside of the above walled garden 
described above. Such a deployment is outside the scope of this document.   
 </t>
 </section>
 
  <section title="IANA Considerations"> 
   <section title="Hybrid (SD-WAN) Overlay SAFI"> 
	<t>IANA has assigned SAFI = 74 as the Hybrid (SD-WAN) SAFI.</t>
   </section>
    <section title="Tunnel Encapsulation Attribute Type"> 
	<t>IANA is requested to assign a type from the BGP Tunnel Encapsulation Attribute Tunnel Types as follows [RFC8126]:</t>
	     <artwork><![CDATA[  
 Value   Description    Reference
-----   ------------   ---------
 25	  SD-WAN-Hybrid   (this document)
		]]></artwork>
	</section>
	  <section title="Tunnel Encapsulation Attribute Sub-TLV Types"> 
	  <t>IANA is requested to assign the following sub-Types in the BGP Tunnel Encapsulation Attribute Sub-TLVs registry:</t>
	  	     <artwork><![CDATA[  
   Value   Type Description            Reference     Section 
   -----   -----------------------     ------------- -------
    64	IPSEC-SA-ID Sub-TLV            This document  3.3.1
    65	Extended Port Property Sub-TLV This document  3.3.6
    66	Underlay Transport Sub-TLV     This document  3.3.6.1 
    67	IPsec SA Rekey Counter Sub-TLV This document  3.3.2
    68	IPsec Public Key Sub-TLV       This document  3.3.3 
    69	IPsec SA Proposal Sub-TLV      This document  3.3.4
    70	Simplified IPsec SA sub-TLV    This document  3.3.5
		]]></artwork>
	  </section>
    <section title="Tunnel Encapsulation Attribute Type"> 
	<t>IANA is requested to assign a type from the BGP Tunnel Encapsulation Attribute Tunnel Types as follows [RFC8126]:</t>
	     <artwork><![CDATA[  
 Value   Description    Reference
-----   ------------   ---------
 25	  SD-WAN-Hybrid   (this document)
		]]></artwork>
	</section>
 </section>
 
</middle>	

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.1997"?>    
      <?rfc include="reference.RFC.2119"?>
	  <?rfc include="reference.RFC.4271"?>
	  <?rfc include="reference.RFC.4360"?>
	  <?rfc include="reference.RFC.4364"?>
  	  <?rfc include="reference.RFC.4456"?>
   	  <?rfc include="reference.RFC.4659"?>
	  <?rfc include="reference.RFC.4760"?>  
  	  <?rfc include="reference.RFC.4761"?>  
	  <?rfc include="reference.RFC.4762"?>  
 	  <?rfc include="reference.RFC.5701"?> 
 	  <?rfc include="reference.RFC.6793"?> 	  
	  <?rfc include="reference.RFC.7296"?>
	  <?rfc include="reference.RFC.7606"?>
  	  <?rfc include="reference.RFC.8092"?>
	  <?rfc include="reference.RFC.8126"?>
      <?rfc include="reference.RFC.8174"?>
      <?rfc include="reference.RFC.8277"?>
	  <?rfc include="reference.RFC.8489"?>
      <?rfc include="reference.RFC.9012"?>

    </references>

    <references title="Informative References">
  	  <?rfc include="reference.RFC.5114"?>
   	  <?rfc include="reference.RFC.5903"?>	  
	  <?rfc include="reference.RFC.7018"?>
 
	 <reference anchor="Net2Cloud" target= "https://datatracker.ietf.org/doc/draft-ietf-rtgwg-net2cloud-problem-statement/">
	 <front>
	    <title> Dynamic Networks to Hybrid Cloud DCs: Problem Statement and Mitigation Practice</title>
		<author>
		 <organization>L. Dunbar, A Malis, C. Jacquenet, M. Toy and  K. Majumdar</organization>
		</author>
		<date month="Sept" year="2023"/>
     </front>
	 </reference>
	 
	 <reference anchor="SD-WAN-BGP-USAGE" target="https://datatracker.ietf.org/doc/draft-ietf-bess-bgp-sdwan-usage/">
	 <front>
	    <title> BGP Usage for SD-WAN Overlay Networks</title>
		<author>
		 <organization>L. Dunbar, A Sajassi, J Drake, and B. Najem</organization>
		</author>
		<date month="Sept" year="2023"/>
     </front>
	 </reference>
	 <reference anchor="Secure-EVPN" target="https://datatracker.ietf.org/doc/draft-ietf-bess-secure-evpn/">
	 <front>
	    <title>Secure EVPN</title>
		<author>
		 <organization>A Sajassi, A. Banerjee, S. Thoria, D. Carrell, B. Weis, J. Drake </organization>
		</author>
		<date month="Nov" year="2024"/>
     </front>
	 </reference>
	 <reference anchor="MEF70.1" target="https://www.mef.net/resources/mef-70-1-sd-wan-service-attributes-and-service-framework/">
	 <front>
	    <title> SD-WAN Service Attributes and Service Framework</title>
		<author>
		 <organization>MEF</organization>
		</author>
		<date month="Nov" year="2021"/>
     </front>
	 </reference>
	 <reference anchor="MEF70.2" target="https://www.mef.net/resources/mef-70-2-sd-wan-service-attributes-and-service-framework/">
	 <front>
	    <title> SD-WAN Service Attributes and Service Framework</title>
		<author>
		 <organization>MEF</organization>
		</author>
		<date month="Oct" year="2023"/>
     </front>
	 </reference>	 	 
	 	 
	<reference anchor="IANA-AH" target="https://www.iana.org/assignments/isakmp-registry/isakmp-registry.xhtml#isakmp-registry-9">
	 <front>
	    <title> IANA-AH </title>
		<author>
		 <organization>IANA</organization>
		</author>
     </front>
	 </reference>
	 
	 <reference anchor="IANA-ESP" target="https://www.iana.org/assignments/isakmp-registry/isakmp-registry.xhtml#isakmp-registry-9">
	 <front>
	    <title> IANA-ESP </title>
		<author>
		 <organization>IANA</organization>
		</author>
     </front>
	 </reference>
	 	 

    </references>
	<section title="Acknowledgments">
	<t>Acknowledgements to Wang Haibo, Shunwan Zhuang, Hao Weiguo, and ShengCheng for implementation contribution. 
	Many thanks to Yoav Nir, Graham Bartlett, Jim Guichard, John Scudder, and Donald Eastlake for their 
	review and suggestions.</t>

	</section>
	<section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-contributors">Contributors</name>
   <t>Below is a list of other contributing authors:</t>
   <t>
   <list style="symbols">
   <t>
      	<contact fullname="Gyan Mishra">
        <organization showOnFrontPage="true">Verizon</organization>
        <address>
          <postal>     
            <country>USA</country>
          </postal>
          <email>gyan.s.mishra@verizon.com</email>
        </address>
      </contact>, </t>  
	 <t>
	  <contact fullname="Shunwan Zhuang">
        <organization showOnFrontPage="true">Huawei</organization>
        <address>
          <postal>
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>zhuangshunwan@huawei.com</email>
        </address>
      </contact>,</t> 
	  <t>
      <contact fullname="Sheng Cheng">
        <organization showOnFrontPage="true">Huawei</organization>
        <address>
          <postal>     
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>shengcheng@huawei.com</email>
        </address>
      </contact>, and </t>
	  <t>
	  <contact fullname="Donald Eastlake">
        <organization showOnFrontPage="true">Futurewei</organization>
        <address>
          <postal>     
            <country>USA</country>
          </postal>
          <email>d3e3e3@gmail.com</email>
        </address>
      </contact>.</t> 
	  </list>
	  </t> 
    </section>
  </back>
</rfc>
