# Enhancing Communication Security in Drones Using QRNG in Frequency Hopping Spread Spectrum
## 4 Methodology and System Architecture
### Dynamic Hopping Rate Implementation  
The system can adjust the frequency hopping rate \(R_{h}\) based on the perceived threat level. A threat detection module monitors indicators such as increased error rates, signal interference patterns, and unexpected signal strength variations. If the module detects anomalies exceeding predefined thresholds, it can signal the control unit to increase \(R_{h}\) within allowable limits \([R_{h_{\min}},R_{h_{\max}}]\). Conversely, in low-threat environments, \(R_{h}\) is decreased to conserve energy. The threat detection algorithm operates as described in Algorithm 2. ```
1:while Communication is Active do
2: Monitor communication metrics:
3: Bit Error Rate (BER)
4: Signal-to-Noise Ratio (SNR)
5: Received Signal Strength Indicator (RSSI)
6:if Any metric exceeds threshold then
7: Set threat level Threat_Level \(\leftarrow\) High. 8: Adjust hopping rate \(R_{h}\leftarrow\min(R_{h}+\Delta R,R_{h_{\max}})\). 9:else
10: Set threat level Threat_Level \(\leftarrow\) Low. 11: Adjust hopping rate \(R_{h}\leftarrow\max(R_{h}-\Delta R,R_{h_{\min}})\). 12:endif
13:endwhile
```  
**Algorithm 2** Threat Detection and Hopping Rate AdjustmentTo clarify the operation of the Threat Detection Algorithm and address concerns about how often the system updates its threat assessment and adjusts the frequency hopping rate, we provide additional details on the timing and responsiveness of the mechanism. The Threat Detection Algorithm can operate continuously during active communication, monitoring key communication metrics such as Bit Error Rate (BER), Signal-to-Noise Ratio (SNR), and Received Signal Strength Indicator (RSSI). The assessment of these metrics occurs at regular intervals defined by the system's monitoring frequency \(f_{\text{monitor}}\), which can be configured based on the specific requirements and capabilities of the system. In high-security environments, \(f_{\text{monitor}}\) can be set to evaluate metrics every hop interval, allowing the system to detect threats and respond in real-time. Upon detecting that any monitored metric exceeds its predefined threshold, indicating a potential attack or interference, the system increases the frequency hopping rate \(R_{h}\) by a step size \(\Delta R\). The adjustment is immediate and can occur within a single hop interval, enabling the system to respond swiftly to threats. The time it takes to adjust from the minimum hopping rate \(R_{h_{\text{min}}}\) to the maximum hopping rate \(R_{h_{\text{max}}}\) depends on the value of \(\Delta R\) and the frequency of metric assessments. For example, if \(\Delta R\) is set such that \(R_{h}\) increases by a fixed percentage or value each time a threat is detected, and assessments occur every hop, the total time \(T_{\text{adjust}}\) to reach \(R_{h_{\text{max}}}\) is:  
\[T_{\text{adjust}}=\left\lceil\frac{R_{h_{\text{max}}}-R_{h_{\text{current}}}}{ \Delta R}\right\rceil\times T_{\text{hop}} \tag{10}\]  
where \(R_{h_{\text{current}}}\) is the current hopping rate at the time of the first threat detection, and \(T_{\text{hop}}=\frac{1}{R_{h}}\) is the duration of each hop. To prevent rapid oscillations of the hopping rate due to transient fluctuations or false positives, the system may incorporate hysteresis or require that the thresholds be exceeded for a certain number of consecutive assessments before adjusting \(R_{h}\). Additionally, when the threat subsides--indicated by metrics returning below threshold levels--the system decreases \(R_{h}\) gradually to conserve resources, ensuring a balance between security and efficiency. In our current implementation, the dynamic adjustment of \(R_{h}\) in response to detected threats is conceptual and serves to illustrate how the methodology could be applied in real-world scenarios. We consider the integration of real-time threat detection and hopping rate adjustment to be feasible with appropriate hardware and software optimizations.