need some 'expert' help with qos and sip

Discussion in 'Tomato Firmware' started by bidouilleur, Oct 13, 2010.

  1. bidouilleur

    bidouilleur Addicted to LI Member

    I've been reading a lot, and tried to apply at best qos/ + ip/mac bw limiter
    most seems to run quite fine except sip phone.

    Let me first give you some details about the setup wrt54gl with Tomato RAF v1.28.8615 MIPSR1_RAF K26 Std linksys pap2t with a sip phone behind it

    some other routers but not important to this
    several computers and smartphone, all with fixed ip

    the idea is just to give a fair balance in usage and if we need to call (sip phone) drop speeds for all so the call is clear. speeds have been measured (far from stable especially up speed so I use a low figure)

    to test sip I voluntarily have some dl going on that is recognized in class D and limited, upload is limited. Basically rules do detect that traffic quite well and keep it within the set boundaries.

    But when I make a call I do hear very well but the other party doesn't hear me or very badly. When no dl is going on, conversation is pretty good, meaning line is good enough when nothing else is using it.

    Sip is recognized partly in high class (class I have for skypetoskype) and for as much I could see upstream ended in class D (no good at all)
    Clearly my rules aren't ok and for sure SIP isn't getting in the highest class with all priority. I did see random ports used for SIP .. not just the few in the rtp section ...
    Can someone with more knowledge help me , if possible ...

    below a few images from the rules etc

    thanks a lot for your time and help

    Attached Files:

  2. occamsrazor

    occamsrazor Network Guru Member

    I'm not a QoS expert but... I would forget about the L7 rule, and use two separate rules for your SIP traffic... in this order:

    1. Given that your Linksys box has a static IP, give it priority based on its LAN IP address, i.e. Src IP = = Highest

    2. Then have your port-based rules as they are, but without the L7 part. This rule is essentially just a backup, in case you use SIP from other devices, the 1st rule should catch everything, regardless of port number, from your Linksys box.

    Give it a try, but of course the problem could be something else...

    PS - I assume you have the ports 5060-5063,16384-16482 for both TCP/UDP manually port-forwarded to on the router...... right? Just checking...

    PS - I don't use the IP/MAC limiter for QoS on my setup, perhaps try switching it off.
  3. Porter

    Porter LI Guru Member

    For a more basic understanding of how Tomato should be configured you should take a look at this:

    Some quick thoughts on your configuration:
    1. You need to _measure_ the line speed of your connection. Don't just put in the values your ISP gave you. Google for Websites in your country that offer speedtests. After you have gotten the values deduct around 30% (I've forgotten the values Toastman recommends, but it's somewhere around this). These two values will be your rates you will put into "Max Bandwidth" fields. And then one thing might already be clear: standard VoIP needs around 128kbit upstream (correct me if I'm wrong). 160 - 30% = 112kbit! You are already in a difficult place to start with, although it might still be possible to get acceptable VoIP working. Just keep in mind that it may not be as great as it should be.

    2. In the Outbound Rate section there are two values to be considered:
    the left one is the guaranteed speed of this class. The right value is the maximum speed of this class. Guaranteed means that no other class is able to borrow this bandwidth from this class. Classes will lend unused bandwidth to other classes. Higher classes will get served first when there is unused bandwidth. The problem with your configuration is, that the guaranteed rates (left side) add up to more then your line speed. Actually that's already the case just looking at your Highest class (and that's why downloading kills your VoIP call, because downloading uses upstream, too). Being the highest class it will automaticly get all the bandwidth which isn't guaranteed to another class. This means that all the left values need to be much lower (probably even 0%) and the sum of all guaranteed upstream rates must not exceed the measured upstream speed.

    3. Inbound shaping has a real weakness in Tomato which I won't explain here any further. My general advise is to use very careful values. 1695kbit in your Low class is most certainly too much. Experiment until you are content most of the time.

    4. Just a side note on L7-filter: don't use ports in L7-filters. It's contradictory as L7-filter don't work with ports, they work with patterns. In some cases it might be useful, to use a ports specification with a L7-filter, but vertainly not in yours as you already know what will be running on this specific port because you configured it this way. Just to be more economic in setting up rules: "stupid" port filters need to be put before "intelligent" L7-filters. If you think your VoIP device uses other ports as well then you should first configure the device right before adding QoS-rules.

    Good luck!
  4. bidouilleur

    bidouilleur Addicted to LI Member

    have been playing for a few days with settings and your advice. iFinally got my sip in highest class, tested some and it seems pretty nice now.

    Values I have are measured values, though the uplink is pretty conservative but I can't do more right now since it is very time sensitive. When we're in peak hours it drops pretty fast pity enough. On paper I have a symmetric 2 mb line but on wimax seems the uplink is shared. Guess isp hasn't got enough bw on our antenna or their qos is really a mess (could well be seen how they use their routers)

    thanks for your help.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice