Cognitive NOMA for UAV-Enabled Secure Communications: Joint 3D Trajectory Design and Power Allocation

In the paper, we investigate the physical layer security (PLS) of an unmanned aerial vehicle (UAV) enabled communication system that integrates non-orthogonal multiple access (NOMA) with cognitive radio (CR), namely CR-NOMA. Specifically, the secondary UAV transmits confidential information to multiple secondary legitimate receivers with NOMA by sharing the spectrum with the primary networks, while an eavesdropper (Eve) attempts to wiretap the communication. We aim to jointly optimize the three-dimensional (3D) UAV trajectory and power allocation to maximize the worst-case average secrecy sum rate of all secondary receivers (SRs) while keeping the interference to primal receivers (PRs) below a certain threshold. The formulated problem is mixed-binary non-convex and is generally NP-hard. To address this issue, we first equivalently transform the binary variables into continuous ones by introducing tractable inequality constraints. Then, we decompose the optimization problem into two subproblems and develop an efficient iterative algorithm based on the successive convex approximate (SCA) technique, block coordinate descent (BCD) technique, and penalty function method. Numerical results are extensively studied to show that the proposed joint design significantly outperforms the benchmark schemes in terms of secrecy rate.


A. MOTIVATIONS
Recently, unmanned aerial vehicles (UAVs) have attracted growing interest in both academia and industry. Compared to traditional terrestrial communications, UAV-enabled communication has several advantages, such as on-demand deployment, high mobility, and line-of-sight (LoS) dominant UAV-to-ground channels [1], [2]. Therefore, UAV is anticipated to find many potential applications in the future [3]- [6]. However, the UAV system is in the face of spectrum scarcity issue since UAVs usually operate on overloaded unlicensed spectrum bands (e.g., IEEE S-Band, IEEE L-Band, and, Industrial, Scientific, and Medical (ISM) band) [7]. Fortunately, cognitive radio (CR) technology has been recognized as a prospective approach to improve the The associate editor coordinating the review of this manuscript and approving it for publication was Cesar Vargas-Rosales . system spectrum utilization [8], [9]. Specifically, in the underlay CR paradigm, secondary users are allowed to access the primary networks while ensuring that the interference constraints of the primary users are not violated [10]. Therefore, the CR technology can provide a prominent solution to deal with the spectrum congestion in UAV systems.
Despite the considerable benefits of applying CR into UAV systems, the limited flight time of UAVs becomes a bottleneck. Therefore, it is essential to enhance transmission efficiency. Non-orthogonal multiple access (NOMA) is an important technology for the future network, owing to its low transmission latency, massive connectivity support, and high spectrum efficiency [11]. In power domain NOMA, more than one user can be served in the same time/frequency resources simultaneously and multiplexed in power levels, which is fundamentally different from conventional orthogonal multiple access (OMA). Therefore, it is of VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ utmost importance to study the application of NOMA in UAV-enabled CR networks, namely CR-NOMA. Moreover, the inherent broadcast nature of the wireless channel makes the UAV-to-ground link vulnerable to the eavesdropper (Eve) than ever, leading to a risk of information leakage. As a complement of traditional encryption techniques, physical layer security (PLS) techniques play an essential role as an appealing alternative way to partially tackle the security issues by exploiting the physical layer characteristics of wireless channels [12]. Motivated by the above work, in this paper, we study the PLS performance of a UAV-enabled CR-NOMA communication system.

