# Cyberattack on Flight Safety: Detection and Mitigation Using LoRa
## 4 Simulator and Field Experiment
### Wireless Sensor Network Experiments  
This experiment was designed to test the feasibility of a WSN deployed in a given environment (Figure 8). Each node on the network contained a LoRa SX1280 2.4 GHz communication component, as well as an Arduino controller and a battery (Figure 9). Before the start of the experiment, the nodes that participated in the experiment were initialized and given a unique address. In addition, an initial adjustment of the communication component between both nodes in the network was made. This fine adjustment was required to increase the accuracy of the distance measurement. The adjustment was performed only once and was stored in the node memory. The nodes operated autonomously and managed their energy use. Occasionally, they conducted an interrogation of other nodes in the network, and if these nodes responded positively, they performed a distance measurement and stored the data in their memory. To preserve the network messages, a gateway node was setup, whose function was to receive network messages and store them in a cloud database. Figure 8: The layout of the nodes in the university area, as well as the distances between the nodes after the network started operating. Figure 7: The large-scale simulator built for this study. These images display a simulation of the sense and avoid protocol for two aircraft. At the end of the distance measurement, the node published its distance table to the network to allow other nodes verify their relative position with the use of the table. That is, when Node A reported that was at a certain distance from Node B, Node B performed a distance measurement and verified that it was indeed at the same distance as Node A had published. Similarly, Node B performed the same action with the rest of the nodes within its range. If a node found a different distance with respect to another node, it concluded that there was a problem and therefore temporarily suspended itself in the network. The results showed that the distance table (Table 1) published by the nodes was similar to the distance table measured with the GPS (Table 2) within \(\pm 10\%\). The distance between the aircraft flying in a controlled airspace is usually several kilometers; therefore, we compared the accuracy level of the LoRa SX1280 2.4 GHz for longer distances compared to the GPS using weather balloons. The distance measurements performed using this component and during the flight of the balloon (Figure 10) showed that they matched the GPS data obtained simultaneously with the beacon. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Device** & **D1** & **D2** & **D3** & **D4** \\ \hline D1 & - & 250.2 & 252.8 & 416.2 \\ \hline D2 & 248.4 & - & 230.2 & 344.8 \\ \hline D3 & 242.9 & 242.9 & - & 219.2 \\ \hline D4 & 431.8 & 288.7 & 312.0 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distance measurement results using LoRa SX1280 2.4 GHz. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Device** & **D1** & **D2** & **D3** & **D4** \\ \hline D1 & - & 244.0 & 245.0 & 423.0 \\ \hline D2 & 244.0 & - & 276.0 & 312.0 \\ \hline D3 & 245.0 & 276.0 & - & 228.0 \\ \hline D4 & 423.0 & 312.0 & 228.0 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Distance measurement results using GPS. Figure 9: Several nodes were built to take part in the WSN field experiments. Table 3 shows a summary of the GPS data with the distance measurement data. The results showed that at distances exceeding 80 km, the error was up to \(\pm\)10%. At the same time, the measurement results showed that as the distance increased, so did the level of accuracy. However, an accuracy level of \(\pm\)10% is not sufficient for aircraft moving at distances of tens of kilometers, and therefore, more work is required to increase the accuracy level. Nevertheless, this experiment proved that it was feasible to use the setup in aircraft flying distances of tens of kilometers. Performing a distance measurement between two nodes requires the use of the radio component.