Deploying a stratum 1 NTP server with a GPS reference clock gives you independent, highly accurate time synchronization without relying on public NTP pools. This guide compares three open-source implementations for managing GPS/PPS reference clocks: NTPsec, Chrony, and LinuxPTP.
What Is an NTP Reference Clock?
An NTP reference clock is a local hardware time source connected directly to your server — typically a GPS receiver with PPS (Pulse Per Second) output. Unlike servers that sync from upstream NTP pools, a stratum 1 server with a reference clock generates its own authoritative time signal from satellite atomic clocks.
Reference clocks provide:
- Independence from internet-based NTP pools and upstream servers
- Sub-microsecond accuracy when using PPS discipline
- Resilience against network outages and GPS spoofing attacks
- Compliance with audit requirements for traceable time sources
GPS receivers output two signals: NMEA sentences (coarse position and time) and a PPS pulse (precise second boundary). The NMEA data gives you time within milliseconds; the PPS signal narrows that down to microseconds.
Comparison: NTPsec vs Chrony vs LinuxPTP for Reference Clocks
| Feature | NTPsec refclock | Chrony refclock | LinuxPTP (ptp4l/phc2sys) |
|---|---|---|---|
| PPS Support | Yes (SHM/PPS) | Yes (PPS/REFCLK) | Yes (PHC/PPS) |
| NMEA Support | Yes (driver 20) | Yes (SHM driver) | Via gpsd bridge |
| GPSD Integration | Yes | Yes | Partial |
| PTP (IEEE 1588) | No | Limited | Native (primary purpose) |
| Stratum | 1 | 1 | 1 (with grandmaster) |
| Accuracy | ~1-10 μs PPS | ~1-10 μs PPS | Sub-microsecond (hardware) |
| Config Complexity | Moderate | Low | High |
| Package Size | ~2 MB | ~1 MB | ~500 KB |
| Active Development | Yes (ntpsec.org) | Yes (chrony-project) | Yes (linuxptp.sourceforge) |
| Docker Deployable | Yes (privileged) | Yes (privileged) | Yes (privileged + cap) |
| Stars / Activity | 278+ (2026-05) | 204+ (2026-04) | 381+ (2026-05) |
Deploying NTPsec with GPS Reference Clock
NTPsec is a hardened fork of the classic NTP daemon, focused on security and modern timekeeping. It includes dedicated reference clock drivers for GPS receivers.
Docker Compose Configuration
| |
NTPsec Configuration (ntpsec.conf)
| |
Key Configuration Notes
flag1 1enables PPS signal processing for the GPS drivertime1andtime2are cable delay corrections (calibrate for your setup)minpoll 3andmaxpoll 4set polling intervals (8-16 seconds) for reference clocks- The
preferkeyword tells NTPsec to prefer this source over others
Deploying Chrony with GPS Reference Clock
Chrony is a modern NTP implementation known for fast convergence and excellent reference clock support. It is the default NTP daemon on many Linux distributions.
Docker Compose Configuration
| |
Chrony Configuration (chrony.conf)
| |
Chrony Advantages
- Fast convergence: Chrony typically synchronizes within seconds of receiving PPS signals
local stratum 1 orphanmode allows serving time even during GPS signal lossrefclock PPSdirective provides native kernel PPS support without SHM overheadlog tracking statisticsprovides detailed discipline metrics for monitoring
Deploying LinuxPTP for Precision Time Protocol
LinuxPTP implements IEEE 1588 Precision Time Protocol (PTP), which achieves sub-microsecond accuracy — significantly better than NTP. It is the right choice when your infrastructure requires hardware timestamping.
Docker Compose Configuration
| |
PTP Configuration (ptp4l.conf)
| |
phc2sys Configuration (phc2sys.conf)
| |
GPS Hardware Setup
All three implementations require similar hardware:
GPS Receiver with PPS output — common choices include:
- u-blox NEO-M8N/M9N module (~$15-25)
- Adafruit Ultimate GPS Breakout (~$40)
- Navisys GR701-W USB GPS (~$80)
USB-to-Serial adapter (if using UART GPS modules)
PPS kernel module — ensure
pps-ldiscandpps-gpioare loaded:
| |
- gpsd — recommended as the GPS daemon that all three NTP implementations can read from:
| |
Monitoring and Verification
Verify your reference clock is working correctly:
| |
Look for:
- Stratum 1 in the output
- GPS or PPS as the reference ID
- Offset under 10 microseconds for PPS-disciplined clocks
- Jitter values in the sub-microsecond range
Choosing the Right Reference Clock Solution
| Scenario | Recommendation |
|---|---|
| Simple NTP stratum 1 server | Chrony — easiest setup, fast convergence |
| Security-hardened NTP server | NTPsec — reduced attack surface, modern security |
| Sub-microsecond precision needed | LinuxPTP — IEEE 1588, hardware timestamping |
| Existing NTP infrastructure | NTPsec — drop-in replacement for classic NTP |
| Mixed PTP/NTP environment | Chrony + LinuxPTP — Chrony serves NTP, PTP handles hardware sync |
Why Self-Host Your Own Time Source?
Running your own stratum 1 NTP server with a GPS reference clock provides several critical advantages for infrastructure operators:
Independence from external time sources. Public NTP pools can be spoofed, rate-limited, or become unavailable during network outages. A local reference clock ensures your infrastructure always has access to accurate time, even when internet connectivity is disrupted. For financial trading systems, telecom networks, and industrial control systems, this independence is not optional — it is a compliance requirement.
Regulatory compliance. Many audit frameworks (PCI DSS, SOX, HIPAA) require traceable, accurate time sources. A GPS-referenced stratum 1 server provides a verifiable chain of custody from atomic clocks to your server logs. This matters during incident investigations, forensic analysis, and compliance audits where timestamp accuracy directly affects the credibility of evidence.
Network performance. Eliminating the round-trip latency to external NTP pools reduces jitter and improves timekeeping stability. For high-frequency trading, distributed databases, and synchronized media production, every microsecond matters.
For broader NTP server configuration, see our NTP comparison guide. For monitoring your time synchronization health, our NTP monitoring guide covers chronyc, ntpviz, and ntpstat. For PTP-specific precision time, our PTP server guide covers grandmaster deployment in detail.
FAQ
What accuracy can I expect from a GPS reference clock?
With NMEA data alone, accuracy is typically 1-10 milliseconds. Adding PPS (Pulse Per Second) discipline improves this to 1-10 microseconds. LinuxPTP with hardware timestamping can achieve sub-microsecond accuracy (100-500 nanoseconds) on supported NICs.
Do I need a dedicated GPS antenna?
For indoor servers, a small active GPS antenna with an SMA-to-U.FL cable works well. For best accuracy, place the antenna with a clear view of the sky. USB GPS dongles with built-in antennas are adequate for most data center deployments.
Can I run these in Docker containers?
Yes, but you need privileged: true, network_mode: host, and device passthrough (/dev/gps0, /dev/pps0). The container also needs SYS_TIME and optionally SYS_NICE capabilities. Some setups require running gpsd on the host and sharing its SHM segments with the container.
What happens when GPS signal is lost?
Chrony with local stratum 1 orphan continues serving time at the last known accuracy. NTPsec marks the reference clock as faulty and falls back to other configured peers. LinuxPTP enters holdover mode, maintaining time based on its oscillator’s stability.
Is a GPS reference clock better than syncing to pool.ntp.org?
For most home labs, pool.ntp.org is perfectly adequate. A GPS reference clock becomes valuable when you need: independence from internet connectivity, regulatory compliance with traceable time, sub-millisecond accuracy, or protection against NTP spoofing attacks.
Can I use a Raspberry Pi as a stratum 1 server?
Yes. The Raspberry Pi 4/5 with a USB GPS module (like the Adafruit Ultimate GPS) makes an excellent low-power stratum 1 server. Connect the GPS PPS output to a GPIO pin, configure the PPS kernel module, and run Chrony or NTPsec.