Secrecy Capacity Maximization of UAV-Enabled Relaying Systems with 3D Trajectory Design and Resource Allocation

Unmanned aerial vehicles (UAVs) have attracted considerable attention, thanks to their high flexibility, on-demand deployment and the freedom in trajectory design. The communication channel quality can be effectively improved by using UAV to build a line-of-sight communication link between the transmitter and the receiver. Furthermore, there is increasing demand for communication security improvement, as the openness of a wireless channel brings serious threat. This paper formulates a secrecy capacity optimization problem of a UAV-enabled relay communication system in the presence of malicious eavesdroppers, in which the secrecy capacity is maximized by jointly optimizing the UAV relay’s location, power allocation, and bandwidth allocation under the communication quality and information causality constraints. A successive convex approximation–alternative iterative optimization (SCA-AIO) algorithm is proposed to solve this highly coupled nonconvex problem. Simulation results demonstrate the superiority of the proposed secrecy transmission strategy with optimal trajectory design and resource allocation compared with the benchmark schemes and reveal the impacts of communication resources on system performance.


Background and Related Works
Compared with the traditional terrestrial communication, the unmanned aerial vehicle (UAV) is regarded as an important component in emergency communication, mobile internet, and Internet of Things (IoT) due to its rapid response, strong flexibility and low cost [1,2]. In recent years, UAVs have been used in many communication scenarios such as aerial base station (BS) [3], mobile relay [4], flying cellular user [5], communication blind compensation [6], and airborne edge-cloud computing [7]. As one of the main applications of a UAV communication system, the UAV relay technology can effectively solve the wireless traffic congestion as well as the dynamic and unbalanced distribution of mobile devices [8][9][10].
The flexibility to build a line-of-sight (LoS) link is one of the main advantages of UAV-enabled communication [11]. However, the LoS channel is also vulnerable to be eavesdropping by malicious users [12][13][14] due to the channel characteristics of opening and broadcasting. Meanwhile, wireless channels have the characteristics of opening and broadcasting. Therefore, the security of UAV-enabled communication systems needs to be taken seriously, which was not considered in [3][4][5][6][7][8][9][10]. Due to the limited resources and strong flexibility of the UAV, the traditional transmission method could not be directly used in the UAV-enabled communication. As an important supplement of encryption technologies, physical-layer security (PLS) realizes the secrecy transmission by increasing the channel capacity of legitimate users and reducing the channel capacity of eavesdropping users [15][16][17][18][19][20][21].

Motivation and Contributions
As mentioned above, the existing UAV trajectory optimization methods generally focus on 2D optimization under fixed flight altitude, which can not take full advantage of UAV's maneuverability. Furthermore, most studies of PLS in UAV-enabled communication rely on static ground users without considering the existence of mobile users in many scenarios. There is still a lack of research contribution on the effect of mobile ground users on the UAV communication systems, and the corresponding secrecy capacity optimization scheme has not been studied yet. Meanwhile, mobile ground users may bring more challenges in practice, such as how to maintain reliable LoS communication and satisfy the quality of service (QoS) requirements of mobile users.
Based on the above description and discussion, this paper mainly investigates the 3D trajectory optimization and resource allocation to improve the secrecy performance of the UAV-enabled relaying system, where the reliability of LoS communication and QoS of mobile ground users are considered. In particular, a rotary UAV is used as a relay to assist the communication from the BS to multiple mobile users which are monitored by a malicious user; then, the power allocation, bandwidth allocation, and trajectory of the UAV are jointly optimized to maximize the secrecy channel capacity. To handle the nonconvex optimization problem, the SCA-AIO algorithm is utilized. The contributions of this article can be summarized as follows: • A UAV-enabled relaying communication system in the presence of an eavesdropper is proposed in this paper. To enhance the secrecy capacity of this system, we formulate a problem by jointly optimizing the UAV's 3D trajectory and resource allocation under the constraints on information-causality, LoS communication reliability, and QoS requirements of mobile users. • For the highly coupled nonconvex problem, we develop an efficient algorithm to solve it. Specifically, we decompose the optimization problem into three subproblems and transform each nonconvex subproblem into a solvable convex optimization problem by the SCA algorithm. Among them, for the power and bandwidth allocation problems, we transform all the constraints into second-order cone (SOC) constraints and linear matrix inequality (LMI) constraints by introducing auxiliary variables to improve the solution efficiency. Meanwhile, we propose a joint optimization algorithm based on the AIO algorithm framework and analyze the convergence and complexity of the algorithm. • The following fruitful insights are obtained: (1) Numerical results show that the proposed scheme has better performance in terms of the secrecy capacity compared with the traditional optimization schemes. (2) Based on the theoretical analysis and simulation results, the path panning of the UAV relay-adjusted coordinate according to the position of the mobile users is analyzed qualitatively. (3) According to in-depth simulations, we provide the impacts of different parameter configurations on the performance of a UAV-enabled relaying system.

