Physical Layer Security in Random NOMA-Enabled Heterogeneous Networks

The performance of physical layer secrecy approach in non-orthogonal multiple access (NOMA)-enabled heterogeneous networks (HetNets) is analyzed in this paper. A K-tier multi-cell HetNet is considered, comprising NOMA adopted in all tiers. The base stations, legitimate users (in a two-user NOMA setup), and passive eavesdroppers, all with single-antenna, are randomly distributed. Assuming independent Poisson point processes for node distribution, stochastic geometry approaches are exploited to characterize the ergodic secrecy rate. A lower bound on the ergodic secrecy rate along with closed-form expressions for the lower bound on the ergodic rates of the legitimate users in a special case are derived. Moreover, simpler expressions for the ergodic secrecy rate are obtained in the interference-limited regime with vanishing noise variance. The effect of multi-tier technology, NOMA, and physical layer secrecy are investigated using numerical results. The results reveal that applying HetNet to a secure multi-cell NOMA system improves the spectrum efficiency performance.


I. INTRODUCTION
Nowadays, cellular systems focus on beyond 5G networks, where to meet high spectral efficiency, important new technologies such as heterogeneous networks (HetNets) and nonorthogonal multiple access (NOMA) are proposed [1]- [3].HetNets are typically composed of macrocells with high transmission power and coverage.Macrocell, in turn, overlays smallcells such as picocells and femtocells which have low transmission power and coverage.Thus, network capacity is improved and the coverage is extended due to distance reduction between end users and access nodes.Channel reuse is also increased by deploying small base stations (BSs).Consequently, traffic can be offloaded to smallcells to target a higher spectral efficiency using HetNets [4], [5].On the other hand, the basic idea of NOMA is to allocate the same time and frequency resources to different users, instead of using orthogonal spectrum.Therefore, significant improvements in spectral efficiency can be achieved by NOMA.Particularly, powerdomain NOMA improves spectral efficiency by superposing multiple users in the power domain.This can be obtained by superposition coding (SC) at the transmitter and successive interference cancellation (SIC) at the receivers [6], [7].
Due to the broadcasting nature of transmission medium, security is an essential feature in wireless communication networks.The information theoretic methods to provide secrecy at the physical layer become popular in beyond 5G networks.Thanks to their easier key management and resistance against computationally powerful eavesdroppers [8], [9].Physical layer security (PLS) methods exploit the physical characteristics of wireless channels including noise, fading, and interference [10], [11].In this paper, we study the performance of two beyond 5G key technologies, HetNet and NOMA, in the presence of PLS approaches.
The existing literatures on secure NOMA system [12]- [16], secure HetNet [17]- [22], and NOMA-based HetNet [23]- [26] either optimize the system parameters for a single shot of a network or evaluate the performances of HetNet, NOMA, and PLS, separately, in random networks (i.e., a network with randomly located nodes).However, the PLS in NOMAenabled HetNet in random networks had not been considered, which is the main focus of this paper.Note that providing PLS in HetNets and also multi-cell NOMA systems result in spectrum efficiency reduction.Hence, the motivation of studing NOMA-enabled HetNet under secrecy constraint is to measure this reduction.

