<?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-bier-egress-protect-07"
     ipr="trust200902">
  <front>
    <title abbrev="BIER Egress Protect">BIER Egress 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>hchen.ietf@gmail.com</email>
      </address>
    </author>

    <author fullname="Mike McBride" initials="M" surname="McBride">
      <organization>Futurewei</organization>
      <address>
        <email>michael.mcbride@futurewei.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 fullname="Gyan S. Mishra" initials="G" surname="Mishra">
      <organization>Verizon Inc.</organization>
      <address>
        <postal>
          <street>13101 Columbia Pike</street>
          <city>Silver Spring</city>
          <code>MD 20904</code>
          <country>USA</country>
        </postal>
        <phone> 301 502-1347</phone>
        <email>gyan.s.mishra@verizon.com</email>
      </address>
    </author>

     <author initials="Y" fullname="Yisong Liu" 
            surname="Liu">
      <organization>China Mobile</organization>
      <address>
        <email>liuyisong@chinamobile.com</email>
      </address>
    </author>

  <author fullname="Michael Menth" initials="M" surname="Menth">
   <organization>University of Tuebingen</organization>
   <address>
    <email>menth@uni-tuebingen.de</email>
   </address>
  </author>

     <author initials="B" fullname="Boris Khasanov" 
            surname="Khasanov">
      <organization>Yandex LLC</organization>
      <address>
        <postal>
          <street></street>
          <city>Moscow</city>
          <region></region>
          <code></code>
          <country></country>
        </postal>
        
        <email>bhassanov@yahoo.com</email>
      </address>
    </author>

    <author fullname="Xuesong Geng" initials="X." surname="Geng">
      <organization>Huawei</organization>
      <address>
        <postal>
          <street/>
          <city/>
          <region/>
          <code/>
          <country/>
        </postal>
        <phone/>
        <facsimile/>
        <email>gengxuesong@huawei.com</email>
        <uri/>
      </address>
    </author>

   <author initials="Y" fullname="Yanhe Fan" 
            surname="Fan">
      <organization>Casa Systems</organization>
      <address>
        <postal>
          <street></street>
          <city></city>
          <region></region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>yfan@casa-systems.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>Alef Edge</organization>
      <address>
        <postal>
          <street> </street>
          <city> </city>
          <region> </region>
          <code></code>
          <country>USA</country>
        </postal>
        <email>xufeng.liu.ietf@gmail.com</email>
      </address>
    </author>

    <date year="2024"/>

    <abstract>
<t>This document describes a mechanism for fast protection against the
failure of an egress node of a "Bit Index Explicit Replication" (BIER)
domain. It is called BIER egress protection. It does not require any
per-flow state in the core of the domain. With BIER egress protection
the failure of a primary BFER (Bit Forwarding Egress Router) is
protected with a backup BFER such that traffic destined to the primary
BFER in the BIER domain is fast rerouted by a neighbor BFR to the backup
BFER on the BIER layer. The mechanism is applicable if all BIER traffic
sent to the primary BFER can reach its destination also via the backup
BFER. It is complementary to BIER-FRR which cannot protect against the
failure of a BFER.</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 target="RFC8174"/> 
      when, and only when, they appear in all capitals, as shown here.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t><xref target="RFC8279"/> specifies 
         "Bit Index Explicit Replication" (BIER). 
         It provides optimal forwarding of multicast data
         packets through a "multicast/BIER domain". It
         does not require the use of a protocol for explicitly 
         building multicast distribution trees, and it does not
         require intermediate nodes to maintain any per-flow state.</t>

      <t>This document describes a mechanism for fast  
         protection against the failure of an egress node of 
         a "Bit Index Explicit Replication" (BIER) domain,
         which is called BIER Egress Protection.</t>

      <t>This BIER Egress Protection does not require intermediate 
         nodes to maintain
         any per-flow state for fast protection against the failure of 
         an egress node of the flow.</t>

    <section title="Terminology">
      <t>
      <list style="hanging" hangIndent="6">
       <t hangText="BFR:">Bit-Forwarding Router.</t>
       <t hangText="BFIR:">Bit-Forwarding Ingress Router.</t>
       <t hangText="BFER:">Bit-Forwarding Egress Router.</t>
       <t hangText="BFR-id:">BFR Identifier. 
          It is a number in the range [1,65535].</t>
       <t hangText="BFR-NBR:">BFR Neighbor.</t>
       <t hangText="F-BM:">Forwarding Bit Mask.</t>
       <t hangText="BFR-prefix:">An IP address (either IPv4 or IPv6) of a BFR.</t>
       <t hangText="BIRT:">Bit Index Routing Table. 
          It is a table that maps from the BFR-id (in a particular sub-domain)
          of a BFER to the BFR-prefix of that BFER, and to the BFR-NBR 
          on the path to that BFER.</t>
       <t hangText="BIFT:">Bit Index Forwarding Table.</t>

       <t hangText="FRR:">Fast Re-Route.</t>
       <t hangText="PLR:">Point of Local Repair.</t>

       <t hangText="LFA:">Loop-Free Alternate.</t>
       <t hangText="Basic LFA:">It is the LFA defined in 
          <xref target="RFC5286"/>.</t>
       <t hangText="RLFA:">Remote LFA. It is the LFA defined in 
          <xref target="RFC7490"/>.</t>
       <t hangText="TI-LFA:">Topology Independent LFA. It is the LFA defined in 
           <xref target="I-D.ietf-rtgwg-segment-routing-ti-lfa"/>.</t>

       <t hangText="IGP:">Interior Gateway Protocol.</t>
       <t hangText="LSDB:">Link State DataBase.</t>
       <t hangText="SPF:">Shortest Path First.</t>
       <t hangText="SPT:">Shortest Path Tree.</t>
       <t hangText="OSPF:">Open Shortest Path First.</t>
       <t hangText="IS-IS:">Intermediate System to Intermediate System.</t>
       <t hangText="LSA:">Link State Advertisement in OSPF.</t>
       <t hangText="LSP:">Link State Protocol Data Unit (PDU) in IS-IS.</t>
       <t hangText="FIB:">Forwarding Information Base or Forwarding Table.</t>