Organization
The rest of this paper is organized as follows. Section 2 presents the system model and states the problem formulation. In Section 3, we propose a joint optimization algorithm to solve the secrecy capacity maximization problem and analyze the complexity as well as the convergence of the proposed algorithm. Simulation results are provided in Section 4. Finally, conclusions are drawn in Section 5.

System Model and Problem Formulation
As shown in Figure 1, we consider a UAV communication system in which multiple mobile users need to receive information from the BS, while an eavesdropper EVE is located around mobile users and attempts to intercept the downlink signal between UAV and mobile users. There is no direct communication link between BS and the users due to obstacle occlusion. Therefore, we establish a two-hop wireless relaying transmission link by using a UAV relay. Without loss of generality, a three-dimensional (3D) Cartesian coordinate system is considered. Suppose that a set of Ω = {1, 2, 3, . . . , N} mobile users are randomly distributed on the ground, and the UAV, which is denoted as R, can adjust its 3D position. Then, the coordinates of BS, UAV, and the nth mobile user are q BS = (0, 0, 0), q R = (x R , y R , z R ), and q n = (x n , y n , 0), respectively. The rough location of EVE can be detected by an optical camera or synthetic aperture radar (SAR) [22]. In practice, the eavesdroppers always try to hide their existence, and the location detection may suffer from errors [23]. Therefore, we assume that the error between the measured value and the actual coordinates is r mk . According to [17], the probability of LoS communication between the UAV R and the ground communication node m is where ϕ and ξ are constants depending on the environment type, while d m,R = q m − q R and θ m,R = 180 π sin −1 z R d m,R are the distance and elevation angle between the UAV and node m, respectively.
To ensure the reliability of the LoS communication between UAV and the BS/mobile users, the probability of LoS needs to meet P LoS ≥ ε LoS [24], where the ε LoS is a constant close to 1. To facilitate the analysis, this constraint can be rewritten as follows To guarantee the security of information transmission, we consider the worst case, i.e., it is a LoS link between the UAV and EVE. The Doppler effect is assumed to be perfectly compensated [25]. Then, the channel gain between the UAV and BS, EVE, and the nth mobile user can be expressed as the following free-space path loss model [26], where X ∈ {BS, EVE, Ω}, and β 0 denotes the channel power gain at the reference distance d = 1 m, which depends on the carrier frequency, antenna gain, etc., and d X,R is the distance between X and R. Considering the worst case, the minimum distance between the UAV R and the EVE is We assume that the downlink between UAV and mobile users adopts frequency division multiple access (FDMA), and the UAV adopts the decode-and-forward (DF) relaying method. The UAV transmits information to mobile users with bandwidth allocation B = {B n,R , ∀n ∈ Ω} and power allocation P = {P n,R , ∀n ∈ Ω}. Considering the limited spectrum resources, the maximum bandwidth for this downlink is denoted as B max , and the maximum transmitting power of the UAV is P max . The channel capacity between the UAV and the nth mobile user is C n = B n,R r n,R where r n,R = log 2 1 + P n,R δ n d 2 n,R , δ n = β 0 n 0 B n,R , and n 0 is the noise power spectrum density. Similarly, the channel capacity between the UAV and the EVE as well as the BS can be expressed as follows, respectively where W is the bandwidth between the R and BS, δ BS,R = β 0 σ 2

