{"id":8473,"date":"2024-06-08T08:01:01","date_gmt":"2024-06-08T00:01:01","guid":{"rendered":""},"modified":"2024-06-08T08:01:01","modified_gmt":"2024-06-08T00:01:01","slug":"ping\u547d\u4ee4\u662f\u4ec0\u4e48\u7aef\u53e3_traceroute\u547d\u4ee4\u7ed3\u679c\u8be6\u89e3","status":"publish","type":"post","link":"https:\/\/mushiming.com\/8473.html","title":{"rendered":"ping\u547d\u4ee4\u662f\u4ec0\u4e48\u7aef\u53e3_traceroute\u547d\u4ee4\u7ed3\u679c\u8be6\u89e3"},"content":{"rendered":"
\n \u4f5c\u8005\uff1a\u5e73\u89e3\u6280\u672f\u63a7
\n
https:\/\/www.jianshu.com\/p\/828c0f\n <\/p><\/blockquote>\nLinux\u547d\u4ee4\u6709\u5f88\u591a\uff0c\u4eca\u5929\u8ddf\u5927\u5bb6\u4ecb\u7ecd\u5e38\u7528\u7684\u4e24\u4e2a\u547d\u4ee4ping \u3001traceroute\u547d\u4ee4\uff0c\u6309\u7167\u5de5\u5177\u7684\u4f5c\u7528\uff0c\u539f\u7406\uff0c\u7528\u6cd5\u4e09\u4e2a\u7ef4\u5ea6\u6765\u7406\u89e3\u3002<\/p>\n
\u4e00\u3001ping<\/strong><\/h4>\n
1.\u4f5c\u7528<\/h5>\n
\u63a2\u6d4b\u7aef\u5230\u7aef\u7684\u8fde\u901a\u6027\uff0c\u5305\u5f80\u8fd4\u65f6\u5ef6\u3002<\/p>\n
2.\u539f\u7406<\/h5>\n
icmp\u534f\u8bae\uff0c\u662f\u5728IP\u534f\u8bae\u4e4b\u4e0a\u7684\u4e00\u79cd\u534f\u8bae\uff0c\u5305\u62ec\u9996\u90e8\u548c\u6570\u636e\u4e24\u4e2a\u90e8\u5206\u3002icmp\u534f\u8bae\u5934\u90e8\u7684\u4e09\u4e2a\u56fa\u5b9a\u5b57\u6bb5\uff0ctype,code,checksum\u3002ping\u4f7f\u7528\u5176\u4e2dtype\u4e3a8\u548c0\u7684\u4e24\u79cd\u7c7b\u578b\u3002type8\u4e3arequest\uff0ctype 0 \u4e3areply\u3002\u9996\u90e8\u5176\u4ed6\u5b57\u6bb5\u56e0\u4e0d\u540c\u5305\u7c7b\u578b\u6709\u6240\u533a\u5206\u3002<\/p>\n
\u901a\u8fc7\u6293\u5230\u7684\u5305\uff0c\u6765\u770b\u4e0b\u5404\u4e2a\u5b57\u6bb5\u3002<\/p>\n
<\/p>\n
ping\u62a5\u6587<\/p>\n
request\u5305<\/h5>\n
<\/p>\n
ping-request\u5305<\/p>\n
<\/p>\n
ping-reply\u5305<\/p>\n
\u53ef\u4ee5\u770b\u51fa\uff0cping\u5305\u5934\u90e8\u9664\u4e86\u4e09\u4e2a\u56fa\u5b9a\u5b57\u6bb5\u4e4b\u5916\uff0c\u8fd8\u6709Identifier\uff0cSequence\u3002data\u5b57\u6bb5\u4e3aTimestamp\u3002\u5176\u4e2dIdentifier\uff0cSequence\u4e3b\u8981\u662f\u4e3a\u4e86\u8ba9request,reply\u80fd\u914d\u5bf9\uff0c\u6bd4\u5982\u54ea\u4e2areply\u662f\u56de\u590d\u54ea\u4e2arequest\u7684\u3002\u770b\u4e0a\u56fe\u7684request\u548creply\u5305\uff0cIdentifier BE LE \u76f8\u540c\uff0cIdentifier\u4e00\u822c\u662f\u53d1\u9001\u7684\u8fdb\u7a0b\u53f7\u3002Sequence number BE LE \u4e5f\u76f8\u540c\uff0c\u8868\u793a\u53d1\u9001\u7684\u5e8f\u5217\u53f7\uff0c\u4e00\u5bf9\u8bf7\u6c42\u548c\u7b54\u590d\u5305Sequence number BE LE \u76f8\u540c\u3002Timestamp\u91cc\u9762\u8bb0\u5f55\u4e86\u4f20\u8f93\u65f6\u95f4\u6233\u548c\u5e8f\u5217\u53f7\u3002\u9996\u5148\u770brequest\u5305\u91cc\u9762\u7684\u53d1\u9001\u65f6\u95f4\uff0c\u548creply\u5305\u91cc\u9762\u7684\u53d1\u9001\u65f6\u95f4\u76f8\u540c\u3002<\/p>\n
<\/p>\n
request\u4e2d\u7684timestamp\u5b57\u6bb5<\/p>\n
<\/p>\n
reply\u4e2d\u7684timestamp\u5b57\u6bb5<\/p>\n
Response time\uff0crtt\u6b63\u662f reply\u5305\u91cc\u9762relative\u65f6\u95f4\u51cf\u53bbrequest\u5305\u91cc\u9762\u7684\u65f6\u95f4\u3002<\/p>\n
\u6240\u4ee5ping\u5305\u53ef\u4ee5\u8fde\u7eed\u7684\u53bb\u7ed9\u5bf9\u7aef\u53d1request\uff0c\u800c\u4e0d\u7528\u7b49\u5bf9\u7aef\u56de\u590d\u67d0\u4e00\u4e2a\u5305\u4e4b\u540e\u518d\u53d1\uff0c\u9ed8\u8ba41s \u53d1\u9001\u4e00\u4e2arequest\u5305\u3002<\/p>\n
3.\u7528\u6cd5<\/h5>\n
\u4e0d\u5e26\u4efb\u4f55\u53c2\u6570\uff0c\u9ed8\u8ba4ping \u7684\u6570\u636e\u5305\u5927\u5c0f\u662f 56 \u5b57\u8282\u3002\u4f1a\u6301\u7eed\u4e0d\u65ad\u7684ping\u4e0b\u53bb\u3002<\/p>\n
\u8f93\u51fa\u53c2\u6570\u89e3\u91ca\uff1amin\/avg\/max\/stddev \u524d\u4e09\u4e2a\u597d\u7406\u89e3\uff0c\u6700\u540e\u4e00\u4e2a\u53c2\u6570\uff0cmac\u4e0b\u662fstddev\uff0clinux\u4e0b\u9762\u662f mdev Mean Deviation\uff0c\u4ee3\u8868 ICMP \u5305\u7684 RTT \u504f\u79bb\u5e73\u5747\u503c\u7684\u7a0b\u5ea6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u503c\u770b\u51fa\u7f51\u7edc\u6296\u52a8\u7684\u60c5\u51b5\uff0cmdev\u503c\u8d8a\u5927\u8bf4\u660e\uff0c\u6574\u4e2a\u94fe\u8def\u4e0a\u7684\u5305\u5ef6\u65f6\u8d8a\u4e0d\u7a33\u5b9a\u3002\u503c\u8d8a\u5c0f\uff0c\u8bf4\u660e\u8d8a\u7a33\u5b9a\u3002<\/p>\n
<\/p>\n
ping\u4e0d\u5e26\u53c2\u6570\u7ed3\u679c<\/p>\n
ping\u53c2\u6570\u7528\u6cd5\uff1a<\/p>\n
-l \u6307\u5b9a\u53d1\u9001\u5305\u7684\u5927\u5c0f<\/p>\n
-c \u6307\u5b9a\u53d1\u9001\u5305\u7684\u6b21\u6570<\/p>\n
-i \u6307\u5b9a\u53d1\u9001\u95f4\u9694\uff0c\u9ed8\u8ba4\u662f1s<\/p>\n
-I \u6307\u5b9a\u53d1\u9001\u5305\u7684\u7f51\u5361 \uff0c\u4e00\u822c\u662f\u67e5\u770b\u8def\u7531\u8868\uff0c\u54ea\u4e2a\u7f51\u5361\u8def\u7531\u5339\u914d\u7528\u54ea\u4e2a\u7f51\u5361\u53d1\u9001\u3002<\/p>\n
<\/p>\n
ping\u53c2\u6570\u5b66\u4e60<\/p>\n
\u4ee5\u4e0a\u6307\u5b9a\u4e86 \u5305\u5927\u5c0f\uff0c-M do\u8868\u793a\u4e0d\u8981\u5206\u7247\uff0c-c 4 \u6b21\u6570\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5728\u63a2\u6d4b\u94fe\u8defmtu\u7684\u65f6\u5019\u4f1a\u7528\u5230\u3002<\/p>\n
\u4e8c\u3001traceroute<\/strong><\/h4>\n
1.\u4f5c\u7528<\/h5>\n
\u63a2\u6d4b\u7aef\u5230\u7aef\uff0c\u94fe\u8def\u6bcf\u4e00\u8df3\u7684\u65f6\u5ef6\u3002<\/p>\n
2.\u539f\u7406<\/h5>\n
\u5148\u770b\u4e00\u4e2atraceroute\u7684\u8bbf\u95ee\u622a\u56fe\u548c\u6293\u5305\u622a\u56fe<\/p>\n
<\/p>\n
traceroute\u8bbf\u95ee\u622a\u56fe<\/p>\n
\u6e90IP \uff1a192.16843,87 \u5bb6\u91cc\u7684\u5c40\u57df\u7f51\u5730\u5740<\/p>\n
<\/p>\n
traceroute\u6293\u5305\u622a\u56fe<\/p>\n
\u6e90IP \uff1a192.16843,87 \u5bb6\u91cc\u7684\u5c40\u57df\u7f51\u5730\u5740<\/p>\n
\u76ee\u7684IP: 61.135.169.121 \u767e\u5ea6\u7684\u5730\u5740<\/p>\n
\u53ef\u4ee5\u770b\u51fatraceroute\u5f00\u59cb\u7684\u65f6\u5019\uff0c\u6e90\u5730\u5740\u53d1\u5305\uff0cttl \u503c\u4f9d\u6b21\u4ece\u4e3a1,1,12,2,2,3,3,3...ttl\u4f9d\u6b21\u589e\u5927\uff0c\u5e76\u4e14\u6bcf\u4e2attl\u503c\u53d1\u4e09\u4e2a\u5305\u3002\u5728\u770b\u53d1\u5305\u6e90\u7aef\u53e3 44136\uff0c\u4e00\u76f4\u6ca1\u6709\u53d8\uff0c\u8bbf\u95ee\u7684\u76ee\u7684\u7aef\u53e3\u4ece 33435\u4f9d\u6b21\u589e\u5927\u3002tracroute\u5047\u8bbe\u670d\u52a1\u5668\u7684\u7aef\u53e3 33435\u6ca1\u6709\u76d1\u542c\uff0c\u5982\u679c\u6070\u5de7\u8fd9\u4e2a\u7aef\u53e3\u670d\u52a1\u7aef\u76d1\u542c\u4e86\uff0c\u90a3\u4e48traceroute\u5c31\u4e0d\u80fd\u6b63\u5e38\u5224\u65ad\u4e86\u3002\u8def\u5f84\u4e0a\u7684\u6bcf\u4e00\u8df3\uff0c\u6216\u8005\u8fd4\u56deicmp ttl\u8d85\u65f6\u7684\u9519\u8bef\u5305\uff0c\u6216\u8005\u4e0d\u8fd4\u56de\uff0c\u76f4\u5230\u8fbe\u5230\u4e3b\u673a\u4e4b\u540e\uff0c\u4e3b\u673a\u4f1a\u8fd4\u56de\u4e00\u4e2a\u670d\u52a1\u4e0d\u53ef\u8fbe\u7684\u5305\uff0c\u8fd9\u4e2a\u65f6\u5019trcaeroute\u8ba4\u4e3a\u63a2\u6d4b\u5230\u4e86\u4e3b\u673a\u3002<\/p>\n
ttl\u4e3a1\u7684\u5305\u53d1\u51fa\u53bb\u4e4b\u540e\uff0c\u6536\u5230\u4e86\u4e2d\u95f4\u8def\u7531\u5668\u7684\u56de\u5305\uff0c\u50cfttl\u4e3a 2\uff0c3\u7684\u5305\u6ca1\u6709\u6536\u5230\u56de\u5305\uff0c\u63a7\u5236\u53f0\u770b\u7684\u7ed3\u679c\u4e3a *<\/p>\n
<\/p>\n
traceroute\u6ca1\u6709\u6536\u5230\u56de\u5305\u4e3a*<\/p>\n
\u770b\u4e0b\u53d1\u5305\u7684\u8be6\u7ec6\u7279\u5f81\uff1a<\/p>\n
<\/p>\n
traceroute\u53d1\u5305<\/p>\n
\u53ef\u4ee5\u770b\u51fa\u8fd9\u4e2a\u5305\u662fUDP\u5305<\/p>\n
<\/p>\n
traceroute-ttl\u8d85\u65f6\u54cd\u5e94\u5305<\/p>\n
\u53ef\u4ee5\u770b\u51fa\u8fd9\u4e2a\u5305\u662f ICMP\u5305\uff0ctype 11\uff0ccode 0 \uff0cTTL\u8d85\u65f6\u5305\u3002\u8fd9\u4e2a\u5305\u7684\u6e90\u5730\u5740\u4e3a 192.168.43.138\u4e3a\u4e2d\u95f4\u8def\u7531\u5668\u7684\u53d1\u56de\u6765\u7684\u5305\u3002\u8fd9\u4e2a\u5305\u5c06\u53d1\u5305\u7684\u4fe1\u606f\u5c01\u88c5\u5230\u4e86\u81ea\u5df1\u91cc\u9762\uff0c\u53ef\u4ee5\u548c\u4e0a\u4e00\u4e2a\u56fe\u5bf9\u6bd4\u3002<\/p>\n
3.\u7528\u6cd5<\/h5>\n
\u5e38\u89c4\u7684\u7528\u6cd5\u5982\u4e0a\u9762\uff0c\u770b\u4e0b\u54ea\u4e00\u4e2a\u8def\u5f84\u4e0a\u7684\u5ef6\u65f6\u53d8\u5927\u3002\u9664\u4e86UDP\u5305\u63a2\u6d4b\u4e4b\u5916\uff0ctraceroute\u8fd8\u53ef\u4ee5\u6307\u5b9a\u4f7f\u7528TCP\u534f\u8bae\u63a2\u6d4b\uff0c\u53ef\u4ee5\u4f7f\u7528-p\u6307\u5b9a\u7aef\u53e3<\/p>\n
\u547d\u4ee4\uff1atraceroute -T www.baidu.com<\/p>\n
\u63a2\u6d4bmtu\u5927\u5c0f: traceroute www.baidu.com -F 1472<\/p>\n
<\/p>\n
trcaeroute-tcp\u8fd4\u56de\u7ed3\u679c<\/p>\n
\u597d\u6587\u63a8\u8350\uff1a<\/p>\n
\u522b\u603b\u5199\u4ee3\u7801\uff0c\u8fd9130\u4e2a\u7f51\u7ad9\u6bd4\u6da8\u5de5\u8d44\u90fd\u91cd\u8981<\/p>\n
30\u5206\u949f\u7406\u89e3\u51b3\u7b56\u6811\u7684\u57fa\u672c\u539f\u7406<\/p>\n
\u6700\u65b02020\u5e743\u6708\u4efd\u7f16\u7a0b\u8bed\u8a00\u6392\u884c\u699c\u8be6\u60c5<\/p>\n
<\/p>\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"ping\u547d\u4ee4\u662f\u4ec0\u4e48\u7aef\u53e3_traceroute\u547d\u4ee4\u7ed3\u679c\u8be6\u89e3\u4f5c\u8005\uff1a\u5e73\u89e3\u6280\u672f\u63a7https:\/\/www.jianshu.com\/p\/828c0fLinux\u547d\u4ee4\u6709\u5f88\u591a\uff0c\u4eca\u5929\u8ddf\u5927\u5bb6...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8473"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=8473"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/8473\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=8473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=8473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=8473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}