## 5 Simulation Results  
In the QKD network topology, when the service arrives, the key service is numbered to distinguish it from other services. The start time and duration of the services obey Poisson distribution. The source node \(s_{r}\) and destination node \(d_{r}\) of services are both randomly generated. The time slot required for the service expresses the demand of the service for the key. For the link of QKD network topology, the remaining time slot of the current link represents the number of keys that can be provided by the link at this time. \(\eta\) indicates the percentage of the limited key protection threshold. The blocking rate of key service requests of the working path and the successful construction rate of the protection path are the data measuring the effect of the protection strategy. On the link of the QKDN, the channel can include multiple wavelengths which are set as \(n\). Each wavelength channel can be divided into \(m\) time slots. According to the number of keys generated in each time slot, the remaining time slot of the current link can be calculated by detecting the wavelength time slot resources in each fiber and the time slot required for the key unit time. In this study, the protection scheme designed in a QKDN with partially trusted relay was simulated and verified in Intellij IDEA using Java language. The algorithm was completed on NSFNET topology and USNET topology, which are shown in Figure 4. The NSFNET topology has 14 nodes and 21 links, with the longest link length being 1140 km, while the USNET topology has 24 nodes and 43 links. In the process of algorithm verification, a total of 105 randomly generated services run on the topologies. In the two topologies, we conducted the simulation in three cases. The independent variables are the generation rate of key resources on the link, the number of untrusted nodes in the topology and the correlation percentage of key protection threshold \(\eta\). The dependent variables are blocking rate of key service requests and protection path construction success rate. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Service** & **Calculated Paths** & **Selected Path** \\ \hline  & 1-2-6 & \\  & 1-4-2-6 & Working path \\  & 1-4-5-6 & 1-2-6 \\  & 1-2-3-6 & Protection path \\  & 1-2-4-5-6 & 1-4-2-6 \\  & 1-4-2-3-6 & \\ \hline  & 2-4-5 & Working path \\  & 2-6-5 & 2-6-5 \\  & 2-1-4-5 & Protection path \\  & 2-3-6-5 & 2-3-6-5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The operation of the services in the TAPS-PTR. In order to observe the data more intuitively, the number of untrusted nodes in the NSFNET topology was set to 2. As shown in Figure 5a,b, the impact of the change of key resources and protection threshold on the blocking rate of key service requests was tested. It can be seen from the simulation results that with the increase in key resources provided by the link, the blocking rate of key service requests of each curve decreases. On the curve of \(\eta=0.3\), when the link generation key resource rate is the highest, the blocking rate of key service requests can be reduced to close to 0. However, when \(\eta\) is higher, the blocking rate of key service requests increases. The reason is that the key protection threshold rises with the increase in \(\eta\). When the protection threshold rises, theoretically more protection paths are constructed, competing for the limited key resources with subsequent services. In USNET, the number of untrusted nodes was set to 3. The results show that the changes of curves are similar to those in NSFNET. The blocking rate of key service requests decreases significantly with the increase in key resources. When the key resource generation rate of the link is 80 unit/s, the blocking rate of key service requests can be reduced by at least 0.5% whenever \(\eta\) is reduced by 0.1. In this case, the key generation rate of the link is set to 80 unit/s in both NSFNET and USNET topologies.