# Secure On-Off Transmission in UAV Relay-Assisted mmWave Networks
## 3 Secrecy Evaluation
### Performance Analysis with Perfect Beam Alignment
#### 3.2.1 On-Off Transmission Scheme  
In this scheme, with the pilot signals from the destination \(D\), the selected UAV relay \(R_{0}\) sends the messages only when the channel capacity \(C_{R_{0}D}\) is above a threshold \(\mu\). Then, the TP is derived as  
\[ \begin{split} p_{tx}&=\Pr\left(C_{R_{0}D}>\mu\left| R_{0}\in\hat{\Phi}\right.\right)\\ &=\frac{\Pr\left(\left|h_{R_{0}D}\right|^{2}>\frac{N_{0}\left(2^ {\mu}-1\right)}{\Pi\in R_{0}D^{L}\left(t_{R_{0}D}\right)}\right)}{\Pr\left(R_{ 0}\in\hat{\Phi}\right)}\\ &=\frac{\sum\limits_{j\in\left(L_{N}\right)}A_{j}\int_{0}^{ \tau}\frac{\tau\left(N_{j}^{0\left(2^{\mu}-1\right)}g_{R_{0}D}^{A_{j}}\right)} {\tau\left(N_{j}\right)}}{\tau\left(N_{j}\right)}g_{j}(r)dr\\ &\overset{a}{=}\frac{\sum\limits_{j\in\left(L_{N}\right)}A_{j} \sum\limits_{i=1}^{\tau}\alpha_{i}^{\left(\tau\right)}\left(\tau_{i}r_{i}H_{i }G_{R_{0}D}\right)g_{\tau_{i}}(r_{i})}{\sum\limits_{j\in\left(L_{N}\right)}A_{j }\sum\limits_{i=1}^{\tau}\alpha_{i}^{\left(\tau\right)}g_{\tau_{i}}(r_{i})} \end{split}  \tag{9}\]  
where step \((a)\) is due to the Gauss-Chebyshev integration, \(r_{i}=\frac{\mathcal{Q}}{2}\left(1+\cos\frac{\left(2i-1\right)\pi}{2T}\right)\), \(\bar{w}_{i}^{\left(r\right)}=\frac{\pi}{T}\sqrt{\tau_{i}\left(Q-r_{i}\right)}\) and \(\tau_{j}\left(\mu,r_{i},H,G_{R_{0}D}\right)\) is written as  
\[\tau_{j}\left(\mu,r_{i},H,G_{R_{0}D}\right)= \frac{\Gamma\left(N_{j},\frac{N_{0}\left(2^{\mu}-1\right)\left( \tau_{i}^{2}+H^{2}\right)^{\frac{\alpha_{j}}{2}}}{P_{\xi}R_{0}D\cdot D_{j}} \right)}{\Gamma\left(N_{j}\right)}. \tag{10}\]  
The SOP is the probability that the secrecy outage occurs when \(R_{0}\) performs data transmission. As such, the SOP in on-off scheme is derived as  
\[ \begin{split} p_{sop}^{on-off}&=1-\Pr\left(C_{R_{0 }D}-C_{E}>C_{S}\left|\left(C_{R_{0}D}>\mu\left|R_{0}\in\hat{\Phi}\right.\right. \right)\right.\\ &=1-\frac{\Pr\left(\tau_{E}<\frac{1+\tau_{R_{0}D}}{C_{s}}-1,\tau_ {R_{0}D}>2^{\mu}-1\right)}{P_{tx}}\\ &=1-\frac{1}{P_{tx}}\sum\limits_{j\in\left\{L,N\right\}}A_{j}\int _{0}^{P_{tx}}\int_{2^{\infty}-1}g_{j}\left(r\right)F_{\tau_{E}}\left(\frac{1+x }{2^{\zeta_{5}}}-1\right)f_{\tau_{R_{0}Dj}}\left(x\right)drdx\\ &\overset{b}{\approx}1-\frac{1}{P_{tx}}\sum\limits_{j\in\left\{L,N\right\}}A_{j}\sum\limits_{i,k=1}^{T}\bar{w}_{i}^{\left(r\right)}w_{k}^{ \left(x\right)}g_{j}\left(r_{i}\right)F_{\tau_{E}}\left(\beta\left(x_{k}\right) \right)f_{\tau_{R_{0}Dj}}\left(x_{k}\right),\end{split}  \tag{11}\]  
where \(F_{\tau_{E}}\left(\cdot\right)\) is the CDF of \(\gamma_{E}\), \(f_{\tau_{R_{0}D}j}\left(\cdot\right)\) is the PDF of \(\gamma_{R_{0}D}\) with LOS or NLOS \(R_{0}\to D\) link, \(\beta\left(y\right)=\frac{1+y}{C_{s}}-1\), step \((b)\) is due to the fact that the maximal \(\gamma_{R_{0}D}\) can be approximated as \(\gamma_{R_{0}D}^{\max}=\frac{5\pi N_{L}c_{M}^{R_{0}}c_{M}^{D}L(H)}{N_{0}}\), and \(x_{k}=\frac{\left(\gamma_{R_{0}D}^{\max}+2^{\mu}-1\right)\left(\gamma_{R_{0}D}^ {\max}-2^{\mu}-1\right)}{2}\cos\frac{(2k-1)\pi}{2T}\) and \(w_{k}^{(x)}=\frac{\pi}{T}\sqrt{\left(x_{k}-2^{\mu}+1\right)\left(\gamma_{R_{0} D}^{\max}-x_{k}\right)}\) are the parameters by using Gauss-Chebyshev integration. We note that (11) is calculated by using the CDF of \(\gamma_{E}\) and the PDF of \(\gamma_{R_{0}D}\) when \(R_{0}\to D\) link is LOS or NLOS. Without loss of generality, we only take into account the eavesdroppers inside a circular area, and the radius is set as \(Q\) for simplicity. Then, the CDF of \(\gamma_{E}\) is derived as  
\[ \begin{split} F_{\gamma_{E}}\left(x\right)&=\Pr \left(\max_{e\in\Phi_{E}}\gamma_{E_{e}}\leq x\right)\\ &=\mathrm{E}_{\Phi_{E}}\left(\prod\limits_{e\in\Phi_{E}}\Pr\left( \gamma_{E_{e}}\leq x\right)\right)\\ &\overset{c}{=}\exp\left(-\lambda_{E}\int_{R^{2}}\Pr\left( \gamma_{E_{e}}>x\right)dR^{2}\right)\\ &=\exp\left(-\lambda_{E}\sum\limits_{G_{R_{0}E}}\Pr\left(G_{R_{ 0}E}=V\right)\sum\limits_{j\in\{L,N\}}\Xi_{j}\left(V,x\right)\right),\end{split}  \tag{12}\]  
where step (\(c\)) is due to the void probability of PPP, \(\Xi_{j}\left(V,x\right)\) is given as  
\[