An Optimal Relay Number Selection Algorithm for Balancing Multiple Performance in Flying Ad Hoc Networks

The rapid development of aviation technology has made the application of unmanned aerial vehicles (UAVs) more popular in recent years. Due to the inadequate capability of a single UAV, flying ad hoc networks (FANETs), which consist of multiple different UAVs, not only break the limits of single UAV by introducing the cooperation between UAVs, but also complete more complex missions by extending the communication range at infrastructure-less areas. One of the most important design issues for FANETs is the communication and cooperation between UAVs, and the number of UAV relays has been proved to be closely related to the improvement of system performance. However, few FANET protocols or algorithms have been proposed from the perspective of scheduling the number of relays. Inspired by the idea, this paper proposes an optimal relay number selection algorithm based on a more realistic network model which includes a novel cooperative (n+2)-node system model considering the distance metrics between relays and a Nakagami-m short-term static fading channel model more suitable for UAV operation environments. The system outage probability is calculated by introducing the Meijer-G function, and a three-dimensional discrete time Markov chain (DTMC) model is established and analyzed to derive the closed-form binary expressions of throughput, energy efficiency and average transmission delay. In order to balance the three performance so as to achieve a comprehensive system performance, a trade-off factor named EDT is further proposed and maximized to evaluate the optimal number of relays. Finally, simulation results assess the impact of network parameters on system performance, and verify the superiority of the proposed algorithm over its fixed relay number counterpart. INDEX TERMS FANETs, outage probability, relay number selection, DTMC, system performance


I. INTRODUCTION
In the past decade, the rapid development of flight control technology and integrated circuit technology has greatly promoted the application of unmanned aerial vehicles (UAVs), making the mobile communication networks composed of UAVs, which act as both sensors and routers, become a powerful complement to the static wireless sensor networks (WSNs). UAVs have gained widespread attention in the emerging communication field for their excellent advantages of high mobility, low cost, strong survivability and no risk of casualties. They not only play an important role in modern military wars such as intelligence reconnaissance and military strike, but also have broad application prospect in future civilian fields such as traffic monitoring, managing wildfire and power line inspection.
Since the 21st century, with the increasing demand of wireless users for communication modes and quality of service (QoS), taking military communication as an example, the application of UAVs has developed from the early single and large UAV to the current UAV group As shown in Figure 1, different from the traditional single UAV system, besides the communication mode UAV-to-Infrastructure (U2I) where the large UAV must be equipped with an expensive and complicated hardware to communicate with the ground BS or satellite, there has another mode, i.e., UAV-to-UAV (U2U), in FANETs. The mode U2U can be built between small UAVs that are only equipped with cheap and simple hardware. Obviously, the introduction of U2U can effectively reduce the hardware load of network and the acquisition and maintenance cost of nodes, extend the scalability and improve the survivability, making cooperative system complete missions faster than single UAV system. An application example of FANETs is shown in Figure 2.

A. RELATED WORK
FANETs were mostly used in the military field in their early days. Since the 21st century, the flourish of UAV technology has gradually prompted FANETs become a new way in the field of civil communication. Until now, a lot of related work has been proposed to study and improve them.

