ntp工作过程

本文通过`tcpdump`捕获NTP协议交互数据包,展示了在CentOS系统中如何进行时间同步的过程。客户端首先向多个NTP服务器发送时间校验请求,收到服务器响应后,经过多次交互,最终成功调整了系统时间,实现了与服务器时间的精确同步。
摘要由CSDN通过智能技术生成
[root@centos6 logs]# tcpdump port 123 -vv
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
15:26:02.417921 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 76)
    172.18.110.101.ntp > 114.80.81.1.ntp: [ bad udp cksum 8256!] NTPv4, length 48                            -->客户端发起时间校验,udp校验和错误,但是不影响使用
        Client, Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 6s, precision -19
        Root Delay: 0.000000, Root dispersion: 0.002975, Reference-ID: (unspec)
          Reference Timestamp:  0.000000000
          Originator Timestamp: 3547953085.375634335 (2012/06/06 14:31:25)
          Receive Timestamp:    3546660296.572161377 (2012/05/22 15:24:56)                                   -->客户端的当前时间
          Transmit Timestamp:   3546660362.417906163 (2012/05/22 15:26:02)
            Originator - Receive Timestamp:  -1292788.803472957                                                            -->与服务器的时间差
            Originator - Transmit Timestamp: -1292722.957728171
15:26:02.573882 IP (tos 0x0, ttl 46, id 44778, offset 0, flags [none], proto UDP (17), length 76)
    114.80.81.1.ntp > 172.18.110.101.ntp: [udp sum ok] NTPv4, length 48
        Server, Leap indicator:  (0), Stratum 2 (secondary reference), poll 6s, precision -19
        Root Delay: 0.141281, Root dispersion: 0.013046, Reference-ID: clock.isc.org
          Reference Timestamp:  3547953071.150161125 (2012/06/06 14:31:11)                                 -->服务器返回的时间戳
          Originator Timestamp: 3546660362.417906163 (2012/05/22 15:26:02)
          Receive Timestamp:    3547953151.380694855 (2012/06/06 14:32:31)
          Transmit Timestamp:   3547953151.380723113 (2012/06/06 14:32:31)
            Originator - Receive Timestamp:  +1292788.962788691                                                           -->服务器比客户端时间快的秒数
            Originator - Transmit Timestamp: +1292788.962816949
15:27:03.451400 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 76)                  -->向另外一台服务器发起对时请求
    172.18.110.101.ntp > 216.45.57.38.ntp: [bad udp cksum 814c!] NTPv4, length 48
        Client, Leap indicator: clock unsynchronized (192), Stratum 0 (unspecified), poll 6s, precision -19
        Root Delay: 0.000000, Root dispersion: 0.003890, Reference-ID: (unspec)
          Reference Timestamp:  0.000000000
          Originator Timestamp: 3547953147.470567139 (2012
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值