## 2 Materials and Methods
### Anti-spoofing Method  
Figure 7 shows a general spoofing scenario. The spoofer simulates the observation information of the satellite and broadcasts it from an antenna to the user receiver. In this case, the direction information calculated based on the airspace information is related to the spoofer, not the satellite. In general, the broadcast ephemeris is almost impossible to be deceived, and the real direction information of the satellite can be calculated by using the broadcast ephemeris. The calculated value of satellite direction information can be obtained through the DOA calculation method of four antennas. In the case of not being spoofed, the residual between the expected value and the calculated value of DOA conforms to a Gaussian distribution with zero mean, and the sum of squared residuals conforms to a chi-square distribution. When there are one or more spoofing signals in the receiving signal channel of the receiver, the residual sum of squares conforms to the non-central chi-square distribution. Therefore, SSE can be used to assess whether the receiver is spoofed [34]. The SSE test metric is defined as follows:  
\[SSE=trace\bigg{\{}\Big{[}D_{pcf}-RD_{emu}\Big{]}Q_{N}^{-1}\Big{[}D_{pcf}-RD_{ emu}\Big{]}^{T}\bigg{\}} \tag{23}\]  
where \(D_{pcf}\) is a \([3\times N]\) matrix in the local coordinate frame of the antenna array and \(N\) means the number of satellites. Each column in \(D_{pcf}\) is a unit vector between the satellite and the receiver, denoted as \(\hat{d}_{pcf}^{i}\), and \(i\) represents the number of columns. \(D_{emu}\) is a \([3\times N]\) matrix in the user \(ENU\) coordinate frame. Each column in \(D_{emu}\) is a unit vector between the satellite and the receiver, denoted as \(\hat{d}_{emu}^{i}\). The relationship between \(D_{pcf}\) and \(D_{emu}\) is \(D_{pcf}=RD_{emu}+E\). And \(E\) is a \([3\times N]\) measurement noise matrix. \(R\) is a \([3\times 3]\) unitary rotation matrix. \(Q_{N}\) is a diagonal matrix consisting of the variance of the observation errors, and its diagonal elements are \(\sigma_{1}^{2},\sigma_{2}^{2},\sigma_{3}^{2},\cdots,\sigma_{n}^{2}\). From the definition of the SSE test metric, it can be seen that when the signal direction of the satellite is normal, the SSE test metric obeys the chi-square distribution with a degree of freedom \(k=2N-3\). If there is a spoofing signal in the incoming signals, the SSE test metric obeys the non-central chi-square distribution with the degree of freedom as \(k\) and the non-central parameter as \(\lambda_{1}\). The \(\lambda_{1}\) shows the degree of deviation between the non-central  
Figure 7: Schematic diagram of a spoofing attack. chi-square distribution and the standard chi-square distribution under the same degree of freedom. The binary hypothesis for spoofing detection can be obtained as:  
\[ \begin{array}{l}H_{0}(Real)\ :\ SSS\sim\chi^{2}(k)\\ H_{1}(Spoofing)\ :\ SSS\sim\chi^{2}(k,\lambda)\\ k=(2N-3)\\ \lambda_{1}=\sum\limits_{n=1}^{N}\left(\frac{\Delta g_{n}}{\sigma_{n}}\right)^{2} \end{array}  \tag{24}\]  
where \(\Delta g_{n}\) is the angle difference between the expected value and the calculated value of the \(n_{th}\) signal DOA, which can be expressed as follows:  
\[\Delta g_{n}=\arccos\left(\hat{d}_{pcf}^{n}\cdot\left[R\hat{d}_{eu}^{n}\right]\right) \tag{25}\]  
\(\sigma_{n}\) is the standard deviation of the measurement error, which is related to the elevation angle of the satellite. In [35], the fitting function of the distribution curve between \(\sigma_{n}\) and \(\alpha\) is given as \(\sigma_{n}=2.9e^{-0.0086\alpha}\). According to the Neyman-Pearson criterion, each epoch can set the SSE test metric related to the false alarm rate as the DOA threshold. In this paper, the false alarm rate \(P_{FAR}\) is set to \(10^{-3}\). In the case of 6 satellites, the threshold \(SSE_{th}\) of the SSE test matrix is 27.88. If the calculated value is greater than \(SSE_{th}\), it is considered that the receiver is spoofed.