Introduction

Today, unmanned aerial vehicles (UAVs) have become advanced technology due to low cost, high strength, and various applications. Hence, they have attracted the attention of many researchers at universities and industry1,2. In addition, multi-UAV systems can play an effective role in various missions due to features such as high scalability, good stability, and high throughput. When multiple UAVs cooperate to carry out a particular mission, this cooperation leads to the formation of a flexible, dynamic, distributed, and strong network called a flying ad hoc network (FANET)3,4. An important application of FANET is precision agriculture. Newly, farmers find out that the use of a swarm of UAVs in an ad hoc form is very useful in agriculture. This increases production growth and improves the quality of agricultural products because farmers manage crops and use water and fertilizer efficiently5,6. Additionally, the use of UAVs, equipped with cameras, sensors, and other data collection devices, allows farmers to control their product state and identify problems that are not visible on the ground surface7,8. Compared to other traditional methods, UAVs can be used in pesticide spraying automatically and accurately. Figure 1 depicts the application of FANETs in precision agriculture9,10.

Figure 1
figure 1

FANET in precision agriculture.

FANET does not rely on communication infrastructure. In FANET, the information, such as control commands, position, and data collected from the environment, is shared with UAVs through a wireless channel11,12. In FANETs, researchers have challenges such as the movement of UAVs in a 3D area, unstable network topology, limited energy resources, and the low density of UAVs. These challenges should be taken into consideration to achieve a reliable and stable data transmission process13,14. A suitable routing approach must provide extensive communication coverage, high reliability, and strong communication links in FANET. In FANETs, a routing protocol is responsible for discovering one or more routes and delivering data packets from the source to the destination via a multi-hop route15,16. Many routing protocols such as DSDV17, OLSR18, DSR19, AODV20, TORA21, and GPSR22, which have been used on other ad hoc networks (i.e. mobile ad hoc networks (MANETs) or vehicular ad hoc networks (VANETs)) should be modified for FANETs because these networks have different needs for designing routing protocols that go beyond traditional ad hoc networks such as MANET and VANET. Therefore, the routing subject is an important and influential issue in network performance. There are various challenges related to the construction of routing protocols in FANETs, which are due to the features of these networks, namely high-mobile and low-energy UAVs, instability of communication links, and dynamic network topology. On the other hand, the high mobility of UAVs results in the disconnection of communication links in the network, and consequently, the instability of communication routes in the network, which weakens network performance in terms of delay, packet loss, and routing overhead. In FANET, each routing method must improve its adaptability to the dynamic network environment, manage resources, including bandwidth and energy consumption in the network, and reduce the required memory to hold the routing tables. In FANET, a routing method must quickly react to network topology changes and transmit data packets to the destination reliably and quickly.

Despite much research to solve this problem, research on routing protocols in FANET is still a hot scientific subject because the formation of stable paths in FANET is a major challenge due to the instability of communication links and the high mobility of UAVs. AODV is a classic and successful protocol in FANETs23,24. It utilizes an on-demand routing methodology. This means that AODV only finds suitable paths in the network when requesting a node to build a route and broadcasting a route request (RREQ) packet in the network. This feature is valuable because it reduces routing overhead and energy consumption and lowers the need for memory25,26. Thus, AODV is a popular routing protocol in ad hoc networks, especially FANETs. Today, various AODV-based routing schemes have been presented for ad hoc networks, especially FANET. However, AODV suffers from some weaknesses that must be addressed in FANETs:

  • Lack of adaptability to the dynamic environment of FANET: The AODV routing strategy relies only on one criterion, namely the number of hops, to find the shortest route to the destination. This strategy does not pay attention to the mentioned challenges in FANETs, including high-speed UAVs and the instability of network topology. This has led to the weak performance of AODV in FANET27,28.

  • The broadcasting storm issue: In AODV, the route discovery strategy is performed by flooding RREQs in the network, but it results in high communication overhead and delay in the data transmission process. In addition, this flooding can cause a serious problem, namely the broadcasting storm, in the network. AODV tries to prevent this problem by inserting parameters such as sequence number, message ID, and number of hops into the RREQ packet, but it does not have a successful performance in this area, especially for FANET29,30.

  • Failure to use position information: In AODV, the position information of UAVs is not used to find routes in the network. However, this information improves the performance of AODV and increases its adaptability to FANET. The position information of UAVs is obtained by connecting UAVs to a positioning system such as GPS31,32.

  • Lack of energy awareness: Energy is a limited resource in FANET. Thus, each routing protocol must consider how to use this resource to improve network performance because UAVs are relatively far from each other in FANET. As a result, they consume a lot of energy for the data transfer process. This can quickly discharge their battery capacity. However, the routing strategy in AODV does not pay attention to this important challenge. Therefore, the selection of low-energy UAVs as intermediate nodes in routing paths can lead to instability of routes. This leads to an imbalance in energy consumption in the network and consequently reduces the lifetime of FANET33,34.

According to these facts, in this paper, a local filtering-based energy-aware routing method (LFEAR) is presented in FANETs to solve the challenges mentioned above. In this regard, LFEAR tries to improve the adaptability of AODV to FANET and solve the broadcasting storm issue. To achieve these goals, LFEAR modifies the route discovery process in AODV, but the route maintenance process is similar to AODV. To solve the broadcasting storm issue, LFEAR uses local filtering to limit the broadcasting range of RREQ. This reduces routing overhead and delay in the route discovery procedure. To improve the adaptability to FANET, LFEAR applies information about the energy, position, and speed of UAVs in the route discovery process. In the following, the most important contributions are expressed in this paper.

  • In LFEAR, the position and speed of each UAV are considered in the routing process to increase the adaptability of the proposed method to FANET. Therefore, UAVs regularly exchange this information through beacon messages to gain a better understanding of local network topology and make accurate decisions about UAVs in the route discovery process.

  • In LFEAR, the template of two control packets used in the route discovery process, namely route request (RREQ) and route reply (RREP), are modified so that RREQ includes three new components, namely route energy, reliable distance, and movement similarity. The purpose of these three components is to increase the stability of paths, balance the energy consumption of UAVs, and improve network lifespan.

  • In LFEAR, local filtering is employed to avoid the broadcasting storm issue by limiting the broadcasting range of RREQs. Accordingly, only UAVs inside the local filtering can rebroadcast the RREQ packet and other UAVs must remove this RREQ packet. Local filtering is a cylindrical zone whose central line is drawn from the source to the destination. Thus, the relevant equations are presented in the cylindrical coordinate system.

  • In LFEAR, after the end of the route discovery procedure, the destination node must choose the best route from the found paths. Accordingly, the destination node extracts the information about each route, namely the number of hops, energy, reliable distance, and movement similarity from the RREQ packet to calculate its score. Lastly, the destination node selects the path with the highest score and sends RREP to the source node through this path.

The rest of this paper is as follows: Sect. "Related works" presents the related works in FANET. Section "System model" describes the network and energy models in LFEAR. Section "Proposed method" elaborates on the proposed routing scheme accurately. The simulation results are shown in Sect. "Simulation and result evaluation", and the conclusion is presented in Sect. "Conclusion".

Related works

In Ref.35, the authors provided a utility function-based greedy perimeter stateless routing scheme (UF-GPSR) in FANETs. This scheme takes into consideration the essential components of UAVs, including distance, movement angle, velocity, the risk of communication links, and energy level to modify the greedy routing strategy. Furthermore, UF-GPSR computes the utility function based on the mentioned components to modify the routing procedure and designate the best UAV inside the communication area of the previous-hop UAV. The authors described their motivations for designing UF-GPSR: (1) The most suitable next-hop node is not always the UAV closest to the destination. (2) In environments with sparsely populated UAVs and high changes to network topology, routing holes are very likely, and the routing algorithm may converge to the local optimum. (3) The routing protocol must not rely only on the location coordinates of UAVs to choose the next-hop node. The results obtained from UF-GPSR illustrate that this scheme works well and satisfactorily.

In Ref.36, the authors introduced an energy-efficient data transfer technique named ENSING for the Internet of Drones (IoD) to create three-dimensional connections in 6G networks. This approach addressed energy consumption in the swarm of UAVs because energy is an important issue, which affects UAVs in terms of their flight duration and their ability to do various missions. Additionally, the coordination and organization of UAVs in the network depend on communication links between UAVs in FANETs. ENSING is a new routing strategy, which focuses on energy consumption. It tries to lower the number of control packets to keep the energy of UAVs. In ENSING, the next-hop node is chosen based on the energy criterion. Thus, UAVs with an acceptable remaining energy level can participate in the data transfer procedure. The simulation results show that the performance of ENSING is better than other routing schemes.

