Joint Energy and Performance Aware Relay Positioning in Flying Networks

Unmanned Aerial Vehicles (UAVs) have emerged as suitable platforms for transporting and positioning communications nodes on demand, including Wi-Fi Access Points and cellular Base Stations. This paved the way for the deployment of flying networks capable of temporarily providing wireless connectivity and reinforcing coverage and capacity of existing networks. Several solutions have been proposed for the positioning of UAVs acting as Flying Access Points (FAPs). Yet, the positioning of Flying Communications Relays (FCRs) in charge of forwarding the traffic to/from the Internet has not received equal attention. In addition, state of the art works are focused on optimizing both the flying network performance and the energy-efficiency from the communications point of view, leaving aside a relevant component: the energy spent for the UAV propulsion. We propose the Energy and Performance Aware relay Positioning (EPAP) algorithm. EPAP defines target performance-aware Signal-to-Noise Ratio (SNR) values for the wireless links established between the FCR UAV and the FAPs and, based on that, computes the trajectory to be completed by the FCR UAV so that the energy spent for the UAV propulsion is minimized. EPAP was evaluated in terms of both the flying network performance and the FCR UAV endurance, considering multiple networking scenarios. Simulation results show gains up to 25% in the FCR UAV endurance, while not compromising the Quality of Service offered by the flying network.


I. INTRODUCTION
Over the last years, the use of Unmanned Aerial Vehicles (UAVs) for a myriad of civil and military applications has increased [1], [2]. Their capability to operate virtually anywhere, their ability to hover above the ground, and their increasing capacity to carry cargo on-board make UAVs suitable platforms for transporting and positioning communications nodes, including Wi-Fi Access Points and cellular Base Stations. This paved the way for the deployment of flying networks that provide wireless connectivity and reinforce the coverage and capacity of existing networks on demand, enabling broadband Internet access in temporary events, including music festivals and disaster management scenarios [3], [4]. However, flying networks impose The associate editor coordinating the review of this manuscript and approving it for publication was Stefano Scanzio . important challenges regarding the positioning of the UAVs, in order to meet the Quality of Service (QoS) expected by the users. In this article, we assume that two types of UAVs compose the flying network: Flying Access Points (FAPs) and a single Flying Communications Relay (FCR). In the literature, several solutions have been proposed for the positioning of FAPs, aiming at enhancing the wireless coverage, the number of ground users served [5]- [8], and the QoS offered [3], [9]- [13]. However, the positioning of the FCR UAV has not received equal attention. The FCR UAV plays a crucial role in the flying network, as it is the communications node responsible for forwarding the traffic between the FAPs and the Internet, as depicted in Fig. 1.
In order to address the FCR UAV positioning challenge, a traffic-aware gateway positioning (GWP) algorithm for flying networks with controlled topology was proposed in [14]. GWP considers the traffic demand of the FAPs and their positions to define in advance the positioning of the FCR UAV, taking advantage of the holistic knowledge provided by a central node. However, GWP neglects an important concern in flying networks: the energy spent for the UAV propulsion. As UAVs are not connected to the electrical grid, they typically rely on their on-board batteries, which have limited capacity. For this reason, the UAVs need to land frequently for recharging or replacing their batteries [15].
The problem occurs when the UAVs play the role of FCRs, especially in a flying network composed of only one FCR UAV. The available energy at the FCR UAV directly influences the overall performance of the flying network, since if the FCR UAV becomes unavailable due to power shortage, the FAPs will be unable to access the Internet. Therefore, the energy spent for the UAV propulsion should be taken into account when planning flying networks, in order to improve their availability. Flying networks with high availability will be able to provide connectivity for a longer time interval. This problem is identified in [16], which refers to resource management and energy-efficiency as open research challenges for using UAVs in flying networks. A reference work on energy-efficiency in rotary-wing UAVs is presented in [17]. The authors have concluded that the power consumption when the UAVs move at low speed values is lower than when the UAVs are in the hovering state. Therefore, hovering is not the most energy-efficient UAV state.
Within this context, a joint energy and performance-aware FCR UAV positioning algorithm that meets the FAPs traffic demand while ensuring an energy-efficient UAV state is worthy of being considered. In order to address this problem, in [18] we have proposed an Energy-aware RElay Positioning algorithm for flying networks, called EREP. EREP takes into account the energy spent for the UAV propulsion, as well as the positions and the traffic demand of the FAPs providing wireless connectivity to the ground users, in order to define the trajectory and speed of the FCR UAV that minimize its power consumption. Still, EREP was validated considering an ideal wireless channel, modeled by the Friis propagation model. In real-world networking scenarios, it is expected that the network performance is degraded due to SNR deviations with respect to the values obtained by means of the Friis propagation model, especially when the FCR UAV is moving to complete the trajectory defined by EREP. In order to address the problem, we propose the Energy and Performance Aware relay Positioning (EPAP) algorithm. Built upon the EREP algorithm, EPAP defines target performance-aware SNR values for the wireless links established between the FCR UAV and the FAPs and, based on that, computes the trajectory to be completed by the FCR UAV, in order to minimize the FCR UAV energy consumption for propulsion, while ensuring the targeted flying network performance. EPAP is evaluated in terms of: i) the flying network performance; and ii) the FCR UAV endurance, considering the energy spent for the UAV propulsion in multiple networking scenarios.
The main contributions of this article are three-fold: 1) The Energy and Performance Aware relay Positioning (EPAP) algorithm, which allows to compute the trajectory to be completed by the FCR UAV, in order to minimize its energy consumption, while ensuring the targeted flying network performance. 2) Evaluation of the flying network performance achieved when the EPAP algorithm is employed by means of ns-3 simulations carried out using a realistic wireless channel model. 3) Evaluation of the FCR UAV endurance when using the EPAP algorithm, considering multiple networking scenarios composed of a different number of FAPs and average distances between them, including random networking scenarios. The rest of this article is organized as follows. Section II presents the related work on energy and performance aware UAV positioning. Section III describes the system model and formulates the problem addressed in this article. Section IV presents the EPAP algorithm. Section V presents the evaluation of the EPAP algorithm in terms of the flying network performance, and the energy consumption and endurance of the FCR UAV. Section VI discusses the results achieved, and the pros and cons of the EPAP algorithm. Finally, Section VII points out the main conclusions and directions for future work.

