<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?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-chen-idr-sr-ingress-protection-08"
     ipr="trust200902">
  <front>
    <title abbrev="SR Ingress Protection">SR Path Ingress Protection</title>

     <author initials="H" surname="Chen" fullname="Huaimo Chen">
      <organization>Futurewei</organization>
      <address>
        <postal>
          <street></street>
          <city>Boston, MA</city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>huaimo.chen@futurewei.com</email>
      </address>
    </author>

    <author initials="M" fullname="Mehmet Toy" 
            surname="Toy">
      <organization> Verizon </organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <country>USA</country>
        </postal>
        <email>mehmet.toy@verizon.com</email>
      </address>
     </author>

     <author initials="A" fullname="Aijun Wang" 
            surname="Wang">
      <organization>China Telecom</organization>
      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>
          <city>Beijing</city>
          <region> </region>
          <code>102209</code>
          <country>China</country>
        </postal>
        <email>wangaj3@chinatelecom.cn</email>
      </address>
    </author>

     <author initials="Z" fullname="Zhenqiang Li" 
            surname="Li">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <street>32 Xuanwumen West Ave, Xicheng District</street>
          <city>Beijing</city>
          <region> </region>
          <code>100053</code>
          <country>China</country>
        </postal>
        <email>lizhengqiang@chinamobile.com</email>
      </address>
    </author>

   <author initials="L" fullname="Lei Liu" 
            surname="Liu">
      <organization>Fujitsu</organization>
      <address>
        <postal>
          <street> </street>
          <city> </city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>liulei.kddi@gmail.com</email>
      </address>
    </author>

   <author initials="X" fullname="Xufeng Liu" 
            surname="Liu">
      <organization>Volta Networks</organization>
      <address>
        <postal>
          <street> </street>
          <city>McLean</city>
          <region>VA</region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>xufeng.liu.ietf@gmail.com</email>
      </address>
    </author>


    <date year="2023"/>

    <abstract>
     <t>This document describes extensions to
      Border Gateway Protocol (BGP) for protecting 
      the ingress node of a Segment Routing (SR) tunnel or path.</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">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">	
    <t>The fast protection of a transit node of a Segment Routing (SR)
     path or tunnel is described 
     in <xref target="I-D.bashandy-rtgwg-segment-routing-ti-lfa"/> and
     <xref target="I-D.hu-spring-segment-routing-proxy-forwarding"/>.
     <xref target="RFC8424"></xref> presents extensions to RSVP-TE for 
     the fast protection of the ingress node of 
     a traffic engineering (TE) Label Switching Path (LSP).
     However, these documents do not discuss any protocol extensions 
     for the fast protection of 
     the ingress node of an SR path or tunnel.</t> 

     <t>This document fills that void and specifies protocol extensions to
     Border Gateway Protocol (BGP)
     for the fast protection of the ingress node of an SR path or tunnel. 
     Ingress node and ingress, fast protection and protection as well as
     SR path and SR tunnel 
     will be used exchangeably in the following sections.</t> 
    </section> <!-- Introduction -->


    <section title="Terminologies">
    <t>The following terminologies are used in this document.
     <list style="hanging">
       <t hangText="SR:">Segment Routing</t>
       <t hangText="SRv6:">SR for IPv6</t>
       <t hangText="SRH:">Segment Routing Header</t>
       <t hangText="SID:">Segment Identifier</t>
       <t hangText="CE:">Customer Edge</t>
       <t hangText="PE:">Provider Edge</t>
       <t hangText="LFA:">Loop-Free Alternate</t>
       <t hangText="TI-LFA:">Topology Independent LFA</t>
       <t hangText="TE:">Traffic Engineering</t>
       <t hangText="BFD:">Bidirectional Forwarding Detection</t>
       <t hangText="VPN:">Virtual Private Network</t>
       <t hangText="L3VPN:">Layer 3 VPN</t>
       <t hangText="FIB:">Forwarding Information Base</t>
       <t hangText="PLR:">Point of Local Repair</t>
       <t hangText="BGP:">Border Gateway Protocol</t>
       <t hangText="IGP:">Interior Gateway Protocol</t>
       <t hangText="OSPF:">Open Shortest Path First</t>
       <t hangText="IS-IS:">Intermediate System to Intermediate System</t>
      </list>
     </t>
    </section> <!-- Terminologies -->


    <section title="SR Path Ingress Protection Example">
    <t>To protect against the failure of the (primary) ingress node of
    a (primary) SR path, a backup ingress node is configured or selected and  
    is different from the (primary) ingress node.
    A backup SR path from the backup ingress node is computed and 
    installed. Primary ingress and ingress as well as 
    primary SR path and SR path will be used exchangeably.</t>

    <t><xref target = "SR-Protect-Ingress-PE1"/> 
    shows an example of protecting
    ingress PE1 of a SR path, which is from ingress PE1 to egress PE3.  

