Jun 19 2008

Using Primus and BitTorrent at the same time

Published by Jonathan Wise at 12:38 pm under Articles, Hacks

I’ve scoured the Internets and not found any best practices or recommendations for how to set-up hardware VoIP, like what’s offered by Primus in Canada, so that call quality is not affected by BitTorrent (or other bandwidth-heavy activity.) So documented here is the configuration I’ve found to work best.

But first, here’s how I originally had it set-up…

Initially I connected the Linksys VoIP gateway box that Primus sent me to my router (a Linksys WRT160N) figuring I could use its QoS to make sure that voice calls were given priority. I tried all of the QoS configuration methods available to ensure that the gateway was the highest priority device on my network: I set its MAC address and its physical port to “High” while everything else in QoS, especially the TCP ports being used by BitTorrent on both my computers were set to “Low.”

Frankly, this wasn’t enough. I constantly was connected to wrong numbers when I dialed out, and when I was able to connect, calls would be plagued by static and lag until I shut down the BitTorrent clients on both computers — and this was even when they both had significant “speed limits” enforced to ensure that neither was consuming more than 10kbps up or down.

I was more than a little frustrated. I pay $100 a month for business DSL, that promises 6mbps down (actually delivering around 5) and 800kbps up (actually delivering around 350.) Sure my DSL provider sucks, but thats another story. It should have been sufficient to download a total of 20kbps while still talking on the phone.

The problem, it turns out, was in Linksys’ QoS implementation. Its just not that good. The custom firmware available for the WRT54G series routers (plug for Tomato!) has much better QoS, and if I was willing to downgrade my hardware back to that venerable but older device, maybe I would have had better luck. But the WRT160N is a darn fast router, and I’m otherwise quite happy with it.

So here’s how I got things working — and suprisingly, it required following the advice of the Primus tech support guys… and then going just a little bit further. Who woulda thought a company’s tech support department actually knew what they were talking about?!

First of all, just do what they suggest, and put the gateway between your modem and your router. I know having another hardware device between the internet and your network probably rubs you the wrong way, but it’s OK, I promise! Connect your modem to your VoIP gateway, and your VoIP gateway to your router.

  • If you’re using DSL, you’ll need to provide your gateway with your PPPoE login info. This requires temporarily connecting my PC to the gateway’s Ethernet port, and then directing my browser to 192.168.0.1
  • If you’re using the Linksys SPA hardware gateway, when asked for authentication provide a username of “user” and a password of “primus” (for any other device, call Primus to find out the login information — don’t worry, they’ll give it to you.)
  • Now go into the WAN tab, and provide your PPPoE login info.
  • Reconnect the Ethernet port on your gateway to your router, connect your PC back to your router, and configure your router’s Internet connection for DHCP (if it isn’t already)
  • Find the Internet MAC address on your router (probably in the Status tab) and copy it.
  • Now return to the gateway config page (still 192.168.0.1) and go to “Advanced” (again, this is for the Linksys box, your settings may vary)
  • Under LAN set-up, add a DHCP reservation for your router, using the MAC address we looked up before, to make sure it always gets the same IP.
  • Now the final, most important step, is to DMZ your router. In the “Application” tab is a section where you specify the IP address of the device you want DMZed. Use the IP you reserved in the step above.

Save all your settings, and return to your router config pages. Now you can specify QoS for everything else inside your network. The VoIP gateway will make sure calls get priority over the DMZ device, but otherwise forwards everything right through to the router, which will make sure that everything else is QoSed the way you want it.

(Important side-note: If you don’t have a router, don’t DMZ your PC! This is never a good idea! The only reason DMZ is OK here, is because we have another hardware device protecting the internal network, and doing the port forwarding, etc…)

Using this configuration I can leave BitTorrent running all day, and still have great voice quality on my phone calls. I do still need to set a speed limit on my BitTorrent clients, which I have enforced during business hours (Transmission on the Mac has a “Speed Limit” option, uTorrent has a “Scheduler” — both allow you to constrain torrent activity during certain times) but not nearly as heavily as I had before.

Now that I have much less bandwidth available to me (down from 13MBPS on RoadRunner in New York) I’ve had to reverse the QoS policies I had articulated before so that Torrents are the lowest priority activity on my network. Skype is the highest priority, and HTTP/IMAP/SMTP traffic are in the middle. This keeps the web and e-mail moving quickly. Again, the VoIP Gateway, since its the first level traffic cop, makes sure than nothing is more important than voice calls.

Primus’ customer service isn’t much help, and tech support will give up on you fast if you seem to have a slow Internet connection. On the other hand, they seem to know that they have somewhat niche technology typically adopted by the more savvy, and assuming your connection is OK, they’re pretty willing to give you whatever advanced information you want to try and tweak your settings yourself…

Plus you can’t really beat their long distance prices, or that killer “Concierge” feature on the Portal page…

Popularity: 15% [?]

2 Responses to “Using Primus and BitTorrent at the same time”

  1. Jebuson 15 Jul 2008 at 4:53 pm

    Hi, I’m having about the same problem with my bittorrent. I work out of the house and I need a working phone to do so. When I run bittorrent though the phone lags and makes my voice jump in and out so it’s hard to hear wat I am saying forcing me to turn off bittorrent during the day. Is there any way to change bittorrents settings to correct this problem? I have high speed cable which actually gets more speed then the company promises so you would think just like u said this problem wouldn’t occur.

  2. Jonathan Wiseon 18 Jul 2008 at 7:03 am

    Ya, unfortunately since its impossible to QoS inbound traffic, you’ll still have to set up a speed limit or schedule on your BitTorrent client during the day when you might want to use your phone. How much you have to limit your torrents really depends on your connection speed…

Print This Post Print This Post   Trackback URI Comments RSS

Leave a Reply