<?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-anycast-label-01"
     ipr="trust200902">
  <front>
    <title abbrev="BIER Anycast MPLS Label">BIER Anycast MPLS Label</title>

    <author fullname="Siyu Chen" initials="S." surname="Chen">
      <organization>Huawei Technologies</organization>

      <address>
        <email>chensiyu27@huawei.com</email>
      </address>
    </author>
    
    <author fullname="Fanghong Duan" initials="F." surname="Duan">
      <organization>Huawei Technologies</organization>

      <address>
        <email>duanfanghong@huawei.com</email>
      </address>
    </author>

    <date day="16" month="Mar" year="2024"/>

    <abstract>
      <t>This document provides a method to reduce packet loss when failures
      occur at BIER transit or egress nodes or link.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP 14
      <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>When failures occur at transit or egress BIER node, there is no fast
      recovery or protecting mechanism currently. The recovery duration depends
      on how fast the unicast algorithm can re-calculate the new path. The new
      available path can only be generated in this way called 'IGP re-convergence'.
      In this document, a fast failover method is designed for BIER to generate
      an alternative path for flow in advance by allocating and transmitting
      additional BIER MPLS label for certain network topology.
      </t>

      <t>As shown in the following figure, two BFRs are deployed in each site. Each
	  BFR can be backup device for the other BFR within the site. CE is connected to
      only one of the BFERs.
      </t>
        <t><figure align="middle" title="BIER Network Topology">
            <artwork><![CDATA[ 
                Site1          Site2              Site3
                 ....  ---- BFR-E(ID:4) ---- BFER-C(ID:3)         
                   |\          /| \             /   |         
                   |  \      /  |   \         /     |         
                   |    \  /    |     \     /       |  
                   |     \/     |       \ /         |                      
                   |    /  \    |       /  \        |         
                   |   /    \   |     /      \      |
                   | /        \ |   /          \    |                
        SRC -- BFIR-A(ID:1) -- BFR-B ------- BFER-D(ID:2) -- CE -- RECEIVER                                                        
           ]]></artwork></figure></t>
      
      <t>In <xref target="RFC8279"/>, BIER MPLS label was assigned locally to
      identify different set of [Sub-domain, SI, BSL] and therefore can identify
      different instances of BIER Forwarding Table. In this document, a BFR node
      will be assigned two MPLS Labels called 'Anycast' and 'Bypass' MPLS Label.
      Anycast MPLS Label will be used to represent the site, while bypass MPLS label
      will only be used within each site to ensure the forwarding function. The BIER
	  Forwarding Table will also be modified to record two different out interfaces
	  for two target BFR-IDs.</t>
      
    </section>

    <section title="Terminology">
      <t>The terminology used in this document is the terminology defined
      in<xref target="RFC8279"/>, <xref target="RFC8296"/> and <xref
      target="RFC8556"/>.</t>

      <t>For convenience of description, the abbreviations used in this
      document is listed below.</t>

      <t><list style="empty">
          <t>BIER: Bit Index Explicit Replication</t>

          <t>BGP: Border Gateway Protocol</t>

          <t>IGP: Interior gateway protocol</t>

          <t>BFR: Bit-Forwarding Router</t>

          <t>BFR-ID: Bit-Forwarding Router ID</t>

          <t>BFR-Prefix: Bit-Forwarding Router Prefix</t>
          
          <t>BFR-NBR: Bit-Forwarding Router Neighbor</t>

          <t>BIRT: Bit index routing table</t>

          <t>BIFT: Bit index forwarding table</t>
          
          <t>F-BM: Forwarding Bit Mask</t>
          
          <t>MPLS: Multiprotocol Label Switching</t>
        </list></t>
    </section>

    <section title="Egress Protection">
      <section title="Anycast and Bypass MPLS Label">
        <t>As shown in the following figure, one customer device CE is connected 
        to BFER-D. Each site deploys two BFRs to perform failure protection, different BFR-IDs
        and BFR-prefixes are configured. In this way, when CE sends join towards BFER-D, the source
		and BFIR can clearly know where the receiver is. Specially, BFRs in one site are assigned with
		same Anycast MPLS Label and different Bypass MPLS labels. The same Anycast Label can be used to
		specify the site. The Bypass MPLS Label works as the traditional MPLS label to ensure the normal
		behavior of BIER forwarding function within the site. The relationship between [SD, BSL, SI],
		Anycast Label, Bypass Label will be maintained and utilized when parsing BIER packets.
		Anycast and Bypass MPLS Labels are then advertised by BIER-Info Sub-TLV in BIER prefix. After each
		BFR receives BIER prefix, BIER MPLS Label will be contained in BIER Forwarding Table to instruct
		forwarding data packet. </t>
        <t><figure align="middle" title="BIER Network Topology with BFR-ID">
            <artwork><![CDATA[ 
                Site1         Site2           Site3
                 .... ----  BFR-E(1000) --- BFER-C(0100)
                   |\          /|  \          /  |         
                   |  \      /  |    \      /    |         
                   |    \  /    |      \  /      |  
                   |     \/     |       \/       |                      
                   |    /  \    |      /  \      |         
                   |   /    \   |    /      \    |
                   | /        \ |  /          \  |                
         SRC -- BFIR-A(0001) -- BFR-B ---- BFER-D(0010) --- CE                                                         
         ]]></artwork></figure></t>
      </section>

      <section title="Advertisement of MPLS Label">
        <t><xref target="RFC8401"/> defines BIER Info Sub-TLV to advertise BIER parameters
        such as BFR-ID, subdomain-id. The key field of the Sub-TLV is BIER prefix. Within the Sub-TLV,
        sub-sub-TLV is contained and it carries MAX-SI, BSL and MPLS Label. The sub-sub-TLV
        is modified in this document so that both Anycast and Bypass MPLS Labels can be advertised.</t>
        <t><figure align="middle" title="New BIER Info Sub-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       |   Length      |
	  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	  |   Max SI      |  BSL  |           (Bypass) Label              |
	  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	  |    Type       |   Length      |
	  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
	  |   Max SI      |  BSL  |            Anycast Label              |
	  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork></figure></t>
                  </section>


      <section title="Establishment of BIER Forwarding Table">
        <t>After receiving BIER Info Sub-TLV, BFR will parse Bypass MPLS Label and Anycast
        MPLS Label. The relationship of [BFR-ID, Anycast Label, Bypass Label] will be maintained
        by each BFR.</t>
		<t>The procedure of establishing BIFT is illustrated from the perspective of BFR-B and the Topology
		is accordingly simplified. As shown in the simplified topology figure below, BFR-B will receive BIER
        Info Sub-TLVs from BFER-C and BFER-D. The Anycast Label of two BFERs are different with BFR-B's,
        but they are same with each other. BFR-B will combine BFR-ID of BFER-C and BFER-D into one entry
        in the Bit Index Forwarding Table. Both BFER-C and BFER-D may receive packet.</t>
        
        <t><figure align="left" title="Simplified Topology from BFR-B's Perspective">
            <artwork><![CDATA[ 
          Site1          Site2      Site3
                     BFR-E(1000) -- BFER-C(0100)
                           |    /     |             
         BFR-A(0001)---  BFR-B ---- BFER-D(0010) ------- CE
            
            ]]></artwork></figure></t>


       <t><figure align="left" title="BFR-B's BIFT">
            <artwork><![CDATA[ 
           BFR-B BIFT
          --------------------------------------
           | F-BM  | BFR-NBR | NBR-Label       | 
          =====================================
           | 0001  |    A    |  AnycastLabel-1 |
          -------------------------------------
           | 0110  |    D    |  AnycastLabel-3 |
          -------------------------------------
                   |    C    |  AnycastLabel-3 |
          -------------------------------------
           | 1000  |    E    |  BypassLabel-21 |
          -------------------------------------
       ]]></artwork></figure></t>
        <t>When BFR-B receives BIER data packet, it will locate the BIFT according to the BIFT-ID encapsulted
        in BIER header. If the packet needs to be forwarded to BFR-ID 2, it will modify the BIFT-ID field
        as AnycastLabel-3 and then forward it. When BFER-D receives this packet, it will send the packet to CE.
        </t>

        <t>BFERs will also advertise their BIER Info Sub-TLV to each other. When BFER-C receives BFER-D's
        Sub-sub-TLV, it finds BFER-D has same anycast label and different bypass label with itself. BFER-C will encode
		Bypass MPLS label into its BIFT as shown below.</t>
        <t><figure align="middle" title="BFR-C's BIFT">
            <artwork><![CDATA[ 
           BFR-C BIFT
          --------------------------------------
           | F-BM  | BFR-NBR |   NBR-Label     | 
          =====================================
           | 0010  |   D     |  BypassLabel-32 |
          -------------------------------------
           | 1001  |   E     |  AnycastLabel-2 |
          -------------------------------------
                   |   B     |  AnycastLabel-2 |
          -------------------------------------
       ]]></artwork></figure></t>
      </section>
      <section title="Fast Recovery">
      <t>When link between BFR-B and BFER-D goes down due to certain reason, BFR-B will detect it and forward
      packet to BFER-C immediately according to BIFT entry. AnycastLabel-3 will be encapsulated. When BFER-C receives
      this packet, it will firstly use anycast label to locate corresponding BIFT table. Then it will use BFR-ID 2 to
      look for F-BM and find its neighbor is BFER-D. The Bypass label of BFER-D will be encapsulated into data packet
      header. Then BFER-D will finally receive the packet and forward it to CE. No packet will be dropped because the
      backup out interface has been generated when the anycast and bypass MPLS Labels are advertised and utilized.</t>
      
      <t>In this way, reliance on unicast routing re-convergence after failure are minimized. It is also compatible with
	  existed BIER protocol and signals such as BIER Info sub-TLV. This method is also friendly to hardware platform. BIER
	  forwarding procedures actually are not modified.</t>
      <t/>
      </section>
    </section>
    

    <section title="Security Considerations">
      <t>//TODO</t>

      <t/>
    </section>

    <section title="IANA Considerations">
      <t>//TODO</t>
    </section>

    <section title="Acknowledgements">
      <t>//TODO</t>

      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.RFC.2119'?>

      <?rfc include='reference.RFC.8279'?>

      <?rfc include='reference.RFC.8296'?>

      <?rfc include='reference.RFC.8401'?>
      
      <?rfc include='reference.RFC.8556'?>
      
      <?rfc include='reference.RFC.8174'?>
    </references>
  </back>
</rfc>