A. Related Works
PLS in NOMA-based systems was studied from various perspectives [12]- [16].Optimization approaches were taken in [12] and [13].The security in NOMA large scale networks was studied in [14] using stochastic geometry to calculate the secrecy outage probability, where the network consists of one BS, several legitimate users, and eavesdroppers in both single-antenna and multiple-antenna scenarios.Secrecy outage probability and strictly positive secrecy rate were analyzed in [15], which investigate of a cooperative NOMA system with a single relay, one BS, and an eavesdropper.The PLS analysis in a two-way channel with a trusted multiple-antenna relay in the presence of eavesdroppers was studied in [16].Artificial noise and full-duplex techniques were used at the relay to improve the secrecy performance.A closed-form expression for the ergodic secrecy rate was obtained in both single eavesdropper and multiple eavesdroppers cases.The ergodic secrecy rate analysis in the multi-cell NOMA systems has not been taken into account, which is addressed in this paper.
Exploiting PLS in HetNets for random networks was studied in [17]- [22].In [17], secrecy and connection probabilities along with sum secrecy rate were studied in a multi-tier heterogeneous cellular network.The position of BSs, legitimate users, and eavesdroppers are characterized by homogeneous Poisson point processes (HPPPs).Each BS employs the artificial noise transmission strategy and the user association policy is based on the truncated average received signal power.A dynamic coordinated multi-point transmission scheme is introduced in [18] for BS selection in heterogeneous cellular networks, where the received signal power for legitimate users are used in BS selection process.The secure coverage probability was calculated by considering co-channel interference and worst-case scenario for eavesdroppers.The area ergodic secrecy rate, the secrecy outage probability, and the energy efficiency in heterogeneous cloud radio access network (RAN) were studied in [19] considering soft fractional frequency reuse (S-FFR), where two-tier heterogeneous cloud RAN consists of massive MIMO macrocell BSs in the first tier and remote radio heads in the second tier.Locations of the macro BSs, the remote radio heads, and the passive eavesdroppers were modeled as HPPPs.In [20], artificial noise-aided PLS in multi-antenna smallcell networks was investigated.Closedform expressions for the connection and the secrecy outage probabilities were obtained as well as a semi closed-form lower bound on the average secrecy rate.In [21], a user association based on the maximum secrecy capacity in twotier heterogeneous cellular networks with in-band interference was studied.Keeping the user association scheme in mind, connection and secrecy probabilities and network secrecy throughput were analyzed.PLS was also studied for a heterogeneous spectrum-sharing cellular network in [22].The network includes a macro BS and a small BS that send messages to legitimate macro and small users in the presence of an eavesdropper.Overall outage and intercept probabilities were obtained in closed-form and secrecy diversity analysis was performed to evaluate performance.
Without secrecy constraint, the outage probability and the ergodic rate of the HetNet-NOMA systems in random networks were studied in [23]- [26].In [23], the coverage probability, the ergodic rate, and the energy efficiency in twotier HetNets were analyzed.The first and the second tiers were equipped with massive MIMO and NOMA technologies, respectively.The coverage probability and achievable rate were analyzed in a downlink NOMA-based HetNet in [24].For improvement of NOMA and SIC, a coordinated joint transmission NOMA method was introduced.Analysis of the coverage probability and the spectral efficiency in NOMAbased HetNets were studied in [25] regarding interference coordination.Two well-known methods, namely strict fractional frequency reuse and soft frequency reuse, were used to reduce inter-cell interference.The coverage probability and the achievable rate were characterized in [26] for a NOMA-based two-tier HetNet with non-uniform smallcell deployment.
Optimization approaches for secure NOMA-based HetNets were also studied in [27] and [28].Cooperative jamming was utilized in a two-tier HetNet in [27].The first tier and the second tier were equipped with massive MIMO and NOMA technologies, respectively.The proposed algorithms are presented to maximize the secrecy rate of target users subject to the QoS constraints of other users.In [28], a resource allocation algorithm (joint subcarrier and power allocation) was studied in a NOMA based two-tier HetNet.The network consisted of one macro BS and multiple small BSs in both single-antenna and multiple-antennas modes.Unlike [27] and [28], we study the performance of secure NOMA-based HetNet in random networks.

