# An Efficient Routing Protocol for Quantum Key Distribution Networks
## 2 The Proposed QOLSR Protocol
### The Proposed QOLSR Protocol
#### 2.3.1 Efficient Link-State Awareness Mechanism for QKD Networks  
The traffic on each link is dynamic due to the high concurrency and highly fluctuating nature of communication requirements. Furthermore, each link's key generation capability varies, resulting in differences in the quantity of residual key resources on each link throughout communication. The link-state in QKD networks depends on whether there are enough quantum secure key resources in the key pool for communication. During communication, the variable amount of remaining quantum secure key resources regularly causes changes in the link-state. In turn, the topology of QKD networks changes. Link-state awareness must be timely and efficient to overcome the challenge of frequent topology changes. By utilizing a timely and effective link-state awareness mechanism, QKD networks can communicate with high quantum secure key utilization. As mentioned above, in order to enhance quantum secure key utilization in QKD networks, a key pool is set on each link. Considering the limited storage resources, the amount of quantum secure key resources in each key pool has a maximum threshold MAX. A minimal threshold MIN is specified for each key pool to ensure that there are enough authentication keys for key generation. In addition, each key pool also has a warning threshold WARN for link-state awareness. WARN can warn that the link is going to be in a broken state and a new routing path should be calculated in advance. According to the three thresholds, there are three states of the key pool: unavailable, warning, and ready, as shown in Figure 1. In this paper, the link-state is judged through the states of the key pool. The ready state of the key pool indicates that the link is in a healthy communication state. The warning state of the key pool indicates that the link is about to transform to a broken state. The unavailable state of the key pool indicates that the link is in a broken state. In the OLSR protocol, a new routing path is calculated locally when the neighbor routing table or the topology table changes. When the link is disconnected, the neighbor routing table will be changed due to the loss of HELLO packets. Subsequently, the two-hop neighbor table changes, too. This causes further changes in the MPR selector table and topology table. Therefore, timely awareness of the link-state is largely dependent on when HELLO packet loss is sensed. If the HELLO packets sent by neighbor nodes are not received, the OLSR protocol assumes the link is broken due to inadequate quantum secure keys. To communicate the information of broken links to each node in the entire network, numerous TC interval cycles are required. Data packets cannot be transferred normally during this time because the routing path in the routing table is actually inaccessible. To address this issue, this paper proposes a pre-sensed link-state strategy based on the amount of remaining quantum secure key resources, which involves separating communication data packets from routing packets and upgrading the QKD network's HELLO packet transmission mechanism. The workflow of this scheme is shown in Figure 3. In comparison to the original link-state awareness mechanism of OLSR, the red component is the improved version proposed in this paper. The required key pool's information can be retrieved locally using HELLO packets. Therefore, whether the number of remaining quantum secure key resources can meet communication needs can be estimated locally. WARN can anticipate the link-state by comparing the quantity of remaining quantum secure key resources with the warning threshold. If the quantity of remaining quantum secure key resources is less than WARN, the node will not broadcast HELLO packets to neighboring nodes. Communication data packets are sent normally until the amount of remaining quantum secure key resources is lower than the minimum threshold MIN or the communication path is changed.