{"id":181594,"date":"2020-05-17T09:22:59","date_gmt":"2020-05-17T01:22:59","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181594"},"modified":"2020-05-09T09:23:14","modified_gmt":"2020-05-09T01:23:14","slug":"linux-3-network","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-3-network.html","title":{"rendered":"Linux\u4e0b3\u79cd\u5e38\u7528\u7684\u7f51\u7edc\u6d4b\u901f\u5de5\u5177\u7b80\u4ecb"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e0d\u7ba1\u4f60\u7528\u7684\u662f\u4ec0\u4e48\u64cd\u4f5c\u7cfb\u7edf\uff0c\u7f51\u901f\u90fd\u662f\u4f60\u975e\u5e38\u5173\u5fc3\u7684\u4e00\u4e2a\u6027\u80fd\u6307\u6807\uff0c\u6bd5\u7adf\uff0c\u8c01\u90fd\u4e0d\u60f3\u770b\u4e2a\u89c6\u9891\u7ed3\u679c\u7f51\u901f\u5361\u5230\u4f60\u6000\u7591\u4eba\u751f\u3002\u672c\u6587\u4ecb\u7ecd\u4e09\u4e2a Linux \u547d\u4ee4\u884c\u4e0b\u7684\u7f51\u7edc\u6d4b\u901f\u5de5\u5177\uff0c\u8ba9\u4f60\u968f\u65f6\u968f\u5730\u77e5\u9053\u4f60\u7684\u7f51\u7edc\u72b6\u51b5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

fast<\/strong><\/div>\n

fast \u662f Netflix \u63d0\u4f9b\u7684\u4e00\u9879\u670d\u52a1\uff0c\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6765\u4f7f\u7528\uff0c\u800c\u4e14\u53ef\u4ee5\u76f4\u63a5\u5728 Web \u7aef\u4f7f\u7528\uff1afast.com\u3002<\/p>\n

\"\"<\/p>\n

\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u8fd9\u4e2a\u5de5\u5177\uff1a<\/p>\n

$ npm install --global fast-cli<\/pre>\n

\u4e0d\u7ba1\u662f\u7f51\u9875\u7aef\u8fd8\u662f\u547d\u4ee4\u884c\uff0c\u5b83\u90fd\u63d0\u4f9b\u4e86\u6700\u57fa\u672c\u7684\u7f51\u7edc\u4e0b\u8f7d\u6d4b\u901f\u3002\u547d\u4ee4\u884c\u4e0b\u6700\u7b80\u5355\u7684\u4f7f\u7528\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n

$ fast\r\n\u00a0 \u00a0 93 Mbps \u2193<\/pre>\n

\u4ece\u4ee5\u4e0a\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u76f4\u63a5\u4f7f\u7528 fast \u547d\u4ee4\u7684\u8bdd\uff0c\u5c06\u53ea\u8fd4\u56de\u7f51\u7edc\u4e0b\u8f7d\u901f\u5ea6\u3002\u5982\u679c\u4f60\u4e5f\u60f3\u83b7\u53d6\u7f51\u7edc\u7684\u4e0a\u4f20\u901f\u5ea6\uff0c\u5219\u9700\u8981\u4f7f\u7528 -u \u9009\u9879\u3002<\/p>\n

$ fast -u\r\n\u00a0 \u00a0 \u2827 81 Mbps \u2193 \/ 8.3 Mbps \u2191<\/pre>\n
speedtest<\/strong><\/div>\n

speedtest \u662f\u4e00\u4e2a\u66f4\u52a0\u77e5\u540d\u7684\u5de5\u5177\u3002\u5b83\u662f\u7528 Python \u5199\u6210\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528 apt \u6216 pip \u547d\u4ee4\u6765\u5b89\u88c5\u3002\u4f60\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e0b\u4f7f\u7528\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5c06\u5176\u5bfc\u5165\u5230\u4f60\u7684 Python \u9879\u76ee\u3002<\/p>\n

\u5b89\u88c5\u65b9\u5f0f\uff1a<\/p>\n

$ sudo apt install speedtest-cli\r\n$ sudo pip3 install speedtest-cli<\/pre>\n

\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c speedtest \u547d\u4ee4\u5373\u53ef\uff1a<\/p>\n

$ speedtest\r\nRetrieving speedtest.net configuration...\r\nTesting from Tencent cloud computing (140.143.139.14)...\r\nRetrieving speedtest.net server list...\r\nSelecting best server based on ping...\r\nHosted by Henan CMCC 5G (Zhengzhou) [9.69 km]: 28.288 ms\r\nTesting download speed................................................................................\r\nDownload: 56.20 Mbit\/s<\/pre>\n

Testing upload speed......................................................................................................
\nUpload: 1.03 Mbit\/s<\/p>\n

\u4ece\u8fd0\u884c\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0cspeedtest \u547d\u4ee4\u5c06\u76f4\u63a5\u63d0\u4f9b\u4e0a\u4f20\/\u4e0b\u8f7d\u901f\u7387\uff0c\u6d4b\u8bd5\u7684\u8fc7\u7a0b\u4e5f\u662f\u633a\u5feb\u7684\u3002\u4f60\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u811a\u672c\u6765\u8c03\u7528\u8fd9\u4e2a\u547d\u4ee4\uff0c\u7136\u540e\u5b9a\u671f\u8fdb\u884c\u7f51\u7edc\u6d4b\u8bd5\uff0c\u5e76\u5728\u7ed3\u679c\u4fdd\u5b58\u5728\u4e00\u4e2a\u6587\u4ef6\u6216\u6570\u636e\u5e93\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u5b9e\u65f6\u8ddf\u8e2a\u4f60\u7684\u7f51\u7edc\u72b6\u6001\u3002<\/p>\n

iPerf<\/strong><\/div>\n

iperf \u662f\u4e00\u4e2a\u7f51\u7edc\u6027\u80fd\u6d4b\u8bd5\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u6d4b\u8bd5 TCP \u548c UDP \u5e26\u5bbd\u8d28\u91cf\uff0c\u53ef\u4ee5\u6d4b\u91cf\u6700\u5927 TCP \u5e26\u5bbd\uff0c\u5177\u6709\u591a\u79cd\u53c2\u6570\u548c UDP \u7279\u6027\uff0c\u53ef\u4ee5\u62a5\u544a\u5e26\u5bbd\uff0c\u5ef6\u8fdf\u6296\u52a8\u548c\u6570\u636e\u5305\u4e22\u5931\u3002\u5229\u7528 iperf \u8fd9\u4e00\u7279\u6027\uff0c\u53ef\u4ee5\u7528\u6765\u6d4b\u8bd5\u4e00\u4e9b\u7f51\u7edc\u8bbe\u5907\u5982\u8def\u7531\u5668\uff0c\u9632\u706b\u5899\uff0c\u4ea4\u6362\u673a\u7b49\u7684\u6027\u80fd\u3002<\/p>\n

Debian \u7cfb\u7684\u53d1\u884c\u7248\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5 iPerf \uff1a<\/p>\n

$\u00a0sudo\u00a0apt\u00a0install\u00a0iperf<\/pre>\n

\u8fd9\u4e2a\u5de5\u5177\u4e0d\u4ec5\u4ec5\u5728 Linux \u7cfb\u7edf\u4e0b\u53ef\u4ee5\u7528\uff0c\u5728 Mac \u548c Windows \u7cfb\u7edf\u540c\u6837\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n

\u5982\u679c\u4f60\u60f3\u6d4b\u8bd5\u7f51\u7edc\u5e26\u5bbd\uff0c\u5219\u9700\u8981\u4e24\u53f0\u7535\u8111\u3002\u8fd9\u4e24\u53f0\u7535\u8111\u9700\u8981\u5904\u4e8e\u540c\u6837\u7684\u7f51\u7edc\uff0c\u4e00\u53f0\u4f5c\u4e3a\u670d\u52a1\u673a\uff0c\u53e6\u4e00\u53f0\u4f5c\u4e3a\u5ba2\u6237\u673a\uff0c\u5e76\u4e14\u4e8c\u8005\u5fc5\u987b\u90fd\u8981\u5b89\u88c5 iPerf \u3002<\/p>\n

\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u83b7\u53d6\u670d\u52a1\u5668\u7684 IP \u5730\u5740\uff1a<\/p>\n

$\u00a0ip\u00a0addr\u00a0show\u00a0|\u00a0grep\u00a0inet.*brd\r\n\u00a0\u00a0\u00a0\u00a0inet\u00a0192.168.242.128\/24\u00a0brd\u00a0192.168.242.255\u00a0scope\u00a0global\u00a0dynamic\u00a0noprefixroute\u00a0ens33<\/pre>\n

\u6211\u4eec\u77e5\u9053\uff0c\u5728\u5c40\u57df\u7f51\u91cc\uff0c\u6211\u4eec\u7684 ipv4 \u5730\u5740\u4e00\u822c\u662f\u4ee5 192.168 \u5f00\u5934\u7684\u3002\u8fd0\u884c\u4ee5\u4e0a\u547d\u4ee4\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u8bb0\u4e0b\u670d\u52a1\u673a\u7684\u5730\u5740\uff0c\u540e\u9762\u4f1a\u7528\u5230\u3002
\n\u4e4b\u540e\uff0c\u6211\u4eec\u518d\u5728\u670d\u52a1\u673a\u4e0a\u542f\u52a8 iperf \u5de5\u5177\uff1a<\/p>\n

$\u00a0iperf\u00a0-s<\/pre>\n

\u7136\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7b49\u5f85\u5ba2\u6237\u673a\u7684\u63a5\u5165\u4e86\u3002\u5ba2\u6237\u673a\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fde\u4e0a\u670d\u52a1\u673a\uff1a<\/p>\n

$\u00a0iperf\u00a0-c\u00a0192.168.242.128<\/pre>\n

\u901a\u8fc7\u51e0\u79d2\u949f\u7684\u6d4b\u8bd5\uff0c\u5b83\u5c31\u4f1a\u8fd4\u56de\u7f51\u7edc\u4f20\u8f93\u901f\u7387\u53ca\u5e26\u5bbd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

fast \u662f Netflix \u63d0\u4f9b\u7684\u4e00\u9879\u670d\u52a1\uff0c\u5b83\u4e0d\u4ec5\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6765\u4f7f\u7528\uff0c\u800c\u4e14\u53ef\u4ee5\u76f4\u63a5\u5728 Web \u7aef\u4f7f\u7528\uff1afa […]<\/p>\n","protected":false},"author":323,"featured_media":169030,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-181594","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=181594"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181594\/revisions"}],"predecessor-version":[{"id":181640,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181594\/revisions\/181640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/169030"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}