Facebook brings high-precision time synchronization system to open source, construction cost is a fraction of the conventional one



In a distributed system, it is important to synchronize the time on individual servers to ensure accurate transaction order and log consistency. Regarding the time server used for the time synchronization, Facebook announced that it will publish a highly accurate, inexpensive, vendor lock-in-free design and specifications as open source.

Open sourcing a more precise time appliance --Facebook Engineering

https://engineering.fb.com/2021/08/11/open-source/time-appliance/

In a blog post on March 18, 2020, Facebook announced that it has improved the time synchronization system, which was previously only accurate to 10 milliseconds, and improved the accuracy 100 times to enable synchronization in 100 microsecond units. was doing. This system receives signals from artificial satellites equipped with atomic clocks and corrects the time of the time server on the ground in the Stratum 1 layer in the figure below.



Many companies use an external time server such as 'time.facebook.com' operated by Facebook as Stratum 1 for server time correction, but problems with the Internet connection or external services went down. In some cases, the time will be incorrect and there is a risk of trouble.

Therefore, Facebook newly designed hardware called 'time appliance' consisting of a receiver and an

atomic clock , even if the connection with the artificial satellite is temporarily lost while receiving the accurate time from the artificial satellite. We have built a mechanism that can build a time server that does not lose accuracy. At the same time, he also invented a PCIe card 'time card' that can turn a general server into a time appliance.

The time appliance itself is not innovative and there are already a number of similar products out there, but the software is out of date and has security issues, and the software source is private for device configuration and monitoring. There were problems such as restrictions, the inability to maintain the hardware by the user, and the high production volume, which made it expensive.

Time cards are devices created to solve these problems, with receivers and atomic clocks (MACs) that provide time and pulse signals (PPS). The time card specifications, source code, and schematics are all published on GitHub, and the driver is included in the Linux kernel version 5.15 or later, and if it is a Linux kernel version 5.12 or later, you can build and use it yourself. It is also possible.



The verification result of the accuracy of the time card is as shown in the figure below. The

NTP indicated by the blue dot is within 40 microseconds, and the PTP indicated by the orange dot has an error of only nanoseconds. You can see that it has not occurred.



According to Facebook, time cards can be built at a fraction of the cost of existing products, and adjustments such as making it cheaper by changing the atomic clock to a crystal oscillator are possible. In addition to the time card specifications, GitHub also details how to combine hardware and software to build a time appliance.

in Software,   Hardware, Posted by log1d_ts