How Queues are processed?

Oh ok, i see.

Thanks :slight_smile:

You might have noticed that you can drag a rule up or down in the list.

That’s so you can set the Order in which they get processed.

The Order can be very important.

LOL @ ur avatar.

are u talking with mangle or queues?

Filter, NAT and Mangle.

Queues are different.

LOL @ ur avatar.

What avatar ?

Mine’s a Webcam and i just put my specs on.

Its the dog with normises face

what dog? i have seen him, it’s his picture

U had me fooled there for a moment, i 1st thought it was father xmas… haha

Hello again.

Ok so i have been playing around wiht packet marking and i still cannot get download to work.

Ok i used a simple one to test:


i am just trying to mark tcp traffic on port 80 ( all web traffic)

but in my cue it only has Upload and no download:

So i created 2 mangle rules:

1: preroute
tcp:
port: DST 80
mark packet: web passthrough


then for the 2nd one ( the one i want to mark downloading traffic)
I tried all of the: pre,postrouting,input,output and forward with both dst and src port set to 80>

and i never got any download in my que traffic?

Please help.

Zapnologica

please, try this example, must help:

1)Mark Upload traffic. If u are use NAT on your router u can mark your upload traffic in mangle prerouting OR mangle forward, OR mangle postrouting (see packet-flow diagram):

1.1) Mangle prerouting:

chain=prerouting action=mark-packet new-packet-mark=my_upload passthrough=no src-address-list=inet_users in-interface=lan


1.2) Mangle forward:

chain=forward action=mark-packet new-packet-mark=my_upload passthrough=no src-address-list=inet_users out-interface=wan1


1.3) Mangle postrouting:

chain=postrouting action=mark-packet new-packet-mark=my_upload passthrough=no src-address-list=inet_users out-interface=wan1

  1. Mark Download traffic. If u are use NAT on your router u can mark your download traffic in mangle forward OR mangle postrouting (see packet-flow diagram):


    2.1) Mangle forward:

chain=forward action=mark-packet new-packet-mark=my_download passthrough=no dst-address-list=inet_users in-interface=wan1


2.2) Mangle postrouting:

chain=postrouting action=mark-packet new-packet-mark=my_download passthrough=no dst-address-list=inet_users out-interface=lan


Queue Tree.

If you are use marks from mangle prerouting then u must make queues in global-in interface, if u use marks from mangle forward or mangle postrouting - then u must make queues in global-out interface OR outgoing interface. If u want use PCQ queue type for NATed upload traffic, the you must use ONLY global-out interface (not outgoing interface) for queues, otherwise PCQ don’t work properly, because PCQ queues don’t know src-address of LAN clients if u use it after NAT (see packet-flow diagram).

I advise you to read: http://wiki.mikrotik.com/wiki/NetworkPro_on_Quality_of_Service , http://wiki.mikrotik.com/wiki/Manual:Packet_Flow

P.S. Sorry for my Broken English, I hope my information will help you.

Thank you very much:

That one post of yours has given me such a better understanding of the whole marking process:

Thank u so much.

Ur english was perfect, better than me and im english haha

what dog? i have seen him, it’s his picture

Cheers Normis. I get fed up explaining about my Ancestors in the Ruski Sputnik dog-breeding programme.

Just cos i’m a dog dunt mean i can’t do technology.

i have been playing around,

and the “forward mangles donot seem to work” ?

why would this be?

I tried create the ques on lan and that worked, but the prioriry does not work.

So i am trying to create the que on the wan interface?

Do u use forward for that?

and the “forward mangles donot seem to work” ?

Depends on whether the packet’s you’re expecting are being Forwarded.

E.g. : a packet destined for the Router you’re on will not hit the Forward rule - it will hit the Input rule.

Queue Priority does work, but it is unclear (to me) if MT implement a true Prio queue above the HTBs or not.

Even if you set Priorities, remember that all of this works on a packet-by-packet basis, and the router can process packets very quickly, so do not expect something to stop just because there is a higher Prio bit of data passing by.

Another thing you got to know is that the Queue acts on packets leaving an interface.
(IMQ confuses all that, so ignore global-in.out etc for now).

Ok when i say it ont work, i mean:

i set SIP as priority 1 and RDP as 2 and web as 4:

now as far as i belive, if i am on web, and i make a VOIP call, it should allow all VOIP packets thoough before the WEB therfore no laag?

