请选择 进入手机版 | 继续访问电脑版

设为首页 收藏本站
思科服务支持社区 点击关注
思科服务支持社区

  
 找回密码
 立即注册

扫一扫,访问微社区

搜索
热搜: 邮件服务器
查看: 1118|回复: 6

share NTP 排错命令中相关参数解释

[复制链接]
发表于 2018-1-2 14:06:22 | 显示全部楼层 |阅读模式
show ntp association
An NTP association can be a peer association (one system is willing to synchronize to the other system or to allow the other system to synchronize to it) or a server association (only one system synchronizes to the other system and not the other way around).
This is an example of output from the show ntp association command:
CLA_PASA#sh ntp association
      address         ref clock     st  when  poll reach  delay  offset    disp
~127.127.7.1      127.127.7.1       9    50    64  377     0.0    0.00     0.0
~10.50.44.69      10.50.36.106      5  21231  1024   0     3.8   -4.26  16000.
+~10.50.44.101     10.50.38.114      5    57    64    1     3.6   -4.30  15875.
+~10.50.44.37      10.50.36.50       5     1   256  377     0.8    1.24     0.2
~10.50.44.133     10.50.38.170      5  12142  1024   0     3.2    1.24  16000.
+~10.50.44.165     10.50.38.178      5    35   256  357     2.5   -4.09     0.2
+~10.50.38.42      86.79.127.250     4     7   256  377     0.8   -0.29     0.2
*~10.50.36.42      86.79.127.250     4   188   256  377     0.7   -0.17     0.3
+~10.50.38.50      86.79.127.250     4    42   256  377     0.9    1.02     0.4
+~10.50.36.50      86.79.127.250     4    20   256  377     0.7    0.87     0.5
* master (synced), # master (unsynced), + selected, - candidate, ~ configured
Term
Explanation
Characters before the address have these definitions:
* Synchronized to this peer
# Almost synchronized to this peer
+ Peer selected for possible synchronization
- Peer is a candidate for selection
~ Peer is statically configured
address
This is the IP address of the peer. In the example, the first entry shows 127.127.7.1. This indicates that the local machine has synced with itself. Generally, only an NTP master syncs with itself.
ref clock
This is the address of the reference clock for the peer. In the example, the first six peers/servers have a private IP as the reference clock, so their masters are probably routers, switches, or servers within the local network. For the last four entries, the reference clock is a public IP, so their masters are probably a public time source.
st
NTP uses the concept of a stratum in order to describe how far away (in NTP hops) a machine is from an authoritative time source. For example, a stratum 1 time server has a radio or atomic clock directly attached to it. It sends its time to a stratum 2 time server through NTP, and so on up to stratum 16. A machine running NTP automatically chooses the machine with the lowest stratum number with which it can communicate and uses NTP as its time source.
when
The time since the last NTP packet was received from a peer is reported in seconds. This value should be lower than the polling interval.
poll
The polling interval is reported in seconds. The interval usually starts with a minimum of 64-second poll intervals. The RFC specifies that no more than one NTP transaction per minute is needed in order to synchronize two machines. As NTP becomes stable between a client and a server, the poll interval may increase in small steps from 64 seconds up to 1024 seconds and generally stabilizes somewhere in between. But, this value dynamically changes, based on the network conditions between the client and the server and the loss of NTP packets. If a server is unreachable for some time, the poll interval is increased in steps to 1024 seconds in order to reduce network overhead.
It is not possible to adjust the NTP poll interval on a router, because the internal is determined by heuristic algorithms.
reach
Peer reachability is a bit string reported as an octal value. This field shows whether the last eight packets were received by the NTP process on the Cisco IOS® software. The packets must be received, processed, and accepted as valid by the NTP process and not just by the router or switch that receives the NTP IP packets.
Reach uses the poll interval for a time out in order to decide whether a packet was received or not. The poll interval is the time that NTP waits before it concludes that a packet was lost. The poll time can be different for different peers, so the time before reach decides that a packet was lost can also different for different peers.
In the example, there are four different reach values:
377 octal = 11111111 binary, which indicates the NTP process received the last eight packets.
0 octal = 00000000, which indicates the NTP process did not receive any packet.
1 octal = 00000001, which indicates the NTP process received only the latest packet.
357 octal = 11101111, which indicates the packet before the latest four packets was lost.
Reach is a good indicator of whether NTP packets are being dropped because of a poor link, CPU issues and other intermittent problems.
Convert octal < - > binary is an online unit converter for this and many other conversions.
delay
The round-trip delay to peer is reported in milliseconds. In order to set the clock more accurately, this delay is taken into account when the clock time is set.
offset
Offset is the clock time difference between the peers or between the master and client. This value is the correction that is applied to a client clock in order to synchronize it. A positive value indicates the server clock is higher. A negative value indicates the client clock is higher.
disp
Dispersion, reported in seconds, is the maximum clock time difference that was ever observed between the local clock and server clock. In the example, dispersion is 0.3 for the server 10.50.36.42, so the maximum time difference ever observed locally between the local clock and the server clock is 0.3 seconds.
You can expect to see a high value when the clocks are syncing initially. But, if the dispersion is too high at other times, the NTP process on the client does not accept NTP messages from the server. Maximum dispersion is 16000; in the example, that is the dispersion for servers 10.50.44.69 and 10.50.44.133, so the local client does not accept time from these servers.
If the reach is zero and dispersion is very high, the client is probably not accepting messages from that server. Refer to the second line of the example:
     address     ref clock  st  when  poll reach delay  offset   disp
