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.
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.
Stratum 0 sources are not NTP servers per se. They are physical devices that provide an absolute time reference:
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 module provides two types of information:
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".
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
NTP does not simply use "the first available source". It implements a sophisticated algorithm to select the best time source among all configured ones.
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 |
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 |
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.
*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.
For a robust NTP infrastructure, it is essential to know the most reliable time sources. Here are the main worldwide references:
| 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 |
| 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 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).
23:59:58 → 23:59:59 → 23:59:60 → 00:00:0023:59:60 for one extra second.
23:59:58 → 00:00:0023: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.
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.
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.
[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)
Check that your system is properly synchronized with our Stratum 1 infrastructure.
Test now