Nelson's log

Shape Blizzard’s bittorrent client

Blizzard uses BitTorrent for distribution of their game clients and patches. Great idea, but their BitTorrent client lacks any user controlled bandwidth settings so it totally saturates your home network. And thanks to the combination of bufferbloat and 100+ active streams, TCP congestion control doesn’t much help.

What does help is router QoS. I use Tomato firmware and it has a very nice little QoS setting. The key classifier for Blizzard traffic is Source or Destination Port: 6881. That catches most of the TCP streams starting on your PC downloading the game client. I set it to Low priority, which gives my ssh, HTTP and DNS traffic at the router a fighting chance.

While I’m here, the most valuable router QoS setting is “prioritize ACK packets”. That helps stop large uploads from an ADSL line prevent simultaneous fast downloads.

Here’s a graph of my router outbound traffic while I’m busily downloading Diablo III to my laptop (class = Low) while simultaneously uploading a big file via ssh (class = Medium). The graph shows a lot of Highest priority traffic; I’m not sure, but I assume that’s ACK packets. I’m a little sad that low priority gets 50% of the bandwidth whereas medium only gets 25%: I don’t know if that’s how the QoS works or if it’s an artifact of Bittorrent using so many simultaneous streams.

Here’s my router QoS settings:

Match Rule Class Description
Port: 123
Highest ntp
Dst Port: 53
Transferred: 0 – 2KB
Highest DNS
Port: 22
Transferred: 0 – 1024KB
High ssh
Dst Port: 80,443
Transferred: 0 – 512KB
High WWW
Dst Port: 80,443
Transferred: 512KB+
Low WWW (512K+)
Dst Port: 53
Transferred: 2KB+
Lowest DNS (2K+)
Port: 119
Port: 563
Port: 6881
Low Blizzard BitTorrent

And for lolz, I’ve discovered my iMac + router + modem  has 2 megs of upload buffer. Boy that’s a lot. I should look into tweaking Tomato to lower the buffers. Or maybe find whatever the new hacker hipster router firmware is.

Update: the graph above was when I only identified source port 6881 as Blizzard traffic. Catching destination 6881 as well seems to help things a little.