Secure User Pairing and Power Allocation for Downlink Non-Orthogonal Multiple Access against External Eavesdropping

We propose a secure user pairing (UP) and power allocation (PA) strategy for a downlink Non-Orthogonal Multiple Access (NOMA) system when there exists an external eavesdropper. The secure transmission of data through the downlink is constructed to optimize both UP and PA. This optimization aims to maximize the achievable sum secrecy rate (ASSR) while adhering to a limit on the rate for each user. However, this poses a challenge as it involves a mixed integer nonlinear programming (MINLP) problem, which cannot be efficiently solved through direct search methods due to its complexity. To handle this gracefully, we first divide the original problem into two smaller issues, i.e., an optimal PA problem for two paired users and an optimal UP problem. Next, we obtain the closed-form optimal solution for PA between two users and UP in a simplified NOMA system involving four users. Finally, the result is extended to a general 2K-user NOMA system. The proposed UP and PA method satisfies the minimum rate constraints with an optimal ASSR as shown theoretically and as validated by numerical simulations. According to the results, the proposed method outperforms random UP and that in a standard OMA system in terms of the ASSR and the average ASSR. It is also interesting to find that increasing the number of user pairs will bring more performance gain in terms of the average ASSR.


Introduction
Over the past decade, NOMA has garnered considerable attention owning to its possibility to enhance spectrum efficiency and capacity by serving a cluster of users over the same resource block [1][2][3][4][5], and has been conceived as a technology with great promise, facilitating fifth-generation (5G) wireless communication [6,7] and serving as a potential foundation for the next generation of multiple access in 6G [8].
While NOMA can yield considerable performance improvements, it faces notable challenges that jeopardize its secure transmission.Specifically, wiretapping is one of a variety of security and confidentiality concerns because of the inherently broadcast nature of the wireless communication and successive interference cancellation (SIC) adopted in NOMA [9].Therefore, the establishment of secure transmission in NOMA networks has garnered significant interest from academic and industrial spheres alike.
To address these challenging security issues, the concept of physical layer security (PLS) aims to safeguard authentic communication via leveraging the diversity present in physical communication channels through an informational-theoretical lens [10], and various PLS approaches have been proposed to guarantee secure transmission in NOMA networks [11][12][13][14][15].The work in [11] considered a cognitive radio network employing NOMA with two cells and multiple inputs and outputs, and presented a sequential transmission method employing zero-force beamforming to safeguard communications against potential eavesdropping.The work in [12] proposed a beamforming scheme with the assistance of artificial noise (AN) to maximize the secrecy sum rate (SSR) in an NOMA system.
In [13], the proposed method employed unmanned aerial vehicle (UAV) assistance in NOMA transmission to ensure secure downlink communication by employing artificial jamming, and the exploration of the balance between jamming effectiveness and the total data transmission rate was examined to optimize power distribution, user scheduling, and the UAV's path, aiming to achieve a trade-off that harmonizes security and transmission efficiency.The work in [14] analyzed secure downlink transmission schemes in an NOMA system with artificial-signal assistance and relay assistance and found equilibrium strategies using game theory.Additionally, in recent years, intelligent reflecting surfaces (IRSs) also show potential in enhancing the security of the foundational layer within wireless networks.This was achieved via mitigating the reflected signal at potential eavesdroppers while directing the beam towards authorized receivers through the adjustment of the IRS reflecting elements [15].
Although numerous initial studies have delved into the security aspects of NOMA networks through the lens of beamforming, artificial noise, UAV, IRS, etc., they mainly focus on NOMA systems with two or more users sharing one resource block.However, in future scenarios with massive connections, the decoding complexity and delay of the proposed schemes in the existing literature will increase, and additional hardware resources will be necessary [9,16].Therefore, NOMA users should be categorized into distinct groups to balance implementation complexity and resource utilization [17].User pairing to satisfy some system performance indicators, such as achievable sum rates and spectral efficiency, has been investigated in works such as [18][19][20][21].However, as far as we are aware, how to improve secure performance gains via UP has not been investigated thoroughly, and this motivated us to study the secure strategies combined with user pairing.We explore the challenge of UP under the condition of a minimum rate constraint of each authorized user to maximize the ASSR, which results in MINLP.Then, we decompose the MINLP problem into two sub-problems, optimal UP and PA, and obtain an optimal solution for UP and PA in a closed-form globally.Ultimately, through the comparison of the ASSR acquired using the proposed method against those generated by the standard methods, the outcomes from the simulation indicate that the suggested method surpasses both the randomly paired approach with optimal power distribution and the Orthogonal Multiple Access (OMA) configuration in identical channel conditions.
The rest of this paper is structured as follows.In Section 2, a downlink NOMA system with an external eavesdropper is presented, and the joint optimization of an achievable sum secrecy rate is formulated and decomposed into two sub-problems, optimal power allocation and optimal user pairing.We investigate the two sub-problems and obtain the closed-form solutions in Sections 3 and 4, respectively.Numerical simulations are conducted and the outcomes are given in Section 5, followed by the conclusions, which are outlined in Section 6.