In Ref.37, the authors presented a position forecast-based greedy perimeter routing scheme named GPSR+ in FANET. GPSR+ utilizes a position forecast approach to gain the next position of UAVs in the FANET environment. Furthermore, the hello messaging period is modified to achieve better compatibility with FANET. It also designates a set of candidate UAVs based on the spherical removal strategy to decide on intermediate UAVs in the communication route. Finally, these selected UAVs create a stable route. The simulation results indicate the powerful performance of GPSR+ in comparison with other routing approaches.

In Ref.38, the authors proposed a fuzzy-based trust-aware routing algorithm (FTSR) for FANETs. In FTSR, two trust formulations, namely local trust and path trust are defined. The first system, namely local trust, acts under a distributed process to unearth trustworthy neighboring UAVs and isolate untrustworthy neighboring UAVs in the network. Thus, only trustworthy nodes carry out the routing process. This lowers the number of unsafe paths in FANETs. On the other hand, the second trust system (i.e. path trust) recognizes untrustworthy nodes, which are not identified in the first trust system. This system calculates the trust of created routes in the network. To produce this system, the source UAV implements a fuzzy system to determine the safest route between source and destination. The results obtained from the simulation process confirm the performance of FTSR compared to other schemes.

In Ref.39, the authors offered a virtual tunnel-based energy-aware routing technique named EARVRT for FANETs. In this scheme, a virtual relay tunnel (VRT) is designed to control the rebroadcasting range of RREQs when finding paths in the network. VRT decreases routing overhead because only UAVs, located in the tunnel, rebroadcast RREQ in the network. This tunnel prevents other UAVs from relaying RREQs to create the communication paths in the network. The goal of this tunnel is to avoid the broadcasting storm issue in FANET. UAVs construct the VRT tunnel very quickly and without extra overhead. Additionally, EARVRT takes into consideration three criteria, namely route energy, the number of hops, and a new criterion called route correlation, which depends on two elements, including the distance between UAVs and their cosine similarity. The simulation results confirm the successful performance of EARVRT in comparison with other algorithms.

In Ref.40, the authors suggested a position-based cone-shaped routing technique called LoCaL for FANETs. The major motivation of LoCaL is to extend the lifespan of communication links in the network. In this scheme, the forwarding node is chosen based on several metrics, like link lifespan, remaining energy, and safety degree. Accordingly, LoCaL increases the stability of paths and decreases the number of broken paths. This route stability is achieved through a utility function. It assists LoCaL in selecting relay UAVs in the cone-shaped area. This reduces routing overload in the route-finding process. The simulation results show the successful performance of LoCaL compared to other schemes.

In Ref.41, the authors offered a three-dimensional location-aware routing algorithm named O-LAR for propagating information in FANET. Additionally, O-LAR defines a weight function to construct the best route between UAVs. O-LAR utilizes this weight function to find intermediate UAVs in the communication path. It is dependent on multiple metrics, including movement angle, remaining energy, and distance. In addition, in O-LAR, a mathematical formula is presented to obtain parameters such as the link lifespan, remaining energy, and the average number of hops. The simulation results show that O-LAR works better than other schemes.

In Ref.42, the authors offered a particle swarm optimization (PSO)-based greedy and limited flooding routing approach (PSO-GLFR) in FANET. In PSO-GLFR, two routing schemes, namely GPSR and AODV are merged. PSO-GLFR splits the data transfer procedure into two parts: (1) greedy routing and (2) flooding-based path-finding. Additionally, PSO-GLFR can solve the next-hop selection issue in the greedy routing strategy using the PSO algorithm. Simulation results represent the superiority of PSO-GLFR compared to other schemes.

In Ref.43, the authors combined two routing schemes, GPSR and AODV, and suggested a geographic routing method called GPSR+AODV for FANET. In GPSR+AODV, the hello dissemination interval is regularly updated based on the predicted position of UAVs. Then, this scheme introduces a new greedy forwarding strategy by limiting candidate next-hop nodes. This set of candidate nodes is defined in the cylindrical coordinate system. Next, GPSR+AODV formulates a fitness function based on relative velocity, energy level, buffer capacity, and distance to the destination to evaluate the candidate next-hop nodes and choose the best next hop. In GPSR+AODV, when the greedy forwarding strategy fails, an AODV-based forwarding strategy is responsible for finding the next hop.

In Ref.44, the authors combined the optimised link state routing scheme (OLSR) and GPSR, and presented a new routing protocol called OLSR+GPSR for FANETs. In OLSR+GPSR, the hello dissemination interval is adjusted using a fuzzy system, which includes two inputs, namely UAV’s speed and the position error. OLSR+GPSR selects multi-point relays (MPRs) based on the weighted sum of buffer capacity, remaining energy, neighbor degree, node stability, and residual energy. Then, MPRs must find the most suitable paths between UAVs using a greedy forwarding strategy.

Table 1 compares different methods and highlights their most important strengths and weaknesses. Studies in this paper show that designing routing protocols for FANET is a very important scientific subject. Among the aforementioned routing schemes, UF-GPSR35, ENSING36, GPSR+37, GPSR+AODV43, and OLSR+GPSR44 use greedy forwarding strategy to send data to the destination and are not reliable. These methods are energy-efficient and require position information of UAVs to find the suitable routes in the network. Although UF-GPSR35 and ENSING36 have not a well adaptability to FANET, GPSR+37, GPSR+AODV43, and OLSR+GPSR44 are adaptable and consider the position and movement of UAVs in the routing process. Other aforementioned routing schemes, FTSR38, EARVRT39, LoCaL40, O-LAR41, PSO-GLFR42, and GPSR+AODV43 are on-demand and energy-efficient routing methods and use route requests to discover communication routes in the network. However, FTSR38, O-LAR41, and GPSR+AODV43 cannot manage flooding route requests in the network and may deal with the broadcast storm issue. These methods suffer from a lot of communication overhead. In contrast, EARVRT39, LoCaL40, PSO-GLFR42 use various techniques for managing flooding route requests in the network. However, these methods have not a good adaptability to FANET and do not pay attention to the high speed of UAVs and topological instability. Thus, this paper introduces a local filtering-based energy-aware routing scheme (LFEAR) in FANET. In this regard, LFEAR tries to improve adaptability to FANET and solve the broadcast storm problem. To achieve these goals, LFEAR modifies the route discovery process and uses a local filtering to avoid the broadcast storm issue. Accordingly, only UAVs inside the local filtering are allowed to rebroadcast RREQs and other UAVs must remove route requests. This reduces routing overhead and delay in the routing process. To improve the adaptability to FANET, LFEAR uses the residual energy, position and speed of UAVs in the route discovery process. After ending this process, the destination selects the best route from the paths found in the previous step based on several criteria such as, the number of hops, path energy, reliable distance, and movement similarity, and sends the RREP to the source node through it.

Table 1 Comparison of related works.

System model

Here, two network and energy models are described in LFEAR.

Network model

In LFEAR, the network graph \(G=\left( U,L\right) \) comprises two sets of vertices and edges i.e. \(U=\left\{ {U_{i}}|1\le i\le n\right\} \) and \(L=\left\{ {L_{ij}}|\underset{i\ne j}{\mathop {\forall }}\,\,\,{U_{i}},{U_{j}}\in U\,\,and\,\,{D_{ij}}\le R\right\} \), respectively. Here, \({U_{i}}\) and n express i-th UAV and the total number of UAVs, respectively. In this network model, \({U_{i}}\) uses a specific identifier (\(ID_{i}\)) to be distinguishable from other UAVs and R shows its communication radius in the network. Now, if \({U_{i}}\) and \({U_{j}}\) are in each other’s communication area, their distance (i.e. \({D_{ij}}=\sqrt{{{\left( {x_{i}}-{x_{j}} \right) }^{2}}+{{\left( {y_{i}}-{y_{j}}\right) }^{2}}+{{\left( {z_{i}}-{z_{j}}\right) }^{2}}}\)) is shorter than R, and \({U_{i}}\) and \({U_{j}}\) have a direct link \({L_{ij}}\) in the set L. This link is used to communicate between the two UAVs. In addition, \(\left( {x_{i}},{y_{i}},{z_{i}} \right) \) and \(\left( {x_{j}},{y_{j}},{z_{j}}\right) \) show the spatial coordinates of \({U_{i}}\) and \({U_{j}}\), respectively. Each UAV has access to a positioning system and can obtain its spatial coordinates at any moment. Now, if \({U_{i}}\) and \({U_{j}}\) are not in each other’s communication area and do not have any direct link in the set L, their communication will be indirectly established. In this case, the network supports UAV-to-UAV communication, shown in Fig. 2. UAVs employ IEEE 802.11g as a communication standard in the MAC layer. The network model also includes a ground control station (GCS) that is responsible for communicating with the central monitoring system and UAVs, transferring instructions to UAVs, receiving data collected by UAVs, and sending this data to the central system. This network also supports GCS-to-UAV communication so that GCS always connects to one or more UAVs and can communicate with other UAVs through these connected UAVs.

