# Detecting and Mitigating Attacks on GPS Devices
## 3 GNSS Overview
### GPS System
Each satellite's unique PRN code is orthogonal to all other PRN codes, meaning each PRN code will not correlate with any other satellite's PRN code. Each C/A code chip corresponds to 293 m of distance; therefore, the receiver tracking this code will result in a range estimation  
Figure 1: GPS trilateration for position estimation. no worse than 293 m and better in most cases. The Precision Code, or P-code, is a sequence of 6.187104 \(\times\) 10\({}^{12}\) chips transmitting at a rate of 10.23 million chips per second (Mcps) and repeating once a week. Receivers can use the C/A code for course range estimation and the P-code for higher resolution range estimation. The original (legacy) GPS signal and messaging structure are depicted in Figure 2[28]. The L2 carrier also has a W-code that is applied to the P-code at approximately 500 bps, the details of which are secret. This code is meant for US military usage; however, modern two-channel commercial GPS receivers can also track the L2 signal without knowing the W-code. These commercial receivers are more expensive and uncommon in consumer applications. A secure M-code in newer Block III GPS satellites is used for military applications that aim to improve the anti-jamming and secure access of military GPS signals. Receivers will demodulate the BPSK signal and process the NAV message to determine the time and location of the transmitting satellite. The receiver can then estimate the transmission delay and consequently estimate the range of the satellite. The receiver can estimate its 3D position once it can receive at least four satellite transmissions and estimate the range of each satellite. GPS receivers utilize different aspects of the GPS signal to estimate range and position. Receivers utilize two primary observables to estimate the distance between the satellite and receiver: (1) code and (2) phase. The process previously described is code-observable; however, accessing the NAV message does not generally yield highly accurate results. This level of accuracy may be sufficient for some applications; however, additional precision can be obtained through the phase observable, where the unmodulated carrier phase is estimated by the receiver. Receivers can use the Doppler shift as another observable. The type and sophistication of processing vary across receivers based on several factors, including the required accuracy and desired cost point. The position estimate is presented as its solution, along with several metrics that convey confidence in that estimate once the receiver has processed the signals. The receiver provides the Dilution of Precision (DOP) metric and is intended to reflect the quality of the satellite geometry and the resulting data uncertainty. Position DOP (PDOP) is another key metric that reflects the uncertainty of the overall position estimate. Horizontal DOP (HDOP) and Vertical DOP (VDOP) reflect the uncertainty in the horizontal and vertical components of the 3D position estimation. Higher values of DOP and PDOP generally mean a more accurate position estimate. DOP and PDOP typically increase as the number of visible GPS satellites increases, such as when the number of GPS satellites for which the signal can be successfully demodulated and processed increases, the geometry of the GPS satellites is more advantageous, and GPS receive signal strength (RSS) is higher. Figure 2: Legacy GPS signaling and messaging structure.