Traffic Prioritization with Queue trees
RouterOS general discussion

6 posts   •   Page 1 of 1
alex_rhys-hurn
Member
Member
 
Posts: 304
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya

Traffic Prioritization with Queue trees

by alex_rhys-hurn » Tue Oct 09, 2007 3:33 am

Hi Folks,

Macgaiver says this:
Let me explain how to realize QoS in 2 steps

1) traffic prioritization - mangle traffic by type (first 200k, last 200k, p2p, icmp etc) in prerouting and prioritize it in global-in (using only queue tree) - WITHOUT ANY LIMITATION - only priorities - this way all packets will be arranged in to your determined sequence!

2) traffic shaping - RE-MANGLE traffic by users in mangle chain forward, and place limitation on the interface queues (using PCQ for example) - this way you will be dropping last traffic from the sequence you made earlier

Thats all folks!!! It took me one Mikrotik Advanced QoS training + 2 weeks to handle


I am working on step 1, the traffic prioritisation.

I have the mangle rules working well, identifying traffic by port and protocol, using conn.mark and packet mark. The counters increment correctly.

I also used the wiki http://wiki.mikrotik.com/wiki/TransparentTrafficShaper to help me get these right.

An example of a couple of these mangle rules (not all as its a long list):

Code: Select all
  0   ;;; DNS TRAFFIC
     chain=prerouting action=mark-connection new-connection-mark=dns_conn passthrough=yes dst-port=53 protocol=tcp

 1   chain=prerouting action=mark-connection new-connection-mark=dns_conn passthrough=yes dst-port=53 protocol=udp

 2   chain=prerouting action=mark-packet new-packet-mark=dns passthrough=no connection-mark=dns_conn

 3   ;;; SSH TRAFFIC
     chain=prerouting action=mark-connection new-connection-mark=ssh_conn passthrough=yes dst-port=22 protocol=tcp

 4   chain=prerouting action=mark-connection new-connection-mark=ssh_conn passthrough=yes dst-port=22 protocol=udp

 5   chain=prerouting action=mark-packet new-packet-mark=ssh passthrough=no connection-mark=ssh_conn


I am having problems with the queue tree however. This is the code for my queue tree:

Code: Select all
[admin@Core Router] /queue tree> print detail
Flags: X - disabled, I - invalid
 0   name="HTTP" parent=global-in packet-mark=http limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 1   name="SSH" parent=global-in packet-mark=ssh limit-at=0 queue=default priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 2   name="DNS" parent=global-in packet-mark=dns limit-at=0 queue=default priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 3   name="SIP" parent=global-in packet-mark=sip limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 4   name="RTP" parent=global-in packet-mark=rtp limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 5   name="SMTP" parent=global-in packet-mark=smtp limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 6   name="OTHER TRAFFIC" parent=global-in packet-mark=other limit-at=0 queue=default priority=4 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s
[admin@Core Router] /queue tree>


queue-trees-priority.jpg
queue-trees-priority.jpg (42.07 KiB) Viewed 2540 times


My Main aim here is to ensure that my SIP phone calls and remote winbox sessions do not get broken by other traffic and surfing.

But it doesnt seem to work properly, my sip calls still get broken up when other traffic passes.

Do I need to make queues for upload and download? or should I duplicate the mangle rules with one set for the WAN interface and the other for the LOCAL interface?

Can anyone spot a mistake?

Help appreciated.

Alex

rafa_lore
Member Candidate
Member Candidate
 
Posts: 121
Joined: Tue Apr 17, 2007 4:57 am
Location: Salta

Re: Traffic Prioritization with Queue trees

by rafa_lore » Tue Oct 09, 2007 4:52 am

HI Alex
I think that is better to make a QUEUE TREE mother of download and upload, and then inserting the other queue depending of that queue mother
Look for in yhe wiki and you will see a better example
Bye
Rafael Loré

alex_rhys-hurn
Member
Member
 
Posts: 304
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya

Re: Traffic Prioritization with Queue trees

by alex_rhys-hurn » Tue Oct 09, 2007 4:47 pm

Ok, thanks for the reply.

So you are suggesting that I make a parent (or mother in your words) queue for upload and another one for download. Then I put the priority queues for each traffic underneath the parent queues.

