Best way to implement Traffic Shaping?



  • I have been trying a while to get traffic shaping working. We are using asterisk (sip) over the Teliax network. We have a Verizon DSL connection coming in- 1 MBPS down and 384k UP. Yes, very little bandwidth and the Traffic Shaping settings I implement (using the wizard) does not really work. If I want to allocate 256 kbps of voip traffic it throws an error message about something to do with 80% of the bandwidth usage needs to be set for QOS. If you need the exact error message I can give it to you. Yes I did try allocating much less space but when I would do a speed test or download something, quality is distorted. The only luck I had was telling the traffic shaping wizard that i am only getting 300 kbps down and 50 up and allocating very little bandwidth for voip. Traffic shaping worked like a charm but when I ran speed tests (during my phone call and after the phone call) I was only getting 250-300k of bandwidth down (and 50 up).
    Is there any workaround to get this working?
    All help appreciated
    Thanks



  • You need to go into the Queues section under the traffic shaper and adjust the realtime and bandwidth settings for the other queues.
    The default settings probably won't suit your needs and you need to adjust them accordingly.

    More likely than not, the only realtime settings you really probably need are for Voip queue and qWanAcks.  The rest of the queues can go by Linkshare for starters and tweak according to your needs.  Setting their Bandwidth share to 1% basically turns the shaper into a pseudo-CBQ with bandwidth limiting capabilities.



  • I tried your suggestion and changed the few things to kbps instead of % and also changed around the numbers. Unfortunately it still did not work, and I was getting thrown a bunch of errors at a certain point. I think error 115 (from what I remember) but something about a parent number being lower than what I configured. If you need me to post more details let me know
    But, when I did get it right finally, when I ran speed tests while on the phone I got nowhere.



  • Would be good if you actually posted your requirements for traffic shaping and your Link speeds.

    It does sound like you actually entered 'Kb' in the bandwidth box rather than use the dropdown box to switch from '%' to 'Kb'.

    If you want to just reserved a fixed amount of bandwidth, say 256Kb/s downstream and 64kb/s upstream for your voip calls, then set:

    qLanRoot to 1Mb/s (possibly less depending on your connection)
    qWanRoot to 346Kb/s (90% of theoretical)

    qWanAcks will probably do fine with 5% Bandwidth, Realtime M2 1Kb
    qLanAcks should not require more than 8Kb Bandwidth, Realtime 1Kb

    qVoipUp should be set to 1% Bandwidth, Realtime 64Kb
    qVoipDown should be set to 1% Bandwidth, Realtime 256Kb

    qLanDef should be set to Bandwidth 1%, Upperlimit 73% (since 1Mb/s - 256Kb/s gives about that amount remaining), ECN enabled
    qWanDef Bandwidth 1%, Upperlimit 75%, ECN enabled

    Of course, you need to tweak the settings here and there.  I don't use Voip so I can't tell you how to adjust the M1 and D parameters accordingly (I know that they should be set to guarantee the bandwidth at the start)



  • I selected kb from the drop down list
    You mentioned that I have the option to resrve bandwidth for VoIP calls. From my understanding, this will allocate bandwidth for voip whether or not calls are in progress. Correct me if I am wrong. If I am correct, is there any possible way to tell pfsense: "When a voip call is in progress, start allocating 256kb of bandwidth for the duration of the call. Then when the call is hung up, allow the full 1mbps/384k of bandwidth to be utilized without any interferences"?



  • @hatboy:

    I selected kb from the drop down list
    You mentioned that I have the option to resrve bandwidth for VoIP calls. From my understanding, this will allocate bandwidth for voip whether or not calls are in progress. Correct me if I am wrong. If I am correct, is there any possible way to tell pfsense: "When a voip call is in progress, start allocating 256kb of bandwidth for the duration of the call. Then when the call is hung up, allow the full 1mbps/384k of bandwidth to be utilized without any interferences"?

    Play around with the Bandwidth/ Linkshare setting together with realtime.  You won't quite get exactly what you want;  but I think it's close enough.

    Make sure Voip queues have the highest priority (aside from acks).

    In the above example, you can try

    qVoipUp should be set to 20% Bandwidth, Realtime: M1 64Kb D 30 M2 1Kb
    qVoipDown should be set to 26% Bandwidth, Realtime: 256Kb D 30 M2 1Kb



  • @hatboy:

    is there any possible way to tell pfsense: "When a voip call is in progress, start allocating 256kb of bandwidth for the duration of the call. Then when the call is hung up, allow the full 1mbps/384k of bandwidth to be utilized without any interferences"?

    There's a way to do this, but it's not pretty.  :-\

    http://www.xmission.com/~hidden/aatqos

    I modified my pfSense install to use snort to tell if a voice call is active.  When the call goes live, it launches a script that reconfigures the router to limit everything but VoIP to a much smaller % of bandwidth.  Once the call is done, that's detected by snort and removes the limit opening up the entire bandwidth without interferences.

    Let us know if you figure a way to do this completely within pfSense using the standard shaper.  I'd love to hear success stories.



  • is traffic shaping on wireless to lan bridged interfacing working with any1 coz i just dont see the wireless traffic falling into any configured queue other than the default queue.


Log in to reply