<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7431.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
<!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
<!ENTITY RFC5226 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5226.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<?rfc iprnotified="no" ?>
<!-- Change to "yes" if someone has disclosed IPR for the draft -->
<!-- end of list of popular I-D processing instructions -->

<rfc ipr="trust200902" docName="draft-eckert-bier-te-frr-00" category="std">
        <front>
                <title abbrev="BIER-TE FRR">Fast ReRoute (FRR) Extensions for BIER-TE</title>
                <author fullname="Toerless Eckert" initials="T.T.E." surname="Eckert">
                        <organization>Cisco Systems, Inc.</organization>
                        <address>
                                <email>eckert@cisco.com</email>
                        </address>
                </author>
                <author fullname="Gregory Cauchie" initials="G.C." surname="Cauchie">
                        <organization>Bouygues Telecom</organization>
                        <address>
                                <email>GCAUCHIE@bouyguestelecom.fr</email>
                        </address>
                </author>
                <author fullname="Wolfgang Braun" initials="W.B." surname="Braun">
                        <organization>University of Tuebingen</organization>
                        <address>
                                <email>wolfgang.braun@uni-tuebingen.de</email>
                        </address>
                </author>
                <author fullname="Michael Menth" initials="M.M." surname="Menth">
                        <organization>University of Tuebingen</organization>
                        <address>
                                <email>menth@uni-tuebingen.de</email>
                        </address>
                </author>
                <date day="8" month="July" year="2016"/>
                <abstract>
<t>
  This document proposes an Fast ReRoute (FRR) extension to the BIER-TE
  Architecture <xref target="I-D.eckert-bier-te-arch"/>.  The FRR procedure
  has to be supported by the BIER-TE Controller host and the BFRs that are
  attached to a link/adjacency for which FRR support is required.  Thus, the
  FRR concept can be incrementally deployed in the data plane to only those BFR
  adjacent to adjacencies for which FRR protection is desired.
</t>

<t>
  The FRR procedure does not require changes to the packet format described in
  <xref target="I-D.ietf-bier-architecture"/> that is also used for BIER-TE.
  Existing BIER-TE tables do not have to be altered. FRR procedures do require
  additional forwarding plane logic on the BFR that need to support FRR.
</t>

<t>
  An additional table is needed that carries information about pre-computed
  backup paths. This table is used to modify upon detection of failure
  the bitstring in the BIER header. To prevent packet duplicates, tunneling
  mechanisms such as remote adjacencies or BIER-in-BIER encapsulation can be
  leveraged.
</t>
                </abstract>
        </front>

<middle>

  <section anchor="intro" title="Introduction">

<t>FRR is an optional procedure. To leverage it, the BIER-TE controller host
and BFRs need to support it. It does not have to be supported on all BFRs, but
only those that are attached to a link/adjacency for which FRR support is
required.</t>

<t>If BIER-TE FRR is supported by the BIER-TE controller host, then it needs
to calculate the desired backup paths for link and/or node failures in the
BIER-TE domain and download this information into the BIER-TE Adjacency FRR
Table (BTAFT) of the BFRs. The BTAFT then drives FRR operations in the BIER-TE
forwarding plane of that BFR.</t>

<t>The FRR operations modify the BIER header to facilitate local bypass of
failed elements.  In general, the backup is encoded in the bitstring of the
packet.  To avoid duplicates, it may be necessary to reset some bits in the
bitstring or to use tunneling to the next-hops and next-next-hops of the
multicast tree.  Link and node failures can be addressed by the FRR
mechanism.</t>

<t>Note that BIER-TE FRR does not require additional state depending on the
multicast trees in the network but only depends on the network topology.</t>

<t>FRR is an optional procedure because it does require additional control plane,
and forwarding plane and not all BIER-TE networks may want to use it. Alternatives
to FRR include the following:</t>

<t>"Live-Live" - transmitting the same traffic twice across two BIER-TE engineered diverse paths.
Live-Live is popular in deployments where actual receiver equipment can already
deal with dual reception (eg: SMPTE ST 2022-7 seamless protection switching in video
system). Likewise, MoFRR (Multicast only Fast Reroute, <xref target="RFC7431">RFC 7431</xref>)
could be used on BFER to merge traffic from two TE engineered diverse paths for receivers
that can not deal with dual-reception.</t>

<t>BFIR FRR: Because BIER-TE is stateless, it is feasible to consider simply changing
the bitstring on a BFIR upon detection of a failure. Such an approach would require
fast propagation of detected failures, pre-calculation or fast-inline-calculation of
the modified bitstrings and then quickly pushing these into the BFIR. Due to the absence
of statelessness in solutions preceeding BIER-TE there are no good data points what
performance could be achieved from such an approach yet in various network/tree setups.</t>

  </section>
  <!-- intro -->


  <section anchor="frrkeyconcepts" title="FRR Key Concepts">