II. RELATED WORK
Flying networks composed of UAVs have emerged as a flexible and agile solution to provide broadband Internet access in areas where terrestrial networks are not available and when their coverage and capacity need to be enhanced. Flying networks present many advantages in a myriad of scenarios, including the possibility of an on-demand, quick deployment anywhere, anytime. Also, in flying networks the wireless links are characterized by a strong Line-of-Sight component, paving the way to use simplified radio propagation models for their planning, including the Friis propagation model [13], [19]; this represents an important advantage when compared with terrestrial networks. Moreover, UAVs have fully controlled mobility in three-dimensional (3D) space and can adaptively change their positions for reducing the Euclidean VOLUME 10, 2022 distance to the ground users, in order to improve the wireless coverage and the QoS offered. These advantages were exacerbated by the advent of small and low-cost UAVs.

A. UAV ENERGY CONSUMPTION
In flying networks made up of UAVs, energy is spent for two main tasks: communications and UAV propulsion [20]. In order to improve the energy-efficiency in communications, the literature has been focused on different communications layers: 1) network layer, by designing energy-aware routing protocols that compute the forwarding tables taking into account the energy available in the UAVs [21]- [23]; 2) data link layer, by improving the MAC scheme for using sleep modes when the communications nodes are in an idle state [24], [25]; and 3) physical layer, by optimizing the hardware design, and the performance of the signal transmission and processing tasks [26]. However, the energy spent for communications is typically negligible when compared with the energy spent for the UAV propulsion. For instance, an offthe-shelf IEEE 802.11n Network Interface Card (NIC) has an estimated power consumption up to 2 W [27], [28], while the power consumption for the UAV propulsion when in hovering state is greater than 150 W, as depicted in Fig. 2.
A reference work on joint energy-efficiency and trajectory optimization for an FCR UAV is presented in [29], where the authors propose a theoretical model to estimate the energy spent for the UAV propulsion, considering the UAV speed, direction, and acceleration. In order to maximize the UAV energy-efficiency, a circular trajectory with optimized radius and flight speed is proposed. Nevertheless, the proposed model targets fixed-wing UAVs and considers only one ground user.
In [30], [31], the optimal altitude for rotary-wing UAVs acting as FAPs is derived, taking into account both the energy consumption and the performance from the communications point of view. However, their authors consider UAVs in hovering state only, which is not the most efficient state when it comes to the energy spent for the UAV propulsion. This challenge was also not addressed in [32], where in addition to the UAV hovering altitude, the transmission power is jointly optimized for allocating communications resources using UAVs in a space-air-ground networking scenario.
In [33], the energy-efficient UAV deployment problem is formulated taking into account the flight dynamics and the QoS offered to the users. In terms of flight dynamics, the influence of altitude, UAV components, and payload weight in power consumption during hovering are studied. The authors concluded that the higher the UAV is, the more power it consumes, since as the altitude increases, the air density decreases. On the other hand, when the air density decreases, in order the UAV is able to maintain constant thrust, the induced air velocity needs to be increased. For this purpose, the propellers need to increase the blade tips speed, thus raising the power consumption. Finally, it is concluded that a higher payload weight leads to an increased power consumption. In [34], an energy-aware 3D UAV deployment solution is proposed, aiming at optimizing the throughput. The tradeoff between flight altitude, energy consumption, and travel time is addressed. With respect to the power spent for the UAV propulsion, it is shown that moving the UAV at high speed values consumes more power than hovering, whereas hovering requires more power than climbing in altitude.
In [35], [36], an energy-efficiency model for multiple UAVs, taking into account the energy consumed by the UAVs and a suitable deployment approach for recharging them, is proposed, aiming at providing seamless long-term wireless connectivity. Still, the communications cells are achieved by positioning the UAVs in hovering state and the speed in which the UAVs move to/from the charging station is not optimized for minimizing the UAVs' energy consumption.

