Using DD-WRT with HFSC and l7 protocol inspection to prioritise VOIP traffic

 Let me start by saying that DD-WRT is great, it supports a huge range of hardware and mostly does what it says it'll do. The glaring exception unfortunately is Quality of Service 'QoS', the DD-WRT implementation is totally broken. My requirements for QoS were probably the same as virtually everyone else who looks into traffic shaping -- allow surfing and VOIP to continue even when there are large P2P transfers. In DD-WRT there is a QoS tab, which looks like it should make what I wanted to do quite easy, but every time I enabled QoS based on L7 protocol inspection it made my latency huge and it felt like browsing on a 56k modem.

This is because there are some unresolved bugs in the way DD-WRT turns the data from the user interface into the scripts that actually do the heavy lifting. Fortunately it is quite easy to install a custom script that works around this problem. In OpenWRT this is actually the normal way to do things, and there is a very useful thread on the OpenWRT forums, although the script presented there didn't quite meet my needs.

The basis for this script is one created by 'Morph3ous' as described in his blog which lays the basis for getting HFSC to work. I have added the ability to filter based on l7 protocol inspection because that is the only way to identify skype traffic and hopefully made it easier to configure.

It seems to work well so far, I can talk on skype with good audio quality even while bittorrent is running which was my main objective. Unlike the built in QoS web browsing remains responsive.

To use this script simply turn off all of the built in QoS, browse to administration > commands, paste the script into the text box and hit 'save firewall'.

Download QoS.sh.zip