1 Introduction

A mobile ad hoc network (MANET) is a non-centric network, consisting of a large number of mobile nodes without rules. In ad-hoc networks, the ad-hoc on-demand distance vector (AODV) routing protocol is relatively mature, but there are still many shortcomings. First, there are backbone nodes [1] in an ad-hoc network, and the frequency of these nodes being involved in route reconstruction and data transmission is relatively high. The route with the shortest hops is chosen when using the AODV routing protocol to rebuild the route regardless of network congestion. However, having set up a route with a heavy network load, the backbone nodes will be extremely busy, which will cause network congestion. Second, in AODV route protocol there is a major problem—especially in highly loaded networks—in that there is not only a considerable routing overhead, but increasing delays, mainly because of the sending and receiving [2] of large numbers of routing packets, such as Route Request (RREQ), Route Reply (RREP) and Route Error (RERR). Last but not least, in the AODV routing protocol, each source node maintains only one valid route to the destination node, and if the route fails, it will re-initiate the route discovery process, thus increasing the network overhead.

There are many improved AODV routing protocols in local and international literature. In Ref. [3], the author improved the count mode of hops using node mobility, and determined a metric M by combining mobility with real hops. M was the result of quantization of the finding path, and the destination node selected the minimum M value of the path to transmit data packets. This improved method takes the stability of the route into account, and although the frequency of failure of the path is reduced, fracture phenomena still occur in the path, increasing the latency to a certain extent. Reference [4] proposes reverse lookup routing when the node is idle. This approach enables an increase in the number of local routes in the network, and increases redundancy while improving the efficiency of route discovery. Although this method can repair the route in a timely manner when it is broken, to some extent it increases the routing overhead and the number of control packets. Reference [5] improves the route repair mechanism, broadcasts the looking up of the path between the last and next hops on the failed node, and although it accelerates routing repair, it increases latency. The SR-AODV routing protocol [6] changes the RREQ packet structure, increases the number of bytes, finds multiple redundant routes from the source node to destination node based on the stability of the network, and chooses the route with the highest stability for data transmission, while retaining the other routes as backup. However, this scheme increases the network overhead. An improved-AODV protocol [7] uses the same method to change the RREQ packets to improve the AODV routing protocol, but is not determined based on the stability of the route. Rather, it is based on finding multiple redundant routes, which also greatly increases the network overhead.

To solve the above problem, we propose the NAODV routing protocols for local congestion, in which the source node maintains routing and broadcast storms. The protocol adjusts the number of hops based on hops counted in the past, uses the concept of congestion hops, which reduces the lifetime of the route, and sets up a backup route to achieve the purpose of improving the overall performance of the AODV.

2 NAODV Routing Protocol

In this section, we improve AODV routing protocol by three ways, Number of congestion hops based on queue length; Cost control based on routing survival and the AODV routing protocol design based on redundant rout. A new NAODV routing protocol is formed, taking into account the above three shortcomings, to improve the original AODV routing protocol.

2.1 Number of Congestion Hops Based on Queue Length

In Ref. [1], there are backbone nodes in the self-organizing network, which participate more frequently in establishing routes and data transmission. The AODV routing protocol, irrespective of the degree of network congestion, selects a minimum number of hops to forward data for these established routes. However, setting up the route when the network load is large means the backbone nodes might be busy, leading to relatively large congestion. We propose a method for improving the number of hops from the perspective of network congestion.

In Ref. [8], using the exponentially weighted moving average low-pass filter (EWMA) method to calculate the average queue length, we have:

$$ Lavg = (1 - W_{q} ) \times Lavg + W_{q} \times AAAlen\_, $$
(1)

where W q represents the weights and AAAlen represents the current queue length.

According to the literature [1] and the description in [1], congestion increases as the average queue length increases. In this study, using the average queue length to predict congestion, the congestion and hops are linked to the number of the hop counts that avoid heavy network load routing nodes, while choosing routes wherever possible. This can predict and avoid congestion.

