IPFire 2.13 Beta 2 - Part 4 Bufferbloat

by Michael Tremer, January 28, 2013

Do you like what you are reading? Subscribe to our newsletter and don't miss out on the latest...   Join Now

I think it is very hard to explain what bufferbloat is to people, who are not network engineers or have only little experience in these things. But I will try it anyway, because it will change your life and how you experience the Internet.

Bufferbloat from the user perspective

Jim Gettys noticed this problem first, after his children said to him: “Daddy, the Internet is slow today!” I am sure we all have been there. You are running a huge down- or upload and literally nothing else finds its way through your modem. The latency of your internet connection is that high that any connection but the download/upload stream eventually time out.

But why is that? We have connections with a lot of bandwidth. Usually the internet is fast when you don’t have to share the connection, but if all familiy members are surfing at the same time, the experience drastically changes. That’s because your router or modem stores all the packets that have to be sent to the Internet in a queue that is called “buffer”. These buffers got huge over the last centuries, because memory is cheap and they “fixed” some problems we had. Obviously they did not fix it right.

If there is an upload which sends packets very fast, those will fill up the buffer very quickly and other packets are queued at the end. That sounds fair in the first place, because who comes first gets served first, right? No!

Networks transfer very different types of data. There is for example important management information like ICMP packets, DNS, DHCP and many more which are very small and important. After a few seconds, most of this information is moot. Then there are data streams that have slightly bigger packets which also need to be transferred as quickly as possible like VoIP telephony or online gaming. At last we have bulk data transfers which send huge amounts of data for a long time.

Without any other configuration, all clients on the networks send their packets to the router, which queues them and sends them out one by one. The result of that is, that important packets often stand last in line and it may take seconds(!) for them to reach the top of the queue to finally be sent out. In easy terms: When the buffer is full, it takes seconds for the packets to walk through it which makes everything slow!

Active Queue Management (AQM)

Van Jacobson and Kathleen Nichols built an algorithm that solves the problems by controlling the delay. The algorithm is called CoDel and belongs to the class of active queue management (AQM) algorithms. Basically the algorithm can detect good and bad traffic. Good traffic does not bloat the buffers and can therefore be ignored by the algorithm. Bad traffic has to be treated differently because it can massively increase the delay of the Internet link, so CoDel drops pakets from bad traffic streams to keep the buffer emptier.

The goal of the algorithm is to keep the minimum delay below 5 milliseconds. A major advantage over other implementations of AQM (like RED) is that CoDel is parameterless. Thus, it makes it a perfect solution for slow and fast links. It is also efficient that it can work in small home routers as well as high-end routers.

All that sounds really good, doesn’t it? You will now be able to have bulk transfers like uploading a YouTube video and you can still talk to other people over Voice-over-IP without too much latency, abrupted calls or artefarcts in the audio stream. You can also play your favourite online game and do not need to take of other people who are using the same Internet connection at the same time. While the algorithm is working, it does not decrease the maximum throughput of your internet connection in any way. You can use 100% of your available bandwidth.

As I have been using CoDel for a couple of months now, I feel that it has improved the Internet very much. Often you don’t even recognize what it has made better until you turn it off and have to work with the “old internet connection” again. The feature that counts the most for me is that it turns even slow links into usable ones, where faster speed is not available. So, please install IPFire 2.13 when it is out and you won’t have to configure anything to use CoDel. It just works out of the box.

Read more

I blogged about Bufferbloat a while ago where I made a benchmark: