NTP响应中的参数是什么意思?

NTP响应中的参数是什么意思?

当我将以下行添加到systemd-timesyncd.service

Environment="SYSTEMD_LOG_LEVEL=debug"

同步系统时间时得到以下输出:

systemd-timesyncd[42507]: Sent NTP request to 46.175.224.7:123 (0.pl.pool.ntp.org).
systemd-timesyncd[42507]: NTP response:
systemd-timesyncd[42507]:   leap         : 0
systemd-timesyncd[42507]:   version      : 4
systemd-timesyncd[42507]:   mode         : 4
systemd-timesyncd[42507]:   stratum      : 3
systemd-timesyncd[42507]:   precision    : 0.000002 sec (-19)
systemd-timesyncd[42507]:   root distance: 0.069962 sec
systemd-timesyncd[42507]:   reference    : n/a
systemd-timesyncd[42507]:   origin       : 1569357097.226
systemd-timesyncd[42507]:   receive      : 1569357097.254
systemd-timesyncd[42507]:   transmit     : 1569357097.254
systemd-timesyncd[42507]:   dest         : 1569357097.292
systemd-timesyncd[42507]:   offset       : -0.005 sec
systemd-timesyncd[42507]:   delay        : +0.066 sec
systemd-timesyncd[42507]:   packet count : 4
systemd-timesyncd[42507]:   jitter       : 0.016
systemd-timesyncd[42507]:   poll interval: 512
systemd-timesyncd[42507]:   adjust (slew): -0.005 sec
systemd-timesyncd[42507]:   status       : 8193 sync
systemd-timesyncd[42507]:   time now     : 1569357097.292
systemd-timesyncd[42507]:   constant     : 5
systemd-timesyncd[42507]:   offset       : -0.005 sec
systemd-timesyncd[42507]:   freq offset  : +796760 (+12 ppm)
systemd-timesyncd[42507]: interval/delta/delay/jitter/drift 512s/-0.005s/0.066s/0.016s/+12ppm
systemd-timesyncd[42507]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=6 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a

那么基本上,NTP 响应中的所有参数都意味着什么?

答案1

其中一些是微不足道的(例如“版本 4”意味着它是 NTP 协议的版本 4),但其中很多并不是那么微不足道。例如,leap 0 表示服务器不会警告即将到来的闰秒(值 2 = 添加一秒或 3 = 删除一秒)或时钟不同步(值 4)。模式4为服务器;层基本上是服务器距参考(国家标准)时钟的跳数。

有关所有字段及其使用方式的完整详细信息,请参阅RFC 5905及其更新。还有各种ntp工作组文件

相关内容