时间同步目前主要可以有三个元素:
频率同步:如果是周期性的脉冲(如1PPS)的话,那么频率同步意味着脉冲的重复频率或周期形同;
时间同步:如果是周期性的脉冲的话,那么相位同步意味着脉冲的上升沿对齐
时间同步:也可以简单理解为时间戳同步(TOD 或 Time of day),比如UTC时间对齐。意味着不同节点之间的时间戳是相同的。
下面这个图帮助理解下:
时间同步的主流手段如下:
1PPS (1 Pulse per Second) | An electrical pulse signal aligned to the start of each second. Accurate to 12 picoseconds to a few microseconds per second depending on the generating source. 1秒周期的脉冲,可用于频率和相位同步; |
10 MHz | A precise reference frequency signal used for synchronization. 用于频率同步的10Mhz信号 |
TOD (Time of Day) | An interface that combines an RS-422 serial connection with a 1PPS signal. 一般和1PPS绑定在一起出现,会借助RS-422 串口传输。 |
BITS(Building-Integrated Timing Supply) | A system that distributes timing signals within a building over T1/E1 connections. |
NTP (Network Time Protocol) | Standard protocol for the distribution of network time. Accurate to within tens of milliseconds. 网络时间同步协议,提供毫秒级别的精度;软件实现 |
IEEE 1588(Precision Time Protocol) | Precision time synchronization over networks. Accuracy ranges from 10 ns to 100 ns. 网络时间同步协议,提供亚微妙的精度。软件和硬件配合实现 |
GPS (Global Positioning System) | High-precision time synchronization from global satellites. Accuracy of about 100 nanoseconds |
Synch-E(Synchronous Ethernet) | a physical layer-based frequency synchronization technique that provides frequency synchronization to the packet layer of Ethernet-based networks. 网络频率同步协议,需要网络里每个节点都支持这个协议才行,一般基于硬件实现 |
同步方法选择的依据一般是根据需要同步设备间的距离:
1PPS, 10 MHz, and TOD这些信号,通常可以用于连接到位于一个机架或着一个房间内的不同设备,提供同步信号。
BITS 信号通常用于一个建筑物内部提供同步
NTP 和 IEEE 1588通常用于基于以太网连接的设备之间的同步,可以覆盖很大的范围。
GPS 时间可以用于更大范围内的同步,而且一般用作主时钟参考源,为别的设备提供时间同步信号输入。