Figure 2
figure 2

Network model in LFEAR.

Energy model

In LFEAR, the energy model follows the first-order radio model45, which supports the two energy models, namely the free space propagation model (FSPM) and the multi-path fading propagation model (MPFPM). These two models consider a direct relationship between the energy consumption of the transmitter (\({U_{i}}\)) and the recipient (\({U_{j}}\)) and their distance (\({D_{ij}}\)).

$$\begin{aligned} {D_{ij}}=\sqrt{{{\left( {x_{i}}-{x_{j}}\right) }^{2}}+{{\left( {y_{i}}-{y_{j}} \right) }^{2}}+{{\left( {z_{i}}-{z_{j}}\right) }^{2}}}, \end{aligned}$$
(1)

Furthermore, \(\left( {x_{i}},{y_{i}},{z_{i}}\right) \) and \(\left( {x_{j}},{y_{j}},{z_{j}}\right) \) show spatial coordinates \({U_{i}}\) and \({U_{j}}\), respectively.

Accordingly, if \({U_{i}}\) and \({U_{j}}\) are far from each other, they need a lot of energy to exchange data. However, if \({U_{i}}\) and \({U_{j}}\) are close to each other, they need lower energy to exchange. According to FSPM and MPFPM, when \({U_{i}}\) wants to send k bits to \({U_{j}}\), the energy consumption of \({U_{i}}\) and \({U_{j}}\) is obtained from Eqs. (2) and (3), respectively.

