## 3 Routing Protocol: RFAODV
### Overview of RFAODV
#### 3.2.1 Route Discovery
If not, it indicates that the first path discovery failed. There is a high possibility of routing holes. The node will broadcast RREQ immediately. If yes, the node will judge whether it is in the forwarding area or not. Each node in the forwarding area will start a timer after receiving the RREQ. To alleviate interference and improve the delivery ratio, each node is assigned a different forwarding delay according to its own location, residual energy and communication time. During the timer, if the RREQ forwarded by the neighbor node is monitored, the process of route discovery is abandoned. This ensures that only a few ideal nodes participate in the path discovery of each hop. The delay time can be calculated by Equation (5). \[Tdelay= \begin{cases}2(\frac{R-d}{v}+Tc\times\text{random}(0,\frac{R-d}{v})) \times(2-Eremain/E)&\text{if}(Nq<2)\\ 0&\text{others}\end{cases}  \tag{5}\]  
where \(v\) is the acoustic velocity in the water, \(d\) is the distance between the candidate forwarding node and latest forwarding node, \(Eremain\) is the residual energy of the candidate forwarding node, \(E\) is predefined maximum energy of node, and \(Tc\) is communication time. In order to avoid path discovery failures caused by routing holes, the global broadcast is adopted when the first discovery failure. This improves protocol robustness. 3. The Processing of Node  
When the source node S sends data to the destination node D, node S does not have an available route to the destination node D, and it will start the process of route discovery. The main steps of the Algorithm 1 are as follows. 1. Source node generates and sends a route request packet (RREQ). The RREQ contains the IP address of the source node, the sequence number of the source node, the location coordinates of the source node, the IP address of the destination node, the sequence number of the destination node, the location coordinates of the destination address, the identification number of the RREQ, \(Nq\), the location coordinates of last forwarding node, as shown in Table 2. RREQ packet can be uniquely determined by the address of the source node and the identification number of the RREQ packet, which is used by the node to determine whether the packet has been received repeatedly;
2. The number of RREQ attempts of source node will increase by 1. And node S set a timer to wait for route request packet (RREP);
3. If the RREP is not received after timeout, the route discovery process will be performed again. If the RREP is not received after RREQ_RETRIES attempts, the destination node is considered unreachable. When any node X receives the RREQ, it will operate according to the Algorithm 2. The main steps of the algorithm are as follows. 1. Node X determines whether the RREQ has been received according to the source address and the identification number of the RREQ. If yes, it drops the RREQ. Otherwise go to step (2);
2. Node X establishes or updates the reverse route to the source node S. The destination node in the routing table is the source node. The next hop is the forwarding node of the RREQ. The hop count is the hop count in the RREQ. The sequence number of the destination node is the sequence number of the source address in the RREQ. The routing status is set to valid. Go to step (3);
3. If node X is the destination node of RREQ or has a valid route to the destination node, then return RREP by unicast along the reverse route. Otherwise go to step (4);
4. The node judges whether \(Nq\) is less than 2. If not, it indicates that the first route discovery failed, and the RREQ will be broadcast immediately. Otherwise go to step (5);