加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 使用GPS时钟看似质量差的NTP时间同步

发布时间:2020-12-13 18:09:21 所属栏目:Linux 来源:网络整理
导读:我有一台 Linux服务器,它的时间与附近的基于GPS的NTP设备同步.从服务器到设备的Ping时间约为1ms,抖动非常低: --- x.x.x.x ping statistics ---100 packets transmitted,100 received,0% packet loss,time 99001msrtt min/avg/max/mdev = 0.874/0.957/1.052/
我有一台 Linux服务器,它的时间与附近的基于GPS的NTP设备同步.从服务器到设备的Ping时间约为1ms,抖动非常低:
--- x.x.x.x ping statistics ---
100 packets transmitted,100 received,0% packet loss,time 99001ms
rtt min/avg/max/mdev = 0.874/0.957/1.052/0.051 ms

但是,NTP客户端估计时间同步的准确度大约为5-6ms,考虑到设置,这似乎非常高:

synchronised to NTP server (x.x.x.x) at stratum 2
   time correct to within 5 ms
   polling server every 16 s

ntpq -p给出以下内容:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*x.x.x.x         .PPS.            1 u   10   16  377    0.964   -0.019   0.036

两个问题:

>可能导致NTP客户端对同步精度的信心如此之低?
>有没有办法测量同步的实际精度,比如说到最接近的毫秒?

解决方法

ntpstat在“time correct to within”之后显示的值是根色散根延迟/ 2.ntpq -p不显示“根色散”运行ntpq -c rl.

尽管如此,很明显缺乏准确性的主要原因是分散而不是延迟(仅为0.964).

色散是“相对于主要参考源的标称误差”.我简要介绍了NTPv4 RFC,这就是它要说的内容:

The dispersion (epsilon) represents
the maximum error inherent in the
measurement. It increases at a rate
equal to the maximum disciplined
system clock frequency tolerance
(PHI),typically 15 PPM. 1 PPM
is equal to 10^(-6) seconds/second.

使用rrdtool术语分散不是衡量标准,而是计数器.看到一个很大的值可能并不表示有什么不对.

唉,我无法很好地理解ntp算法,看看如何使这个数字更小.我注意到这个值偶尔会被重置.我不知道为什么.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读