BS,R
, and σ 2 BS,R = n 0 W is the noise power at the UAV.
According to [12], the security capacity is defined as the difference between the legitimate channel capacity and the eavesdropping channel capacity, i.e., In this paper, we aim to maximize C sec by jointly optimizing the UAV's 3D trajectory, bandwidth, and power allocation with the constraints on information causality [27], LoS communication reliability, and the QoS requirement of mobile users. We formulate the problem of interest as follows where (8b) and (8c) are information causality constraints in the relaying system, i.e., UAV R can only forward the data that has already been received from BS during the relaying process [27]; (8d) and (8e) guarantee the reliability of the LoS communication; and (8h) guarantees the QoS requirement of mobile users. In addition, (8f) and (8g) limit the maximum available bandwidth and maximum transmission power.

Problem Formulation
Note that the above problem contains nonconvex constraints and nonconvex objective functions, and the UAV location, power allocation, and bandwidth allocation are coupled with each other. To solve this problem, we propose an efficient iterative optimization algorithm, i.e., P1 is decomposed into three subproblems to optimize the UAV's position, power allocation, and bandwidth allocation, respectively.

3D Trajectory Optimization
In this section, the trajectory of the UAV is optimized with fixed power and bandwidth allocations. The slack variables {ϑ n , ϑ EVE , ϑ}(∀n ∈ Ω) are introduced, and the subproblem can be formulated as It can be seen that P1.1 is equivalent to the trajectory optimization subproblem of P1 when the constraints (9d)-(9f) are satisfied with equality. For any ∀n ∈ Ω, if (9d) or (9e) is strictly unequal, C sec will increase as ϑ n decreases or ϑ EVE increases. Therefore, the optimal solution of P1.1 is necessarily obtained when (9d)-(9f) are satisfied with equality, i.e., the optimal solution to P1 can be obtained by equivalently solving the P1.1 when power and bandwidth allocation are fixed. However, it is still nonconvex programming due to the nonconvex constraints (9b), (9c) and (9e). To solve this problem, the UAV's location will be updated iteratively based on the SCA algorithm [28].
Define the coordinate of the UAV in the mth iteration of the SCA algorithm as . According to [28], we can estimate EVE,R by a first-order Taylor expansion, i.e., n,R = P n,R δ n ln 2(P n,R δ n +ϑ n ) . Based on the above analysis, the SCA algorithm solves P1.1 at the mth iteration by transforming it as follows: P1.1.1 is a convex optimization problem, which can be solved by CVX. After obtaining the optimal solution q opt of P1.1.1, it will be used as the input for the next iteration. Finally, the optimization result q opt of the UAV trajectory can be obtained by several iterations. In summary, let

Power Allocation Optimization
In this subsection, we focus on the subproblem to find the optimal power allocation, while the UAV's trajectory and bandwidth are fixed. Obviously, the function R EVEn = log 2 The optimization problem can be rewritten as P1.2 is then reduced to a convex programming problem and can be solved by CVX. Since the objective function and constraints contain the log(·) function, CVX processing requires a large number of approximation iterations [29]. In order to solve this problem, we introduce two sets of auxiliary variables {ρ n }, {χ n }, ∀n ∈ Ω, and transform the constraints into LMI constraints or SOC constraints. Then, the optimization problem is expressed as For the constraint (14e), it can be transformed into an SOC constraint by simple transformation, i.e., P1.2.1 is a simple second-order cone programming (SOCP) problem, which can also be solved by CVX effectively. In summary, let X (0) = P (0) , X (m−1) = P (m−1) , X opt = P (mopt ) , OP X = P1.2.1; then, the subproblem of power allocation optimization can be solved by Algorithm 1.

