DD-WRT and Tomato: Close but no cigar

Discussion in 'Tomato Firmware' started by likesmyprivacy, Mar 25, 2009.

  1. likesmyprivacy

    likesmyprivacy Addicted to LI Member

    I can't seem to get what I want from these two firmwares. I want my traffic priority to be based on which computer the traffic is going to/from, not based on the service each computer may or may not be using.

    DD-WRT QOS didn't seem to work at all.

    If I make the following settings in Tomato:

    Basic Settings
    Prioritize small packets with these control flags: Tried ACK checked/unchecked and all of the other options checked/unchecked

    Max. Bandwidth: 95% of my max. upstream.
    Highest: 80-100%
    Medium: 10-100%

    Max. Bandwidth: 95% of my max. downstream.
    Highest: Tried "None" and 100%
    Medium: 50%

    To First computer: Highest
    From First computer: Highest
    To Second Computer: Medium
    From Second Computer: Medium

    Whatever I set the Medium Inbound setting to, the second computer is always limited by that percentage of the total bandwidth, whether the first computer is using any bandwidth or not.

    Oddly enough, if I set Medium to 90% the second computer (used for p2p) is hogging most of the bandwidth even though the first computer has a higher priority.

    I want the second computer to be able to use any bandwidth the first computer isn't using, up to the maximum - with the first computer having absolute first priority of the bandwidth no matter what.

    I do not want this to be dependant on what program or service is being used on either computer in any way, shape or form.

    Is there a way to accomplish this with Tomato or is there another firmware I can use to accomplish this?

  2. Victek

    Victek Network Guru Member

  3. Toastman

    Toastman Super Moderator Staff Member Member

    What you are trying to do is feasible in Tomato, but it does require a good understanding of how the QOS system works, and how the servers at the *far* end of the links respond to what your clients are sending.

    It is quite probable that your QOS as currently set up is doing exactly what you asked. But what you asked, is probably not going to do what you intended.

    For example, let us imagine you have three computers correctly set in order of priority, and the second were to be allowed to use whatever bandwidth was left after the first. Let us say that the first has a period of low activity and the second uses this bandwidth to send out requests to download 300 files from various servers. Now the incoming files from those requests quickly swamp your incoming link. Now, the first computer will soon find all of it's returning data is stuck at the back of the incoming queue and most of it will be dropped. So it now backs off (waits) according to the normal TCP protocol, and then retries, asking for that data to be sent again. However, while it is in this "wait" period, the second computer has time to send it's acknowledgements and request for more data to the 300 servers. That is how the second computer can take over, despite being second in priority. It has merely followed the rules.

    You can see that no. 1 sent it's request first, no. 2 sent it's requests after no. 1 had finished it's turn, and hence the rules have been followed. The problem is not only one of priority, but of traffic control. No QOS system can control incoming data directly, you have to try to do that by careful control of what you SEND and also by limiting incoming bandwidths according to protocol / application classes.

    This silly example is just an attempt to explain what can happen. I am trying to make the point that QOS can work, but it does require thought and careful planning. You may need to abandon your strategy of not trying to limit according to protocol or application, in order to make it work.
  4. szfong

    szfong Network Guru Member


    In personal computing environments, the easiest way is to put limits on your p2p client, rather than going the more complex router route. Anyhow, what your asking is the ability to finely control the # of connections & the amount of both inbound & outbound traffic. Oftentimes, inbound traffic is difficult to control, as it has already reached you. Dropping/delaying packet acks, etc... Your connection dies simply because your being sent too much data on your small pipe. In the "PAY" version of dd-wrt you have a feature that allows for a bit more finer control. I've heard it works great on the x86 variety, not so great on the wrt54gl. You may need, umm.. for a free solution is something like pfsense + a few addon packages.

    In short, set limits on your p2p app... it's alot easier than trying to control the inbound flood of data at the router...
  5. pharma

    pharma Network Guru Member

    You might also look at your Windows Event Log for the "4226" tcpip error to see if you are encountering the OS limit for half-open connections. There are patches available if you are.

    I had the "4226" problem in XP and Vista 32 & 64 where p2p hogged most of the bandwidth. Applying the appropriate patch resolved the issue and can now download p2p at full throttle, surf, and stream music at the same time.

  6. chadrew

    chadrew LI Guru Member


    I'm no pro but I'd just do this:

    Do not prioritize any small packets or ICMP.

    DNS Traffic: classify as Highest (Dst port 53)
    Traffic coming from first PC: classify as High (by Src MAC of that PC)
    Traffic coming from second PC: classify as Medium (by Src MAC of that PC)

    Highest: 50%-100%
    High: 45%-100%
    Medium: 5%-90%

    I would also put an inbound limit to the Medium class, maybe around 80%-90% of your maximum download capability.

    I've found this is what works for me best, give it a try :thumbup:
  7. likesmyprivacy

    likesmyprivacy Addicted to LI Member

  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