FIGURE 2. A FANET scenario for aerial surveillance.
Mentioning the origin of FANETs, there were various names of wireless networks composed of UAVs before 2013. For example, the earliest name can be traced back to the UAV ad hoc network named by T X Brown et al. at the university of Colorado in 2004 [5]. T X Brown et al. developed and built a wireless network test bed using IEEE 802.11b (WiFi) radio equipments mounted on small lowcost UAVs, and described the real ad hoc network behavior among UAVs by recording detailed data on network throughput, delay, range, and connectivity under different operating regimes. Aerial robot team is another name, but as a collaborative and autonomous multi-UAV system whose network architecture is ad hoc, its research mainly focuses on the collaborative coordination of multi-UAV systems, rather than the design and optimization of network structures, algorithms or protocols [6]. The third commonly used name is aerial sensor network proposed in [7], which presented a low-cost, miniature controlled-mobile aerial sensor network called Sensor Fly. [7] also demonstrated the hardware design, flight control and collaborative localization capabilities of the Sensor Fly system.
It was not until 2013 that Ilker Bekmezci et al. first formally defined the concept of FANETs in [8], discussed different FANETs application scenarios, and clarified the differences between FANETs, MANETs (mobile ad hoc networks) and VANETs from the perspective of node mobility, topology change, computational power, etc. Furthermore, [8] introduced the main FANETs design challenges and open research issues by providing a comprehensive review of the existing FANETs literatures in order to encourage more researchers to work for the solutions. Based on [8], by introducing the basic networking architecture and main channel characteristics, [9] provided an overview on FANETs with the help of three cases: UAV-aided ubiquitous coverage, UAV-aided relaying and UAV-aided information dissemination. The In terms of network layer, due to the rapid mobility and highly dynamic topology, designing a routing protocol for UAV networks is a challenging task [11]. As a result, a lot of work has been devoted to the design of FANETs routing protocols [11]- [17]. Among them, several overview articles [11]- [14] have been reported from the perspective of topology-based routing [12], position-based routing [13] and cluster-based routing [11]. For example, [11] extensively surveyed and qualitatively compared the cluster-based routing protocols in terms of outstanding features, competitive advantages and limitations. Some open research issues and challenges on cluster-based routing were also discussed in [11]. Meanwhile, many efforts [15]- [17] have been made to improve network performance. An adaptive density-based routing protocol (ADRP) was proposed in [15] to improve the forwarding efficiency by dynamically fine-tuning the rebroadcasting probability according to the number of neighbor nodes. NS-2 simulation results revealed that ADRP achieved better performance than ad hoc on demand distance vector (AODV) protocol in terms of the packet delivery fraction, average end-to-end delay, and normalized routing load, etc. In order to solve the two main problems of short flight time and inefficient routing, [16] saved the communication energy by anticipating the operational requirements of UAVs to adjust their transmission power, and reduced the routing overhead by using a variant of the K-means density clustering algorithm to select the optimal cluster heads. Simulation results evaluated the performance from the aspects of energy consumption, cluster lifetime etc. Based on the optimized link-state routing (OLSR) protocol, [17] designed an OLSR extension, i.e., predictive OLSR (P-OLSR), by taking advantage of the Global Positioning System (GPS) information available on board. A test bed was built to evaluate the link performance, communication range and routing performance. Furthermore, the superiority of P-OLSR over OLSR in the presence of frequent network topology changes was proved.
Although the existing routing protocols have revealed promising results, further investigations (quick recovery, effective dynamic topology formation and maintenance, etc.) are required to take full advantage of UAVs in various applications. For example, a majority of existing works do not take energy efficiency into account, which is a vital problem for commercial off-the-shelf battery powered UAVs, and the traffic characteristics (load balancing) exchanged among nodes.
On the other hand, some media access control (MAC) protocols [18]- [22] have been designed to coordinate and provide means for UAVs to access the medium in an efficient and fair manner. Among them, [18], [19] devoted to improve network performance by designing modified MAC protocol. For example, an adaptive MAC protocol scheme for UAVs (AMUAV) was proposed in [18]. AMUAV implemented a transmission scheme in which UAVs send control packages (Request-to-Send (RTS), Clear-to-Send (CTS), and Acknowledgement (ACK)) with omni-directional antennas and switch to directional antennas to send data packets. OPNET simulation results proved that AMUAV protocol can improve throughput, end-to-end delay and bit error rate for multi-UAV systems. [20], [21] have been proposed to realize a collision-free time slot allocation. [20] proposed a token-based MAC protocol with full-duplex (FD) and multi-packet reception (MPR) radios. This protocol eliminated the packet collision by frequently updating channel state information (CSI) to ensure UAVs can have the latest CSI at any time. Performance results showed the effectiveness of proposed MAC protocol. Moreover, in order to address the well known directional antenna deafness problem, Temel et al. [22] designed a MAC protocol called as LODMAC (location oriented directional MAC) by incorporating the utilization of directional antennas and location estimation of neighbor nodes. Performance results showed that LODMAC protocol outperforms the well-known DMAC (directional MAC) protocol in terms of throughput, utilization, average network delay and fairness.
It is obvious that some existing MAC protocols have well investigated on eliminating packet collision, dealing with hidden exposure terminal problems and directional deafness issues. However, how to provide continuous and timely positioning information for directional antenna is still a difficult point. Moreover, MAC protocols which can not only adapt to dynamic UAV networks but also make full use of channel resources has not been well studied. VOLUME XX, 2017 1 Comprehensively, some works [23]- [25] have been proposed from the perspective of cross-layer analysis. Considering the problem of spectrum scarcity, [23] proposed an integration of UAVs with cognitive radio (CR) technology, discussed the CR-UAV integration issues, and highlighted future research challenges in layer-wise manner. From the perspective of cross-layer design, an adaptive hybrid communication protocol including a positionprediction-based directional MAC protocol (PPMAC) and a self-learning routing protocol based on reinforcement learning (RLSRP) was proposed in [24]. Simulation results showed that the proposed PPMAC overcome the directional deafness problem with directional antennas, and RLSRP provided an automatically evolving and more effective routing scheme. Tian W et al. [25] firstly studied the issue of how to utilize CC to improve the connectivity recovery efficiency in FANETs, and designed a CC-based connectivity recovery algorithm named C3RUN, which not only uses CC to enlarge UAV's communication range and thus achieve quick repair of network connectivity, but also enables UAVs to proactively move to better places for ensuring the establishment of relay links. Simulation results revealed that C3RUN not only can achieve connectivity recovery with less nodes and shorter distance to move, but also can achieve 100% success ratio for connectivity recovery compared with existing work.
The cross-layer design approach has received considerable attention in recent years. A cross-layer protocol, which allows exchanging useful information and feedback among layers for routing decisions, would be an interesting choice to achieve the reliability requirement of FANETs. In future design of cross-layer protocols, machine learning (ML) based algorithms (such as deep learning, neural networks, reinforcement learning, etc.) are considered as most promising techniques. Moreover, more low-complex algorithms for solving the cross-layer optimization problems need to be designed to make the cross-layer protocols more efficiently employed in practical applications.
For quick review, the development of FANETs and some state-of-the-art works are shown in Figure 4. Purohit A et al. proposed a low-cost, miniature controlled-mobile aerial sensor network system called SensorFly [7].
An adaptive MAC protocol scheme for UAVs (AMUAV) was proposed to switch the antenna mechanism used to transmit different packets [18].
A token-based MAC layer scheme using FD and MPR radios was proposed to eliminate the packet collision [20].
Tareque M H et al. classified the existing routing protocols for FANETs into six major categories and introduced them based on various performance criteria [14].
Temel et al. designed a MAC protocol called as LODMAC by incorporating the utilization of directional antennas and location estimation of neighbor nodes [22]. VOLUME XX, 2017 1 To sum up, the current work of FANETs has the following deficiencies. Firstly, compared with the research of routing protocols, less work has been concentrated on the design of MAC layer schemes. Although some existing MAC protocols [17]- [21] have been proposed, most of them mainly devote to improve single performance or solve optimization problems such as position prediction and directional deafness. To the best of our knowledge, there is no MAC scheme has been proposed from the perspective of controlling the number of relays. As described in [8]: "in many applications, the performance enhancement is closely related with the number of UAVs. For example, the higher number of UAVs can complete a search and rescue operation faster. FANET protocols and algorithms should be designed so that any number of UAVs can operate together with minimal performance degradation". Coincidentally, this idea coincides with us. In our finished work [26], an important conclusion that under a specific communication scenario (such as the communication distance between source nodes and destination nodes), there always exists an optimal number of relays in the system which can maximize the energy efficiency has been drawn. Based on this, is it possible to design an optimal relay number selection algorithm which can dynamically adjust the number of relays according to the changing communication distance?
Secondly, the majority of existing system models proposed to analyze multi-relay cooperative networks ignores the distance difference between relays. In FANETs, very low node density and very fast channel quality change lead to a fact that many existing theoretical assumptions considered in other networks cannot be well applied to FANETs. For example, [27]- [29] all studied the MAC schemes under multi-relay networks, but they all made an ideal assumption that the probability parameters such as outage probability, frame error rate (FER) or packet error rate (PER) from the source (S) to the tth relay R t , and that from R t to the destination (D) were equal. Specifically, [29] has assumed that 1  . That is, [29] equated multiple relays to a "super" single relay and thus ignored the distance metrics between different relays. It is reasonable in the low-speed mobile networks such as WSNs and WLANs. However, it is obviously unsuitable for FANETs. Finally, most of the existing literatures only analyze single performance optimization without considering a trade-off between multiple performances. Until now, single performance optimization is the main object of current FANET research, such as improving the throughput [19], and enhancing the connectivity recovery efficiency [25]. However, it is insufficient in high-speed mobile communication scenarios that emphasize comprehensive performance. On the other hand, there always exist some contradictory performances in the system. How to balance them so as to achieve an optimal comprehensive performance is also a key problem that needs to be studied.

