Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze ntp time Service

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, Xiaobian will bring you an analysis of how to carry out ntp time service. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.

NTP (Network Time Protocol) is a standard Internet protocol used for time synchronization on the Internet. NTP is used to synchronize computer time to certain time standards. The current time standard is UTC (Universal Time Coordinated). NTP was developed by David L. Professor Mills.

NTP time server is a high-tech product that calibrates the time of computers and control devices in automation systems. NTP time server products acquire standard time signals from GPS satellites and transmit these information to equipment that need time information in automation systems (computers, protection devices, fault recorders, event sequence recording devices, safety automatic devices, remote RTUs) through various interface types, so that time synchronization of the entire system can be achieved.

Ntp time synchronization is a complex time synchronization mechanism, which has been studied and improved for about 20 years. It takes into account the delay error of hardware information transmission, network transmission delay error and other issues, and is not a simple matter of simply asking a time from the ntp server and setting this time to the client.

0 1 2 3 4 5 6 7 8

Server --------+---+.--------------------------------

. ' `.

/ `.

. ' `-.

/ `.

Client . '---------------------`.---------------------

1 2 3 4 5 6 7 8 9

This is not to say that as long as ntp client connects to ntp server, ntp client will get the time of ntp server and synchronize. When the ntp client sends a request to the ntp server, the server will return a set of packets to the client. If the error value in the packet exceeds the acceptable range after calculation, the returned value will not be accepted. The error value is related to the server itself, the network environment of the server, and the server time source hierarchy.

If we find that ntp client does not synchronize time with ntp server, we can use

# ntpq

Enter the interactive interface and use the command

> ass

List all active time servers

[root@dhcp-0-065 ~]# ntpq

ntpq > ass

ind assID status conf reach auth condition last_event cnt

===========================================================

1 11024 9614 yes yes none sys.peer reachable 1

ntpq >

And then you give the order

> rv

Select the assID of the specified ntp server to see the action

ntpq > rv 11024

assID=11024 status=9614 reach, conf, sel_sys.peer, 1 event, event_reach,

srcadr=dhcp-0-098.pek.redhat.com, srcport=123, dstadr=10.66.0.65,

dstport=123, leap=00, stratum=2, precision=-20, rootdelay=306.686,

rootdispersion=37.537, refid=10.5.26.10, reach=377, unreach=0, hmode=3,

pmode=4, hpoll=8, ppoll=8, flash=00 ok, keyid=0, ttl=0, offset=-0.014,

delay=0.312, dispersion=9.491, jitter=1.704,

reftime=ceefdf8c.e2a278cd Thu, Jan 7 2010 12:20:28.885,

org=ceefe1f8.5f74624a Thu, Jan 7 2010 12:30:48.372,

rec=ceefe1f8.5f7e5b59 Thu, Jan 7 2010 12:30:48.373,

xmt=ceefe1f8.5e570beb Thu, Jan 7 2010 12:30:48.368,

filtdelay= 4.47 0.35 4.48 0.31 2.85 4.68 0.33 2.47,

filtoffset= 2.08 -0.14 2.00 -0.01 -1.27 2.10 -0.05 1.07,

filtdisp= 0.00 3.84 7.70 11.55 15.42 19.25 23.09 26.94

ntpq >

We take the flash value, which can be passed through

http://www.eecis.udel.edu/~mills/ntp/html/decode.html#flash

This link looks at why time servers are not trusted.

Note: flash=00 ok indicates that ntpd client trusts time server.

reach=000 indicates that the ntpd client has not received the time packet from the time server.

ref =INIT indicates that the timing action is being initialized.

flash=400 indicates that the accuracy value of the time server (provided by the time server) is too high and the ntpd client does not trust the time server.

reach=003 indicates that the ntpd client has received 2 packets from the time server.

Supplement: modify/etc/ntp.conf on solaris, set server to 10.10.10.72, and then restart the service to take effect

Observe the status of the current NTP service with ntpq -p and ntptrace 10.10.10.72.

Suspend ntpd service and execute ntpd -n -dddd to gather information for about 20 minutes.

service ntpd stop

ntpd -n -dddd > ntpdebug Collect information and reanalyze

View ntp service status for 10.10.10.72:

a), svcs|grep ntp

b), pkginfo | grep ntp

c), netstat -an|grep 123

View ntp status/etc/init.d/ntpd status

The above is the analysis of how to carry out ntp time service shared by Xiaobian for everyone. If there are similar doubts, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report