# Enhanced Bit Repair IP Fast Reroute Mechanism for Rapid Network Recovery
## 3 The B-REP Mechanism
The LSDB contains complete topology information about all routers in the network and assumes the use of an ID as a unique identifier of the vertices of the network graph representation constructed by the LS protocol. For the sake of clarity and the OSPF protocol used, we assume the following example of B-REP R-ID assignment process. First, the B-REP mechanism reads the OSPF LSDB and loads OSPF router IDs. Then, B-REP ranks all routers in the OSPF routing domain according to their OSPF Routers IDs in ascending order (Figure 7) and starts to assign B-REP R-IDs. The router with the lowest OSPF router ID obtains the first B-REP Router ID (B-REP R-ID = 1). This R-ID will also indicate the first position of the router in the Bit-String value. The router with the highest OSPF router ID will obtain the highest B-REP R-ID. In a network consisting of fifteen routers, the highest B-REP R-ID will be 15. Figure 6: BIER header with a Bit-String. MSB—Most Significant Bit. LSB—Least Significant Bit. For a topology consisting of five routers, as is shown in Figure 7, the final assignment of the B-REP R-IDs and BS mapping may look like the data presented in Table 2.  
After the initiation, the B-REP algorithm proceeds as follows: The algorithm for each of the preconfigured IP addresses and protected interfaces will construct the B-REP Backup Table (B-REP BT). The entry of B-REP table contains the identity of the protected interface; the B-REP R-ID of a destination router (D router), which decapsulates tunneled packets; and the Bit-String value, which exactly specifies the entire backup route from the router (S router) to the destination router. B-REP BT is calculated in the following way: Each B-REP enabled router for each protected interface (metric set to infinity) and specified IP address of a protected flow specifies the destination router D. The D router is selected by using [PERSON]'s algorithm. B-REP then calculates the backup path towards this router using [PERSON]'s algorithm and the local LSDB. Thanks to the use of the LS routing protocol in the backend, the B-REP algorithm is topology-aware. Finally, the B-REP sets the Bit-String value of the backup path. This BS value represents the list of BIER routers traversed from the source S to the destination router D (Table 3) in a hop-by-hop manner. Table 2 shows an example of how the precalculated B-REP Backup paths of the topology example are expressed using BS values. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Router** & **Router ID (OSPF)** & **B-REP R-ID** & **Bit-String Position (B-REP)** \\ \hline Router 1 & 1.1.1.1 & 1 & 00001 (LSB) \\ Router 2 & 2.2.2.2 & 2 & 00010 \\ Router 3 & 3.3.3.3 & 3 & 00100 \\ Router 4 & 4.4.4.4 & 4 & 01000 \\ Router 5 & 5.5.5.5 & 5 & 00000 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: B-REP Table—Bit-String allocation according to B-REP R-ID. Figure 7: Allocation of Bit-String position according to the B-REP Router ID. The backup route is used in the case of protected interface failure. This means that if the router detects a link failure or a neighboring router connected through a protected link becomes unavailable, the router will start using the IP FRR mechanism and its pre-prepared backup plan. The B-REP algorithm starts encapsulating original IP packets using the BIER header. In the header's BS field, the router writes the prepared correct BS value that represents the alternative route from a router that detects the problem (called as S router) towards the D router. By BIER encapsulation and correct BS value, the original packets are virtually tunneled around the failed element. Let us briefly explain the elementary principles of B-REP FRR on a more illustrative example of the topology shown in Figure 8. We have already used the topology to illustrate examples of B-REP tables. Assume that the link between R1/R3 has failed and the protected flow directed towards the destination is therefore affected.