An energy-aware routing method using firefly algorithm for flying ad hoc networks

Flying ad-hoc networks (FANETs) include a large number of drones, which communicate with each other based on an ad hoc model. These networks provide new opportunities for various applications such as military, industrial, and civilian applications. However, FANETs have faced with many challenges like high-speed nodes, low density, and rapid changes in the topology. As a result, routing is a challenging issue in these networks. In this paper, we propose an energy-aware routing scheme in FANETs. This scheme is inspired by the optimized link state routing (OLSR). In the proposed routing scheme, we estimate the connection quality between two flying nodes using a new technique, which utilizes two parameters, including ratio of sent/received of hello packets and connection time. Also, our proposed method selects multipoint relays (MPRs) using the firefly algorithm. It chooses a node with high residual energy, high connection quality, more neighborhood degree, and higher willingness as MPR. Finally, our proposed scheme creates routes between different nodes based on energy and connection quality. Our proposed routing scheme is simulated using the network simulator version 3 (NS3). We compare its simulation results with the greedy optimized link state routing (G-OLSR) and the optimized link state routing (OLSR). These results show that our method outperforms G-OLSR and OLSR in terms of delay, packet delivery rate, throughput, and energy consumption. However, our proposed routing scheme increases slightly routing overhead compared to G-OLSR.

• Improving the Hello message format and the topology control (TC) message format.
• Proposing a new scheme for calculating the connection quality.
• Selecting MPR nodes using the firefly algorithm.
• Calculating the routing table based on energy and connection quality.
The rest of the paper is organized as follows: In "Related works" section, we examine various routing methods presented in FANETs. In "Basic concepts" section, we define the concepts related to the firefly algorithm, which is used in the proposed method. In "Network model" section, we present the network model used in our method. In "Proposed method" section, we describe the proposed routing method in detail. In "Simulation and evaluation of results" section, we simulate the proposed method and compare its results with G-OLSR and OLSR. In "Conclusion" section, we conclude the paper.

