## 5 Performance Analysis and Simulation
### Comparison of the Performance Simulation
#### 5.3.1 Comparison of Safety Period
Moreover, when the hop count from the SoN to the SN is greater than 20, the average safety period of the NRDPS scheme is greater than 1000, that is, the attacker is never able to capture the source node. Figure 10: Comparison of the safety period of the NRSPS scheme with the other three schemes. **Experiment 3:** Comparison of the safety period of the proposed four schemes  
In order to further compare the security performance of our proposed four schemes, we compare the safety period of the four schemes of NRSPS, NRDPS, RSPS and RDPS. The average safety period is obtained by repeating the experiment 100 times, as shown in Figure 12.  
It can be seen from Figure 12 that the RDPS scheme has the highest safety period. When the hop count of the source node to the sink node is 5, the safety period of the RDPS scheme reaches 1000, that is, the attacker cannot trace back to the SoN. In practical applications, the SoN is far away from the SN, so the RDPS can ensure the privacy and security of the location of the source node in practical applications. Compared with NRSPS, RSPS and NRDPS schemes, the safety period of the RDPS scheme increases by 32.13 times, 1.33 times and 4.22 times, respectively. In Figure 12, the safety period of the NRSPS does not change much. This is because the safety period of the NRSPS is low, and the change is too small compared with other schemes. Its actual change trend is shown in Figure 10.  
It can be seen from the above comparison results that replacing the PN can greatly improve the security performance of the scheme. This is because after the PN is replaced, the attacker loses the  
Figure 11: Comparison of the safety period of NRSPS and NRDPS. Figure 12: Comparison of the safety period of NRSPS, RSPS, NRDPS and RDPS. interception target. During the process of the attacker returning to the SN, the SoN continues sending the collected data packets to the SN. **Experiment 4:** The impact of when to replace the phantom node on the safety period  
It can be seen from Experiment 3 that replacing the PN can improve the security performance of the scheme. Therefore, in Experiment 4, we further explore the influence of the timing of replacing the PN on security performance. Suppose that in the RDPS scheme, when the attacker backtracks \(\text{Hop}_{\text{Ps},\text{pr}}+\text{Hop}_{\text{pr},\text{sink}}/n\) hops, the SoN changes the SPN and the RPN. It can be known from Equations (12) and (13) that in the RDPS scheme, the attacker needs to backtrack \(\text{Hop}_{\text{sum}}=\text{Hop}_{\text{s},\text{ps}}+\text{Hop}_{\text{ ps},\text{pr}}+\text{Hop}_{\text{pr},\text{sink}}\) hops to capture the SoN. In the RDPS scheme, \(\text{Hop}_{\text{s},\text{ps}}\) is used as the extra security hop count. Suppose that \(\text{Hop}_{\text{E}}\) is the hop count that the attacker backtracks, and when \(\text{Hop}_{\text{E}}=\text{Hop}_{\text{ps},\text{pr}}+\text{Hop}_{\text{pr}, \text{sink}}/n\), the SoN replaces the PN. If the attacker does not overhear the packet, he needs to jump back \(\text{Hop}_{\text{E}}\) hops to the SN. Except for Experiment 4, in other experiments, the value of \(n\) is 1. In the case of different \(n\), the average safety period is obtained by repeating the experiment 100 times, as shown in Figure 13.  
From Figure 13, we can see that the average safety period of the three cases is increased. This is because as the distance between the SoN and the SN increases, the number of hops that the attacker needs to trace back increases accordingly. Meanwhile, it can be seen from Figure 13 that the larger the value of \(n\) is, the smaller the average safety period is. This is because in the simulation, in order to avoid the experiment falling into an infinite loop, the SoN no longer sends the request packet to the SN even when the PNCS is empty, and the experiment ends when the attacker traces back to the SoN. Therefore, when the number of PNs that can be used is fixed, prematurely changing the PNs will in advance lead to an insufficient of PNs that can be used.