# Secure Transmission for Buffer-Aided Relay Networks in the Internet of Things
## 5 Simulation Analysis  
In this section, Monte-Carlo simulation results are presented to validate the theoretical analysis derived in the previous sections for the three transmission schemes. Without loss of generality,the normalized distance is set as follows: \(d_{SR}=d_{RD}=1\), \(d_{SE}=d_{RE}=2\). The path loss factor \(\kappa\) is set to be 3. From the figures, the theoretical curves are in exact agreement with the simulation results, which verifies the accuracy of our theoretical analysis. Figure 2 illustrates the secrecy outage probability versus the total transmit power budget \(P_{Total}\) for the three proposed transmission schemes. As shown in Figure 2, the secrecy outage probability decreases with the increase of \(P_{Total}\) until a secrecy outage performance floor occurs at high transmit power. This is intuitive since both capacities of the main and wiretap channels improve with the increase of the transmit power. Furthermore, we observe that, in both the NCE and CE scenarios, the NJ scheme outperforms the SCJ scheme at the low total transmit power, while the opposite holds in the high total transmit power. For the SCJ-OPA scheme, almost the same performance as the NJ scheme can be obtained at the low transmit power, and, when \(P_{Total}\) is large, a similar performance as the SCJ scheme can also be achieved, which indicates that the SCJ-OPA scheme covers the shortages of the NJ and SCJ schemes exactly. In addition, it is worth noting that the secrecy performance of the CE scenario is worse than that of the NCE scenario under the same conditions, which is because that the MRC scheme utilized by the CE mode can enhance the ability of eavesdropping. Figure 3 plots the average secrecy throughput of the three proposed transmission schemes versus the total transmit power budget \(P_{Total}\). It is observed that the average secrecy throughput increases until it converges to a fixed value with the increase of the total transmit power. In addition, we further observe that the NJ and SCJ-OPA schemes outperforms the SCJ scheme in terms of the average secrecy throughput when \(P_{Total}\) is not large. At the high \(P_{Total}\), the SCJ and SCJ-OPA schemes achieve better performance than the NJ scheme. In other words, utilizing the SCJ-OPA scheme can improve the secrecy performance of the considered system, especially when the total power is small or large. Figure 4 investigates the impact of the secrecy rate \(R_{s}\) on the average secrecy throughput for the NCE and CE scenarios, respectively. From these figures, we find that, for both NCE and CE scenarios, the average secrecy throughput first increases with the increase of \(R_{s}\) and then decreases when \(R_{s}\) increases beyond a certain value, which demonstrates the accuracy of the analysis in Section 4.2. Besides, it can be observed that when the total transmit power is small, i.e., \(P_{Total}=10\) dB, the SCJ-OPA scheme obtains a similar average secrecy throughput as the NJ scheme, which are both better than the SCJ scheme. On the other hand, when the total transmit power is large, i.e., \(P_{Total}=20\) dB, the SCJ-OPA and SCJ schemes are superior to the NJ scheme, which is consistent with the previous analysis and simulation. Figure 2: Secrecy outage probability vs. the total transmit power budget \(P_{Total}\) for the three proposed transmission schemes when \(R_{s}=0.6\) (bit/s/Hz), \(M=3\), \(L=2\), \(K=2\). Figure 5 presents the end-to-end delay for the three proposed transmission schemes versus the total transmit power budget \(P_{Total}\). As shown in Figure 5, the end-to-end delay is significantly decreased as the \(P_{Total}\) increases in both the NCE and CE scenarios. Similarly, when the \(P_{Total}\) increases beyond a certain value, the end-to-end delay remains unchanged. That is to say, a performance floor occurs. This is because the secrecy outage probability tends to a fixed value at this moment.