<figure anchor="SR-Protect-Ingress-PE1" 
 title="Protecting Ingress PE1 of SR Path PE1-P1-PE3">
  <artwork> <![CDATA[
             *******  *******   
         [PE1]-----[P1]-----[PE3]            PE1 Ingress
         / |        |& &&&&&  | \            PEx Provider Edge
        /  |        |&        |  \           CEx Customer Edge
   [CE1]   |        |&        |   [CE2]      Px  Non Provider Edge
        \  |        |&        |  /           *** SR Path
         \ | &&&&&& |&        | /            &&& Backup Path
         [PE2]-----[P2]-----[PE4] 
]]></artwork>
</figure> 
    In normal operations, CE1 sends the traffic with destination PE3 
    to ingress PE1,
    which imports the traffic into the SR path.</t>

    <t>When CE1 detects the failure of ingress PE1, it switches the traffic to
    backup ingress PE2, which imports the traffic from CE1 into a backup
    SR path. 
    The backup path is from the backup ingress PE2 to the egress PE3. 
    When the traffic is imported into the backup path, 
    it is sent to the egress PE3 along the path. </t>
	  
    </section> <!-- SR Path Ingress Protection Example --> 


    <section title="Behavior after Ingress Failure">
      <t>After the failure of the ingress of an SR path happens, 
      there are a couple of different ways to detect the failure. 
      In each way, there may be some specific behavior for  
      the traffic source (e.g., CE1) and the backup ingress (e.g., PE2).</t>

      <t>In one way, the traffic source (e.g., CE1) is responsible 
      for fast detecting the failure of the ingress (e.g., PE1) of 
      an SR path. Fast detecting the failure means detecting the failure 
      in a few or tens of milliseconds.
      The backup ingress (e.g., PE2) is ready to import the traffic 
      from the traffic source into the backup SR path installed.</t>

      <t>In normal operations,
      the source sends the traffic to the ingress of the SR path.
      When the source detects the failure of the ingress,
      it switches the traffic to the backup ingress, 
      which delivers the traffic to the egress of the SR path 
      via the backup SR path.</t>

      <t>In another way, 
      the backup ingress is 
      responsible for fast detecting the failure of the ingress of
      an SR path.</t>

      <t>In normal operations,
      the source (e.g., CE1) sends the traffic to the ingress (e.g., PE1)
      and may send the traffic to the backup ingress (e.g., PE2).

      It sends the traffic to the backup ingress (e.g., PE2)
      after the ingress fails.</t>

      <t>The backup ingress does not import any traffic 
      from the source into the backup SR path in normal operations.

      When it detects the failure of the ingress, 
      it imports the traffic from the source into the backup SR path.</t>

    </section> <!-- Behavior after Ingress Failure -->


    <section title="Extensions to BGP">
      <t>For a SR path from a primary ingress node to an egress node,
      a backup ingress node is selected to protect the failure of the 
      primary ingress node of the SR path. 
      This section describes the extensions to BGP 
      for representing the information for protecting the primary ingress
      node in a BGP UPDATE message and distributing the information
      to the backup ingress node. 
      The information includes a SR backup path.</t>

      <t><xref target="I-D.ietf-idr-segment-routing-te-policy"/>
      specifies a way of representing a SR path in a BGP UPDATE message
      and distributing the SR path to the ingress node of the SR path.</t>

      <t>This is extended to represent the information for protecting
      the primary ingress by defining a few of new Sub-TLVs.</t>

    <section title="SR Path Ingress Protection Sub-TLV">
      <t>A new Sub-TLV, called SR Path Ingress Protection Sub-TLV, 
      is defined.
      When a UPDATE message is sent to the backup ingress node
      for protecting the primary ingress node of a SR path, 
      the message contains this Sub-TLV. 
      Its format is illustrated below.</t>
<t>
<figure anchor="sr-ingress-protection-sub-tlv" 
        title="SR Path Ingress Protection Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |  Type (TBD1)  |        Length (variable)      |  Flags      |A|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~                                                               ~
 ~                        Sub-TLVs (optional)                    ~
 ~                                                               ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> TBD1 is to be assigned by IANA.</t>
       <t hangText="Length:"> Variable.</t>
 
       <t hangText="Flags:"> 1 octet. One flag is defined.
          <list style="hanging">
            <t hangText="Flag A:"> 1 bit. It is set to
               <list style="hanging">
                  <t hangText="1:">request a backup ingress to let
                    the forwarding entry for the backup SR path be Active.</t>
                  <t hangText="0:">request a backup ingress to let
                    the forwarding entry for the backup SR path be inactive
                    initially and to make the entry be active after detecting the 
                    failure of the primary ingress node of the primary SR path.</t>
               </list>
             </t>
          </list>
       </t>
      </list>
