# A New Bit Repair Fast Reroute Mechanism for Smart Sensors IoT Network Infrastructure
## 3 The Proposal of the B-REP FRR Mechanism
Because all routers have the same LSDB databases that contain all topological information, including all routers, each B-REP router will assign a unique B-REP R-ID to itself as well as to all other routers in the area. As the next step, the router specifies corresponding bit-string values for each area router. This information is stored, and operations are performed inside of the B-REP Table (Table 3). The table is created by each B-REP router when the B-REP is activated and finally it will be the same on each router. The table is constructed by sorting all routers of the given area according to their OSPF router IDs ascending. Then the B-REP algorithm assigns them unique B-REP IDs and positions in the bit-string (Table 3). Because the LSDB is the same on all routers, the final B-REP table will be the same too. In case of a network failure, the content of the B-REP table is frozen because it is used to construct an alternative reroute path. When the convergence of the OSPF protocol ends, the process of creating the B-REP table is performed again, i.e., each B-REP router refreshes its own B-REP table. As we can see from the example, the router with the lowest OSPF Router ID is Router 1. Its OSPF router ID is 1.1.1.1, therefore, it gets B-REP R-ID of 1. That gives R1 the least significant bit (LSB) position in the bit-string (... 00001, Table 3, Figure 6). The Router 2, which is the second with the OSPF Router-ID 2.2.2.2 gets B-REP R-ID of 2 and the second position in bit-string (... 00010, Table 3, Figure 6). The basic idea of FRR mechanisms is to calculate an alternative route to bypass the local router's failure in advance. The B-REP mechanism maintains this idea, as it also preliminary calculates an alternative route. Calculating an alternate route beforehand ensures that the routing engine of the  
Figure 6: Allocation of Bit-Strings by the Router ID. \begin{table}
\begin{tabular}{l 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 &... 10000 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: B-REP Table—Bit allocation according to Bit-String. router is able to quickly install and use the alternative route in the event of an error. Each B-REP-enabled router calculates alternative paths based on the protected link. In FRR terminology, the protected link is a link against whose failure (or by the failure of a directly connected neighbor) the network wants to be preserved. By default, the protected link in B-REP is set manually by an administrator. Next, based on the settings, B-REP calculates alternative paths to all destinations of protected flows routed over the protected link in order to decrease the impact of the link failure. For the simulation purposes, we expect one flow and one destination. An alternative route is then used in the event of a protected link or its neighboring router failure. The B-REP mechanism uses [PERSON]'s algorithm to calculate an alternative path for each given destination by setting the protected link to a metric with a value at infinity. When the router detects a connection failure with the primary next-hop router for a specific destination, it becomes the S router. The destination of an alternate path in terms of reroute scheme is the D router. In the considered case, it is Router 3 (Figure 7). The path from the router S to the router D must bypass the local failure detected by router S.  
In the case of a link failure and specific protected flow of the customer, the router S already has a pre-calculated alternative path that contains all routers on the path including the destination router D. Following the failure protection procedures, the router S encapsulates packets of the original unicast protected flow with a new BIER header.