B. CONTRIBUTIONS AND PAPER STRUCTURE
Focusing on the above shortcomings, our main contributions are summarized as follows: a) The proposal of a novel network model. Focusing on the problem that the distance difference caused by network characteristics of FANETs cannot be ignored, a novel (n+2)-node system model considering the distance metrics between relays is proposed. Furthermore, a Nakagami-m short-term static fading channel model is selected for FANETs, and the outage probability of all communication links is analyzed by introducing the Meijer-G function. b) The design of an optimal relay number selection algorithm. According to the inspiration that the improvement of FANET performance is closely related to the number of UAVs, a distance-based optimal relay number selection algorithm is designed. Moreover, the proposed strategy can balance multiple performances by introducing a trade-off factor which is called as EDT. d) Four simulation cases are performed to evaluate the influence of network parameters such as the maximum transmission number, communication distance, and the location of relays on system performance. Moreover, the superiority of the proposed strategy over its counterpart whose optimal number of relay is fixed are verified. The rest of this paper is organized as follows: the system model and the proposed algorithm are introduced in Section II. Section III analyzes the system outage probability, builds a 3-D DTMC, and calculates the transmission completion probability   Pr , , i k J by deriving one-step state transition probability. System performance analysis and the evaluation of optimal relay number are presented in Section IV and Section V, respectively. Section VI presents the simulation cases. Finally, the conclusion is drawn in Section VII.

