# A Self-Diagnosis Method for Detecting UAV Cyber Attacks Based on Analysis of Parameter Changes
## 3 Results and Discussion
Next, it is necessary to analyze the UAV's flight altitude in the normal mode and during an attack since this parameter affects the detection of an attack. Figure 5 shows the result of changing the UAV's flight altitude in the normal mode and during an attack. Figure 4: _Cont._  
In Figure 5, the red line (GPS Altitude) is the UAV flight altitude according to the GPS module, and the blue line (Fused Altitude Estimation) is the estimate of the change in altitude. Fused Altitude Estimation is the result of the state estimator, and so it uses not only the raw GPS data but also the accelerometer. As shown in Figure 4(a), the GPS altitude and the final altitude coincide during normal UAV flight. Figure 4(b) shows that the altitude changes and the GPS altitude graph and the final altitude graph do not coincide during an attack on the GPS. Next, we analyzed the data on the number of satellites that the UAV captures during regular flight and under the influence of an attack, as shown in Figure 6. In Figure 6, the gray line (Num Satellites used) is the number of satellites used. The blue line (GPS Fix) is the state of fixation by satellites. The GPS uncertainty graph shows information from the GPS device. The number of satellites used must be about 12 or higher. Figure 6 shows that the GPS fix (blue line) is constant during normal flight. It means that the drone does not lose communication with satellites and always knows where it is. The average number of satellites used is 18 (gray line). During the attack (Figure 6), communication with satellites is not stable and the number of satellites is constantly changing. You can also see when the UAV loses its GPS fix, the number of satellites used to determine the location is 0. The GPS noise sensor readings are shown in Figure 7. In Figure 7, the red line (Noise per msec) is the GPS noise. The GPS noise and interference graph is useful for checking for GPS signal interference. The GPS signal is very weak and; therefore, can be easily disturbed/jammed by components transmitting (via cable) or transmitting at the frequency used by the GPS. The interference indicator should be around or below 40. Values around 80 or above are too high. Signal interference results in reduced accuracy and less satellite usage. Figure 7 shows that during normal flight the noise does not exceed 105 per ms, but during an attack, this indicator is not stable and at the peak has a value of 300 per ms. So we can conclude that during the attack a high noise level is in the GPS channel. Figure 4: UAV flight trajectories: (**a**) In the normal mode; and (**b**) during a GPS attack. Figure 5: Readings of flight altitude sensors: (**a**) In the normal mode; and (**b**) during a GPS attack. Figure 6: _Cont._  
Figure 8 shows energy consumption. In the normal flight mode, the UAV has an average power consumption of 500 to 1000 mAh. During the attack, we see a strong power  
Figure 6: The state of the parameter indicating the number of GPS satellites: (**a**) In normal UAV flight mode; and (**b**) during a GPS attack. Figure 7: Indication of the level of noise affecting GPS: (**a**) In the normal mode; and (**b**) during a GPS attack. consumption of 10,000 to 40,000 mAh. Thus, we can conclude that the UAV spends much more energy to maintain its flight when it is under attack. Figure 9 shows the measurement result of the condition evaluator. It should be a constant zero. If one of the flags is nonzero, the evaluator has encountered a problem that requires further investigation. In most cases, this is a problem with the sensor, for example, magnetometer interference. Figure 3:0 Energy consumption curves: (**a**) In the normal mode; and (**b**) during a GPS attack. Figure 3:1 _Cont._  
Figure 10 shows the result of measuring the processor load.