# Secure Transmission for Buffer-Aided Relay Networks in the Internet of Things
## 4 Performance Analysis
### Secrecy Outage Analysis
#### 4.1.2 SCJ Scheme  
The secrecy outage probability at state \(s_{n}\) under the SCJ scheme can be represented as  
\[P_{out,n}^{SCJ}\left(\gamma_{th}\right)=F_{\gamma_{E1}^{SCJ}} \left(\gamma_{th}\right)\cdot F_{\gamma_{E2}^{SCJ}}\left(\gamma_{th}\right). \tag{26}\]  
**Theorem 4**.: _The CDF of \(\gamma_{E2}^{SCJ}\) under the NCE scenario is given by_  
\[F_{\gamma_{E2}^{SCJ}}\left(x\right)=K\sum\limits_{s=0}^{M_{2n}}\sum\limits_{t=0}^ {K-1}\left(\begin{array}{c}M_{2,n}\\ s\end{array}\right)\left(\begin{array}{c}K-1\\ t\end{array}\right)\left(-1\right)^{s+t}\beta^{t}\left[\frac{\lambda_{JE}}{P_ {2}}I_{1}\left(t\right)+\beta I_{2}\left(t\right)\right]e^{-\frac{\lambda_{B} \beta P\left(x-1\right)}{P_{2}}}, \tag{27}\]  
_where \(\beta=\frac{\lambda_{JE}P_{R_{2}}}{\lambda_{JE}P_{2}}\), \(\mu\left(t\right)=\frac{\lambda_{B}p\text{s}+\lambda_{JE}\left(t+1\right)}{P_ {R_{2}}}\), \(I_{1}\left(t\right)\) and \(I_{2}\left(t\right)\) are given by_  
\[I_{1}\left(t\right)=\left\{\begin{array}{cc}-\varepsilon^{\beta\mu\left(t \right)}Ei\left(-\beta\mu\left(t\right)\right),&t=0\\ \sum\limits_{l=1}^{t}\frac{\left(l-1\right)!\left(t-\left(l\right)\right)!-l }{t!\beta}-\frac{\left(-\mu\left(t\right)\right)!e^{\beta\mu\left(l\right)}Ei \left(-\beta\mu\left(t\right)\right)}{t!}&t>0\end{array}\right., \tag{28}\]  
\[I_{2}\left(t\right)=\sum\limits_{l=1}^{t+1}\frac{\left(l-1\right)!\left(-\mu \left(t\right)\right)!^{l-l+1}}{\left(t+1\right)!\beta^{l}}-\frac{\left(-\mu \left(t\right)\right)^{l+1}}{\left(t+1\right)!}e^{\beta\mu\left(t\right)}Ei \left(-\beta\mu\left(t\right)\right). \tag{29}\]  
Proof of Theorem 4.: See Appendix C.  
**Theorem 5**.: _The CDF of \(\gamma_{E2}^{SCJ}\) under the CE scenario can be presented as_  
\[F_{\gamma_{E2}^{SCJ}}\left(x\right)=\sum\limits_{s=0}^{M_{2n}}\left(\begin{array} []{c}M_{2,n}\\ s\end{array}\right)\left(-1\right)^{s}e^{-\frac{\lambda_{B}p\left(s-1\right) }{P_{R_{2}}}}\Phi, \tag{30}\]  
_where \(\Phi\) is given by_  
\[\Phi=1+\frac{\lambda_{JE}^{K}}{\left(K-1\right)!}e^{\omega\lambda_{JE}}\sum \limits_{t=1}^{K}\sum\limits_{l=0}^{K-1}\left(\begin{array}{c}K\\ t\end{array}\right)\left(\begin{array}{c}K-1\\ l\end{array}\right)\left(-\theta\right)^{l}\left(-\omega\right)^{K-1-l}\Phi_{1}, \tag{31}\]  
_with \(\theta=\frac{\lambda_{B}p\text{s}x}{P_{2}\lambda_{JE}}\), \(\omega=\theta+\frac{1}{P_{2}}\) and \(\Phi_{1}\) can be expressed as_  
\[\Phi_{1}=\left\{\begin{array}{cc}\frac{\mathrm{r}\left(\begin{array}{cc}l -t+1,&\omega\lambda_{JE}\end{array}\right)}{\lambda_{JE}^{l-t+1}},&l-t\geq 0\\ -Ei\left(-\omega\lambda_{JE}\right),&l-t\!=\!-1\\ e^{-\omega\lambda_{JE}}\sum\limits_{v=1}^{t-l-1}\frac{\left(v-1\right)!\left(- \lambda_{JE}\right)^{t-l-1-v}}{\left(t-l-1\right)!\omega^{\rho}}-\frac{\left(- \lambda_{JE}\right)^{t-l-1}}{\left(t-l-1\right)!}Ei\left(-\omega\lambda_{JE} \right),&l-t\leq-2\end{array}\right., \tag{32}\]  
_where \(\Gamma\left(\cdot,\cdot\right)\) is the upper incomplete Gamma function [40] (eq. (8.350.2)), and \(Ei\left(\cdot\right)\) is the exponential integral function [40] (eq. (8.211.1))._  
Proof of Theorem 5.: See Appendix D.  
Recalling the first hop of the SCJ scheme is the same as the NJ scheme, we can derive \(F_{\gamma_{E1}^{SCJ}}\) by making a substitution of some parameters. Furthermore, the stationary probability vector of the SCJ scheme \(\boldsymbol{\pi}^{SCJ}\!=\left(\mathbf{A}^{SCJ}-\mathbf{I}+\mathbf{B}\right)^ {-1}\mathbf{b}\) can also be obtained following the similar analysis as in **Theorem 3**. Hence, the secrecy outage probability for the NCE and CE scenarios under the SCJ scheme in closed-form can be derived by substituting Equation (26) and \(\boldsymbol{\pi}^{SCJ}\) into Equation (20).