In this protocol, we redefined the policy of selecting the forwarding area and forwarding node. Instead of only using the position information as a forwarding node reference, RFAODV also takes the energy, the link communication status and communication time into account.
RFAODV protocol contains two basic stages: route discovery and route maintenance.
3.2.1. Route Discovery
Figure 3 shows the basic idea of the RFAODV forwarding area, which is called route-focusing. The basic principle of the forwarding region selection algorithm proposed in this paper is to keep the forwarding path around the vector between the source node and the destination node. The nodes marked in black in the figure will not participate in the routing discovery. In addition, within the node transmission range, the longer distance from the previous forwarding node, the more additional coverage can be acquired. It results in more opportunities to reach more nodes, receives fewer hops and obtains less delay. Based on the above principles, it can be seen from
Figure 3 that the optimal forwarding node should be node V. Node V is not only located on the boundary of the transmission distance of the forwarding node of the last hop, but also on the vector of node S and node D. But node V may not actually exist, so we can call it a virtual node. Therefore, setting only one location to participate in forwarding is likely to result in route discovery failure. So, we define the intersection area between the transmission range of node V and the transmission range of the latest forwarding node as the forwarding area. All the nodes in the forwarding area are qualified to forward packets.
Before we give the forwarding area, we need to calculate the position of the virtual node V. We can utilize the location information of source node S, destination node D and last forwarding node F carried in the RREQ to calculate the position of node V. The positions of nodes S, D and F are:
,
,
. We assume that the position of node V is
, which can be obtained by the following Equation (3), where
is the vector between the source node and the destination node,
is the vector between the source node and the forwarding node, and
is the projection point of node F on the routing vector
, as shown in
Figure 4.
Forwarding area is defined as:
- 2.
Forwarding delay of RFAODV
In the RFAODV protocol, all the nodes in the forwarding area are qualified to forward RREQ. When a RREQ is received by a candidate node, the node will first judge whether the number of the RREQ attempts (
Nq) is less than two. 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).
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.
Algorithm 1 Route discovery of the source node |
1. | if the source node S has data sent to the destination node D, then |
2. | if node S has an available route to node D, then |
3. | send data using an existing valid route; |
4. | else |
5. | generate and send RREQ; |
6. | set a timer to wait for RREP; |
7. | Nq + 1; |
8. | if receive RREP before timer expired, then |
9. | turn off this timer; |
10. | establish route; |
11. | send data using this route; |
12. | else if Nq > RREQ_RETRIES, then |
13. | the destination node is considered unreachable; |
14. | else |
15. | the route discovery process will be performed again; |
16. | end if |
17. | end if |
18. | end if |
Table 2.
The structure of the RREQ.
Table 2.
The structure of the RREQ.
Byte | 1 | 2 | 3 | 4 |
---|
Definition | Type | Reserved | Nq | Hop Count |
RREQ ID |
Destination IP Address |
Destination Sequence Number |
Source IP Address |
Source Sequence Number |
Destination Loaction |
Source Loaction |
Last Forwarding Node Loaction |
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);
- (5)
Node X determines whether it is in the forwarding area. And if it is not, the node drops this RREQ directly. Otherwise go to step (6);
- (6)
Determine whether the RREQ needs to continue to find the path through TTL (time to live). If not, drops this RREQ. Otherwise go to step (7);
- (7)
Node X sets a timer according to its position, energy and communication time. If the timer expires, broadcast the updated RREQ. During the waiting period, if the RREQ sent by the neighbor node is received, it indicates that a better node has carried out RREQ forwarding, and this process of route discovery is abandoned.
Algorithm 2 RREQ processing of any node |
1. | if the RREQ is received for the first time, then |
2. | establish or update the reverse route to the source node S; |
3. | if node X is the destination node of RREQ or has a valid route to the destination node, then |
4. | send RREP; |
5. | else if Nq < 2, then |
6. | if in the forwarding area and TTL > 1, then// Obtain the forwarding area using Equation (3) |
7. | set delay timer; // Obtain the delay using Equation (5) if receive RREQ forwarded by another node before timer expired, then |
8. | drop this RREQ; |
9. | else |
10. | broadcast this RREQ; |
11. | end if |
12. | else |
13. | drop this RREQ; |
14. | end if |
15. | else |
16. | broadcast this RREQ; |
17. | end if |
18. | else |
19. | drop this RREQ; |
20. | end if |
Node Y is any node and operates after receiving RREP according to the Algorithm 3, the main steps of the algorithm are as follows.
- (1)
Node Y determines whether it is a destination node according to the destination address in RREP, as shown in
Table 3. If yes, the route is established successfully. Otherwise go to step (2);
- (2)
Establish or update the route according to whether there is a route to source of RREP;
- (3)
Update and forward or drop this RREP according to whether there is a route to destination of RREP.
Algorithm 3 RREP processing of any node |
1. | if node Y is destination node of RREP, then |
2. | route is established successfully; |
3. | send the data in the queue to the destination node; |
4. | else |
5. | if node Y has a route to destination node, then |
6. | update the route; |
7. | else |
8. | establish this route; |
9. | end if |
10. | if node Y has a route to source node, then |
11. | update and forward this RREP; |
12. | else |
13. | drop this RREP; |
14. | end if |
15. | end if |
Table 3.
The structure of RREP.
Table 3.
The structure of RREP.
Byte | 1 | 2 | 3 | 4 |
---|
Definition | Type | Reserved | Hop Count |
Destination IP Address |
Destination Sequence Number |
Source IP Address |
Life Time |
3.2.2. Route Maintenance
Because the moving speed and range of underwater nodes are smaller than those of terrestrial ad hoc nodes, and the energy of node, communication bandwidth is more limited, RFAODV cancels the mechanism of sending hello packets regularly, and adopts the following two mechanisms for route maintenance.
Data link layer feedback. In underwater acoustic networks, MAC protocols with ACK are usually used for communication quality, such as Macaw, Aloha and so on. Therefore, we can determine whether the link is normal from the data link layer.
Energy judgment. In order to reduce the energy consumption of one or several nodes in an ideal position, we can set a principle. If the energy of the node decreases by 50%, 70%, 90%, the RRER packet is sent to inform the neighbor nodes that the route is invalid.
Up on receiving notification of link interruption, source nodes can restart the discovery process if they still require a route to the destination.