Related works
Lee et al. 30 suggested an energy-aware and predictive fuzzy logic-based routing scheme in FANETs. This approach includes two processes: route discovery and route maintenance. In the route discovery process, each UAV calculates its score based on movement direction, remaining energy, link quality, and node stability. If the node achieves enough score, it can participate in rebroadcasting route request messages (RREQs) and otherwise, it is not allowed to do this. The purpose of this work is to balance energy consumption, reduce congestion in the network, and control the broadcast storm problem. When RREQ messages arrive at the destination, the destination node selects the best path to the source node using the fuzzy system. The best path is a route with a minimum number of hops, low delay, and high fitness. In the route maintenance process, two issues are addressed: preventing path failure and rebuilding failed paths. This method creates stable routes between network nodes. Also, this scheme is simulated in a 3D space. However, the route maintenance process is slightly ambiguous and can be improved.
Mahmoud and Cho 31 offered a location estimation-based congestion-aware routing method (LECAR) for FANETs. It is a delay-tolerant network (DTN)-based routing scheme and tries to solve two problems in DTNbased routing schemes: high energy consumption and high network congestion. In this method, each node estimates its location and locations of other nodes using the path-planning mechanism and location map. In the routing process, the source node sends its data packet to the node, which is nearer to the destination and has enough buffer capacity. This method successfully balances energy consumption in the network and prevents network congestion. However, it has high communication overhead and delay. This method is simulated in a two-dimensional space that is not compatible with FANETs.
Clausen et al. 32 presented the optimized link state routing protocol (OLSR) for mobile ad hoc networks (MANETs). It is one of the well-known proactive routing schemes. OLSR depends on multipoint relays (MPRs), which are tasked to produce and forward topology messages in the network. However, OLSR has several disadvantages, including high communication overhead and delay. Therefore, OLSR is not suitable for delay-intolerant applications. Today, many researchers focus on OLSR to modify this protocol for FANETs.
For example, Ali et al. 33 proposed the greedy optimized link state routing (G-OLSR) scheme for FANETs. G-OLSR merges two methods, including the greedy perimeter stateless routing (GPSR) and OLSR. G-OLSR minimizes communication overhead and delay in the network. As a result, it is suitable for delay-intolerant applications. This method utilizes a self-adaptation approach when varying network topology. This enhances the network performance. A greedy approach is applied for choosing the next-hop node. In this approach, the next-hop node is selected based on maximum distance from the source toward the destination. When the greedy approach cannot find the next-hop node, G-OLSR switches to the route recovery mode. This case occurs when there is no node whose distance toward the destination node is longer than the previous-hop node. In the recovery mode, G-OLSR considers the angle between a neighboring node and the destination node to select the next-hop node. This method is simulated in a 3D space, which is suitable for FANET. However, G-OLSR ignores the energy and link quality in the routing process. In G-OLSR, unstable paths may be created. www.nature.com/scientificreports/ Rahmani et al. 34 presented a fuzzy-based routing protocol called OLSR+ for flying ad hoc networks. It is an improved version of the optimized link state routing protocol (OLSR). In this method, the authors proposed a new technique to calculate the lifetime of the link between two UAVs. The link lifetime is obtained based on the received signal strength indication (RSSI), Euclidean distance, relative velocity, and motion direction. Then, MPRs are selected using a fuzzy system. This fuzzy system consists of three inputs, including the residual energy of a neighboring UAV, link lifetime, and the degree of a neighboring UAV. The fuzzy output indicates the chance of a neighboring node to be selected as MPR. Finally, the routing paths are determined between the nodes based on three parameters, including the number of hops, route energy, and route lifetime. The simulation results indicate that OLSR+ has a successful performance in terms of delay and energy consumption. However, OLSR+ has a lot of communication overhead.
Ma et al. 35 offered the velocity-aware and stability-estimation-based multi-path routing protocol (VaSe-MRP) in FANETs. This routing scheme includes two steps: route discovery and route maintenance. In the first step, the authors present a forwarding mechanism, which is based on the velocity of nodes and categorizes the nodes into two classes: reliable class and non-reliable class. Next-hop nodes are selected from reliable class. Also, VaSe-MRP calculates the link stability time and selects several routes between transmitter and receiver. Therefore, VaSe-MRP increases packet delivery rate. However, it is implemented in a 2D space, which is not suitable for FANET. VaSe-MRP considers a very low speed for nodes when simulating this scheme. Therefore, it must be evaluated for high-speed nodes.
Chen et al. 36 suggested the traffic-aware Q-network enhanced geographic routing scheme (TQNGPSR). TQNGPSR presents a new mechanism based on congestion information. This mechanism balances network traffic. Furthermore, this scheme utilizes the Q-network reinforcement algorithm to analyze link quality according to the congestion information. In fact, the Q-value represents the link quality. Finally, TQNGPSR chooses routes based on Q-value. These routes include low delay, low packet loss rate, and low traffic. However, TQNGPSR is implemented in a 2D space, which is a false option for FANETs. This scheme does not consider the energy parameter and link lifetime. However, they are very important when designing a routing protocol in FANETs. Also, it includes a high communication overhead.
Oubbati et al. 37 proposed the energy-efficient connectivity-aware data delivery (ECaD) for FANETs. This scheme prevents route failure and reconstructs failed routes. In ECaD, the energy parameter, link lifetime, and delay are considered in the routing process. If UAVs have enough energy, they can rebroadcast RREQ messages and otherwise, they do not participate in this process. This work balances energy consumption in the network. It is simulated in a 3D space, which is a suitable option for FANET. However, ECaD ignores the movement direction and the link quality when selecting routes.
Liu et al. 38 proposed the Q-learning-based multi-objective routing protocol (QMR) for FANETs. QMR utilizes a reinforcement algorithm (Q-learning) for finding paths. Firstly, QMR sets the learning rate and the discount factor in Q-learning algorithm according to network conditions. This scheme decreases delay and energy consumption. In QMR, each node estimates the future status of its neighbors in the network. This advantage helps nodes to choose the best next-hop nodes. QMR considers various parameters like, speed, movement direction, and delay in the routing process. This scheme builds stable route in the network. Furthermore, QMR is simulated in a 2D space, which is a false option for FANET. In addition, QMR predicts route failure and rebuilds failed routes. However, QMR has a major disadvantage. It cannot control swarm connectivity.