~10.50.44.69  10.50.36.106   5  21231  1024    0    3.8   -4.26  16000.
Even though the offset is just -4.26, the dispersion is very high (perhaps due to a past event), and the reach is zero, so this client does not accept time from this server.


show ntp association detail
This is an example of output from the show ntp association detail command:
Router#sho ntp assoc detail
10.4.2.254 configured, our_master, sane, valid, stratum 1
ref ID .GPS., time D36968AA.CC528FE7 (02:10:50.798 UTC Fri May 25 2012)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 0.00 msec, root disp 0.44, reach 377, sync dist 207.565
delay 2.99 msec, offset 268.3044 msec, dispersion 205.54
precision 2**19, version 3
org time D36968B7.E74172BF (02:11:03.903 UTC Fri May 25 2012)
rcv time D36968B7.A2F44E2C (02:11:03.636 UTC Fri May 25 2012)
xmt time D36968B7.A21D3780 (02:11:03.633 UTC Fri May 25 2012)
filtdelay =     2.99    2.88  976.61  574.65  984.71  220.26  168.12    2.72
filtoffset =  268.30  172.15 -452.49 -253.59 -462.03  -81.98  -58.04   22.38
filterror =     0.02    0.99    1.95    1.97    2.00    2.01    2.03    2.04

10.3.2.254 configured, selected, sane, valid, stratum 1
ref ID .GPS., time D36968BB.B16C4A21 (02:11:07.693 UTC Fri May 25 2012)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 0.00 msec, root disp 3.34, reach 377, sync dist 192.169
delay 0.84 msec, offset 280.3251 msec, dispersion 188.42
precision 2**19, version 3
org time D36968BD.E69085E4 (02:11:09.900 UTC Fri May 25 2012)
rcv time D36968BD.9EE9048B (02:11:09.620 UTC Fri May 25 2012)
xmt time D36968BD.9EA943EF (02:11:09.619 UTC Fri May 25 2012)
filtdelay =     0.84    0.75  663.68    0.67    0.72  968.05  714.07    1.14
filtoffset =  280.33  178.13 -286.52   42.88   41.41 -444.37 -320.25   35.15
filterror =     0.02    0.99    1.97    1.98    1.98    2.00    2.03    2.03