B. UAV POSITIONING
The literature on UAV positioning has been focused on defining the positions and trajectories of: 1) FAPs, considering the wireless coverage, the number of ground users served [5]- [8], and the QoS offered to the ground users [3], [9]- [13]; and 2) FCR UAVs forwarding traffic between ground nodes [37]- [39]. However, existing works aim at optimizing both the flying network performance and energy-efficiency from the communications point of view [40]- [43], neglecting the energy spent for the UAV propulsion.
When it comes to the FAP positioning in flying networks, a reference work is proposed in [3], where the NetPlan algorithm is proposed. NetPlan is based on the Potential Fields (PF) technique, which lies on PF generators that apply forces on the FAPs; these forces are attractive to areas with high traffic demand and rejective to areas with low traffic demand. In order to improve the aggregate throughput, the FAPs closer to the users with higher traffic demand establish smaller Wi-Fi cells, whereas the remaining FAPs establish larger Wi-Fi cells so that the entire area is covered.
A UAV can also be used to extend the communications range between ground nodes. In [37], the effect in the network performance resulting from the asymmetrical positioning of an FCR UAV between two ground nodes is studied.
Three possible networking scenarios are explored by moving an FCR UAV from an equidistant position between the ground nodes to a non-equidistant position. The authors concluded that: 1) the data rate of the link established with the farther ground node is reduced, while the data rate of the other link is not improved; 2) the data rate of the link established with the nearest ground node is improved without reducing the data rate of the link to the node further away; and 3) the date rate of the link to the nearest node is improved, while the data rate of the link established with the further apart node is decreased. Gains up to 35% in throughput were achieved, when compared with the positioning in a central position. Moreover, the altitude of the FCR UAV and the distance between the ground nodes were shown to have great influence in the throughput. However, the traffic demand of the ground nodes was not considered.
The positioning challenge for a single FCR UAV considering the traffic demand of multiple FAPs has been addressed in [14], where the GWP algorithm was proposed. Taking into consideration the future positions of the FAPs, which are defined by a FAP positioning algorithm running on a central node, and the bitrate of the generated traffic flows, the GWP algorithm aims at guaranteeing that the wireless link established between each FAP and the FCR UAV has a minimum SNR that enables the use of the minimum Modulation and Coding Scheme (MCS) index able to accommodate the traffic demand. The Friis propagation model is used to estimate the SNR of the wireless link established between each FAP and the FCR UAV, which acts as the gateway to the Internet. The maximum distance in 3D space corresponds to the radius of a sphere, centered at each FAP, within which the FCR UAV should be positioned. Considering all the FAPs in the flying network, the position defined for the FCR UAV corresponds to the subspace generated by the intersection of all the spheres. This position is determined by the GWP algorithm following an iterative approach, considering the transmission power of the UAVs as the fine-tuning parameter, which is successively increased until intersection between the spheres occurs. The results obtained in the performance evaluation of GWP show that it is possible to improve the overall performance of the flying network by dynamically adjusting the position of the FCR UAV, considering both the positions and traffic demand of the FAPs. However, the energy consumption of the FCR UAV is not considered by GWP, as the FCR UAV is positioned in hovering state; according to [17], hovering is not the most energy-efficient UAV state.
In order to improve the performance of GWP, we have proposed the EREP algorithm [18]. EREP allows to define the trajectory and speed of the FCR UAV that minimize its energy consumption for propulsion. However, since EREP uses a theoretical radio propagation model for determining the minimum SNR values required to meet the FAPs' traffic demand, it may lead to network performance degradation in the real-world, especially due to the FCR UAV movement. In order to address this problem, a joint energy and performance-aware FCR UAV positioning algorithm is worthy of being considered.

III. SYSTEM MODEL AND PROBLEM FORMULATION
When positioning a single FCR UAV, which is the communications node responsible for forwarding traffic to/from the Internet, the traffic demand of each FAP providing wireless connectivity to the ground users should be taken into account. We assume that the information about the traffic demand is provided by a Central Station, which is a centralized node deployed anywhere in the Cloud or at the Edge of the flying network. The Central Station is in charge of defining the positions of the FAPs by running a state of the art FAPs positioning algorithm [3], thus providing a holistic knowledge about the network. Herein, the number of FAPs in the flying network is variable; however, a single FCR UAV is considered.
When planning a flying network, the limited energy on-board the UAVs should be taken into consideration, as it restricts the total amount of time the network is available. A flying network composed of UAVs with higher endurance will be able to serve the connected users for a longer time, thus increasing the network availability. In the state of the art, when it comes to UAV positioning, several solutions aim at determining the optimal positions where the FAPs and the FCR UAVs should hover. However, moving UAVs at relatively low speed values has been proven to consume less energy than hovering [17], [44]. For these reasons, an algorithm for positioning the FCR UAV taking into consideration the traffic demand of all FAPs while maintaining an energyefficient state is proposed herein, in order to improve the overall performance of the flying network.
We assume that the wireless links established between the FAPs and the FCR UAV are modeled by the Friis propagation model [45], due to the strong Line-of-Sight component between UAVs flying above the ground. This assumption is supported by [13], [19], wherein experimental results show that Friis is the most adequate model to characterize the wireless link established between a UAV and a communications node close to the ground. As such, the power received P r at the FCR UAV is computed using (1), where P t is the FAP transmission power, λ is the wavelength given by the speed of light in vacuum c over the carrier frequency f used, and r represents the distance between the FAPs and FCR UAV. We assume the maximum channel capacity is defined by the data rate associated with the MCS index used by the UAVs, which requires a minimum SNR = P r /P N , over the number of FAPs using the same wireless channel. For computing SNR, a constant noise power P N is considered. The wireless medium is shared and all UAVs can listen to any other UAV. The Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) is employed for Medium Access Control (MAC).
Flying network composed of two-tiers: access and backhaul networks. The FAPs, in the first tier, provide wireless connectivity to the ground users, while the FCR UAV, in the second tier, forwards the traffic to/from the Internet. An example trajectory defined by the EPAP algorithm is depicted by the red arrows. The Central Station uses an out-of-band long-range wireless channel (dotted orange line) to exchange control information with the UAVs. It enables an always-on wireless links, even when the flying network is being reconfigured.
The power P(V ) required by a rotor-wing UAV for propulsion while moving at speed V is defined in (2) by means of three components [17]: 1) Blade profile -the power required to overcome the profile drag of the blades. It increases quadratically with V . 2) Induced -the power required to overcome the induced drag of the blades, which decreases with V . 3) Parasite -the power required to overcome the fuselage drag. It increases cubically with V .
In (2), the first addend is the blade profile power in hovering state, where U tip denotes the tip speed of the rotor blade. The second addend is the induced power for hovering, where P ind is the constant induced power, and v o is the mean rotor induced speed. The last addend represents the parasite component, where d 0 is the fuselage drag ratio, ρ is the air density, s is the rotor solidity, and A is the rotor disc area. The values for the UAV related parameters can be obtained from the UAV specifications, while ρ depends on the surrounding environment. In [17] has been concluded that there is an interval of UAV speed values V for which the power consumed by the UAV in movement is lower than the power consumed when the UAV is in hovering state. When V is set to 0, which represents the speed value in hovering state, the power consumption P(V ) in (2) is equal to P b + P ind . In such case, P(V ) is a finite value that only depends on physical factors such as the UAV weight, air density, and rotor disc area. In turn, when the speed V is positive, P(V ) slightly decreases for low speed values, but then it increases significantly as the speed also increases. These variations are depicted in Fig. 2, allowing to conclude that hovering is not the most energy efficient state for the FCR UAV propulsion. Among the factors that change according to the surrounding environment, the wind speed and direction have an indirect correlation with the UAV energy consumption -they only influence the speed of the UAV with respect to the air [46]. For this reason, in this article, the wind effect is neglected for both the EPAP algorithm and the considered baseline.
In the formulation presented herein, a graph G = (U , L) is considered for modeling the flying network. Let U = {UAV 0 , . . . , UAV N −1 } represent the set of UAVs i positioned at Q i = (x i , y i , z i ) and L ⊆ U × U represent the set of directional links established between UAV i and UAV j, with (i, j) ∈ L and i, j ∈ U . Assuming that each UAV i , i ∈ {1, . . . , N − 1}, acting as a FAP, transmits a traffic flow F 0,i with bitrate T i bit/s towards UAV 0 , acting as the FCR UAV, we have a tree T (U , L T ) that is a subgraph of G. This tree defines the active topology of the flying network and is composed of single-hop paths, where L T ⊂ L is the set of direct links established between each UAV i and UAV 0 .
Considering T the endurance of UAV 0 , with 0 ≤ t ≤ T , the problem consists in determining the trajectory Q 0 (t) = (x 0 (t), y 0 (t), z 0 (t)) of UAV 0 , to be completed at a velocity up to the maximum value V MAX allowed by UAV 0 , such that the power P 0 Q 0 (t) consumed by UAV 0 for propulsion is minimized. Solving this problem implies considering the maximum power P MAX 0 allowed by UAV 0 , while ensuring that a wireless link with high enough capacity C 0,i (t) is available between each UAV i , i ∈ {1, . . . , N − 1} and UAV 0 , in order to accommodate the traffic demand T i of UAV i . For that purpose, the minimum SNR i required to induce that UAV i selects an MCS index with data rate higher than or equal to T i bit/s must be ensured. SNR i depends on the Euclidean distance of the wireless links established between UAV i and UAV 0 , the carried frequency f , and the transmission power P t , assumed to be equal for all the UAVs forming the flying network and set to the maximum value P MAX t allowed for the wireless communications technology in use. Our objective function is In the defined optimization problem, the following constraints are considered for any time instant t: • (3b) ensures that the propulsion power P 0 Q 0 (t) enabling the operation of UAV 0 is greater than 0 and lower than or equal to the maximum power P MAX 0 allowed by UAV 0 .
• (3c) sets the transmission power P t to the maximum value P MAX t allowed by the wireless communications technology in use.
• (3d) guarantees that the speed of UAV 0 is lower than or equal to the maximum speed V MAX 0 allowed by UAV 0 .
• (3e) ensures that the position computed for UAV 0 is different from the position of any other UAV i in the flying network, in order to avoid collisions. The position of each UAV i is defined in advance by a state of the art FAP positioning algorithm, such as the algorithm proposed in [3], which also avoids collisions for any UAV i .
• (3f) assures that a wireless link between each UAV i and UAV 0 is always available in the flying network.
• (3g) guarantees that the capacity in bit/s of the wireless link established between each UAV i and UAV 0 is greater than or equal to the traffic demand of UAV i .
• (3h) ensures that the aggregate capacity of the wireless links established with UAV 0 is lower than or equal to the maximum capacity C MAX of the wireless channel used.
• (3i) ensures the target SNR i that enables the use of an MCS index characterized by a data rate higher than or equal to T i (t) bit/s. SNR i depends on the Euclidean distance between each UAV i and UAV 0 , the transmission power P t of the UAVs, and the carrier frequency f used.
Determining the solution for the problem defined in (3a) requires computing the trajectory of UAV 0 such that the energy spent for the UAV propulsion is minimal and the capacity of the wireless links established between each UAV i (FAP) and UAV 0 (FCR UAV) is high enough to accommodate the traffic demand T i of UAV i . The UAV trajectory planning problem has been shown in the literature to be NP-hard [47], [48]. In order to achieve a solution for this problem, we propose the EPAP algorithm.