Basic concepts
In this section, we explain the firefly algorithm (FA) briefly because this concept is used in our approach for selecting MPR nodes.
Firefly algorithm. In late 2007, Xin-She Yang introduced the firefly algorithm (FA). FA is inspired by optical patterns and the behavior of fireflies 29 . FA is based on several rules: • Fireflies are single-sex. This means that fireflies are attracted to each other without considering their sex.
• Attractiveness of fireflies is defined based on their brightness. This means that the less bright fireflies are attracted to brighter fireflies. When the distance between fireflies increases, their attractiveness decreases. If there is not a brighter firefly, the movement of fireflies is random. • An objective function is defined for calculating the brightness of fireflies.
FA considers two parameters: the variation of light intensity and attractiveness. Attractiveness is obtained based on brightness. Furthermore, brightness is defined based an objective function.
Brightness of a firefly (i.e. I) at a specific position x is I(x) ∝ f (x) . However, attractiveness (i.e. β ) ia relative and depends on the distance r ij between firefly i and firefly j . Moreover, if firefly is far from the light source, the light intensity reduces. Furthermore, the media absorbs light. Moreover, attractiveness depends on the absorption degree. Usually, the light intensity I(r) varies according to the inverse-square law expressed in Eq. (1): where, I s indicates the intensity at the source.
Assume a specific medium, which has a constant light absorption coefficient γ , Eq. (2) computes I according to the distance r: Also, Eq. (4) computes β of a firefly: where, β 0 is the attractiveness at r = 0 . Equation (4) is estimated as Eq. (5) because 1 1+r 2 is computed faster than an exponential function: Equation (6) expresses the distance between firefly i and firefly j at z i and z j , respectively: where, z i,k , is the kth component of the spatial coordinate z i of ith firefly.
According to Eq. (7), the firefly i is attracted to more attractive firefly j : where, attraction is expressed in the second phrase. Also, randomization is created using the third phrase. It is achieved through the randomization parameter α . And, i indicates a vector of random numbers. Note that, ǫ i can be replaced with rand −1 2 so that rand generates a random number in [0, 1]. Generally, it is assumed that β 0 = 1 and α ∈ [0, 1] . For more details, please refer to Ref. 29 . We use FA to select MPR nodes in the network because this algorithm can satisfactorily explore the optimal global response. Also, FA has a high convergence speed and acceptable accuracy. Furthermore, it can make a balance between global search and local search and is implemented easily.

Network model
In the proposed routing method, we assume that the network includes N nodes such as UAV i , i = 1, 2, . . . , N . Each node has a unique identifier ( ID UAV i ). These nodes are randomly distributed in FANET. FANET is a threedimensional environment and the position of nodes is represented based on length, width, and height. Each node is connected to the global positioning system (GPS) to know its position x t i , y t i , z t i and its speed v t x,i , v t y,i , v t z,i at moment t. Also, nodes move at a speed V UAV in the network. Therefore, the network topology changes continuously and communication links fail. In addition, it is assumed that the network supports UAV to UAV communications (U2U) and UAV to GS communications (U2G). In U2G communication, a small number of UAVs communicate directly with GS, other UAVs act as a relay node and transmit data packets in a multi-hop manner. We use the IEEE 802.11a protocol as a wireless interface in the MAC layer of each UAV because it provides appropriate bandwidth. Also, it supports high-dynamic topologies and provides a wide range of wireless communication. The network model is shown in Fig. 1.

Proposed method
In this paper, we propose an energy-aware routing scheme for FANETs. This method is inspired by OLSR. The proposed scheme includes five steps: • Improving the Hello message format and the neighborhood table.
• Calculating the connection quality.
• Introducing the MPR-FA approach to select MPRs.
• Modifying the TC message format.
In the following, these steps are described in detail. Moreover, we present the most important symbols used in our scheme in Table 1.