B. Contributions
To the best of our knowledge, there is no study on PLS in random NOMA-enabled HetNets.Moreover, the ergodic secrecy rate in multi-cell NOMA systems has not been investigated.In addition to the improved spectral efficiency, both NOMA and HetNet may contribute in realizing PLS technique.The interference caused by macrocells and smallcells, one of the main challenges in HetNets, corrupts the eavesdroppers signals in a friendly manner.Furthermore, NOMA causes interference in the network which is beneficial to provide system security.However, the challenges of analyzing NOMAbased HetNet in random networks with PLS approach fall into the complexity of calculations and the difficulty of deriving closed-form secrecy rate expressions.Our main contributions are as follows: The secrecy performance of a K-tier multi-cell HetNet with NOMA enabled in all tiers is investigated, exploiting stochastic geometry approaches.The studied K-tier multicell HetNet consists of single-antenna BSs in all tiers; the legitimate users employ a two-user NOMA approach, and the eavesdroppers passively intercept the secure messages.The locations of BSs, legitimate users, and eavesdroppers are randomly distributed regarding HPPP.The model is described in Section II.
Analytical expressions for the ergodic secrecy rate of the secure NOMA-based HetNet (SN-Het) is derived in Section III.To this end, user association probability, probability density function (PDF) of users' distances, SINR analysis considering NOMA transmission, and the characteristic function of interference are characterized.Although the closed-form of ergodic secrecy rate is not reached for the general case, the results are easily computable.We also derive lower bounds on the ergodic rates of the legitimate users.The lower bounds are reduced to closed-form in a special case with the same pertier path loss exponents and no biasing.In addition, simpler expressions for the ergodic secrecy rate in the interferencelimited regime is achieved considering the same path loss exponents, zero noise power, and no biasing for all tiers.
Numerical and simulation results are provided in Section IV to evaluate the performance of considered SN-Het.The derived ergodic secrecy rate is compared with rates in HetNet [29], HetNet-NOMA [23], secure HetNet [19], and secure multi-cell NOMA (assuming only one tier in the derived results of ssection III for SN-Het) to observe the effects of secrecy constraint as well as, NOMA, and HetNet technologies.The results show that applying HetNet to a secure multicell NOMA system improves the spectrum efficiency, while the secrecy constraint degrades the ergodic rate as expected.It is also inffered that increase in number of network tiers with a fixed density of BSs results in the ergodic secrecy rate improvement.On the other hand in a two-tier network, the ergodic secrecy rate is improved by increasing the density of second tier BSs that results in proper interference for security.

II. PROBLEM DESCRIPTION
As shown in Fig. 1, a K-tier multi-cell HetNet with macrocells in the first tier and smallcells in remaining tiers is considered.Users are randomly distributed according to an HPPP Φ u with intensity λ u and we exploit two-user NOMA technique.A number of passive eavesdroppers are randomly distributed throughout the network to intercept the secrecy messages.The positions of eavesdroppers and BSs in the jth tier are modeled according to HPPPs denoted as Φ e and {Φ bj } j=1,...,K with intensities λ e and λ j , respectively.Φ e k is a set of eavesdroppers in the tier k.Users, eavesdroppers, and BSs are equipped with a single-antenna.It is assumed that the channel state information (CSI) of users at the BS is known.However, the CSI of eavesdropper is unknown at the BS, and only the knowledge of its channel distribution is available.Accordingly, the ergodic secrecy rate is computed in this paper.

A. Signal Model
Each BS communicates with a set of users in the presence of eavesdroppers.The set of all users at q-th BS in the k-th tier, BS k,q , is defined as N k,q = {1, 2, ..., n k,q } where n k,q is a random variable.Without loss of generality, BS k,q divides N k,q into n k,q 2 subsets, to enable a two-user NOMA scheme with random pairing in each subset.We consider one of the subsets, including users m and n.It is also assumed that user m is farther from BS k,q than user n.Employing NOMA scheme, BS k,q transmits signal a m k,q P k s m k,q + a n k,q P k s n k,q , where s m k,q and s n k,q are the transmitted messages for user m and user n, respectively.P k is the transmit power of BS k,q ; (a m k,q , a n k,q ) are the power allocation coefficients for users m and n, while a m k,q ≥ a n k,q and a m k,q + a n k,q = 1.The received signals at user m and user n and also the e-th eavesdropper are as: where i ∈ {m, n, e}; h i k,q = √ g i k,q d i k,q −α k /2 is the channel coefficient between BS k,q and the i-th user/eavesdropper in N k,q /Φ e k ; g i k,q ∼ exp(1) denotes the small-scale fading transmission/eavesdropping channel power gain, d i k,q stands for the distance between i-th user/eavesdropper and BS k,q , and α k is the path loss exponent of the k-th tier.Moreover, h i j,l = √ g i j,l d i j,l −αj /2 is the channel coefficient between BS j,l (l-th BS in tier j) and i-th user/eavesdropper in N k,q /Φ e k where g i j,l ∼ exp( 1) is the small-scale fading channel gain; d i j,l denotes the distance between i-th user/eavesdropper and BS j,l .z i k,q stands for the complex additive white Gaussian noise (AWGN) with zero-mean and variance σ 2 , z i k,q ∼ CN (0, σ 2 ).