$$\begin{aligned}{} & {} {E_{TX}}\left( k,{d_{ij}}\right) =\left\{ \begin{matrix} kE_{elec}+k{\epsilon }_{fs}{{\left( {d_{ij}}\right) }^{2}}\,\,\,\,{d_{ij}}\le {d_{t}} \\ kE_{elec}+k{\epsilon }_{mp}{{\left( {d_{ij}}\right) }^{4}}\,\,\,\,{d_{ij}}>{d_{t}} \\ \end{matrix}\right. \end{aligned}$$
(2)
$$\begin{aligned}{} & {} \quad {E_{RX}}\left( k \right) =kE_{elec}, \end{aligned}$$
(3)

Here, \({E_{elec}}\) denotes the energy used in the electrical circuit of \({U_{i}}\) and \({U_{j}}\) to exchange each bit. In addition, \({d_{t}}\) indicates the distance threshold and is calculated through Eq. (4).

$$\begin{aligned} {d_{t}}=\sqrt{\frac{{{\epsilon }_{fs}}}{{{\epsilon }_{mp}}}}, \end{aligned}$$
(4)

If \({d_{ij}}\le {d_{t}}\), the energy used in \({U_{i}}\) follows the FSPM model. In this case, \({{\epsilon }_{fs}}\) is the power amplifier coefficient and the energy used in the amplifier is equal to \({{\epsilon }_{fs}}{{\left( {d_{ij}}\right) }^{2}}\). Otherwise, the energy used in \({U_{i}}\) follows the MPFPM model. Furthermore, \({{\epsilon }_{mp}}\) indicates the power amplifier coefficient and the energy used in the amplifier is equal to \({{\epsilon }_{mp}}{{\left( {d_{ij}}\right) }^{4}}\).

Proposed method

In this section, a local filtering-based energy-aware routing scheme (LFEAR) is proposed in FANETs. In this regard, LFEAR seeks to improve the adaptability of AODV to FANET and solve the broadcasting storm problem. To achieve these goals, LFEAR modifies the route discovery process in AODV, but the route maintenance process in LFEAR is similar to it in AODV. To solve the broadcasting storm problem, LFEAR creates local filtering to limit the broadcasting range of RREQs in the network. This decreases routing overhead and latency in the path discovery procedure. To improve the compatibility with FANET, LFEAR uses the residual energy, position, and velocity of UAVs in the path discovery procedure. Thus, LFEAR includes two phases:

  • Neighbor table construction phase

  • Route discovery phase

In the following, each phase is described in detail. Figure 3 shows the schematic design of LFEAR. Also, Table 2 presents the notations used in this paper.

Figure 3
figure 3

Schematic design of LFEAR.

Table 2 Notations used in LFEAR.

Neighbor table construction phase

In LFEAR, the position and speed of UAVs are needed to enhance the adaptability of the proposed scheme to FANET. Hence, UAVs exchange this information regularly through beacon messages to obtain local network topology and decide on relay UAVs in the route discovery process. According to Fig. 4, each beacon message includes an identifier (\(ID_{i}\)), spatial coordinates \(\left( {x_{i}},{y_{i}},{z_{i}}\right) \), and the speed vector \(\left( {V_{i}},{{\theta }_{i}},{{\varphi }_{i}}\right) \). It is locally disseminated in the communication range of UAVs. In the speed vector, \({V_{i}}\), \({\theta }_{i}\), and \({\varphi }_{i}\) are the velocity length, the angle between the positive x-axis and the projection of the speed vector on the xy-plane, and the angle between the speed vector and the positive z-axis. Note that UAVs should not rebroadcast beacon messages received from other UAVs in the network.

Figure 4
figure 4

Beacon message format.

When a UAV, like \({U_{i}}\), obtains a beacon message from a nearby UAV, like \({U_{j}}\), it adds an entry to its neighbor table (\(NT_{i}\)) and records the information of \({U_{j}}\) in \(NT_{i}\). See Fig. 5. As soon as a new beacon message comes from \({U_{j}}\), its information in this entry will be updated immediately. To avoid holding out-of-date information in \(NT_{i}\), \({U_{i}}\) adds a validity time (\(VT_{j}\)) to the entry corresponding to \({U_{j}}\). \(VT_{j}\) is a timer, which is adjusted based on the beacon dissemination period. When \({U_{i}}\) and \({U_{j}}\) get away from each other’s communication range, they do not receive each other’s beacon messages, and in this case, \(VT_{j}\) is zero. As a result, the entry of \({U_{j}}\) in \(NT_{i}\) is automatically removed. However, if \({U_{i}}\) receives a new beacon message from \({U_{j}}\) in the current beacon time, it will update \(VT_{j}\) again. As a result, the entry of \({U_{j}}\) in \(NT_{i}\) remains valid at the next beacon period. Note that LFEAR regulates the beacon dissemination time based on the speed of UAVs to increase its adaptability to FANET. Accordingly, if UAVs move very quickly in the network, the beacon period will be shorter so that each UAV can keep its neighbor table up-to-date regarding the rapid changes in the network topology. However, if UAVs move very slowly in the network, LFEAR will prolong the beacon time because fewer changes occur in the network topology, and each UAV can update its neighbor table with low routing overhead. Algorithm 1 represents the pseudo-code of this phase.

Figure 5
figure 5

Structure of \(NT_{i}\).

Algorithm 1
figure a

Neighbor table construction phase.

Route discovery process

In this phase, suppose that \({U_{S}}\) and \({U_{D}}\) intend to communicate with each other to exchange their data packets, but the two UAVs have no direct link, and \({U_{S}}\) cannot find any valid paths to \({U_{D}}\) in its routing table. Therefore, \({U_{S}}\) must execute the route discovery process by broadcasting the RREQ packet. In LFEAR, this process is explained in four steps:

  • Format of control packets

  • Local filtering construction process

  • Path-finding process

  • Selection of the best route

Format of control packets

Here, the formats of two control packets used in the route discovery process, namely route request (RREQ) and route reply (RREP), are explained. The formats of RREQ and RREP are presented in Figs. 6 and 7, respectively. In the following, the most important fields in these control packets are described.

  • Message type: The formats of RREQ and RREP are very similar. This field specifies the type of control packet to distinguish RREQs from RREPs. If this field is equal to one, the control packet is RREQ, while if it equals two, the packet is RREP.

  • Number of hops (\(\mathbf {HC_{r}}\)): When RREQ is initialized, \({U_{S}}\) must set \(HC_{r}\) to zero. This field acts as a counter and counts the number of hops traveled in \({P_{r}}\) (i.e. the route between \({U_{S}}\) and \({U_{D}}\)). This counter prevents routing holes in the network.

  • Route energy (\(\mathbf {{E_{r}}}\)): This field expresses the lowest residual energy of intermediate nodes in \({P_{r}}\) and determines the energy crisis point (i.e. the UAV with the least energy capacity in \({P_{r}}\)). Energy is an important criterion to evaluate \({P_{r}}\) because if this route includes UAVs with inadequate energy levels, \({P_{r}}\) is extremely unstable and may be cut quickly. As a result, the data transfer process will not be successful. If low-energy UAVs take part in the route construction process, it causes an imbalance in the energy consumption of nodes and reduces network lifespan. \({U_{S}}\) determines the initial value of \({E_{r}}\) based on its energy capacity. Then, \({E_{r}}\) is updated in each hop based on Eq. (5).

    $$\begin{aligned} {E_{r}}=\underset{{U_{i}}\in {P_{r}}}{\mathop {\min }}\,\left\{ \frac{{E_{i}}}{{E_{\max }}} \right\}, \end{aligned}$$
    (5)

    where \({E_{i}}\) and \({E_{\max }}\) represent the residual energy of \({U_{i}}\) and the initial energy of UAVs in \({P_{r}}\), respectively.

  • Reliable distance (\({\Psi }_{r}\)): This field expresses the reliable distance between intermediate UAVs in \({P_{r}}\). The goal of \({\Psi }_{r}\) is to choose two consecutive UAVs in \({P_{r}}\) in a way that minimizes the likelihood of leaving each other’s communication range. This means that the two UAVs are not close to each other’s communication boundary. As a result, \({P_{r}}\) remains valid for a longer time. This improves the data delivery ratio (PDR) and reduces delay in the routing process because LFEAR has less need to reconstruct the created paths between UAVs. Therefore, if \({P_{r}}\) has a high reliable distance, it is more stable and suitable for transferring data packets. \({U_{S}}\) sets the initial value of \({\Psi }_{r}\) to one. Then, \({\Psi }_{r}\) is calculated based on Eq. (6) in each hop.

    $$\begin{aligned} {\Psi }_{r}=\underset{{U_{j}}\,and\,{U_{i}}\in {P_{r}}}{\mathop {\min }}\,\left\{ {\Psi }_{ij} \right\}, \end{aligned}$$
    (6)

    So that \({\Psi }_{ij}\) is the reliable distance between the two consecutive nodes \({U_{i}}\) and \({U_{j}}\) in \({P_{r}}\). \({\Psi }_{ij}\) is calculated through Eq. (23) in Sect. "Path-finding process".

  • Movement similarity (\(\mathbf {{\vartheta }_{r}}\)): This field indicates the least speed similarity of intermediate UAVs in \({P_{r}}\). The purpose of this field is to select the intermediate nodes with the similar speeds in \({P_{r}}\) to form a stable path between \({U_{S}}\) and \({U_{D}}\). In this case, intermediate nodes are in the communication range of each other for a longer time. However, if these intermediate UAVs have different speeds, the likelihood of leaving each other’s communication range will be very high and the created routes must be rebuilt quickly. This needs a lot of communication and computational overheads. Thus, \({\vartheta }_{r}\) is calculated based on Eq. (7).

    $$\begin{aligned} {\vartheta }_{r}=\underset{{U_{j}}\,and\,{U_{i}}\in {P_{r}}}{\mathop {\min }}\,\left\{ CS_{\overrightarrow{{V_{ij}}}}\right\}, \end{aligned}$$
    (7)

    So that \(CS_{\overrightarrow{{V_{ij}}}}\) shows the speed similarity of two consecutive nodes \({U_{i}}\) and \({U_{j}}\) in \({P_{r}}\). \(CS_{\overrightarrow{{V_{ij}}}}\) is obtained from Eq. (27) in Sect. "Path-finding process".

  • Message ID: This field considers a unique identifier for each RREQ or RREP so that UAV identifies duplicated control packets and does not process these packets again.

Figure 6
figure 6

Format of RREQ.

Figure 7
figure 7

Format of RREP.

Local filtering construction process

When \({U_{S}}\) and \({U_{D}}\) intend to communicate with each other, and \({U_{S}}\) cannot find any valid path to \({U_{D}}\) in its routing table, it must execute the route discovery process by broadcasting RREQs in its communication radius (R). This process is shown in Fig. 8. According to this figure, the communication range of \({U_{S}}\) is a circular area with the R radius, and \({U_{S}}\) broadcasts RREQs for its neighboring UAVs, including \({U_{1}}\), \({U_{2}}\), \({U_{3}}\), \({U_{4}}\), \({U_{5}}\), \({U_{6}}\), and \({U_{7}}\).

Figure 8
figure 8

Broadcasting RREQs in the route discovery process.

To avoid the broadcasting storm issue, LFEAR uses local filtering to limit the broadcasting range of REEQs. Accordingly, only UAVs inside local filtering can rebroadcast the RREQ packet and other UAVs remove this packet. This local filtering is depicted in Fig. 9. Local filtering is cylindrical, and its central line is drawn from \({U_{S}}\) to \({U_{D}}\). According to Fig. 9, \({U_{1}}\), \({U_{2}}\), and \({U_{3}}\) are outside the filtered area, and they must not rebroadcast the RREQ packet. But, \({U_{4}}\), \({U_{5}}\), \({U_{6}}\), and \({U_{7}}\) are inside the filtered zone, they can rebroadcast the RREQ packet.

Figure 9
figure 9

Filtering the relay UAVs.

Note that local filtering is cylindrical. Consequently, it is best to provide the relevant equations in the cylindrical coordinate system. As shown in Fig. 10, if the Cartesian coordinates of a point, like P, are \(\left( {x_{p}},{y_{p}},{z_{p}}\right) \), then its cylindrical coordinates are \(\left( {\rho }_{p},{\phi }_{p},{z_{p}}\right) \). Equation (8) is used to convert Cartesian coordinates into cylindrical coordinates.

$$\begin{aligned} \begin{array}{l} {\rho }_{p}=\sqrt{{x_{p}}^{2}+{y_{p}}^{2}} \\ {\phi }_{p}=\arctan \left( \frac{{y_{p}}}{{x_{p}}}\right) \\ {z_{p}}={z_{p}} \end{array}, \end{aligned}$$
(8)

Here, \({\rho }_{p}\) denotes the distance between the origin and the projection of P on the xy-plane. \({\phi }_{p}\) indicates the angle between the positive x-axis and \({\rho }_{p}\). \(z_{p}\) specifies the distance between P and the xy-plane. Furthermore, Eq. (9) is used to convert cylindrical coordinates into Cartesian coordinates.

$$\begin{aligned} \begin{array}{l} {x_{p}}={{\rho }_{p}}\cos {{\phi }_{p}} \\ {y_{p}}={{\rho }_{p}}\sin {{\phi }_{p}} \\ {z_{p}}={z_{p}} \end{array}, \end{aligned}$$
(9)
Figure 10
figure 10

Relationship between cylindrical coordinates and Cartesian coordinates.

To formulate the local filtering area, Fig. 9 is simplified and converted to Fig. 11. In Fig. 11, local filtering is a cylindrical zone whose radius and height are R, and this area is rotated in the direction of \({U_{D}}\) based on the angle \(\alpha \), so that the origin of the coordinate axes is \({U_{S}}\).

Figure 11
figure 11

Local filtering zone.

For constructing local filtering, three steps are considered. The pseudo-code of this process is presented in Algorithm 2.

  • Transfer the three axes, namely X, Y, and Z, from \(O\left( 0,0,0\right) \) to \({U_{S}}\left( {x_{s}},{y_{s}},{z_{s}}\right) \). This operation converts the Cartesian coordinates of each point, like P, from \(\left( {x_{p}},{y_{p}},{z_{p}}\right) \) into \(\left( {{x'}_{p}},{{y'}_{p}},{{z'}_{p}}\right) \). The mathematical expression of this operation is stated in Eq. (10).

    $$\begin{aligned} \begin{array}{l} {{x'}_{p}}={x_{p}}-{x_{s}} \\ {{y'}_{p}}={y_{p}}-{y_{s}} \\ {{z'}_{p}}={z_{p}}-{z_{s}} \end{array}, \end{aligned}$$
    (10)
  • Rotate the transferred axes, namely \(X'\), \(Y'\), and \(Z'\) according to the rotation angle \(\alpha \) in Fig. 11. \(\alpha \) is the angle between the z-axis and the line segment from \({U_{S}}\) to \({U_{D}}\). This angle is obtained from Eq. (11).

    $$\begin{aligned} \begin{array}{l} \alpha =\arccos \left( \frac{{z_{d}}-{z_{s}}}{\sqrt{{{\left( {x_{d}}-{x_{s}} \right) }^{2}}+{{\left( {y_{d}}-{y_{s}}\right) }^{2}}+{{\left( {z_{d}}-{z_{s}}\right) }^{2}}}} \right) ,\,\,\,\,\, \\ 0\le \alpha \le 2\pi \end{array}, \end{aligned}$$
    (11)

    After rotating the coordinate axes, the Cartesian coordinates of each point, like P, is converted from \(\left( {x'}_{p},{y'}_{p},{z'}_{p}\right) \) into \(\left( {x''}_{p},{y''}_{p},{z''}_{p}\right) \). In LFEAR, the cylindrical coordinate system is used to calculate the filtered area, and the rotation matrix in this coordinate system is presented in Eq. (12).

    $$\begin{aligned} {R_{z}}\left( \alpha \right) =\left[ \begin{matrix} \cos \alpha &{} -\sin \alpha &{} 0 \\ \sin \alpha &{} \cos \alpha &{} 0 \\ 0 &{} 0 &{} 1 \\ \end{matrix}\right], \end{aligned}$$
    (12)

    The mathematical expression of this rotation operation is presented in Eq. (13).

    $$\begin{aligned} \left[ \begin{matrix} {x''}_{p} \\ {y''}_{p} \\ {z''}_{p} \\ \end{matrix}\right] =\left[ \begin{matrix} \cos \alpha &{} -\sin \alpha &{} 0 \\ \sin \alpha &{} \cos \alpha &{} 0 \\ 0 &{} 0 &{} 1 \\ \end{matrix}\right] \left[ \begin{matrix} {x'}_{p} \\ {y'}_{p} \\ {z'}_{p} \\ \end{matrix}\right], \end{aligned}$$
    (13)
  • Obtain the formulation of the cylindrical area with the radius and height of R in the rotated coordinate system through Eq. (14).

    $$\begin{aligned} 0\le \rho \le R,0\le z\le R,0\le \phi \le 2\pi, \end{aligned}$$
    (14)
Algorithm 2
figure b

Local filtering construction.

Path-finding process

Here, assume that \({U_{S}}\) and \({U_{D}}\) intend to communicate with each other, and \({U_{S}}\) cannot find any valid path in its routing table. Thus, \({U_{S}}\) adjusts the RREQ packet according to the format presented in Fig. 6 in Sect. "Format of control packets" and broadcasts it within its communication radius (i.e. R). The path discovery process in LFEAR is explained based on the example presented in Fig. 12. In this example, \({U_{S}}\) disseminates RREQ for its neighboring UAVs, including \({U_{1}}\), \({U_{2}}\), \({U_{3}}\), \({U_{4}}\), \({U_{5}}\), \({U_{6}}\), and \({U_{7}}\). After receiving this RREQ, these neighbors execute the filtering steps to find out whether they are inside the filtered area of their previous-hop UAV or not. For the general expression of this filtering mechanism, assume that the previous-hop node is \({U_{i}}\), and its coordinates are equal to \(\left( {x_{i}},{y_{i}},{z_{i}}\right) \). In addition, the next-hop UAV is \({U_{j}}\), and its coordinates are equal to \(\left( {x_{j}},{y_{j}},{z_{j}}\right) \). Now, \({U_{j}}\) carries out the four steps to determine whether it is inside the local filtering zone or not.

Figure 12
figure 12

Route discovery process between \({U_{S}}\) and \({U_{D}}\).

  • Step 1: \({U_{j}}\) transfers its spatial coordinates \(\left( {x_{j}},{y_{j}},{z_{j}}\right) \) to the coordinate system with the origin \({U_{i}}\left( {x_{i}},{y_{i}},{z_{i}}\right) \) according to Eq. (15).

    $$\begin{aligned} \begin{array}{l} {x'}_{j}={x_{j}}-{x_{i}} \\ {y'}_{j}={y_{j}}-{y_{i}} \\ {z'}_{j}={z_{j}}-{z_{i}} \\ \end{array}, \end{aligned}$$
    (15)
  • Step 2: \({U_{j}}\) rotates its spatial coordinates \(\left( {x'}_{j},{y'}_{j},{z'}_{j}\right) \) in the coordinate system with the origin \({U_{i}}\left( {x_{i}},{y_{i}},{z_{i}}\right) \) based on the angle \(\alpha \) (calculated based on Eq. (11)). This process is presented in Eq. (16).

    $$\begin{aligned} \left[ \begin{matrix} {x''}_{j} \\ {y''}_{j} \\ {z''}_{j} \\ \end{matrix}\right] =\left[ \begin{matrix} \cos \alpha &{} -\sin \alpha &{} 0 \\ \sin \alpha &{} \cos \alpha &{} 0 \\ 0 &{} 0 &{} 1 \\ \end{matrix}\right] \left[ \begin{matrix} {x'}_{j} \\ {y'}_{j} \\ {z'}_{j} \\ \end{matrix}\right], \end{aligned}$$
    (16)

    Hence,

    $$\begin{aligned} \begin{array}{l} {x''}_{j}={x'}_{j}\cos \alpha -{y'}_{j}\sin \alpha \\ {y''}_{j}={x'}_{j}\sin \alpha +{y'}_{j}\cos \alpha \\ {z''}_{j}={z'} \end{array}, \end{aligned}$$
    (17)
  • Step 3: \({U_{j}}\) converts its spatial coordinates \(\left( {x''}_{j},{y''}_{j},{z''}_{j}\right) \) into cylindrical coordinates using Eq. (18).

    $$\begin{aligned} \begin{array}{l} {\rho }_{j}=\sqrt{{{x''}_{j}}^{2}+{{y''}}_{j}^{2}} \\ {\phi }_{j}=\arctan \left( \frac{{y''}_{j}}{{x''}_{j}}\right) \\ {z_{j}}={z''}_{j} \end{array}, \end{aligned}$$
    (18)
  • Step 4: If the cylindrical coordinates of \({U_{j}}\), i.e. \(\left( {\rho }_{j},{\phi }_{j},{z}_{j}\right) \), satisfy the inequality presented in Eq. (19), \({U_{j}}\) is inside the local filtering zone of its previous-hop node (\({U_{i}}\)). Hence, it rebroadcasts the RREQ packet. Otherwise, the RREQ packet is deleted.

    $$\begin{aligned} 0\le {{\rho }_{j}}\le R,0\le {z_{j}}\le R,0\le {{\phi }_{j}}\le 2\pi, \end{aligned}$$
    (19)

In the example presented in Fig. 12, only two UAVs, namely \({U_{5}}\) and \({U_{6}}\), are allowed to rebroadcast the RREQ packet. Now, these nodes update some fields of this RREQ packet. To generally express how the RREQ packet is updated, assume that the previous-hop UAV and the next-hop one are \({U_{i}}\) and \({U_{j}}\), respectively. \({U_{j}}\) updates the fields of the RREQ packet below.

  • Number of hops (\(\mathbf {HC_{r}}\)): For updating this field of the RREQ packet, \({U_{j}}\) must add one unit to \(HC_{r}\). This is stated in Eq. (20).

    $$\begin{aligned} HC_{r}=HC_{r}+1, \end{aligned}$$
    (20)
  • Route energy (\(\mathbf {{E_{r}}}\)): \({U_{j}}\) obtains its current energy capacity and normalizes it according to Eq. (21).

    $$\begin{aligned} E_{j}^{norm}=\frac{{E_{j}}}{{E_{\max }}}, \end{aligned}$$
    (21)

    where \({E_{j}}\) indicates the residual energy of \({U_{j}}\) and \({E_{\max }}\) denotes the initial energy of UAVs. Now, \({U_{j}}\) compares \(E_{j}^{norm}\) with the value inserted in the field \({E_{r}}\). If \(E_{j}^{norm}<{E_{r}}\), then \({U_{j}}\) updates \({E_{r}}\) in the RREQ packet and inserts \(E_{j}^{norm}\) into this field.

  • Reliable distance (\({\Psi }_{r}\)): To update this field in the RREQ packet, \({U_{j}}\) calculates the distance to \({U_{i}}\) (i.e. its previous-hop node) based on Eq. (22).

    $$\begin{aligned} {D_{ij}}=\sqrt{{{\left( {x_{i}}-{x_{j}}\right) }^{2}}+{{\left( {y_{i}}-{y_{j}} \right) }^{2}}+{{\left( {z_{i}}-{z_{j}}\right) }^{2}}}, \end{aligned}$$
    (22)

    Here, \(\left( {x_{i}},{y_{i}},{z_{i}}\right) \) and \(\left( {x_{j}},{y_{j}},{z_{j}}\right) \) show the spatial coordinates of \({U_{i}}\) and \({U_{j}}\), respectively. Now, \({U_{j}}\) obtains its reliable distance (i.e. \({\Psi }_{ij}\)) based on \({D_{ij}}\). Figure 13 clarifies this concept. In this figure, R is the communication radius of UAVs. According to this figure, the three UAVs, namely \({U_{f}}\), \({U_{p}}\), and \({U_{q}}\) are in the communication range of \({U_{i}}\). \({U_{f}}\) and \({U_{i}}\) have a very short distance from each other i.e. \({D_{if}}\le {R_{\min }}\). In this case, if \({U_{f}}\) is chosen as the next-hop node, there are a high number of hops in the communication route. This increases latency in the routing path. On the other hand, \({U_{p}}\) is very close to the communication boundary of \({U_{i}}\), i.e. \({R_{\max }}<{D_{ip}}\le R\). If \({U_{p}}\) is chosen as the next-hop node, this path has low PDR. This is because \({U_{p}}\) may leave the communication range of \({U_{i}}\), and the created path is extremely unstable. However, the distance between \({U_{q}}\) and \({U_{i}}\) is reliable, i.e. \({R_{\min }}\le {D_{iq}}\le {R_{\max }}\). If \({U_{q}}\) is chosen as the next-hop node, the communication path is stable, and data packets arrive at the destination successfully. \({R_{\min }}\) and \({R_{\max }}\) are the lower and upper borders of \({\Psi }_{ij}\), and their values are empirically selected. In35, the authors stated that if \({R_{\max }}=0.9R\), the data delivery ratio reaches 100%. In addition, the lower border is empirically considered \({R_{\min }}=0.1R\). According to the points mentioned above, \({\Psi }_{ij}\) is calculated through Eq. (23).

    $$\begin{aligned} {\Psi }_{ij}=\left\{ \begin{array}{ll} \frac{{D_{ij}}}{{R_{\min }}},\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,0<{D_{ij}}<{R_{\min }}\,\,\,\,\,\, \\ 1,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,{R_{\min }}\le {D_{ij}}\le {R_{\max }} \\ 1-\left( \frac{{D_{ij}}-{R_{\max }}}{R-{R_{\max }}}\right) ,\,\,\,{R_{\max }}<{D_{ij}}\le R \\ \end{array}\right. \end{aligned}$$
    (23)
    Figure 13
    figure 13

    Concept of reliable distance in the communication range of \({U_{i}}\).

    Now, \({U_{j}}\) compares \({\Psi }_{ij}\) to the value inserted into the field \({\Psi }_{r}\). If \({\Psi }_{ij}<{\Psi }_{r}\), then \({U_{j}}\) updates \({\Psi }_{r}\) and inserts \({\Psi }_{ij}\) into this field.

  • Movement similarity (\(\mathbf {{\vartheta }_{r}}\)): To update this field in the RREQ packet, the similarity between the two speed vectors of \({U_{j}}\) and \({U_{i}}\) is calculated through Eq. (24).

    $$\begin{aligned} cs_{\overrightarrow{{V_{ij}}}}=\frac{V_{i}^{x}V_{j}^{x}+V_{i}^{y}V_{j}^{y}+V_{i}^{z}V_{j}^{z}}{\sqrt{{{\left( V_{i}^{x}\right) }^{2}}+{{\left( V_{i}^{y}\right) }^{2}}+{{\left( V_{i}^{z} \right) }^{2}}}\times \sqrt{{{\left( V_{j}^{x}\right) }^{2}}+{{\left( V_{j}^{y} \right) }^{2}}+{{\left( V_{j}^{z}\right) }^{2}}}}, \end{aligned}$$
    (24)

    where \(\left( V_{i}^{x},V_{i}^{y},V_{i}^{z}\right) \) and \(\left( V_{j}^{x},V_{j}^{y},V_{j}^{z} \right) \) show two speed vectors of \({U_{i}}\) and \({U_{j}}\), respectively. They are calculated through Eqs. (25) and (26), respectively.

    $$\begin{aligned}{} & {} \begin{array}{l} V_{i}^{x}={V_{i}}\sin {{\varphi }_{i}}\cos {{\theta }_{i}} \\ V_{i}^{y}={V_{i}}\sin {{\varphi }_{i}}\sin {{\theta }_{i}} \\ V_{i}^{z}={V_{i}}\cos {{\varphi }_{i}} \end{array}, \end{aligned}$$
    (25)
    $$\begin{aligned}{} & {} \quad \begin{array}{l} V_{j}^{x}={V_{j}}\sin {{\varphi }_{j}}\cos {{\theta }_{j}} \\ V_{j}^{y}={V_{j}}\sin {{\varphi }_{j}}\sin {{\theta }_{j}} \\ V_{j}^{z}={V_{j}}\cos {{\varphi }_{j}} \end{array}, \end{aligned}$$
    (26)

    where \(\left( {V_{i}},{\theta }_{i},{\varphi }_{i}\right) \) and \(\left( {V_{j}},{\theta }_{j},{\varphi }_{j}\right) \) indicate the speed information of \({U_{i}}\) and \({U_{j}}\) in the neighbor table, respectively. Note that \(cs_{\overrightarrow{{V_{ij}}}}\) is limited to \(\left[ -1,1\right] \), but in LFEAR, this parameter is normalized through Eq. (27) to be limited to \(\left[ 0,1\right] \).

    $$\begin{aligned} CS_{\overrightarrow{{V_{ij}}}}=\frac{cs_{\overrightarrow{{V_{ij}}}}+1}{2}, \end{aligned}$$
    (27)

    Now, \({U_{j}}\) compares \(CS_{\overrightarrow{{V_{ij}}}}\) to the value inserted into the field \({\vartheta }_{r}\). If \(CS_{\overrightarrow{{V_{ij}}}}<{\vartheta }_{r}\), then \({U_{j}}\) updates \({\vartheta }_{r}\) and records \(CS_{\overrightarrow{{V_{ij}}}}\) in it.

After updating the RREQ packet, \({U_{5}}\) broadcasts the RREQ packet for its neighbors, namely \({U_{9}}\), \({U_{10}}\), and \({U_{11}}\). This is shown in Fig. 14a. In this figure, \({U_{11}}\) is outside the filtering area and removes the RREQ packet. \({U_{6}}\) transmits the RREQ packet to its neighboring UAVs, namely \({U_{8}}\) and \({U_{9}}\). This process is shown in Fig. 14b. In this figure, \({U_{8}}\) is outside the local filtering and removes the RREQ packet, but \({U_{9}}\) rebroadcasts this packet. In the next step, \({U_{9}}\) and \({U_{10}}\) execute the RREQ rebroadcast process, which is displayed in Fig. 15a and b, respectively. At the last step, \({U_{13}}\) and \({U_{14}}\) execute the RREQ rebroadcast process, which is depicted in Fig. 16a and b, respectively. Finally, the RREQ packet reaches \({U_{D}}\), and the path discovery process ends. The pseudo-code of this process is stated in Algorithm 3.

Figure 14
figure 14

Route discovery process in the second step.

Figure 15
figure 15

Route discovery process in the third step.

Figure 16
figure 16

Route discovery process in the fourth step.

Algorithm 3
figure c

Route finding.

Selection of the best route

After ending the route discovery procedure, the two paths are constructed between \({U_{S}}\) and \({U_{D}}\). As shown in Fig. 17, these two paths are \(PATH1:{U_{S}}-{U_{5}}-{U_{10}}-{U_{13}}-{U_{D}}\) and \(PATH2:{U_{S}}-{U_{6}}-{U_{9}}-{U_{14}}-{U_{D}}\).

Figure 17
figure 17

Construction of two routes between \({U_{S}}\) and \({U_{D}}\).

Now, \({U_{D}}\) begins the route selection process. In the current phase, \({U_{D}}\) should choose the best route from the constructed paths. Therefore, \({U_{D}}\) extracts information about each route \({P_{r}}\), namely, \(HC_{r}\), \({E_{r}}\), \({\Psi }_{r}\), and \({\vartheta }_{r}\) from the relevant RREQ packet and calculates the score \({S_{r}}\) based on Eq. (28).

$$\begin{aligned} {S_{r}}={{\ell }_{1}}\left( 1-\frac{HC_{r}}{n-1}\right) +{{\ell }_{2}}{E_{r}}+{{\ell }_{3}}{{\Psi }_{r}}+{{\ell }_{4}}{{\vartheta }_{r}}, \end{aligned}$$
(28)

where \({\ell }_{1}\), \({\ell }_{2}\), \({\ell }_{3}\), and \({\ell }_{4}\) are weight coefficients in \(\left[ 0,1\right] \) so that \({\ell }_{1}+{\ell }_{2}+{\ell }_{3}+{\ell }_{4}=1\). In LFEAR, these coefficients have the same value i.e. \({\ell }_{1}={\ell }_{2}={\ell }_{3}={\ell }_{4}=\frac{1}{4}\). Also, n is the number of UAVs in the network.

Then, \({U_{D}}\) selects \({P_{r}}\) with the highest route and sends the RREP packet to \({U_{S}}\) through it. In Fig. 18, \({U_{D}}\) chooses \(PATH1:{U_{S}}-{U_{5}}-{U_{10}}-{U_{13}}-{U_{D}}\). Then, \({U_{S}}\) keeps this path in its neighbor table to exploit it for communicating with \({U_{D}}\). The pseudo-code of this process is stated in Algorithm 4.

Figure 18
figure 18

Selection of the best route.

Algorithm 4
figure d

Selection the best route.

Simulation and result evaluation

In this section, the simulation process of LFEAR is described using the NS2 simulator. In the simulation environment, the length, width, and height of the network are \(X=10000\,\,m\), \(Y=10000\,\,m\), and \(Z=10000\,\,m\), respectively. In this environment, the number of flying nodes varies from 5 to 30, and the speed of these nodes is limited to \(10-110\,\,m/s\). The movement pattern of these nodes in the network environment is defined based on the random waypoint mobility model. Each flying node has a 250-meter communication radius, and its initial energy equals 100 joules. The total simulation time is 150 seconds. The traffic model is defined according to the constant bit rate model (CBR). In this model, data packets are 512 bytes, and the bit rate is 2 Mbps. Table 3 introduces the most important simulation parameters. Note that two simulation scenarios are considered to accurately evaluate network performance in different methods. The first scenario assumes that network density varies from 5 to 30 nodes, and these flying nodes have a speed of \(60\,\,m/s\). The second scenario assumes that the speed of flying nodes varies from 10 to \(110\,\,m/s\), while the network density is adjusted to 10 nodes. Then, network performance is evaluated in terms of five criteria, namely energy consumption, data delivery rate, network lifespan, routing overhead, and delay. These simulation results compare and evaluate the four routing methods, including LFEAR, EARVRT39, LoCaL40, and O-LAR41. To enhance the accuracy of the simulation results, multiple runs are executed for each scenario and the gathered data is averaged. To extract the average data, each simulation process is repeated 10 times.

  • Energy consumption (EC): Equation (29) calculates the average energy consumption of each UAV when transmitting a data packet to GCS.

    $$\begin{aligned} EC=\frac{{E_{Consumed}}}{n\times {n_{PK_{d}}}}, \end{aligned}$$
    (29)

    here \({E_{Consumed}}\) indicates the sum of the energy consumption of UAVs when transmitting and getting data packets at a work period, n is the number of UAVs, and \({n_{PK_{d}}}\) denotes the number of packets delivered to GCS.

  • Packet delivery rate (PDR): Equation (30) calculates this criterion, which is the ratio of the packets received by GCS to all packets transmitted by the source UAV.

    $$\begin{aligned} PDR=\left( \frac{{n_{PK_{d}}}}{{n_{PK_{s}}}}\right) \times 100. \end{aligned}$$
    (30)

    here \({n_{PK_{d}}}\) counts the number of the data packets delivered to GCS, and \({n_{PK_{s}}}\) counts the number of the data packets sent by the source UAV, respectively.

  • Network lifetime: This criterion represents the time interval when the network begins its activity until the first node dies (FND).

  • Routing overhead (RO): Equation (31) calculates this criterion, which is the ratio of the number of control packets (Beacons, RREQs, and RREPs) to the number of transmitted data packets.

    $$\begin{aligned} RO=\left( \frac{{n_{PK_{Beacon}}}+{n_{PK_{RREQ}}}+{n_{PK_{RREP}}}}{{n_{PK_{s}}}}\right) \times 100, \end{aligned}$$
    (31)

    where \({n_{PK_{Beacon}}}\), \({n_{PK_{RREQ}}}\), \({n_{PK_{RREP}}}\), and \({n_{PK_{s}}}\) denote the number of beacons, RREQs, RREPs, and sent packets, respectively.

  • End-to-end delay (EED): Equation (32) calculates EED, which is the average required time to transmit the data packet from the source UAV to GCS.

    $$\begin{aligned} EED=\frac{\sum \limits _{PK_{i}\in P=\left\{ PK_{1},...,PK_{n}\right\} }{\left( t_{D}^{PK_{i}}-t_{S}^{PK_{i}}\right) }}{{n_{PK_{d}}}}, \end{aligned}$$
    (32)

    here \({n_{PK_{d}}}\) is the number of packets received by GCS, \(PK_{i}\) denotes i-th delivered packet, P denotes the set of these packets. \(t_{D}^{PK_{i}}\) is the delivery time and \(t_{S}^{PK_{i}}\) denotes the sent time.

Table 3 Simulation settings.

Energy consumption

Figure 19 and Table 4 compare several routing approaches in terms of energy consumption in the first simulation scenario. In this figure, energy consumption in LFEAR is 1.33%, 11.59%, and 24.45% less than that in EARVRT, LoCaL, and O-LAR, respectively. Figure 20 and Table 5 also show the energy consumption of different methods in the second simulation scenario. According to this figure, LFEAR reduces energy consumption by 5.55%, 6.98%, and 16.79% compared to EARVRT, LoCaL, and O-LAR, respectively. There are several reasons, which are addressed below. In LFEAR, the number of relay nodes in the route discovery process is managed using local filtering. Hence, the broadcast range of the RREQ packet is limited in the network and the broadcasting storm issue in FANET does not occur. This can improve energy consumption in the network. Furthermore, in the routing process, the RREQ packet stores the route energy parameter, which shows the lowest energy level of UAVs in this route. This field determines the energy crisis point in the routing path. In the route selection process, the destination node seeks to find the route with the best energy. This increases the stability of the selected path and improves energy consumption in the network. In addition, this reduces the number of low-energy UAVs participating in the route construction process. As a result, the energy consumption of UAVs is balanced in the network. This enhances network lifespan. On the other hand, LFEAR considers the three parameters, namely the route energy, reliable distance, and movement similarity, in the path selection process. The purpose of these three parameters is to increase the stability of the constructed paths to balance the energy consumption of UAVs and improve network lifespan. Among the different routing approaches, EARVRT also works well in terms of energy consumption because it is an energy-aware routing approach and restricts the broadcasting range of RREQs through a virtual tunnel. Additionally, LoCaL utilizes a filtering technique to limit RREQs. However, it does not guarantee path stability. As a result, it is weaker than LFEAR in terms of energy consumption. O-LAR has the worst energy consumption because the filtering technique used in this scheme does not work well.

Figure 19
figure 19

Energy consumption in the first simulation scenario.

Table 4 Energy consumption in the first simulation scenario.
Figure 20
figure 20

Energy consumption in the second simulation scenario.

Table 5 Energy consumption in the second simulation scenario.

Routing overhead

Figure 21 and Table 6 compare the routing schemes in terms of routing overhead in the first simulation scenario. According to this figure, the routing overhead in LFEAR is 16.51% more than that in EARVRT. However, it is 2.33% and 23.03% lower than that in LoCaL and O-LAR, respectively. Figure 22 and Table 7 evaluate the routing approaches in the second simulation scenario. As shown in this figure, the routing overhead in LFEAR is about 23% more than that in EARVRT. However, LFEAR decreases routing overhead by 1.6% and 26.79% in comparison with LoCaL and O-LAR, respectively. Thus, the performance of the proposed method is weaker than EARVRT because LFEAR uses beacon messages to obtain local network topology, but EARVRT does not require these messages. However, LFEAR has less routing overhead than LoCaL and O-LAR. This is because it controls the broadcasting range of RREQs using local filtering. On the other hand, LFEAR takes into consideration three parameters, including route energy, reliable distance, and movement similarity in the path selection process. These parameters help LFEAR find more stable and energy-efficient paths in FANET. This reduces the number of failed routes in the network. Hence, LFEAR lowers the need to find new paths and rebuild failed routes. As a result, routing overhead is better than LoCaL and O-LAR.

Figure 21
figure 21

Routing overhead in the first simulation scenario.

Table 6 Routing overhead in the first simulation scenario.
Figure 22
figure 22

Routing overhead in the second simulation scenario.

Table 7 Routing overhead in the second simulation scenario.

Packet delivery rate

Figure 23 and Table 8 evaluate the routing approaches in terms of packet delivery rate in the first simulation scenario. According to this evaluation, LFEAR increases PDR by 1.77%, 5.14%, and 13.04% compared to EARVRT, LoCaL, and O-LAR, respectively. Figure 24 and Table 9 also test the routing approaches in terms of PDR in the second simulation scenario. This experiment shows that the performance of the proposed scheme is weaker than EARVRT at high speeds, and it has less PDR (approximately 2.29%) than EARVRT. This is because LFEAR is dependent on beacon messages to access local network topology. At high speeds, the network topology experiences more changes. Therefore, this increases errors in the routing process. As a result, the constructed paths are volatile and may be cut off. This lowers PDR. However, EARVRT does not need information about local network topology. Thus, topological changes in the network have less effect on the performance of this method. However, in the second simulation scenario (Fig. 24), LFEAR has a higher PDR than LoCaL and O-LAR. This is because LFEAR uses a criterion called reliable distance in the RREQ packet. This criterion attempts to choose two consecutive UAVs in a routing path in such a way that minimizes the likelihood of leaving the communication range of each other. This means that these UAVs are not close to the communication boundary of each other. As a result, the communication path is valid for a longer time. This improves PDR in the network. In addition, another criterion, namely movement similarity, is inserted into the RREQ packet. This criterion indicates the speed similarity of intermediate UAVs. The purpose of this field is to select the intermediate nodes with similar speeds in the routing path to form stable paths in FANET. In this case, data packets reach the destination successfully. Considering the energy criterion in the routing process helps LFEAR to build stable routes and increase PDR in the network.

Figure 23
figure 23

Packet delivery rate in the first simulation scenario.

Table 8 Packet delivery rate in the first simulation scenario.
Figure 24
figure 24

Packet delivery rate in the second simulation scenario.

Table 9 Packet delivery rate in the second simulation scenario.

Network lifetime

Figure 25 and Table 10 compare the routing approaches in terms of network lifetime (when the first node dies (FND) in the network) in the first simulation scenario. According to this figure, LFEAR increases network lifespan by 6.74%, 3.15%, and 10.85% compared to EARVRT, LoCaL, and O-LAR, respectively. In addition, Fig. 26 and Table 11 test different routing schemes in terms of network lifespan in the second simulation scenario. The experiment shows that the network lifetime in LFEAR is about 5.67%, 4.64%, and 22.63% more than that in EARVRT, LoCaL, and O-LAR, respectively. The most important reason is that LFEAR can optimize energy consumption in the network so that UAVs consume energy uniformly. Other reasons for this are mentioned in Sect. "Energy consumption". On the other hand, LFEAR uses a new criterion called reliable distance to choose optimal paths. This criterion causes the two consecutive UAVs in a routing path to be not close to each other. This minimizes the likelihood of leaving the communication range of each other and increases the stability of the constructed paths. As a result, UAVs consume less energy to discover new routes or rebuild failed paths. This improves network lifetime. LFEAR also uses another criterion called movement similarity in the route selection process. This criterion causes intermediate nodes with almost similar speeds to be chosen in the routing path, and consequently, stable paths are constructed in FANET. This stability has a good effect on improving network lifetime because communication paths are valid for a longer time, and LFEAR has little need to find new routes.

Figure 25
figure 25

Network lifetime in the first simulation scenario.

Table 10 Network lifetime in the first simulation scenario.
Figure 26
figure 26

Network lifetime in the second simulation scenario.

Table 11 Network lifetime in the second simulation scenario.

Delay

Figure 27 and Table 12 evaluates the routine approaches in terms of delay in the first simulation scenario. This figure shows that LFEAR reduces latency by 1.71%, 13.53%, and 25.81% compared to EARVRT, LoCaL, and O-LAR, respectively. In addition, Fig. 28 and Table 13 compares the routing schemes in terms of delay in the second simulation scenario. According to this figure, the delay in LFEAR is about 6.67% more than that in EARVRT. However, it is about 3.03% and 20% better than that in LoCaL and O-LAR, respectively. The proposed scheme has weaker performance than EARVRT. This is because LFEAR has a neighboring table construction phase, which does not exist in EARVRT. This phase leads to accurate decisions in the route discovery process, but it increases delay. However, the better performance of the proposed scheme compared to LoCaL and O-LAR is due to local filtering, which controls the broadcasting range of RREQs in the network. This accelerates the path discovery process in the network. On the other hand, the route selection process considers the three parameters, including energy, reliable distance, and movement similarity, and consequently, it has a good ability to find stable routes for FANET. This reduces the need for rebuilding the broken paths and lowers delay in the network.

Figure 27
figure 27

Delay in the first simulation scenario.

Table 12 Delay in the first simulation scenario.
Figure 28
figure 28

Delay in the second simulation scenario.

Table 13 Delay in the second simulation scenario.

Conclusion

In this paper, a local filtering-based energy-aware routing scheme (LFEAR) was suggested for FANETs. LFEAR seeks to improve the adaptability of AODV to FANET and solve the broadcasting storm issue in AODV. Overall, LFEAR consists of two phases: neighbor table construction and route discovery. To solve the broadcasting storm issue, LFEAR uses local filtering to limit the broadcasting range of RREQs. Additionally, LFEAR improves the template of RREQ by adding three other fields, namely route energy, reliable distance, and movement similarity to create stable and energy-efficient routes between UAVs. After discovering different paths, the route selection process begins, and a score is calculated for each path. This score combines the number of hops, route energy, reliable distance, and movement similarity. Finally, the route with the highest score performs the data transmission process. Finally, the simulation process of LFEAR is performed using the NS2 simulator, and two simulation scenarios are defined based on the network density and the speed of UAVs. In the first scenario, LFEAR improves energy consumption, PDR, network lifetime, and delay by 1.33%, 1.77%, 6.74%, and 1.71%, respectively. However, routing overhead in LFEAR is approximately 16.51% more than that in EARVRT. In the second scenario, LFEAR optimizes energy consumption and network lifetime by 5.55% and 5.67% respectively, but its performance in terms of routing overhead, PDR, and delay is 23%, 2.29%, and 67.67% weaker than EARVRT. LFEAR experiences a weak network performance when UAVs move at high speeds. Thus, in future research directions, we attempt to increase its adaptability to the dynamic environment of FANET and improve its performance at high speeds. In this regard, future research attempts to decrease routing overhead in the network by adjusting an adaptive beacon period. To design this period, swarm intelligence techniques and machine learning (ML) can be used. Also, the routing process can be strengthened by adding artificial intelligence (AI) techniques and other optimization methods. These techniques can be used to intelligently design local filtering and lower routing overhead and delay.