In the AODV algorithm, the maximum queue length was set to 64, and then drawn RED thought, and the maximum and minimum threshold were introduced to predict network congestion. The new approach considers congestion when determining the routing. The number of hops is calculated based on the number of congested hops as:

$$ Chops = Chops + select\_w(), $$

where select_w() is a piecewise function, defined as follows:

$$ \begin{array}{lll} select\_w() = WMIN & \quad if & Lavg \le LEN\_MIN \\ select\_w() = WMID& \quad if & LEN\_MIN \le Lavg \le LEN\_MAX \\ select\_w() = WMAX& \quad if & Lavg \ge LEN\_MAX, \\ \end{array}$$

where Lavg is the average queue length, LEN_MIN is the minimum threshold of the average queue length, and LEN_MAX is the average queue length for the maximum threshold.

While Lavg ≤ LEN_MIN, the network nodes load is light and does not appear congested, and WMIN can be set to the true hop 1.

While LEN_MIN < Lavg < LEN_MAX, the network nodes are in the middle loaded state and can participate in the establishment of the route, but are lower in priority compared with the lightly loaded node. WMID can be set to an appropriate value, so that it can detect network congestion and not affect the normal route selection, thus setting the value of WMID to 5.

While Lavg ≥ LEN_MAX, the network nodes are relatively heavily loaded, and congestion is likely to occur, so it is not suitable for data transmission. The literature [8] shows that the defaulted situation is unreachable when the number of hops is 15, and they do not communicate with each other. Therefore, the study set WMAX to 15, resulting in this heavily loaded node no longer being involved in establishing new routes.

Figure 1 shows a flowchart for forwarding RREQ from a node using the congestion hops:

Fig. 1
figure 1

Flowchart of the RREQ forwarding

2.2 Cost Control Based on Routing Survival

In the AODV routing protocol, if a node needs to communicate with other nodes and lacks efficient routing, the source node needs to broadcast RREQ to start the routing discovery process [9, 10]. If there is no valid route between the intermediate node and the destination node, the AODV routing protocol needs to frequently start the routing discovery process because it has less routing information. At the same time, because of the constant motion, nodes frequently change their network topology, making it necessary to update the routing, which will cause frequent retransmission of RREQ and increase the network overhead. Therefore, reducing the routing survival rate can reduce overhead.

The code for the AODV routing protocol follows:

In the function:

$$ \begin{aligned} & {\text{void AODV::forward}}\left( {{\text{aodv\_rt\_entry *rt, Packet *p, double delay}}} \right) \\ & \quad {\text{rt->rt\_expire}} = {\text{CURRENT\_TIME}} + {\text{ACTIVE\_ROUTE\_TIMEOUT;}} \\ \end{aligned} $$

Each route has a survival time when forwarding, the value of the survival time is the current time and the ACTIVE_ROUTE_TIMEOUT values.

$$ \begin{aligned} & {\text{Meanwhile: In the function void AODV :: recvRequest }}\left( {\text{Packet * p}} \right) :\\ & \quad {\text{rt0->rt\_expire}} = {\text{CURRENT\_TIME}} + {\text{ACTIVE\_ROUTE\_TIMEOUT;}} \\ \end{aligned} $$

When the node receives the RREQ packet request, it will immediately create a reverse route. The survival time of the reverse route is the current time plus the ACTIVE_ROUTE_TIMEOUT.

Therefore, by reducing the value of ACTIVE_ROUTE_TIMEOUT, the protocol can reduce the lifetime of fault routing, and help to periodically update the routing. The overhead of the route decreases as the route survival time decreases.

2.3 AODV Routing Protocol Design Based on Redundant Route