B. User Association Statistics and Distance Distribution
The maximum biased average received power of each tier is assumed for user association [29].Keeping the w-th user, at tier k, as the associated user in mind, average biased received power is: where w ∈ {m, n}, B k is a positive bias factor of tier k (the bias factor of all BSs in tier k is the same).R uk,q denotes the distance between a typical user and BS k,q .
According to [29, Lemma 1], the probability of a typical user association with the secure NOMA-based HetNet BSs in tier k is: where Pj = between a typical user and its serving BS in the k-th tier is as follows:

C. NOMA Transmission and SINR Analysis
Employing NOMA technique inspired from [23], the first user is assumed to associate with BS in the previous round of the user association and the second user is also connected to the same BS.In existing works on NOMA-HetNet systems, the distance between the first connected NOMA user and its associated BS was fixed [23].On the contrary, we consider this distance as a random variable r a .The distance between the second user and the connected BS is also a random variable r s .The distances r s and r a follow the distribution f Ru (r) in ( 4) where u ∈ {a, s}.As shown in Fig. 2, two cases can be considered due to the uncertainty of whether the second user is farther or nearer.In Case I, user m is the associated user and user n is the second user which is nearer to BS k,q (r s ≤ r a ).In Case II, user n is the associated user and user m is the second user which is farther from BS k,q (r s > r a ).Hence, user m is always the far user and user n is always the near user.The near user decodes messages of both m-th and n-th users and performs SIC, while the far user only decodes its own message.Thus, the following SINR is obtained for user m by substituting {i ∈ m} in (1): where is the interference at user m from the BSs in all macrocells and smallcells except its serving BS.Substituting {i ∈ n} in (1), the SINR at the n-th user decoding the message of user m is: where is the interference at user n from BSs in all macrocells and smallcells except its serving BS.The SINR at user n for decoding its own message (after SIC) is calculated as follows by substituting {i ∈ n} in (1), The SINR at users for Case I and Case II, respectively, can be obtained by substituting {d m k,q = r a , d n k,q = r s } and {d m k,q = r s , d n k,q = r a } in ( 5), (6), and (7).
Considering non-colluding eavesdropping scenario, the received SINR at the most detrimental eavesdropper for detecting the message of the w-th user is obtained by substituting {i ∈ e} in (1) as: where I e k,q = K j=1 l∈Φ b j \{BS k,q } P j g e j,l d −αj e j,l is the interference at eavesdropper e from BSs in all macrocells and smallcells except BS k,q .

D. Interference Characteristic Function
The characteristic function of interference from the macro and small BSs at user w is computed using [23, Lemma 2] as: where w ∈ {m, n}, u ∈ {a, s}, and 2 F 1 denotes the Gauss hypergeometric function [33].The distance between user w and the closest interferer in tier j is y j (r u ) = ( Pj Bj ) 1/αj r 1/ αj u .The characteristic function of interference at an eavesdropper is also obtained using [19,Theorem 2] as: where Γ stands for the Gamma function [33].For the sake of simplicity, L Iw k,q and L Ie k,q are shown as L Iw and L Ie , respectively, in subsequent descriptions.

