help needed to setup QoS

Discussion in 'Tomato Firmware' started by julien-1993, Jul 31, 2009.

  1. julien-1993

    julien-1993 Addicted to LI Member

    Hello all,

    About 2 months ago i signed up for a unlimited internet + VOIP account and bought a buffalo router with QoS in mind. I started using the default QoS setting from tomato by adding a rule for VOIP based on the destination port in the HIGHEST group and adding a high rule for gaming. It worked almost perfectly.

    Let me explain why almost.

    My internet traffic is mostly as fallow:

    - I download and upload using the bittorrent protocol 24/7 (mostly upload, download is more sporadic)
    - I play a fps game and my girlfriend plays on EA pogo java games (both are very sensible to latency)
    - we use voip for our main phone (it seems that this is also very sensible to latency)
    - other than that is mostly web browsing and shoutcast streams.

    with the slightly modified default QoS, everything was good except for the pogo games. the phone was always perfect (which is very important for us) and torrents where able to seed almost maxing my upload speed constantly.

    It turned out that the pogo games where very laggy and that was a deception for my gf who had to pause the torrents everytime she wanted to play and who also forgot to resume them when she was done most of the time.

    I was almost certain that this was from an error in my QoS settings so i started googling concerning that matter and found this forum. I than found the very good and well explained thread by toastman about Qos. I read that thread and try to applied it to be in Internet nirvana but unfortunately with what i understood from the thread and tried to apply, it is now worse than it was with the almost default setting. now the voip is broken D: what i mean by that is that the people to wich we talk (and that we can hear perfectly) cant hear us at all. So here we are now requesting your precious help to adress our problem.

    I have done a lot of testing on lately (with qos disabled) and here are the results.

    download is at 4300 kbps and upload is at 665 kbps. I have done tests at different times in the days and night and it seems to always be the same numbers.

    here is what i have as from the scratch settings atm.

    these are the objectives i would like to achieve in order of importance for us:
    1- Voip should have priority over everything. i dont mind a slowdown of everything else when we talk on the phone.
    2- My fps game and my gf pogo games should have the minimum latency possible.
    3- Bittorent should upload as fast as possible for us to obtain good ratios on private trackers.
    4- web browsing should be fast if its possible but we dont mind a little slowdown if the other objectives are fullfill.

    By reading the qos thread, i understand that those objective possibly cant be all true. we are ok with torrents being a little slower but we would like them to still upload nicely when nothing else is using the connection.

    I thank you in advance for you precious help :D
  2. Toastman

    Toastman Super Moderator Staff Member Member

    Can't see the setup, if you can fix it then I'll try to help!

    Without seeing the rest of it, try outgoing limit of 450 or less, and incoming max limit of 3000 first.
  3. julien-1993

    julien-1993 Addicted to LI Member

    thanks for you interest in helping me toastman :)
    i tried uploading my images to another place, they should work now.
  4. Toastman

    Toastman Super Moderator Staff Member Member

    First glance - no incoming max limit - for good latency set this to 2/3 of max measured speed - say 3000. With no limits set, it's almost inevitable that the incoming line will saturate.

    EDIT - it turns out that the maximum incoming "limit" box in Tomato is not in fact a limit at all, it is just used to calculate the percentages for the class bandwidths. So make sure your class bandwidths are set correctly instead of relying on an overall bandwidth limit.

    Looking further...

    Suggest the following changes
    Check prioritise ICMP also (just check ALL small packet boxes except ACK) - this allows you to check ping times in a DOS ping session when making changes.

    Uncheck the ACK box - to keep P2P ACKS from being prioritized along with everything else
    Change default class to D - to put any traffic you don't specifically classify into a defined class D

    Set max outgoing bandwidth deliberately low to make absolutely sure there is spare bandwidth until you have some results. Say 350-400 kbit/s.

    Outbound rate/limit

    Highest 100/100 VOIP
    High 20/40 DNS
    Medium 30/60 Games
    Low 30/50 VNC
    Lowest 30/50 WWW
    A Use for WWW 512k+ (downloads)
    D 1/10 Default class
    E 1/1 Use for crawl class (to throttle apps when testing etc). Set NONE for both to kill this class altogether.

    Inbound limits

    "Inbound Class Limit" 3000 (note - this is only used to calculate the percentages in the other classes. It is NOT an overall limit).

    Highest None - (this class has no limit)
    High 40
    Medium 30
    Low 50
    Lowest 50
    A 60 - (You can set this to "None" for best WWW speed later.)
    D 40
    E 1/1

    Use these as a start, nothing is written in stone,, but you'll see I've severely cut back on many things. Get it working first, then increase allocations etc. and see how it affects VOIP and games latency.

    Latency in general begins to suffer badly unless sufficient incoming bandwidth is made available for e.g. VOIP in particular. Tests show 66% limit will provide good latency, degrading as the limit begins to allow other apps full use of incoming bandwidth. It's a trade-off. If people can't hear you, there's insufficient outgoing bandwidth available, throttle all other applications back severely to begin with and then experiment afterwards with increasing them to achieve what you want. It will take some time. Don't rush.....

    If you have problems with your VOIP don't forget to check the Conntrack timeouts. An assured UDP timeout setting of 300 seconds is often necessary instead of a shorter timeout which is good for P2P.

    Re-read the QOS thread for more explanations ... esp:

    Good luck!
  5. julien-1993

    julien-1993 Addicted to LI Member

    I have applied all the modifications that you suggested, its now working perfectly. we just tested starting the torrents , and at the same time talking on the phone and playing the pogo game. Phone was perfect according to the person we spoke to and my gf was having not lag at all in pogo. As expected, torrents upload speed where a lot slower (about 5-10% of what they are with Qos off). At least now i got it to work like it should, im going to reread the whole thread about QoS another time like you are suggesting before touching the settings. thanks alot Toastman, you have been of great help to me and I appreciate it a lot.
  6. Toastman

    Toastman Super Moderator Staff Member Member

    great, that's good news! I suggest to be careful with P2P but increase the outgoing allocation to say 1-20 in steps and see how it affects your other apps. If it's still ok, then a bit more each time, and stop when it begins to affect anything. I've found that 50% is the max I can allow before everything ceases to work properly. Pinging your local gateway in a window continuously while you do it is the best way to see if it's clobbering your latency.

    BTW if you have utorrent, turn off DHT and if Bit Torrent, uninstall DNA too.

    Remember, if your aim (like most of us) is to DOWNLOAD P2P files from public sources, just forget about trying to seed anything. Switch off uploads (seeds). If you can't do that in your client, choose the lowest possible limit - say 1 kbps. Your upload speed should IMMEDIATELY start to climb.
  7. ceckin

    ceckin LI Guru Member

    Are you really suggesting to NOT SEED? I have no problem what-so-ever with my games with running torrent client. So this QOS at best are unnecessary and yet the users doesn't understand will become the millions of lechers that exploit the backbone of Bit-Torrent.
  8. Toastman

    Toastman Super Moderator Staff Member Member

    I know all about our "moral duty" (!!!) to upload our (mostly stolen/pirated) P2P files and so on...:biggrin: However, I'm not concerned with that aspect and I don't need to be "politically correct" here. I'm concerned here simply with an engineering problem and the laws of physics. You see, it is well known amongst the P2P community that the vast majority of broadband users have ADSL lines with small upload bandwidth of around 5%-10% of their downlink, and just cannot seed anything worthwhile without screwing up the rest of our applications and even our own P2P downloads. We have been trying for years to improve things for those users but you cannot wring juice from a turnip. In fact the fastest speed that is even supported by even the ADSL2+ modems used with these connections is a 1 Mbps uplink. Put more than a few users on that, and you will have problems. And yes, we are fully aware that many people have high speed cable, they are what really keeps P2P working. Never forget that the vast majority of the world's users don't even have ADSL, and most of those that do are limited to 256k/1Mbps. And thank your lucky stars you are not one of them!

    For example, in all of ***MY*** ADSL installations, which range from 512k/5Mbps to 1Mbps/16Mbps ADSL/ADSL2+, downloads get better and faster without ANY exceptions if (a) DHT and uTP is turned off, and (b) seeds limited to the lowest possible setting (I'm talking about public torrent sites). In other words, simple TCP connections.

    You just have to experiment and see what happens in your case (over a long period of time or you will not get a true picture of what is happening) and then decide what is important in your case.
  9. Azuse

    Azuse LI Guru Member

    Roll on inbound qos lol

    Sadly toasmans not quiet accurate, there are plenty people with uploads greater than needed. As far as Europe concerned the uk has poor broadband, but even my isp provides 5 time the upload speed I need to download and has done for over 4 years. Virgin is in the process of increasing it's upload speeds to everyone (i.e. even the cable companies are passed using uploads to limit downloads) which is what, 11/12 million homes?

    Tomato will catch up ofc, but it will take time and there's always going to some compromise until isps offer end-to-end qos (no happening :(), may as well be uploads.

    Oh and you have to set your outbound lower than it is because you a. need room to ease congestion and b. tomato can't calculate transport overheads accurately for adsl. There's a patch for that if anyone ever fancys integrating it :p
  10. Toastman

    Toastman Super Moderator Staff Member Member

    I was not talking about the bandwidth required to download. We all have enough for that. But not if several users take all our uplink bandwidth to UPLOAD SEEDS.

    We mostly want to download stuff, right?

    QOS - the real thing. Humbug! There probably never will be an end-to-end priority system, or "QOS". If you think about it, this would just mean that anyone (me for instance) can just mark all his own traffic to maximum priority and screw everyone else! Windows 2000 even did it! So I sure would. It's similar to the old tricks in the early days of the internet of removing the exponential backoff on the TCP timers.

    In the past, many ISP's have tried to implement end-to-end QOS, and other ISP's immediately took advantage of the early experiments to boost their own traffic at the expense of everyone else (much better than spending money on improving their own infrastructure). So the major trunks around the globe decided long, long ago this would never work in practice, and have given up on the idea. Some people say that some global priority is given to port 443 by the trunks, but I have never found this to be true personally and none of my colleagues believe it either. 443 traffic is no faster here than port 80.

    But anyway, the OP, Julien-1993, was on ADSL at the same speed as I was, so that upload recommendation was the advice I gave him based on what happens here.
  11. Kisch

    Kisch LI Guru Member

    Julien 1993
    It is very strange, you have not problem with VOIP, because I cannot see highest priority in your QOS setup. UDP to 5060 is (if I am right)for SIP protocol, but SIP (Session Initiation Protocol) is only for start VOIP connection and for signaling. Voice is transferred through RTP packets and you have to prioritize these packets too. Check your VOIP phone for ports used for RTP stream, or use F7 filter in QOS setup.
  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