B. RELATED WORKS 1) TERRESTRIAL NETWORKS
Extensive efforts have been devoted to study the security issues of CR networks from a physical layer perspective [13]- [17]. For example, [13] and [14] aim to maximize the achievable ergodic secrecy rate of the secondary transmission. The work in [13] proposes a multiuser scheduling scheme, while in [14] beamforming vector of the information signal and power allocation between information and jamming signals are optimized. The work in [16] proposes a framework to investigate the spectrum efficiency and energy efficiency for secure transmission in CR networks.
Simultaneously, improving the PLS performance for NOMA systems has attracted a lot of interest. Specifically, the works in [18]- [20] have demonstrated the superiority of NOMA compared with OMA for achieving a remarkable secrecy performance. The max-min secrecy rate problem is formulated in [18] with the constraints of the secrecy outage and transmit power. Beamforming and power allocation policies are adopted by [19] and [20] to confront internal Eves. In large-scale networks, the stochastic geometry approach is invoked in [21] to enhance the PLS in the NOMA system.
Recent studies have paid more attention to the PLS performance for CR-NOMA systems. The work in [22] studies the power allocation of NOMA for secondary users in a CR network to enhance spectral efficiency by using interference cancellation. The secrecy sum rate of all legitimate users is maximized in [23] by power allocation between primary receivers (PRs) and a secondary base station. An analysis framework is developed in [24] to evaluate the reliability and security performance of cooperative cognitive NOMA systems via secrecy outage probability and connection outage probability. A two-slot secure transmission is proposed in [24] by using a multi-antenna secondary full-duplex NOMA relay for CR networks.
2) UAV NETWORKS UAV communications have been widely studied for wireless networks [3]- [6], [25], [26]. Among them, in [25], the UAV is employed to aid multiple cells for data offloading, where the trajectory is optimized to maximize the sum rate of UAV-served edge users. For a solar-powered multicarrier UAV communication system, the work in [26] studies the joint three-dimensional (3D) UAV trajectory and offline/online resource allocation optimization to maximize the system sum throughput. However, the security issue is not considered in these works and thus secure transmission cannot be guaranteed. Recently, the PLS techniques have been increasingly applied in UAV-enabled communication systems to enhance system security [27], [28]. For instance, a secure transmission system consisting of two UAVs is investigated in [28], where a UAV communicates with multiple legitimate users with OFDMA, and the other multi-antenna UAV acts as a jammer to interfere with Eves. The system energy efficiency maximization problem is studied by jointly optimizing the UAV trajectory, resource allocation and jammer policy.
There exist a few works in the literature focusing on the security of UAV-aided CR networks [29], [30]. The work in [29] deploys UAV as a mobile relay to assist communication from a secondary transmitter (ST) to a secondary receiver (SR) in the presence of an Eve, while the work in [30] employs UAV as a friendly jammer to interfere with the Eve. Moreover, the security of cognitive UAV communication networks is studied in [31], [32], where a cognitive/secondary UAV acts as a transceiver to communicate with an SR. With imperfect information regarding the locations of PRs and Eves, a joint robust two-dimensional (2D) trajectory and transmit power design is investigated in [32] to maximize the average secrecy rate by taking into account two practical inaccurate location estimations, i.e., the worst case and the outage-constrained case. However, the above works in [29]- [32] only consider one SR, which extremely simplifies the practical consideration.
The application of NOMA in UAV networks has become a promising area very recently. The work in [33] proposes a multiple-input multiple-output (MIMO)-NOMA based UAV network and analyzes the outage probability and ergodic rate with a stochastic geometry model. In [34], the authors investigate the joint UAV placement, admission control, and power allocation to maximize the user number for a heavy-loaded NOMA based UAV system. Additionally, exploiting the UAV's high mobility is expected to unlock the full potential of UAV-to-ground communications [35]- [38]. Specifically, by considering a linear topology scenario for ground receivers, the work in [35] optimizes the one-dimensional (1D) UAV trajectory and communication resource allocation to reveal the fundamental rate limits of the UAV-enabled multiple access channel. For a UAV-enabled uplink NOMA network, the joint 2D UAV trajectory and power control problem is proposed in [36] to maximize the sum rate, which is then transformed into a UAV deployment problem. The work in [38] develops an efficient algorithm to solve the max-min average rate problem by optimizing the 2D UAV trajectory and resource allocation for the time division multiple access (TDMA) and NOMA schemes. However, all the aforementioned research efforts either focus on the CR based or NOMA based UAV network, but the integration of CR with NOMA has not been well studied.
There have been very few works that investigate the PLS performance for UAV-enabled NOMA networks [39]- [42]. The work in [39] proposes a joint precoding optimization scheme for secure simultaneous wireless information and power transfer (SWIPT) in UAV-aided NOMA networks, where artificial jamming is generated at UAV to guarantee the security. In [40], a framework is proposed to study the security, reliability, and energy coverage performance of millimeter-wave (mmWave) SWIPT UAV networks for both OMA and NOMA schemes. For a UAV-relaying system with local caching, the work in [41] studies the joint optimization of the UAV trajectory and time scheduling to secure the transmission. The work in [42] proposes two schemes to enhance the security of NOMA-UAV networks via power allocation and beamforming. However, these works largely ignore the secrecy performance of mobile-UAV enabled NOMA networks.