III. PERFORMANCE ANALYSIS
In this section, performance of the considered SN-Het is analyzed in term of the ergodic secrecy rate.To this end, we first study each tier of the SN-Het.Initially, the ergodic rates of the legitimate users are derived in Lemma 1.The proof is in Appendix A.
Lemma 1.Based on the location of NOMA users, the ergodic rate is presented below.
1) Case I: The ergodic rates of the associated user (user m) and the second user (user n) in the k-th tier are derived as (11) and (12), respectively.
2) Case II: The ergodic rates of the associated user (user n) and the second user (user m) in the k-th tier are derived as (13) and (14), respectively. where It should be noted that due to higher limit of the internal integral in ( 11) and ( 14), the integrand is easy to compute.Despite non-closed-form equations for ergodic rates of the legitimate users, they are efficiently computed numerically compared to Monte Carlo simulations which depend on repeated random sampling.
Remark 1. Considering the incremental behavior of distribution f Ru (r) with growth in density of BSs at the k-th tier (λ k ) in Lemma 1 and also increase in the exponential term and the characteristic function of interference with enhanced transmission power of BSs at the k-th tier (P k ), the ergodic rate of k-th tier is incremental.
To present simpler expressions, in the following lemma, lower bounds on the results of Lemma 1 are derived.The proof is in Appendix B.
Lemma 2. The lower bounds on the ergodic rates of the associated and the second users in the k-th tier for Case I and Case II are obtained at the top of this page for w ∈ {m, n}, we have 2−αj .Note that all logarithms are in base 2 in this paper.
The derived expressions in Lemma 2, relaxe the ergodic rates of the legitimate users in the k-th tier of Lemma 1 to a single integral form.Now, we consider a special case where the path loss exponents for all tiers are equal and the association is unbiased and we derive the rate expressions in closed-forms.The proof is in Appendix C. where Next, the ergodic leakage rate of the most detrimental eavesdropper is provided in Lemma 3. The proof is in Appendix D.
Lemma 3.For w ∈ {m, n}, the ergodic leakage rate at the most detrimental eavesdropper for decoding the message of w-th user in the k-th tier is expressed as: Remark 2. Eq. ( 23) confirms that higher density of eavesdroppers in the network leads to the ergodic leakage rate increase.Now, the special case of interference-limited network (σ 2 = 0) with unbiased association and equal path loss exponents for all tiers is investigated.The interference-limited regime is of high importance in HetNets due to high BS density which results in domination of interference to the noise power [29].In the following corollary, the results of Lemma 1 and Lemma 3 are further simplified for this special case.The proof is in Appendix E.
Corollary 2. The ergodic rates of the associated and the second users in the k-th tier of Case I and Case II are presented below considering some special conditions: (i) the same path loss exponent for all tiers ({α k } k=1,...,K = α), (ii) an unbiased association ( Bj = 1), and (iii) the interferencelimited regime (σ 2 = 0). where In addition, the ergodic leakage rate at the most detrimental eavesdropper for detecting the information of w-th user (w ∈ {m, n}) in the k-th tier is given by: R w e,k (α, 1) = where B λ e a w k,q The provided ergodic rates of the legitimate users at (24) and ( 25) in the interference-limited regime neither depend on the number of tiers, nor on BS transmit power and BS density.This is consistent with the result of [29,30].
After studying each tier in the considered SN-Het system model, the ergodic secrecy rate of the SN-Het is calculated in Theorem 1 below.
Theorem 1.The ergodic secrecy rate of the SN-Het is calculated as follows: , and R m e,k are also derived in ( 11)-( 14) and (23).
Proof.Based on [23, Proposition 1] at non-secure mode, the achievability of (30) could be shown by using wiretap coding for each of NOMA users.R I sec,k and R II sec,k are inferred from Lemma 1 and Lemma 3.

Remark 4. The ergodic secrecy rate of the SN-Het is derived for the special case (the same per-tier path loss exponent, interference-limited network, and unbiased association) by applying derived expressions in Corollary 2 to Theorem 1.
Remark 5. Assuming one tier in the SN-Het (K = 1), the ergodic secrecy rate of multi-cell NOMA system is obtained by invoking the results of Theorem 1.To the best of our knowledge, it is not addressed yet in the literature.

