# Secure On-Off Transmission in UAV Relay-Assisted mmWave Networks
## 3 Secrecy Evaluation
### Performance Analysis with Beam Alignment Error  
Based on the antenna model mentioned in Section 2.2, the beam alignment occurs when the orientation of the target node falls in the main lobe of the transmitter's antenna gain. For the 3D antenna, if the additive beam alignment error is not larger than half of the main-lobe beamwidth in both of the azimuth and elevation, i.e., \(\left|\xi_{a}^{k}\right|\leq\theta_{a}^{k}/2\), \(\left|\xi_{d}^{k}\right|\leq\theta_{d}^{k}/2\), \(k\in\{S,R_{x},D\}\), the beam alignment is deemed to be achieved. Then the probability that node \(k\) align its target node is calculated by  
\[\begin{split} P_{A}^{k}&=F_{\left|\xi_{a}^{k}\right|} \left(\frac{\theta_{a}^{k}}{2}\right)F_{\left|\xi_{d}^{k}\right|}\left(\frac{ \theta_{d}^{k}}{2}\right)\\ &=erf\left(\frac{\theta_{a}^{k}}{2\sqrt{2}\bar{\gamma}_{k}}\right) erf\left(\frac{\theta_{d}^{k}}{2\sqrt{2}\bar{\gamma}_{k}}\right).\end{split} \tag{16}\]  
Since the existence of beam alignment error, the antenna gain between the legitimate nodes \(i\) and \(j\), \(i,j\in\{S,R_{0},D\}\), which is denoted as \(G_{ij}\), can be described as a discrete random variable. As such, the PDF of \(G_{ij}\) can be given by  
\[\begin{split} f_{G_{ij}}(y)&=P_{A}^{i}P_{A}^{j} \delta\left(y-G_{M}^{i}G_{M}^{j}\right)+P_{A}^{i}\bar{P}_{A}^{j}\delta\left(y- G_{M}^{i}G_{m}^{j}\right)\\ &\quad+\bar{P}_{A}^{i}P_{A}^{j}\delta\left(y-G_{m}^{i}G_{M}^{j} \right)+\bar{P}_{A}^{i}\bar{P}_{A}^{j}\delta\left(y-G_{m}^{i}G_{m}^{j}\right), \end{split} \tag{17}\]  
where \(\bar{P}_{A}^{i}=1-P_{A}^{i}\) (\(\bar{P}_{A}^{j}=1-P_{A}^{j}\)), and \(\delta\left(\cdot\right)\) is the Kronecker delta function.  
Let the \(p_{sop}^{on-off}\left(y_{1},y_{2}\right)\) and \(p_{sop}^{non}\left(y_{1},y_{2}\right)\) be the SOP in the on-off and non-on-off transmission schemes when \(G_{SR_{0}}=y_{1}\) and \(G_{R_{0}D}=y_{2}\). The SOP in the on-off transmission scheme is formulated as  
\[\begin{split}\hat{p}_{sop}^{on-off}&=\int_{0}^{ \infty}\int_{0}^{\infty}p_{sop}^{on-off}\left(y_{1},y_{2}\right)f_{G_{SR_{0}}} \left(y_{1}\right)f_{G_{R_{0}D}}\left(y_{2}\right)dy_{1}dy_{2}\\ &=\sum\limits_{G_{SR_{0}}}\Pr\left(G_{SR_{0}}=y_{1}\right)\sum \limits_{G_{R_{0}D}}\Pr\left(G_{R_{0}D}=y_{2}\right)p_{sop}^{on-off}\left(y_{ 1},y_{2}\right),\end{split} \tag{18}\]  
where \(G_{ij}\) belongs to \(\left\{G_{M}^{i}G_{M}^{j},G_{M}^{i}G_{m}^{j},G_{m}^{i}G_{M}^{j},G_{m}^{i}G_{m}^{j }G_{m}^{j}\right\}\) with probability \(\left\{P_{A}^{i}P_{A}^{j},P_{A}^{i}\bar{P}_{A}^{j},P_{A}^{i}P_{A}^{j},P_{A}^{i} \bar{P}_{A}^{j}\right\}\) for \(i,j\in\{S,R_{0},D\}\). The SOP in the non-on-off scheme is similar to (18), but replacing \(\hat{p}_{sop}^{on-off}\) and \(p_{sop}^{on-off}\left(y_{1},y_{2}\right)\) with \(\hat{p}_{sop}^{non}\) and \(p_{sop}^{non}\left(y_{1},y_{2}\right)\), respectively.  
**Remark 2**.: _It can be clarified that the beam alignment probability of node \(k\) is affected by the main-lobe beamwidth in both the azimuth and elevation \(\theta_{a}^{k}\), \(\theta_{d}^{k}\) and the beam alignment error \(\sigma_{k}\), as indicated by (16). Obviously, the SOPs in both the on-off and non-on-off transmission schemes increase as \(\sigma_{k}\) becomes large. This is because that the larger \(\sigma_{k}\) degrades the channel qualities of legitimate links. Nevertheless, when the error is relatively small, the SOP would not have a decided change because the main lobe of the transmitter's antenna still can cover the target nodes. In addition, when \(\sigma_{k}\) is severe, the SOP is worse by using the antenna array with larger number of elements due to its lower side-lobe gain and narrow beamwidth._