# Enhanced Multicast Repair Fast Reroute Mechanism for Smart Sensors IoT and Network Infrastructure
## 5 Enhancements for M-Rep
### Multiple Failures  
So far, we have dealt with the failure of a single link or router at a time. In critical situations, multiple failures may occur at the same time (Figure 7). This situation is an issue for the M-REP mechanism because it is not able to find an alternative route, although an alternative path exists. Nevertheless, it should be noted, that most of FRR mechanisms analyzed are not able to solve this situation of multiple failures at the given time. Their principles simply do not allow for the correction of multiple failures. To solve this problem, we propose an extension of the M-REP mechanism, which is called the Swap method. To explain its principle better, we can divide the method into three separate steps. We were inspired by the Multiprotocol Label Switching (MPLS) technology and its functions: Push, Swap and Pop. The step definitions are as follows:  
* Push is defined as the encapsulation of an M-REP packet;
* Swap is defined as the replacement of a multicast M-REP address by another one;
* Pop is defined as the decapsulation of M-REP packets, i.e., the decapsulation of original unicast flow from the multicast M-REP packets. The principle of the EM-REP mechanism in the event of a single failure is unchanged compared to the original design. If another failure occurs at a different time to the original failure, the method Swap shall be used. This interpretation implies that the used M-REP multicast address (after the first failure at time t) will be in the event of a further failure (at time t + x, where x is the time difference between the first and second failure) replaced by another predefined multicast address. However, this behavior is not efficient and can be optimized further. This implies the following behavior. A router that detects a new connection failure on already used M-REP backup path of a particular multicast flow will replace the multicast destination address of the existing M-REP header with another  
Figure 7: M-REP: reroute in the event of multiple failures. multicast address. That is, a router detecting a new failure on the original M-REP backup path becomes the next local repair point, the router S. This will force the router to start a new flooding process but using a different multicast address for the M-REP flow. This behavior is shown in Figure 8. The primary path for delivering unicast packets from Source to Destination is through R1 \(\rightarrow\) R2 \(\rightarrow\) R5 \(\rightarrow\) D (red arrows). Router R2, which has detected at time \(t\) the first link failure on the primary path, becomes the router S (Figure 8a, mark 1). Next, router S (R2) begins to encapsulate the protected unicast flow to a specific M-REP multicast flow identified by (S, G) pair, and initiates the flooding process in the topology (Figure 8a, mark 2). Routers that use PIM-DM with modified RPF control, receive multicast traffic (the first-arrival rule) and create an alternative M-REP pathway. The path goes through R2 (S) \(\rightarrow\) R4 \(\rightarrow\) D. Routers on interfaces that do not have receivers for the M-REP multicast flow or receive multicast traffic as the second ones are pruned using Prune messages. At time t + x, router R4 has detected a second network failure (Figure 8b, mark 3), which occurred on the link through which the alternative M-REP route (S, G) leads. R4 becomes the next source router S2. R4 router replaces the destination multicast address of the original (S, G) multicast flow with the new destination multicast address (S, G + 1). Next, the flooding process in the network starts again (Figure 8b, mark 4). As a result, the new alternative M-REP path is created for the multicast flow (S, G + 1). The path goes through R4 (S2) \(\rightarrow\) R5 \(\rightarrow\) D (Figure 8b, mark 5). The whole resulting alternative M-REP path will go through R2 (S) \(\rightarrow\) R4 (S2) \(\rightarrow\) R5 \(\rightarrow\) D. The part between R2 (S) \(\rightarrow\) R4 (S2) was constructed as the multicast distribution tree for the (S, G) flow.