Community discussions

MikroTik App
 
xt22
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Tue Jul 14, 2015 1:16 pm

Bandwidth limiting - working limit-at

Tue Feb 20, 2018 2:06 pm

Hello,

I want to setup bandwidth limiting with working limit-ats, not wasting usable bandwidth etc, but it never works for me as expected. I have read the articles at the wiki, pcq, htb examples etc, but I just can't get it working. I use mangle and queue trees to set bandwidth for ips or ranges, it works like a charm, but this setup is wasting a lot of unused bandwidth. I think the problem may be related to parent queues setting, or limiting only the outgoing interface etc.

The goal: lets have 200mb line on eth1-gateway, and I want to split it to 100mb for eth2 and 100mb for eth3. A can do that now, but when there is no traffic on eth2, eth3 is still limited to 100mb and 100mb of eth2 is wasted. I want eth3 do download 200mbit with eth2 off, but when eth2 gets on and wants do download as much as possible, it should get its 100mb. Or, if eth2 is downloading from a slow 30mbit server, eth3 should get 170mb, etc.

I tried to set limit-at for eth2 and eth3 to 100mb, set parent max-limit to 200mb, priorities etc, but I never got it working. Can anyone please post a real working example? I don't really know what I'm doing wrong.

And to be even more tricky, lets say that eth2 is /24 production network, with a pc in meetingroom. For the meeting, I want to guarantee 60mb only for that one ip - but again, I don't want to cut down the speed of the production network to 40mb forever, I want it this way only when the meetingroom pc is being used.

thank you
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1647
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: Bandwidth limiting - working limit-at

Tue Feb 20, 2018 2:55 pm

--> Parent - Max Limit 200m
----> Child 1 - Limit at 100m, max limit 200m
----> Child 2 - Limit at 100m, max limit 200m

With above config, it will satisfy child queues with 100M first, if any of the 200M is available, it will use it
MTCNA, MTCTCE, MTCRE & MTCINE
 
xt22
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Tue Jul 14, 2015 1:16 pm

Re: Bandwidth limiting - working limit-at

Wed Feb 21, 2018 2:17 pm

I know it should work this way, I tried it and even posted this config in my post, but it does not. The cuplrit may be the the forward chain in my mangle rules (instead of prerouting) - I don't know how big influence can this have, in the packet flow diagram all chains are before HTB, so it should work nonetheless. But I'll change the chain.

The way it works now is: without eth2, eth3 is downloading 200m. But when eth2 turns on and wants to download as fast as possible, it gets like 30mb, and eth3 keeps around 170mb (the number changes, but it is definitely a lot more than eth2, not 100/100). When I quit eth3 downloading, eth2 jumps to 200m.

THIS IS why I'd like someone to post all related settings of a working config (ros6) - mangle rules, QT queues and rules, including parents, and anything else related
 
xt22
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Tue Jul 14, 2015 1:16 pm

Re: Bandwidth limiting - working limit-at

Wed Feb 21, 2018 3:23 pm

ok, so I took four RB2011 and did some more bandwidth testing, it gets interesting.
I changed the chain to prerouting with no effect, speeds are still like 176/6, 150/40 - far from 100/100.

But the CPU usage was >90%, so I tested it with max-limit 50M and limit-at 25M - it seems working much better, most of the time something like 25.1/25, sometimes for a few seconds 29/21.

Is it possible that RB2011 cannot mangle & queue traffic for ~100M and up - with two hosts running btest, few fw rules, no other traffic?
eth1 is gw, Gb ports are switched with eth2 master port for eth3-5. And if so, are there any possible ways to optimize?

Unfortunately my CCR is used at different site so I can't test it :-(
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1647
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: Bandwidth limiting - working limit-at

Wed Feb 21, 2018 3:27 pm

I think every situation is different, so rather post your config, maybe rule order is wrong, etc
MTCNA, MTCTCE, MTCRE & MTCINE
 
freemannnn
Long time Member
Long time Member
Posts: 680
Joined: Sun Oct 13, 2013 7:29 pm

Re: Bandwidth limiting - working limit-at

Wed Feb 21, 2018 4:10 pm

My rb2011 is maxing cpu at around 50mbps download with pcc rules (dual wAn 2* 50mbps vdsl), pcq queues and capsman forwarding for 40 caps!
So propably cpu is your problem.
Please if you test with a better mikrotik router like hex rb750gr3 or ccr show us your results
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1647
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: Bandwidth limiting - working limit-at

Fri Feb 23, 2018 4:01 pm

Just read the below at https://wiki.mikrotik.com/wiki/Tips_and ... ngle_rules

Queues
Limits specified on parent Simple Queue are not working
In RouterOS if you have Simple Queues with child queues, then you have to remember that after a parent queue matches some kind of traffic the same traffic will be again checked by the child queues. It means that you have to cover an entire set of packets which are captured by the parent and there is an easy way to do it by using the copy of the parent as a child.

Example which shows how to correctly create a child Simple Queue (written on 6.34.3 RouterOS).

This is not correct because only packets with address 192.168.88.2 will be limited by queues:
/queue simple
add max-limit=100M/100M name=GLOBAL target=192.168.88.0/24
add max-limit=10M/10M name=child1 parent=GLOBAL target=192.168.88.2/32
To fix this problem you have to add another child queue which would be a copy of the parent without specified limits:
/queue simple
add max-limit=100M/100M name=GLOBAL target=192.168.88.0/24
add max-limit=10M/10M name=child1 parent=GLOBAL target=192.168.88.2/32
add name=child2 parent=GLOBAL target=192.168.88.0/24
MTCNA, MTCTCE, MTCRE & MTCINE
 
pe1chl
Forum Guru
Forum Guru
Posts: 6519
Joined: Mon Jun 08, 2015 12:09 pm

Re: Bandwidth limiting - working limit-at

Fri Feb 23, 2018 4:48 pm

When your queues don't limit all the traffic, make sure you don't have fasttrack enabled on this traffic, because it will cut around the queue processing.

Who is online

Users browsing this forum: arnelgiga, Majestic-12 [Bot] and 53 guests