# An Efficient Routing Protocol for Quantum Key Distribution Networks
## 2 The Proposed QOLSR Protocol
### The Proposed QOLSR Protocol
#### 2.3.2 Efficient Path Optimization for QKD Networks  
In addition to efficient link-state awareness as proposed above, QKD networks should also be able to make timely path adjustments based on this awareness. OLSR selects the optimal path based on the minima-hopping method. However, QKD networks are different from traditional networks. Information transmission in QKD networks relies heavily on quantum secure keys. As a result, the path's quality is determined by the remaining quantum secure key resources, the ability to generate quantum secure keys, and the quantum secure key consumption rate. This research assesses the optimal path in terms of the remaining quantum secure key resources, the ability to generate quantum secure keys, and the quantum secure key consumption rate, and proposes an efficient path selection strategy based on key recovery ability. In order to reduce the switching frequency of the communication path, the path with the longest sustainable working time is considered the optimal path. The sustainable working time takes into account the amount of remaining quantum secure key resources, quantum secure key generation capability, and quantum secure key consumption rate. Given the topology of QKD networks, \(N=(V,E)\), where \(V\) is the set of nodes and \(E\) is the set of edges. The quantum secure key rate on each edge is represented by \(\left\{C_{(u,v)}\mid(u,v)\in E\right\}\), where \(\kappa\) is packet size, \(\omega_{(u,v)}^{s,t}(i)\) is traffic on edge \((u,v)\) at time \(i\) when source node \(s\) communicates with destination node \(t\), and \(Cur_{(u,v)}(i)\) and \(Dur_{(u,v)}(i)\) represent the amount of remaining  
Figure 3: The link-state prediction scheme. available quantum secure key resources and the sustainable working time of edge \((u,v)\) at time \(i\), respectively. When the key generation rate is higher than the key consumption rate, the sustainable working time of the link is infinite. When the key generation rate is lower than the key consumption rate, the formula to calculate \(Dur_{(u,v)}(i)\) is:  
\[Dur_{(u,v)}(i)=\frac{Cur_{(u,v)}(i)}{\sum\limits_{s\in V^{\prime} \
eq I\in V^{\prime}}\left(\omega_{(u,v)}^{s,t}(i)\cdot\kappa\right)-C^{{}^{ \prime}}_{(u,v)}}, \tag{1}\]  
where \(\sum\limits_{s\in V^{\prime},t\in V^{\prime}}\left(\omega_{(u,v)}^{s,t}(i) \cdot\kappa\right)\) is used to calculate the total traffic of each communication pair through edge \((u,v)\) at time \(i\). The sustainable working time is calculated based on the current routing protocol. Therefore, if the routing protocol is adjusted according to the calculation result, it will cause uncontrollable negative feedback problems, resulting in unstable communication and low quantum secure key utilization. Thus, this paper suggests using quantum secure key recovery time instead of sustainable working time as a new routing metric. Specifically, sustainable working time refers to the time required for the quantum secure keys in the key pool to be exhausted when the quantum secure key consumption rate is higher than the quantum secure key generation rate. Key recovery time refers to the time required for the key pool to be filled when the quantum secure key generation rate is higher than the quantum secure key consumption rate. With a maximum threshold in the key pool, the amount of quantum secure key resources cannot increase indefinitely. Therefore, the shorter the key recovery time, the closer the key pool is to the full state, and the higher the priority of the link. On the contrary, the longer the quantum secure key recovery time, the closer the key pool is to the empty state, and the lower the priority of the link. Considering that the link priority is inversely proportional to the quantum secure key recovery time, the reciprocal of the quantum secure key recovery time (called the quantum secure key recovery capability) is used to judge link priority.