# Spoofing Traction Strategy Based on the Generation of Traction Code
## 2 Materials and Methods
### Proposed Strategy Spoofing traction strategy based on the generation of traction code
#### 2.3.4 Data Processing  
Whether in the simulation or experiment, the local code phase is not directly known, and it must be obtained using the following formula:  
\[\tau_{1}(\mathrm{n})=\tau_{0}+T_{\mathrm{coh}}\cdot\sum_{i=1}^{n}\mathrm{cd_{i }(i)}, \tag{28}\]  
where \(\tau_{0}\) is the initial code phase obtained from acquisition. The phase difference diagram can be obtained by subtracting \(\tau_{1}\) from \(\tau_{\mathrm{a}}\) and \(\tau_{\mathrm{s}}\), respectively.  
Once we obtain the tracking results, we must determine whether the spoofing traction was successful. For spoofing, whose frequency is locked to the genuine signal, we want \(\tau_{\mathrm{sl}}\) to be 0 to demonstrate that the code loop traction is successful, and for spoofing that maintains the code-carrier coherence, we also want \(f_{\mathrm{sl}}\) to be 0 to demonstrate that the carrier loop traction is successful. These results can be expressed using the following formulas:  
\[T_{1}=\mathrm{sgn}\{\log|\tau_{\mathrm{sl}}|\} \tag{29}\]  
\[T_{2}=\mathrm{sgn}\{\log(|\tau_{\mathrm{sl}}|+|f_{\mathrm{sl}}|)\} \tag{30}\]  
If T\({}_{1}\) (or T\({}_{2}\)) is less than 0, traction succeeds; otherwise, traction fails.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**No.**} & \multirow{2}{*}{**Strategy**} & \multicolumn{3}{c}{**Spoofer**} & \multicolumn{2}{c}{**Channel**} & \multicolumn{1}{c}{**Receiver**} \\ \cline{3-8}  & & \multicolumn{2}{c}{**Traction Duration (s)**} & \multirow{2}{*}{**Traction Duration (s)**} & \multirow{2}{*}{**v\({}_{\mathrm{drag}}\) (cps)**} & \multirow{2}{*}{**h\({}_{\mathrm{max}}\)**} & \multirow{2}{*}{**C/N\({}_{0}\) (dBHz)**} & \multirow{2}{*}{**D (Chips)**} \\ \cline{3-8}  & & & & & & & 30 & 1 \\ \hline
1 & & & & & & 40 & 1 \\ \hline
2 & & & & & & 50 & 1 \\ \hline
3 & \(1\) & & & & & 50 & 0.2 \\ \hline
4 & & & & & & 60 & 1 \\ \hline
5 & & & & & & 3  
Given the maximum traction speed \(\mathrm{v_{drag\_max}}\) for a given strategy, the shortest time required for deceptive traction can be calculated using the following formula:  
\[\mathrm{t_{c\_min}}=\frac{1+\mathrm{d}}{\mathrm{v_{drag\_max}}} \tag{31}\]  
Because there are several detection methods included in TOA and power detection, this study attempts to use a simple statistical analysis method and the SQM method as examples to verify the detection quantity. If we perform a statistical analysis on observation X, the RMSE statistic is:  
\[\mathrm{RMSE}=\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left(\mathrm{X}_{i}-\mathrm{X} _{0_{i}}\right)^{2}}, \tag{32}\]  
where \(\mathrm{X}_{0_{i}}\) are the fitting values of the genuine signal observations. To reflect the influence of the spoofing signals of each strategy on the RMSE, the RMSE values are calculated as follows:  
\[\mathrm{Percentage}_{\Delta i}=\frac{\mathrm{RMSE}_{i}-\mathrm{RMSE}_{0}}{ \mathrm{RMSE}_{0}}\times 100\% \tag{33}\]  
where \(\mathrm{RMSE}_{0}\) represents the RMSE statistic of the genuine signal observations.  
In the SQM technique, we used a Ratio Test metric to identify correlation distortions. The Ratio Test metric is:  
\[\mathrm{R_{SQM+}}=\frac{\mathrm{E}+\mathrm{L}}{2\mathrm{P}}, \tag{34}\]  
where E, L, and P denote early, late, and prompt correlator outputs over the in-phase branch, respectively.  
To observe fluctuations, we uniformly subtracted the ideal value of metric 1/2 from the metric when plotting.