IV. ENERGY AND PERFORMANCE AWARE RELAY POSITIONING ALGORITHM
As presented in Section III, there is an interval of UAV speed values for which the power spent by the UAV for propulsion is lower than for hovering. This is the rationale of the EREP algorithm that we have proposed in [18], which was built upon the GWP algorithm [14]. GWP takes advantage of the information about the positions and traffic demand of the FAPs, provided by a state of the art FAP positioning algorithm such as the one proposed in [3], in order to enable wireless links with high enough capacity for accommodating the traffic demand of the FAPs. This position is within a 3D subspace, resulting from the intersection of the spheres centered at each FAP, with radius equal to the transmission range that ensures the minimum SNR required to induce a target MCS index, characterized by a data rate higher than or equal to the traffic demand of each FAP. Conceptually, since any position within the 3D subspace resulting from the intersection of the spheres allows to use the MCS index targeted by each FAP, the EREP algorithm improves the GWP algorithm from the energy consumption point of view by defining a trajectory within the 3D subspace, to be completed by the FCR UAV at the speed that minimizes its power consumption, instead of hovering in a fixed position. Since the movement performed by the FCR UAV to complete the defined trajectory may lead to network performance degradation in practice, due to SNR degradation, the use of an SNR margin with respect to the values computed by means of the Friis propagation model is proposed by the EPAP algorithm proposed herein. EPAP considers that when the length of the trajectory defined for the FCR UAV is long enough to induce SNR degradation, due to a wide intersection volume between the spheres centered at the FAPs, then the minimum theoretical SNR value required for the wireless link established between the FCR UAV and each FAP should be increased. This will result in a smaller intersection volume, leading to a shorter trajectory for the FCR UAV and avoiding network performance degradation due to the FCR UAV movement. The main differences between the GWP, EREP, and EPAP algorithms are presented in Table 1.
The EPAP algorithm starts by determining the minimum SNR i that allows to induce an MCS index (MCS i ) able to accommodate the traffic demand T i , in bit/s, of FAP i (line 1 of Alg. 1). The relation between SNR i and the fair share of the wireless channel capacity is considered, as proposed in [14], taking into account the number of FAPs that use the same wireless channel, thus limiting the capacity of TABLE 1. Main differences between the GWP, EREP, and EPAP algorithms. GWP positions the FCR UAV in hovering state, which leads to high energy consumption [17], while EREP computes a trajectory to be completed by the FCR UAV at the speed that minimizes the energy spent for the UAV propulsion. EPAP improves the EREP algorithm by defining a network performance-aware trajectory for the FCR UAV. the wireless link achievable in practice. The fair share is defined as the data rate associated with the MCS index used by the wireless link established between each FAP and the FCR UAV over the number of FAPs sharing the medium. An illustrative example is presented in Table 2 for two FAPs, considering the IEEE 802.11ac technology with 800 ns Guard Interval (GI), 160 MHz channel bandwidth, one spatial stream, and one omnidirectional antenna. The minimum SNR i required for inducing MCS i imposes a minimum received power P r i at FAP i .
Then, considering a constant transmission power P t set to 20 dBm for all FAPs, EPAP computes the maximum transmission range r i so that the minimum targeted SNR i is ensured, as presented in Fig. 4 (line 2 of Alg. 1). In 3D space, r i represents the radius of a sphere centered at FAP i . After that, EPAP finds the volume that results from the intersection of the spheres centered at each FAP i , as illustrated in Fig. 4. The intersection between the spheres defines the volume within which the FCR UAV can move without compromising the QoS offered. If no intersection is found, the EPAP algorithm is terminated (line 5 of Alg. 1). In order to solve the problem, a suitable approach lies on forming clusters of nearby FAPs and assign an FCR UAV to each cluster, using the EPAP algorithm to compute the trajectory for each FCR UAV independently. The solution to form the clusters of nearby FAPs is out of scope of this article.
Considering that an intersection volume is found for a single FCR UAV, the altitude corresponding to the largest area (largest 2D plane) within such volume is considered (line 9 of Alg. 1). The EPAP algorithm avoids significant changes in altitude when defining the trajectory for the FCR UAV, in order to minimize the UAV power consumption [33], [50], [51]. The centroid of that area is the same position defined by the GWP algorithm and constitutes the waypoint where all possible trajectories for the FCR UAV pass through (line 10 of Alg. 1). EPAP computes three possible trajectories (line 11 of Alg. 1), each consisting of four waypoints (P1, P2, P3, and P4) in addition to the centroid (Pc). An illustrative example for a reference networking scenario is depicted in Fig. 5. For Trajectory #1 (cf. Fig. 5a), the four waypoints are located in the intersection area with the highest and lowest values of x, in both extremes of the y-axis. For Trajectory #2 (cf. Fig. 5b), the corresponding four waypoints assume the highest and lowest values of y, in both extremes of the x-axis. Finally, for Trajectory #3 (cf. Fig. 5c), the four waypoints have the same x or y coordinate as the centroid, in the extremes of the intersection area. The trajectory with the highest total sum of distances between successive waypoints, including the centroid, is selected (line 12 of Alg. 1). This allows to maximize the time the FCR UAV is moving at the speed that enables the lowest power consumption. Taking into account the minimum SNR obtained by means of the Friis propagation model, if the trajectory length is a) higher than or equal to 160 m, then the targeted SNR is increased by 4 dB (line 13 and 14 of Alg.1); b) higher than or equal to 120 m but shorter than 160 m, then the targeted SNR is increased by 3 dB (line 16 and 17 of Alg. 1); c) higher than or equal to 80 m but shorter than 120 m, then the targeted SNR is increased by 2 dB (line 19 and 20 of Alg.1). In practice, this approach ensures an SNR margin with respect to the values obtained by means of the Friis propagation model or any other theoretical propagation model employed, in order to avoid network performance degradation when the FCR UAV is moving. The values considered for the SNR margin are configuration parameters in the EPAP algorithm and were obtained following a trial and error approach. For that purpose, the Friis propagation loss model and the Rician fast-fading component, with a K-factor equal to 13 dB, were considered, based on the experimental model proposed in [13], wherein channel model was analyzed in terms of the path-loss and fast-fading components. The K-factor is the ratio of the received power in the dominant component over the scattered power. The fine-tuning of the SNR margin values is left for future work, as well as the possible dynamic adjustment according to the time-varying wireless link quality.
Considering the selected trajectory (the longest trajectory in any scenario), the UAV starts at Pc and moves to P1. Afterwards, it goes to P2 and then to P3, passing through Pc. Before returning to Pc, the UAV passes through P4. The UAV hovers for 1 s at each waypoint before inverting the movement direction and proceeding to the next waypoint. The 1 s hovering is used as an approximation to take into account the energy consumed for changing the movement direction. This was considered in EPAP because, to the best of our knowledge, there is no model in the state of the art available to characterize the energy consumed by rotor-wing UAVs to perform such movement. In the optimization problem (3), this approximation is represented by a set of consecutive equal waypoints Q 0 (t) during 1 second. In EPAP, the transmission range that ensures the targeted SNR for the wireless link established between each FAP and the FCR UAV is represented by a sphere centered at each FAP. The volume resulting from the intersection of all spheres is depicted in Fig. 4); it is denoted by the IntersectionPoints variable in Algorithm 1. DesiredAltitude is the z value in which the xy-plane with the largest area is located, within the intersection volume (IntersectionPoints variable). This plane enables the longest trajectory for the FCR UAV, allowing to minimize the energy consumed by the UAV for propulsion. The centroid is the point of that plane that minimizes the Euclidean distance between the FCR UAV and the FAPs. Finally, the maximumDistance variable is the length of the longest trajectory amongst the three trajectories (cf. Fig. 5a,  Fig. 5b, and Fig. 5c) computed by EPAP. The length of each trajectory is the sum of the Euclidean distances between the successive waypoints forming the trajectory and it is computed considering their Cartesian coordinates. The computed trajectory is sent by the Central Station to the FCR UAV using an out-of-band long-range wireless link (e.g., based on IEEE 802.11ah). This allows for an always-on control wireless link and avoids introducing overhead in the flying network offered to the ground users. The design of the control wireless link is beyond the scope of this article.

