Community discussions

MikroTik App
 
xminox
just joined
Topic Author
Posts: 1
Joined: Sun Apr 01, 2018 4:14 pm

Queue tree beginner's question

Sun Apr 01, 2018 4:31 pm

Hi all,
apologies for, perhaps, a really dummy question. What I want to achieve is a simple packet prioritization (and also bandwidth limitation) based on src IP.
I've typed following:
/queue tree
add limit-at=8000k max-limit=8000k name=Queue1 parent=ether1-wan queue=default
add limit-at=8000k max-limit=8000k name=P2-Mining packet-mark=Mining parent=Queue1 priority=2 queue=default
add limit-at=7800k max-limit=7800k name=P3-AppleTV packet-mark=AppleTV parent=Queue1 priority=3 queue=default
add limit-at=5000k max-limit=5000k name=P4-untagged packet-mark=no-mark parent=Queue1 priority=4 queue=default

/ip firewall mangle
add action=mark-connection chain=postrouting src-address=192.168.0.34 new-connection-mark=Mining passthrough=no
add action=mark-connection chain=postrouting src-address=192.168.0.36 new-connection-mark=Mining passthrough=no
add action=mark-connection chain=postrouting src-address=192.168.0.20 new-connection-mark=AppleTV passthrough=no
add action=mark-packet chain=postrouting connection-mark=Mining new-packet-mark=Mining passthrough=no
add action=mark-packet chain=postrouting connection-mark=AppleTV new-packet-mark=AppleTV passthrough=no 
Then I used Speedtest.net app on Apple TV to check if it works and the answer is no. It always hits packet-mark=no-mark ( priority 4 ) and not packet-mark=AppleTV ( priority 3 ).
Src IP is correct. Any ideas?

Thanks in advance!
 
HzMeister
Frequent Visitor
Frequent Visitor
Posts: 73
Joined: Sun Jan 28, 2018 9:48 pm

Re: Queue tree beginner's question

Wed Apr 04, 2018 6:13 am

You're trying to do qos on download, right?
If so,
Set passthrough=yes on the connection marks.
Set chain=prerouting on all mangle rules.
Set parent=LAN in the queue tree.
Keep everything else the same.

btw, your limit settings aren't setup correctly - I'd remove everything but the max limit on the parent queue. Also, if you don't have anything that's ultra latency sensitive, sfq will share bandwidth more fairly.
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1127
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: Queue tree beginner's question

Wed Apr 04, 2018 11:27 am

Assuming this is upload?
Couple of points to mention.
If you are doing prioritisation, you don't "really" need to use limits as you are passing off potential spare bandwidth when limits aren't being hit.
Max-Limit is max speed you want to go at, limit-at is the amount you don't want speed reducing below.
I generally use default-small but if your preference is default then go with that. A bigger queue isn't necessarily a good thing as it's more delayed packets, sometimes it is better to drop.
I've added the passthrough option as your connections would get marked for connection-mark then not passed through for packet marking.
I've changed from "post" to "pre" chains as that's generally where I tend apply upstream QoS marking.

My adaptation of your export;
/queue tree
add max-limit=8000k name=Queue1 parent=ether1-wan queue=default
add name=P2-Mining packet-mark=Mining parent=Queue1 priority=2 queue=default
add name=P3-AppleTV packet-mark=AppleTV parent=Queue1 priority=3 queue=default
add name=P4-untagged packet-mark=no-mark parent=Queue1 priority=4 queue=default

/ip firewall mangle
add action=mark-connection chain=prerouting src-address=192.168.0.34 new-connection-mark=Mining passthrough=yes
add action=mark-connection chain=prerouting src-address=192.168.0.36 new-connection-mark=Mining passthrough=yes
add action=mark-connection chain=prerouting src-address=192.168.0.20 new-connection-mark=AppleTV passthrough=yes
add action=mark-packet chain=prerouting connection-mark=Mining new-packet-mark=Mining passthrough=yes
add action=mark-packet chain=prerouting connection-mark=AppleTV new-packet-mark=AppleTV passthrough=yes 
HTH
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials
 
anavds
newbie
Posts: 38
Joined: Wed Apr 04, 2018 2:47 pm

Re: Queue tree beginner's question

Wed Apr 04, 2018 3:16 pm

Hi StevO

Can you explain the logic of the setup..........
Line1: The max-limit of 8K is the highest throughput the rule will apply (manages up to 8K speed)
Q, What happens to capacity above 8K?
Line1: 8K speed is available to the units identified in the queue tree.
Line1: This queue manages outgoing traffic from the LAN (upload - LAN to WAN)?
Q. What happens to download traffic? (from Wan to LAN devices)?

