{"id":145,"date":"2022-03-21T15:29:51","date_gmt":"2022-03-21T07:29:51","guid":{"rendered":"http:\/\/www.wangzheduo.com\/?p=145"},"modified":"2022-03-21T15:29:51","modified_gmt":"2022-03-21T07:29:51","slug":"ubuntu-17-04-%e5%bc%80%e5%90%af-tcp-bbr-%e6%8b%a5%e5%a1%9e%e6%8e%a7%e5%88%b6%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wangzheduo.com\/?p=145","title":{"rendered":"Ubuntu 17.04 \u5f00\u542f TCP BBR \u62e5\u585e\u63a7\u5236\u7b97\u6cd5"},"content":{"rendered":"<div class=\"clear\">\u6982\u8ff0<\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\" class=\"blogpost-body blogpost-body-html\">\n<div class=\"content-body\">\n<p>TCP BBR \u7531\u8c37\u6b4c\u5f00\u53d1\uff0c\u5373 TCP \u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u5176\u76ee\u7684\u5728\u4e8e\u6700\u5927\u5316\u5229\u7528\u7f51\u7edc\u94fe\u8def\u3002\u77e5\u4e4e\u4e0a\u7684\u89e3\u91ca\u975e\u5e38\u8d34\u5207\uff0c\u4e00\u6761\u7f51\u7edc\u94fe\u8def\u5c31\u50cf\u4e00\u6839\u6c34\u7ba1\uff0c\u6700\u5927\u5316\u5229\u7528\u8fd9\u6839\u6c34\u7ba1\u7684\u529e\u6cd5\u5219\u662f\u7528\u6c34\u5c06\u5176\u5145\u6ee1\u3002TCP BBR \u8981\u89e3\u51b3\u7684\u95ee\u9898\uff1a<\/p>\n<ol>\n<li>\u5145\u5206\u5229\u7528\u5b58\u5728\u4e00\u5b9a\u4e22\u5305\u7387\u7684\u7f51\u7edc\u94fe\u8def\uff1b<\/li>\n<li>\u964d\u4f4e\u7f51\u7edc\u5ef6\u8fdf\uff1b<\/li>\n<\/ol>\n<p>Linux kernel 4.9+ \u5df2\u7ecf\u96c6\u6210 TCP BBR \u7b97\u6cd5\uff0c\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728 Ubuntu Server 17.04 x86_64 \u4e0a\u5f00\u542f TCP BBR \u7b97\u6cd5\u3002<\/p>\n<h2>\u51c6\u5907\u5de5\u4f5c<\/h2>\n<p>\u672c\u6587\u662f\u9488\u5bf9\u6d77\u5916\u4e91\u670d\u52a1\u5668\u7684\u6280\u672f\u6307\u5357\uff0c\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u4e91\u670d\u52a1\u5668\uff0c\u8bf7\u521b\u5efa<\/p>\n<h2>\u68c0\u67e5\u7cfb\u7edf\u5185\u6838<\/h2>\n<p>\u622a\u6b62\u672c\u6587\u53d1\u5e03\uff0cUbuntu 17.04 x86_64 \u53d1\u884c\u7248\u5185\u6838\u7248\u672c\u4e3a\u00a0<em>GNU\/Linux 4.10.0-24-generic x86_64<\/em>\uff0c\u53ea\u9700\u786e\u4fdd\u5185\u6838\u7248\u672c\u5927\u4e8e\u7b49\u4e8e Linux 4.9 \u5373\u53ef\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre><code class=\"hljs language-shell\"><span class=\"hljs-meta\"># <\/span><span class=\"language-bash\"><span class=\"hljs-built_in\">uname<\/span> -r<\/span>\r\n4.10.0-24-generic\r\n<\/code><\/pre>\n<h2>\u5f00\u542f BBR<\/h2>\n<p>\u6267\u884c\u547d\u4ee4<\/p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"net.core.default_qdisc=fq\"<\/span> &gt;&gt; \/etc\/sysctl.conf\r\n<span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"net.ipv4.tcp_congestion_control=bbr\"<\/span> &gt;&gt; \/etc\/sysctl.conf\r\n<\/code><\/pre>\n<p>\u6267\u884c\u547d\u4ee4\uff0c\u4f7f\u8bbe\u7f6e\u751f\u6548\u6267\u884c<\/p>\n<pre><code class=\"hljs language-ini\"><span class=\"hljs-comment\"># sysctl -p<\/span>\r\n<span class=\"hljs-attr\">net.core.default_qdisc<\/span> = fq\r\n<span class=\"hljs-attr\">net.ipv4.tcp_congestion_control<\/span> = bbr<\/code><\/pre>\n<h2>\u68c0\u67e5 BBR \u662f\u5426\u5f00\u542f\u6210\u529f<\/h2>\n<p>\u6267\u884c\u547d\u4ee4\uff0c\u7ed3\u679c\u4e2d\u6709 bbr \u5373\u8868\u793a\u5185\u6838\u5df2\u5f00\u542f BBR \u7b97\u6cd5\u3002<\/p>\n<pre><code class=\"hljs language-ini\"><span class=\"hljs-comment\"># sysctl net.ipv4.tcp_available_congestion_control<\/span>\r\n<span class=\"hljs-attr\">net.ipv4.tcp_available_congestion_control<\/span> = bbr cubic re<span class=\"hljs-literal\">no<\/span><\/code><\/pre>\n<p>\u6267\u884c\u547d\u4ee4\uff0c\u7ed3\u679c\u6709 tcp_bbr \u4e00\u884c\u8868\u793a BBR \u5df2\u6210\u529f\u542f\u52a8\u3002<\/p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># lsmod | grep bbr<\/span>\r\ntcp_bbr                20480  0\r\n<\/code><\/pre>\n<h2>\u7981\u7528 BBR<\/h2>\n<p>\u4f9d\u6b21\u6267\u884c\u547d\u4ee4<\/p>\n<pre><code class=\"hljs language-shell\"><span class=\"hljs-meta\"># <\/span><span class=\"language-bash\">sed -i <span class=\"hljs-string\">'\/net\\.core\\.default_qdisc=fq\/d'<\/span> \/etc\/sysctl.conf<\/span>\r\n<span class=\"hljs-meta\"># <\/span><span class=\"language-bash\">sed -i <span class=\"hljs-string\">'\/net\\.ipv4\\.tcp_congestion_control=bbr\/d'<\/span> \/etc\/sysctl.conf<\/span>\r\n<span class=\"hljs-meta\"># <\/span><span class=\"language-bash\">sysctl -p<\/span><\/code><\/pre>\n<p>\u91cd\u542f\u7cfb\u7edf<\/p>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># reboot<\/span><\/code><\/pre>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u7531\u4e8e Ubuntu 17.04 \u91c7\u7528\u4e86\u6700\u65b0\u7684 Linux \u5185\u6838\uff0c\u56e0\u6b64\u5f00\u542f TCP BBR \u975e\u5e38\u7b80\u5355\uff0c\u5f00\u542f\u540e\u5e26\u5bbd\u63d0\u5347\u4f1a\u76f8\u5f53\u660e\u663e\u3002\u7248\u672c\u8f83\u4f4e\u7684\u64cd\u4f5c\u7cfb\u7edf\u8981\u5148\u5347\u7ea7\u5185\u6838\u5230 Linux 4.9 \u53ca\u4ee5\u4e0a\u624d\u80fd\u5f00\u542f BBR \u7b97\u6cd5\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 TCP BBR \u7531\u8c37\u6b4c\u5f00\u53d1\uff0c\u5373 TCP \u62e5\u585e\u63a7\u5236\u7b97\u6cd5\uff0c\u5176\u76ee\u7684\u5728\u4e8e\u6700\u5927\u5316\u5229\u7528\u7f51\u7edc\u94fe\u8def\u3002\u77e5\u4e4e\u4e0a\u7684\u89e3\u91ca\u975e\u5e38\u8d34\u5207\uff0c\u4e00\u6761\u7f51\u7edc\u94fe\u8def\u5c31\u50cf\u4e00\u6839\u6c34\u7ba1\uff0c\u6700\u5927\u5316\u5229\u7528\u8fd9\u6839\u6c34\u7ba1\u7684\u529e\u6cd5\u5219\u662f\u7528\u6c34\u5c06\u5176\u5145\u6ee1\u3002TCP BBR \u8981\u89e3&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/posts\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=145"}],"version-history":[{"count":1,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=\/wp\/v2\/posts\/145\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wangzheduo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}