Makes sense to me logically but how do I do this? The parent queue will have unlimited bandwidth and standard priority set? but only be fixed to the relevant interface?

I don't want to define speeds on the queue because the VSAT service I have here in Africa does not guarantee bandwidths...

So, can you confirm if my thinking is along the right lines? I am going to experiment just now.

alex_rhys-hurn
Member
Member
 
Posts: 304
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya

Re: Traffic Prioritization with Queue trees

by alex_rhys-hurn » Wed Oct 10, 2007 11:34 am

I dont think I have got this right yet.

I think that it must be a queues problem, and probably I have got the wrong the parents.

This is what my queue types and queue trees look like:

QUEUE TYPES
Code: Select all
5 name="pcq-download" kind=pcq pcq-rate=0 pcq-limit=50 pcq-classifier=dst-port pcq-total-limit=2000

 6 name="pcq-upload" kind=pcq pcq-rate=0 pcq-limit=50 pcq-classifier=src-port pcq-total-limit=2000


So for the queue types I have set PCQ with src port and dst-port classifiers. Is this correct?

QUEUE TREE
Code: Select all
  name="HTTP" parent=upload packet-mark=http limit-at=0 queue=pcq-upload priority=4 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 1   name="SSH" parent=upload packet-mark=ssh limit-at=0 queue=pcq-upload priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 2   name="DNS" parent=upload packet-mark=dns limit-at=0 queue=pcq-upload priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 3   name="SIP DOWN" parent=download packet-mark=sip limit-at=0 queue=pcq-download priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 4   name="RTP" parent=upload packet-mark=rtp limit-at=0 queue=pcq-upload priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 5   name="SMTP" parent=upload packet-mark=smtp limit-at=0 queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 6   name="OTHER TRAFFIC DOWN" parent=download packet-mark=other limit-at=0 queue=pcq-download priority=4 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

 7   name="upload" parent=ether3-red packet-mark="" limit-at=0 queue=pcq-upload priority=4 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 8   name="download" parent=global-in packet-mark="" limit-at=0 queue=pcq-download priority=4 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

 9   name="DNS-DOWN" parent=download packet-mark=dns limit-at=0 queue=pcq-download priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

10   name="HTTP DOWN" parent=download packet-mark=http limit-at=0 queue=pcq-download priority=4 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

11   name="OTHER TRAFFIC UP" parent=upload packet-mark=other limit-at=0 queue=pcq-upload priority=4 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

12   name="RTP DOWN" parent=download packet-mark=rtp limit-at=0 queue=pcq-download priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

13   name="SIP" parent=upload packet-mark=sip limit-at=0 queue=pcq-upload priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

14   name="SMTP DOWN" parent=download packet-mark=smtp limit-at=0 queue=pcq-download priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

15   name="SSH DOWN" parent=download packet-mark=ssh limit-at=0 queue=pcq-download priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

16   name="WINBOX" parent=upload packet-mark=winbox limit-at=0 queue=pcq-upload priority=2 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

17   name="WINBOX DOWN" parent=download packet-mark=winbox limit-at=0 queue=pcq-download priority=2 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s


Here is an image of the tree:
queue tree.png
queue tree.png (15.12 KiB) Viewed 2431 times


It seems to me that the mangle works as the counters increment correctly. It also seems to me that the queues are doing something as the counters increment as expected there too.

But if I have an SSH session open and then start a download, the ssh session will drop me out...

Can any one help with this?

Regards,

Alex

pospanko
Member Candidate
Member Candidate
 
Posts: 244
Joined: Sun Dec 18, 2005 5:23 pm

Re: Traffic Prioritization with Queue trees

by pospanko » Wed Oct 10, 2007 8:47 pm

This thread is dead for a while. Hope someone could help him (and me too) to do pririty by traffic then equal among users...

alex_rhys-hurn
Member
Member
 
Posts: 304
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya

Re: Traffic Prioritization with Queue trees

by alex_rhys-hurn » Wed Oct 10, 2007 11:45 pm

Hey pospanko,

maybe we work together and figure it out...

what is your config and problem?

Cheers!

its nice to know I am not alone!

Alex

6 posts   •   Page 1 of 1

Who is online

Users browsing this forum: Google Feedfetcher, sarikatel and 32 guests

It is currently Sat Nov 29, 2014 12:38 pm