II. SYSTEM MODEL AND OPTIMAL RELAY NUMBER SELECTION ALGORITHM
In this section, we build both system and channel models for multi-relay cooperative FANETs. Furthermore, the main assumptions used in this paper are described, and the optimal relay number selection algorithm is introduced. VOLUME XX, 2017 1

A. SYSTEM MODEL
As shown in Figure 5, this paper considers a multi-relay cooperative FANET consisting of a UAV source node (S), a ground BS destination node (D), and n UAV neighbor nodes  . It is assumed that the distance between any two nodes does not exceed the communication range of antennas and the hidden terminals do not exist. As described in Section I, it is the distinct characteristic of FANETs that makes many existing multi-relay system models which ignore the distance difference between relays significantly unsuitable for analyzing FANETs. Therefore, as shown in Figure 6, this paper builds a dedicated (n+2)-node system model for multi-relay FANETs. In this model, the distance between S (D) and R t , i.e., Each node in the network operates in half duplex and is equipped with the same switched beam antenna arrays [22] that can focus more energy on predetermined directions. That is, system can only conduct once transmission towards one of the M directions of the antennas within a time slot. Given that the main beam angle is  . In radians, the beam number of the antenna can be calculated as: In order to cover the entire communication range, antennas may transmit data continuously and the beams calculated in formula (1) are numbered from 1 to M. Nodes can only transmit or receive data through one of these antenna beams at a given time slot. Obviously, in order to broadcast data, S must carry out sequential transmissions through all the beams. This paper also assumes that all nodes use the identical antenna patterns and can maintain the beam direction at any time. Moreover, the switching time between antenna beams is ignored which can be achieved by using some digital signal processing (DSP) technologies. A perfect CSI is considered, all nodes in the network remain fully synchronized, and the feedback channel is ideal.
As for the selection of channel models, according to the conclusion drawn in [30]: "the fading model should be chosen according to the operation environment. For example, Rayleigh fading can be more suitable for low altitude crowded area applications, while Nakagami-m and Weibull fading with high fading parameters best fit for high altitude open space missions." It is known that Nakagami-m channel is equivalent to the Rayleigh when m=1. For generality, this paper adopts independent Nakagami-m fading. On the other hand, because the very high mobility is the most distinct characteristic between FANETs and traditional terrestrial networks, we further select the short-term static feature to characterize the complex FANETs time-varying channel. It is worth noting that in our finished work for typical terrestrial networks such as VANETs [26] and WSNs [31], the longterm static Rayleigh fading is chosen as the channel model. The difference between long-term and short-term static feature lies in the changing frequency of channel fading coefficient. Given that the duration for sending a specific data frame is an ARQ process, and each transmission in it refers to an ARQ round. A frame can be transmitted at most L times in one ARQ process. The channel fading coefficient of link i-j under the lth ARQ round, i.e. , for different node pairs. However, for the short-term static channel, , ij l h is independent and identically distributed (i.i.d) while l changes for the same node pair (i, j), and independent for different node pairs. It is obvious that the short-term static feature is more accurate to describe the frequent FANETs time-varying channel. Therefore, this paper adopts independent Nakagami-m short-term static fading as the channel model, and selects the additive white Gaussian noise (AWGN) as the noise model.
, and its probability density function (PDF) is: where 0 ij m  is the Nakagami multi-path fading parameter is the average power of link i-j (   E  is the expectation), and     is the Gamma function as shown in formula (3): This paper assumes that relays work in the decode-andforward (DF) mode, and thus after the first ARQ round,  out of n neighbor nodes successfully decode the data frame broadcast by S, and assist S in retransmitting the frame.