Lines2,3,: Attach marked traffic as part of the parent queue and associate the desired Priority
Line4: Same except instead of a specific source (address), this handles all other traffic as the lowest Priority (4)
Q. What is the difference in effect of stating Priority 2,3,4 in practical terms (how is 8K divided up?
Q. What happened to Priority 1?
Q. What is the difference between default and default-small, or default-big LOL if there is such a thing.
Q. The passthrough one is confusing.......... you recommend using it to ensure that ??? The wording used could be construed two ways,
Im confused by marking for connection-mark and then packet marking??

It seems the new packet marking level is required for queue application.
It seems the new connection mark is required for.............???????
Why do you have two mangle rules per........
Is passthrough simply stating, please go to the next mangle rule that applies to this traffic ???

Why not (one RULE).
add action=mark-packet chain=prerouting source-address= 192.168.0.xx connection-mark=Mining new packet mark=Mining
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5717
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Queue tree beginner's question

Thu Apr 05, 2018 5:22 am


Assuming this is upload?
Couple of points to mention.
If you are doing prioritisation, you don't "really" need to use limits as you are passing off potential spare bandwidth when limits aren't being hit.
Max-Limit is max speed you want to go at, limit-at is the amount you don't want speed reducing below.
I generally use default-small but if your preference is default then go with that. A bigger queue isn't necessarily a good thing as it's more delayed packets, sometimes it is better to drop.
I've added the passthrough option as your connections would get marked for connection-mark then not passed through for packet marking.
I've changed from "post" to "pre" chains as that's generally where I tend apply upstream QoS marking.

My adaptation of your export;
/queue tree
add max-limit=8000k name=Queue1 parent=ether1-wan queue=default
add name=P2-Mining packet-mark=Mining parent=Queue1 priority=2 queue=default
add name=P3-AppleTV packet-mark=AppleTV parent=Queue1 priority=3 queue=default
add name=P4-untagged packet-mark=no-mark parent=Queue1 priority=4 queue=default

/ip firewall mangle
add action=mark-connection chain=prerouting src-address=192.168.0.34 new-connection-mark=Mining passthrough=yes
add action=mark-connection chain=prerouting src-address=192.168.0.36 new-connection-mark=Mining passthrough=yes
add action=mark-connection chain=prerouting src-address=192.168.0.20 new-connection-mark=AppleTV passthrough=yes
add action=mark-packet chain=prerouting connection-mark=Mining new-packet-mark=Mining passthrough=yes
add action=mark-packet chain=prerouting connection-mark=AppleTV new-packet-mark=AppleTV passthrough=yes 
HTH
So what happens with return traffic coming from the WAN, how is that handled??
What is the practical effect of setting the priorities 2,3,4 in terms of the 8K and what happened to number 1?
What is the practical difference between default and default-small? is their a default-tiny and how about defaulty-teenytiny?

I think you have a mangle mess, what happened to keeping it simple?
In other words please explain why you seem to have two mangle rules per traffic type......
(why new connection mark and new packet mark -thus far I have only used mark routing and thus lost in the dark)

How would you handle also ensuring the apple TV never got less that 1500k?
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1127
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: Queue tree beginner's question

Thu Apr 05, 2018 12:49 pm

So what happens with return traffic coming from the WAN, how is that handled??
Does it matter? Download is already probably rate limited by the ISP, why try to reorder it as it comes back in? You're burning off resource and re-ordering stuff that doesn't need to be.

What is the practical effect of setting the priorities 2,3,4 in terms of the 8K and what happened to number 1?
Priority is literally as it sounds, the marks are run in ascending order with priority in that way. You don't need a 1 to have a 2,3,4. I usually use 1,4,8 (High, Med, Low) but I'm trying not to re-invent someone elses wheel here.

What is the practical difference between default and default-small? is their a default-tiny and how about defaulty-teenytiny?
I think it's 50 packets to 20 (it says for certain in the wiki:manual. You can create your own queue and assign that as teenytiny (2 packets?)

I think you have a mangle mess, what happened to keeping it simple?
In other words please explain why you seem to have two mangle rules per traffic type......
(why new connection mark and new packet mark -thus far I have only used mark routing and thus lost in the dark)
Connection mark is picking up source of traffic and labelling it all.
Packet mark is using connection mark as a matcher to label those packets.
IMO it's actually a very clean way of achieving packet marking like this. Less of a mess and more of "another way" of organising it.
**Also see previous comment about not re-inventing someone elses wheel.

How would you handle also ensuring the apple TV never got less that 1500k?
If you are packet prioritising the ATV's upload then naturally the download will lean in that direction due to the free flowing upload acks, if other devices are getting slower ack returns then their download stream will of course be slower.
I accept there is nothing in their guaranteeing the ATV the bandwidth however the upload prioritisation (if ATV were number 1 for example) should ensure it is not needed.


TL:DR
Why limit your download when it's already limited? The packets are already arriving at your router.
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5717
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Queue tree beginner's question

Thu Apr 05, 2018 3:04 pm

Strange ISPs you have in the UK, here they are 150 down and 50 up, as a typical throughput and thus my upload is more limited than my download LOL.
Is live streaming or streaming netflix an UPLOAD action???
I mean not everyone is serving up,,,,,,,,,, and I say the majority are downloading, so I dont understand your comments.
Yes I am always difficult LOL (but I realize its often from my lack of proper networking understanding).
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1127
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: Queue tree beginner's question

Thu Apr 05, 2018 3:24 pm

Strange ISPs you have in the UK, here they are 150 down and 50 up, as a typical throughput and thus my upload is more limited than my download LOL.
Is live streaming or streaming netflix an UPLOAD action???
I mean not everyone is serving up,,,,,,,,,, and I say the majority are downloading, so I dont understand your comments.
Yes I am always difficult LOL (but I realize its often from my lack of proper networking understanding).
Your 150Mb download is limited by your ISP though (unless you pull data from servers that can't push data to you that fast).
Streaming is of course download however you have a constant flow of ack packets going back up, on an upload limited connection you can prioritise these to enable smooth streaming whilst making non-essential other connections get in line behind.

On a 150/50 residential service QoS really is probably not needed other than something to "level out" the connection if it spikes above, a simple queue would do that quite well. For a more restricted service though 10/0.5 as a perfect example then upload prioritisation is an absolute key factor in levelling out a service. The easy answer is of course provide more bandwidth but if that isn't an option you have to manage what you have better.
Steve "Steveocee" Carter
PC Gamer, Airsofter, MikroTik Nerd
My Website - My MikroTik Tutorials

Who is online

Users browsing this forum: 007, coreshok and 82 guests