# Impacts of GPS Spoofing on Path Planning of Unmanned Surface Ships
## 4 Experiments
### GPS Spoofing Simulation  
We use GPS-SDR-SIM as a GPS signal generator code, which can produce spoofing GPS signals. GPS-SDR-SIM is an open-source GPS generator project. To make it easier for readers to understand GPS spoofing, we introduce the process of GPS spoofing step by step. We download and compile the GPS simulator code from GitHub, as shown in Figure 14. Then, we can generate GPS longitude and latitude information that we want to spoof through online tools and generate GPS simulation data through GPS simulator according to this longitude and latitude information, as shown in Figure 15. Among them, 31.60321167 and 120.4666667 are the GPS longitude and latitude of spoofing to be transmitted to the GPS receiver. After the execution of the above command, the gpssim.bin file is generated, which saves the GPS spoofing data generated by the simulation code, as shown in Figure 16. The GPS test app for mobile phones is GPS Test Plus. Before starting the GPS spoofing attack, open the app of GPS Test Plus and check the physical position of the mobile phone, as shown in Figure 17. \begin{table}
\begin{tabular}{l l} \hline \hline
**Item** & **Value** \\ \hline Hardware & HackRF ONE \\ Operation System & Ubantu 64 bit \\ Network & China Mobile LTE, China Unicom LTE \\ Antenna & 700–2700 MHZ \\ Clock & GPS external clock \\ GPS Receiver & Xiaomi 6 mobile phone \\ Test App & GPS Test Plus 1.5.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Experimental environment of GPS spoofing. Figure 12: A simple GPS spoofer. Figure 13: The test system of the hardware. Figure 16: Generation of GPS spoofing data. Figure 17: Physical position of test mobile phone. Figure 14: GPS-SDR-SIM download and compile. Figure 15: GPS spoofing location. HackRF ONE is a full open-source hardware and software project that can provide Software Defined Radio (SDR) solutions. The wireless communication protocol based on software definition can replace the hardware connection so that the frequency band, air interface protocol, and function can be upgraded through software download and update without replacing the hardware. We use HackRF ONE to transmit the fake GPS data we simulated above, as shown in Figure 19. After waiting for 3-4 min, we open the app of GPS Test Plus and find that the mobile phone position has been changed to a fake GPS spoofing position, as shown in Figure 20.  
The purpose of a GPS spoofing attack based on the APF method is to cause lateral deviation in the position of the ship's navigation trajectory so that the ship deviates from the original path planning, as shown in Figure 22.  
We take a practical example to illustrate the harm of GPS spoofing to unmanned ships using the APF method for path planning. Without the repulsive force of obstacles, we assume that the physical location of OS \(x=(0,0)\), the false location of OS \(x^{\prime}=(2,0)\), the goal location \(x_{g}=(5,5)\), and the step is 1, shown as in Figure 12:0 Without GPS spoofing, the next position of OS based on APF is \(x_{1}=(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}})\). Under GPS spoofing, the next position of OS based on APF is \({x_{1}}^{\prime}=(\frac{3}{\sqrt{34}},\frac{5}{\sqrt{34}})\). In conclusion, GPS spoofing can cause the yaw of unmanned ships using the APF method for path planning. In the environment of both attraction of goal and repulsion of an obstacle, the attacker can influence the result of path planning based on the APF method through GPS spoofing. We use a practical example to illustrate the influence of GPS spoofing on path planning results by the APF method. In the Cartesian coordinates, we assume that \(x_{g}=\) (10,10) is position of the goal, \(x=\) (0,0) is the initial position of OS, \(x_{o_{1}}=(4,8)\) and \(x_{o_{2}}=(\frac{1}{5},-\frac{1}{5})\) are the positions of the first obstacle and the second obstacle, respectively. \(k=50\) and \(m=15\) are the attraction gain and the repulsive gain, respectively, \(l=0.2\) is the step length of OS. \(\rho_{0}=0.5\) is the influence distance of obstacles.