A quick intro to NTP (Network Time Protocol)
Published by marco on
Although this eight-minute video’s title is a misnomer—NTP isn’t an obscure system, in that it is incredibly well-documented—it is still a reasonably informative and entertaining explainer.
The Obscure System That Syncs All The World’s Clocks by Half as Interesting (YouTube)
The system is called NTP—the Network Time Protocol—and comprises four tiers.
- Tier 0 is Atomic clocks, which measures the resonant frequency of Cesium atoms to obtain a regular “ticking” from nature itself.
- These are attached to servers in Stratum 1, usually a machine that is on-site.
- These are, in turn, attached to Stratum 2 servers, things like
time.windows.com
orpool.ntp.org
. - Any machines that we use are almost certainly in Stratum 3, which are connected to Stratum 2 machines.
The machines coordinate between layers by relying primarily on their local clocks (usually kept running run by a CMOS battery on what passes for a motherboard) and re-synchronizing occasionally by “pinging” the layer above. They account for lag by including time sent and time received in messages, so that the sending system has four times with which to calculate the current time.