## 4 Proposed Routing Scheme
### Distributed Detour Routing Scheme
Thus, the recovered node sends a link recovery message and deletes the information from all detour tables that were established while detouring the previously failed link. Sharing a link recovery message can result in excessive communication overhead. To mitigate this problem, we defined the link recovery process using a distributed detour routing scheme. The process of sending a link recovery message is executed using the same procedure as that used for constructing the pre-detour path in the distributed detour routing scheme. The link recovery message includes information about the failed link and the destination information of the original packet. The node compares the destination and failed link information stored in the detour table and deletes this information from the detour table. For rapid detour routing, the link recovery process sends a recovery message in the same direction as that calculated using Algorithm 1. After receiving the recovery message, nodes update their detour tables to revert to their original paths. The pre-detour path is composed of both rapid detour routing and selective flooding paths. The link recovery process is performed in the same manner as in rapid detour routing for selective flooding. The link recovery process involves transmitting messages along a precalculated detour path, thus not requiring additional calculations or iterative operations. Consequently, the time complexity is \(O(n)\), determined by the number of hops. ### Loop Avoidance

This section presents techniques to avoid routing loops in distributed routing by utilizing rapid detours and selective flooding instead. Lacking a global view of routing topology often leads to routing loops and significant packet losses in distributed routing. Therefore, it is important to implement a loop avoidance mechanism to circumvent potential loops caused by link failures. The proposed detour algorithm uses only primary and secondary candidate hops in a distributed hop-by-hop routing scheme. We assumed that packets are forwarded along the MHR edge when both candidate directions are unavailable. In this scenario, an alternative direction is utilized. The alternative direction is opposite to the primary direction, as shown in Figure 5(a). Routing looping may occur if the packet returns to its previous transmission path. To prevent looping, packets forwarded in the opposite direction also use a rapid detour to reach their original destination. In Figure 5(a), the yellow node represents the rapid detour point. In case of a rapid detour occurring at a node before the detour point, the packet is sent back to the node where the link failure occurred, which can lead to an infinite loop. Therefore, as depicted in Figure 5(a), the packet utilizes both alternative and secondary directions (each once for forwarding). The packet then breaks out of the loop and is transmitted to its destination. As shown in Figure 5(b), the packet returns to the corner of MHR. MHR corner ISLs have only primary and secondary directions. If the packet is forwarded outside the MHR of the original packet, additional communication overhead will occur to create a pre-detour path. To minimize communication overhead and escape the loop, a pre-detour path should be established within the MHR region. Unlike the cases in Figure 5(a),b, the packet is transmitted twice in the secondary direction. After transmitting through two hops in the secondary direction, the next forwarding direction is determined based on the rapid detour. Figure 5(b) shows the packet path in the Northern Hemisphere. In the Southern Hemisphere, the path of the packet also forms the same corner shape at high latitudes. Regardless of the hemisphere, the same loop avoidance strategy is applied. Figure 6: Different loop avoidance strategy by link failure location. As shown in Figure 6c, the packet returns to a source node. Because all available ISLs in the MHR region are not usable, the MHR is extended to allow detours. In Figure 6c, if a link fails in the right direction, the MHR extends toward the left.