# Secure Communication for Uplink Cellular Networks Assisted with Full-Duplex Device-to-Device User
## 4 Simulation Results and Analysis  
In this section, simulation results can present the performance of two different schemes, including the proposed FD scheme and the conventional HD scheme. For the conventional HD scheme, we still consider that the D2D user as a relay is untrusted, but the D2D user is operated in HD mode to assist cellular uplink transmission while reusing the cellular spectrum to achieve D2D communication. The instantaneous SINRs at D1, BS and D2 can be formulated as:  
\[\gamma_{D1}^{HD}=\frac{\beta P_{C}\gamma_{C1}}{(1-\beta)P_{C}\gamma_{C1}+1} \tag{31}\]  
\[\gamma_{B}^{HD}=\frac{\alpha\beta P_{C}P_{D}\gamma_{C1}\gamma_{B1}}{\alpha P_{ D}\gamma_{B1}+P_{C}\gamma_{C1}+1} \tag{32}\]  
\[\gamma_{D2}^{HD}=\frac{(1-\alpha)P_{D}\gamma_{12}}{P_{C}\gamma_{C2}+\alpha P_{ D}\gamma_{12}+1} \tag{33}\]  
The optimal power allocation factors at D1 and CU in the HD scheme can be expressed as:  
\[\alpha_{HD}^{\star}=\frac{(P_{C}\gamma_{C1}+1)\Big{[}(\eta^{2}-1)(P_{C}\gamma_ {C1}+1)+\beta P_{C}\gamma_{C1}\Big{]}}{P_{D}\gamma_{B1}\Big{[}\beta(1-\beta)P_ {C}^{2}\gamma_{C1}^{2}-(\eta^{2}-1)(P_{C}\gamma_{C1}+1)\Big{]}} \tag{34}\]  
\[\beta_{HD}^{\star}=\frac{(P_{C}\gamma_{C1}+1)\Big{[}\sqrt{\eta^{2}(\eta^{2}-1 )}-(\eta^{2}-1)\Big{]}}{P_{C}\gamma_{C1}} \tag{35}\]  
For the Monte Carlo experiment, the simulation results are averaged over 1000 independent channel realizations. Simulation parameters are elaborated in Table 1.  
Figure 2 shows the optimal power allocation factor \(\beta^{\star}\) at CU versus various secrecy rate threshold \(R_{th}\). We set cancellation coefficients \(\kappa\) as 0.001, 0.005 and 0.01, respectively. As shown in Figure 2, the optimal power allocation factor at CU will monotonically increase as the secrecy rate threshold increases. The reason is that the CU allocates more power to transmit the confidential signal to increase the cellular link rate, which can improve the security of the relay. In addition, the larger \(\beta^{\star}\) can be obtained, as the cancellation coefficient \(\kappa\) is bigger. The optimal power allocation factor \(\alpha^{\star}\) at D1 versus \(R_{th}\) under different SIC levels is shown in Figure 3. From Figure 3, when the secrecy rate threshold is 1, the optimal power factor \(\alpha^{\star}\) with \(\kappa=0.01\) is approximately 0.48, the optimal power factor \(\alpha^{\star}\) with \(\kappa=0.008\) is about 0.39, and the optimal power factor \(\alpha^{\star}\) with \(\kappa=0.005\) is only 0.3. That is because the smaller cellular uplink rates can be obtained, as the cancellation coefficient is greater. In order to ensure that the cellular communication can achieve a secrecy rate, D1 must allocate more power to assist in transmission, which also causes the D2D link rate to drop. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Bandwidth & 5 Hz \\ Noise power & \(-\)70 dBm \\ Path loss exponent & 2 \\ The distance between CU and D1 & 200 m \\ The distance between CU and D2 & 200 m \\ The distance between D1 and D2 & 200 m \\ The distance between D1 and BS & 300 m \\ Power of CU & 1 W \\ Power of D1 & 1 W \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. The D2D link rate \(R_{D}\) versus secrecy rate threshold \(R_{th}\) in the proposed FD scheme and the conventional HD scheme is shown in Figure 4. As can be seen from Figure 4, the output performance of the proposed FD scheme is better than the HD scheme, and the D2D link rate decreases as the secrecy rate threshold \(R_{th}\) increases. Furthermore, the D2D link rate with \(\kappa=0.01\) in the proposed FD scheme is less than with \(\kappa=0.005\). Figure 5 displays the optimal allocation factor versus the cancellation coefficient \(\kappa\), in which the secrecy rate thresholds are set as 0.1, 0.5 and 1, respectively. From Figure 5, when the secrecy rate threshold is 1, the optimal power allocation factor \(\beta^{*}\) is greater than that when the secrecy rate threshold is 0.1 and 0.5.