Community discussions

MikroTik App
 
alex_rhys-hurn
Member
Member
Topic Author
Posts: 348
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Traffic Prioritization with Queue trees

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):
  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:
[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
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
You do not have the required permissions to view the files attached to this post.
 
rafa_lore
Member Candidate
Member Candidate
Posts: 121
Joined: Tue Apr 17, 2007 4:57 am
Location: Salta
Contact:

Re: Traffic Prioritization with Queue trees

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
Topic Author
Posts: 348
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Traffic Prioritization with Queue trees

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
Topic Author
Posts: 348
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Traffic Prioritization with Queue trees

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
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
  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
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
You do not have the required permissions to view the files attached to this post.
 
pospanko
Member Candidate
Member Candidate
Posts: 279
Joined: Sun Dec 18, 2005 4:23 pm

Re: Traffic Prioritization with Queue trees

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
Topic Author
Posts: 348
Joined: Mon Jun 05, 2006 8:26 pm
Location: Kenya
Contact:

Re: Traffic Prioritization with Queue trees

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

Who is online

Users browsing this forum: Josephny, karlisi, TeWe, VinceKalloe and 104 guests