V. EPAP EVALUATION
In order to evaluate the FCR UAV endurance and the network performance when employing the EPAP algorithm, a set of specific networking scenarios based on the reference scenario depicted in Fig. 3, were defined; they aim at showing how the distance between the FAPs influences the FCR UAV endurance. These scenarios were composed of a single FCR UAV and a variable number of FAPs positioned at extreme distances from each other: 1) FAPs close to each other; and 2) FAPs away from each other. The Cartesian coordinates of the FAPs for the considered scenarios are presented in Table 3. Moreover, in order to assess how a different number of FAPs and the average distance between them influence the gains  in the FCR UAV endurance obtained when using EPAP, networking scenarios consisting in FAPs randomly positioned were considered. In order to define the traffic demand of each FAP, we took into account an estimation for the maximum channel capacity of the wireless channel, assumed to be equal to 65% of the data rate associated with the highest MCS index possible for the network configuration employed (65% × 780 Mbit/s ≈ 500 Mbit/s) over the number of FAPs using the same wireless channel. The 65% factor allows to consider a margin with respect to the theoretical channel capacity and take into account the inefficiency of the IEEE 802.11 MAC scheme observed in practice. The network performance evaluation took into account two QoS metrics: 1) aggregate throughput, which consists of the average number of bits received per second by the FCR UAV; and 2) delay, which represents the time taken by each data packet to reach the sink application of the FCR UAV, since the instant it was generated by the source application of each FAP, including queuing, transmission, and propagation delays; it was measured based on packets collected every 10 ms, during the simulation time.
The evaluation of the EPAP algorithm under random networking scenarios was also performed, in order to assess the gains obtained in the FCR UAV endurance when using EPAP, considering different number of FAPs and average Euclidean distances between them.

A. SIMULATION SETUP
The evaluation of both the energy consumption and endurance of the FCR UAV was evaluated by means of the UAVPowerSim simulator, originally proposed in [18] and publicly available in [52]. For the physical attributes characterizing the UAV model and the surrounding environment, we considered the values proposed in [17], including: UAV weight W = 20 N, rotor radius R = 0.4 m, blade angular For evaluating the network performance achieved when employing the EPAP algorithm, the ns-3 simulator [53] was used. A NIC was configured on each simulated UAV in Ad Hoc mode, using the IEEE 802.11ac standard in channel 50. The traffic generated was UDP Poisson for a constant packet size of 1400 bytes. The data rate was automatically defined by the MinstrelHtWifiManager mechanism. The traffic generation was carried out during 130 s simulation time. The Controlled Delay (CoDel) algorithm [54], which is a queuing discipline that considers the time that packets are held in the transmission queue to discard packets, was used; it allows to mitigate the bufferbloat problem [55]. The default parameters of CoDel in ns-3 [56] were used. The wireless channel was modeled by means of the Friis propagation model with Rician fast-fading, considering a K-factor equal to 13 dB, according to a realistic channel model built upon experimental results collected in an experimental testbed [13]. The Rician K-factor represents the ratio of the received power in the dominant component over the scattered power.
The main simulation parameters employed are summarized in Table 4.

B. EVALUATION UNDER EXTREME NETWORKING SCENARIOS
In the following, we present the results obtained when the EPAP algorithm was used under networking scenarios composed of FAPs at extreme distances between them. We start by evaluating EPAP under networking scenarios composed of two FAPs and comparing its performance with the EREP and GWP algorithms; then, we proceed to scenarios with five FAPs and ten FAPs.
The results for the network performance are represented by means of the Cumulative Distribution Function (CDF) for the packet delay and by the Complementary CDF (CCDF) for the aggregate throughput. The CDF F(x) allows to infer the percentage of collected packets with delay lower than or equal to x, while the CCDF F (x) gives the percentage of time during which the average throughput was greater than x. The results consider all values collected during 20 simulation runs for each scenario.

1) TWO FAPs
In order to demonstrate the performance gains achieved by the EPAP algorithm with respect to the EREP algorithm [18] and motivate the use of EPAP, we first considered a reference networking scenario consisting of two FAPs close to each other. The FAPs were generating the same amount of traffic, which was set to 250 Mbit/s, enabling an intersection volume centered in the FAPs' geometric center. For this networking scenario, Trajectory #3 was chosen, since its length is longer than the other two -Trajectory #1 is 122 m long, Trajectory #2 is also 122 m long, while Trajectory #3 is 196 m long, thus allowing to achieve a higher gain in the FCR UAV endurance. Each lap for this trajectory takes a total of 23 s to be completed, which enables 98 laps and an FCR UAV endurance of 38 min. To complete a lap, 3096 J are consumed, while in hovering mode the energy consumption increases to 3913 J, as depicted in Fig. 6a. This represents a gain in the FCR UAV endurance of 26% (cf. Fig. 6b). On the other hand, the network performance results for this scenario are depicted in Fig. 7. The 50 th percentile results show a decrease of 11% in aggregate throughput and an increase of 500% in delay. The increase in delay is mainly due to the high distance between the FCR UAV and the FAPs in this scenario, as the intersection volume between the two FAPs is large. When the distance between the FCR UAV and the FAPs increases, the SNR of the wireless link decreases, the capacity of the wireless channel is reduced, and the packets are held in the transmission queues longer.
The second scenario represents two FAPs positioned away from each other. Similarly, they were generating the same amount of traffic: 250 Mbit/s. In this sense, the performance evaluation carried out allows to assess the influence of the distance between the FAPs for the same traffic demand. Trajectory #3 was selected, as it is the longest trajectory -Trajectory #1 is 84 m long, Trajectory #2 is 40.4 m long, and Trajectory #3 is 105.7 m long. Each lap for Trajectory #3 takes a total of 14 s to be completed, which enables 153 laps and an FCR UAV endurance of 37 min. To complete a lap, 1978 J are consumed, while in hovering 2418 J are consumed, as depicted in Fig. 8a. This represents a gain in the FCR UAV endurance of 22%, as presented in Fig. 8b. The network performance results are shown in Fig. 9. The 50 th percentile results show a decrease of 10% in aggregate throughput, while an increase of 941% in delay. The increase in delay is justified by the same reasons as in the networking scenarios composed of two FAP close to each other.
Despite the reduction in the FCR UAV energy consumption achieved when using the EREP algorithm, a relevant degradation in the network performance is observed. In order to address this problem, we propose the EPAP algorithm. The performance evaluation of the EPAP, EREP, and GWP algorithms is depicted in Fig. 10, where it is possible to observe that the network performance results of the EPAP algorithm (in blue) are close to those obtained when the FCR UAV is in hovering in the position defined by the GWP algorithm (in orange), while the FCR UAV energy consumption when using EPAP is substantially reduced. In order to improve the flying network performance with respect to the EREP algorithm (in green), EPAP promotes the reduction of the area within which the FCR UAV can move by imposing higher target SNR values. VOLUME 10, 2022