C. CONTRIBUTION AND ORGANIZATION
The main contributions of this paper are summarized as follows: • In this paper, we study the PLS performance of a mobile UAV-enabled CR-NOMA communication system. Specifically, by sharing the spectrum with the primal network, a mobile UAV acts as a secondary transmitter and sends confidential information to multiple SRs with NOMA in the presence of an Eve. Our objective is to maximize the worst-case average secrecy sum rate of all SRs by jointly optimizing the 3D UAV trajectory and power allocation as long as the interference constraint at PRs is satisfied, which is a mixed-binary non-convex problem.
• First, for the binary variables determined by the time-varying UAV trajectory, we equivalently transform them into continuous variables by introducing tractable inequality constraints, which efficiently avoids dealing with piecewise constraints. Then, we decompose the non-convex optimization problem into two sub-problems and propose an efficient algorithm with alternating optimization (AO) by leveraging the successive convex approximate (SCA) technique, block coordinate descent (BCD) technique, and penalty function method. Specifically, for the 3D UAV trajectory and power allocation optimization subproblem with fixed successive interference cancellation (SIC) order, we add a penalty term that violates the constraints to the objective function, thus providing more freedom for trajectory optimization. For the SIC order optimization subproblem with fixed 3D trajectory and power allocation, we add another penalty term to convert the constraints to the objective function, thereby extending the feasible set and avoiding the problem infeasibility caused by the approximation process from non-convex to convex terms.
• We evaluate the performance of our proposed design through extensive simulations. Numerical results demonstrate that our joint design of 3D trajectory and power allocation can achieve superior performance gain compared with benchmark schemes. Besides, it shows that the secrecy rate of the NOMA scheme is always no worse than that of the TDMA scheme. Note that the work in [25] investigates the UAV trajectory at the edge of multiple cells for data offloading. The works in [26] and [28] study the joint UAV trajectory and resource allocation optimization for solar-powered UAV communications and energy-efficient secure UAV communications, respectively. However, in comparison with [25], [26], [28], we consider CR-NOMA based UAV communications, which brings additional challenges to the trajectory design and power allocation since NOMA introduces varying binary SIC order determined by the UAV trajectory.
The rest of this paper is organized as follows. Section II introduces the system model and problem formulation for the UAV-enabled CR-NOMA communication system. Section III proposes an iterative algorithm for the formulated problem. In Section IV, numerical results are presented to validate the effectiveness of the proposed joint design. Finally, we conclude the paper in Section V.
Notations: In this paper, scalars are denoted by italic letters, and vectors are denoted by boldface lower-case letters. R M ×1 denotes the space of M-dimensional real-valued vectors. For a scalar x, |x| represents its absolute value. For a vector y, ||y|| denotes its Euclidean norm, and y T represents its transpose.

