Confused by Queues

Hi,

My global upload speed is severely limited, so I need to create a Queue / Queues on my 750G to give priority to traffic coming from my 433AH and going to the Internet. Emails being sent from the Mail Server to the Internet need to be a lower priority.

Diagram:

Ethernet Ports on the 750G are connected as follows:
Eth1 <=> Internet
Eth2 <=> RB433AH
Eth3 <=> Mail Server

I’ve been reading the Wiki and have been experimenting with different types of queues, but nothing seems to work and I’m more confused now than when I started.

Is there a simple way to give one interface upload priority over the other using queues?

anyone?

No, there is no simple way. RouterOS doesn’t have the concept of “process this traffic first”.

You need to make IP firewall mangle rules that mark packets based on their ingress interface. That way packets from your 433 can be differentiated from packets from your mail server.

Then make a queue on your WAN interface on the RB750G. That queue will handle all packets going OUT of that interface - there is no point trying to do QoS on egress packets in your situation since it’s already too late when the packets come to you.

That queue should have a limit-at set to your actual upload speed given to you by your provider. Then make two child queues to that queue. One uses the packet marks for the RB433 and gets a priority of 1, the other uses the packet marks for the mail server and gets a priority of 8. You also need to set the limit-at and max-limit parameters on the child queues. That’s difficult to explain in theory, so below a contrived example.

Let’s say you have 1 meg upload. Therefore you set the limit-at of the interface queue to 1M.

Priority first determines each child queue’s race to get to limit-at. Priority then determines each child queue’s race to get to max-limit. You want the mail traffic to trickle while the 433 gets (nearly) all traffic to itself when it needs it. One approach would be to set the limit-at of the mail queue to 64K, and its max-limit to 1M. That way it can get a (in your situation) guaranteed 64K at all times, but can go up to 1M when space is available. The 433 queue gets a limit-at of 512K and a max-limit of 1M. That way it gets a more or less guaranteed 512K at all times, but can go up to 1M when space is available.

When both are contending, the 433 queue first gets 512K due to priority. Then the mail queue gets 64K due to priority. Then the 433 queue gets up to 1M due to priority, and the mail server gets what is left.

Hope that helps.

Thanks Fewi!

Early testing suggests that it did the trick!

I guess the thing that confuses me most about queues is that limiting “upload” or “download” does not always work in the way I would expect. e.g. When I set the upload limit of my queues on the 750G, it actually restricted my download speed and vice versa.

:confused:

http://wiki.mikrotik.com/wiki/Packet_Flow#Diagram

Look this over, it explains how packets flow through the router, and when and where they are processed. If you are setting up any kind of QoS, this is a vital document to have with you.

The one thing that confuses people the most is they expect to be able to limit speed of a connection from the interface something comes in on. This is simply not possible, the router has no control over the stuff it is receiving on any given interface. What it can do is limit what it sends out of a given interface, so this means a Queue on your LAN limits download, and a Queue on your WAN limits upload.