NTP Stratum 1 Server: Raspberry Pi, GPS and Atomic Time

By Richard DEMONGEOT | January 14, 2026 | Reading time: 12 min
Raspberry Pi with GPS module for NTP Stratum 1 server

Our NTP Stratum 1 server: a Raspberry Pi with a GPS module and PPS signal, at the heart of the RDEM Systems infrastructure.

At the heart of our time synchronization infrastructure lies a small device with remarkable capabilities: a Raspberry Pi equipped with a GPS receiver that provides time with microsecond-level accuracy. This Stratum 1 server serves as the absolute reference for all other NTP servers in our network.

Table of Contents

Understanding the NTP Protocol and Stratum Levels

The Network Time Protocol (NTP) is a protocol designed to synchronize the clocks of computer systems across a network. Developed by David L. Mills at the University of Delaware in the 1980s, NTP is one of the oldest protocols still in use on the Internet.

The fundamental concept of NTP is based on a hierarchy of stratum levels. This architecture ensures that time propagates in an orderly manner, from the most reliable sources down to the end clients.

NTP Stratum Hierarchy

Stratum 0
Atomic clocks, GPS, radio signals
Absolute reference sources - not directly accessible via NTP
Stratum 1
Servers directly connected to Stratum 0
Our Raspberry Pi GPS - Accuracy: < 10 microseconds
Stratum 2
Servers synchronized to Stratum 1
Our public servers ntp1-11.rdem-systems.com
Stratum 3+
Downstream clients and servers
Your servers, workstations, network equipment...
Accuracy and degradation
At each stratum level, accuracy degrades slightly due to network delays and processing inaccuracies. A Stratum 1 server typically offers accuracy of a few microseconds, while a Stratum 2 achieves a few tens of microseconds, and a Stratum 3 a few milliseconds.

Stratum 0: Atomic Time References

Stratum 0 sources are not NTP servers per se. They are physical devices that provide an absolute time reference:

Why is GPS so accurate?
Each GPS satellite carries multiple atomic clocks (cesium and rubidium). The GPS system requires extreme time accuracy because a 1-microsecond error translates into a position error of 300 meters. The PPS signal provided by GPS receivers is synchronized directly to this atomic reference.

Stratum 1: Our GPS Server

Our Stratum 1 server is built around a Raspberry Pi equipped with a GPS module with PPS output. Here is how this setup works:

The GPS Receiver and the PPS Signal

The GPS module provides two types of information:

  1. NMEA data: Text sentences containing position, date and time (accuracy ~1 second)
  2. PPS signal: An electrical pulse precisely at the start of each second (accuracy < 1 microsecond)
cgps output showing GPS satellites and accuracy

Output of the cgps command: 12+ satellites in view, position fixed with accuracy of +/- 8 meters, time offset of 0.257ms.

The combination of both is essential: NMEA provides the current second (but with a variable delay), while PPS provides the exact instant of the second change. The NTP daemon uses NMEA to "know what time it is" and PPS to "know exactly when the second changes".

ntpd Configuration with GPS

In our setup, the ntpd daemon uses shared memory (SHM) drivers to communicate with gpsd:

# /etc/ntp.conf - Stratum 1 GPS Configuration

driftfile /var/lib/ntp/ntp.drift

# Statistics for analysis
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# NMEA source via gpsd (SHM 0) - noselect because less accurate
server 127.127.28.0 minpoll 8 noselect
fudge  127.127.28.0 time1 0.304 time2 0.280 refid NMEA

# PPS source via gpsd (SHM 1) - PRIMARY REFERENCE
server 127.127.28.1 minpoll 1 maxpoll 2 prefer iburst
fudge  127.127.28.1 refid PPS stratum 0

# Stratum 1 validation servers (not public)
# Configuration with several metrological institutes
# for cross-validation of the GPS signal
server [stratum-1-server-A] iburst
server [stratum-1-server-B] iburst
server [stratum-1-server-C] iburst
# ...

# RDEM Stratum 2 servers (cross-validation)
server ntp1.rdem-systems.com iburst
server ntp2.rdem-systems.com iburst
# ... up to ntp10
Why use validation peers?
Even with a GPS, it is recommended to configure trusted external NTP servers. The NTP algorithm uses them to validate that our GPS source is working correctly and to detect potential anomalies (GPS spoofing, hardware failure, etc.).

The NTP Peer Selection Algorithm

NTP does not simply use "the first available source". It implements a sophisticated algorithm to select the best time source among all configured ones.

Selection Metrics

For each source, NTP calculates several metrics:

Metric Description Ideal
Stratum Level in the NTP hierarchy As low as possible
Delay Round-trip time to the server < 50ms
Offset Difference between the local clock and the server < 10ms
Jitter Variation of the offset over time < 5ms
Reach Response history (octal, 377 = 8/8 successes) 377

Interpreting ntpq -c peers

ntpq -c peers output showing NTP sources

Output of ntpq -c peers: the * character indicates the selected source (here PPS), + valid candidates, - rejected outliers.