II. SYSTEM MODEL AND PROBLEM FORMULATION A. SYSTEM MODEL
As shown in Fig. 1, we consider a spectrum sharing scenario for a UAV-enabled downlink secure communication system. Specifically, a cognitive/secondary UAV serves SRs in the presence of a number of primary users that operate over the same frequency band, and in the meantime, an Eve attempts to wiretap the communication. We consider that the secondary UAV adopts the underlay CR paradigm to access the licensed spectrum, where concurrent primary and secondary UAV transmissions are allowed as long as the interference on the VOLUME 8, 2020 primary network cannot exceed a tolerable threshold [10]. Let I denotes the number of PRs. Without loss of generality, a 3D Cartesian coordinate system is considered, where the 3D coordinate of k-th SR, Eve and i-th PR is given by w u,k ∈ R 3×1 for k ∈ K {1, 2, · · · , K }, w e ∈ R 3×1 , and w p,i ∈ R 3×1 for i ∈ I {1, 2, · · · , I }, respectively. We consider offline optimization in this paper by assuming that their locations are fixed and known to the UAV. Specifically, SRs and PRs can obtain their locations via a global positioning system (GPS) and report location information to the UAV by performing handshaking with the UAV at the beginning of each time slot. The Eve location can be detected by using an optical camera or synthetic aperture radar (SAR) equipped on the UAV [27], [28]. This provides key insights for practical designs with partial/imperfect knowledge of location information.
For ease of exposition, the discrete linear state-space approximation is applied to divide the UAV flight time T into N equally-spaced time slots with step size δ t , i.e., T = N δ t . 1 Note that δ t is selected to be small enough such that the 3D UAV location is nearly unchanged within each time slot. Accordingly, the 3D UAV trajectory can be approximated by the sequence q[n] ∈ R 3×1 for n ∈ N {1, · · · , N }. In practice, the UAV trajectory is limited by the maximum horizontal flight speed V L and vertical flight speed V D in meter/second (m/s), i.e., Besides, the UAV is subject to the maximum/minimum altitude constraints in meter (m), i.e., Moreover, the UAV is dispatched to fly from the predefined initial location q 0 to the final location q F , i.e., We assume that the Doppler effect owing to the UAV mobility can be perfectly compensated. As commonly adopted in prior works on UAV-assisted communications (e.g. [43], [44]), we assume that the air-to-ground communication channel is heavily dominated by LoS links. Hence, the channel state information (CSI) between each node and UAV can be determined by its location. Therefore, based on location information, the UAV can easily obtain CSI of SRs, PRs and Eves for all the time slots for any positions of the UAV [27], [28]. Thus, the channel power gains from the UAV to k-th SR, i-PR and Eve in time slot n follow the free-space path loss model, which are respectively given as where β 0 denotes the channel power gain at the reference Note that when the channel gains are equal, either SR can be chosen as the stronger one, and the other is the weaker one. (8b) indicates that the UAV should not treat the signal from the k-th SR as interference when decoding the k-th SR's signal. Constraints (8c) avoids the case where two different SRs are regarded as stronger or weaker users at the same time. Denote p k [n] as the downlink transmission power allocated to k-th SR in time slot n, which needs to satisfy where P max denotes the maximum downlink transmit power of the UAV. For a more general system model that takes into account the UAV power consumption for cruising, the joint optimization of UAV trajectory and power allocation is more intricate, which will be left as our future work. In practice, in addition to the interference from other co-channel terrestrial users, SRs and Eve also suffer the terrestrial interference from primary transmitters. In the paper, we assume that the total terrestrial interference is contained in Gaussian noises, and the variance of Gaussian noises at each SR and Eve is different. The achievable data rate of k-th SR in time slot n in bps/Hz is where γ k = β 0 σ 2 k and σ 2 k is the variance of Gaussian noises at the k-th SR. Note that the worst case is that signals of the SRs whose channel gains are worse than k-th SR have already been decoded before Eve attempts to decode the signals of the k-th SR, which overestimates the Eve's capability [45]. An achievable rate R e,k [n] in bps/Hz for Eve to wiretap the signal of the k-th SR is formulated as where γ 0 = β 0 σ 2 and σ 2 is the variance of Gaussian noises at Eve. The worst-case secrecy rate of k-th SR in time slot n in bps/Hz can be expressed as where [x] + = max{x, 0}. In such a spectrum sharing scenario, PRs suffer severe air-to-ground interference from the secondary UAV. In order to protect primal communications, the interference temperature (IT) technique is adopted as in [29]- [32] such that the interference power at i-th PR within time slot n is constrained below the tolerable threshold , i.e., , ∀k, n}, and Q = {q[n], ∀n}. We aim to maximize the worst-case average secrecy sum rate over all SRs via the joint design of power allocation, P, and 3D UAV trajectory, Q. This problem can be formulated as where r * denotes the minimum average secrecy rate threshold of SR. Note that the operation [·] + has been dropped since the practical value of R u,k [n] − R e,k [n] in the objective function and constraint (15b) is at least zero by setting p k [n] for any k, n. Constraints (15b) ensure the minimum average secrecy rate requirement of each SR. Problem (P1) is challenging due to the existence of the non-convex objective function and constraints as well as binary variables α k,j [n] that are trajectory dependent. It is worth mentioning that the approach in [25], [46] for addressing the binary variables does not apply to (P1). In [25], [46], binary variables are first relaxed to [0, 1], and then can be reconstructed based on the obtained non-binary variables, by dividing the origin time-slots into more sub-slots and assigning the fractional resource accordingly. However, such an approach to reconstruct binary variables does not apply to (P1) since, within any time slot n, the SIC order α k,j [n] cannot be assigned proportionally. In (P1), α k,j [n] and q[n] must be determined jointly, or otherwise, once the optimal q[n] is obtained, the SIC order α k,j [n] can be uniquely determined to 0 or 1 according to SR's channel gain.