</t>

      <t>A few optional Sub-TLVs are defined, 
      which are Primary Ingress Sub-TLV, Service Sub-TLV and 
      Traffic Description Sub-TLV.</t>

    <section anchor="Primary-Ingress-sub-TLV" title="Primary Ingress Sub-TLV">
      <t>A Primary Ingress Sub-TLV indicates the IP address of the primary ingress 
      node of a primary SR path.
      It has two formats: one for primary ingress node IPv4 address
      and the other for primary ingress node IPv6 address, 
      which are illustrated below.</t>
<t>
<figure anchor="primary-ingress-ipv4-sub-tlv" 
        title="Primary Ingress IPv4 Address Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (1)   |   Length (4)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Primary Ingress IPv4 Address (4 octets)            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (1 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 4.</t>
       <t hangText="Primary Ingress IPv4 Address:">4 octets. It represents
          an IPv4 host address of the primary ingress node of a primary 
          SR path.</t>
      </list>
</t>

<t>
<figure anchor="primary-ingress-ipv6-sub-tlv" 
        title="Primary Ingress IPv6 Address Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (2)   |  Length (16)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |            Primary Ingress IPv6 Address (16 octets)           |
 ~                                                               ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (2 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 16.</t>
       <t hangText="Primary Ingress IPv6 Address:">16 octets. It represents
          an IPv6 host address of the primary ingress node of a primary 
          SR path.</t>
      </list>
</t>

    </section> <!--  Primary Ingress Sub-TLV -->

    <section anchor="Service-sub-TLV" title="Service Sub-TLV">
      <t>A Service Sub-TLV contains a service ID or label to be added 
      into a packet to be carried by a SR path.
      It has three formats: 
      the first one for the service identified by a label,
      the second one for the service identified by a service 
      identifier (ID) of 32 bits, and 
      the third one for the service identified by a service 
      identifier (ID) of 128 bits. 
      Their formats are illustrated below.</t>
<t>
<figure anchor="service-label-sub-tlv" 
        title="Service Label Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (3)   |   Length (4)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |        zero           |       Service Label (20 bits)         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (3 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 4.</t>
       <t hangText="Service Label:">the least significant 20 bits. 
          It represents a label of 20 bits.</t>
      </list>
</t>


<t>
<figure anchor="service-ID-sub-tlv" 
        title="32 Bits Service ID Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (4)   |   Length (4)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        Service ID (4 octets)                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (4 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 4.</t>
       <t hangText="Service ID:"> 4 octets. 
          It represents a Service Identifier (ID) of 32 bits.</t>
      </list>
</t>

<t>
<figure anchor="service-ID-16-sub-tlv" 
        title="128 Bits Service ID Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (5)   |  Length (16)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        Service ID (16 octets)                 |
 ~                                                               ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (5 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 16.</t>
       <t hangText="Service ID:"> 16 octets. 
          It represents a Service Identifier (ID) of 128 bits.</t>
      </list>
</t>
    </section> <!-- Service sub-TLV -->

    <section anchor="Traffic-sub-TLV" title="Traffic Description Sub-TLVs">
      <t>A Traffic Description Sub-TLV describes the traffic to be 
      imported into a backup SR path. 
      Five Traffic Description Sub-TLVs are defined. Two of them 
      are FEC Sub-TLVs and the others are interface Sub-TLVs.</t>

      <t>Two FEC Sub-TLVs are IPv4 and IPv6 FEC Sub-TLVs. 
      Their formats are illustrated below.</t>
<t>
<figure anchor="fec-ipv4-sub-tlv" 
        title="IPv4 FEC Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (6)   |Length(variable|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |IPv4 Prefix Len|          IPv4 Prefix                          ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~   (Optional) Virtual Network ID (2 octets)                    ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (6 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> Variable.</t>
       <t hangText="IPv4 Prefix Len:"> Indicates the length of 
          the IPv4 Prefix.</t>
       <t hangText="IPv4 Prefix:"> IPv4 Prefix rounded to octets.</t>
       <t hangText="Virtual Network ID:"> 2 octets. 
          This is optional. It indicates the ID of a virtual network.</t>
      </list>
</t>

<t>
<figure anchor="fec-ipv6-sub-tlv" 
        title="IPv6 FEC Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (7)   |Length(variable|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |IPv6 Prefix Len|          IPv6 Prefix                          ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 ~   Optional Virtual Network ID (2 octets)                      ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (7 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> Variable.</t>
       <t hangText="IPv6 Prefix Len:"> Indicates the length of 
          the IPv6 Prefix.</t>
       <t hangText="IPv6 Prefix:"> IPv6 Prefix rounded to octets.</t>
       <t hangText="Virtual Network ID:"> 2 octets. 
          This is optional. It indicates the ID of a virtual network.</t>
      </list>
</t>
      <t>An Interface sub-TLV indicates the interface from which 
      the traffic is received and imported into the backup SR path/tunnel.
      It has three formats: one for interface index, 
      the other two for IPv4 and IPv6 address, 
      which are illustrated below.</t>
<t>
<figure anchor="interface-ix-sub-tlv" 
        title="Interface Index Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (8)   |   Length (4)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                   Interface Index (4 octets)                  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (8 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 4.</t>
       <t hangText="Interface Index:">4 octets. It indicates the index of 
          an interface.</t>
      </list>
</t>

<t>
<figure anchor="interface-ipv4-sub-tlv" 
        title="Interface IPv4 Address Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Type (9)   |   Length (4)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               Interface IPv4 Address (4 octets)               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (9 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 4.</t>
       <t hangText="Interface IPv4 Address:">4 octets. It represents
          the IPv4 address of an interface.</t>
      </list>
</t>

<t>
<figure anchor="interface-ipv6-sub-tlv" 
        title="Interface IPv6 Address Sub-TLV">
<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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   Type (10)   |  Length (16)  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               Interface IPv6 Address (16 octets)              |
 ~                                                               ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
     <list style="hanging">
       <t hangText="Type:"> Its value (10 suggested) is to be assigned by IANA.</t>
       <t hangText="Length:"> 16.</t>
       <t hangText="Interface IPv6 Address:">16 octets. It represents
          the IPv6 address of an interface.</t>
      </list>
</t>

    </section> <!-- Traffic Description sub-TLV -->


    </section> <!-- SR Path Ingress Protection -->
    </section> <!-- Extensions to BGP -->

    <section anchor="Backup-Ingress-Behavior" title="Backup Ingress Behavior">
      <t>When a backup ingress node receives a UPDATE message
      containing the information for protecting the primary ingress node
      of a SR path, it installs a forwarding entry in its FIB 
      based on the information.
      The information is encoded in a SR policy of 
      the following structure:</t>

<t>
<figure>
<artwork> <![CDATA[
  SR Policy SAFI NLRI: <Distinguisher, Policy-Color, Endpoint>
  Attributes:
      Tunnel Encaps Attribute (23)
          Tunnel Type (15): SR Policy
              SR Path Ingress Protection Sub-TLV
                  Primary Ingress Sub-TLV
                  Service Sub-TLV
                  Traffic Description Sub-TLV
              Preference Sub-TLV
              Binding SID Sub-TLV 
              Explicit NULL Label Policy (ENLP) Sub-TLV
              Priority Sub-TLV
              Policy Name Sub-TLV
              Segment List Sub-TLV
                  Weight Sub-TLV
                  Segment Sub-TLV
                  Segment Sub-TLV
                  ...
              ...
 ]]></artwork>
</figure>
Where:
</t>

<t>
     <list style="hanging">
       <t hangText="o"> SR Policy SAFI NLRI is defined in 
          <xref target="I-D.ietf-idr-segment-routing-te-policy"/>.</t>
       <t hangText="o"> Tunnel Encapsulation Attribute is defined in
          <xref target="I-D.ietf-idr-tunnel-encaps"/>.</t>
       <t hangText="o"> Tunnel Type of SR Policy is defined in 
          <xref target="I-D.ietf-idr-segment-routing-te-policy"/>.</t>   
       <t hangText="o"> SR Path Ingress Protection, Primary Ingress, 
          Service and Traffic Description Sub-TLVs 
          are defined in this document.</t> 
       <t hangText="o"> Preference, Binding SID, ENLP, Priority, Policy Name,
          Segment List, Weight and Segment Sub-TLVs are defined in 
          <xref target="I-D.ietf-idr-segment-routing-te-policy"/>.</t>   
      </list>
</t>

    <t>After receiving a SR policy with a SR Path Ingress Protection Sub-TLV,
the backup ingress node will install one or more candidate paths into
its "BGP table". Another module such as SRPM will choose one or more paths
and install the forwarding entries for them in the data plane.</t>

    <t>The forwarding entries for the paths installed in the data plane 
will be set to be inactive
if the flag A in the SR Path Ingress Protection Sub-TLV is zero. 
When the primary ingress node fails, these forwarding entries are set to
be active. The failure of the primary ingress may be detected 
by the backup ingress node through using
a mechanism such as BFD. The IP address of the primary ingress in 
the Primary Ingress Sub-TLV may be used for detecting the failure of 
the primary ingress node.</t>

    <t>If the flag A in the SR Path Ingress Protection Sub-TLV is one, 
then the forwarding entries for the paths installed in the data plane 
will be set to be active.</t>

    <t>When there is a Service Sub-TLV in the SR Path Ingress Protection
Sub-TLV, the ID or Label in the Service Sub-TLV will be included in 
the forwarding entries.
When a packet is imported into a backup SR path using the forwarding entries,
the service ID or Label is pushed first and then the sequence of
segments represented in the Segment List Sub-TLV.</t>

    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Protocol extensions defined in this document do not 
      affect the BGP security other than those as discussed 
      in the Security Considerations section of [RFC5575].</t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
     <t>The authors of this document would like to thank 
     Dhruv Dhody
     for the comments.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
    <section anchor="existing" 
      title="BGP Tunnel Encapsulation Attribute Sub-TLVs">
      <t>Under Existing Registry Name: 
      "BGP Tunnel Encapsulation Attribute Sub-TLVs", 
      IANA is requested to assign a new Sub-TLV value for 
      SR Path Ingress Protection as follows: 
<figure>
 <artwork> 
  Value     sub-TLV Name                           Reference
  -----    ------------------------------------    --------------
  TBD1     SR Path Ingress Protection Sub-TLV      This Document
  </artwork>
</figure>
</t>
    </section> <!-- BGP Tunnel Encapsulation Attribute Sub-TLVs -->

    <section anchor="new" 
      title="Ingress Protection Information Sub-TLVs">
    <t>A new registry called "Ingress Protection Information Sub-TLVs"
    is defined in this document.
      IANA is requested to create and maintain new registry: 
<list style="hanging">
  <t hangText=" o"> Ingress Protection Information Sub-TLVs</t>
</list>
  
Initial values for the registry are given below. 
The future assignments are to be made through IETF Review 
<xref target="RFC5226"/>.

<figure>
 <artwork> 
  Value     sub-TLV Name                            Reference
  -----    -------------------------------------    --------------
   0       Reserved
   1       Primary Ingress IPv4 Address Sub-TLV     This Document
   2       Primary Ingress IPv6 Address Sub-TLV     This Document
   3       Service Label Sub-TLV                    This Document
   4       32 Bits Service ID Sub-TLV               This Document
   5       128 Bits Service ID Sub-TLV              This Document
   6       IPv4 FEC Sub-TLV                         This Document
   7       IPv6 FEC Sub-TLV                         This Document
   8       Interface Index Sub-TLV                  This Document
   9       Interface IPv4 Address Sub-TLV           This Document
   10      Interface IPv6 Address Sub-TLV           This Document
  11-255   Unassigned
  </artwork>
</figure> 
    </t>
    </section> <!--  -->
    </section>


  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.7356"?>
      <?rfc include="reference.RFC.8424"?>
      <!-- <?rfc include="reference.I-D.ietf-ospf-segment-routing-extensions"?> -->
      <?rfc include="reference.I-D.ietf-idr-segment-routing-te-policy"?>
      <?rfc include="reference.I-D.ietf-idr-tunnel-encaps"?>
      <!-- <?rfc include="reference.I-D.li-ospf-ospfv3-srv6-extensions"?> -->
      <!-- <?rfc include="reference.I-D.bashandy-isis-srv6-extensions"?> -->
     <!-- <?rfc include="reference.I-D.hu-rtgwg-sr-proxy-forwarding"?> -->
    </references>

    <references title="Informative References">
      <?rfc include="reference.I-D.hu-spring-segment-routing-proxy-forwarding"?>
      <?rfc include="reference.I-D.bashandy-rtgwg-segment-routing-ti-lfa"?>
      <?rfc include="reference.I-D.hegde-spring-node-protection-for-sr-te-paths"?>

      <?rfc include="reference.I-D.sivabalan-pce-binding-label-sid"?>

      <?rfc include="reference.I-D.ietf-spring-segment-routing-policy"?>

      <?rfc include="reference.RFC.5462"?>

      <?rfc include="reference.RFC.5226"?>
      <?rfc include="reference.RFC.5575"?>
    </references>

  </back>

</rfc>