Bandwidth Allocation Optimization
This section investigates the optimization of bandwidth allocation with a fixed location of UAV and power allocation. Similar to Section 3.2, in the iterative process using the SCA algorithm, we introduce auxiliary variables {t n }, {µ n }, n ∈ Ω to transform the constraints into LMI or SOC constraints. Then, the optimization problem is expressed as follows P1.3 is a simple SOCP problem, which can also be solved by CVX. In summary, let X (m−1) = B (m−1) , X opt = B (mop ) , OP X = P1.3; then, the subproblem of bandwidth optimization can be solved by Algorithm 1.

Joint Optimization Algorithm
Combining the analysis of the three subproblems, a joint optimization algorithm for secrecy capacity is proposed, which uses Alternating Iterative Optimization until the objective function converges. (3) Constraint (11b) can be simply expressed in the following form Thus, (11b) is an SOC constraint of dimension 4. Similarly, (11c) is also an SOC constraint of dimension 4. Combining (2) and (3), it is known that P2.1 has a total of 3N + 3 SOC constraints of dimension 4. In summary, we can see that Algorithm 1 contains one LMI constraint of dimension 5, 3N + 3 SOC constraints of dimension 4, and one SOC constraint of dimension 3; thus, the complexity of the algorithm can be expressed as O 1 = n 1 √ 6N + 13 25n 1 + 48N + 182 + n 2 1 . Similarly, the complexity of subproblems 2 and 3 are O 2 = n 2 √ 7N[3N 3 + 3N 2 n 2 + 2n 2 N + 6N + n 2 2 ], n 2 = 3N, O 3 = n 3 √ 7N 3N 3 + 3n 3 N 2 + 6Nn 3 + 10N + n 2 3 , and n 3 = 3N, respectively. In summary, the complexity of the joint optimization algorithm is Proof of convergence Combined with [24], it can be seen that each subproblem obtains a lower bound on the original optimization problem, and the objective function is monotonically non-decreasing during the alternating iterations, i.e.
Thus, P1 can be obtained by Algorithm 2 with finite iterations to obtain a convergent solution.