IV. NUMERICAL RESULTS
The derived analytical results (R sec in ( 30)) are numerically evaluated in this section.The Monte Carlo simulation results are also provided to verify the obtained analytical results.The general parameters used in the analytical derivations and simulations are summarized in Table I, which are consistent with the papers [19,23,29].The Monte Carlo simulation area is a circle with radius 10 4 m.Fig. 3 depicts behavior of the SN-Het ergodic secrecy rate versus λ e for different numbers of network tiers.λ e is drawn logarithmically due to its variable interval.The goal is to analyze the ergodic secrecy rate as number of tiers increase while a fixed density of BSs (i.e., 11λ 0 ) is divided between tiers.As expected, the ergodic secrecy rate decreases as λ e increases, due to the increased leakage.Moreover, it is inferred that the ergodic rate improves as the number of tiers increases.It is worth noting that increase in the number of tiers reduces the inter-tier interference because of P 1 > P 2 > P 3 and α 2 , α 3 > α 1 .Interestingly, adding one tier is more beneficial for K = 1 to K = 2 compared with K = 2 to K = 3.In addition, another purpose in Fig. 3 is to allocate a fixed 2 The NOMA power sharing coefficients for all tiers are to be same: (am k,q , an k,q ) = (am, an).Note that, for any am, we characterize the ergodic rate, and optimizing the ergodic rate versus am is an interesting future work.However, for simulations, we choose 1 − am < 0.5 to reduce the probability of SIC failing and thus achieving higher ergodic rates.Ergodic Secrecy Rate [bits/sec/Hz] Fig. 3: The ergodic secrecy rate versus density of eavesdroppers (ra = 50, λ 0 = 1 π500 2 = 1.2732 × 10 −6 , {B 2 , B 3 } = {1, 1}).NOMA, e =10 -7 (lower bound) OMA, e =10 -7   NOMA, e =5x10 -7   NOMA, e =5x10 -7 (lower bound) OMA, e =5x10 -7   Fig. 4: The ergodic secrecy rate versus density of BSs in the second tier density of BSs (11λ 0 ) between two tiers.It is observed that assigning more BSs to a tire with lower power and higher path loss (K = 2) is more advantageous due to the reduction of interference.The analytical curves have a precise match to the results obtained with the Monte Carlo simulations.Due to the high computational complexity for Monte Carlo simulations, we only include the simulation results in Fig. 3.In Fig. 4, behavior of the two-tier SN-Het ergodic secrecy rate is demonstrated versus λ 2 for both NOMA and OMA strategies.Unlike the previous analyses and existing results in [23], the first user distance (r a ) is not fixed here and the ergodic secrecy rate is computed accordingly.The obtained lower bound on ergodic secrecy rate according to Remark 3 is also plotted (denoted as lower bound).It is shown that NOMA significantly outperforms OMA.Furthermore, it is inferred that the ergodic secrecy rate improves as λ 2 increases.Not only the ergodic rate of the second tier is increased by increasing λ 2 , but also the ergodic rate of the first tier increases, interestingly.This is due to the fact that increasing the second tier BSs results in more users with low SINR (i.e., at cell edge) at the first tier become associated with the second tier.In addition, increasing λ 2 results in more interference at the eavesdroppers and degrades the eavesdroppers' channels.As it is inferred, the performance of NOMA is significantly better than OMA systems in networks with higher density of BSs which caused more interference.It is also observed that the obtained ergodic secrecy rates are reasonably close to the demonstrated lower bounds.
The ergodic secrecy rate versus B 2 is presented in Fig. 5 for all network tiers.As observed in [29], which is consistent with the prior existing works, the unbiased association always outperforms biasing from the study of rate at the overall network point of view.It is observed that increasing in B 2 causes the ergodic secrecy rate of the first tier to increase, while the ergodic secrecy rate decreases in the second tier.It is worth noting that more macro users with low SINR (i.e., at cell edge) are associated with the second tier as B 2 increases.This increased macro user association in the second tier degrades the ergodic secrecy rate of corresponding tier, but improves those of the first tier.However, reduction in the second tier ergodic secrecy rate is compensated by increase in λ 2 .Thus, the biased association is an efficient method in load balancing between each tier of the HetNet.Furthermore, the probability of association to the second tier increases as B 2 increases, which causes a faster drop in the two-tier case compared to the second tier case.Randomness to the first user distance is perceived in Fig. 6 as one of our contributions contrary to [23].It is shown by dashed line that the ergodic secrecy rate is highly depended on the value of r a with fixed first user location (as in [23]).Hence, the average of ergodic secrecy rate over the locations of the first user is also depicted by solid line.It is also inferred that obtained lower bound on the ergodic secrecy rate according to Remark 3 (denoted as lower bound) is following the performance of ergodic secrecy rate.