System Model
We investigate a downlink NOMA system utilizing one base station (BS), N = 2K legitimate users, and one external eavesdropper (E), as illustrated in Figure 1.We presume that each node is equipped with a single antenna, as in [16,19,20,22], all wireless channels include Rayleigh block fading [16,22,23], and the communication channel gains from the base station to the legitimate user i (denoted by LU i ) and the eavesdropper are denoted by h i , (i = 1, 2, • • • , 2K), and h e .Generally, we make the assumption that the channel gains of 2K users adhere to the sequence We also presume that both users and the eavesdropper experience equivalent levels of noise power, denoted as σ 2 .
In practice, 2K legitimate users are often grouped into K clusters, i.e., each cluster has two users, aiming to minimize the computational complexity and mitigate delays caused by the successive interference cancellation (SIC) being decoded at the receiver [17].For any pair with two users (users m and n) denoted by (m and n), a constant total transmission power P s is allocated by the BS.Without a loss of generality, we make the assumption of |h m | 2 ≥ |h n | 2 , i.e., the user m is a strong user in NOMA terminology.Then, the superimposed signal transmitted by the BS is where n i represents the Gaussian noise that user i and eavesdropper E encounter, which has a mean of zero and an average power of σ 2 .
Following the NOMA guideline, the strong user m exploits SIC to remove the interference caused by the weak user n, while the weak user n treats the interference caused by the user m as noise.Thus, the achievable rates of users m and n are provided as follows: where R nn is the achievable rate at which user n decodes its own message; R mn and R mm are the rates at which user m decodes user n's and its own messages, respectively; and γ = P s /σ 2 represents the average transmitted signal-to-noise ratio (SNR) for the UP at the BS.Following [12,22], the eavesdropping rates for users m and n by E are and The achievable secrecy rate (ASR) is established as the variance between the achievable rate for the user and that of the eavesdropper.Thus, the ASR for users m and n in the same group, denoted by (m, n), can be expressed as and where As a benchmark, following [16], the achievable rate for user i and the eavesdropper in an OMA system with a similar setting can be, respectively, expressed as where the multiplexing loss in the OMA system attributes to the fraction 1 2 in Formula ( 11).The corresponding ASSR can be given by ASSR