Simulation Results
In this section, we assume that the mobile users are randomly distributed in a circle area with the radius of 500 m, and d BS,cen represents the distance between the center of the circle and the BS. Other simulation parameters are given in Table 1.  Figure 2 provides the secrecy capacity versus the number of iterations under different parameters, which can show the convergence characteristics of the proposed joint optimization algorithm. It can be seen that when the number of iterations is larger than 15, the secrecy capacity tends to be stable. Therefore, the proposed optimization algorithm has good convergence under different conditions. In addition, it can be seen that the number of iterations required for the convergence of the algorithm is mainly influenced by the convergence accuracy and the number of ground users. The number of iterations of the algorithm decreases with the value of ε. The number of iterations required for the algorithm to converge also increases with the number of ground users due to more variables being involved.  Considering the mobility of ground users, Figure 3a shows the trajectory of the UAV relay versus the network mobility to clearly describe the relationship between the UAV's position and mobile users. Figure 3a shows that the center of the mobile user group makes a circular motion, and the number and coordinates of mobile users are randomly generated after each location update. From Figure 3a, the UAV's height increases gradually with the distance between the mobile users and the BS. The reason is that the flight altitude of the UAV needs to be increased to raise the elevation angle between mobile users and UAV with the increasing communication distance so as to ensure the probability of LoS communication.  Figure 3b shows the projection of the UAV trajectory on the horizontal plane. For ease of elaboration, the projection of the UAV in horizontal plane is denoted as Q U AV , and the corresponding center of mobile users is denoted as Q cen . It can be seen that Q U AV is always on the right side of Q cen , which is influenced by the information causality constraint and the eavesdropper's position. The offset between Q U AV and Q cen is more pronounced when the ground user is far from the BS and close to the EVE.
To illustrate the effectiveness of the proposed designs, the proposed joint trajectory and communication resource optimization scheme is compared with other three benchmark schemes proposed in [15,24,30]. Scheme 1-The UAV is deployed at the center of mobile users. The height of UAV relay, bandwidth and power allocation are designed to maximize the secrecy communication capacity of this system [30]. Scheme 2-The transmission power and bandwidth are evenly allocated following the principle of fairness [24], and the 3D location of the UAV is optimized.
Scheme 3-With fixed altitude of the UAV relay [15], the 2D trajectory, power and bandwidth allocation are optimized, and the probability of LoS is considered in the simulation process.
From Figure 4, it can be seen that the secrecy capacity obtained by all schemes is decreasing with the distance between the BS and the center of mobile users increasing. This can be easily understood: as the communication distance increases, the signal experiences more fading, and the legitimate channel capacity will decrease. In addition, as the UAV moves far away from the BS, the distance between the UAV and the EVE decreases, causing an increase in eavesdropping channel capacity; then, the secrecy capacity decreases. In scheme 1, the UAV is always located in the mobile users' center, and the downlink channel quality in the UAV-enabled relay system is better than other schemes at this time. However, this scheme ignores the impact on EVE and BS, resulting in the limitation of legitimate channel capacity by information causality constraint and the increasement of eavesdropping channel capacity. Scheme 2 shows that the power and bandwidth are evenly allocated based on the principle of fairness. For users with relatively poor channel quality, the allocation of the same communication resources cannot achieve the optimal overall performance. In scheme 3, UAV trajectory is optimized at a fixed altitude, which is difficult to ensure the reliability of LoS communication, so the system performance will be worse than the proposed algorithm.   Figure 5 shows the secrecy capacity C sec versus B max for different maximum available powers P max . It can be seen that at a certain value of P max , C sec firstly increases with B max and then remains constant. This is due to the fact that the relay communication process is limited by the information causality constraint; i.e., the maximum secrecy capacity of the system is constrained by the channel capacity between the BS and the UAV. In other words, increasing power and bandwidth cannot consistently improve the communication performance of the relay system.  Figure 6 shows the secrecy capacity of each mobile user under different schemes. For each mobile user, the algorithm proposed in the paper also has better performance than existing schemes. The reason is that the reliability of LoS communication is considered in the proposed optimization scheme, and we make full use of the location information to achieve dynamic multi-domain optimization. It can be seen that the proposed algorithm is more adaptable to the scenario of multiple mobile users.

Conclusions
In this paper, we investigate the secrecy capacity optimization problem when the UAV relay serves multiple mobile ground users in the presence of a malicious user eavesdropping on the ground. A joint optimization algorithm for trajectory design and resource allocation is proposed based on the proposed SCA-AIO algorithm. The secrecy capacity of the relay system is improved by jointly optimizing the UAV's trajectory, power allocation, and bandwidth allocation while ensuring the reliability of LoS communication links, QoS requirements of users, and the information causality constraint. At the end of the paper, the effectiveness of the proposed optimization algorithm is demonstrated by numerical results. In addition, this paper reveals the impacts of different parameters on the system performance and the UAV trajectory trend of UAV relay with mobile ground users. In the text, to ensure the reliability of LoS communication, the UAV's altitude changes drastically. Considering the limited energy of the UAV, the proposed optimization algorithm will affect the endurance of the UAV relay. In practical applications, it may be necessary to sacrifice some throughput performance to extend the endurance of the UAV. Futhermore, an energy efficiency (EE) maximization UAV trajectory design based on fly-hover will be the next step in our research to compromise the energy consumption and throughput in a UAV-enabled communication system.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.