How to setup traffic shaping in monowall for VOIP

I read this on the monowall mailing list, it was posted by Michael Graves


“Sure. Although it helps to know what protocols you run through m0n0. My Asterisk server places outgoing calls via IAX2 and accepts incomming calls via both IAX2 and SIP.

You absolutely have to start with a real world measurment of your connect speeds up and down. Your traffic shapping must not saturate either of those or the benefit will be lost.

The use the Magic Shaper Wizard on the Traffic Shaping tool. This will setup basic rules, pipes and queues. You should have two pipes; Total_upload & Total_download.

Here’s where I change the setup a little. I add a third pipe called Dedicated_IAX_upload. I split my upload data rate between Total_upload and Dedicated_IAX_upload. In my case on Covad ADSL with a measured 650kbps upload I set my total upload speed for only 600kbps. I then assign 384kbps to pipe 2 (Total_upload) and 256kbps to pipe 3


In essence, I full time assign about 40% of my outbound bandwidth to the voip stuff.

Then in the rules section of traffic shaper I add two rules for my Asterisk traffic. All UDP traffic from the servers IP to the wan is driected to pipe3. All UDP traffic from the wan to the server is assigned to Queue 8 which is High_priority_download.

Of course you need firewall NAT and port forwarding settings in place as well. The traffic shaping isn’t port specific in my arrangement.

I’ve had my Asterisk & m0n0 system in use for about 2 years. You need to understand that traffic shaping won’t cure bandwidth issues, but it will make some situation more acceptable. I found that adding G.729 codecs to my server was also very helpfull in reducing the demand for bandwidth.

Also, I don’t use any p2p stuff beyond Skype…which I’d rather not use but many of my overseas coworkers are addicted.”

VOIP at Home: Skype vs SIP / IAX2

Recently a friend asked me about which VOIP solution is best this is what I told him.

“Skype is the easier to setup it handles NAT traversal very well, the handsets we use for Skype (<£30) are USB so need to be plugged into a PC to work. I believe you can now get Skype Adaptors for normal analog phones and Skype phones that don’t need a PC to work, I don’t have any experience of these and they will be more expensive ~£100.

VOIPtalk offer SIP/IAX2 services, the handsets that support these protocols start at £50 but you should spend at least £80 to get a half decent one. You will need a CAT5 socket to connect them to your LAN although you could use WiFi. If you want to have several phones in your house with each room acting as an extension then you should think about installing Linux/Asterisk onto an old PC and run your own mini PBX. This will take a lot more setting up and the learning curve is a lot steeper. You pay a one-off fee of £10 for an inbound 0845 number and buy credit in £5-£50 chunks, you can set your account to auto top-up to save you the hassle of topping up via their website. If you go the VOIPTALK route make sure your Broadband Router has QoS functionality otherwise you won’t be able to hear people when you are downloading large files. It will also need port forwarding and I would recommend using IAX2 over SIP as it only requires one port to be forwarded.
Some (most) routers will not allow SIP to traverse NAT.

In terms of call quality / reliability Skype has the edge in Internet=>Internet calls (which are also free) and Voiptalk has the edge in Internet=>Landline/Mobile calls.

Re call charges, I don’t think there is a lot in it but you can checkout their respective websites.

I’m sure your aware that more and more ISP’s are starting to offer VOIP services so you might be able to get what your looking for that way.”