Time synchronization without internet

Time synchronization without internet

Besides tcp/ip, there are many ways to synchronize time. Some require only a conventional telephone, while others require expensive, rare and sensitive electronic equipment. The vast infrastructure of time synchronization systems includes observatories, government institutions, radio stations, satellite constellations, and more.

Today I will tell you how time synchronization works without the Internet and how to make a β€œsatellite” NTP server with your own hands.

Broadcasting on short waves

In the United States of America, NIST transmits accurate time and frequency on 2.5, 5, 10, 15, and 20 MHz radio waves from the WWVH station in Fort Collins, Colorado, and on 2.5, 5, 10, and 15 MHz from the WWVH station in Kauai, state of Hawaii. The time code is transmitted every 60 seconds at 1 bps. using pulse-width modulation on a subcarrier of 100 Hz.

The National Research Council (NRC) of Canada distributes time and frequency information on 3.33, 7.85 and 14.67 MHz from CHU in Ottawa, Ontario.

Time synchronization without internet
WWVH broadcast format

Signal propagation from shortwave stations usually occurs by reflection from the upper layers of the ionosphere. Signal transmissions can be received over long distances, but time accuracy is on the order of one millisecond.

The current NTPv4 standard includes audio drivers for WWV, WWVH, and CHU.

Broadcasting on long waves

NIST also transmits accurate time and frequency over longwave radio waves on 60 kHz from Boulder, Colorado. There are other stations for transmitting accurate time signals on long waves.

Call signs and location
Frequency (kHz)
Power (kW)

WWVB Fort Collins, Colorado, USA
60
50

DCF77 Mainflingen, Germany
77.5
30

MSF Rugby, United Kingdom
60>
50

HBG Prangins, Switzerland
75
20

JJY Fukushima, Japan
40
50

JJY Saga
60
50

Low Frequency Standard Time Stations

The time code is transmitted at 60 second intervals at 1 bps, just like on shortwave stations. The data transfer formats are also similar for both standards. Signal propagation occurs through the lower layers of the ionosphere, which are relatively stable and have predictable diurnal altitude fluctuations. Due to this predictability of the physical environment, the accuracy is increased to 50 ΞΌs.

Time synchronization without internet
WWVB broadcast format

Geostationary Operational Environmental Observation Satellite

In the US, NIST also transmits precise time and frequency data on approximately 468 MHz from Geostationary Operational Environment Satellites (GOES). The time code is interleaved with messages used to interrogate remote sensors. It consists of 60 BCD nibbles transmitted at 30 second intervals. Time code information is similar to terrestrial services.

Global positioning systems

The US Department of Defense uses GPS for precise navigation on land, at sea and in the air. This system provides 24-hour coverage of the globe using a constellation of satellites in 12-hour orbits inclined at an angle of 55Β°.

The original constellation of 24 satellites has been expanded to 31 satellites in a non-uniform configuration so that at least 6 satellites are always in view and 8 or more satellites are in view in most of the world.

Services like GPS are being operated or planned by other countries. Russian GLONASS has been operating for ten years, if we count from September 2, 2010, when the total number of satellites was brought to 26 - the constellation was fully deployed to completely cover the Earth.

Time synchronization without internet
GPS satellites around the globe.

The satellite navigation system of the European Union is called "Galileo". It was expected that Galileo would start operating in 2014-2016, when all 30 planned satellites would be launched into orbit. But in 2018, the Galileo satellite constellation did not reach the required number of vehicles.

There is also the Chinese "Beidou", which means "whale" in translation. The constellation of 16 satellites was launched into commercial operation on December 27, 2012, as a regional positioning system. The system is expected to reach its full capacity by 2020. Just today, on HabrΓ© came out article, about the successful launch of a satellite of this system.

Mathematics of determining coordinates by SRNS

How does the GPS / Glonass navigator on your smartphone determine the location with such accuracy using the radio navigation communication system (SRNS)? To understand the principle of calculations, you need to remember stereometry and algebra within the upper grades of the secondary school, or the school of physics and mathematics.

Each satellite tells the receiver the exact time. An atomic clock is installed on the satellite and therefore they can be trusted. Knowing the speed of light, it is easy to determine the radius of the sphere on the surface of which the satellite is located. The same sphere in contact with the Earth forms a circle on which the GPS / Glonass receiver is located.

When the signal comes from two satellites, we already have the intersection of the Earth and two spheres, which gives only two points on the circle. The sphere of the third satellite should ideally fall into one of these two points, finally determining the coordinates of the receiver.

In principle, even from two satellites, by indirect signs, one can understand which of the two points is closer to the truth, and modern navigation software algorithms can cope with this task. Why then do we need a fourth satellite?

Time synchronization without internet
Location determination using satellite constellation.

It is easy to see that in this idealized picture there are many nuances on which the accuracy of calculations depends. Receiver time is perhaps the most obvious source of error. In order for everything to work properly, the GPS / Glonass receiver time must be synchronized with the satellite time. Without this, the error would be βˆ“ 100 thousand km.

From the formula for speed, time and distance S = v * t, we obtain the basic equation for SRNS signal transmission. The distance to the satellite is equal to the product of the speed of light and the time difference between the satellite and the receiver.

