Traffic Shaper problem since RC1

  • Hi, before installing RC1 I was running some Beta that I don't remember the snapshot date. Anyways, before upgrading my Traffic Shaper rules for my Asterisk server where working flawlessly, but since the upgrade many persons tell me that I have a digital voice, and I can hear some times artifact. So I checked the queue used and the communication where all sent to the default queue of each interface, in my case that was qP2P… not good for the voice to be there... So I searched, I found that there are now a "Queue" action, so I tell myself, let's get rid of the old setup and rebuild it from scratch using only floating rules. In the beta, for NATted rules I had to put the queue in the WAN rules and I had to create a corresponding rule in the LAN to have both side shaped correctly.

    Here is where I'm at...
    I have 2 rules in the floating rules, one says: "all UDP from SIPServer queue qVoIP" and the other one says "all UDP to SIPServer queue qVoIP" and I have a rule in WAN that is linked to my NAT for "nat UDP SIPPorts to SIPServer" and the rule in the WAN doesn't specify any queue as the floating rules should take care of queuing.

    When I make a call I see the download part of the communication goes to qVoIP but the upload part of the communication goes to qDefaut (which is not my default queue for all interfaces).

    Oh and before anyone ask… I did Reset States, I even rebooted, many times over 2 days of trial and error (mostly errors).

    Every other rules I created works, even the rule for my passive ftp server using non standard port works. But those rule only need a destination, not a source, since the connection is initiated from outside first. The SIP server need both rules because it receive a connection from outside while create one to the outside at the same time. You'll see a pfTop status of this down this post.

    Here are some pictures of what I'm saying.

    The two entry in the Floating rules summary
    SIP_server =
    SIP_ports = 5060:5080 (sip signaling), 10000:20000 (rtp ports), 4569 (iax) **Here is the detail of the first rule

    Here is the detail of the second rule

    Here is the entry in the WAN rules summary

    Here is the detail of the WAN rule

    Here is the entry in the NAT rules summary

    Here is the detail of the NAT rule

    Here is the Outbound NAT for my Asterisk server to set it to "Static Port"

    Here is the result of all this in the queue status when a call is in progress, see that the LAN part is in qVoIP and the WAN part is in qDefault.

    Here is the pfTop states showing both source and dest

    Note: Strange enough, I have a IAX DID (only inbound calls) using only one port for everything (port 4569) The way it's configures is that the DID server connect to my server (NAT) to the port 4569 (IAX) the server accept the connection because the server is in the list of accepted. Both signaling and RTP uses the same port. In the case of SIP signaling goes through 5060 and RTP through port 10000:20000. Anyways… The IAX communications are shaped correctly. Same rule set, different behavior.

    All the tests are made using an inbound call, from either a registered SIP provider (shaping not working) or a IAX Trunked DID (shaping working).

  • Bump, images was not showing… Sorry.

  • Your problem is that on WAN there is no queueing happening since nat happens before your all udp from sipserver to any does not match.
    You have to do it differently
    1- either set it on the LAN rule to choose the qVoip queue
    2- tag the packet on LAN and use the rule as all tagged voip to any

  • If I follow correctly, I need to remove both rules regarding my sipserver from the "Floating Rules" and add them to WAN and LAN rules and queue them.

    This is how it was setup prior to update to RC1 and stooped working since then. I'm using snapshot "built on Mon Apr 18 10:01:33 EDT 2011".

    I'll try again your suggestion and come back with results. What's odd is that calls using IAX does not have this problem. IAX rules are the same as my SIP rules, in fact the IAX port is in the same alias ports and the SIP/RTP one.


    :Edit1 Begin:
    Nope, not working either… I now have two rules, one in the WAN saying "any to SIPServer:SIPPorts" -> qVoIP and one in the LAN saying "SIPServer:SIPports to any" -> qVoIP. I rebooted the router to make sure it takes the new config and still getting the same result, "qDefault on WAN" / "qVoIP on LAN"

    I just found what you're talking about with the "tagging" I'll try that now... That would be the first time I'm using that.
    :Edit1 End:

    :Edit2 Begin:
    OMG, It's working! For the record here is what I've done to make this work.

    Tree rules are necessary to make this work.
    1 in the WAN
    1 in the LAN
    1 in the Floating Rules

    The WAN rules is basically controlled by the NAT rule and I selected the queue "qVoIP", in the advance section I set the tag to "fVoIP"

    The LAN rule is the same as the WAN except instead of destination you setup the sip server and ports as source to any, choosing the queue "qVoIP" and set the tag to "fVoIP" also.

    The Floating Rule is simple, you select the packet based on the flag "fVoIP" and then set the queue to qVoIP.


    Note: The queue selection is mandatory only in the LAN queue, the WAN queue does not need to select the queue, the floating rule does that. I've setup every rule to select the queue to make sure it gets the job done…

    Here some pictures... I know you guys love pictures :-)

    **Here is the WAN rule (note where the flag is entered in the advanced section)

    Here is the LAN rule (note where the flag is entered in the advanced section)

    Finally the Floating rule (note the advanced section, the flag goes in an other editbox)
    :Edit2 End:

Log in to reply