A. Comparision
Since the foundations of the studied model are secrecy, NOMA, and HetNet, we compare the derived results with 1) the HetNet with secrecy constraint, 2) NOMA technique with secrecy constraint, and 3) the HetNet and NOMA-HetNet without secrecy constraints, as follows.Ergodic Secrecy Rate [bits/sec/Hz] HetNet [29] NOMA-HetNet [23] (lower bound) NOMA-HetNet with secrecy HetNet with secrecy (c) Fig. 7: The effects of (a) NOMA technique (K = 2, λ 1 = 1 π500 2 = 1.2732 × 10 −6 , λ 2 = 10λ 1 , B 2 = 1), (b) multi-tier using HetNet (ra = 50, λ 0 = 1) The ergodic secrecy rate in [19] for secure HetNet is compared with our results versus density of eavesdroppers (λ e ).In addition to the difference between our scheme and [19] in the use of NOMA, the work in [19] differs in some other aspects.Contrary to the considered model, the first tier in [19] is equipped with massive MIMO, intra-tier interference is not taken in to account in the second tier, and the adoption of S-FFR for inter-tier interference mitigation is regarded.It is assumed in S-FFR that there are a total of K resource blocks; αK of them are allocated to small BSs and (1 − α)K are shared by small BSs and macro BSs, where α denotes the S-FFR factor.In Fig. 7(a), the lower bound on ergodic secrecy rate of [19] is presented by eliminating massive MIMO in the first tier and setting α = 0 in S-FFR.The results of our considered scheme with and without NOMA are denoted as SN-Het and HetNet with secrecy (by setting a m = 0, r s = 0), respectively.Note that secure HetNet, which is lower bound, is lower than HetNet with secrecy.In accordance to Fig. 7(a), the SN-Het has superiority over other methods due to enabaled NOMA technique.
2) Secure multi-cell NOMA is prepared by eliminating HetNet from the SN-Het (K = 1) to study the effect of using multi-tiers with a fixed density of BSs in Fig. 7(b).It is observed that the ergodic secrecy rate in three-tier HetNet (K = 3) has a significant performance improvement compared to multi-cell NOMA (K = 1).This is consistent with the result of [31] which does not include NOMA and secrecy.
3) The ergodic rate of HetNets from [29] and the lower bound on the ergodic rate of NOMA-HetNet from [23] are provided in Fig. 7(c) to study the effect of secrecy constraints.Massive MIMO in the first tier of model in [23] is eliminated to be comparable with our model.Moreover, we consider our scheme without NOMA (denoted as HetNet with secrecy) and eliminating NOMA only at the first tier (as the network in [23], denoted as NOMA-HetNet with secrecy).In both with and without NOMA cases, secrecy constraint degrades the ergodic rates, especially at higher λ e s.It is worth noting that NOMA-HetNet in λ e = 0 is lower bound and lower than NOMA-HetNet with secrecy.

V. CONCLUSIONS
The physical layer security in a K-tier multi-cell HetNet with NOMA in all tiers is investigated.BSs, legitimate users, and eavesdroppers are randomly distributed in the considered system model.First, analytical expressions for the ergodic secrecy rate over all tiers of the network are derived.Next a lower bound on the ergodic secrecy rate is obtained.In addition, closed-form expressions for the lower bounds on the ergodic rates of legitimate users are provided in a special case.Furthermore, the ergodic secrecy rate of the network is studied in the interference-limited regime.Experimental results demonstrate that NOMA compared to OMA improves the spectrum efficiency performance.It is also inferred that applying HetNet to a secure multi-cell NOMA system improves the spectrum efficiency performance.Moreover, the obtained results verify that increase in the number of network tiers with a fixed density of BSs improves the ergodic secrecy rate.The ergodic secrecy rate is also enhanced with increase in density of the second tier BSs in a two-tier network while density of BSs at the first tier is kept fix.However, the secrecy constraint degrades the ergodic rate as expected.

A. Proof of Lemma 1
The ergodic rate of NOMA users in the k-th tier is computed as follows: where Θ(x) = log(1 + x) and (a) caused by random selection of second user from network and w ∈ {m, n}.
Keeping (A.1) in mind, the ergodic rate of the associated user (m) in Case I is calculated as: Pr Θ(min(γ I m,m k,q (r s , r a ), γ I n,m k,q (r s , r a ))) > y dy × f Rs (r s )f Ra (r a ) dr s dr a where (a) follows from the variable change y = Θ(t).Fmin(γ I m,m k,q ) denotes the complete cumulative distribution function (CCDF) of min(γ I m,m k,q , γ I n,m k,q ) and (b) results from independence of γ I m,m k,q and γ I n,m k,q because of a fixed and independent r a from r s .Defining γ m,m k,q for Case I by substituting {d m k,q = r a } in (5), we have where L Im is obtained in (9).Defining γ n,m k,q for Case I by substituting {d n k,q = r s } in (6), we similarly obtain where L In is obtained in (9).By considering (a m k,q − ta n k,q ) ≥ 0, which leads to ( am k,q an k,q ) ≥ t based on unavailability of Pr(−g m k,q > t(I k,q +σ 2 ) ), the upper limit of the integral on t in (A.2) becomes k,q an k,q .Hence, (11) is by substituting (A.3) and (A.4) into (A.2).
Keeping (A.1) in mind, the rate of the second user (n) in Case I is similarly written as: Then, based on defining γ n,n k,q for Case I by substituting {d n k,q = r s } in (7), we have By substituting (A.6) into (A.5),we have Thus, ( 12) is obtained.The proof of ( 13) and ( 14) is similar to (11) and (12), respectively.This completes the proof.

B. Proof of Lemma 2
The ergodic rate of legitimate user in Case I or Case II is R w,k = E[log(1 + (γ w k,q ))] with w ∈ {m, n}, which is expressed in ( 11)- (14).The Jensen's inequality is utilized to derive a lower bound on the ergodic rate of the w-th user as below: ). (B.1) Thus, the right hand side of (B.1) is the lower bound on the ergodic rate of legitimate user in Case I or Case II (i.e., Rw,k ), which is verified in this proof.Considering γ m,m k,q and γ n,m k,q for Case I obtained by substituting {d m k,q = r a } in ( 5) and {d n k,q = r s } in (6) as well as inequality uv u+v ≤ min(u, v) that results in u, v ≥ 0 [32], the lower bound on the ergodic rate of the m-th user in Case I ( RI m,k ) is calculated at (B.2).In (B.2),(a) results from E[ 1 and considering g w k,q ∼ exp(1).Based on ( 5) and ( 6), E[I w k,q ] can be calculated as: where (a) results from using Campbell's theorem and g w j,l ∼ exp (1).Using E[I w k,q ] in (B.3), ( 15) is obtained by substituting (B.2) into the right hand side of (B.1).Similarly, to calculate the lower bound on the ergodic rate of the n-th user in Case I ( RI n,k ), based on defining γ n,n k,q for Case I by substituting {d n k,q = r s } in ( 7), we have: where (a) is derived in (B.2).Again, using E[I w k,q ] of (B.3), ( 16) is achieved by substituting (B.4) into the right hand side of (B.1).The proof procedure for the lower bounds on the ergodic rates of the m-th and n-th users in Case II is similar to Case I.This completes the proof.

D. Proof of Lemma 3
The ergodic leakage rate of the most detrimental eavesdropper for detecting information of the w-th user (w ∈ {m, n}) is written as: 1 + t dt. (D.1) Based on (8), the CDF of γ emax k,q is calculated as: F γe max k,q (t) = Pr γ emax k,q < t = Pr max e∈Φe a w k,q P k g e k,q d −α k e k,q I e k,q + σ 2 < t = E Φe e∈Φe Pr a w k,q P k g e k,q d −α k e k,q 1 − Pr a w k,q P k g e k,q r −α k I e k,q + σ 2 < t dr Pr g e k,q > t(I e k,q + σ 2 ) a w k,q P k r −α k r dr = exp − 2πλ e ∞ 0 exp − tσ 2 r α k a w k,q P k L Ie tr α k a w k,q P k r dr , where (a) and (b) are in accordance to use of the generating functional of the PPP Φ e and the polar-coordinate system, respectively; L Ie is obtained by (10).Finally, ( 23) is obtained by substituting (D.2) into (D.1).This completes the proof.

PjP
k , Bj = Bj B k , and αj = αj α k are the ratios of the interfering j-th tier to the serving k-th tier.Regarding [29, Lemma 3], the PDF of distance R u = arg max k∈{1,2,...,K} (P r k,q )

Corollary 1 .
Assuming the same path loss exponent, {α k } k=1,...,K = α for all tiers and an unbiased association, Bj = 1, the lower bounds on the ergodic rates of the associated and the second users in the k-th tier for Case I and Case II are expressed in closed-form as: k + , where [x] + = max {x, 0}, R I sec,k and R II sec,k represent the ergodic secrecy rates in the k-th tier for Case I and Case II, respectively.R I n,k − R n e,k + and R I m,k − R m e,k + denote the ergodic secrecy rates of the users n and m in the k-th tier for Case I, respectively (similarly for Case II).A k is given in (3),