<t>In this section we use the following example to explain the key concepts of
BIER-TE FRR.  The example shows a multicast tree from BFR1 to BFR2, BFR6,
BFR9.  The path to BFR2 is represented by the bits p1, p3 and p4.  The bits
p1, p7, p7 and the bits p2, p8 represent the path towards BFR6 and BFR 9,
respectively. Local_decap bits for all BFR2,BFR6, and BFR9 are also used.</t>
      
<figure><artwork align="left"><![CDATA[
                  BFR1-------+
                   |         |
                   |         |
    p4      p3     v p1      v p2
BFR2<---BFR3<-----BFR4------BFR5
         |         |      p5 |
         |         |         |
      p8 |         v p6      v p8
        BFR6<-----BFR7-----BFR9
           p7    p9  p10
]]></artwork></figure>

<t>First, we consider that the link from P towards F fails.  The failure can
be protected by the backup paths over BFR3->BFR6->BFR7: p3, p8, p9 (BP1) and
BFR5->BFR9->BFR7: p5, p8, p10 (BP2).  The use of backup path BP1 does not
cause duplicates.  Backup path BP2 would cause duplicates because the
local_decap bit for D2 is still set in bitstring at P.  Two options exist to
avoid duplicates.  1. We reset the local_decap bit for D2.  This solution
prevents the duplicate packet.  However, this method can lead to lost packets
in other examples.  2.  We use a tunnel from P to F over D2 to prevent BIER
packet processing at the nodes at the backup path.  Tunnels can be implemented
in two different ways.
<list style="numbers">
  <t> A remote adjacency represented by a single bit which is a tunnel in
  the routing underlay.  For an MPLS routing underlay, this can be implemented
  using an MPLS label stack. In the example we would introduce an additional
  bit (eg: p11) representing the tunnel.</t>
  <t> BIER-in-BIER encapsulation using an additional BIER header with
  NextProto = BIER.  BFRs need to support this feature.  This methods does not
  require additional bits for remote adjacencies compared to remote
  adjacencies but it increases the size of the packet header.  In this example
  the new bitstring contains the bits of BP2 and an additional local_decap bit
  for BFR7.</t>
</list>
</t>

<t>Now, we consider that BFR7 fails.  The backup path must send the packets to
all downstream next next-hops (DS-NNHs), i.e. the next-hops of the sub-tree
rooted of BFR7.  BFR4 can identify the DS-NNHs by checking the bits of
interest of the failed node BFR7.  BFR6 is such a node because bit p7 is set.
BFR9 is not downstream because there is no bit of interest from BFR7 to BFR9.
Sending packets to BFR9 would causes duplicates because BFR9 is served using
the branch BFR1->BFR5->BFR9.</t>

<t>Protection against link failures only requires knowledge of the failed
adjacency.  Protection against node failures requires additional knowledge of
the downstream nodes of the tree.  The computation of appropriate backup
paths, AddBitmasks, ResetBitmasks, and BitPositions is outside of the scope of
this document.</t>

  </section>
  <!-- frrkeyconcepts -->

    <section anchor="btaft" title="The BIER-TE Adjacency FRR Table (BTAFT)">

<t>The BIER-TE IF FRR Table exists in every BFR that is supporting BIER-TE
FRR.  It is indexed by FRR Adjacency Index that is compromised of the SI and
the adjacency.  Associated with each FRR Adjacency Index is the failed
BitPosition (F-BP), Downstream BitPosition (DS-BP), ResetBitmask, and
AddBitmask.  The table can be configured to enable different actions for the
AddBitMask.  Either the table is configured to apply BIER-in-BIER
encapsulation with a new BIER header containing the AddBitmask as new
bitstring or to simply add the bits on the current bitstring.</t>

<figure><artwork align="left"><![CDATA[
---------------------------------------------------------------------
| FRR Adjacency | Failed  | Downstream  | ResetBitmask | AddBitmask |
| Index         | BP      | BP          |              |            |
=====================================================================
| 0:1           | 5       | 5           |  ..0010000   | ..11000000 |
---------------------------------------------------------------------
...
]]></artwork></figure>

<t>An FRR Adjacency is an adjacency that is used in the BIFT of the BFR.  The
BFR has to be able to determine whether the adjacency is up or down in less
than 50msec. An FRR adjacency can be a forward_connected adjacency with fast
L2 link state Up/Down state notifications or a forward_connected or
forward_routed adjacency with a fast aliveness mechanism such as BFD.  Details
of those mechanism are outside the scope of this architecture.</t>