This study establishes the backup route ideas for improving the performance of the AODV routing protocol for the case in which each source node only maintains a valid route to the destination node in the AODV routing protocol. If this route fails, it will re-initiate the route discovery process, which makes the network overhead increase considerably. There are two routes, the main route and the backup route. In the NAODV protocol, we modify the local routing repair mechanism. It does not immediately initiate the route lookup process when the primary route fails, but starts the backup route only when the two routes have failed to reinitiate the route lookup process.

An ad-hoc network topology [11] is shown in Fig. 2. If Node S needs to communicate with Node D, and the routing table of Node S does not have a valid route to Node D, then Node S sends a route request packet RREQ. If there is no valid route to Node D in its routing table after Node 1 receives this RREQ packet, Node 1 will continue to broadcast this RREQ packet. Node 2 views its routing table after receiving the RREQ packet, where there is a valid route to Node D, while there are no valid routes to Node D in the routing tables for Nodes 4 and 5. Node S will have received the RREP packets that Node 2 and Node D transmitted. These two RREP packets each contain S-1-2-3-D, and S-1-4-5-6-D, two routes to node D. Node S will choose routes based on two factors, the destination serial number and the node hops to the destination, eventually leaving only one route, and the other route will be discarded even if valid. In this example, the valid routing S-1-2-3-D will still be discarded because the destination node sequence number is relatively small. Nodes 1 and 4 are disconnected in the process of Nodes S and D communicating with each other using the routing S-1-4-5-6-D. Node S will reinitiate a route lookup process to Node D, and the discarded route S-1-2-3-D will then be re-checked, and Node S will again receive a packet RREP message containing the routing S-1-2-3-D [12, 13].

Fig. 2
figure 2

Simple ad-hoc network topology

If the source Node S needs to communicate with the destination Node D while the source Node S routing table does not have a valid route to the destination Node D, after establishing a backup route, Node S will broadcast the RREQ initiate route lookup process. After some time, Node S will have received two RREP packets that contain the routing S-1-2-3-D and the routing S-1-4-5-6-D. Node S puts both routes in the routing table, and when S and D communicate with each other, if Nodes 1 and 4 are turned off, Node S will discover whether there is a backup route to the destination node while sending the fracture treatment. If so, the data packets received and data packets buffered in the queue will be sent through a backup route to the destination node. The route discovery process will only initiate again when the primary and backup routes both fail.

Figure 3 shows a flowchart of the function recvRequest in NAODV routing protocol.

Fig. 3
figure 3

Function recvRequest flowchart in NAODV routing protocol

These are the basic concepts of AODV routing based on the backup routing protocol.

3 Simulation Experiments

This section include two parts. One is set simulation parameters, and the other is Simulation results which has four figure.

3.1 Set Simulation Parameters

In the Network Simulation Version 2 (NS2) simulation platform, the network topology is composed of 50 mobile nodes, randomly distributed in the network model. These nodes are distributed in a 1000 m × 300 m rectangle, and move randomly in all directions at a speed of 0–20 m/s. The default transmission range is 250 m, the destination node residence time is 0 s, and the simulation time is 300 s. Under different scenarios, the node sends packets at rates of 2, 10, 15, 20, and 25 packets [14, 15]. Each CBR packet is 512 B. Specific simulation parameters are shown in Table 1.

Table 1 Simulation parameters

3.2 Simulation Results

In this study, NAODV was compared with the original AODV, the SR-AODV and the ARB-AODV routing protocols in four areas. Alignments showed that NAODV provided better network performance compared with other protocols.

Figure 4 shows the packet delivery ratio (PDR) of the four protocols for the different transmission packet rate conditions. The PDR is the ratio of the number of packets received by the destination node to the number of packets sent by the source node in the application layer, which is a function of the reliability of the network. The greater the PDR, the higher the network reliability. This study is based on the concept of a backup route, greatly improving the ratio of packets received by the destination number and the PDR. According to this figure, when the rate of transmission packets is relatively high, the packet delivery rate between NAODV and several alternatives is relatively close, and network reliability will not significantly improve. In other conditions, when the rate of transmission packets is relatively small, the PDR for NAODV is the highest. This shows that the protocol PDR increases, improving significantly, and the reliability of the network correspondingly improves.