Problem Formulation
To secure a downlink NOMA system against external eavesdropping, in pursuit of enhancing the ASSR, our focus lies in meticulously designing UP and PA.The cooptimization problem of UP and PA can be formulated as where u m,n is a binary variable that indicates that user m pairs with user n if u m,n = 1, otherwise u m,n = 0; the constraints C 1 and C 2 guarantee the QoS for users m and n, respectively, i.e., the requirement that the achievable rate should not be less than that in the OMA system is considered in this paper; the constraint C 3 insures an achievable power allocation between users m and n; and the constraints C 4 ∼C 7 imply the pairing relationship among users, such that each user can pair with one and only one of the others.
Problem (P1) constitutes a non-convex and intricately interconnected mixed integer nonlinear programming issue, posing an NP-hard complexity, and it is generally arduous to search for globally optimal solutions directly.Additionally, in real situations, an eavesdropper usually acts passively.Therefore, we presume that the BS lacks access to precise eavesdropper channel details, and we need to investigate the optimization problem based on the quality of the eavesdropping channels, i.e., the worst quality Obviously, when the eavesdropping channel is superior over all the channels of legitimate users, we have a zero ASSR according to the subsequent theorem.
Theorem 1.In an NOMA system involving 2K users (user hold for any user pair (m, n), it is easy to prove R em ≥ R mm and R en ≥ R nn according to Formulas (3) and ( 5)-( 7), which, consequently, results in = 0 for any user pair (m, n) and ASSR = 0.The proof is quite simple, and we omit the details here for simplicity.Thus, we only investigate the problem with the worst and the medium eavesdropping channel, i.e., |h e | 2 ≤ |h 2K | 2 , in the following sections, respectively.
We initially partition the primary joint optimization problem encompassing UP and PA (P1) into two subsidiary problems, i.e., the optimal PA between two users in one pair (SP1) and the optimal UP problem (SP2), and we will discuss them in the following two sections, respectively.

PA for NOMA Involving Two Paired Users
In sub-problem (SP1), an NOMA system involving two users (users m and n) in one pair and an external eavesdropper (E) is considered.To maximize the ASSR, we formulate the optimization of power allocation as The subsequent theorem elucidates the optimal resolution to the aforementioned problem (SP1).
Theorem 2. In an NOMA system involving two users (users m and n) in one pair and an external eavesdropper (E), the optimal coefficient for power splitting is Proof.We prove this in the following two situations according to the quality of the eavesdropping channel, respectively. ( Taking the derivative of the achievable sum secrecy rate (ASSR), Formula (10), with regard to α m , we can obtain ≥ 0, which implies that the ASSR is a monotonically increasing function of α m in this situation.Following similar steps to those in [16], we can obtain the range of α m from the constraints C 1 and C 2 as According to the monotonicity of the ASSR with respect to α m , we can reach the optimal ASSR within the upper limit of the range, i.e., Similarly, the optimal PA to user m can be inferred as Combining the above two situations, we can prove Theorem 2.
It is worthy of note that the optimal PA is solely determined by the channel gain of the weak user, and only allocates necessary power to satisfy the weak user's QoS constraint C 2 .
Furthermore, we can check the fact that the obtained optimal allocation coefficient α (m,n) m satisfies the constraint C 4 of SP1.

Optimal User Pairing
In sub-problem (SP2), an NOMA system with N = 2K users and an external eavesdropper is considered, and we formulate the optimization of UP as SP2.

SP2: Maximize
To investigate the optimal UP problem for an NOMA involving 2K users, let us commence from the simplest pairing case with the minimum number of users, i.e., with four users, and then extend the obtained results to the general case.Solution a: User 1 pairs with user 2, and user 3 pairs with user 4, i.e., u 1,2 = 1 and u 3,4 = 1.Thus, the ASSR can be expressed as Solution b: User 1 pairs with user 3, and user 2 pairs with user 4, i.e., u 1,3 = 1 and u 2,4 = 1.Thus, the ASSR can be expressed as Solution c: User 1 pairs with user 4, and user 2 pairs with user 3, i.e., u 1,4 = 1 and u 2,3 = 1.Thus, the ASSR can be expressed as 4.1.2.Optimal UP for NOMA with Four Users After analyzing and comparing the ASSRs of three pairing solutions in detail, we give the optimal UP solution of an NOMA system involving four users and an external eavesdropper according to the theorem below.Theorem 3. In an NOMA system involving four users (users 1, 2, 3, and 4) and an external eavesdropper (E) with , Solution c is the optimal UP solution.
Proof.Based on the sequence of channel gains, there are four cases as below, and we will prove C a ≤ C b ≤ C c case by case.
Case 1: Following Theorem 2, we have On this basis, following (9), we can obtain For the function f where (x > 0) monotonously decreases with the increase of x and the presumption |h 1 | 2 ≤ |h 2 | 2 ≤ |h 3 | 2 , we have the sequence of β k (k = 1, 2, 3) as Then, we have and We define g(x) = (1+β 1 x) 2 1+x (x > 0) and it is readily apparent that g ′ (x) ≥ 0.Then, we have In this case, the ASSR in three UP solutions can be described as where "(18)" indicates ( 18) is applied in this step.Thus, we have Similar to Case 2, we can obtain the ASSR in three UP solutions as Let . We have and it is easy to prove that β 1 ≥ β 2 ≥ β e ≥ β 3 .Hence, taking (26) into (25), we have for the reason that Similar to Cases 2 and 3, we can obtain the ASSR in three UP solutions as We can easily verify that C a ≤ C b ≤ C c always holds in Case 4, and omit the detail here for simplicity.
Combining the above four cases, we can prove Theorem 3.

UP for NOMA with 2K Users
We considered an NOMA system with two and four users in Sections 3 and 4.1, and found the optimal PA and UP, respectively.We will give the extended solution to Problem (SP2) using the subsequent theorem.
Theorem 4. In an NOMA system involving 2K users (user 1, 2, • • • , 2K) and an external eavesdropper (E) with |h e | 2 ≤ |h 2K | 2 , the optimal pairing solution is In other words, any user k is paired with the user Proof.When K = 1, there are only two users in the NOMA system, and they have no choice but to pair with each other, which makes (30) hold.Thus, we first consider the case when K = 2, which is a case we discussed in Section 4.1.Following Theorem 3, it is readily verifiable that the optimal pairing strategy Case c satisfies (30).Next, we prove (30) in the case when K > 2 using mathematical induction in the following four steps.
(1) When k = 1, we need to prove u 1,2K = 1, i.e., user 1 pairs with user 2K.We prove it by contradiction.We assume user 1 is paired with user i (2 ≤ i ≤ 2K − 1) instead of user 2K, and user 2K is paired with user j (2 ≤ j ≤ 2K − 1, j ̸ = i) instead of user 1 in the optimal user pairing solution.Following Theorem 3, we have .

Computational Complexity
As mentioned above, the proposed scheme can be implemented in two consecutive steps, the optimal UP and the optimal PA.We analyze the computational complexity of the two parts, respectively.
In the first part, the optimal UP is determined based on Theorem 4, once the order of channel gains is given.Thus, the calculation of channel gain constitutes the primary computational complexity of the first part, such as QuickSort, which runs in O(N 2 ) time in the worst case, and in expected O(NlogN) time [24], where N is the quantity of numbers to be sorted, that is, the number of users in this paper.Although the exhausted searching method can also find the optimal UP scheme, it runs in O(N!) time [16], which is much higher than that in the proposed scheme.
In the second part, we calculate the PA coefficient according to (14) for each user pair, and there are N/2 user pairs in all.Therefore, the computational complexity of the second part is O(N).

Simulation and Discussion
The security performance regarding the ASSR of downlink NOMA against external eavesdropping scenarios was investigated with numerical simulations.The simulations involve N = 2K users, distributed evenly across a disk with radius r = 500 m, and the path-loss coefficient α = 2.The height of the BS is assumed to be H = 50 m.Two benchmark schemes, termed random UP with optimal PA (simply denoted as "random") and the standard OMA setup, were utilized to enhance the performance of the proposed scheme.The performance was averaged on 10 3 user distributions and 10 3 channel realizations for each user distribution.Furthermore, 10 3 random user pairings were conducted for each user distribution and channel realization in the random scheme.
Figure 2 shows a performance comparison of the ASSRs between an NOMA with the proposed UP and PA scheme (proposed), and the two benchmark schemes, randomly paired NOMA with optimal PA and standard OMA, with different numbers of user pairs where P/σ 2 = 20 dB.From Figure 2, it can be inferred that averaged performance of the ASSRs in the NOMA scheme (both optimal pairing and random pairing) outperformed that in the OMA scheme, and the ASSR was a function of the quantity of user pairs.When K was small, the performance difference of the ASSR was not obvious between the NOMA scheme with optimal pairing and that with random pairing.However, with the increase in K, the ASSR of the proposed scheme gradually exceeded that of the rival method owing to the optimality we reached.In Figure 3, a comparison of the ASSRs among an NOMA employing the proposed optimal UP and PA scheme (proposed), a randomly paired NOMA with an optimal PA, and an OMA are shown in different colors and markers, with varying signal-noise ratios (SNRs) for different numbers of user pairs.It can be observed that with the rise in the SNR, the ASSR proportionally improved.At low SNR values, the difference in the ASSR performance between the NOMA scheme with optimal pairing and that with random pairing was not significant.However, as the SNR escalated, the superiority of our method's ASSR became more evident.Furthermore, as the quantity of user pairs (K) grew, the superiority of the ASSRs over the other two schemes became increasingly apparent.Figure 4 illustrates the average ASSRs (average ASSRs per user, i.e., ASSR/N) employing our proposed Optimal UP and PA scheme.The data points are represented using various colors and markers, indicating different signal-noise ratios (SNRs) for varying numbers of user pairs.From Figure 4, we can see the following three aspects.Initially, as the SNR rose, the average ASSR followed a corresponding increase.Secondly, our method outperformed competitors in terms of the average ASSR.Lastly, enhancing the number of pairs (K) resulted in even greater performance improvements in the average ASSR.Compared to Figure 3, as the quantity of user pairs (K) grew, the improvement in the performance of the average ASSR became more significant than that of the ASSR.

Conclusions
In the manuscript, we explore the optimal UP and PA for secure downlink NOMA against external eavesdropping.To maximize the achievable sum secrecy rate, we formulate a joint optimization problem of UP and PA, which is an MINLP problem which is hard to solve.We break down the original problem into two subordinate problems, i.e., an optimal PA problem for two paired users and an optimal UP problem.Then, the optimal solution for a universal NOMA with 2K users is obtained.We validate the theoretical discoveries with simulation discoveries that demonstrate that the proposed scheme outperforms those obtained by the alternative methods in both achievable sum secrecy rate and average secrecy rate performances.

Figure 1 .
Figure 1.Illustration of the considered system model.

Figure 2 .
Figure 2. Comparison of ASSRs among NOMA employing optimal pairing, randomly paired NOMA, and OMA using different pair quantities, with parameters set at P/σ 2 = 20 dB and r = 500 m.

Figure 3 .
Figure 3.Comparison of ASSRs among NOMA employing optimal pairing, randomly paired NOMA, and OMA with different signal-noise ratio, with parameters set at r = 500 m.

Figure 4 .
Figure 4. Comparison of average ASSRs among NOMA employing optimal pairing, randomly paired NOMA, and OMA with different signal-noise ratios, with parameters set at r = 500 m.