2) FIVE FAPs
From now on, we focus on evaluating the EPAP algorithm against the GWP algorithm, our baseline. First, we considered a scenario composed of five FAPs close to each other, each generating 100 Mbit/s. Trajectory #2 was chosen, since it is longer than the other two -Trajectory #1 is 55 m long, Trajectory #2 is 74 m long, and Trajectory #3 is 66 m long, thus allowing to achieve a higher gain in the FCR UAV endurance. Each lap for this trajectory takes a total of 11 s to be completed, which enables 191 laps and an FCR UAV endurance of 36 min. A total of 1584 J are consumed to complete a lap, while in hovering the energy consumption is 1890 J, as depicted in Fig. 11a. This represents a gain in  the FCR UAV endurance of 19%, as presented in Fig. 11b. The network performance results for this scenario are shown in Fig. 12. A negligible degradation for all network performance metrics is observed, when compared with the GWP algorithm -the 50 th percentile results show a decrease of 6% in aggregate throughput and an increase of 4% in delay.
Then, we considered a scenario with five FAPs away from each other. The traffic demand of each FAP was set to 100 Mbit/s. Trajectory #3 was selected, as it presents greater length than the others -Trajectory #1 is 46 m long, Trajectory #2 is 50 m long, and Trajectory #3 is 55 m long. Each lap for this trajectory takes a total of 9 s to be completed, which enables 224 laps and an FCR UAV endurance 43858 VOLUME 10, 2022   Fig. 13a. This represents a gain in the FCR UAV endurance of 16%, as presented in Fig. 13b. The network performance results are depicted in Fig. 14. Again, the performance degradation is negligible for all network performance metrics: the 50 th percentile results show a decrease of 4% in aggregate throughput and an increase of 6% in delay.

3) TEN FAPs
We then considered a scenario composed of ten FAPs close to each other, each offering 50 Mbit/s. Trajectory #3 was chosen, since its length is longer than the other two -Trajectory #1 is 61 m long, Trajectory #2 is 56 m long, and Trajectory #3 is 79 m long. Each lap for this trajectory takes a total of 12 s to be completed, which enables 185 laps and an FCR UAV endurance of 36 min. To complete a lap, 1643 J are consumed, while in hovering the energy consumption is 1969 J, as depicted in Fig. 15a. This represents a gain in the FCR UAV endurance of 20%, which is depicted in Fig. 15b. The network performance achieved when using  EPAP and GWP is approximately the same, as depicted in Fig. 16, where the 50 th percentile results show a decrease of 2% in aggregate throughput and an increase of 2% in delay.
Finally, a scenario composed of ten FAPs away from each other, generating 50 Mbit/s, was considered. Trajectory #1 was selected, as it presents greater length than the others -Trajectory #1 is 40 m long, Trajectory #2 is 39 m long, and Trajectory #3 is 19 m long. Each lap for this trajectory takes a total of 8 s to be completed, which enables 260 laps, taking into account the FCR UAV endurance equal to 34 min. To complete a lap, a total of 1167 J are consumed, while in hovering a total of 1333 J are consumed, as depicted in Fig. 17a. This represents a gain in the FCR UAV endurance  of 14%, as presented in Fig. 17b. The network performance results for this scenario are shown in Fig. 18. Degradation is negligible for all network performance metrics.

C. EVALUATION UNDER RANDOM NETWORKING SCENARIOS
After evaluating the FCR UAV energy consumption, when EPAP is used in extreme networking scenarios and showing EPAP's negligible impact in the network performance achieved, we evaluated EPAP from the energy consumption point of view under random networking scenarios. For that purpose, we focused the evaluation on how a different number of FAPs and the average distance between them can influence  the FCR UAV endurance gains obtained. The considered scenarios were generated using BonnMotion [57], a mobility scenario generation tool. For each scenario composed of the same number of FAPs, all FAPs were generating the same amount of traffic.
The results for a set of 160 random networking scenarios, considering different number of FAPs between 2 and 10, are shown in Fig. 19. We can observe that the endurance gains go up to approximately 25%. A gain of 25% allows a UAV with 2-hour endurance to keep flying for 30 minutes more when compared with the baseline, which considers the UAV hovering at a fixed position. Overall, we can conclude that the higher the average distance between the FAPs, the lower the gains in the FCR UAV endurance obtained when using the EPAP algorithm, which is in line with the results obtained for the extreme networking scenarios presented in Section V-B. Moreover, for equal average distances between the FAPs, the gains in the FCR UAV endurance decrease as the number of FAPs increases. This is mainly due to the decrease in the size of the FAPs intersection volume as more FAPs are added, which leads to short trajectories for the FCR UAV. Still, EPAP always increases the FCR UAV endurance without compromising network performance.