<!--
       <t hangText="SPT-old(R):">The SPT rooted at node R using LSDB 
          before X fails (i.e., old LSDB).</t>
       <t hangText="SPT-new(R, X):">The SPT rooted at node R using LSDB 
          without X after X fails (i.e., new LSDB).</t>

       <t hangText="P-Space P(R,X):">The set of nodes that are reachable 
          from R without going through X. In other words, it is the set of
          nodes that are not downstream of X in SPT-old(R).</t>
       <t hangText="Extended P-Space P'(R,X):">The set of nodes that are 
          reachable from R or a neighbor of R, without going through X.</t>

       <t hangText="Q-Space Q(D,X):">The set of nodes that do not use X 
          to reach destination D using the old LSDB. </t>

       <t hangText="PQ node(R,X):">
          A member of both the P-Space P(R, X) (or the extended
          P-Space P'(R, X)) and the Q-Space (D, X).</t>
-->
      </list></t>
    </section> <!-- Terminology -->

    </section> <!-- Introduction -->


    <section title="Overview of BIER Egress Protection"> 
<t>
This section introduces BIER egress protection and describes its operation
using the BIER topology in  <xref target="bier-top-1"/> as an example. 
The figure
illustrates a BIER sub-domain with the 8 nodes/BFRs A, B, C, D, E, F, G
and H. Each link connecting these nodes/BFRs has a cost. The cost of a
link (for routing purposes) is indicated in the figure unless it is 1 by
default. Nodes/BFRs D, F, E, H and A are BFERs and have BFR-ids 1, 2, 3,
4, and 5 respectively. For simplicity, these BFR-ids are represented by
(SI:BitString), where SI = 0 and BitString is 5 bits long. BFR-ids 1, 2,
3, 4, and 5 are represented by (0:00001), (0:00010), (0:00100),
(0:01000) and (0:10000), respectively.
</t>

<t>
           <figure anchor="bier-top-1" 
           title="Example BIER topology">
  <artwork> <![CDATA[
                                          (CE2) Receiver
                                            \ 
                                             \  4 (0:01000)
                      /--------( G )--------- ( H ) Backup Egress for D
                    2/           2\______      /    \ 
                    /               _____)____/      \   
                   /               /     (____        (CE1) Receiver
                  /               /           \      /
                 /               /             \    /
( A )----------( B )-----------( C )----------( D ) Primary Egress
  5 (0:10000)    \               \              1 (0:00001)
                 4\               \
                   \               \
                  ( E )-----------( F )
                    3 (0:00100)     2 (0:00010)  ]]></artwork>
</figure>
</t>


       <t>CE1 and CE2 in neighboring networks are multicast traffic receivers. 
          CE1 is connected to both BFER D and BFER H.
          CE2 is connected to H but it is not connected to D.</t>

        <t>We explain BIER egress protection for primary BFER D
           using backup BFER H. At first, 
           BFER H is configured to protect BFER D. 
           In addition, whether primary egress D and 
          backup egress H send their BIER packets' payloads
          to the same receiver CE1 
          (i.e., after decapsulating their BIER packets, 
           whether they send the same 
           decapsulated packets 
           to the same receiver CE1)
          is configured. And then,
           this information is distributed to BFR D's
           neighbors (BFR C and BFR G) and the domain by IGP. 
           BFR C, BFR G, and BFER H know
           that H is the backup egress to protect the primary 
           egress D. 
           Two different backup strategies or methods, 
           Bit Protection Switching and Proxy Backup, 
           are specified for two different configurations
           regarding to whether D and H send their BIER packets' 
           payloads to the same receiver.</t>
<t>
      <list style="hanging" hangIndent="6">
       <t hangText="1. Bit Protection Switching:">
If a neighbor of D detects D's outage, it performs the following
operations on all the packets that are destined to D. It clears the bit for
destination D and sets the bit for H. Afterwards, these packets are
forwarded towards H and eventually reach H which decapsulates them
and delivers their payloads to the same receiver CE as D does. </t>

       <t hangText="2. Proxy Backup:">
If a neighbor as PLR of D detects D's outage, it reroutes a copy of 
the packet with D as a destination towards H. 
When H as backup BFER detects its primary BFER D's outage, 
H, acting as a proxy of D, decapsulates all the BIER packets with
destination D and forwards their payloads according to
D's forwarding behavior for the payloads. </t>
</list>
</t>

       <t>Bit Protection Switching is well applicable to the case where 
          primary egress D and backup egress H send their BIER 
          packets' payloads to the same receiver CE1. 
          In this case, after D decapsulates D's BIER packet (i.e.,
          the BIER packet with BFER D as a destination), 
          D sends the decapsulated packet 
          (i.e., the payload of the BIER packet) to receiver CE1
          through its multicast layer. 
          After H decapsulates H's BIER packet (i.e., 
          the BIER packet with BFER H as a destination),
          H sends the same decapsulated packet 
          (i.e., the same payload as the one in D's BIER packet)
          to the same 
          receiver CE1 through its multicast layer as D.</t>

       <t>During normal operations, there is no multicast traffic 
          to CE1 from backup egress H, and CE1 receives
          the multicast traffic only from primary egress D.
          There is no duplicated traffic to receiver CE1.</t>

       <t>When primary egress D fails, 
          the BIER packet with destination D is updated through  
          bit switch (i.e., the bit for D is cleared and bit for H is set 
          in the packet) 
          by a PLR such as BFR C when the PLR 
          detects the failure of D. 
          The updated packet with destination H is sent to 
          backup egress H. H decapsulates the packet and 
          delivers the packet's payload to its multicast layer,
          which sends the payload to CE1.
          </t>

       <t>Proxy Backup is applicable to the case where
          D and H send their BIER packets' payloads 
          to different receivers.

          In this case, after D decapsulates D's BIER packet, 
          D sends the decapsulated packet 
          (i.e., the payload of the BIER packet) to receiver CE1
          through its multicast layer. 
          After H decapsulates H's BIER packet,
          H drops the same decapsulated packet 
          (i.e., the same payload as the one in D's BIER packet) or
          sends it
          to different receiver CE2 through its multicast layer.</t>

       <t>During normal operations, 
          primary egress D sends the payload of the BIER packet
          with destination D to receiver CE1 and 
          backup egress H sends the payload of the BIER packet
          with destination H to receiver CE2. 
          H sends the BIER packet
          with destination D towards node D along the shortest path to D.</t>

       <t>When D fails, 
          the BIER packet with destination D is sent to 
          backup egress H by a PLR such as BFR C when the PLR 
          detects the failure of D. 
          H acting as a proxy of D
          MUST have a fast way to detect the failure of D and
          obtain the forwarding behavior of D for the payload of 
          the BIER packet with destination D in advance. 
          When H as the proxy of D 
          detects the failure of D,
          it sends the payload of the BIER packet
          with destination D to receiver CE1 according to
          the forwarding behavior of D for the payload.</t>

       <t>Backup egress H may obtain the forwarding behavior of 
          its primary egress D for the payload of the BIER packet
          with the primary egress as a destination 
          from configurations or 
          through some protocols such as BGP or PCEP.
          How for a backup egress to obtain the forwarding behavior 
          of its primary egress
          is out scope of this document.
       </t>

<!--
       <t>If we limit a BIER network to the first case 
          (i.e., every pair of primary egress node and backup egress node
           sends their BIER packets' payloads to the same CE receiver), 
          the egress protection mechanism will be 
          simpler and more efficient. 
          There is no need to change a backup egress node for protecting
          its primary egress node.
          The backup egress node does not need to detect
          the failure of its primary egress node. 
          It does not need to obtain and maintain the forwarding behavior 
          of the primary egress node for the payload of the BIER packet
          with the primary egress node
          for actig as the proxy of the primary egress node after the 
          primary egress node fails.
          In addition, the backup information about a primary egress node 
          can be distributed only to the neighbors of the node.
          There is no need to distribute the information through
          the whole BIER network domain.</t>
-->
       <t>The fast egress protection mechanism in this document 
          is different from MoFRR in <xref target = "RFC7431"/>,
          where the same traffic is sent through two separated paths/trees 
          to both primary egress node D and backup egress node H, 
          to which the receiver CE1 is dual homed. It will 
          use less network resources such as link bandwidth than MoFRR
          in <xref target = "RFC7431"/>. 
           </t>
<!--
      <section title="Mechanism">
      <t>For fast protecting an egress node of a BIER domain, 
         a backup egress node is configured on the egress node.
         After the configuration, the egress node distributes 
         the information about the backup egress to its neighbors.</t>

      <t>For clearly distinguishing between an egress node and a backup 
         egress node, an egress node is called a primary egress node
         sometimes. </t>
 
      <t>For a multicast packet to a primary egress node of the domain,
         when the primary egress node fails, its upstream hop as a 
         point of local repair (PLR) sends the packet
         to the backup egress node configured to protect the primary  
         egress node once the PLR detects the failure.
</t>
    
       <t>A Bit-Forwarding Router (BFR) in a BIER sub-domain builds 
          and maintains an "Egress Protection Bit Index Routing Table" 
          (EP-BIRT) for each of its BFR Neighbors (BFR-NBRs) that
          are egress nodes of the domain
          to provide fast protection against the failure of an egress
          node.
          The BFR builds each EP-BIRT based on a BIRT defined in 
          <xref target="RFC8279"/>.
          An "Egress Protection Bit Index Forwarding Table" (EP-BIFT) is  
          derived from an EP-BIRT in a way that is similar to the way 
          in which a BIFT is derived 
          from a BIRT, which is defined in <xref target="RFC8279"/>.</t>

       <t>Once the BFR as a PLR detects the failure of its BFR-NBR X
          that is a primary egress node of the domain,
          for a multicast packet targeting to the primary egress node, 
          the PLR uses the EP-BIFT to send the packet to the  
          backup egress node configured to protect the primary  
          egress node. The backup egress node sends the packet's
          payload to the same CE receiver as the primary egress node.</t> 
    </section> 
-->
<!-- Mechanism -->
    </section> <!-- Overview of BIER Egress Protection -->

    <section title="Protocol Extensions">
      <t>This section defines extensions to OSPF and IS-IS for advertising 
         the backup information 
         (including the backup egress node for protecting a primary 
          egress node).</t>

     <section title="Extensions to OSPF">
      <t>When a node P (as a primary egress node) has a backup egress
         node configured to protect against its failure,
         node P advertises the information about the backup egress 
         node to its neighbors  
         in its router information opaque LSA of LS type 9 or 10. 
         Using the LSA of LS type 9, 
         node P will advertise the information
         only to its neighbors 
         (which will not advertise the information further).
         Using the LSA of LS type 10, 
         node P will advertise the information
         to the whole BIER network domain (i.e., P's neighbors
         will advertise the information further until 
         the information reaches every node in the domain).
         The information is included in a
         backup egress node TLV. The format of the TLV is shown in
         <xref target="ospf-backup-egress-tlv"/>.</t>

      <t>After each of the neighbors receives the backup egress node TLV,
         it knows that node P as a primary egress node
         will be protected by the backup egress node in the TLV.
         Once detecting the failure of node P, it sends the BIER packet
         with the bit for destination P 
         towards node P's backup egress node.

<figure anchor="ospf-backup-egress-tlv" 
        title="OSPF Backup Egress 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            |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |         Reserved            |S| BFR-id of backup egress node  |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       Sub-TLVs (Optional)                     |
 :                                                               :
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
      <list style="hanging" hangIndent="6">
      <t hangText="Type:"> 2 octets, its value (TBD1) is to be 
         assigned by IANA.</t>
      <t hangText="Length:"> 2 octets, its value is 4 plus the length of
         the Sub-TLVs included. If no Sub-TLV is included, its value is 4.</t>
      <t hangText="Reserved:"> 15 bits, they MUST be set to zero when 
         sending and be ignored while receiving.</t>
      <t hangText="S flag:"> 1 bit. It is set to one to indicate that the 
         primary egress and backup egress send their BIER packets'
         payloads to the same CE receiver
<!-- (i.e., 
         the backup egress, using its FIB, forwards the payload of 
         the BIER packet with the primary egress as a destination
         to the same CE receiver as the primary egress) -->; 
         it is set to zero to indicate that the primary egress 
         and backup egress send their BIER packets' payloads to 
         different CE receivers
<!-- (i.e., 
         the backup egress, using its FIB, forwards the payload of 
         the BIER packet with the primary egress as a destination
         to the CE receiver that is different from the one
         to whcih the primary egress forwards) -->.</t>
      <t hangText="BFR-id of backup egress node:"> 2 octets, its value is 
         the BFR-id
         of the backup egress node configured to protect against 
         the failure of the primary egress node.</t>
      <t hangText="Sub-TLVs (Optional):"> No Sub-TLV is defined now.</t>
      </list>
</t>
     </section> <!-- Extensions to OSPF -->


     <section title="Extensions to IS-IS">
      <t>For supporting fast protection against the failure of 
         a primary egress node in a BIER domain, 
         a new IS-IS TLV, called IS-IS backup egress node TLV, is defined.
         It contains the BFR-id of a backup egress node.</t>

      <t>When a node P (as a primary egress node) has a backup egress
         node configured to protect against its failure,
         node P advertises the information about the backup egress 
         node using a IS-IS backup egress node TLV.</t> 
 
      <t>This TLV may be advertised in IS-IS Hello (IIH) PDUs, 
         LSPs, or in Circuit Scoped Link State PDUs (CS-LSP) 
         <xref target="RFC7356"/>.

         Using CS-LSP or IIH PDUs, 
         node P will advertise the information
         only to its neighbors.
         Using LSPs, 
         node P will advertise the information
         to the whole BIER network domain.

         The format of the TLV is shown in
         <xref target="isis-backup-egress-tlv"/>. 

<figure anchor="isis-backup-egress-tlv" 
                    title="IS-IS Backup Egress TLV">
          <artwork align="center"><![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 (TBD2)  |     Length    |          Reserved           |S|
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | BFR-id of backup egress node  |    Sub-TLVs (Optional)        ~
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+]]></artwork>
</figure>
</t>
<t>
      <list style="hanging" hangIndent="6">
      <t hangText="Type:"> 1 octet, its value (TBD2) is to be 
         assigned by IANA.</t>
      <t hangText="Length:"> 1 octet, its value is 4 plus the length of
         the Sub-TLVs included. If no Sub-TLV is included, its value is 4.</t>
      </list>
      The other fields are the same as those 
      in <xref target="ospf-backup-egress-tlv"/>.
</t>
     </section> <!-- Extensions to IS-IS -->

   </section> <!-- Protocol Extensions -->

   <section title="Extensions to BIFT"> 
<!--
    <section title="Egress Protection Bit Index Routing Tables">    
      <t>If a BFR is a direct neighbor of an egress node 
         in a BIER sub-domain, it builds and maintains a number
         of "Egress Protection Bit Index Routing Tables" (EP-BIRTs).         
         There is an EP-BIRT for each of the BFR's neighbors 
         that are egress nodes of the domain.
         The BFR builds each EP-BIRT based on its BIRT.
         Comparing to the BIRT, an EP-BIRT has a piece of 
         new backup information for each BFER.</t> 

      <t>The new backup information for a BFER indicates 
         if the BFER as an egress node is protected by the BFR.
         If so, the information further includes the backup egress
         node configured to protect the BFER.</t>

      <t>In one implementation, the new backup information is represented
         by {EP, BE-BFER}. 
         EP (short for Egress Protection) is a flag, indicating
         whether the BFER as an egress node is protected. 
         EP = 1 means that the BFER is protected. 
         EP = 0 means that the BFER is not protected.  
         BE-BFER (short for Backup Egress BFER) is the BFER 
         (i.e., BFER-id) of the backup egress node when EP = 1.
         BE-BFER is NULL (0) when EP = 0.</t>

       <t>In the EP-BIRT for BFR-NBR X that is an egress node,
          the row having X as BFER and as its next hop BFR-NBR
          contains the new backup information {EP = 1, BE-BFER},
          where BE-BFER is the BFER (i.e., BFER-id) of backup egress 
          node for protecting the egress node.
          Each of the other rows in the EP-BIRT contains 
          the new backup information {EP = 0, BE-BFER = NULL}.</t>

       <t>When the egress node fails, 
          for a multicast packet targeting to the primary egress node BFER
          (PE-BFER), the BFR sends the packet to the BE-BFER
          through using the route to the backup egress node. 
          The BFR clears the bit for PE-BFER and 
          sets the bit for BE-BFER in the packet's BitString first, 
          and then forwards the packet according to the forwarding entry
          for BE-BFER.</t>

       <t>The EP-BIRT for BFR-NBR X that is an egress node considers
          the failure of X. It has a route or say a next hop 
          (i.e., BFR-NBR N on the path, where N is not X) 
          to every BFER except for X.</t> 

       <t>The BFR may build the EP-BIRT for BFR-NBR X 
          by copying its BIRT to the EP-BIRT and 
          sets the new information for each BFER to empty 
          such as {EP = 0, BE-BFER = NULL} first.
          And then it updates each of the rows in the EP-BIRT 
          that has X as BFER or next hop BFR-NBR X.</t>
          
       <t>For the BFR-id of a BFER in the EP-BIRT for egress node X, 
          when the next hop BFR-NBR on the path to the BFER is X,
          the BFR checks whether the BFER is X. 
          If the BFER is not X,  
          the BFR changes next hop BFR-NBR X to a backup next hop (BNH) 
          when there is a BNH on a backup path to the BFER without 
          going through X and the link from the BFR to X.
          If the BFER is X, 
          the BFR adds the new backup information {EP = 1, BE-BFER} 
          for the BFER as PE-BFER.</t>

       <t>If there is not any BNH to a BFER to protect against the failure of X,
          the next hop BFR-NBR X to the BFER in the EP-BIRT for BFR-NBR X 
          is changed to NULL. 

          For a multicast packet having the BFER as one of its destinations,
          if the next hop BFR-NBR to the BFER is NULL,
          the BFR does not send the packet to the next hop BFR-NBR NULL 
          but drops it when X fails.</t>

      <t>Note: In another option, 
         the next hop BFR-NBR X to the BFER in the EP-BIRT for BFR-NBR X 
         keeps unchanged when there is not any BNH to the BFER to protect 
         against the failure of X. 

         In this case, 
         for a multicast packet having the BFER as one of its destinations,
         the BFR sends the packet to X when X fails.</t>

       <t>In one implementation, the BNH is the Loop-Free 
          Node-Protecting Alternate defined in <xref target="RFC5286"/>
          to protect against the failure of X and link from the BFR to X.
          In another implementation, the BNH is the virtual 
          Loop-Free Alternate (LFA), i.e., PQ node, 
          defined in <xref target="RFC7490"/>. 
          In a special case, a PQ node is a Loop-Free 
          Node-Protecting Alternate defined in <xref target="RFC5286"/>.
          </t>
    </section>
--> <!-- Egress Protection Bit Index Routing Tables -->

      <t>This section specifies the BIFT extended for 
         egress protection (EP-BIFT) on a BFR as a PLR and 
         the BIFT extended on a backup egress node.
         In one option, the EP-BIFT is implemented in 
         an Integrated one BIFT.
         In another, it is implemented in Multiple Backup BIFTs.</t>

    <section title="Integrated one BIFT"> 
      <t>A BFR has an integrated BIFT for both normal operations 
         and protections against the failure of each of its neighbor
         BFERs. 
         That is that the normal BIFT on the BFR is extended 
         to have a backup entry (or say sub-entry) for each of its 
         neighbor BFERs. 
         </t>
 
     <section title="EP-BIFT on BFR as PLR"
              anchor="ep-bift-on-plr">     
      <t>To protect a primary egress node (e.g., BFER D in 
         <xref target="bier-top-1"/>), 
         a BFR as the primary egress node's neighbor (e.g., BFR C in 
         <xref target="bier-top-1"/>) and a PLR
         has a backup entry in its BIFT extended for egress protection 
         (EP-BIFT). 
         The backup entry contains: Backup Entry Active (BEA), 
         Same CE receiver (SC), Backup Egress BFER (BE-BFER), 
         Backup F-BM (BF-BM) and Backup BFR-NBR (BBFR-NBR).

        <list style="symbols">
          <t>BEA = 1 indicates that the Backup Entry for egress 
                     protection is active.</t>
          <t>SC = 1 indicates that both primary egress node and backup 
                    egress node send their BIER packets' payloads to 
                    the same receiver CE.</t>
          <t>BE-BFER is the BFR-id of the backup egress node for the 
                   primary egress node. </t>
          <t>BBFR-NBR is the backup BFR-NBR to the backup egress node 
             (e.g., H in <xref target="bier-top-1"/>). 
 
             When SC = 1 (i.e., both primary egress node and backup 
                    egress node send their BIER packets' payloads to 
                    the same receiver CE), 
             the BFR finds a basic, remote or topology 
             independent (TI) LFA to the backup egress node and 
             sets BBFR-NBR to the LFA. 

             When SC = 0 (i.e., the primary egress node and its backup 
                    egress node send their BIER packets' payloads to 
                    different receiver CEs), 
             the BFR obtains the value of BBFR-NBR in following steps.
             At first, the BFR finds a basic, remote or  
             TI LFA to the backup egress node.
             And then the BFR checks if
             the LFA is the backup egress node or 
             the backup egress node is on the shortest path from the
             LFA to the primary egress node 
             without going through the primary egress node.
             If so, the LFA is used as the BBFR-NBR;
             otherwise (i.e., 
             the LFA is not the backup egress node and 
             the backup egress node is not on the shortest path 
             from the LFA to the primary egress node
             without going through the primary egress node), 
             the BBFR-NBR is set to the backup egress node through a tunnel 
             to the backup egress node without going through
             the primary egress node.
             This is to make sure that the BIER packet with 
             the primary egress 
             node as a destination reaches the backup egress node.</t>
        </list>
      </t>

      <t>When primary egress node (e.g., BFER D in 
         <xref target="bier-top-1"/>) fails, 
         the BFR as a PLR sets 
         BEA in the entry for primary egress node to one 
         after the BFR detects the failure.
         The BFR uses  
         the backup entry with BEA = 1 to forward the BIER 
         packet with primary egress node as a destination.

          The BFR forwards the packet to BBFR-NBR.
          Before forwarding the packet, 
          the BFR checks whether SC equals to one in the entry. 
          If SC = 1, the BFR as a PLR replaces 
          the primary egress node as a destination with
          its backup egress node as a destination through 
          clearing the bit for primary egress
          node (e.g., D) 
          as a destination 
          in the BIER packet and setting the bit for backup egress node
          (e.g., H) as a destination in the packet.</t>

      <t>For example, the integrated BIFT (or say EP-BIFT) on BFR C
         in <xref target="bier-top-1"/> is shown in 
         <xref target="int-bift-on-c"/>.
         </t>
<t>
<figure anchor="int-bift-on-c" 
        title="Integrated BIFT on BFR C">
          <artwork align="center"><![CDATA[
+--------------+-------+-------+---+---+----------+-------+---------+
|    BFR-id    | F-BM  |BFR-NBR|BEA|SC | BE-BFER  | BF-BM |BBFR-NBR |
|(SI:BitString)|       |       |   |   |          |       |         |
+==============+=======+=======+===+===+==========+=======+=========+
|  1 (0:00001) | 00001 |   D   | 0 | 1 | H(01000) | 01001 |    H    |
+--------------+-------+-------+---+---+----------+-------+---------+
|  2 (0:00010) | 00110 |   F   | 0 | 0 | E(00100) | 00010 |E(TI-LFA)|
+--------------+-------+-------+---+---+----------+-------+---------+
|  3 (0:00100) | 00110 |   F   | 0 | 0 | F(00010) | 00110 |    F    |
+--------------+-------+-------+---+---+----------+-------+---------+
|  4 (0:01000) | 01000 |   H   | 0 | 1 | D(00001) | 01001 |    D    |
+--------------+-------+-------+---+---+----------+-------+---------+
|  5 (0:10000) | 10000 |   B   | 0 |   |    0     | NULL  |   NULL  |
+--------------+-------+-------+---+---+----------+-------+---------+]]></artwork>
</figure>
</t>
      <t>BFR C in <xref target="bier-top-1"/> has three neighbor 
         BFERs D, F and H with BFR-ids 1, 2 and 4 respectively. 

         The backup entry for BFER D with BFR-id = 1 is 
         the last five columns in the first row of 
         <xref target="int-bift-on-c"/>. 

        <list style="symbols">
         <t>BEA = 0 means that D is working well.</t> 
         <t>SC = 1 means that the primary egress node D and 
            backup egress node H send their BIER packets' payloads to 
            the same CE receiver.</t> 
         <t>BE-BFER = H means that H is the backup egress node 
            for primary egress node D.</t> 
         <t>BF-BM = 01001 is computed by ORing the bit of BFR-id with 
            BFR-NBR = H and the bit of BFR-id with BBFR-NBR = H. 
            BFR-id = 1 is with BBFR-NBR = H and BFR-id = 4 is 
            with BFR-NBR = H.</t>
         <t>BBFR-NBR = H means that BFER H is the next hop on the 
            shortest path to H without going D.</t>
        </list>
      </t>

      <t>The backup entry for BFER F with BFR-id = 2 is 
         the last five columns in the second row of 
         <xref target="int-bift-on-c"/>.
 
        <list style="symbols">
         <t>BEA = 0 means that F is working well.</t> 
         <t>SC = 0 means that the primary egress node F and backup 
            egress node E send their BIER packets' payloads to 
            different CE receivers.</t> 
         <t>BE-BFER = E means that E is the backup egress node 
            for primary egress node F.</t> 

         <t>BF-BM = 00010 is computed by ORing the bit of BFR-id 
            with BFR-NBR = E and the bit of BFR-id with BBFR-NBR = E.
            Since there is no BFR-id with BFR-NBR = E, BF-BM = 00010.</t>

         <t>BBFR-NBR = E (TI-LFA) means that B and E 
            in <xref target="bier-top-1"/> 
            are not on the shortest path to E without going F and 
            TI-LFA tunnel is used to send primary egress node F's 
            BIER packet to backup egress node E when F fails and 
            BEA is set to one.</t>
        </list>
      </t>

      <t>The backup entry for BFER H is similar to the one for BFER D. 
         The backup entry for BFER E is similar to the one for BFER F. 
      </t>

     </section> <!-- EP-BIFT on BFR as PLR -->

     <section title="EP-BIFT on Backup Egress"> 

       <t>If a primary egress node (e.g., D in 
         <xref target="bier-top-1"/>) and 
          its backup egress 
          node (e.g., H in <xref target="bier-top-1"/>) 
          send their BIER packets' payloads to the same 
          receiver CE (e.g., CE1 in <xref target="bier-top-1"/>), 
          then the forwarding entry for the primary egress node 
          in the BIFT on 
          the backup egress node keeps the same as normal.</t>

      <t>For example, 
         the integrated BIFT on backup egress node H in 
         <xref target="bier-top-1"/> with SC = 1 is the same 
         as H's normal BIFT, which is illustrated in 
         <xref target="int-bift-on-backup-egress-h-sc-1"/>. </t>

<t>
<figure anchor="int-bift-on-backup-egress-h-sc-1" 
        title="Integrated BIFT on Backup Egress H with SC = 1">
          <artwork align="center"><![CDATA[
+--------------+-------+-------+
|    BFR-id    | F-BM  |BFR-NBR|
|(SI:BitString)|       |       |
+==============+=======+=======+
|  1 (0:00001) | 10111 |   C   |
+--------------+-------+-------+
|  2 (0:00010) | 10111 |   C   |
+--------------+-------+-------+
|  3 (0:00100) | 10111 |   C   |
+--------------+-------+-------+
|  4 (0:01000) | 01000 |   H   |
+--------------+-------+-------+
|  5 (0:10000) | 10111 |   C   |
+--------------+-------+-------+]]></artwork>
</figure>
</t>

       <t>If the primary egress node and the
          backup egress node send their BIER packets' payloads 
          to different receiver CEs, 
          for example, D as a primary egress node sends 
          its BIER packet's payload to CE1, 
          H as the backup egress node for D sends its BIER packet's 
          payload to CE2, 
          then the forwarding entry for the primary egress node 
          on the backup egress node is extended to contain a 
          backup entry for primary egress node. 
          The backup entry includes: 
        <list style="symbols">
          <t>Backup Entry Active (BEA), SC, BE-BFER, Backup F-BM (BF-BM). 
             These have the same meanings
             as those in <xref target="ep-bift-on-plr"/>.</t>
          <t>Backup BFR-NBR or 
             Pointer to FIB for Primary Egress (BBFR-NBR/P-FIB) is 
             a pointer to the FIB for 
             the primary egress node. Using this FIB, 
             the backup egress node will forward the payload of the 
             BIER packet with the primary egress node
             as a destination to the same CE receiver 
             as the primary egress node.</t> 
        </list></t>

       <t>BEA is set to one when the backup egress node detects 
          the failure of the primary egress node. 
          After detecting the failure and 
          receiving the BIER packet with the bit for the primary 
          egress node as a destination set to one, 
          the backup egress node forwards the packet's payload 
          to the primary egress node's CE receiver using the backup 
          forwarding entry with BEA = 1.</t>

      <t>For example, the integrated BIFT on backup egress node H in 
         <xref target="bier-top-1"/> with SC = 0 is illustrated in 
         <xref target="int-bift-on-backup-egress-h-sc-0"/>.
       </t>
<t>
<figure anchor="int-bift-on-backup-egress-h-sc-0" 
        title="Integrated BIFT on Backup Egress H with SC = 0">
          <artwork align="center"><![CDATA[
+--------------+-------+-------+---+---+----------+-------+---------+
|    BFR-id    | F-BM  |BFR-NBR|BEA|SC | BE-BFER  | BF-BM |BBFR-NBR |
|(SI:BitString)|       |       |   |   |          |       |/P-FIB   |
+==============+=======+=======+===+===+==========+=======+=========+
|  1 (0:00001) | 10111 |   C   | 0 | 0 | H(01000) | 00001 |P-FIB-4D |
+--------------+-------+-------+---+---+----------+-------+---------+
|  2 (0:00010) | 10111 |   C   | 0 | 0 |          |       |  NULL   |
+--------------+-------+-------+---+---+----------+-------+---------+
|  3 (0:00100) | 10111 |   C   | 0 | 0 |          |       |  NULL   |
+--------------+-------+-------+---+---+----------+-------+---------+
|  4 (0:01000) | 01000 |   H   | 0 | 0 |          |       |  NULL   |
+--------------+-------+-------+---+---+----------+-------+---------+
|  5 (0:10000) | 10111 |   C   | 0 |   |          |       |  NULL   |
+--------------+-------+-------+---+---+----------+-------+---------+]]></artwork>
</figure>
</t>
      <t>In <xref target="int-bift-on-backup-egress-h-sc-0"/>,
         the backup entry for primary egress node D with BFR-id = 1 is 
         the last five columns in the first row. 


        <list style="symbols">
         <t>BEA = 0 means that D is working well.</t> 
         <t>SC = 0 means that the primary egress node D and backup 
            egress node H send their BIER packets' payloads to 
            different CE receivers.</t> 
         <t>BE-BFER = H means that H is the backup egress node 
            for primary egress node D.</t> 

         <t>BF-BM = 00001 is computed by ORing the bit of BFR-id 
            with BFR-NBR = P-FIB-4D and the bit of BFR-id with BBFR-NBR = P-FIB-4D.
            Since there is no BFR-id with BFR-NBR = P-FIB-4D, BF-BM = 00001.</t>

         <t>BBFR-NBR/P-FIB = P-FIB-4D is the pointer to the FIB
            for the primary egress node D.
            When D fails and BEA is set to one, 
            backup egress node H for D acts as a proxy of D 
            and sends D's BIER packet's payload to CE receiver CE1
            using the FIB for D. 
            Backup egress node H for D decapsulates the BIER packet
            with D as a destination and forwards the payload using
            the FIB for D after it detects the failure of D.</t>
        </list>
      </t>
    </section> <!-- EP-BIFT on Backup Egress -->

    <section title="Updated Forwarding Procedure for Integrated BIFT">  
       <t>The forwarding procedure defined in <xref target="RFC8279"/>
          is updated/enhanced for integrated BIFT to consider the egress 
          protection. </t>
         
       <t>For a multicast packet with the BitString indicating a BFER 
          as one of its destinations, the updated forwarding procedure
          on a BFR as a PLR 
          sends the packet towards the backup egress node of the BFER
          if the BFER is protected.
          On the backup egress, the procedure sends the packet's 
          payload to the BFER's CE receiver.</t>

       <t>It checks whether BEA = 1 in the forwarding entry for the BFER. 
          If BEA = 1, it determines whether the current node is backup 
          egress node. On backup egress node, the procedure
          sends the packet's payload to the CE receiver.
          On the BFR as a PLR, the procedure sends the packet
          copy to BBFR-NBR.
          Before sending the packet copy, the procedure updates
          the packet copy by
          clearing the bit for primary egress node and
          setting the bit for backup egress node when
          primary egress node and backup egress node send
          their BIER packets' payload to the same CE receiver.
          The bits for the other destinations which are not through 
          BBFR-NBR are cleared in the packet copy's BitString
          by ANDing the BitString with BF-BM.

          The original packet's BitString is updated to remove the bits for 
          the destinations towards which the packet copy is sent
          through BBFR-NBR by ANDing the BitString with 
          the INVERSE of BF-BM.</t>
       
       <t>The updated forwarding procedure for integrated BFIT 
          is described in 
          <xref target="proc4-frr-bift"/>.
 
<figure anchor="proc4-frr-bift" 
        title="Updated Forwarding Procedure for Integrated BIFT">
  <artwork> <![CDATA[
 Packet = the packet received by BFR;
 FOR each BFER k (from the rightmost in Packet's BitString) {
    IF BFER k is the BFR itself {
       copies Packet, sends the copy to the multicast 
       flow overlay and clears bit k in Packet's BitString
    } ELSE {
       finds the row in the EP-BIFT for the sub-domain using 
       Packet's SI and BitString as the key/index
       IF BEA == 1 { // Primary Egress fails
         IF (BBFR-NBR/P-FIB is Pointer to FIB) {// on Backup Egress 
            Sends payload to CE using the FIB for primary egress;
         } ELSE {
            IF (SC == 1) {// on PLR and SC == 1
               clears bit k in Packet's BitString;//BFER k is PE-BFER
               sets bit j in Packet's BitString;  //BFER j is BE-BFER
            } // SC == 0, no updates to packet
            Copies Packet, updates the copy's BitString by ANDing it
            with BF-BM in the entry, sends updated copy to BBFR-NBR;
          }
          updates Packet's BitString by ANDing it with 
          the INVERSE of BF-BM;
       } ELSE {
          Copies Packet, updates the copy's BitString by ANDing
          it with F-BM in the entry, sends updated copy to BFR-NBR;
          updates Packet's BitString by ANDing it with the INVERSE
          of the F-BM in the entry
       }
    }
 }]]></artwork>
</figure> </t>
    </section> <!-- Updated Forwarding Procedure -->
    </section> <!-- Integrated BIFT -->


    <section title="Multiple Backup BIFTs">  
      <t>A BFR has a normal BIFT and multiple backup BIFTs for 
         egress protection. For each of the BFR's neighbor BFERs, 
         the BFR has a backup BIFT for the BFER, 
         which considers the failure of the BFER. 
         In normal operations, the BFR uses its normal BIFT to forward 
         all the BIER packets. 
         When the BFR detects the failure of the BFER, 
         the BFR uses the backup BIFT for the BFER to forward all the 
         BIER packets.</t>
 
    <section title="Multiple Backup BIFTs on BFR as PLR">  

      <t>A BFR as a PLR has a backup BIFT for a BFER 
         that has the same structure as the normal 
         BIFT except for a backup BFER (BE-BFER) for the BFER and 
         same CE receiver (SC) flag indicating 
         whether the BE-BFER and BFER send their BIER packets' payloads 
         to the same CE receiver. 
         In the entry for the BFER in the backup BIFT, 
         the value of BFR-NBR is the backup BFR-NBR (BBFR-NBR),
         which is computed in the same way
         as the BBFR-NBR is computed in 
         <xref target="ep-bift-on-plr"/>.</t>

      <t>For example, the backup BIFT for BFER D
         on BFR C in <xref target="bier-top-1"/> is shown in 
         <xref target="cs-backup-bift4-d"/>. 
         The backup BIFT for D considers BFER D's failure.
 </t>
<t>
<figure anchor="cs-backup-bift4-d" 
        title="BFR C's Backup BIFT for BFER D">
          <artwork align="center"><![CDATA[
+--------------+-------+-------+---+----------+ 
|    BFR-id    | F-BM  |BFR-NBR|SC | BE-BFER  | 
|(SI:BitString)|       |       |   |          | 
+==============+=======+=======+===+==========+ 
|  1 (0:00001) | 01001 |   H   | 1 | H(01000) |  
+--------------+-------+-------+---+----------+
|  2 (0:00010) | 00110 |   F   |   |          |
+--------------+-------+-------+---+----------+
|  3 (0:00100) | 00110 |   F   |   |          |
+--------------+-------+-------+---+----------+
|  4 (0:01000) | 01001 |   H   |   |          |
+--------------+-------+-------+---+----------+
|  5 (0:10000) | 10000 |   B   |   |          |
+--------------+-------+-------+---+----------+]]></artwork>
</figure>
</t>
      <t>In <xref target="cs-backup-bift4-d"/>, 
         the entry for BFER D with BFR-id = 1 has its BFR-NBR with 
         value of the BBFR-NBR (which is H)
         and contains SC = 1 and BE-BFER = H. 
         BE-BFER = H means that BFER H is the backup egress node 
         for primary egress node D. 
         SC = 1 means that primary egress node D and backup egress 
         node H send their BIER packets' payloads to the same CE 
         receiver. </t>

      <t>For the entry with BFR-NBR = X, 
         its F-BM has the bit of the BFR-id in each entry with BFR-NBR = X. 
         For example, the first entry with BFR-NBR = H, 
         its F-BM in the first entry has the bit of BFR-id = 1 and 
         BFR-id = 4 in the first entry and the fourth entry, 
         which are with BFR-NBR = H.</t>

      <t>When BFR C detects the failure of BFER D, it uses 
         the backup BIFT for D to forwards all the BIER packets. 
         For the packet with destination D (i.e., BitString = 00001), 
         BFR C sends the packet to BFR-NBR H after clearing the bit 
         for primary egress node D and setting the bit for backup egress 
         node H since SC = 1. 
         The packet received by H contains BitString = 01000 
         for destination H. After receiving the packet, 
         BFER H sends the packet's payload to the same CE receiver CE1.</t>
 
      <t>If SC = 0, BFR C sends the packet to BFR-NBR H without 
         clearing the bit for D or setting the bit for H. 
         After receiving the packet with destination D 
         (i.e., BitString 00001) and detecting the failure of D, 
         BFER H as a proxy of D sends the packet's payload 
         to primary egress node D's CE receiver CE1.</t>
    </section> <!-- Multiple Backup BIFTs on BFR as PLR -->

    <section title="Multiple Backup BIFTs on Backup Egress">  

      <t>When a primary egress node and its backup egress node 
         send their BIER packets' payloads to the same CE receiver,
         the backup BIFT for the primary egress node 
         on the backup egress node is the same as 
         the normal BIFT on the backup egress node.
         For example, 
         the backup BIFT for primary egress node on backup egress node H in 
         <xref target="bier-top-1"/> with SC = 1 is the same 
         as H's normal BIFT, which is illustrated in 
         <xref target="int-bift-on-backup-egress-h-sc-1"/>.</t>

      <t>When a primary egress node and its backup egress node 
         send their BIER packets' payloads to different CE receivers, 
         the backup BIFT for the primary egress node 
         on the backup egress node considers the failure of 
         the primary egress node.

         The BFR-NBR/P-FIB in the entry for the primary egress node
         is the pointer to the FIB for the primary egress node 
         which is used to forward the payload of the BIER packet with
         the primary egress node as a destination.

         For example, the backup BIFT for primary egress node D
         on backup egress node H in 
         <xref target="bier-top-1"/> with SC = 0 is illustrated in 
         <xref target="backup-bift4-d-on-backup-egress-h-sc-0"/>.
       </t>

<t>
<figure anchor="backup-bift4-d-on-backup-egress-h-sc-0" 
        title="Backup Egress H's Backup BIFT for Egress D">
          <artwork align="center"><![CDATA[
+--------------+-------+---------+---+----------+ 
|    BFR-id    | F-BM  | BFR-NBR |SC | BE-BFER  | 
|(SI:BitString)|       | /P-FIB  |   |          | 
+==============+=======+=========+===+==========+ 
|  1 (0:00001) | 00001 |P-FIB-4D | 0 | H(01000) |  
+--------------+-------+---------+---+----------+
|  2 (0:00010) | 00110 |    C    |   |          |
+--------------+-------+---------+---+----------+
|  3 (0:00100) | 00110 |    C    |   |          |
+--------------+-------+---------+---+----------+
|  4 (0:01000) | 01001 |    H    |   |          |
+--------------+-------+---------+---+----------+
|  5 (0:10000) | 10000 |    C    |   |          |
+--------------+-------+---------+---+----------+]]></artwork>
</figure>
</t>
      <t>In <xref target="backup-bift4-d-on-backup-egress-h-sc-0"/>,
         the entry for BFER D with BFR-id = 1 has 
         its BFR-NBR/P-FIB = P-FIB-4D 
         (the pointer to the FIB for primary egress node D) and 
         contains BE-BFER = H and SC = 0. 
         BE-BFER = H means that BFER H is the backup egress node 
         for primary egress node D. 
         SC = 0 means that primary egress node D and backup egress 
         node H send their BIER packets' payloads to different 
         CE receivers. 
         Note that the last two columns can be removed since they
         are not used for forwarding. </t>

      <t>When backup egress node H detects the failure of 
         primary egress node D, node H uses 
         the backup BIFT for egress D to forward 
         all the BIER packets. 
         For the packet with destination D (i.e., BitString = 00001), 
         node H as a proxy of D sends the packet's payload to the CE1 
         (D's CE receiver) using the FIB for BFER D, 
         which contains the forwarding behavior of primary egress node D
         for the payload of D's BIER packet.</t>
    </section> <!-- Multiple Backup BIFTs on Backup Egress -->  

 
    <section title="Updated Forwarding Procedure for Multiple BIFTs">  
       <t>The updated forwarding procedure for 
          multiple BIFTs is illustrated in
          <xref target="proc4-frr-bifts"/>. 
          This forwarding procedure is used
          with the normal BIFT on a BFR in normal operations.
          It is used with a backup BIFT for a primary egress node 
          on a BFR as a PLR and on a backup egress node when
          the primary egress node fails.</t>    

       <t>On the backup egress node (i.e., BFR-NBR/P-FIB is a pointer
          to the FIB for the primary egress node), 
          the procedure sends the
          payload of the packet with 
          primary egress node/BFER as a destination to 
          the BFER's CE receiver.</t>   

       <t>The forwarding procedure on a BFR as a PLR 
          for each of multiple backup BIFTs
          is the same as the one defined in <xref target="RFC8279"/>
          except for sending the packet with primary egress node 
          as a destination 
          to the backup egress node of primary egress node.
<!--
          when backup egress exists (i.e., BE-BFER is not zero).
-->
          Before sending the packet to the backup egress node,
          the procedure updates the BitString in the packet by
          clearing the bit for the primary egress node and setting
          the bit for the backup egress node when SC = 1 (i.e., 
          the primary egress node and backup egress node 
          send their BIER packets' payloads to the same CE receiver).</t>

<t>
<figure anchor="proc4-frr-bifts" 
        title="Updated Forwarding Procedure for Multiple BIFTs">
  <artwork> <![CDATA[
 Packet = the packet received by BFR;
 FOR each BFER k (from the rightmost in Packet's BitString) {
    IF BFER k is the BFR itself {
       copies Packet, sends the copy to the multicast 
       flow overlay and clears bit k in Packet's BitString
    } ELSE {
       finds the row in the EP-BIFT for the sub-domain using 
       Packet's SI and BitString as the key/index
       IF (BFR-NBR/P-FIB is Pointer to FIB) {// on Backup Egress 
          Sends payload using the FIB for the primary egress;
       } ELSE {
          IF (SC == 1) {// on PLR and SC == 1
             clears bit k in Packet's BitString;//BFER k is PE-BFER
             sets bit j in Packet's BitString;  //BFER j is BE-BFER
          } // SC == 0, no updates to packet
          Copies Packet, updates the copy's BitString by ANDing
          it with F-BM in the entry, sends updated copy to BFR-NBR;
       }
       updates Packet's BitString by ANDing it with the INVERSE
       of the F-BM in the entry
    }
 }]]></artwork>
</figure> </t>
    </section> <!-- Updated Forwarding Procedure -->  


    <section title="Switching between EP and Normal Forwarding">
       <t>When multiple backup BIFTs are used,
          the multiple backup BIFTs are pre-computed and installed ready 
          for activation when an egress node failure is detected.

          In normal operations, a BFR uses its normal BIFT to 
          forward BIER packets.

          Once the BFR detects the failure of its BFR-NBR X as an egress,
          it activates (i.e., uses) the backup BIFT for X 
          to forward BIER packets 
          and de-activates (i.e., does not use) its normal BIFT.

          After activation of the backup BIFT, it remains in effect
          until it is no longer required.</t>

       <t>In general, when the routing protocol has re-converged 
          on the new topology taking into account the failure of X, 
          the BIRT is re-computed using the updated LSDB and
          the BIFT is re-derived from the BIRT.

          Once the BIFT is installed ready for activation, 
          it is activated to forward packets with BIER headers
          and the backup BIFT for X is de-activated. </t>

       <t>From the new topology, the BFR computes/re-computes 
          the backup BIRT for each BFR-NBR Y as an egress and 
          the backup BIFT for Y is derived/re-derived from the backup 
          BIRT for Y.

          The backup BIFT is installed/re-installed ready 
          for activation when Y fails.</t>
    </section> <!-- Switching between EP and Normal -->
    </section> <!-- EP-BIFT in Multiple Backup BIFTs -->

   </section> <!-- "BIER Extensions" --> 


    <section title="Example Application of BIER Egress Protection">
      <t>This section illustrates an example application of 
         BIER Egress Protection using multiple backup BIFTs
         on a BFR in a BIER topology 
         in <xref target="bier-top-1"/>.</t>

      <section title="BIRT and BIFT on a BFR">
        <t>Every BFR in a BIER sub-domain/topology builds and maintains 
           a Bit Index Routing Table (BIRT). 
           For the BIER topology in <xref target="bier-top-1"/>,
           each of 8 nodes/BFRs A, B, C, D, E, F, G and H 
           builds and maintains a BIRT using the LSDB for the topology.</t>

        <t>The BIRT built on BFR C (i.e., node C) is shown in
           <xref target="birt-bfr-c"/>.
 
<figure anchor="birt-bfr-c" 
        title="Bit Index Routing Table on BFR C">
  <artwork> <![CDATA[
           +----------------+--------------+------------+
           |     BFR-id     |  BFR-Prefix  |  BFR-NBR   |
           | (SI:BitString) | of Dest BFER | (Next Hop) |
           +================+==============+============+
           |  1 (0:00001)   |     D        |     D      |
           +----------------+--------------+------------+
           |  2 (0:00010)   |     F        |     F      |
           +----------------+--------------+------------+
           |  3 (0:00100)   |     E        |     F      |
           +----------------+--------------+------------+
           |  4 (0:01000)   |     H        |     H      |
           +----------------+--------------+------------+
           |  5 (0:10000)   |     A        |     B      |
           +----------------+--------------+------------+ ]]></artwork>
</figure>
            The 1st row in the BIRT indicates that the next hop BFR-NBR
            on the shortest path to BFER D with BFR-id 1 is BFR D.</t>
         <t>The 2nd row in the BIRT indicates that the next hop BFR-NBR
            on the shortest path to BFER F with BFR-id 2 is BFR F.</t>
         <t>The 3rd row in the BIRT indicates that the next hop BFR-NBR
            on the shortest path to BFER E with BFR-id 3 is BFR F.</t>
         <t>The 4-th row in the BIRT indicates that the next hop BFR-NBR
            on the shortest path to BFER H with BFR-id 4 is BFR H.</t>
         <t>The 5-th row in the BIRT indicates that the next hop BFR-NBR
            on the shortest path to BFER A with BFR-id 5 is BFR B.</t>


         <t>From this BIRT on BFR C, 
            a Bit Index Forwarding Table (BIFT) is derived. 
            This BIFT is shown in
            <xref target="bift-bfr-c"/>. </t>

         <t>The 2nd and 3-th rows in the BIRT have 
            the same SI = 0 and next hop BFR-NBR = F.
            The F-BM for each of these two rows in the
            BIFT is the logical OR of the BitStrings of these rows,
            which is 00110 (00010 OR 00100 = 00110).</t>

         <t>The F-BM for 1st row in the BIFT is 00001.</t>
         <t>The F-BM for 4-th row in the BIFT is 01000.</t>
         <t>The F-BM for 5-th row in the BIFT is 10000.

<figure anchor="bift-bfr-c" 
        title="Bit Index Forwarding Table on BFR C">
  <artwork> <![CDATA[
              +----------------+---------+------------+
              |     BFR-id     |  F-BM   |  BFR-NBR   |
              | (SI:BitString) |         | (Next Hop) |
              +================+=========+============+
              |  1 (0:00001)   |  00001  |     D      |
              +----------------+---------+------------+
              |  2 (0:00010)   |  00110  |     F      |
              +----------------+---------+------------+
              |  3 (0:00100)   |  00110  |     F      |
              +----------------+---------+------------+
              |  4 (0:01000)   |  01000  |     H      |
              +----------------+---------+------------+
              |  5 (0:10000)   |  10000  |     B      |
              +----------------+---------+------------+ ]]></artwork>
</figure>
         </t>

      </section> <!-- BIRT and BIFT on a BFR -->


      <section title="Backup BIRTs and Backup BIFTs on a BFR">
        <t>Each of the BFRs that are neighbors of egress nodes 
           (i.e., BFERs) in a BIER sub-domain/topology 
           builds and maintains a number of 
           Egress Protection Bit Index Routing Tables (EP-BIRTs)
           or say backup BIRTs. </t>

        <t>For the BIER topology in <xref target="bier-top-1"/>,
<figure>
  <artwork> <![CDATA[
           BFR B is the neighbor of BFERs A and E;
           BFR C is the neighbor of BFERs D, F and H;
           BFR E is the neighbor of BFER F; 
           BFR F is the neighbor of BFER E;
           BFR G is the neighbor of BFERs D and H. ]]></artwork>
</figure> 
           </t>

        <t>Each of 5 nodes/BFRs B, C, E, F and G 
           builds and maintains a number of backup BIRTs using the LSDB 
           for the topology for its every BFR-NBR as an egress node.</t>

        <t>For example, BFR C (i.e., node C) in the BIER topology
           builds and maintains three backup BIRTs for its three BFR-NBRs
           (BFERs D, F and H) that are egress nodes respectively. </t>

        <t>The backup BIRT for BEFR D built by BFR C based on the BIRT
           on BFR C (refer to <xref target="birt-bfr-c"/>)
           is shown in <xref target="ep-birt4d-bfr-c"/>.</t>

       <t>The BIRT is copied to the backup BIRT for BFER D 
          (i.e., the first three columns of the backup BIRT).
          The new backup information (i.e., the 4-th column) 
          for every row in the backup BIRT
          is initialized with BE-BFER = 0/NULL.
          
<figure anchor="ep-birt4d-bfr-c" 
        title="C's Backup BIRT for BFER D">
  <artwork> <![CDATA[
     +--------------+--------------+----------+-----------+
     |    BFR-id    |  BFR-Prefix  |  BFR-NBR |  BE-BFER  |
     |(SI:BitString)| of Dest BFER |(Next Hop)|           |
     +==============+==============+==========+===========+
     |  1 (0:00001) |      D       |    H     |     H     |
     +--------------+--------------+----------+-----------+
     |  2 (0:00010) |      F       |    F     |     0     |
     +--------------+--------------+----------+-----------+
     |  3 (0:00100) |      E       |    F     |     0     |
     +--------------+--------------+----------+-----------+
     |  4 (0:01000) |      H       |    H     |     0     |
     +--------------+--------------+----------+-----------+
     |  5 (0:10000) |      A       |    B     |     0     |
     +--------------+--------------+----------+-----------+ ]]></artwork>
</figure>
            In the backup BIRT for BFER D, the row that has 
            Destination BFER == D is the 1st row. This row has the new 
            backup information 
            BE-BFER = H, which indicates that
            BFER D (i.e., primary egress node D) is protected by 
            BFER H (i.e., backup egress node H).
            Each of the other rows has the new backup information 
            BE-BFER = 0/NULL.</t> 
         <t>The 1st row in the EP-BIRT indicates that the packet with
            destination D will be sent to D's backup egress node H 
            when D fails.</t>
         <t>The 2nd row in the backup BIRT indicates that the next hop BFR-NBR
            on the path to BFER F with BFR-id 2 is BFR F.</t>
         <t>The 3rd row in the backup BIRT indicates that the next hop BFR-NBR
            on the path to BFER E with BFR-id 3 is BFR F.</t>
         <t>The 4-th row in the backup BIRT indicates that the next hop BFR-NBR
            on the path to BFER H with BFR-id 4 is BFR H.</t>
         <t>The 5-th row in the backup BIRT indicates that the next hop BFR-NBR
            on the path to BFER A with BFR-id 5 is BFR B.</t>


         <t>From this backup BIRT for BFER D on BFR C, 
            an Egress Protection Bit Index Forwarding Table (EP-BIFT) or say
            backup BIFT for BFER D is derived. 
            This backup BIFT for BFER D is shown in
            <xref target="ep-bift4d-bfr-c"/>. </t>

         <t>The first and 4-th rows in the backup BIRT have 
            the same next hop BFR-NBR = H.
            The F-BM for each of these two rows in the
            backup BIFT is the logical OR of the BitStrings of these rows,
            which is 01001 (00001 OR 01000 = 01001).</t>

         <t>The 2nd and 3rd rows in the backup BIRT have 
            the same next hop BFR-NBR = E.
            The F-BM for each of these two rows in the
            backup BIFT is the logical OR of the BitStrings of these rows,
            which is 00110 (00010 OR 00100 = 00110).

<figure anchor="ep-bift4d-bfr-c" 
        title="C's Backup BIFT for BFER D">
  <artwork> <![CDATA[
      +----------------+---------+------------+----+----------+
      |     BFR-id     |  F-BM   |  BFR-NBR   | SC | BE-BFER  |
      | (SI:BitString) |         | (Next Hop) |    |          |
      +================+=========+============+====+==========+
      |  1 (0:00001)   |  01001  |     H      | 1  |    H     |
      +----------------+---------+------------+----+----------+
      |  2 (0:00010)   |  00110  |     F      | 0  |    0     |
      +----------------+---------+------------+----+----------+
      |  3 (0:00100)   |  00110  |     F      | 0  |    0     |
      +----------------+---------+------------+----+----------+
      |  4 (0:01000)   |  01001  |     H      | 0  |    0     |
      +----------------+---------+------------+----+----------+
      |  5 (0:10000)   |  10000  |     B      | 0  |    0     |
      +----------------+---------+------------+----+----------+]]></artwork>
</figure>
<figure>  
<artwork> <![CDATA[
The F-BM for 5-th row in the backup BIFT is 10000.]]></artwork>
</figure>
        </t>

      </section> <!-- EP-BIRTs and EP-BIFTs on a BFR -->


      <section title="Forwarding using Backup BIFT">
        <t>Suppose that there is a multicast traffic from
           BFR A as ingress/BFIR to egresses/BFERs D, F and E.
           For every packet of the traffic, after receiving it, 
           BFR A adds a BIER header into the packet and 
           sends the packet with the BIER header to BFR B, 
           which sends the packet BFR C.
           The BIER header contains (SI:BitString) = (0:00111) for 
           egresses/BFERs D, F and E.</t>

        <t>In normal operations, after receiving the packet from BFR B,
           BFR C copies, updates and sends the packet to
           BFR D and BFR F using the normal BIFT on BFR C according to
           the forwarding procedure defined in 
           <xref target="RFC8279"/>.</t>

        <t>Once BFR C detects the failure of its BFR-NBR D,
           which is a BFER,
           after receiving the packet from BFR B,
           BFR C copies, updates and sends the packet 
           using the backup BIFT for BFER D on BFR C according to the 
           updated forwarding procedure.</t>
 
        <t>For the packet targeting to BFER D (i.e., primary egress node),
           BFR C sends it towards BFER H (i.e., backup egress node),
           which is configured to protect BFER D.</t>

        <t>For example, 
           once BFR C detects the failure of its BFR-NBR D,  
           after receiving the packet from BFR B,
           BFR C copies, updates and sends the packet to 
           BFR H and BFR F using the backup BIFT for BFER D on BFR C.</t>

        <t>The packet received by BFR C from BFR B contains 
           (SI:BitString) = (0:00111). 
           The rightmost one bit in BitString is bit 1.
           For BFER 1 (0:00001) (i.e., BFR D as BFER), 
           BFR C gets the 1st row (i.e., forwarding entry) in the 
           backup BIFT for BFER D. 
           BE-BFER = H in the row indicates that BFER D is protected against 
           the failure of D by backup BFER H.
           BFR C clears bit 1 in Packet's BitString 
           and sets bit 4 (i.e., the bit for BE-BFER = H) 
           in Packet's BitString to one since SC = 1. 
           The BitString in Packet is 01110 now.
           BFR C copies, updates the BitString by ANDing it with
           F-BM (which is 01001) and sends the packet copy with 
           BitString = 01000 to
           BFR-NBR H in the entry.</t>

        <t>After sending the packet to H, 
           BFR C updates the original packet by ANDing its BitString 
           with the
           INVERSE of the F-BM in the first row. 
           The updated BitString = 00110,
           which is 01110 &amp; ~F-BM in the row 
           = 01110 &amp; 10110 = 00110.</t>

       
        <t>For the packet containing BitString = 00110, 
           the rightmost one bit in BitString is bit 2.
           For BFER 2 (0:00010) (i.e., BFR F as BFER), 
           BFR C gets the 2nd row (i.e., forwarding entry) in the 
           backup BIFT for BFER D. 
           The next hop BFR-NBR is F in the row.
           BFR C copies, updates and sends the packet to F.</t>

        <t>The packet sent to F contains the updated 
           BitString = 00110, 
           which is 00110 &amp; F-BM in the 2nd row = 00110 &amp; 00110
           = 00110.</t>

        <t>After sending the packet to F, 
           BFR C updates the original packet by ANDing its BitString 
           with the
           INVERSE of the F-BM in the 2nd row. 
           The updated BitString = 00000,
           which is 00110 &amp; ~F-BM in the row = 00110 &amp; 11001 = 00000.</t>
<!--
       <t>For the packet containing BitString = 01000, 
           the rightmost one bit in BitString is bit 4.
           For BFER 4 (0:01000) (i.e., BFR H as BFER), 
           BFR C gets the 4-th row (i.e., forwarding entry) in the 
           backup BIFT for BFER D. 
           BE-BFER = 0 and the next hop BFR-NBR is H in the row.
           BFR C copies, updates and sends the packet to H.
           The packet sent to H contains BitString = 01000.</t>

        <t>After sending the packet to H, 
           BFR C updates the original packet by ANDing its BitString with
           the INVERSE of the F-BM in the 4-th row. 
           The updated BitString = 00000,
           which is 01000 &amp; ~F-BM in the row = 01000 &amp; 10111 
           = 00000.</t>
-->
        <t>The updated packet has BitString without any one bit.
           BFR C finishes forwarding the packet to F 
           and H (backup for D). 
           BFR F will sends the packet to E.</t>

      </section> <!-- Forwarding using EP-BIFT -->

    </section> <!-- Example Application of BIER EP -->


    <section anchor="Security" title="Security Considerations">
      <t>TBD.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>No requirements for IANA.</t>
    </section>


    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank Jeffrey Zhang, Jingrong Xie
      for their comments to this work.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.5286"?>
      <?rfc include="reference.RFC.5714"?>
      <?rfc include="reference.RFC.5880"?>
      <?rfc include="reference.RFC.8174"?>
      <?rfc include="reference.RFC.8279"?>
      <?rfc include="reference.RFC.8556"?>
      <?rfc include="reference.RFC.7490"?>

      <?rfc include="reference.RFC.5250"?>
      <?rfc include="reference.RFC.5226"?>
      <?rfc include="reference.RFC.7356"?>
      <?rfc include="reference.RFC.7684"?>
      <?rfc include="reference.RFC.7770"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.8296"?>
      <?rfc include="reference.RFC.8401"?>
      <?rfc include="reference.RFC.8444"?>
      <?rfc include="reference.RFC.7431"?>
      <?rfc include="reference.I-D.ietf-rtgwg-segment-routing-ti-lfa"?>
      <?rfc include="reference.I-D.ietf-spring-segment-protection-sr-te-paths"?>
    </references>

  </back>

</rfc>
