Where does your computer get its time from?


Tony Finch created a fun presentation about where the time comes from. You might think that it comes through the NTP (network time protocol), but where does that come from in turn?

4 Likes

For the answer to the immediate question:

$ chronyc
chrony version 4.2
chronyc> sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^- alphyn.canonical.com          2  10   377   781    +20ms[  +21ms] +/-  145ms
^- prod-ntp-4.ntp1.ps5.cano>     2  10   257   652   -159us[  +47us] +/-   13ms
^- prod-ntp-5.ntp1.ps5.cano>     2  10   367   756    +50us[ +255us] +/-   17ms
^- prod-ntp-3.ntp1.ps5.cano>     2  10   373   385  -1001us[ -792us] +/-   18ms
^* ntp.hb9trx.ch                 1  10   377   167   +106us[ +318us] +/- 2603us
^- time.cloudflare.com           3  10   377   819  +1485us[+1688us] +/-   16ms
^- phouchg.0x2a.io               2   8   377   113   -648us[ -648us] +/-   18ms
^+ ns2.pmodwrc.ch                2  10   377   345   -165us[  +46us] +/- 7199us

“Stratum” indicates the logical distance of the server from GPS-derived time (or, originally, servers with their own atomic clock source). A stratum 1 source is directly connected to GPS time, a stratum 2 source derives its time from a stratum 1 server, etc.

If your Linux machine uses ntpd for time synchronisation instead of chronyd, use ntpq and peers to obtain the list of servers.

7 Likes

I haven’t looked at DIY stratum-1 time servers for a while, but here’s one you can use with an RPi CM4 module if you want to pay scalper prices for the CM4.

From the omniscient, but only partially disclosing, Dr. Google there’s many articles on building your own cheap gps powered ntp server. Never know when you might need to keep your home network PCs within a microsecond or so of real time. Now I’m retired I only need to be within a few ms.

Hmm, there’s a pile of ESP32 modules in the parts bin…

2 Likes

I recommend the Time Machines TM2000B to my industrial clients. The key is that in addition to NTP, it provides PTP, the Precision Time Protocol (IEEE 1588). For off-the-shelf hardware on a LAN, common synchronization to within single digit microseconds of GPS time is typical.

{ Happy customer. }

4 Likes