Windows 11上开启TCP BBR2 网络拥塞控制

一般我们使用Linux系列操作系统都会安装下谷歌的BBR网络拥塞控制软件。现在Windows 11 上可以开启BBR v2版本了。

BBRv2 是一种基于模型的拥塞控制算法,旨在降低队列、低损耗和(有界的)Reno/CUBIC 共存。维护一个模型网络路径,它使用带宽和 RTT 的测量值,以及(如果发生)数据包丢失和/或 DCTCP/L4S 样式的 ECN 信号。

BBR2比BBR更"公平",在有延迟和丢包的情况下,它的速度会远慢于BBR,有时比默认的CUBIC还慢,所以开不开得根据自己的链路做测试,一般来说只能算是聊胜于无的东西。

Windows Server现在默认使用CUBIC拥塞控制算法,这也是目前最常用的拥塞控制算法。

相关链接

谷歌BBR GitHub:https://github.com/google/bbr

TCP BBR v2 Alpha/预览版介绍:https://github.com/google/bbr/blob/v2alpha/README.md

操作步骤

Windows 11

要求Windows 11是22h2版本及以上。

1.打开powershell并右键管理员权限运行

netsh int tcp set supplemental Template=Internet CongestionProvider=bbr2
netsh int tcp set supplemental Template=Datacenter CongestionProvider=bbr2
netsh int tcp set supplemental Template=Compat CongestionProvider=bbr2
netsh int tcp set supplemental Template=DatacenterCustom CongestionProvider=bbr2
netsh int tcp set supplemental Template=InternetCustom CongestionProvider=bbr2

2.验证是否开启成功

Get-NetTCPSetting | Select SettingName, CongestionProvider

Linux

查看当前拥塞控制算法

sysctl net.ipv4.tcp_congestion_control

如果输出是sysctl net.ipv4.tcp_congestion_control类似的东西,意味着我们当前的算法是CUBIC,我们编辑/etc/sysctl.conf将其更改为BBR

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

保存并应用

sysctl -p

再次检查我们将看到

net.ipv4.tcp_congestion_control = bbr

上面显示net.ipv4.tcp实际在IPv6中也可以用。

恢复设置

有时候开启后可能会出现意料之外的问题。

我们可以在powershell中输入下面命令恢复。

netsh int tcp set supplemental template=internet congestionprovider=CUBIC
netsh int tcp set supplemental template=internetcustom congestionprovider=CUBIC
netsh int tcp set supplemental template=Datacenter congestionprovider=CUBIC
netsh int tcp set supplemental template=Datacentercustom congestionprovider=CUBIC

TCP congestion control:https://en.wikipedia.org/wiki/TCP_congestion_control

BBR: Congestion-Based Congestion Control:https://research.google/pubs/pub45646/

文章链接:https://www.haah.net/archives/8817.html
文章标题:Windows 11上开启TCP BBR2 网络拥塞控制
文章版权:辉哥博客 (https://www.haah.net) 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!
本文最后更新发布于2023年03月08日 22时14分18秒,某些文章具有时效性,若有错误或已失效,请在下方留言或联系辉哥:m@haah.net

给TA买糖
共{{data.count}}人
人已买糖
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
我是底线可爱胖!冲鸭~