Hello message format and neighborhood table.
A Hello message is sent to its neighboring UAVs by each UAV i ( i = 1, . . . , N ). After receiving this message, UAV i knows all its own single-hop and two-hop neighboring UAVs in the network. Figure    (4) β = β 0 e −γ r 2 , www.nature.com/scientificreports/ color) and E UAV (Purple color). The Position UAV field indicates spatial coordinates of UAV i , which is obtained using GPS. The E UAV field represents the remaining energy of UAV i . According to Hello message received from neighboring UAVs, a neighborhood table is built in UAV i . For twohop neighbors, the format of this table is similar to OLSR. But, for single-hop neighbors, this table maintains their main address, their status (symmetric or non-symmetric), their willingness value, their position, their velocity, their remaining energy, and their connection quality. In the following, we describe the most important parameters for single-hop neighbors:  Table 1. Symbols used in the paper.

N
The total number of UAVs Velocity of UAV i at moment t

CQ ij
The quality of the link between UAV i and UAV j

CQ initial ij
The quality of the initial connection between UAV i and UAV j www.nature.com/scientificreports/ • Willingness UAV i obtains this parameter from the Hello message. It represents the willingness of a node to carry and send traffic to other nodes. It is a integer number in [0, 7]. • Position UAV i extracts the spatial coordinates of its neighboring UAV from the Position UAV field in the Hello message. • Velocity UAV i calculates the velocity of a single-hop neighboring node such as UAV j using the Position UAV field in two sequential Hello messages. This is expressed in Eq. (8): where, x p j , y p j , z p j represents the spatial coordinates of UAV j at the moment t p and x is the spatial coordinates of UAV j at the moment t p−1 .
• Remaining energy UAV i extracts the remaining energy of its neighbors from the E UAV field in the Hello message. • Connection qualit (CQ ij ) UAV i calculates this parameter according to Eq. (10) described in "Calculatingtheconnectionquality" section.
Calculating the connection quality. In a dynamic environment such as FANET, the quality of the connection between two nodes cannot be easily evaluated because the nodes are highly moving and their connection quality changes over time. Therefore, we estimate the quality of the connection between UAV i and UAV j (which is called CQ ij ) using an approximate model. According to this model, UAV i measures the quality of the initial connection between itself and UAV j (which is called CQ initial ij ) based on the ratio of Hello packets received by UAV i to the total messages transmitted from UAV j to UAV i at a time interval ( τ ). Note that each node uses a counter for counting the number of Hello messages received from its neighbors within its communication range. Also, we know that Hello messages are sent in a certain time period (for example, one second), so we can obtain the number of sent messages in a time interval. As a result, each node calculates the Hello packet reception rate to evaluate the connection quality. CQ initial ij is calculated according to Eq. (9): where, R hello i, j and S hello i, j indicate the number of Hello messages received by UAV i and the number of Hello messages sent from UAV j to UAV i in the time period τ , respectively.
Note that the connection quality is not a fixed parameter and changes over time.
To evaluate the quality of the connection between two nodes at any moment, the connection quality is updated based on the connection time. Therefore, CQ ij (t) is calculated at the moment t, according to Eq. (10): where, CT ij (t) indicates the connection time of link between UAV i and UAV j . CT ij (t) is calculated using Eq. (11). According to Eq. (10), if CT ij (t) is high (i.e. it is close to one), the connection quality is close to the initial connection quality. Also, when the connection time is low (i.e. it is close to zero), the connection quality will be lower than the initial connection quality.
In Eq. (11), the connection time between between UAV i and UAV j is calculated based on two parameters, including the Euclidean distance and relative velocity of UAV j with regard to UAV i . In this equation, the movement direction is also considered.
where, T max indicates the maximum connection time. This parameter is a fixed value and is determined based on the simulation time. R is the communication radius of UAVs. Also, x t i , y t i , z t i and V t i indicate spatial coordinates and speed of UAV i at time t, respectively. x t j , y t j , z t j and V t j are spatial coordinates and speed of UAV j at www.nature.com/scientificreports/ the moment t, respectively. In addition, �θ ij is the movement direction of UAV j with regard to UAV i . It is obtained according to Eq. (12): where, v t x,i , v t y,i , v t z,i and v t x,j , v t y,j , v t z,j indicate the velocity vectors of UAV i and UAV j at the moment t, respec- Finally, 1 and 2 are configuration parameters in Eq. (11). These parameters are determined based on the four modes: • Mode 1 When UAV i and UAV j move in the same direction (i.e. 0 ≤ �θ ij ≤ π 2 ), and UAV i is ahead of UAV j (see Fig. 3a). Then, 1 = 1 and 2 = 1.
Each UAV i ( i = 1, . . . , N ) must select a set of its neighbors as "multipoint relays"(MPRs). This set is called SET MPR (UAV i ) . When calculating various routes, MPRs are responsible for creating the route from a source node to any destination in the network. This means that only these nodes can forward control message (TC message) into the network. This reduces the number of transmission when flooding control traffic. In this section, we present the MPR-FA approach based on firefly algorithm to select UAV MPR (see Fig. 4). In this process, we assume that each firefly expresses each symmetric single-hop neighbor of UAV i such as UAV j . Firstly, a random value is assigned to each firefly. As a result, UAV i considers each of its symmetric single-hop neighbors as a www.nature.com/scientificreports/ firefly, which can be selected as UAV MPR . Rand function determines the initial attractiveness of a firefly. The end condition for this algorithm is equal to 100 iterations. Finally, a firefly having the most fitness value is selected as a MPR node. In the proposed algorithm, each UAV i follows the following steps: 1. Consider each of its symmetric single-hop neighbors as a firefly. 2. Initialize the firefly population randomly. 3. Set SET MPR (UAV i ) = ∅. 4. Prepare the two-hop neighbor list of UAV i ( List 2Hop−Neighbor ). 5. Insert the identifier of all symmetric single-hop neighbors of UAV i , which their willingness is equal to "WILL-ALWAYS", into SET MPR (UAV i ).
6. Calculate the degree of each single-hop neighbor (i.e. the number of its symmetric neighbors), like UAV j according to the information in its neighborhood table. This metric is represented as D UAV j . 7. Insert the identifier of a single-hop neighbor into SET MPR (UAV i ) , when UAV i can communicate with its two-hop neighbor only by this single-hop neighbor.
8. Remove identifiers of all two-hop neighbors from List 2hop-neighbor when they are covered by at least one MPR.
9. Repeat the following steps until List 2hop-neighbor = ∅: • Calculate the fitness function presented in Eq. (18) for each firefly. This function is calculated based on four parameters. We explain these parameters in the following: This metric indicate the remaining energy of each firefly at any moment to determine how much the UAV has the ability to manage the required network tasks and can continue its activity in the network. This metric helps UAV i to choose high-energy nodes as UAV MPR . This is because MPRs have high communication overhead and require a lot of energy. Thus, this parameter leads to energy saving and higher lifetime. Each UAV loses a certain value of its energy for sending and receiving data or doing internal operations such as computing, linking, updating. Remaining energy is equal to the UAV energy level after doing these operations. If the remaining energy is lower than the threshold ( E Min j ), UAV cannot be selected as UAV MPR to participate in the routing process. To choose UAV MPR , each node acquires the remaining energy of its neighbors by exchanging the Hello message. Assume that E Max j (t) is the primary energy of UAV j at the moment t. The remaining energy of UAV j ( E Residual j ) is obtained after a time interval τ using Eq. (13): where, E Consumed j (t + τ ) indicates the consumed energy of UAV j at time interval τ . This parameter is due to sending, receiving data and internal operations done by UAV j in this interval. Also, the consumed energy for receiving l bits, namely E Received j (t + τ ) and the consumed energy for sending l bits, namely E Send j (t + τ ) (when the Euclidean distance between UAV j and UAV i is equal to d ij ) are calculated according to Eqs. (14) and (15), respectively: So that E elec is the energy consumed by transceiver circuit for a single bit, d ij is the Euclidean distance between UAV i and UAV j . Additionally, E amp indicates the energy required by amplifier. In addition, the energy consumption of UAVs for doing internal operations is displayed as E Computing j (t + τ ) . Therefore, the consumed energy of UAV j in a time interval τ is equal to the total energy consumption of this node for sending/receiving data and internal operations. It is calculated through Eq. (16): As a result, Eq. (13) is written as follows: -CQ i,j This parameter is calculated using Eq. (10). When CQ i,j is high, this means that the communication between UAV i and UAV j is more stable. -D Neighbor It is the number of two-hop neighbors of UAV i that are covered by UAV j . When D Neighbor of UAV j is high, the communication overhead is reduced. UAV i extracts D Neighbor from its neighborhood table. -W j It indicates the willingness of UAV j to carry and send traffic to other UAVs, so that 1 ≤ W i ≤ 7 . UAV i extracts W j from its neighborhood table. When W j is high, UAV j has more chance to be selected as a MPR node. Now, we have: Discovering network topology. In this phase, UAV MPR nodes broadcast the topology control (TC) message in the network. When a UAV MPR receives this message, it rebroadcasts TC message in the network. TC message format is shown in Fig. 5. We add two fields, including E Path and CQ Path , to this message. These fields are shown in Fig. 5 with yellow and purple colors, respectively. In the following, we explain how calculate these two parameters. where, M i is the number of UAV MPR nodes in Route i . In addition, CQ UAV MPR j−1 ,UAV MPR j indicates the connection quality of the link between UAV MPR j and its previous hop node, namely UAV MPR j−1 in Route i .
After broadcasting the TC message, each node in the network creates a topology table. Note that the topology table template in our scheme is similar to OLSR, but there are two differences. We add two fields, including E Path and CQ Path to the topology table. The topology table format is presented in Table 2. In the following, we explain the fields of this table. Note that the topology table is used to calculate the routing table, which is explained in "Computing different routes" section.
• UAV Destination This field indicates the main address of the neighboring node. It is obtained from the Advertised Neighbor Main Address field in the TC message. • UAV Last-hop This field indicates the address of UAV MPR , which sends the TC message.
• ANSN This field is the sequence number that is obtained from the TC message. It is used to detect duplicated TC messages. • E Path In the topology table, we record the route energy. It is achieved from the TC message.
• CQ Path In the topology table, we record route quality, which is obtained from the TC message.
• Time Valid This field indicates the validity time of this entry in the topology table.  www.nature.com/scientificreports/ Figure 6 represents the flowchart of the network topology discovery.
Computing different routes. In the route calculation process, OLSR only considers hop count. However, the proposed method considers several parameters for this process. They include hop count, route energy, and route quality. As a result, our approach creates more stable routes. Table 3 shows the routing table stored in the  memory of the nodes. Note that if the neighborhood table or the topology table have changed, the routing table  must be re-calculated. Initially, we introduce the fields of the routing table. • UAV Destination This field is the destination node address.
• UAV Next-hop This field indicates the next-hop address to reach the destination node.
• Hop Count This field represents the number of hops from the current node to the destination node.
• Interface_address This field is the local interface address to send data to the next-hop node.
In the following, we describe steps for calculating the routing table. Furthermore, it is expressed in Fig. 7.
• UAV i , ( i = 1, ..., N ), extracts the address of its single-hop neighbors from the neighborhood table and inserts them as the destination node into the routing table. In this case, the UAV Next-hop field is also equal to the node address. • UAV i extracts the address of the two-hop neighbors from the neighborhood table and inserts them as the destination node into the routing table. Note that UAV i records the address of UAV MPR related to the two-hop neighbor in the UAV Next-hop field. If UAV i checks its neighborhood table and finds that UAV 2-hop-neighbor is related with several UAV MPR nodes, then UAV i calculates Rank MPR for these UAV MPR nodes and insert the node with the most Rank MPR as the next-hop node into the UAV Next-hop field. This rank is calculated using Eq. (21): Figure 6. Flowchart of the network topology discovery. www.nature.com/scientificreports/ where, CQ i,MPR is the quality of the link between UAV i and UAV MPR . CQ MPR,2-hop-neighbor indicates the quality of the link is between UAV MPR and UAV 2-hop-neighbor . Also, w 1 , w 2 , and w 3 are weight coefficients, so that 3 i=1 w i = 1 and w 1 = w 2 = w 3 = 1 3 . • UAV i inserts the address of multi-hop nodes ( UAV n-hop-neighbor ) as the destination node into its routing table.
First, UAV i checks its topology table. If there are several entries in the topology table for UAV n-hop-neighbor , then UAV i inserts the UAV Last-hop node with the highest Rank Last-hop as the next-hop node into the UAV Next-hop field. Rank Last−hop is calculated using Eq. (23): where, W i is the willingness of a node for transmitting traffic to other nodes in the network and 0 ≤ W i ≤ 7 . E Path and CQ Path are the route energy and the route quality obtained from the topology table. Also, CQ MAX-Path is the maximum quality of different routes for UAV n-hop-neighbor . It is extracted from the topology table. Also, w 1 , w 2 , and w 3 are weight coefficients, so that 3 i=1 w i = 1 and w 1 = w 2 = w 3 = 1 3 .