VI. DISCUSSION
The EREP algorithm proposed in [18] was designed assuming an ideal propagation model. Thus, in practice, the network performance observed is expected to be lower than when the FCR UAV is in hovering state, due to the time-varying nature of the wireless link quality. This is the main drawback of the EREP algorithm. In order to address this problem, the EPAP algorithm introduces an SNR margin, which allows to limit the intersection volume between the spheres centered at each FAP. Since any position within the trajectory defined by EPAP allows ensuring the minimum SNR required to induce the target MCS indexes for the wireless links established between the FCR UAV and the FAPs, the QoS offered by the flying network is not compromised in practice as the FCR UAV moves. Moreover, since the FCR UAV moves at a low speed value (10.2 m/s) and uses an omnidirectional antenna, the impact of UAV movement on the wireless channel modeling is negligible. The results presented herein clearly show an improvement in the network performance achieved by EPAP when compared with EREP. The network performance results for the EPAP algorithm are close to those obtained when the FCR UAV is in hovering state, while the FCR UAV endurance is significantly improved. The evaluation for multiple random networking scenarios and different runs in the ns-3 simulations carried out provide statistical relevance to the performance results presented herein. In addition, we conclude the FCR UAV endurance gains decrease as the number of FAPs increases, due to the shorter length allowed for the UAV trajectories, which are defined within the volume resulting from the intersection of all FAPs.
In its current version, the EPAP algorithm is used to compute the trajectory for the FCR UAV only, as it represents a single point of failure in the flying network: the FCR UAV is the only communications node in charge of forwarding the traffic to/from the Internet. When it comes to the access network, a higher flexibility exists. When a FAP needs to land for power charging, the positioning and the transmission power of the remaining FAPs can be temporarily modified, allowing to provide always-on wireless connectivity to the ground users, even if the performance of the access network may be temporarily degraded. The use of the EPAP algorithm for the FAPs positioning involves addressing additional challenges, including: 1) defining a trajectory for each FAP that simultaneously allows to meet the traffic demand of the ground users and ensures that the backhaul wireless links established with the FCR UAV have high enough capacity to accommodate the traffic demand; and 2) taking into account the collision avoidance problem, since multiple FAPs are expected to move at the same time. The improvement of EPAP to compute the positioning of multiple UAVs is left for future work. VOLUME 10, 2022 Although EPAP was evaluated in networking scenarios composed of FAPs, it can also be used to compute the trajectory of an FCR UAV used to forward traffic to/from fixed ground Wi-Fi Access Points or cellular Base Stations.

VII. CONCLUSION AND FUTURE WORK
Flying networks have emerged as an agile and flexible solution for providing on-demand wireless connectivity anywhere, anytime. For that purpose, UAVs are considered suitable platforms, especially due to their high mobility in 3D and growing capacity to carry cargo on-board, including Wi-Fi Access Points and cellular Base Stations. Yet, the positioning of the FCR UAV, which is the communications node responsible for forwarding traffic to/from the Internet, greatly affects the overall flying network performance, especially when the ground users have heterogeneous traffic demand. An additional challenge when planning flying networks is the energy spent for the UAV propulsion. Unlike terrestrial networks, in which the communications nodes are typically connected to the electrical grid, UAVs rely only on their onboard batteries, which have limited capacity and are drained non-linearly according to the UAV state. In the literature, it is shown that the energy spent for propulsion in rotarywing UAVs decreases for low velocity values, which allows to conclude that hovering is not the most energy-efficient state.
In this article, we proposed the EPAP algorithm, which is able to define the trajectory and speed of the FCR UAV that minimize the energy spent for the UAV propulsion, without compromising the network performance offered by the flying network. EPAP was evaluated in terms of both the FCR UAV endurance and the flying network performance, considering multiple networking scenarios and a realistic wireless channel model. The performance evaluation carried out allowed to conclude that it is possible to increase the endurance of the FCR UAV without compromising the QoS offered by the flying network when the EPAP algorithm is used.
As future work, there are some improvements that can be made to the EPAP algorithm, including: 1) the fine-tuning of the values used for the SNR margin; 2) the consideration of additional possible trajectories for the FCR UAV; 3) the design and experimental evaluation of an energy consumption model for the circular movements performed by rotary-wing UAVs; and 4) evolving EPAP for multiple FCR UAVs. Consortium. He participated in more than 30 research projects and has more than 150 articles published. His research interests include mobile communications networks, quality of service, radio resource management, network congestion control, traffic characterization, and performance assessment.
RUI CAMPOS (Senior Member, IEEE) received the Ph.D. degree in electrical and computers engineering from the University of Porto, in 2011. He is currently a Senior Researcher and the Co-ordinator of the Centre for Telecommunications and Multimedia, INESC TEC, and an Assistant Professor at the University of Porto, where he teaches courses in telecommunications. He is the author of more than 85 scientific publications in international conferences and journals with peer review. He has co-ordinated several research projects, including the WiFIX project in CONFINE Open Call 1, SIMBED (Fed4FIRE+ OC3), and SIMBED+ (Fed4FIRE+ OC5). He has also participated in several EU research projects, including H2020 ResponDrone, H2020 RAWFIE, FP7 SUNNY, and FP6 Ambient Networks. His research interests include airborne, maritime, and green networks, with a special focus on medium access control, radio resource management, and network autoconfiguration. He has been a member of the TPC of several international conferences, including IEEE INFOCOM, IEEE ISCC, and IFIP/IEEE Wireless Days, and he was the General Chair of Wireless Days 2017 and the TPC Vice-Chair of 2021 Joint EuCNC & 6G Summit.