1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Toastman QOS B/W Limiter Not Working

Discussion in 'Tomato Firmware' started by Ashkaan, Jun 18, 2013.

  1. Ashkaan

    Ashkaan Reformed Router Member

    I've tried running several versions Toastman's Tomato on my e4200v1 and I can't get B/W Limiter to work.

    I want to limit bandwidth on one IP, but allow it a ceiling of infinite. No matter what settings I put, it will still hog up the entire internet.

    Is anyone else having this issue? Does anyone know how I can solve?
     
  2. Malitiacurt

    Malitiacurt Networkin' Nut Member

    Working as intended. That's what DLCeil and ULCeil should do when you put a large number in.

    DlRate and UlRate are minimums, the ceilings are the maximums.
     
  3. Ashkaan

    Ashkaan Reformed Router Member

    I forgot to mention that this behavior is happening while others are downloading at max capacity.

    We have a download speed of 6MB/s. One user is limited to 1MB/s DLRate and 6MB/s DLCeil. Another user is not limited. When they both download something that would individually go at 6MB/s, the limited user gets 4.5MB/s and the not limited user gets 1.5MB/s.

    Shouldn't the limited user get 1MB/s and the not limited user get 5MB/s?
     
  4. Planiwa

    Planiwa LI Guru Member

    The "limited" user is given a guarantee of 1.5.
    The other user is given no such minimal guarantee.
    As you say, the upper limit is pointless.
    So, the "limited" user has a privilege that the other user lacks.

    But there is more.

    It is unclear what you mean by "We have a download speed of 6MB/s".
    Is that (<85% of) the lowest rate ever observed, as required for QOS to work?

    Do you actually mean "6Mb/s" rather than "6MB/s"?

    But there is more.

    The only way to limit DS traffic is to receive it, and then to throw it away.
    This works for (well-behaved) TCP, but not for UDP, nor for massively parallel (P2P) TCP.

    In any case, it my be useful to limit US bandwidth in order to effectively limit DS BW.

    "Shouldn't the limited user get 1MB/s and the not limited user get 5MB/s?"

    Perhaps, instead of specifying 1-6 for the "limited" user, you could say:

    l: 1-1
    u: 5-6

    (disregarding those other things. :) )
     
  5. Ashkaan

    Ashkaan Reformed Router Member

    Thank you for the reply.

    6MB/s is the speed of our internet. I mean bytes, not bits.

    I want to limit the limited user ONLY when other users are using bandwidth. When no one is on, I would like 6MB/s and when someone is using 3MB/s, then the limited should have 3MB/s. If someone tries to use all of the internet, I want at least 1MB/s reserved for the limited user.

    How can I best accomplish this without messing with upstream speeds?
     
  6. Marcel Tunks

    Marcel Tunks Networkin' Nut Member

    Is there a specific application or set of applications causing problems? You've got reasonable bandwidth - have you tried QoS while the offending user is active to see if it provides adequate control of traffic?

    If the rest of your users could be added to the bandwidth limiter system, then give them high minimums. That should steal bandwidth from the offending user.

    If the usual use of bandwidth limiter or QoS system don't work for you, an ugly alternative is to use the QoS system as a bandwidth limiter. If you don't need the rest of your QoS, you could make MAC address-based rules to give the limited user a low minimum bandwidth and close to 100% maximum, and give the "default class" a high minimum (e.g. 80% would leave 20% for the limited user) and maximum of 100%.

    I'm sure that others here will have a more elegant solution to any of these three.
     
  7. Ashkaan

    Ashkaan Reformed Router Member

    I don't know what the cause of the problem is.

    It just seems like QoS is not working, right?

    Your suggestion about the mac address-based rules IS in fact what I'm doing.
     
  8. Malitiacurt

    Malitiacurt Networkin' Nut Member

    No, you incorrectly set your rules.

    What you basically want is:
    Limited user:
    DLrate: 1MB/s, DLCeil 6MB/s

    Unlimited user:
    DLrate: 5MB/s, DLCeil 6MB/s

    With ULrate/Ceil mirroring ratios of DLrate/Ceil.

    You can do more tweaking including making limited user DLrate slower and unlimited user DLrate faster, as well as putting priority highest for unlimited and lowest for limited user.

    In the end the QoS is not guaranteed to work on DL, it's more effective on UL. It will simploy start dropping packets received when total DL bandwidth is not enough.

    Easy way to see this is downloading from a 'reliable' bandwidth source (aka not torrents). Using newsgroups is a great example of this.

    If you open say 5 connections from newsgroups on a 'high priority' client and they're barely able to saturate your connection, then open 20 connections on a 'low priority' client at the same time. You'll find the low priority client will hog more of the bandwidth than the high priority client even though your QoS rules try to state otherwise.

    However if you try to open 20 connections on 'high priority' and 20 on 'low priority', then it should somewhat follow your QoS rules. Note that this does not apply to torrenting since seeders/peers upload bandwidth and other external factors such as routing make it unreliable to 'test'.
     
  9. Ashkaan

    Ashkaan Reformed Router Member

    But that's not what I'm trying to achieve.

    I don't want to limit the unlimited user in any way. The unlimited user should always have as much internet as is available and not reserved for AND used by the limited user.

    I only want to use the bandwidth limiter, not full fledged QoS because that will implement a large set of rules that I can't reverse engineer and clear out to make work properly.

    This is clearly a bug if it's not working properly, right?
     
  10. Marcel Tunks

    Marcel Tunks Networkin' Nut Member

    Malitiacurt's instructions are accurate and will give you what you want. It will give the "limited" user full bandwidth when the network is otherwise idle, and 1MB/s when any other user is trying to use the full bandwidth. The "unlimited" users will be guaranteed 5MB/s and will take up to 6MB/s when the network is otherwise idle. It will be increasingly difficult to apply through the BW limiter as the number of "unlimited" users goes up, which is why I suggested the QoS system, but you are free to try any approach you wish.

    Whether you use the bandwidth limiter or the QoS system, the system will be much more effective if you limit upstream bandwidth as well, which was also mentioned in Malitiacurt's post.

    There's very little harm in humouring us and trying it out, even if your intent is to prove us wrong. (Don't worry, I'm used to being wrong...)
     
  11. cloneman

    cloneman Networkin' Nut Member

    in don't know how the bw limiter works, but I would suggest using QoS instead and turn off bw limiter. delete all the default QoS rules and only use a few that you create and fully understand

    using classifications you can can have a setup as simple as 2 rules which will allow both users to use all the bandwith, when both try to use it at the same time, the high priority user will have priority, for example, he will have, 80%.

    I can walk you through it if you want but pm me and we'll do it, too hard for me to explain
     
  12. gutsman7

    gutsman7 Networkin' Nut Member

    If I wanted to limit 1 ip I would use this custom script and only add that 1 ip to it then it will be limited and the rest of the clients will be immune to this rule.
    #Limit Download
    tc qdisc del dev br0 root
    tc qdisc add dev br0 root handle 1: htb
    tc class add dev br0 parent 1: classid 1:1 htb rate 10000kbit
    tc class add dev br0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 5000kbit prio 0
    tc filter add dev br0 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
    iptables -t mangle -A POSTROUTING -d 192.168.1.210 -j MARK --set-mark 10
    #Limit upload
    insmod imq
    insmod xt_IMQ
    ip link set imq0 up
    tc qdisc del dev imq0 root
    tc qdisc add dev imq0 root handle 1: htb
    tc class add dev imq0 parent 1: classid 1:1 htb rate 6000kbit
    tc class add dev imq0 parent 1:1 classid 1:10 htb rate 1000kbit ceil 2000kbit prio 0
    tc filter add dev imq0 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
    iptables -t mangle -A PREROUTING -s 192.168.1.210 -j MARK --set-mark 10
    iptables -t mangle -A PREROUTING -j IMQ --todev 0
    Just add your down and upload rates and change the ip and put this in Firewall script.
     
    DefTaker likes this.
  13. Ashkaan

    Ashkaan Reformed Router Member

    Ok, I think now we're getting somewhere..

    I will try this and let you guys know.

    Thanks!
     
  14. DefTaker

    DefTaker Reformed Router Member

    Just wanted to say that I specifically joined up to say thank you to gutsman7!

    I was getting superfrustrated that the Bandwidth Limiter wasn't working as I had configured everything properly. I then tried using the script that I had for my firewall when I was running DD-WRT and that didn't take either.

    Then (after days of searching) I came upon this thread and I saw the firewall script and how it was similar but different from my DD-WRT firewall script.

    I took gutsman7's script and edited it to limit the D/L & U/L speeds on my entire guest network and tested it out! Voila! It works fantastically! Thank you, thank you, thank you!
     
  15. Eri

    Eri Serious Server Member

    Gents,
    could you give me an example as above script to limit b/w for range of IPs in LAN (eg: 192.168.1.25 - 192.168.1.254) with QOS is enabled?

    Situation:
    I love to use QOS.
    With QOS is enabled, i'd like to give maximum bandwidth for the wanted IPs only and set minimum bandwidth for the unwanted IPs (just in case there will be unwanted PC connect to my LAN).

    I flashed one of my WRT54G using new shibby's build (1.28.0005 115 ND VPN). in this shibby's build, there's menu named "Bandwidth Limiter for LAN (br0)" while in toastman's build named "Bandwidth Limiter - QOS".
    As what described in this forum that i found, Toastman's build only use QOS or BW Limiter, do not use (enable) both of them.

    So in my opinion, that shibby's build is possible to use (enable) both of them while toastman's build is not.
    is it true?

    Pls need your assistance.
     
    Last edited: Dec 9, 2013
  16. Elfew

    Elfew Addicted to LI Member

    Use bw limiter, i think it will be easier and it is working with nocat... Qos has bad impact on speed, so i switched to bw limiter, set limits and my clients are happy...i know that qos would be better but i have 150/150mbit connection so i went this way (tomato raf by victek)
     
  17. Eri

    Eri Serious Server Member

    @Elfew: in my situation, i've got a small bandwidth capacity (512:3000) and most of my clients do lots of voip/games while others browsing & streaming, messenger, etc. That's why i love to use QOS in order to manage the need. And in case to prevent my LAN form unwanted people/pc that can connect to my LAN i need b/w limiter also.
    e.g: my wanted LAN range IPs (fixed IPs): 192.168.1.2 - 192.168.1.25, the rest are unwanted.
     
  18. Porter

    Porter LI Guru Member

    You can't use B/W Limiter and QoS at the same time!
     
  19. Elfew

    Elfew Addicted to LI Member

    Yes, you cannot use them together - there is a warning message about it...
     
  20. Eri

    Eri Serious Server Member

    Last edited: Dec 10, 2013
  21. gutsman7

    gutsman7 Networkin' Nut Member

    need to try out changes.
     
    Last edited: Dec 10, 2013
  22. Eri

    Eri Serious Server Member

    well, i think at this moment i can use "Access Restriction" for my purpose.
    i configured to block all internet access for all unwanted IPs (say: 192.168.1.26 - 192.168.1.254) :)

    but actually i've got a little bit delima, when want to share a little bit connection to some neighbors, i want to prevent them to hook lot of bandwidth, since i want to set all of my clients in my house to the first (highest) priority to share my whole bandwidth.
     
  23. Elfew

    Elfew Addicted to LI Member

    In bw limiter there is an option to set priority for range of ip or for unknown ip connections (victek build)
     
  24. Elfew

    Elfew Addicted to LI Member

    Screenshot of BW limiter:
    https://www.dropbox.com/s/8qd0wgn5igu3ryl/BW limiter.png

    You can set priority/speed/etc for each group (br0, br1, br2, ...)... you can also set all unlisted IP/MAC to the br0 with different limits.

    I am not sure, but I think that Victek´s bw limiter can be used with QoS together (there is an option - use same as for QoS, but I am not sure... I just use BW limiter)
     
  25. Eri

    Eri Serious Server Member

    Thanks for your concern Elfew.
    I don't flash my wrtg54g with victek's mod, since he don't release newer release for k.24 anymore :-(

    But, for classification priority as you mentioned, i could find it in shibby's mod as i mentioned before:
    "I flashed one of my WRT54G using new shibby's build (1.28.0005 115 ND VPN). in this shibby's build, there's menu named "Bandwidth Limiter for LAN (br0)" while in toastman's build named "Bandwidth Limiter - QOS".
    As what described in this forum that i found, Toastman's build only use QOS or BW Limiter, do not use (enable) both of them".

    But then what i found, shibby also stated that QOS & B/W limiter can not be enabled together:
    " http://www.linksysinfo.org/index.ph...-limiter-qos-captive-no-go.38948/#post-188699 "

    So that's why i still interested to use firewall script as gustman7's given an example above :)

    I've got a small DSL Bandwidth capacity (512/3000 Kbps) with about 15 clients connected, most of them do lots of voip/games.
    So that's why i love to use QOS, and a bit delima when i want to give a little bit for closest neighbors (for social relationship) hehe :) , i'm afraid if don't limit or set them to low priority, they will hook the entire bandwidth although they don't realize it.

    pardon me for my complicated purpose :-D
     
  26. gutsman7

    gutsman7 Networkin' Nut Member

    I would just install a version with vlan and create a separate ssid for your guests and you can limit that whole interface to a set rate with the build in bandwith limiter.
     
  27. gutsman7

    gutsman7 Networkin' Nut Member

    Or you can still create a guest ssid and limit the whole interface with a script like this.
    ####
    tc qdisc del dev iface root
    tc qdisc del dev iface root
    tc qdisc del dev iface root
    tc qdisc add dev iface root handle 1: htb default 11
    tc class add dev iface parent 1: classid 1:1 htb rate 10000kbit
    tc class add dev iface parent 1:1 classid 1:10 htb rate 60kbit ceil 200kbit prio 0
    tc class add dev iface parent 1:1 classid 1:11 htb rate 400kbit ceil 900kbit prio 2
    tc filter add dev iface parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10
    tc filter add dev iface parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
    iptables -t mangle -A POSTROUTING -p udp --sport 53 -j MARK --set-mark 10
    ####
    This script will limit the whole interface to a default 11 class of 400k and 900k max and it will atleast give them a decent dns speed. Just change the iface part on each line to the correct interface.
     
    Scottmsu likes this.
  28. Eri

    Eri Serious Server Member

    @gustman7: hehe nice reply. waiting for your next update then :)
     
  29. gutsman7

    gutsman7 Networkin' Nut Member

    Yeah about the iprange script doesnt appear to cooperate with the body of command.
     
  30. Scottmsu

    Scottmsu Reformed Router Member

    Hey gutsmans7, I'm new to router language and I'm not sure how to edit it besides the rates.

    Where do you specify which ssid is affected?

    Can I make it so the main ssid is limited while the guest ssid is not?

    Correct me if I'm wrong-
    tc class add dev iface parent 1: classid 1:1 htb rate 10000kbit
    is the max download rate
    tc class add dev iface parent 1:1 classid 1:10 htb rate 60kbit ceil 200kbit prio 0
    is the min/max upload rate
    tc class add dev iface parent 1:1 classid 1:11 htb rate 400kbit ceil 900kbit prio 2
    is the min/max download rate

    Would using this be more efficient than the built in bandwidth limiter on victek's TomatoRAF 1.2 stable?
     

Share This Page