Patrik "paf" Fältström
2020.04.17
How do you know what time it is?

How do you know what time it is?

At Netnod we are really interested in time. We provide one of the first Network Time Protocol (NTP) services to be enabled with Network Time Security (NTS). We also provide Precision Time Protocol (PTP) services for organisations that need to ensure the highest level of time accuracy.

In this blogpost, we will take a look at some of the fundamentals in providing accurate time. These include looking at what makes a clock, how to ensure accuracy down to the level of nanoseconds and what we are doing to ensure accurate time throughout Sweden. This blogpost is based on two previous talks I gave: one in Brisbane at the office of our friends APNIC, the Regional Internet Registry for the Asia Pacific region; the second talk was at the FOSS North 2020 conference and is available here.

What makes a clock? 

At the basic level, to measure time you need something that “ticks” (for example, sand in an hourglass or the oscillations of a caesium atom) and something that enables you to count the frequency of these ticks. If the frequency is stable, it makes it easier to measure time accurately. For thousands of years, mankind used the rotation of the earth and its movement around the sun to measure time but the frequency is not stable enough to allow highly accurate time measurements. Today we use the oscillations of a caesium atom to create what is known as International Atomic Time (TAI). This is defined as the weighted average of the time kept by about 200 atomic clocks in over 50 national laboratories worldwide. The other 2 main timescales in use are:

  • Universal time (UT1) - defined by the Earth's rotation, with adjustment to polar wandering
  • Coordinated Universal Time (UTC) - uses TAI and adds leap seconds when needed to keep the difference between UTC and UT1 less than 0.9s

How to ensure accuracy?

High precision time measurements depend on using multiple clocks to ensure redundancy and stability. But when using two or more clocks you need to account for what are known as frequency and phase errors (see figure 1).

Figure 1 Frequency and phase errors

Figure 1: Example of Frequency and Phase Errors

The difference between A and B shows when two clocks are out of frequency and C shows when the frequencies don’t peak at the same time (known as a phase error). Frequency and phase errors can cause significant problems especially in sectors where the highest level of time accuracy is needed (for example when running power networks). Minimising these errors is an essential part of running a time service but can pose an interesting engineering problem. If you have two clocks and need to establish accuracy to the level of single digit nanoseconds, you can face a situation where you are effectively racing against the speed of light. Given that the speed of light is about 1 foot per nanosecond, if the clocks are far enough apart, the propagation time between the two clocks might be larger than the phase error you are trying to correct.

Netnod’s time services

Netnod provides NTP, NTS and PTP services offering a robust, reliable and highly accurate source for time and frequency. Netnod’s NTP service, funded by the Swedish Post and Telecom Authority (PTS), uses a distributed timescale on autonomous nodes throughout Sweden to provide a time service available over IPv4 or IPv6 and traceable to within 250 nanoseconds of official Swedish time UTC(SP). Each site has redundant servers, 2 caesium clocks, and 2 FPGA boards providing an extremely fast hardware implementation of NTP.

Figure 2 Netnod redundant time and frequency

Figure 2: Netnod’s redundant time and frequency node, with caesium atomic clocks

Netnod staff have been instrumental in the creation of NTS. Apart from editing the IETF proposed standard, Netnod staff have also developed both server and client side implementations of NTS. Netnod’s NTP service is one of the first anywhere in the world to offer NTS. More information is available here

Netnod’s PTP service provides traceable time over a dedicated fibre which enables organisations to get time and frequency to the highest degree of accuracy. More information about Netnod’s PTP service is available here.

Next steps

Netnod will add a time and frequency node in Luleå and will work to make all nodes more robust against jamming and replay attacks against GNSS. We will continue to develop and deploy the NTS protocol. 

This blogpost is based on two previous talks I gave: one at APNIC, the Regional Internet Registry for the Asia Pacific region, where Netnod has a long-standing relationship involving, among other things, the deployment of I-root servers in the Asia Pacific region; the second talk was at the FOSS North 2020 conference and is available here.