# Primary User Emulation Attacks: A Detection Technique Based on Kalman Filter
## 3 Experiments and Results
As it can be seen from this figure, this function remains almost constant when the measurement noise values are less than 0.02, and it increases exponentially after that value. For measurement noise values equal to 0.2 and 0.07, the error function is 0.1 and 0.11, respectively. When the measurement noise is greater than 0.3, the error function increases exponentially. For instance, when the measurement noise is equal to 7, the error function is equal to 10 and when this measurement noise increases to 8.5, its corresponding error function value rises to 15. These results suggest that measurements noise values that are less than 0.2 are the optimal values for the experiments since they reduce the error between the actual and the predicted trajectory leading to a better estimation of the primary user position. Thus, we selected 0.05 for conducting the remaining experiments. Figures 3 and 4 show the scenario used for simulating the mobile primary user, the fixed PUE attacker, secondary users, and anchor nodes. In Figure 3, the red symbols represent the measurements collected by the anchor nodes regarding the movement of the primary user. Due to the measurement noise, these collected measurements are not precise enough to accurately predict the primary user trajectory. From Figure 4, it can be seen that after using the optimal measurement noise value selected previously, which is 0.05, and by applying the Kalman filtering process, the predicted trajectory is close to the actual one. These results suggest that the secondary users can use the collected measurements with the Kaman filter to accurately predict the position of a mobile primary user. Figure 2: Error function as a function of the measurement noise. Figure 5 shows the probability of detection as a function of the distance, d\({}_{\text{pu\_pue}}\) between a mobile primary user and a primary user emulation attacker for different SNR values. As one can see, the probability of detection increases as the distance between the primary user and the attacker increases. For example, for an SNR value of \(-10\) dB, the probability of detection is equal to 37% when the distance between the primary user and the attacker is 50 m, but this probability increases to 60% when the distance is equal to 100 m. In addition, this figure shows that the probability of detection increases with the increase of SNR values. For instance, for a distance of 50 m between the PU and the PUE attacker, the probability of detection is equal to 37%, 80%, 96%, 99.2%, and 99.7%, for SNR values corresponding to \(-10\) dB, \(-5\) dB, \(0\) dB, 5 dB, and 10 dB, respectively. Figure 4: Simulation scenario of the mobile PU, the fixed PUE, SUs, and anchor nodes. The red symbols represent the predicted PU path after applying Kalman filtering with an optimal measurement noise value. Figure 3: Simulation scenario of the mobile primary user the fixed primary user emulation attacker, secondary users and anchor nodes. The red symbols represent the collected measurements gathered by the anchor nodes. Figure 6 shows the probability of detection as a function of the probability of false alarm for a distance \(\mathrm{d}_{\mathrm{pu\_pue}}\) = 30 m between the primary user and the primary user emulation attacker. As it can be observed, the probability of detection increases with the increase in the probability of false alarm. For example, for an SNR value of \(-15\) dB and with a probability of false alarm of 10%, the probability of detection is 16%, but when the probability of false alarm increases to 30%, the probability of detection is equal to 61%. In addition, with the increase of the SNR value, the probability of detection increases. For instance, with a probability of false alarm of 2%, the probability of detection is equal to 39%, 63% 90%, 99%, and 100% for SNR values corresponding to \(-15\) dB, \(-10\) dB, \(-5\) dB, 0 dB, and 5 dB, respectively.