<t>The FRR Adjacency Index is the index that would be indicated on the fast
Up/Down notifications to the BIER-TE forwarding plane and enables the
selection of appropriate ResetBitMasks and AddBitmasks.</t>

<t>The failed BitPosition is the BP in the BIFT in which the FRR Adjacency is
used.  The downstream BitPosition is required to protect against node failures
to identify the downstream adjacency as described in <xref
target="frrkeyconcepts"/>.  The backup path/tree is constructed of the
individual ResetBitmasks and AddBitmasks of the downstream nodes. To protect
against link failures, the DS-BP field is set equally to the F-BP field.</t>

    </section>
    <!-- btaft -->
 
    <section anchor="frr-forwarding" title="FRR in BIER-TE forwarding">

<t> The BIER-TE forwarding plane receives fast Up/Down notifications of BIER
adjacencies which are used to with the FRR Adjacencies Index for different
SIs.  From the failed BitPosition in the BTAFT entry, it remembers which BPs are
currently affected (have a down adjacency).</t>

<t> When a packet is received, BIER-TE forwarding checks if it has affected
failed BPs and matching downstream BitPositions to which it would forward.  If
it does, it will remove the ResetBitmask bits from the packets BitString.
Dependent on the table configuration it will either add the AddBitmask bits to
the packets BitString or construct a new BIER header for rerouted packets.
Note that the original packet must be still available for non-affected
bitpositions.</t>

<t>Afterwards, normal BIER-TE forwarding occurs, taking the modified BitString
or the additional BIER header into account.  Note that the information is
pre-computed by the controller and the BFR immediately bypasses a failure
after its detection.</t>

    </section>
    <!-- frr-forwarding -->

    <section anchor="frr-controller" title="FRR in the BIER-TE Controller Host">

<t>The basic rules how the BIER-TE controller host would calculate
ResetBitMask and AddBitmask are as follows:</t>

<t><list style="numbers">
  <t>The BIER-TE controller has to decide which tunnel mode a BFR uses for the
  BTAFT: remote adjacencies or BIER-in-BIER tunneling.</t>

  <t>The BIER-TE controller host has to determine whether a
  failure of the adjacency should be taken to indicate link or
  node failure. This is a policy decision.</t>
  
  <t>The ResetBitmask has the BitPosition of the failed adjacency.</t>
  
  <t>In the case of link protection, the AddBitmask are the segments forming a
  path from the BFR over to the BFR on the other end of the failed link.  The
  path can be formed using remote adjacencies for tunneling purposes. </t>
  
  <t>In the case of node protection, the AddBitmask are the segments
  forming a tree from the BFR over to all necessary BFR downstream
  of the (assumed to be failed) BFR across the failed adjacency.</t>
  
  <t>The ResetBitmask is extended with those segments that could
  lead to duplicate packets if the AddBitmask is added to
  possible BitStrings of packets using the failing BitPosition.</t>
  </list></t>

  </section>
  <!-- frr-controller -->

  <section anchor="frr-benefits" title="BIER-TE FRR Benefits">


<t>Compared to other FRR solutions, such as RSVP-TE/P2MP FRR, BIER-TE
FRR has two key distinctions</t>

<t><list style="symbols">
  <t>It maintains the goal of BIER-TE not to establish in-network
  per multicast traffic flow state. For that reason, the backup
  path/trees are only tied to the topology but not to individual
  distribution trees.</t>
  
  <t>For the case of node failure, it allows to build a path engineered
  backup tree (4.) as opposed to only a set of p2p backup tunnels.</t>
  <t>BIER-in-BIER encapsulation enables backup tunnels in networks that do not
  provide a routing layer with tunneling capabilities.  It may simplify
  network management because additional tunnels (such as GRE) must not be
  setup in the routing layer beforehand.</t>
</list></t>

  </section>
  <!-- frr-controller -->


  <section anchor="pseudocode" title="Adjustment to the BIER-TE Forwarding Pseudocode">

<t>We augment the forwarding procedure presented in the BIER-TE draft to support FRR.</t>

<t>The following procedure computes the Reset- and AddBitmaks when a adjacency
up/down notification is triggered.  The masks can later be directly applied to
the header to facilitate the backup.</t>