but when i phone on VOIP and was on remote desktop, the voip call lagged like hell and the rdp was slow?

I just did a simple que.

marked the up and download traffic like u said and then used simple queues with a master parent.


So what must my mangle rule be to mark downloading traffic so that i can put the queue on the wan interface?


I am busy reading up on queue trees and PCQ ( sounds terrible confusing) my goal in life ( well in my mikrotik life) is to set up a crazy shaping and network priority router, where it works perfectly, and the mangles use packes sizes and all those crazy things under advanced :slight_smile:

Then you’re going to want to move from simple queues over to queue trees sooner rather than later. The queue trees give you a lot more options and a setup you can deal with.

As adrianatkins said, the interface you place the queue on is just for traffic leaving that interface, the router cannot control the traffic it has received on an interface, it can only control what it is sending out of the interface. So something like this will get you started on a queue tree. You can make sub branches as you classify things more in your mangle and make more packet marks. You basically need a tree for each LAN interface and each WAN interface, if you bridge all of your LAN interfaces together then you just need one on the bridge.

/queue tree
add name="Download LAN1" parent="LAN1" max-limit=10M priority=8
add name="High Download LAN1" parent="Download LAN1" limit-at=8M max-limit=10M priority=1 packet-mark="high priority"
add name="Low Download LAN1" parent="Download LAN1" limit-at=2M max-limit=10M priority=8 packet-mark="low priority"
add name="Upload WAN1" parent="WAN1" max-limit=10M priority=8
add name="High Upload LAN1" parent="Upload LAN1" limit-at=8M max-limit=10M priority=1 packet-mark="high priority"
add name="Low Upload LAN1" parent="Upload LAN1" limit-at=2M max-limit=10M priority=8 packet-mark="low priority"

The basic rules say that LAN and WAN can only ever send out 10M of traffic. Of that 10M 8M is a guaranteed rate for high priority, but it can take up to 10M if low priority isn’t using it’s guaranteed 2M, and vice versa.

Oh ok i see:

That seems much better than simple queues. Thats act what i was trying to do in simple queue,

I have constructed a nice queue tree now: lets see how it works.

I wil do some testing?

I have use PCQ in my tree?
what does this do?

is this normaly to make sure that one user does not hog the network?

I don’t have much experience with the various sub queue options. Queue types basically determine how the packets are ordered and what packets will get dropped when the queue is full, PCQ is a way of further dividing up queues automatically that will split each connection so no one connection can take everything if that is what you want. I just leave them at the default packet first in first out myself.

We are also running hotspots, so to insure that no one user takes up all of the bandwidth I have Radius assign each user a bandwidth profile that automatically sets up a simple queue just for that user. This way I am prioritizing all of the traffic I want, DNS, HTTP, etc, and each end user has a rate limit they cannot exceed. It’s harder for me to say how well this works since guests only say something when they have a problem and not when it works.

Yea, i was thinking about that,

Cause currently i also set the speed limit in raduis, and that seems to work well.

But from my understanding of using queue trees with pcq is that say there is only 2 users on line they get more than what they usualy would get???


So PCQ is a good thing if u can get it set up correctly:

i followed some pdf file QoS_Megis.pdf and it was really nice, its just that i dont get the whole:
Rate:
Limit:
Total Limit:

thing? some how u need to divide total limit by limit to see how many users it will work with, so u have to adjust it appropriatly.
But i donot understand it enough to change them and see what it does? U by any chance know?

Actually your normal simple queues are going to fire still going to fire and apply their rate limits to each user. By placing the queues trees directly on the interface they are being processed after everything else has been done to them on the router. I believe if you place them on the Global-in and Global-out “interfaces” it then will override the simple queues and not process them.
http://wiki.mikrotik.com/wiki/Manual:Packet_Flow

The Wiki has a few examples explaining PCQ:
http://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ
http://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ_Examples
http://wiki.mikrotik.com/wiki/Manual:Queue

Basically if you set up PCQ you are telling the router to divide up queues it has on that interface into sub queues dynamically to make sure no one connection is taking up all of the bandwidth. If you just use PCQ and nothing else, there is an option that allows you to set up the maximum amount that it will give any one person.

There was a presentation by Fewi at this last MUM that went over using PCQ for hotspots instead of the default simple queues that you may find useful in understanding PCQ a bit more, it just doesn’t appear to be up on the ticktube yet.