10.1.2.254 configured, insane, invalid, stratum 1
ref ID .GPS., time D3696D3D.BBB4FF24 (02:30:21.733 UTC Fri May 25 2012)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 0.00 msec, root disp 4.15, reach 1, sync dist 15879.654
delay 0.98 msec, offset 11.9876 msec, dispersion 15875.02
precision 2**19, version 3
org time D3696D3D.E4C253FE (02:30:21.893 UTC Fri May 25 2012)
rcv time D3696D3D.E1D0C1B9 (02:30:21.882 UTC Fri May 25 2012)
xmt time D3696D3D.E18A748D (02:30:21.881 UTC Fri May 25 2012)
filtdelay =     0.98    0.00    0.00    0.00    0.00    0.00    0.00    0.00
filtoffset =   11.99    0.00    0.00    0.00    0.00    0.00    0.00    0.00
filterror =     0.02 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0
Terms already defined in the show ntp association section are not repeated.
Term
Explanation
configured
This NTP clock source has been configured to be a server. This value can also be dynamic, where the peer/server was dynamically discovered.
our_master
The local client is synchronized to this peer.
selected
The peer/server is selected for possible synchronization, when 'our_master' fails or the client loses sync.
sane
Sanity tests are used in order to test the NTP packet received from a server. These tests are specified in RFC 1305, Network Time Protocol (Version 3) Specification, Implementation and Analysis . The tests are:
Packet data is valid if tests 1 to 4 are passed. The data is then used in order to calculate offset, delay, and dispersion.
Packet header is valid if tests 5 to 8 are passed. Only packets with a valid header can be used to determine whether a peer can be selected for synchronization.
insane
The sanity checks have failed, so time from the server is not accepted. The server is unsynced.
valid
The peer/server time is valid. The local client accepts this time if this peer becomes the master.
invalid
The peer/server time is invalid, and time will not be accepted.
ref ID
Each peer/server is assigned a reference ID (label).
time
Time is the last time stamp received from that peer/server.
our mode/ peer mode
This is the state of the local client/peer.
our poll intvl/ peer poll intvl
This is the poll interval from our poll to this peer or from the peer to the local machine.
root delay
Root delay is the delay in milliseconds to the root of the NTP setup. Stratum 1 clocks are considered to be at the root of an NTP setup/design. In the example, all three servers can be the root because they are at stratum 1.
root dispersion
Root dispersion is the maximum clock time difference that was ever observed between the local clock and the root clock. Refer to the explanation of 'disp' under the show ntp association section for more details.
sync dist.
This is an estimate of the maximum difference between the time on the stratum 0 source and the time measured by the client; it consists of components for round trip time, system precision, and clock drift since the last actual read of the stratum source.
In a large NTP setup (NTP servers at stratum 1 in the internet, with servers that source time at different strata) with servers/clients at multiple strata, NTP synchronization topology should be organized in order to produce the highest accuracy, but must never be allowed to form a time sync loop. An additional factor is that each increment in stratum involves a potentially unreliable time server, which introduces additional measurement errors. The selection algorithm used in NTP uses a variant of the Bellman-Ford distributed routing algorithm in order to compute the minimum-weight spanning trees rooted on the primary servers. The distance metric used by the algorithm consists of the stratum plus the synchronization distance, which itself consists of the dispersion plus one-half the absolute delay. Thus, the synchronization path always takes the minimum number of servers to the root; ties are resolved on the basis of maximum error.
delay
This is the round trip delay to peer.
precision
This is the precision of the peer clock in Hz.
version
This is the NTP version number used by the peer.
org time
This is the time stamp of the NTP packet originator; in other words, it is this peer's time stamp when it created the NTP packet but before it sent the packet to the local client.
rcv time
This is the time stamp when the local client received the message. The difference between org time and rcv time is the offset for this peer. In the example, master 10.4.2.254 has these times:
org time D36968B7.E74172BF (02:11:03.903 UTC Fri May 25 2012)
rcv time D36968B7.A2F44E2C (02:11:03.636 UTC Fri May 25 2012)
The difference is the offset of 268.3044 msec.
xmt time
This is the transmit time stamp for the NTP packet the local client sends to this peer/server.
filtdelay
filtoffset
filterror
This is the round trip delay in milliseconds of each sample.
This is the clock offset in milliseconds of each sample.
This is the approximate error of each sample.
A sample is the last NTP packet received. In the example, master 10.4.2.254 has these values:
filtdelay =    2.99   2.88  976.61  574.65  984.71 220.26 168.12  2.72
filtoffset = 268.30 172.15 -452.49 -253.59 -462.03 -81.98 -58.04 22.38
filterror =    0.02   0.99    1.95    1.97    2.00   2.01   2.03  2.04
These eight samples correspond to the value of the reach field, which shows whether the local client received the last eight NTP packets.

Test
Mask
Explanation
1
0x01
Duplicate packet received
2
0x02
Bogus packet received
3
0x04
Protocol unsynchronized
4
0x08
Peer delay/dispersion failed boundary check
5
0x10
Peer authentication failed
6
0x20
Peer clock unsynchronized (common for unsynched server)
7
0x40
Peer stratum out of bound
8
0x80
Root delay/dispersion failed boundary check


show ntp status
This is an example of output from the show ntp status command:
USSP-B33S-SW01#sho ntp status
Clock is synchronized, stratum 2, reference is 10.4.2.254
nominal freq is 250.0000 Hz, actual freq is 250.5630 Hz, precision is 2**18
reference time is D36968F7.7E3019A9 (02:12:07.492 UTC Fri May 25 2012)
clock offset is 417.2868 msec, root delay is 2.85 msec
root dispersion is 673.42 msec, peer dispersion is 261.80 msec
Terms already defined in the show ntp association section or the show ntp association details section are not repeated.
Term
Explanation
precision
Precision is determined automatically and is measured as a power of two. In the example, 2**18 means 2^(-18), or 3.8 microseconds.
Loss of synchronization between NTP peers or between a master and client can be due to a variety of causes. NTP avoids synchronization with a machine whose time might be ambiguous in these ways:
NTP never synchronizes to a machine that is not synchronized itself.
NTP compares the time that is reported by several machines and does not synchronize to a machine whose time is significantly different from the others, even if its stratum is lower.





  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分5 (2 评价)
发表于 2018-1-2 14:13:37 | 显示全部楼层
  谢谢分享!
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 2018-1-3 13:22:32 | 显示全部楼层
确实很详细
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 2018-2-22 22:31:58 | 显示全部楼层
MAX可以的,很详细
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 2018-3-1 22:02:05 | 显示全部楼层
学习了, 感谢楼主分享,thanks for sharing
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 2018-3-22 19:44:13 | 显示全部楼层
学习了,谢谢分享
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
发表于 2018-3-27 07:45:00 | 显示全部楼层
在学习学习NTP
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5
平均得分0 (0 评价)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver | 思科服务支持社区  

GMT+8, 2018-7-16 11:09 , Processed in 0.104116 second(s), 48 queries .

京ICP备09041801号-187

版权所有 :copyright:1992-2019 思科系统  重要声明 | 保密声明 | 隐私权政策 | 商标 |

快速回复 返回顶部 返回列表