📜 ⬆️ ⬇️

About the exact time

image Everyone is already accustomed to the time synchronization service using the NTP protocol - it is enabled by default or is easily enabled for most popular operating systems. However, what accuracy is achieved with this? What are the exact time server, and with which you can work as a mere mortal? What are the pitfalls, and how to choose the "right" time server?



Server types


Servers are Stratum 1 and 2, 3 (rarely above).
')
Stratum 1 - get the exact time directly from a source of exact time: atomic clocks (for example, time-a.nist.gov, accuracy - trillionths of a second) or a GPS receiver (ntpx.imvp.ru accuracy - billionths of a second). There are servers receiving exact time through a cellular network CDMA (millionths of a second). When working with ntpd, you can find out the type of server using the ntpq -np command: “PPS” means GPS, “ACTS” means direct connection to the atomic clock (ibid also other valuable statistics - ping, jitter), server rank (1 , 2 ...)).

"Mere" mortals access to Stratum-1 servers is strictly prohibited, because the load on them is already very large (and for many Stratum-1 servers there is no public access at all). It is believed that you can connect to Stratum-1 servers or request access to them if you have an NTP server serving at least 100 clients. A complete list of servers can be found here: support.ntp.org/bin/view/Servers/StratumOneTimeServers . Naturally, it is desirable to connect to servers in your country.

Stratum 2 - get the exact time from Stratum-1 servers. With proper configuration and selection of time source servers, the error is less than 1 ms. Usually, everyone can connect, but many servers regularly die from the load (for example, time.windows.com). www.pool.ntp.org supports round-robin lists of public Stratum-2 NTP servers. This provides load balancing and is almost always available. You can connect to these servers at 0.ru.pool.ntp.org 1.ru.pool.ntp.org 2.ru.pool.ntp.org and 3.ru.pool.ntp.org (this is for Russia, selected randomly from the list of ~ 50 servers).

Stratum 3 - get time from Stratum-2 servers, etc.

Practical accuracy


Stratum-1
This is a graph of the difference in system time with the time obtained from Stratum-1 servers (canonical.com - Stratum-2 server, for comparison).
* .nist.gov - located in the US, because of the "big" ping, sometimes terrible "outliers" occur. Error from Russian Stratum-1 servers usually in + - 1 ms.
image

Stratum-2
This is the difference with Stratum-2 servers: 4 from the Russian Pool, 1 from the European, default time server ubunt (europium.canonical.com), and the same * .nist.gov:
image
Immediately striking the server, having a constant error of up to 20 ms.

Summary




Ps. By the way, by default in Ubuntu time synchronization occurs once when the system boots. If uptime for half a year - time can leave much. Install ntpd - it adjusts the time constantly and “smoothly” (without sharp jerks, “smearing” the deceleration / acceleration of time). In Windows, synchronization occurs once a day a week in one “jump”, which can cause difficulties in processing logs if a big difference has happened.

Comrades!


Give us great public NTP servers in Russia! Especially Stratum-1 (with them, we generally have tension, 2-3 pieces for the whole exUSSR). By the way, the exact time can be taken from Glonass, who will undertake to launch the first Glonass-powered server?

Pps. I can not understand which blog to move to, tell me :-)

Source: https://habr.com/ru/post/79461/


All Articles