# An On-Demand Fault-Tolerant Routing Strategy for Secure Key Distribution Network
## 5 Simulations and Discussion
### Simulation Environment  
We use the ns3 simulator to compare the proposed solution with OSPF, the adaptive stochastic routing (ASR) [28] and the multi-path communication scheme (MPCS) [38]. BRITE [39] is used to generate a random topology under the Waxman model, in which nodes and links are randomly distributed in the grid to ensure that the evaluation of the method based on the simulation results is independent of the specific network structure. Table 1 shows the parameters used in the simulation. The simulation time was 100 s for each simulation and 20 simulations were run to obtain the average value. We will consider the following two scenarios representing malicious fault in the communication key distribution phase and path discovery phase, respectively. One is the black hole attack (BHA), where the faulty node participates in path discovery normally while performing uniform random selective packet loss; the second is the traffic redirection attack (TRA). Based on BHA, it interferes with the path discovery process involved, and the faulty node falsely reports its local key status, which will cause nodes to select a path containing faulty nodes for key distribution with a greater probability.  
Performance metrics including packet delivery ratio, key material utilization, corrupted key ratio, and hop count can be used to assess the availability and reliability of routing strategy within the specified simulation environment, as described below.  
**Packet Delivery Ratio**: This metric is the ratio of communication keys successfully received by the destination to all communication keys sent by the source during the simulation. This is used to evaluate communication key distribution performance under fault scenarios.  
**Key Material Utilization**: This metric is the ratio of local keys consumed by successfully received communication keys during the simulation to the total consumption of local  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Waxman parameters & \(\alpha=0.1,\beta=0.1\) \\ Number of nodes & 40/60/80/100 \\ Number of source-destination pairs & 8/12/16/20 \\ Ratio of the number of faulty nodes & 0/0.05/0.1/0.15/0.2/0.25/0.3/0.35/0.4 \\ Acknowledgment rate threshold & 0.5 \\ Error rate & \([0,0.5]\) \\ Constant bit rate & \([0.5,1.5]\) Mbps \\ Piecewise linear function parameters & \(a=0.1,b=0.6,c=0.9,d=0.2\) \\ Important factor of \(\epsilon_{1},e_{2},e_{3}\) & \(3,3,6\) \\ Important factor of evidence collected in the & 3 \\ fault detection process & 3 \\ \(K_{gen},K_{cur},K_{max}\) & \([0.5,1.5]\) Mbps, \([1,25]\) MB, 100 MB \\ \hline \hline \end{tabular}
\end{table}
Table 1: Simulation setup.  
keys. It can reflect the key utilization rate and certain routing overhead, reflecting the availability of the routing strategy.  
**Corrupted Key Ratio**: The metric is the proportion of successfully received communication keys that have passed faulty nodes during the simulation. This reflects the confidentiality of communication keys successfully distributed in fault scenarios.  
**Hop Count**: This metric is the average forwarding number of successfully received communication keys during the simulation. This reflects the effectiveness of the path discovery mechanism with a certain key distribution delay and improved fault tolerance.