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 use the clockdiff command in Linux

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to use the clockdiff command in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Timestamp data can be placed in both the header of ip message and the header of ICMP message. The clockdiff program uses timestamps to measure the system time difference between the destination host and the local host.

Clockdiff detects the time difference between two linux hosts

Option-o: use the IP timestamp option to measure the system time difference. Only three timestamps are used. -o1: use the IP timestamp option to measure the system time difference. Use 4 timestamps. If-o and-o1 are not set, then the ICMP timestamp is used to test the system time difference. Example lixi@lixi-desktop:~$ ping-T tsandaddr www.ustc.edu.cn-c 1 PING www.ustc.edu.cn (202.38.64.9) 56 (124) bytes of data. 64 bytes from 202.38.64.9: icmp_seq=1 ttl=62 time=0.823 ms TS: lixi-desktop.local (210.45.74.25) 12522473 absolute 210.45.74.1-251 local-gw.ustc.edu.cn (202.38.64.126) 248202.38.64.9-857514 Unrecorded hops: 3-www.ustc.edu.cn ping statistics-1 packets transmitted, 1 received, 0 packet loss Time 0ms rtt min/avg/max/mdev = 0.823 ms 0.823 ms 0.823 RRT is first obtained from the above when the RRT is small. Several ICMP timestamps. The time difference between the local host and 202.38.64.9 is about-8575140248-2511487517. Test the system time of the above routes with-o (timestamp in the IP option) and without option (ICMP routing timestamp). The results obtained are:

Lixi@lixi-desktop:~#. / clockdiff-o 202.38.64.9. Host=202.38.64.9 rtt=1 (0) ms/1ms delta=-857517ms/-857517ms Wed Dec 17 11:28:30 2008 lixi@lixi-desktop:~#. / clockdiff 202.38.64.9. Host=202.38.64.9 rtt=750 (187) ms/0ms delta=-857517ms/-857517ms Wed Dec 17 11:28:35 2008 both methods are more accurate.

Lixi@lixi-desktop:~#./clockdiff gigagate1.Princeton.EDU... Host=gigagate1.Princeton.EDU rtt=307 (21) ms/271ms delta=-5ms/-5ms Wed Dec 17 11:50:16 2008 above is to test the system time difference between the destination host and the local host with a large RTT. When using clockdiff, however, you need a bit of luck, because many routes ignore ICMP or IP timestamps.

Thank you for reading! This is the end of this article on "how to use clockdiff commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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: 286

*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

Development

Wechat

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

12
Report