III. PROPOSED ALGORITHM FOR PROBLEM (P1)
In this section, we develop an efficient iterative algorithm based on the SCA technique, BCD technique, and penalty function method. Specifically, we first equivalently convert the binary variables determined by the time-varying Q into continuous ones through introducing inequality constraints that are linear and convex with respect to A and Q, respectively. Then, we optimize the 3D UAV trajectory Q and transmit power P with fixed SIC order A, and then optimize the SIC order A with fixed 3D UAV trajectory Q and transmit power P. These two optimization subproblems are solved alternatively until converge is reached.

A. PROBLEM TRANSFORM
To facilitate processing the constraint (8a), we first define where x ∈ R, y ∈ R 3×1 , and d u,k [n] = ||y − w u,k ||. Then, we present the following lemma. Proof: See Appendix B. So far, by exploiting the special structure of (8a), we have transformed the binary piecewise constraints (8a) into continuous ones, which efficiently facilitates the tractability of (P1). Then, by introducing the slack variables T = , ∀k, n}, we handle the highly coupled objective function and transform problem (P1) as It can be verified that all constraints (19c) must be satisfied with equality at the optimal solution to (P2), since otherwise, we may increase θ k [n] without decreasing the objective value or violating constraint in (19b) and (19c). Similarly, there also exists a corresponding optimal solution to (P2) that makes all constraints (19d) and (19e) satisfied with equality. Therefore, (P2) is equivalent to (P1). However, (P2) is still a non-convex optimization problem. In the following subsection, (P2) is decomposed into two subproblems, and a suboptimal solution can be obtained. K k,j f k,j,n (α k,j [n], q[n]) and µ > 0 is the penalty parameter. It is worth noting that it must have ϕ ≥ 0 due to f k,j,n (α k,j [n], q[n]) ≥ 0 within the feasible region of (P3). Inspired by [34], it can be proved that (P4) is equivalent to (P3), when µ ≥ µ * , where µ * is the optimal Lagrange multiplier associated with constraint (17a). In the following, we focus on solving problem (P4). Without loss of generality, we adopt the SCA technique to replace the non-convex term by deriving the global lower bounds at a given point in each iteration as in the prior works (e.g., [25] , ∀k, n. According to the above discussions, problem (P4) is approximated as the following problem (P5) max P,Q,T,S,θ ,ϕ However, problem (P6) is still a non-convex optimization problem owing to the non-convex constraints (17b) and (19c), which is difficult to solve with standard convex optimization techniques in general. Fortunately, all these non-convex terms can be handled with the SCA technique. However, if we directly apply the SCA technique under the consideration of (17b), there will be some iterations where the subproblem is infeasible due to (17b) leading to the failure of obtaining solutions. Inspired by the recent results in [34], [47], we tackle this issue by alternatively considering the relaxation of constraints (17b). Specifically, by introducing slack variables φ, problem (P6) can be rewritten as and λ * is the optimal Lagrange multiplier associated with constraint (17b). It has been proved in [34] that φ = 0 at the convergence points, i.e., problem (P7) is equivalent to (P6). Now the SCA technique is used to tackle the non-convex constraints in the same way as Section III-B. In addition, for any local point {ᾱ k,j [n]}, we can obtain an upper bound of φ as For any local point {t k [n]}, constraint (19c) can be converted into (34b) Note that problem (P8) is a convex optimization problem, which can be effectively solved by standard convex optimization tools such as CVX. It is worth noting that the feasible set of problem (P8) is a subset of that of problem (P7). Therefore, the objective value of problem (P8) gives a lower bound to that problem (P7).

D. OVERALL ALGORITHM AND COMPLEXITY
The proposed iterative algorithm for problem (P1) is concluded in Algorithm 1. Specifically, problem (P1) are solved by alternately optimizing subproblem (P5) and (P8). Note that we initially set a small value r * 0 and then use r * r * temp = min{r * , r * 0 + m · r step }.

8:
Update m = m + 1, λ m+1 = min{c 1 λ m , λ max } and µ m+1 = min{c 2 µ m , µ max }. 9: until r * temp = r * , ϕ ≤ 1 , φ ≤ 2 , and the fractional increase of the objective value is below a threshold. VOLUME 8, 2020 to approach r * by updating it step by step, which can ensure the feasibility of initial points. Moreover, we initially set the penalty parameters λ and µ a sufficiently small value λ 0 and µ 0 to provide a larger feasible set for A and Q, and then we update λ and µ with two constants c 1 and c 2 step by step until two corresponding bounds λ max and µ max are achieved to make sure φ → 0 and ϕ → 0 at the convergence points. Since CVX invokes an interior-point method to solve the optimization problem, the computational complexity of the proposed algorithm can be analyzed as follows. Note that logarithmic constraints can be approximated to linear ones by using the first-order Taylor . Besides, problem (P8) contains 4K (K − 1)N + 5KN + 3K linear inequality constraints of dimension 1 and its number of optimization variables is on the order of O(K 2 N ). The computational complexity of problem (P8) with interior-point method is in the order of O(K 7.5 N 3.5 ). Therefore, the total computational complexity of the proposed algorithm is O(N ite ((K 0.5 + I 0.5 )(K 4 N 2.5 + K 3 N 3.5 ) + K 7.5 N 3.5 )), where N ite is the iteration number of Algorithm 1.
Based on (35), the sum data rate of Eve in time slot n depends on the transmit power of the UAV, i.e., K j=1 p k [n], and is independent on the power allocation to SRs.
Remark 2: It is worth pointing out that any feasible solution of problem in the TDMA scheme is also feasible for (P1) in the NOMA scheme, but the reverse does not hold in general. Specifically, for the TDMA scheme, suppose {β k [n]} denotes the scheduling variable between k-th SR and the UAV in time slot n and b[n] is the UAV transmit power. If k-th SR is served by the UAV in time slot n, β k [n] = 1; otherwise, β k [n] = 0. Then, for any feasible {β * k [n], b * [n]} in the TDMA scheme, we can always construct a feasible solution to the NOMA scheme by allocating p k [n] = β * k [n]b * [n] to the k-th SR in time slot n. Under this circumstance, the SR's secrecy rate of NOMA is the same as that of TDMA. As a result, the NOMA scheme at worst-case can always achieve no worse performance than the TDMA scheme.

IV. NUMERICAL RESULTS
In this section, numerical results are provided to evaluate the performance of the proposed iterative algorithm. We consider a system with K = 3 SRs, I = 3 PRs and an Eve that are distributed in a horizontal plane, marked by '×'s,' •'s and ' ' respectively. The UAV is assumed to fly from the initial location [0, 200, 50] T m (marked by '+') to the final location [0, −200, 50] T m (marked by ' '). Furthermore, the numerical setup of the following simulations is given in Table 1. For comparison, we propose a CR-TDMA scheme, where the secondary UAV communicates with at most one SR within one time slot. Specifically, the 3D UAV trajectory, transmit power and SR scheduling are jointly optimized in the CR-TDMA scheme.  First, we show the convergence performance of the proposed iterative algorithm in Fig. 2. The flight time is set as T = 45 s, the maximum transmit power of the UAV is P max = 0.1 W and IT threshold is = −80 dBm. It can be observed that the worst-case secrecy rate first decreases rapidly and then gradually increases. This is because the r * is initially set as a small value and then reaches the desired r * . In our setting, the secrecy rate converges after 66 iterations, which verifies the effectiveness of the proposed algorithm. Fig. 3 illustrates the UAV horizontal trajectories for different schemes under different flight time T . The corresponding powers transmitted by UAV and allocated to SRs versus time is shown in Fig. 4. We set P max = 0.1 W and = −80 dBm. Fig. 3(a) shows the UAV horizontal trajectories for the CR-TDMA and CR-NOMA schemes when T is small, i.e., T = 45 s, from which three significant observations can be made. Specifically, for the CR-TDMA scheme, the UAV first tends to fly closer to SR 3 , then approaches SR 1 and finally reaches the final location. In contrast, for the CR-NOMA scheme, the UAV flies along a relatively direct path to a position closer to SR 1 , and then moves to the final locations. The reason for such a difference is that the strategy of time resource allocation in the CR-TDMA scheme, i.e., the UAV only communicates with the nearest SR within a time slot, requires the UAV to be closer to SR 3 to obtain better channel quality, thereby meeting the minimum average secrecy rate requirement. However, in the CR-NOMA scheme, the UAV serves SR 1 and SR 3 at the same time by allocating transmit power so as to extending SR 3 's communication time. Hence, the secrecy rate requirement of SR 3 is still satisfied, although the channel quality is always poor. This fact can be verified by Fig. 4(a), which shows that the UAV communicates with SR 3 from t = 1 s to t = 10 s in the CR-TDMA scheme; while the UAV serves SR 3 from t = 1 s to t = 23 s in the CR-NOMA scheme. On the other hand, it is observed that due to limited flight time, UAV horizontal trajectory for the CR-TDMA scheme inevitably gets closer to Eve as compared to the CR-NOMA scheme, which results in more signal being eavesdropped by Eve. Furthermore, it can be seen that when the UAV gets farther away from SR 2 and closer to the final location, i.e., from t = 24 s to T = 45 s, the trajectories of both schemes are similar. The reason is that during this period, the difference between legal and eavesdropping link channels of SR 2 is much larger than that of the other SR, so the UAV in both schemes only communicates with SR 2 . Fig. 3(b) shows the UAV horizontal trajectories for the CR-TDMA VOLUME 8, 2020 and CR-NOMA schemes when T is larger, i.e., T = 90 s. The UAV first tends to closer to SR 3 , then flies over SR 1 and remains stationary at a location on the left of SR 1 , and finally gets to the final locations in both schemes. However, the horizontal trajectories are different because of different power allocation in different schemes, as shown in Fig.4(b). Fig. 5 shows the UAV altitudes versus time for the CR-TDMA and CR-NOMA schemes under different flight time T . It can be seen that the UAV adaptively adjusts its altitude to control interference on the PR below a threshold. From Fig. 4(a) and Fig. 5(a), it is observed that when the UAV flies near to PR 1 (at time instant t = 6 s for CR-NOMA and t = 5 s for CR-TDMA), the UAV reduces transmit power and increases altitude in both schemes. A similar observation can be made in Fig. 5(b) for T = 90 s.
In the following, we compare the joint 3D CR-TDMA and 3D CR-NOMA scheme with the following benchmark schemes: • Straight CR-TDMA: The secondary UAV communicates with SRs in the TDMA scheme and flies in a straight line from the initial location to the final location with a constant speed at the lowest altitude, while SR scheduling and UAV transmit power are jointly optimized.
• Straight CR-NOMA: The secondary UAV communicates with SRs in the NOMA scheme and flies in a straight line from the initial location to the final location with a constant speed, while the power allocation is optimized.
• Joint 2D CR-TDMA: The secondary UAV communicates with SRs in the TDMA scheme and flies at a fixed altitude H min , while the UAV horizontal trajectory, SR scheduling and transmit power are jointly optimized.
• Joint 2D CR-NOMA: The secondary UAV communicates with SRs in the NOMA scheme and flies at a fixed altitude H min , while the UAV horizontal trajectory and power allocation are jointly optimized.
• Random CR-NOMA: The SIC order is randomly generated, while the 3D UAV trajectory and transmit power are jointly optimized. Fig. 6 shows the average secrecy sum rate 2 versus flight time T for the different schemes when P max = 0.1 W and = −80 dBm. It is observed that the average secrecy sum rate of the joint CR-TDMA and CR-NOMA schemes increases as the flight time T increases. This is expected since when T becomes larger, the UAV exploits its mobility to adaptively adjust its trajectory to move closer to SRs and hover at locations to enjoy better channels. For the straight scheme, the secrecy rate will remain almost unchanged as in the case of T = 45 s. The joint 3D CR-NOMA scheme always achieves the highest secrecy rate, followed by the joint 2D CR-NOMA scheme, both of which are superior to the other benchmark schemes. It can also see that the secrecy rate of the random CR-NOMA scheme is seriously degraded compared to the joint 3D CR-NOMA scheme. Besides, the performance of the 2D scheme is close to that of the 3D scheme when T becomes larger, especially in CR-TDMA. This is because as shown in Fig.5, the UAV flies higher when it is close to PR 1 , while it flies at the lowest altitude in other locations. Thus, the performance gain of average secrecy rate obtained from optimized altitude is less notable, especially when T is large. Besides, the joint CR-NOMA scheme always achieves the highest secrecy rate, followed by the joint CR-TDMA schemes, both of which are superior to the benchmark schemes. Moreover, the secrecy rate of three NOMA schemes is higher than that of the corresponding TDMA schemes, which demonstrates that NOMA outperforms TDMA even in the worst case. Such observations also verify the necessity of the joint 3D UAV trajectory and power allocation for improving the secrecy rate.  Fig. 7 shows the average secrecy sum rate versus the IT threshold for the different schemes when T = 45 s and P max = 0.1 W. It is observed that the secrecy rate achieved by all schemes increases rapidly when is low, then it raises smoothly with the growth of . The fundamental reason for such a result is that when is small, the available transmit power rises with the relaxation of IT constraints, thereby increasing the secrecy rate. However, when becomes larger, the IT constraints do not work while transmit power is restricted by P max in order to meet the maximum power constraints. It is observed that the joint 3D CR-NOMA scheme outperforms the joint 2D CR-NOMA scheme when < −75 dBm; while the gap between them becomes very small when ≥ −75 dBm. A similar observation can be made in the CR-TDMA scheme. These observations indicate that the secrecy rate performance mainly depends on the UAV horizontal trajectory and power control when is high. Besides, the rate gap between the joint CR-TDMA and CR-NOMA first becomes larger with the increasing of , and eventually remains constant. This demonstrates that the power allocation strategy of CR-NOMA is more efficient in enhancing secrecy performance when maximum allowable power is larger. Fig. 8 shows the average secrecy sum rate versus the maximum transmit power P max for the different schemes when T = 45 s and = −80 dBm. The secrecy rate obtained from all schemes increases with P max before getting saturation at a sufficiently large P max . This is because the allowable transmit power first increases with the growth of P max and then is restricted by the IT constraints. Again, it can be seen from Fig. 7 and Fig. 8 that the joint 3D CR-NOMA scheme always obtains the highest secrecy rate, which also validates the importance of joint 3D UAV trajectory design and power allocation.

V. CONCLUSION
In this paper, we study the PLS for a UAV-enabled CR-NOMA system. Specifically, by taking into account the IT constraints, the average secrecy sum rate is maximized via jointly optimizing the 3D UAV trajectory and power allocation. In order to handle binary constraints, as well as the highly coupled non-convex objective function and constraints, we first transform the binary variables into continuous ones with tractable inequality constraints. Then, we propose an iterative algorithm by applying the SCA technique, BCD technique, and penalty method. Numerical results show that the proposed joint design provides significant performance gains compared to the benchmark schemes, and the secrecy rate of the CR-NOMA scheme is always no worse than that of the CR-TDMA scheme. In future work, given that the endurance and performance of the UAV are fundamentally limited by the on-board energy, it is worth pursuing to consider the UAV cruise power consumption and propulsion energy in UAV-enabled CR-NOMA communication systems. Furthermore, the UAV-enabled NOMA system can be flexibly combined with many other existing upcoming communication schemes and technologies that meet with the requirements of 5G and beyond 5G, such as MIMO communications, coordinated multi-point (CoMP) transmission and reception.

APPENDIX B PROOF OF PROPOSITION 1
Define a function g(x), which is given by where a, x ∈ R 3×1 . Let v ∈ [0, 1]. 1 In fact, in Case 1, satisfying α k,j [n] = 1 is also equivalent to satisfying α k,j [n] ∈ X , where X = {x k,j,n N n=1 K k,j f k,j,n (x k,j,n ) ≤ 0, 0 ≤ x k,j,n ≤ 1, ∀k, j, n ∈ M 1 }. Compared to X , X ignore the inequality N n=1 K k,j h(x k,j,n ) ≤ 0. Therefore, h(x k,j,n ) in X is redundant. Here, we use it to facilitate the derivation in Case 3.
Then, for any x, y, we have and That is to say, Following (48)