Page 1 of 1

QOS: setmax-limit to full bandwidth ?

Posted: Wed Dec 30, 2009 10:43 pm
by rodolfo
Hi all.
In my qos implemetation (I have a 30Mbit internet connection shared to 700 users) I mark different types of traffic then I give more or less priority to the different types.

The sum of Limit-At of all queues is = 30.
I have limited also max-limit for each queue but I don know if this is a good idea:
could it be better to set max-limit of each queue to 30Mbit (full bandwidth) ?

In this case, each queue could reach the maximum bandwidth, and each queue figth with its own priority.

Is this correct ?

thanks

Re: QOS: setmax-limit to full bandwidth ?

Posted: Thu Dec 31, 2009 4:33 am
by rmichael
Each queue, after satisfying limit-at will contend for bandwidth based on priority. You'll need to set max-at (at least in the root queue) for HTB to work. Btw, priority QOS only works on leaf queues.

More info here:
http://wiki.mikrotik.com/wiki/HTB

Re: QOS: setmax-limit to full bandwidth ?

Posted: Thu Dec 31, 2009 10:35 am
by rodolfo
thanks rmichael.
do you think in my implementation there is something wrong ?
queue in.jpg

Re: QOS: setmax-limit to full bandwidth ?

Posted: Thu Dec 31, 2009 6:25 pm
by rmichael
I'm still learning this stuff, but it looks OK to me. Next, I would suggest that you look at your queues and see how many packets they drop.

Normally you want to drop as little as possible for down traffic and low priority traffic first for uploads.

To maximase bandwidth use for tcp traffic make sure that you don't drop ACK, SYN-ACK packets - you should propably put them in a separate, high priority queue. That way you can also monitor and act on SYN flood.

Michael

Re: QOS: setmax-limit to full bandwidth ?

Posted: Fri Jan 01, 2010 12:20 pm
by rodolfo
I added this mangle rule:
add action=mark-connection chain=forward disabled=no \
new-connection-mark=SYSTEM-CONN passthrough=yes protocol=tcp  \
tcp-flags=syn,ack 
Then I mark the packets to fall in an high priority queue.

If a queue drops too many packets (and is a download queue), is a good idea to enlarge the buffer size ?

Thanks

Re: QOS: setmax-limit to full bandwidth ?

Posted: Fri Jan 01, 2010 8:09 pm
by rmichael
If a queue drops too many packets (and is a download queue), is a good idea to enlarge the buffer size ?
Yes for TCP flows, generally no for UDP flows. Try to tune so packets of low importance get dropped first.

EDIT:
To get a good starting point for queue size calculate bandwidth-delay-product * 2 / [avg packet size]

bdp calc can be found here:
http://www.speedguide.net/bdp.php

Re: QOS: setmax-limit to full bandwidth ?

Posted: Sat Jan 02, 2010 12:27 am
by rodolfo
Is very clear, thank you.

Now I have a doubt: how fast is the queue tree system when all available bandwidth is used ?
Suppose all 30Mbit are used for download because no other users browse or voip.
At this moment, one sip incoming call begin its stream.
Does queue tree give immediately high priority to this connection ? (supposing cpu not at 100%)

If yes, all Limit-at coud be = 30Mbit.
In not, I must be aware to give all bandwidth to low priority connections.

thanks

Re: QOS: setmax-limit to full bandwidth ?

Posted: Sat Jan 02, 2010 4:30 am
by rmichael
If yes, all Limit-at coud be = 30Mbit.
In not, I must be aware to give all bandwidth to low priority connections.
I think you mean limit-at could be =0. If you assign 30Mbit to a queue it will act as if had the highest priority.

For downloads you're at the mercy of TCP or UDP backoff algorithm as packets arrive before HTB has a chance to work it's magic (or do what you told it to do :) ). To keep download stream ready you need to proactively try to shape flows by dropping packets, queuing (so you propably want the sum of your bulk traffic to be <30Mbit.

Re: QOS: setmax-limit to full bandwidth ?

Posted: Sun Jan 03, 2010 5:58 pm
by norocel
thanks rmichael.
do you think in my implementation there is something wrong ?
queue in.jpg
rodolfo, can you post here your mangle and queue three ?
im interested,
10x in advance

Re: QOS: setmax-limit to full bandwidth ?

Posted: Sun Mar 21, 2010 10:02 am
by magnavox
+1, can you post your working mangle rules?

tnx ;)

Re: QOS: setmax-limit to full bandwidth ?

Posted: Thu Mar 25, 2010 1:36 am
by WirelessRudy
I added this mangle rule:
add action=mark-connection chain=forward disabled=no \
new-connection-mark=SYSTEM-CONN passthrough=yes protocol=tcp  \
tcp-flags=syn,ack 
Then I mark the packets to fall in an high priority queue.

Thanks
Michael, Rodolfo: I have a question on this; I mangle on the prerouting chain since I mangle client traffic for shaping in the forward chain.
Should I now mangle these tcp flags in the public or the local interface? I only see traffic on the local interface though...

Then, would it not be enough to mark the packages only? The flags state belong to a connection I believe, by marking the connection are we now not marking the whole tcp connection? And thus ALL tcp traffic gets the mark and following queue. This would be unwanted?

I am still trying to fine tune my Qos and my eye fell on this topic with this new info.
Any further comment is very appreciated.