How TCP-BBR Could Help Speed Up Internet

Wasin Thonkaew - May 8, 2017

I've come back to stay in Shenzhen, China since exactly 2 weeks ago.

Coming this time, Internet quality is pretty much worse than previous time in which I thought it was quite stable after fighting with GFW alot. Now the speed is quite low (lowest point can be < 1 Mb/s), and I cannot watch video online with good enough quality to enjoy the content. If it can be 144p in smooth manner, that's what the best I could ask for.

It's like GFW really knows how to adapt. It learns from analyzing ton of packets flowing within China, and across the border. It learns to cut my SSR connection (prior to this it was still Ok). I need to find a reactive solution to fight back.

I connected through my Shadowsocks server. Long before it was always SSR. Now I'm fully using SS. It's better strategy to have alternatives or back ups plan for your connection available.

TCP-BBR

I came across to find this terminology by reading discussion on shadowsocks-org repository on Github. Especially this, and this comment that shows the result of speed testing using TCP-BBR which is a lot higher.

I'm so hooked up with that. Thus I further did research on the topic on how to enable such feature on my proxy server.

Question found in comment that whether or not we need to enable it on both end of communication. Answer is no, so it's great as I'm quite aware that macOS won't likely to support and really need to catch up in pace. Take example of Fast TCP Open feature for Chrome on macOS. It still doesn't support!

What Is It?

In short and human word (in which by no mean I'm an expert on network matter, and I don't like to act like one), TCP-BBR is another algorithm in TCP congestion control. It improves what has already been there via loss-based congestion control which is predominantly used since 1980s.

This new scheme is contributed by Google which commited back to Linux kernel for general public to use.

Refer to these notable excerpts I captured from its commit link.

The factor of improvement is magnificent. Although numbers stated above would be as high as ~2kx. From what I got as tested it's roughly ~600x when pull content from upstream via Github clone command, or ~30x in downstream Internet speed in general. It's way better than before.

How to Enable It On Your Ubuntu 14.01 Server?

I learned the steps much from this guide (in Chinese). So big shoutout to him. Allow me to replicate steps in English with slightly modified here.

I have Ubuntu 14.01 in which this kernel version doesn't support TCP-BBR just yet. You have to upgrade your kernel.
Kernerl version 4.9+ is at least to support.

You should see output like net.ipv4.tcp_available_congestion_control = bbr hybla cubic reno, and
net.ipv4.tcp_congestion_control = bbr.

and lastly

lsmod | grep bbr

you should see tcp_bbr there in output.

Result

Speed gained as tested over speedtest.net, or via tool like speedtest-cli might not be tremondous high. I gained speed like 10-30x more, with lower ping (-~20ms).

But that increased speed plays a key role in consuming online content, in addition to performing Github commands i.e. cloning.

Result from my Github clone of big project in which normally I can clone it with average speed of around ~4KB/s then sometimes it would stall then connection broken. It only can succeed for small to almost medium size project with good Internet time (not too much traffic). But now I do get the following

Average speed is good which is 2MB/s and reliable.

It is not only Github, but also NPM which if you depend and use NodeJS-based packages, you will pull down lots of packages from it from time to time. Loads of files, and some certain package is very large in size. Thus they are much more better and reliable.

Finally, consuming video content online is much more pleasant without waiting for it to finishes buffering first. 360p quality in video is a norm, but if I need to go high like HD, I can do so too but slightly waiting in initial time might be required depends on traffic at that time. I also can watch live streaming without problem. Anyway, 360p quality is good enough for experience in my case of consuming educational, tutorial, songs kind of video.

In short, TCP-BBR helps significantly with minimal effort in upgrading your kernel to support it.
As it's an addition to TCP protocol, it is compatible for all proxy applications you're using.

Give TCP-BBR a try. I strongly believe you will experience much better quality of Internet speed.

I blog about projects I'm working on. Mostly about mobile games, tech, web service, little tiny things I built for myself or for public, and tech/game industry-wide. Currently I'm living in Shenzhen, China. I'm running a small creative company with my girlfriend here.