{"id":5121,"date":"2019-10-18T18:47:44","date_gmt":"2019-10-18T10:47:44","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5121"},"modified":"2019-10-18T18:47:46","modified_gmt":"2019-10-18T10:47:46","slug":"clockdiff","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/clockdiff","title":{"rendered":"clockdiff\u547d\u4ee4 – \u68c0\u6d4b\u4e24\u53f0linux\u4e3b\u673a\u7684\u65f6\u95f4\u5dee"},"content":{"rendered":"\n
\u5728ip\u62a5\u6587\u7684\u9996\u90e8\u548cICMP\u62a5\u6587\u7684\u9996\u90e8\u90fd\u53ef\u4ee5\u653e\u5165\u65f6\u95f4\u6233\u6570\u636e\u3002 clockdiff \u7a0b\u5e8f\u6b63\u662f\u4f7f\u7528\u65f6\u95f4\u6233\u6765\u6d4b\u7b97\u76ee\u7684\u4e3b\u673a\u548c\u672c\u5730\u4e3b\u673a\u7684\u7cfb\u7edf\u65f6\u95f4\u5dee\u3002 <\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>clockdiff [\u53c2\u6570] [ip\u5730\u5740]<\/p>\n\n\n\n \u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n \u9996\u5148\u7531\u4e0a\u9762\u7684\u5f97\u51fa\u5728RRT\u4e0d\u5927\u7684\u65f6\u5019\uff0c\u51e0\u4e2aICMP\u65f6\u95f4\u6233\u7684\u5173\u7cfb\u3002\u672c\u5730\u4e3b\u673a\u548c202.38.64.9\u4e4b\u95f4\u7684\u65f6\u95f4\u5dee\u7ea6\u4e3a\uff1a-857514+248-251=-857517\u3002\u5206\u522b\u7528-o\uff08IP\u9009\u9879\u4e2d\u65f6\u95f4\u6233\uff09\u548c\u4e0d\u5e26\u9009\u9879\uff08ICMP\u8def\u7531\u65f6\u95f4\u6233\uff09\u4e0a\u8ff0\u8def\u7531\u7684\u7cfb\u7edf\u65f6\u95f4\u8fdb\u884c\u6d4b\u8bd5\u3002\u5f97\u5230\u7684\u7ed3\u679c\uff1a <\/p>\n\n\n\n \u4e24\u79cd\u65b9\u6cd5\u6d4b\u8bd5\u7684\u90fd\u6bd4\u8f83\u51c6\u786e:<\/p>\n\n\n\n \u4e0a\u9762\u662f\u6d4b\u8bd5\u4e00\u4e2aRTT\u8f83\u5927\u7684\u76ee\u7684\u4e3b\u673a\u548c\u672c\u5730\u4e3b\u673a\u7684\u7cfb\u7edf\u65f6\u95f4\u5dee\u3002\u4e0d\u8fc7\u5728\u4f7f\u7528clockdiff\u7684\u65f6\u5019\uff0c\u9700\u8981\u4e00\u70b9\u8fd0\u6c14\uff0c\u56e0\u4e3a\u5f88\u591a\u8def\u7531\u4f1a\u5ffd\u7565ICMP\u6216IP\u65f6\u95f4\u6233\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":" \u5728ip\u62a5\u6587\u7684\u9996\u90e8\u548cICMP\u62a5\u6587\u7684\u9996\u90e8\u90fd\u53ef\u4ee5\u653e\u5165\u65f6\u95f4\u6233\u6570\u636e\u3002 clockdiff \u7a0b\u5e8f\u6b63\u662f\u4f7f […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5121"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=5121"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5121\/revisions"}],"predecessor-version":[{"id":5233,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5121\/revisions\/5233"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-o<\/td> \u4f7f\u7528IP\u65f6\u95f4\u6233\u9009\u9879\u6765\u6d4b\u91cf\u7cfb\u7edf\u65f6\u95f4\u5dee\u3002\u65f6\u95f4\u6233\u53ea\u75283\u4e2a <\/td><\/tr> -o1<\/td> \u4f7f\u7528IP\u65f6\u95f4\u6233\u9009\u9879\u6765\u6d4b\u91cf\u7cfb\u7edf\u65f6\u95f4\u5dee\u3002\u75284\u4e2a\u65f6\u95f4\u6233\u3002\u5982\u679c-o\u548c-o1\u90fd\u6ca1\u6709\u8bbe\u7f6e\uff0c\u90a3\u4e48\u5c31\u662f\u7528ICMP\u65f6\u95f4\u6233\u6765\u6d4b\u8bd5\u7cfb\u7edf\u65f6\u95f4\u5dee <\/td><\/tr><\/tbody><\/table>\n\n\n\n [root@linuxcool ~]# ping -T tsandaddr www.ustc.edu.cn -c 1 \nPING 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 \nTS: lixi-desktop.local (210.45.74.25) 12522473 absolute 210.45.74.1 -251 \nlocal-gw.ustc.edu.cn (202.38.64.126) 248 \n202.38.64.9 -857514 Unrecorded hops: 3 \n\n--- www.ustc.edu.cn ping statistics \n--- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min\/avg\/max\/mdev = 0.823\/0.823\/0.823\/0.000 ms <\/pre>\n\n\n\n
[root@linuxcool ~]# .\/clockdiff -o 202.38.64.9 \n.................................................. \nhost=202.38.64.9 rtt=1(0)ms\/1ms delta=-857517ms\/-857517ms Wed Dec 17 11:28:30 2008<\/pre>\n\n\n\n
[root@linuxcool ~]# .\/clockdiff 202.38.64.9 \nhost=202.38.64.9 rtt=750(187)ms\/0ms delta=-857517ms\/-857517ms Wed Dec 17 11:28:35 2008 <\/pre>\n\n\n\n
[root@linuxcool ~]# .\/clockdiff gigagate1.Princeton.EDU\n.................................................. host=gigagate1.Princeton.EDU rtt=307(21)ms\/271ms delta=-5ms\/-5ms Wed Dec 17 11:50:16 2008 <\/pre>\n\n\n\n