B. OPTIMAL RELAY NUMBER SELECTION ALGORITHM
In order to maximize the performance improvement in a specific communication scenario, an optimal relay number selection algorithm is proposed in Figure 7. It is worth noting that the detailed hardware implementation of the proposed algorithm is beyond the scope of this paper.  It can be seen from Figure 7 that the algorithm is mainly composed of two modules: the control module and transmission module. Specifically, in the control module, S judges whether its buffer is empty. If yes, it keeps idle. Otherwise, it broadcasts handshake messages, i.e., control frames, for transmission. After D receives the handshake message broadcast from S, through advanced positioning technologies such as GPS, differential GPS (DGPS), assisted GPS (AGPS) and inertial measurement unit (IMU), D exchanges handshake messages, and calculates n* relays to participate in the cooperation based on the communication distance between it and S. In the transmission module, S transmits data frames in the form of omnidirectional broadcast, if D decodes the data frame correctly; S will transmit a new data frame in the next ARQ round. Otherwise, D judges whether the ARQ round l is less than the maximum value L. if yes, system enters retransmission phases. Otherwise, a NACK is fed back by D and l is reset to 0. In the retransmission phase where relays work in the DF mode, k out of n* relays successfully decode the data frame broadcast from S, if k=0, the data frame is retransmitted by S in the next ARQ round. Otherwise, k relays directionally transmit data frames to D. Similarly, k relays do not stop retransmission until them receive an ACK from D, or L is reached.

III. SYSTEM OUTAGE PROBABILITY ANALYSIS AND MARKOV MODEL ESTABLISHMENT
This section devotes to analyze system outage probability and to establish the corresponding Markov model.

A. SYSTEM OUTAGE PROBABILITY ANALYSIS
Supposing that the transmitted signal is x with a signal-tonoise ratio (SNR) of  , the received signal is y, and the channel fading coefficient is h, then the outage probability of the data link with signaling rate r bits/slot/Hz is: In this paper, the outage events that happen on link S-R, and S-D with and without successful reception at relays in the lth ARQ round are denoted as , respectively.
The assumption: is made to simplify the analysis. It is known that where  is the path loss factor. Therefore, in the Nakagami-m short-term static fading channel with AWGN communication scenario, the probability of above outage events is expressed as follows: Pr Pr log 1 are the elements of power intensity gain matrixes represents that k out of n UAV neighbor nodes successfully decode the data frame for the first time in the k R T th ARQ round. Equations (5) and (7) mean that the transmission of links S-R and S-D have failed (i.e., outage happens) for l ARQ rounds, while equation (6) which means that k out of n UAV relays do not correctly decode the frame transmitted from S until the tth ARQ round.
It is known that , is the Meiger-G function [33] shown in formula (11): , , , = , , , where the integral path C depends on the relative size of parameters.   1   and   2   are as follows: In particular, when   which can be simplified in equation (15) by using the Meijer-G identity: From above, we can obtain the expressions of outage probability for all data links.