The characters at the beginning of each line have a specific meaning:

Symbol Meaning
* sys.peer - Source currently selected for synchronization
+ candidate - Valid source, candidate for replacement if the primary fails
- outlier - Source rejected by the selection algorithm (too large a deviation)
# selected - Distance too great, but otherwise acceptable
x falseticker - Source considered to be providing incorrect time

The Intersection Algorithm

NTP uses an intersection algorithm (Marzullo's algorithm) to determine which sources are consistent with each other. The principle is simple: if the majority of sources agree on a time range, the sources that deviate from it are considered "falsetickers" and excluded.

In our setup
The source *SHM(1) .PPS. is selected as the primary reference with an offset of 0.000ms and a jitter of 0.008ms - remarkable accuracy. The PTB and OBSPM servers serve as validation and confirm that our GPS is providing correct time.

Major Reliable Time Sources Worldwide

For a robust NTP infrastructure, it is essential to know the most reliable time sources. Here are the main worldwide references:

National Metrology Institutes (Stratum 1)

Organization Country Access
PTB (Physikalisch-Technische Bundesanstalt) Germany Restricted access / on request
Paris Observatory (LNE-SYRTE) France Restricted access / on request
NIST (National Institute of Standards) USA Restricted access / on request
NPL (National Physical Laboratory) UK Restricted access / on request
Non-public Stratum 1 servers
Stratum 1 NTP servers from national metrology institutes are generally not publicly accessible. Access is reserved for infrastructure operators (ISPs, datacenters, research projects) upon justified request. For end users, Stratum 2 servers from the NTP pool or major providers (Google, Cloudflare) offer more than sufficient accuracy.

NTP Services from Major Tech Companies

Provider Servers Specifics
Google Public NTP time.google.com Leap smearing (smooth leap second handling)
Cloudflare Time time.cloudflare.com NTS (Network Time Security) available
Apple time.apple.com Used by Apple devices
Meta time.facebook.com Leap smearing

The Leap Second

The leap second is a one-second adjustment applied to UTC time to compensate for the gradual slowdown of the Earth's rotation. Unlike atomic time (TAI), which flows perfectly regularly, UTC must remain synchronized with the Earth's rotation (astronomical time).

How does it work?
When the difference between TAI and the Earth's rotation exceeds 0.9 seconds, the IERS (International Earth Rotation Service) announces a leap second, inserted on June 30 or December 31 at midnight UTC. Two possible cases:

Adding a second (positive leap second):
23:59:58 → 23:59:59 → 23:59:60 → 00:00:00
The clock displays 23:59:60 for one extra second.

Removing a second (negative leap second):
23:59:58 → 00:00:00
The second 23:59:59 is simply skipped. (This case has never occurred so far.)

Since 1972, 27 positive leap seconds have been added. The last one was on December 31, 2016. In 2022, the decision was made to abolish leap seconds by 2035.
Why do leap seconds cause problems?
The value 23:59:60 does not exist in most software. Many programs assume that seconds range from 0 to 59, and crash or behave unpredictably when they encounter the value 60. Major incidents have been caused by leap seconds: Linux server crashes (kernel bug in 2012), database malfunctions, application outages.

This is precisely why Google and others invented leap smearing: rather than abruptly inserting an "impossible" second, they spread the adjustment over several hours by slightly slowing down the clock.

For NTP, the leap second is announced via the leap indicator in NTP packets. Stratum 1 servers connected to atomic clocks receive this information and propagate it to their clients. The ntpd daemon automatically handles the insertion of the extra second.

Practical advice
If you use sources with leap smearing (Google, Meta, Cloudflare), use them exclusively. Never mix them with traditional NTP servers in the same configuration, or you risk time discrepancies during leap second events.

The pool.ntp.org Project

The NTP Pool Project is a collaborative initiative that brings together thousands of volunteer NTP servers worldwide. The addresses 0.pool.ntp.org through 3.pool.ntp.org (or their regional variants like fr.pool.ntp.org) automatically redirect to nearby and available servers.

RDEM Systems actively contributes to the French NTP pool with about ten Stratum 2 servers. You can check our reliability score on our official NTP Pool page.

Our Setup in Detail

Hardware Used

Software

Our Infrastructure Architecture

                    [GPS Satellites]
                          |
                    [PPS Signal + NMEA]
                          |
                    [Raspberry Pi - Stratum 1]
                    ntp-0.hq.rdem-systems.com
                          |
            +-------------+-------------+
            |             |             |
    [Stratum 2]    [Stratum 2]    [Stratum 2]
    ntp1.rdem      ntp2.rdem      ntp3.rdem ...
            |             |             |
            +-------------+-------------+
                          |
                    [NTP Pool FR]
                          |
                    [Your servers]

🔍 You can validate your infrastructure's synchronization with check-ntp.net (real-time diagnostics from a third-party network)

Test Your Synchronization

Check that your system is properly synchronized with our Stratum 1 infrastructure.

Test now

Back to home | Our NTP Pool score