Simulation and evaluation of results
In this section, we simulate our method using NS3 software. To simulate the movement of drones in the network, we use the random waypoint mobility (RWP). In RWP, UAVs are stopped at a fixed time interval called the stop period. When this time is terminated, the node selects a random position and a random speed in the simulation environment. Then, it moves toward this position. After the UAV reaches this position, it waits for the stop period to restart its movement. This process continues during all simulation times. In RWP, the most important advantage is its simple implementation. For this reason, most routing methods use this model to simulate the movement of drones in FANET. In the simulation process, assume that the network size is equal to 500 × 1500 × 1500 m 3 . Also, the number of UAVs in the network is between 10 and 50. These nodes are randomly and uniformly distributed in the network. The simulation time is 200 seconds. Table 4 presents the most important simulation parameters in summary. Then, we compare the simulation results of our proposed routing scheme with the two methods, including G-OLSR 33 and OLSR 32 . They are evaluated in terms of delay, routing overhead, packet delivery rate, throughput, and energy consumption.
End-to-end delay. This parameter divides the time required for transferring the message from the source node to the destination node by the total number of nodes in a path. It consists of the transmission delay ( D trans ), the propagation delay of the signal ( D prop ), and the queuing delay ( D queue ) in the entire network. This metric can be calculated using Eq. (24). Figure 8 compares the end-to-end delay in different routing methods. As shown in this figure, our method has the lowest delay in comparison with other routing schemes. In Fig. 8, our scheme reduces the end-to-end delay by 15.29% and 48.20% compared to G-OLSR and OLSR, respectively. The proposed method considers two parameters, including route quality and route energy to make more stable paths. This reduces the number of route failures. Furthermore, it decreases the updating time of the routing table, this helps our scheme to reduce the transmission delay. In contrast, OLSR considers only the number of hops for creating different paths. It is not enough. Also, G-OLSR does not consider energy and link quality in the route establishment process. In G-OLSR, paths are determined by a greedy scheme, which is based on the distance from nodes to the destination. If the  www.nature.com/scientificreports/ greedy method cannot find a proper path to the destination, G-OLSR switches to the route recovery process and selects a node with the minimum angle toward the destination as the next-hop node. This routing strategy reduces the end-to-end delay properly. However, it has weaker performance than our scheme. On the other hand, we design a new approach based on the firefly algorithm for selecting MPRs. According to the MPR-FA algorithm, when nodes have high energy and more stable links and more neighborhood degree, they obtain more fitness to be selected as MPRs. As a result, the MPR-FA scheme helps our approach to select more stable nodes as the MPR node. This increases the network stability. As a result, the paths formed between nodes are valid for more time. This successfully reduces delay in our scheme compared to other methods. According to Fig. 8, when the number of nodes in the network is high, the delay is reduced in our scheme and G-OLSR. While this issue does not affect OLSR and even increases the delay. This is because our method and G-OLSR select optimal routes to the destination. These methods are more consistent with FANETs, and they can manage rapid changes in the topology and high-speed nodes, which fail communication links. While OLSR is not such and cannot manage this condition. As a result, it has a weak performance in FANET.
Routing overhead. This parameter indicates the ratio of Beacon messages to the total number of messages in the network. Figure 9 shows routing overhead in different schemes. As shown in this figure, our method reduces routing overhead compared to OLSR, but it has a weaker performance than G-OLSR. In Fig. 9 our rout-  www.nature.com/scientificreports/ ing method improves the routing overhead in comparison with OLSR (21.74%), while it has a higher routing overhead compared to G-OLSR (6.93%). This is because the proposed scheme uses a firefly algorithm-based mechanism for selecting MPRs. This mechanism increases computational and communication overheads. On the other hand, G-OLSR considers a greedy mechanism for selecting the next-hop node. A combination of the greedy scheme and OLSR helps G-OLSR to reduce routing overhead. Another important point is that in all methods, when increasing the number of nodes in the network, the routing overhead is also increased because in this case, the schemes exchange more Hello messages and TC messages to update neighborhood where, P r is packets received by the destination UAV and P s is packets sent by the source UAV. As shown in Fig. 10, our method has the best PDR compared to G-OLSR and OLSR. In Fig. 10, the proposed routing scheme increases PDR by 2.86% and 9.76% in comparison with G-OLSR and OLSR methods, respectively. When PDR has a better value, this means that routes are more stable. In the proposed method, we focus on the route stability. We consider the energy of nodes in the route calculation process and the MPR selection process so that high-energy nodes have more chance to participate in the route formation process. Also, we focus on the link quality and estimate the connection quality based on the ratio of sent/received of hello packets and connection time to select routes with high quality link for sending data packets. In contrast, OLSR does not consider these parameters. G-OLSR uses a greedy routing process only based on distance. Also, it focuses on only one parameter, namely motion angle in the recovery phase. For these reasons, our method has better performance than OLSR and G-OLSR in terms of PDR. According to Fig. 10, another point is that PDR in different schemes increases when increasing the number of nodes in the network, because it reduces the probability of route failures.
Throughput. This parameter is the ratio of messages delivered to the destination to the total time required to reach the destination. As shown in Fig. 11, our proposed approach improves throughput by 10.17% and 26.46% compared to G-OLSR and OLSR, respectively. This proves that our method form suitable paths between nodes in the network. This is because low-energy nodes do not participate in the route creation process and have a very small chance to be selected as MPR nodes. As a result, routes have more energy and higher lifetime. As a result, our scheme prevents unstable paths. These reasons improve throughput in our method compared to other methods. As shown in Fig. 11, when increasing nodes in the network, throughput is also increased in all methods because this increases the chance to find the suitable paths between nodes and improves connections between nodes in the network.
Energy consumption. In Fig. 12, the average energy consumption is compared in different methods. As shown in this figure, our method has the lowest energy consumption than other schemes. Based on Fig. 12, the proposed method reduces energy consumption by 13.28% and 18.98% compared with G-OLSR and OLSR, www.nature.com/scientificreports/ respectively. This is because we consider the energy parameter for calculating paths and selecting MPR nodes, while OLSR and G-OLSR do not pay attention to this parameter in their routing process. Also, our scheme forms more stable paths because this method considers energy consumption and connection quality. Therefore, paths are valid for more time. As a result, our method has a lower need for updating routing tables. This helps our scheme to improve energy consumption. Another point is that in all methods, energy consumption is boosted when increasing the number of nodes in the network. This is because in this case, these routing methods need to exchange more control messages (Hello and TC messages) in the network. This increases their communication overhead and energy consumption.  www.nature.com/scientificreports/

Conclusion
In this paper, we proposed an energy-aware routing scheme using firefly algorithm for FANETs. In our scheme, a new approach is introduced for estimating the connection quality. It is estimated based on the ratio of sent/ received of hello packets and connection time. Then, we presented the MPR-FA algorithm to choose the best set of MPRs in the network. In this algorithm, a fitness function is defined based on four parameters, including energy, connection quality, neighborhood degree, and willingness. Finally, our scheme calculates the paths between nodes based on path energy and path quality. NS3 software is used for simulating our scheme and evaluating its performance. The RWP mobility model is considered for simulating the movement of UAVs in the simulation process. We compare our scheme with G-OLSR and OLSR. The simulation results show that our method has a successful performance compared to G-OLSR and OLSR in terms of end-to-end delay, PDR, throughput, and energy consumption. However, our approach has more routing overhead compared to G-OLSR.
In the future research direction, we must evaluate our scheme with other mobility models and more scenarios to highlight the efficiency of our method. Also, we try to present a multi-path routing scheme using machine learning (ML) techniques in FANET for improving network fault tolerance.