使用MTR分析网络延迟及丢包
Last updated
2023-01-28 10:37:50
{"value":"### \u95ee\u9898\u63cf\u8ff0\n\n\u672c\u5730\u8bbf\u95ee\u4e91\u670d\u52a1\u5668\uff0c\u6216\u8005\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u8bbf\u95ee\u5176\u4ed6\u7f51\u7edc\u8d44\u6e90\u65f6\uff0c\u53d1\u73b0\u7f51\u7edc\u5361\u987f\u3002\u4f7f\u7528 ping \u547d\u4ee4\uff0c\u53d1\u73b0\u7f51\u7edc\u5b58\u5728\u4e22\u5305\u6216\u65f6\u5ef6\u8f83\u9ad8\u7684\u60c5\u51b5\u3002\n\n### \u95ee\u9898\u5206\u6790\n\n\u4e22\u5305\u6216\u65f6\u5ef6\u8f83\u9ad8\u53ef\u80fd\u662f\u9aa8\u5e72\u94fe\u8def\u62e5\u585e\u3001\u94fe\u8def\u8282\u70b9\u6545\u969c\u3001\u670d\u52a1\u5668\u8d1f\u8f7d\u9ad8\u3001\u7cfb\u7edf\u8bbe\u7f6e\u95ee\u9898\u7b49\u539f\u56e0\u5f15\u8d77\u3002\u5728\u6392\u9664\u4e91\u670d\u52a1\u5668\u81ea\u8eab\u539f\u56e0\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 MTR \u8fdb\u884c\u8fdb\u4e00\u6b65\u8bca\u65ad\u3002\nMTR \u662f\u4e00\u6b3e\u7f51\u7edc\u8bca\u65ad\u5de5\u5177\uff0c\u5176\u5de5\u5177\u8bca\u65ad\u51fa\u7684\u62a5\u544a\u53ef\u4ee5\u5e2e\u52a9\u60a8\u786e\u8ba4\u7f51\u7edc\u95ee\u9898\u7684\u75c7\u7ed3\u6240\u5728\u3002\n\n### \u89e3\u51b3\u65b9\u6848\n\n\u4e0b\u9762\u4ee5 Linux \u548c Windows \u4e91\u670d\u52a1\u5668\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528 MTR \u4ee5\u53ca\u5982\u4f55\u5bf9 MTR \u7684\u62a5\u544a\u7ed3\u679c\u8fdb\u884c\u5206\u6790\u3002\n\n**\u6ce8**\uff1a\u5982\u679c\u672c\u5730\u6216\u4e91\u670d\u52a1\u5668\u7981Ping\uff0c\u5219MTR\u5c06\u65e0\u7ed3\u679c\u3002\n\n#### **Windows\u64cd\u4f5c\u7cfb\u7edf\u4f7f\u7528MTR\u8fc7\u7a0b**\n\n**WinMTR**\uff1a\u9002\u7528\u4e8e Windows \u7cfb\u7edf\u7684\u514d\u8d39\u7f51\u7edc\u8bca\u65ad\u5de5\u5177\uff0c\u96c6\u6210\u4e86 Ping \u548c tracert \u7684\u529f\u80fd\uff0c\u5177\u6709\u56fe\u5f62\u754c\u9762\uff0c\u53ef\u4ee5\u76f4\u89c2\u5730\u770b\u5230\u5404\u4e2a\u8282\u70b9\u7684\u54cd\u5e94\u65f6\u95f4\u548c\u4e22\u5305\u60c5\u51b5\u3002\n\n**\u7b2c\u4e00\u6b65\uff1a\u4e0b\u8f7d\u5b89\u88c5WinMTR**\n\n1.\u767b\u5f55 Windows \u4e91\u670d\u52a1\u5668\u3002\n\n2.\u5728\u64cd\u4f5c\u7cfb\u7edf\u754c\u9762\uff0c\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9\uff08\u6216\u5176\u4ed6\u5408\u6cd5\u6e20\u9053\uff09\u4e0b\u8f7d\u5bf9\u5e94\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b\u7684 WinMTR \u5b89\u88c5\u5305\u3002\n\n3.\u89e3\u538b\u7f29 WinMTR \u5b89\u88c5\u5305\u3002\n\n**\u7b2c\u4e8c\u6b65\uff1a\u4f7f\u7528WinMTR**\n\n1.\u53cc\u51fb\u6253\u5f00WinMTR\u5de5\u5177\u3002\n\n2.\u5728\u5728 WinMTR \u7a97\u53e3\u7684 **Host** \u5904\uff0c\u8f93\u5165\u76ee\u7684\u670d\u52a1\u5668 IP \u6216\u8005\u57df\u540d\uff0c\u5355\u51fb **Start**\u3002\n\n Host\uff1ax.x.x.x Start\n\n3.\u6839\u636e\u5b9e\u9645\u60c5\u51b5\uff0c\u7b49\u5f85 WinMTR \u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\uff0c\u5355\u51fb **Stop**\uff0c\u7ed3\u675f\u6d4b\u8bd5\u3002\n\n Hostname Nr Loss% Sent Recv Best Avrg Worst Last\n x.x.x.x 1 0 60 60 50 55 60 52\n x.x.x.x 2 0 60 60 60 67 78 69\n\n**\u6d4b\u8bd5\u7ed3\u679c\u7684\u4e3b\u8981\u4fe1\u606f\u5982\u4e0b\uff1a**\n\n- Hostname\uff1a\u5230\u76ee\u7684\u670d\u52a1\u5668\u8981\u7ecf\u8fc7\u7684\u6bcf\u4e2a\u4e3b\u673a IP \u6216\u540d\u79f0\u3002\n- Nr\uff1a\u7ecf\u8fc7\u8282\u70b9\u7684\u6570\u91cf\u3002\n- Loss%\uff1a\u5bf9\u5e94\u8282\u70b9\u7684\u4e22\u5305\u7387\u3002\n- Sent\uff1a\u53d1\u9001\u7684\u6570\u636e\u5305\u6570\u91cf\u3002\n- Recv\uff1a\u63a5\u6536\u5230\u54cd\u5e94\u7684\u6570\u91cf\u3002\n- Best\uff1a\u6700\u77ed\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n- Avrg\uff1a\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u3002\n- Worst\uff1a\u6700\u957f\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n- Last\uff1a\u6700\u8fd1\u4e00\u6b21\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n\n#### **Linux\u64cd\u4f5c\u7cfb\u7edf\u4f7f\u7528MTR\u8fc7\u7a0b**\n\n**MTR**\uff1aLinux \u5e73\u53f0\u4e0a\u8bca\u65ad\u7f51\u7edc\u72b6\u6001\u7684\u5de5\u5177\uff0c\u7ee7\u627f\u4e86 Ping\u3001traceroute\u3001nslookup \u7684\u529f\u80fd\uff0c\u9ed8\u8ba4\u4f7f\u7528 ICMP \u5305\u6d4b\u8bd5\u4e24\u4e2a\u8282\u70b9\u4e4b\u524d\u7684\u7f51\u7edc\u8fde\u63a5\u60c5\u51b5\u3002\n\n**\u7b2c\u4e00\u6b65 \u5b89\u88c5MTR**\n\nCentOS\u7cfb\u7edf\uff1a\n\n yum -y install mtr\n\nUbuntu\u7cfb\u7edf\uff1a\n\n sudo apt-get install mtr\n\n**Linux MTR \u76f8\u5173\u53c2\u6570\u8bf4\u660e**\n\n- -h\/--help\uff1a\u663e\u793a\u5e2e\u52a9\u83dc\u5355\n- -v\/--version\uff1a\u663e\u793a MTR \u7248\u672c\u4fe1\u606f\n- -r\/--report\uff1a\u7ed3\u679c\u4ee5\u62a5\u544a\u5f62\u5f0f\u8f93\u51fa\n- -p\/--split\uff1a\u4e0e --report \u76f8\u5bf9\uff0c\u5206\u522b\u5217\u51fa\u6bcf\u6b21\u8ddf\u8e2a\u7684\u7ed3\u679c\n- -c\/--report-cycles\uff1a\u8bbe\u7f6e\u6bcf\u79d2\u53d1\u9001\u7684\u6570\u636e\u5305\u6570\u91cf\uff0c\u9ed8\u8ba4\u662f10\n- -s\/--psize\uff1a\u8bbe\u7f6e\u6570\u636e\u5305\u7684\u5927\u5c0f\n- -n\/--no-dns\uff1a\u4e0d\u5bf9 IP \u5730\u5740\u505a\u57df\u540d\u89e3\u6790\n- -a\/--address\uff1a\u7528\u6237\u8bbe\u7f6e\u53d1\u9001\u6570\u636e\u5305\u7684 IP \u5730\u5740\uff0c\u4e3b\u8981\u7528\u6237\u5355\u4e00\u4e3b\u673a\u591a\u4e2a IP \u5730\u5740\u7684\u573a\u666f\n- -4\uff1aIPv4\n- -6\uff1aIPv6\n\n**\u7b2c\u4e8c\u6b65 \u4f7f\u7528MTR**\n\n\u8fdb\u5165LInux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u8fd9\u91cc\u6d4b\u8bd5\u5230\u8c37\u6b4cdns\u670d\u52a1\u5668\u3002\n\n mtr 8.8.8.8 \n\n\u6267\u884c\u540e\u51fa\u73b0\u4e0b\u9762\u4fe1\u606f\u3002\n\n My traceroute [v0.85]\n CDNCloud (0.0.0.0) Fri Oct 21 01:16:02 2022\n Keys: Help Display mode Restart statistics Order of fields quit\n Packets Pings\n \n Host Loss% Snt Last Avg Best Wrst StDev\n 1. 154.91.84.1 1.0% 306 4.0 4.7 1.9 11.7 2.0\n 2. 10.25.23.5 0.0% 305 1.7 8.0 1.3 96.6 15.2\n 3. 10.10.99.116 0.0% 305 5.7 6.9 1.4 122.6 15.7\n 4. 10.10.99.82 0.0% 305 1.5 13.9 1.4 172.1 24.5\n 5. ???\n 6. 108.170.241.33 0.0% 305 3.9 4.0 3.6 6.0 0.1\n 7. 142.251.60.59 0.0% 305 2.3 2.2 2.2 4.6 0.1\n 8. dns.google 0.0% 305 2.8 2.7 2.7 3.3 0.0\n\n**\u4e3b\u8981\u8f93\u51fa\u7684\u4fe1\u606f\u5982\u4e0b\uff1a**\n\n- HOST\uff1a\u8282\u70b9\u7684 IP \u5730\u5740\u6216\u57df\u540d\u3002\n- Loss%\uff1a\u4e22\u5305\u7387\u3002\n- Snt\uff1a\u6bcf\u79d2\u53d1\u9001\u7684\u6570\u91cf\u5305\u7684\u6570\u91cf\u3002\n- Last\uff1a\u6700\u8fd1\u4e00\u6b21\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n- Avg\uff1a\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u3002\n- Best\uff1a\u6700\u77ed\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n- Wrst\uff1a\u6700\u957f\u7684\u54cd\u5e94\u65f6\u95f4\u3002\n- StDev\uff1a\u6807\u51c6\u504f\u5dee\uff0c\u504f\u5dee\u503c\u8d8a\u9ad8\uff0c\u8bf4\u660e\u5404\u4e2a\u6570\u636e\u5305\u5728\u8be5\u8282\u70b9\u7684\u54cd\u5e94\u65f6\u95f4\u76f8\u5dee\u8d8a\u5927\u3002\n\n#### \u6839\u636e\u7ed3\u679c\u5206\u6790\u4ee5\u53ca\u5904\u7406\n\n\u6ce8\uff1a\u7531\u4e8e\u7f51\u7edc\u72b6\u51b5\u7684\u975e\u5bf9\u79f0\u6027\uff0c\u9047\u5230\u672c\u5730\u5230\u670d\u52a1\u5668\u7684\u7f51\u7edc\u95ee\u9898\u65f6\uff0c\u5efa\u8bae\u60a8\u6536\u96c6\u53cc\u5411\u7684 MTR \u6570\u636e\uff08\u4ece\u672c\u5730\u5230\u4e91\u670d\u52a1\u5668\u4ee5\u53ca\u4e91\u670d\u52a1\u5668\u5230\u672c\u5730\uff09\u3002\n\n1.\u6839\u636e\u62a5\u544a\u7ed3\u679c\uff0c\u67e5\u770b\u76ee\u7684\u670d\u52a1\u5668 IP \u662f\u5426\u4e22\u5305\u3002\n\n- \u5982\u679c\u76ee\u7684\u5730\u6ca1\u6709\u4e22\u5305\uff0c\u5219\u8868\u793a\u7f51\u7edc\u6b63\u5e38\u3002\n- \u5982\u679c\u76ee\u7684\u5730\u53d1\u751f\u4e22\u5305\uff0c\u5219\u7ee7\u7eed\u4e0b\u4e00\u6b65\u3002\n\n2.\u5f80\u4e0a\u67e5\u770b\u62a5\u544a\u7ed3\u679c\uff0c\u5b9a\u4f4d\u7b2c\u4e00\u6b21\u4e22\u5305\u7684\u8282\u70b9\u3002\n\n- \u5982\u679c\u4e22\u5305\u53d1\u751f\u5728\u76ee\u7684\u670d\u52a1\u5668\uff0c\u5219\u53ef\u80fd\u662f\u76ee\u7684\u670d\u52a1\u5668\u7684\u7f51\u7edc\u914d\u7f6e\u4e0d\u5f53\u5f15\u8d77\uff0c\u8bf7\u68c0\u67e5\u76ee\u7684\u670d\u52a1\u5668\u7684\u9632\u706b\u5899\u914d\u7f6e\u3002\n- \u5982\u679c\u4e22\u5305\u5f00\u59cb\u4e8e\u524d\u4e09\u8df3\uff0c\u4e00\u822c\u4e3a\u672c\u5730\u8fd0\u8425\u5546\u7f51\u7edc\u95ee\u9898\uff0c\u5efa\u8bae\u68c0\u67e5\u8bbf\u95ee\u5176\u4ed6\u7f51\u5740\u662f\u5426\u5b58\u5728\u76f8\u540c\u60c5\u51b5\u3002\u5982\u679c\u5b58\u5728\u76f8\u540c\u60c5\u51b5\uff0c\u8bf7\u53cd\u9988\u7ed9\u60a8\u7684\u8fd0\u8425\u5546\u8fdb\u884c\u5904\u7406\u3002\n- \u5982\u679c\u6709\u9891\u7e41\u4e22\u5305\u7684\u60c5\u51b5\uff0c\u786e\u5b9e\u4e3a\u7f51\u7edc\u4e0d\u7a33\u5b9a\u7684\u573a\u666f\uff0c\u5219\u8bf7 \u63d0\u4ea4\u5de5\u5355 \u8fdb\u884c\u54a8\u8be2\uff0c\u5e76\u9644\u4e0a\u6d4b\u8bd5\u622a\u56fe\uff0c\u4ee5\u4fbf\u5de5\u7a0b\u5e08\u8fdb\u884c\u5b9a\u4f4d\u3002"}