<figure> <artwork align="left"><![CDATA[
   global ResetBitMaskByBT[BitStringLength]
   global AddBitMaskByBT[BitStringLength]
   global FRRaffectedBP

   void FrrUpDown(FrrAdjacencyIndex, UpDown)
   {
       global FRRAdjacenciesDown
       local Idx = FrrAdjacencyIndex

       if (UpDown == Up)
           FRRAdjacenciesDown &= ~ 2<<(FrrAdjacencyIndex-1)
       else
           FRRAdjacenciesDown |=   2<<(FrrAdjacencyIndex-1)

       for (Index = GetFirstBitPosition(FRRAdjacenciesDown); Index ;
           Index = GetNextBitPosition(FRRAdjacenciesDown, Index))

           local BP = BTAFT[Index].BitPosition
           FRRaffectedBP |= 2<<(Index)
           ResetBitMaskByBT[BP] |= BTAFT[Index].ResetBitMask
           AddBitMaskByBT[BP]   |= BTAFT[Index].AddBitMask
   }
]]></artwork></figure>

<t>The ForwardBierTePacket procedure must be modified by applying the FRR
operations when necessary.</t>

<figure> <artwork align="left"><![CDATA[
   void ForwardBierTePacket (Packet)
   {
       // We calculate in BitMask the subset of BPs of the BitString
       // for which we have adjacencies. This is purely an
       // optimization to avoid to replicate for every BP
       // set in BitString only to discover that for most of them,
       // the BIFT has no adjacency.

       local BitMask = Packet->BitString
       Packet->BitString &= ~MyBitsOfInterest
       BitMask &= MyBitsOfInterest

       // FRR Operations
       // Note: this algorithm is not optimal yet for ECMP cases
       // it performs FRR replacement for all candidate ECMP paths

       local MyFRRBP = BitMask & FRRaffectedBP
       for (BP = GetFirstBitPosition(MyFRRNP); BP ;
            BP = GetNextBitPosition(MyFRRNP, BP))
           BitMask &= ~ResetBitMaskByBT[BP]
           BitMask |=  ResetBitMaskByBT[BP]

       // Replication
       for (Index = GetFirstBitPosition(BitMask); Index ;
            Index = GetNextBitPosition(BitMask, Index))
           foreach adjacency BIFT[Index] 

               if(adjacency == ECMP(ListOfAdjacencies, seed) )
                   I = ECMP_hash(sizeof(ListOfAdjacencies),
                                 Packet->Entropy, seed)
                   adjacency = ListOfAdjacencies[I]

               PacketCopy = Copy(Packet)

               switch(adjacency)
                   case forward_connected(interface,neighbor,DNR):
                       if(DNR)
                           PacketCopy->BitString |= 2<<(Index-1)
                       SendToL2Unicast(PacketCopy,interface,neighbor)

                   case forward_routed([VRF],neighbor):
                       SendToL3(PacketCopy,[VRF,]l3-neighbor)

                   case local_decap([VRF],neighbor):
                       DecapBierHeader(PacketCopy)
                       PassTo(PacketCopy,[VRF,]Packet->NextProto)
   }
]]></artwork></figure>

  </section>
  <!-- pseudocode -->


  <section anchor="eFRR" title="BIER-TE and existing FRR">

<t>BIER-TE as described above is an advanced method for node-protection where
the replication in a failed node is on the fly replaced by another replication
tree through bit operations on the BitString.</t>

<t>If BIER-TE FRR is not feasible or necessary, it is also possible for BIER-TE
to leverage any existing form of "link" protection. For example: instead of
directly setting up a forward_connected adjacency to a next-hop neighbor, this can
be a "protected" adjacency that is maintained by RSVP-TE (or another FRR mechanism)
and passes via a backup path if the link fails.</t>

<t>BIER-in-BIER encapsulation provides P2MP protection in node failure cases
because the new header can contain a new multicast.  This allows for the least
packet duplication if the routing underlay does not provide P2MP tunnels.</t>

  </section>
  <!-- eFRR -->

  <section anchor="iana" title="IANA Considerations">

<t>This document requests no action by IANA. </t>

  </section>
  <!-- iana -->

  <section anchor="ack" title="Acknowledgements">

  <t>The authors would like to thank Greg Shepherd, Ijsbrand Wijnands and Neale Ranns for their extensive review and suggestions.</t>
  </section>
  <!-- ack -->

  <section anchor="changes" title="Change log [RFC Editor: Please remove]">
  <t>
    <list>
      <t>00: Initial version based on draft-eckert-bier-arch-03.</t>
    </list>
  </t>
  </section>
  <!-- changes -->

</middle>

<back>
<references title="References">
      &RFC2119;

      <?rfc include="reference.I-D.ietf-bier-architecture"?>

      <?rfc include="reference.I-D.eckert-bier-te-arch"?>
      <!---->
</references>

</back>
</rfc>