B. MARKOV MODEL ESTABLISHMENT AND ANALYSIS
According to the system model and optimal relay number selection algorithm described in Section II, a 3-dimensional DTMC model is established in Figure 8.
In the DTMC, state S represents that D decodes the data frame successfully, state F represents that D fails to VOLUME   Based on the obtained expressions of outage probability, the one-step transition probability of this 3-D DTMC model can be analyzed. There are mainly three types of transition: 1) The transition from the initial state   S F . The state S (or F ) that represents a successful (or failed) transmission of the previous data frame can only move to state S , 1,0,0 R , or   Obviously, the sum of formulas (16) decode the frame for the first time, but D fails to decode the frame; D finally fails to decode the frame and discards it, respectively. Their transition probability can be expressed as: Similarly, formula (24) can be derived by summing k in formula (22), and the same conclusion can be drawn as that from formula (19 3) The transition from the general state , , From above, all one-step transition probability expressions of the 3-D DTMC model can be obtained.

C. TRANSMISSION COMPLETION PROBABILITY
In order to analyze system performance in Section IV, it is necessary to obtain the probability that the ARQ process for transmitting a frame is completed through k relays cooperatively retransmit the frame   0 1 J J i    times in the ith ARQ round, i.e.,   Pr , , i k J , which is also called as the transmission completion probability in this paper. It is worth noting that all the possible values of J when 2 i  are presented in Figure 9. Obviously, when 1 i  , it means that the transmission process ends in the first ARQ round, i.e., D successfully decodes the frame in the first round.
From Figure 9, the transmission completion probability   i k J represents the probability that the ARQ process is completed before reaching the maximum transmission number L (i.e., Pr , , L k J represents the probability that the process is not completed until L is reached ( i L  ). They are expressed as: The expressions of four sub-formulas in formulas (29) and (30) are respectively analyzed below: 1) The formula (29-a), i.e.,   Pr , 0, 0 i .

 
Pr , 0, 0 i , which represents that the S-D link successfully completes the transmission in the î th ARQ round without any cooperation, can be expressed as follows according to the multiplication of one-step transition probability of DTMC model shown in Figure 8: represents the probability that the S-R-D link successfully completes transmission in the î th ARQ round. From (32), formula (8) can be rewritten as: Pr Pr The complete expression of   Pr , , i k J can be obtained by substituting equations (31)-(32) and (34)-(35) into (28).
However, it is necessary to reorganize the formula (28)

IV. SYSTEM PERFORMANCE ANALYSIS
Based on the one-step transition probability and transmission completion probability obtained in Section III, this section mainly derives the closed-form expressions of system performance, which includes throughput, energy efficiency and average transmission delay, under arbitrary maximum transmission number L and relay number n.

A. THROUGHPUT
This paper defines system throughput as the average number of data frames correctly received by D within one time slot, i.e., the average number of time slots consumed by the DTMC in the state S , which can be equivalent to the steady state probability of state S . Supposing that the steady state distribution of the 3-D DTMC model is  is the steady probability of state S . It is worth noting that throughput S  is a binary function of L and n. Then S  can be derived according to 1 ,  is calculated as: Based on equation (28)

V. EVALUATION OF THE OPTIMAL RELAY NUMBER n* FOR BALANCING MULTIPLE PERFORMANCE
Based on the above analysis, this section further discusses how to evaluate the optimal relay number n* that can balance throughput, energy efficiency and average transmission delay from a general value n.
It is reasonable that high throughput and energy efficiency, and low transmission delay are three of the most crucial considerations in the design of wireless network strategy. As a result, it is ideal to increase throughput and energy while reducing transmission delay in most wireless mobile networks including FANETs. However, these performance metrics are often contradictory to each other. For instance, reducing power consumption of battery-powered devices leads to a long packet delay in the network [34]. It is this trade-off relationship that makes it very difficult to improve multiple performance at the same time.
In order to determine the appropriate number of relays, this paper proposes a trade-off factor called EDT (energy, delay and throughput) according to the above optimization principle. That is: It can be seen from equation (57) that the main goal of our proposed optimal relay number selection algorithm is to maximize EDT to balance the throughput, energy efficiency and average transmission delay. Based on the system performance in Section IV, because the number of relays n is the important parameter that affects these performances simultaneously (i.e., all the three performance metrics are a function of n when L is given), the optimization function of EDT can be obtained, which is shown in equation (58), by using n as the control knob parameter.
Obviously, the optimal value n* can be obtained by rigorously searching a sufficient range for n, thus solving the integer programming problem shown in formula (58). The acquisition of n* means that the ground BS (i.e., D) can calculate and schedule optimal number of relays according to the different communication distance between S and D, achieving the highest comprehensive performance in the specific communication environment.

