Physical Clock Synchronization — Clock Series
In my last article, we discussed the various types of physical clocks. We discussed the accuracy offered by those clocks, and how UTC time is derived from TAI & UTI. We also discussed the concept of Leap Second, which is applied to UTC to accommodate for irregularities and the long-term slowdown in the Earth’s rotation.
NTP — Network Time Protocol
Before going into how leap seconds are applied, let’s talk about NTP!
NTP is an internet protocol used to synchronize with computer clock time sources in a network. NTP leverages UDP protocol over port 123, to synchronize clocks within a few seconds of the UTC time.
Each computer(OS) comes with the NTP Package. The NTP package contains a background program (daemon or service) which synchronizes the computer’s system time to one or more external reference time sources. Common daemons are ntpd and chronyd. You can refer to this to understand the difference between them.
But, where can your computer get the UTC time from?
NTP is structured as a hierarchy of servers. Each level in the hierarchy is called a stratum & it represents the distance from the reference clock. Stratums can range from 0–15(16 levels), with 0 being the reference clock. Each clock at stratum X synchronizes itself from stratum X-1.(the previous level). Any clock at stratum 16 is considered unsynchronized.