I was also thinking about creating a script that uses the bandwidth test tool to check bandwidth between 2 RB's every x minutes and adept the max-limit of the queues dynamically but this isn't a solid and good solution.
Inspired by cFosSpeed, I see a clear way to implement something in RouterOS. This feature would kick ass, I hope MT see how it will make a lot of cash for them, feelin' rich MT?
. It can also be done with a tool that is run on a separate host that communicates with a server and checks for loss between the two. By ICMP and by TCP RTT and the way TCP Vegas does it and the way the new uTP protocol does it - this communcation will need to have high priority in RouterOS. If only ICMP is used - this can be scripted in bash and in RouterOS. If loss occurs - the max-limit is lowered. This feature can be put in a new binary and in a new npk called "prioritiser" or "WAN optimiser". This new binary can be made outside MT, so that the MT guys would be free to make all the other stuff they have their hands full with already.
This feature will be useful for example in cases when the available bandwidth changes slowly. So it will adjust the max-limit to a lower value than what is actually avaliable. So we will still have wasted bandwidth but at least we will have better chace for our priority packets. So its either joy and happines by this method or its back to the dark ages and sure death by setting youtself on fire while drowning.
unfortunately, there are many pitfalls in such situations. for example, if you use ADSL modem..
If you have something other than Ethernet - you have serialisation delay and crazy loss and delay due to ATM etc etc, due to noise, etc etc. so there are soooo many variables to work with. Remember the adsl-optimiser that claimed to be able to delay the packets properly, to compensate for the ATM BS on ADSL? I wonder if RouterOS HTB and queues work in a different way when you have different serialisation delay caused by your interface. In my opinion MikroTik have to make an integrated ADSL client interface so that transmission over it is controlled the best way possible.
I would like to have the ability to have a strict priority queue no matter what the available bandwith is.
so can the limits be set to artificial values (1gbs) and priorities will be enforced in the interface queue?
You can. Your queue will be able to send out the priority packets strictly before the rest. The problem occurs in the next device. It will treat all packets equally or it will have other priority packets - some client that is paying tons more cash for example. Or there will be enough resources but the device will be misconfigured (very often). Because in the case you send out all priority packets first and after them tons and tons of non-prioirty packets, the upstream device will need to drop some. Which ones will it drop? Usually it will choose which ones to drop in a dumb-ass crippling way. This is why DiffServ is a (not guaranteed) standard.
With the current system priority only works if the max-limits are reached. That means that in case you have a 100Mbit non-guaranteed link and this links drops to 99Mbit the priority doesn't work and things get screwed up.
If the upstream device has smart queues and small queue sizes, things will be not so bad. But I dont trust ANY upstream device, even if it was configured/owned by the Pope. So usually the max-limit is set to 98999k and that 1Mbit is left unused, to achieve queue control. And that control is still some of the time
. Since there will be times that the usptream device will be able to forward even smaller amounts of your traffic... But this is The Internet, it is defined as not guaranteed. So I'ts not your problem. If you can compare an upstream provider to another, if you have access to many ISPs routers (like me) and can do special tests to see where the loss occurs and the delays etc - you can make the decision to switch upstream providers or to make a new deal with your current one. Or to build your own link/rent your own dedicated optic to an even upper-stream provider. From which you can profit by selling "guaranteed" bandwidth and you will be able to mess up your own "upstream" devices
There are other ways to help deal with these problems that I have implemented extremely successfully in a dozen of networks
.
actually, priority works when limit-at is reached
I hope you mean the "HTB feature" "Priority". Because one can achieve "piroirty" by bulding his Queue Tree with the limit-ats and the max-limits in a way to give certain leafs "priority" (limit-at). And I think void talks about doing it this way in his first post. In any case, I ask everyone who use this word to specify whether he is talking about "HTB Priority feature" or priority by limit-at or what exactly? Priority that needs Not be defined but just needs to be achieved? (as most users ask for - they just need it achieved). And @MT - could you please make a destinction between these two in the documentation and in the sofware, maybe start using a new word or phrase? As far as I see it right now - one is the "THB Priority feature" from 1 to 8 and the other is "limit-at". So what exactly is the practical difference between the two? How to take advatage of both, in an optimal way?
but let's suppose you have a gate that is passing one white car per minute - that's our queue. and now we get a blue one. so we want the blue car just go round all white cars and pass the gate without limitations =)
My VoIP example should do that. And the price would be that a white car would be made to disappear by Harry Potter (discarded packet) so that the blue one can take its place for immedaite transmission. Also that could happen if the blue car was missed in mangle and it travels out the same interface, in which case the decision if a white car should be dropped or not is made upstream, and in which case this decision could drop/delay a blue car.
Just to avoid any confusion - in MikroTik's QoS there are NO PACKET REORDERING, there are list of packets that will be dropped , but all remaining packets will leave QoS in the same relative order they came in.
What if these packets came in different interfaces?
So let's assume that on 100Mbit FastEthernet, packets are sent one by one, but so fast that in one second time - maybe about 7k-10k pps.
So we have 7k packets coming in the Local interface. Let's assume we number our incoming packets. Let's say we recognise (mangle) 2-3 VoIP packets. They came in as packet number 3, number 666 and number 6666.
So let's say we want to send out VoIP packet number 3 before non-VoIP packet number 2. For that "reordering" to be possible, the outgoing interface serialisation must be slower than FastEthernet. And for RouterOS to know that, it must be a local interface for example a 10Mbit Etherent card. Also the outgoing queues probably need to be bigger. Someone can wrap his brain around this situtation and tell us how could this happen or how and why this will not happen ?
When the unmarked queue is full, and VoIP traffic exists, that queue will lend traffic to the VoIP queue, since it has better priority.
At this point what happens with the lower prio packet that would get this bandwidth if there were no VoIP packets? It gets queued? Or it gets discarded? Because the VoIP one "overwrites" it? Such are the important qeustions that are not (definitely) answered in the conveyr belt example. Or in the Manual. Or anywhere.
The VoIP queue will also borrow...... When a queue cannot borrow any more bandwidth, it will drop packets
Which packets will it drop? The ones in front of the queue or the ones at the back of the queue?
What if we want it to drop from the middle of the queue?
It may be desirable to set up a limit-at parameter to ensure that a queue will not end up at 0 rate if no more bandwidth is available.
What if this queue is for the really low priority traffic? Like p2p traffic on a business network ?
Will the Low-prio traffic from my VoIP example find itself all discarded when the VoIP traffic takes full 100%?
The .diff files are the complete source?
I found something here :
http://git.kernel.org/?p=network/iprout ... ;a=summary the Snapshot link