VI. SIMULATION EXPERIMENTS
In order to analyze the impact of network parameters on system performance and to verify the effectiveness of the proposed algorithm, this section performs four study cases by using MATLAB numerical simulations.
The system parameters adopted in the simulation are summarized in Table I

A. STUDY CASE 1: THE IMPACT OF NETWORK PARAMETERS ON SYSTEM PERFORMANCE
To evaluate the impact of network parameters on system performance, Figures 10-12 simulate throughput, energy efficiency and average transmission delay as a function of n under the same SD d , different L and SR q , respectively. It can be seen firstly from Figure 10 and 12 that with the increase of n, both throughput and delay monotonically change (throughput increases but delay decreases) to a certain value and then keep constant, indicating that there indeed exists a suitable n in the system. Beyond this value, the increase of system cost (such as increasing the number of UAVs) will not improve the system performance.   However, the trend of energy efficiency in Figure 11 which increases first and then decreases with n, even reflecting that after exceeding an appropriate n, the increase of system cost will lead to the decrease of energy efficiency! This also demonstrates the importance of choosing a suitable n for improving system performance. On the other hand, it can be easily seen from Figure 11 that the energy efficiency is maximal when n=1. It is because that the channel quality of link S-D deteriorates with the increase of SD d . In the medium distance communications (i.e., 500 SD d  in this case), its channel quality is worse than that of short distance communications, making the outage probability of link S-D gets higher and system performance becomes poorer. The relay cooperation can effectively compensate the path loss caused by increasing communication distance. Therefore, as shown in Figure 11, the energy efficiency performs optimal at n=1, which proves the effectiveness of introducing relay to improve system performance.   Secondly, Figure 10-12 also show that the maximum transmission number L is directly proportional to both throughput and energy efficiency, but inversely proportional to the average transmission delay, which is realistic because the more the transmissions are performed, the more payloads the system will transmit, the throughput and energy efficiency are naturally improved. However, it is obvious that this improvement is at the expense of the transmission delay.
Thirdly, it can be clearly seen from Figure 10-12 that no matter which performance is, it almost performs optimally under the curve of 0.6 SR q  , which proves that the closer the relays gets to the middle position of SD d , the higher performance the system will achieve. Moreover, these relays should be preferred to the optimal relays.
Case 1 provides some theoretical references for the design and optimization of future multi-relay wireless networks from the perspective of parameter selection and setting.

B. STUDY CASE 2: THE IMPACT OF COMMUNICATION DISTANCE ON SYSTEM PERFORMANCE
To evaluate the impact of the communication distance between S and D (i.e., SD d ) on system performance, Case 4 powerfully proves that the optimal relay number selection algorithm proposed in this paper can keep the highest comprehensive performance of multi-relay FANETs system at any communication distance.

VII. CONCLUSIONS
This paper proposes an optimal relay number selection algorithm which can balance multiple system performance for multi-relay FANETs. Based on a novel system model that adds the distance metrics between relays, a 3-D DTMC model considering the number of relays at any maximum transmission number is established by designing the algorithm flow. The one-step transition probability, steadystate distribution and transmission completion probability of the 3-D DTMC model are respectively solved by analyzing the system outage probability, and then the closed-form binary functions of system performance including throughput, energy efficiency and average transmission delay are derived.
Finally, MATLAB numerical simulation results not only analyze the influence of network parameters including the maximum transmission number, location of relays, number of relays and communication distance on system performance, but also evaluate the optimal relay number n* by introducing and maximizing a trade-off factor EDT. The effectiveness of the proposed algorithm compared with its fixed relay number counterpart is also verified.
In future work, we will further study the performance optimization of FANETs combined with the smart Internet of Things (IoT) based on the inspiration of [35] that proposes a novel routing protocol for FANETs using modified AntHocNet.