Fig. 4
figure 4

Packet delivery ratio when the transmission packet rate changes

The end-to-end average delay is the average time from the IP layer of the nodes of the transmission of data packets to the IP layer of the desired source node receiving the data packet, including the sending delay, transmission delay, delay and wait and retransmission delay, reflecting the effectiveness of the routes. The study control overhead, based on the routing survival, not only reduced the failure route generation time, but also reduced the end-to-end delay by reducing the value ACTIVE_ROUTE_TIMEOUT. As shown in Fig. 5, whether it is at a relatively low rate for a transmission packet or when the speed for a transmission packet is relatively high, the NAODV approach contrasts with the other four protocols. The end-to-end delay was relatively small, and the performance was more evident when the sending at packet rates was greater than 10 packets/s. Thus, the NAODV protocol performance certainly improved in the experiments, as did the routing effectiveness.

Fig. 5
figure 5

End-to-end delay when the transmission packet rate changes

As shown in Fig. 6, when the sending packet rate was between 0–10 packets/s, the route launch frequency was more relaxed. When the sending packets rate was between 10–15 packets, the routing initiate frequency grew rapidly, followed by another rapid decline, until the packet sending rate reached the maximum rate of 15 packets. Because a backup route was used, the route launch frequency for the NAODV routing protocol was significantly less than the other three routing protocols. It indicated that when the primary route failed, the backup route played an important role, greatly reducing the route times.

Fig. 6
figure 6

Route launch frequency when the transmission packet rate changes

As shown in Fig. 7, with the increase in the transmission packet rate, the routing cost for the four routing protocols has a reducing tendency. NAODV decreased faster, and its advantages remained when the transmission rate changed, which shows the NAODV routing protocol overhead was smaller compared with the other protocols. This was because reducing the routing survival reduced the number of transmitting RREQ. Thus, reducing the lifetime of the routes can reduce the routing overhead.

Fig. 7
figure 7

Routing load when the transmission packet rate changes

4 Conclusions

The AODV routing protocol combines the advantages of the DSR protocol and the DSDV protocol, which is an on-demand routing protocol. Despite the advantages, there are still many shortcomings. For example, not considering the congestion of the network when choosing the route (selecting only the largest or shortest number of hops route) will frequently involve some backbone nodes in establishing a forwarding route, making them very busy and causing network congestion. Network topology changes frequently, and route survivals are too long to update the routes. A routing table only maintains one route to the destination node, and when a link fails, immediately re-initiates the route lookup process, so that the overhead becomes too large because of the repeated sending of data packets. We propose a new AODV routing protocol: the NAODV routing protocol to solve the problems of the AODV routing protocol. The number of hops is determined based on the extent of network congestion when selecting the next node, and not just selecting the maximum or shortest number of hops to a node, to avoid congestion. To reduce the survival time of the forward and reverse routes and reduce the number of retransmissions of the RREQ packet with the purpose of reducing overheads, the source node maintains two routes: the main route and the backup route. By modifying the local routing repair mechanism, when the primary route fails, the backup routing is enabled. When both fail, the route lookup process is then re-launched, which significantly reduces the routing initiation frequency and improves the performance of the network. The NS2 simulation results indicate that for the performance of the PDR, end-to-end delay, routing launch frequency and routing overheads, the NAODV routing protocol was greatly improved when compared with the other AODV routing protocols. The PDR, routing launch frequency and routing overhead performance were the more obvious improvements, while advantages in the end-to-end delay were relatively weak. Although the NAODV routing protocol improved in terms of routing performance compared with the other three routing protocols, this came at the expense of energy. Routing protocols using less energy will be the topic of future research.