# Adaptive Power-Controlled Depth-Based Routing Protocol for Underwater Wireless Sensor Networks
## 3 The Proposed Protocol
### Detailed Design of APCDBRP
#### 3.3.3 Data Protection and Route Reconstruction Mechanism  
Due to the mobility of nodes, data packet forwarding may experience interruptions. To address this situation, we employ a localized-globalized integrated strategy to ensure effective network communication.  
Localized Recovery: Due to node mobility, the optimal next-hop relay for data packet forwarding may change its position before receiving the packet, resulting in a failure to forward the packet.  
When a transmission fails, the node sends a PROBE packet at maximum power. The nodes that receive the PROBE packet will determine if they meet the criteria to become the next hop. If they meet the criteria, then it will reply with a PROBE REPLY packet at maximum power. Upon receiving the PROBE REPLY packet, the node calculates the forwarding factor and updates the routing table. To reduce the propagation delay, the node immediately forwards the failed DATA packet upon receiving the first PROBE REPLY packet. Subsequent DATA packets are forwarded based on the routing table. Figure 6 presents an example of localized recovery. Node N1 forwards Data packets to N2 with power level \(p_{n}\). However, N2 has moved out of the communication range at power level \(p_{n}\), resulting in a transmission failure. Consequently, N1 triggers the Localized Recovery mechanism and sends a PROBE packet at maximum power. Nodes N2, N3, and N4 all receive the PROBE packet. Among them, N4 is located at a depth greater than N1, so it does not send PROBE REPLY packets to N1 but updates its routing table based on the information in the PROBE packet. Both N2 and N3 send PROBE REPLY packets to N1, and N1 updates its routing table accordingly. Since the PROBE REPLY packet from N2 arrives at N1 first, N1 forwards the data to N2 using the newly calculated power level.  
Additionally, if the probability of a node successfully forwarding a data packet is low, i.e., when p is below a certain threshold, the node needs to send a Probe Packet to update the routing table before forwarding the data packet. If the node does not receive a Probe reply packet, it sets itself as a hole node and sends a Hole Notification packet to request the nodes that receive it to remove itself from their neighbor tables.  
Global Recovery:The sink node determines whether to trigger the global recovery mechanism based on the packet reception rate over a certain period of time.  
Figure 5: Data forwarding example.  
Global recovery refers to the process of route reconstruction, similar to the routing establishment phase described earlier. Due to node mobility, the network topology undergoes changes, and the sink nodes need to assess the impact of these changes and decide whether to trigger the global recovery mechanism. The specific procedure involves the sharing of received data packets among all sink nodes. Within a time period T, the total number of non-repetitive data packets received is recorded and compared with the total number of data packets sent by the source nodes during the same time period. If the ratio falls below a predefined threshold, the global recovery mechanism is triggered.