../gps
GPS protocol
Details
This note is for an RF challenge. I only cover what a basic legacy receiver (L1 C/A, L2 P(Y)) sees — not L2C/L5.
Frame
A GPS “frame” (LNAV subframe) = 5 frames × 10 words × 30 bits = 1500 bits total.
Frame 1 | Frame 2 | Frame 3 | Frame 4 | Frame 5 |
---|---|---|---|---|
Clock & status | Ephemeris 1/2 | Ephemeris 2/2 | Almanac 1/2 | Almanac 2/2 |
Header
Each frame starts with 2 header words (time refs + housekeeping).
Every 30-bit word ends with 6 bits parity (Hamming, shortened).
Word 1
Preamble | Message | Integrity | Reserved | Parity |
---|---|---|---|---|
8 b | 14 b | 1 b | 1 b | 6 b |
Word 2
TOW* | Alert | Anti-Spoof | ID | Padding | Parity |
---|---|---|---|---|---|
17 b | 1 b | 1 b | 3 b | 2 b (t) | 6 b |
Details
- Preamble: fixed pattern
10001011
. - Message: not used here.
- Integrity: 0 = legacy, 1 = enhanced.
- Reserved: ignore.
- Parity: 6-bit Hamming (each word).
- TOW: start time of the next frame (6 s step).
- Alert: 1 = URA not guaranteed (use with caution).
- Anti-Spoof: 1 = P-code encrypted (Y-code); 0 = clear (rare).
- ID: subframe index
[1..5]
. - Padding (t): non-informational bits used by parity.
Frame 1 : Clock and status
Word 3
WN | L2 code | Accuracy (URA) | Health | IODC (MSB) | Parity |
---|---|---|---|---|---|
10 b | 2 b | 4 b | 6 b | 2 b | 6 b |
Word 4
L2 P-data | Reserved | Parity |
---|---|---|
1 b | 23 b | 6 b |
Word 5
Reserved | Parity |
---|---|
24 b | 6 b |
Word 6
Reserved | Parity |
---|---|
24 b | 6 b |
Word 7
Reserved | TGD | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 8
IODC (LSB) | t_oc | Parity |
---|---|---|
8 b | 16 b | 6 b |
Word 9
af2 | af1 | Parity |
---|---|---|
8 b | 16 b | 6 b |
Word 10
af0 | Padding | Parity |
---|---|---|
22 b | 2 b (t) | 6 b |
Details
- L2 code:
01
= P-code on L2; 10
= C/A on L2; others = invalid. - WN (week number): GPS week mod 1024 (since 1980-01-06).
- L2 P-data:
0
= data ON on L2/P; 1
= data OFF. - Accuracy (URA): error bound index; e.g.
0000
→2.4 m, 0100
→9.65 m, 1111
→no prediction. - Health: 3 MSB = L1 state, 3 LSB = L2 state:
000
healthy, 001
bad timing, 010
bad signal, 011
bad nav data, 111
out of service (others reserved). - TGD: L1–L2 group delay (seconds), signed Q0.31 on 8 bits.
- IODC: Issue Of Data — Clock (dataset version).
- t_oc / af0..2: clock model reference & coefficients.
Correction polynomial:
Δt_sv(t) = af0 + af1·(t − t_oc) + af2·(t − t_oc)^2
.
Details
- L2 code:
01
= P-code on L2;10
= C/A on L2; others = invalid. - WN (week number): GPS week mod 1024 (since 1980-01-06).
- L2 P-data:
0
= data ON on L2/P;1
= data OFF. - Accuracy (URA): error bound index; e.g.
0000
→2.4 m,0100
→9.65 m,1111
→no prediction. - Health: 3 MSB = L1 state, 3 LSB = L2 state:
000
healthy,001
bad timing,010
bad signal,011
bad nav data,111
out of service (others reserved). - TGD: L1–L2 group delay (seconds), signed Q0.31 on 8 bits.
- IODC: Issue Of Data — Clock (dataset version).
- t_oc / af0..2: clock model reference & coefficients.
Correction polynomial:
Δt_sv(t) = af0 + af1·(t − t_oc) + af2·(t − t_oc)^2
.
Frame 2 : Ephemeris 1/2
Word 3
IODE | C_rs | Parity |
---|---|---|
8 b | 16 b | 6 b |
Word 4
Δn | M₀[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 5
M₀[23..0] | Parity |
---|---|
24 b | 6 b |
Word 6
C_uc | e[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 7
e[23..0] | Parity |
---|---|
24 b | 6 b |
Word 8
C_us | √A[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 9
√A[23..0] | Parity |
---|---|
24 b | 6 b |
Word 10
t_oe | Fit | AODO | Padding | Parity |
---|---|---|---|---|
16 b | 1 b | 5 b | 2 b (t) | 6 b |
Details
- IODE: ephemeris dataset version (matches IODC LSBs when clock/orbit uploaded together).
- C_rs / C_us / C_uc: harmonic corrections (radius / arg. of latitude). Units:
C_rs
in m (Q11.5);C_us/C_uc
in rad (Q3.29). - Δn: mean motion delta (semi-circle/s, Q1.43).
- M₀: mean anomaly at epoch (semi-circle, Q1.31).
- e: eccentricity (Q0.33).
- √A: sqrt of semi-major axis (√m, Q13.19).
- t_oe: ephemeris epoch (seconds of week, 16 s step).
- Fit:
0
=4 h,1
=>4 h. - AODO: Age Of Data Offset (900 s step).
- Padding (t) / Parity: as above.
Frame 3 : Ephemeris 2/2
Word 3
C_ic | Ω₀[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 4
Ω₀[23..0] | Parity |
---|---|
24 b | 6 b |
Word 5
C_is | i₀[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 6
i₀[23..0] | Parity |
---|---|
24 b | 6 b |
Word 7
C_rc | ω[31..24] | Parity |
---|---|---|
16 b | 8 b | 6 b |
Word 8
ω[23..0] | Parity |
---|---|
24 b | 6 b |
Word 9
Ω̇[23..0] | Parity |
---|---|
24 b | 6 b |
Word 10
IODE | IDOT | Padding | Parity |
---|---|---|---|
8 b | 14 b | 2 b (t) | 6 b |
Details
- C_ic / C_is: inclination harmonic terms (rad, Q3.29).
- Ω₀ / Ω̇: RAAN at epoch / RAAN rate (semi-circle, Q1.31 / semi-circle/s, Q1.43).
- i₀: inclination at epoch (semi-circle, Q1.31).
- C_rc: radius harmonic term (m, Q11.5).
- ω: argument of perigee (semi-circle, Q1.31).
- IDOT: rate of inclination (semi-circle/s, Q1.43).
- IODE: repeat of same ephemeris version.
- Padding (t) / Parity: as above.
Frames 4–5
Constellation/almanac pages. Not needed for my use case.