Time synchronization without internet

This is mainly due to the fact that even after all synchronizations, we know the time at the receiver tpr with a sufficient degree of accuracy. Between the true time and tpr there will always be Ξ”t, due to which the calculation error becomes unacceptable. That's why you need fourth satellite.

For a clearer mathematical justification for the need for four satellites, we construct a system of equations.

Time synchronization without internet

To determine the four unknowns x, y, z, and Ξ”t, the number of observations must be equal to or greater than the number of unknowns. This is a necessary but not sufficient condition. If the matrix of normal equations turns out to be degenerate, the system of equations will not have a solution.

We should also not forget about the Special Theory of Relativity and relativistic effects with time dilation on satellite atomic clocks relative to those on the ground.

Time synchronization without internet

If we assume that the satellite moves in orbit at a speed of 14 thousand km / h, then we get a time dilation of about 7 ΞΌs (microseconds). On the other hand, the relativistic effects of the General Theory of Relativity operate.

The thing is, satellites in orbits are at a great distance from the Earth, where the curvature of the space-time continuum is less than on the earth's surface due to the mass of the Earth. According to general relativity, clocks that are closer to a massive object will appear slower than clocks that are further away from it.

Time synchronization without internet

  • G is the gravitational constant;
  • M is the mass of the object, in this case the Earth;
  • r is the distance from the center of the Earth to the satellite;
  • c is the speed of light.

Calculating this formula gives a time dilation of 45 Β΅s on the satellite. Total -7ΞΌs +45ΞΌs = 38ΞΌs balance - SRT and GR effects.

In SRNS positioning applications, ionospheric and tropospheric delays should also be taken into account. In addition, the 46 ns corrections are associated with an eccentricity of 0.02 in the orbit of the GPS satellites.

The ability to receive signals simultaneously from more than four GPS / GLONASS satellites allows you to further increase the accuracy of determining the coordinates of the receiver. This is achieved due to the fact that the navigator solves a system of four equations with four unknowns Time synchronization without internet number of times and takes the average value, increasing the accuracy of the final score according to the laws of mathematical statistics.

How to set up NTP server Stratum 1 via satellite

All you need to set up a high quality time server is a GPSD, NTP and GPS receiver, with 1PPS (one pulse per second) output.

1. Install gpsd and ntpd, or gpsd and chronyd. gpsd version must be β‰₯ 3.20

(1:1109)$ sudo emerge -av gpsd chrony

Local copy of remote index is up-to-date and will be used.

Calculating dependencies... done!

[binary  N     ] net-misc/pps-tools-0.0.20120407::gentoo  31 KiB

[binary  N     ] net-misc/chrony-3.5-r2::gentoo  USE="adns caps cmdmon ipv6 ntp phc readline refclock rtc seccomp (-html) -libedit -pps (-selinux)" 246 KiB

[binary  N     ] sci-geosciences/gpsd-3.17-r3:0/23::gentoo  USE="X bluetooth cxx dbus ipv6 ncurses python shm sockets udev usb -debug -latency-timing -ntp -qt5 -static -test" GPSD_PROTOCOLS="aivdm ashtech earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 navcom ntrip oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tnt tripmate tsip ublox -fury -geostar -nmea0183 -nmea2000 -passthrough" PYTHON_TARGETS="python2_7" 999 KiB

Total: 3 packages (3 new, 3 binaries), Size of downloads: 1275 KiB

Would you like to merge these packages? [Yes/No]

2. Connect a PPS-enabled GPS receiver to the RS232 serial or USB port.

A regular cheap GPS receiver won't work; you may have to run around a bit to find the right one.

3. Make sure that the device is really issuing PPS, to do this, check the port with the gpsmon utility.

4. Open the /etc/conf.d/gpsd file and edit the following line.

Substitute

GPSD_OPTIONS=""

so that it becomes

GPSD_OPTIONS="-n"

This change is required so that gpsd immediately starts searching for SRNS sources at startup.

5. Start or restart gpsd.

(1:110)$ sudo /etc/init.d/gpsd start
(1:111)$ sudo /etc/init.d/gpsd restart

For systemd distributions, use the appropriate systemctl command.

6. Check the console output of the cgps command.

You need to make sure that the data is coming from the satellites properly. The console should have something similar to the illustration.

Time synchronization without internet
The output of the cgps console command.

7. It's time to edit the /etc/ntp.conf file.

# GPS Serial data reference (NTP0)
server 127.127.28.0
fudge 127.127.28.0 time1 0.9999 refid GPS

# GPS PPS reference (NTP1)
server 127.127.28.1 prefer
fudge 127.127.28.1 refid PPS

The top NTP0 entry indicates a universal time source available on almost all GPS devices. The lower NTP1 entry defines a much more accurate PPS source.

8. Restart ntpd.

(1:112)$ sudo /etc/init.d/ntpd restart

For systemd distributions, use the systemctl command.
$ sudo systemctl restart ntp

Used materials

Time synchronization without internet

Time synchronization without internet

Source: habr.com

Add a comment