2013/07/27

Software Rants 14: Queue Disciplines

Rabbit hole time! After getting my TR-WDR3600 router to replace a crappy Verizon router/dsl modem combo in preparation for my switch to cablevision internet (for soon ye of 150 KB/s down and 45 KB/s up ye days be numbered) I have dived headfirst into the realm of openwrt, and the myriad of peculiarities that make up IEE 802. 

My most recent confrontation was over outbound queueing - I found my experience using my (constantly bottlenecked) DSL connection pitiful in terms of how well page loads were performing and how responsive websites were under load, so I investigated.

I found a pitiful amount of documentation besides the tc-X man pages on the queue algorithms the kernel supports. I was actually reading the source pages (here are my picks of interest). 

So of course I go right for the shiny new thing, codel. It is a part of the 3.3 kernel buffer bloat tuning. It has to be better than the generic fifo queue, right? The qos package of luci in openwrt always uses hfsc, for example, so it requires elbow grease and an ssh connection to get fq_codel running.

Well, not really. It is just ssh root@router.lan tr qdisc add dev eth0.2 root fq_codel. But it is the thought that counts. 


What did make me happy was the reinforcement of my purchase decision by the Atheros driver (ath71xx) being one of the few kernel 3.3 supported BQL drivers. So that was good. It is currently running on my wan connection, we'll see how it works.

What I found interesting was that apparently the networking in Linux is a real clusterfuck. Who would have known. The bufferbloat problem from a few years ago was, and still is, serious business. And according to documentation 802.11n drivers are much, much worse than just ethernet switches.


It was an educational learning process, though. Codel is a near-stateless, near-bufferless, classless queue discipline that is supposed to handle network variability well and work out of the box, which is exactly what the next generation of network routing algorithms needs. And if it works well, I hope it takes over the world, because fifo queues are so 2002.

2 comments:

  1. Codel is the queue length management algorithm
    fq_codel is flow queue-ing + codel

    In 2002, we had wondershaper, and it worked well for the range of bandwidths available at the time. But SFQ didn't scale, and RED was too hard to configure, and thus we ended up with the clusterfoo we have now.

    fq_codel is a replacement for various combinations of SFQ or DRR + RED and it scales well from 4Mbit to 10GigE, and is somewhat helpful on wifi.

    So by all means turn it on on wireless and wired.

    That said, you DO need to rate limit your incoming and outgoing connection below what your provider has provisioned with something like htb or hfsc so fq_codel can take real effect on your outgoing link. (unless you have hardware flow control)

    fq_codel is *on* on openwrt's qos in barrier breaker. There are also scripts that use htb from cerowrt that work pretty good.

    https://github.com/dtaht/ceropackages-3.3/tree/master/net/aqm-scripts

    http://www.bufferbloat.net/projects/cerowrt/wiki/Bloat-videos

    It would be good to convince more providers to try this stuff on their rate control systems as well.

    ReplyDelete
  2. Thanks for the info! I'm only using it on a very bandwidth constrained home network but I am hopeful eventually fq_codel can eventually get rid of the fifo queuing that currently causes a lot of nascent slowdown problems in routers when nobody knows about it (mainly due to tail packet dropping).

    ReplyDelete