and lower:priority - order in which classes are served at the same level
Priorities
When there is a possibility to send out a packet, HTB queries all its self slots in order of priority, starting with highest priority on the lowest level, till lowest priority on highest level. Each leaf class (packets are stored and enqueued only within qdiscs attached to each leaf class) is ultimately connected to a certain self slot, either directly or through a chain of parent classes:
As you can see from the picture, leaf-classes that are in the green state will always have a higher effective priority than those that are yellow (and, thus, borrowing their rate from parent classes), because their priority is at a lower level (level 0). In this picture, Leaf1 will be served only after Leaf2, although it has a higher priority (priority 7) than Leaf1 (priority .
In case of equal priorities and equal states, HTB serves these classes, using round robin algorithm.
cfosspeed is doing the perfect shaping on the windows, they found the solution.ping (icmp) is a simple test. You could be seeing 1000ms ping times or timeouts and it doesn't always mean the path is slow. For a router to generate packets it is way more overhead that simply routing them.
Yes but based on outbound it knows when to react.With that solution it is still based on changing outbound packets, not inbound. Why not just give your specific (voip?) outbound traffic higher priority all the time?
Yes of course the lower priority download is 24/7 which means all the time, full bandwidth used, or like 99,8% average usage of the bandwidth.From your first few posts it sounds like you want a way to give less priority to longer running connections. Since downloading and browsing is the same thing you need a way to determine what you really want to give less priority to. Maybe based on bursts, or mime types, or something else.
there is no difference in port between browsing , latge file download and a small file download , they all are using port 80 ( of course i'm talking about http download )!!!!! and this is what i was talking about ..
if we have 10Mbps total download speed , and its all filled with downloading large files by different users , when a user tried to browse a small size site , then the user will not find the available bandwidth to browse , ((( page cannot be displayed ))) will shine infront of his eyes , or in the BEST conditions he will take a nap before the page will be downloaded !!!!!!!!
how can MT recognize this ? how can it tell this is a user , he needs just to browse this small page let those giants traffic to slow down a little bit .. WHAT IS MT PRIORITY DOING ??
some falks in this forum ( previous topics ) tried to differintiate between these two types of traffics by thier connection size , which i found it not working good most of the time , may be there is somthing is missing here which is the connection time , so we may consider not only the size of connection , but the active duration of the connection too .. the longest duration large size connection should be slower than the new connections ..
its somthing like burst , but would the burst work if the total download has been filled ?
Tell me just few things, do you mean you have perfect qos for the incoming or outgoing packets or for the both, and do you have bandwidth limitation by the ip's, plus the max transfer limitation for the child ports. Or did you let the child ports with lower priority the full bandwidth allocation of a each IP.I have a Mikrotik QoS working as a charm.
Packets with lower priority are being dropped correctly and if my bandwitdth is full and a higher priority request is processed, it makes room and bandwitdth for it...
No theory or documentation. I have it deployed on my network and i have 600 users in a 34mbit connection. Without that QoS i would've been in troubles already.
macgaiver wrote:
Example2:Client sends out 10Mbps TCP traffic - this traffic will get to the routers local interface, but in one of the HTB (global-in,global-total,global-out or outgoing interface) will be shaped to (lets say) 1Mbps. So only 1Mbps will leave the router. Source get ACK packets only for 1Mbps of 10Mpbs, so source, in the next second, will send little more than 1Mbps Of TCP traffic
And only WARNING that must be there is "To use queues you MUST have TCP/IP knowledge."
and what do you think when when I say shaping the inbound traffic ?
Well there are 1 byte field in IPV4 packet that indicates IP protocol number and as we all know 2^8=256.Only 254?
I shape Inbound Traffic
The key is to set your upper limit about 15% lower than your service can push.
so if I had 10Mbps from my supplier I would set my top to 9Mbps.
It does work perfect, I light user has 10ms ping, the hog user when he uses torrent gets 1000+ms ping.
easy - use "connection-bytes" option in mangle - to prioritize first 4Mb or so of ever TCP port 80 connection.
Long version
1) HTTP browsing connection usually is not more that 0,5MB (or 4Mb)
2) Mangle facility can mark only part of connection - you must use mark-packet directly without mark-connection
3) create two marks "first_bytes" and "last_bytes"
4) create queue structure in queue tree (one for download on local interface, one for upload on public interface)
queue structure must have 3 queues
a) parent with max-limit
b) queue for "first_bytes" with priority=1 and limit-at and max-limit specified
c) queue for "last_bytes" wint priority=8 and limit-at and max-limit specified.
That is it - I use it every day to prioritize normal HTTP over other trraffic on port80 (like p2p, downloads etc)
This is probably the best idea I've seen yet, nowhere near as complicated as shaping outbound pps and makes sense that it allows a margin for any new traffic/connections you can't control straight up. You do however need a connection that has a set limit (eg this wouldn't work as well on an contentioned connection as you aren't guranteed the bandwidth)I shape Inbound Traffic
The key is to set your upper limit about 15% lower than your service can push.
so if I had 10Mbps from my supplier I would set my top to 9Mbps.
It does work perfect, I light user has 10ms ping, the hog user when he uses torrent gets 1000+ms ping.
yes, QoS and Priority is WORKING in MIKROTIK.
for priority, do you make parent queue for the priority rules ? If you don't have one, Router will think that you have unlimited bandwidth, so no matter what priority that connection has, router will pass the traffic.
IF what you said can be done then it will manage the total bandwidth not per user limit , cause max limit is the total bandwidth of the network , so as per user he will not notice any difference if he hit his max limit .. for example a network with 10M max download , and one user has 256k max , when he is downloading a large file he will hit the 256k and stay like that , at the same time the whole network is not consuming more than lets say 2M , when he try to browse the Q tree will not prioritize anything cause the max limit ( 10M ) is not reached yet , right ?easy - use "connection-bytes" option in mangle - to prioritize first 4Mb or so of ever TCP port 80 connection.
Long version
1) HTTP browsing connection usually is not more that 0,5MB (or 4Mb)
2) Mangle facility can mark only part of connection - you must use mark-packet directly without mark-connection
3) create two marks "first_bytes" and "last_bytes"
4) create queue structure in queue tree (one for download on local interface, one for upload on public interface)
queue structure must have 3 queues
a) parent with max-limit
b) queue for "first_bytes" with priority=1 and limit-at and max-limit specified
c) queue for "last_bytes" wint priority=8 and limit-at and max-limit specified.
That is it - I use it every day to prioritize normal HTTP over other trraffic on port80 (like p2p, downloads etc)
this how to had been asked before , some examples posted , some mikrotik " experts " said it cant be done cause the both browsing and download has the same port , and we try hard to apply the connection byte example but no hope !!!!!This post is titled wrong, from what I recall the OP wanted to differeniate between web surfing and downloading. The HTB system that RouterOS uses works fine you just have to get the correct queue and mangle rules for shaping the appropiate traffic.
The problem the OP is having is how do you prioritize different types of HTTP traffic (both HTTP downloading and web surfing use the same port).
I would suggest to the OP that a new topic be created under the question of how to prioritize web surfing over downloading.
but your example about connection byte doesnt work in giving browsing higher priority than download !!!!!!! did you missed somthing in the manual or may be its just MT !!!!!!!i will put it bluntly - you have to know what is going on to manage it. if you have vague image of what is happening you will run in different problems. You have to have good knowledge about networks. You have to know, what traffic is what, where you can possibly alter it in a safe way that you are not dropping packets, but limiting those.
I can assure you - priority is working in queues. how? here is how:
http://www.mikrotik.com/testdocs/ros/3.0/qos/queue.php
using manual you should be able to make working configuration (very basic) and then, if you know what you have just done, you can advance it to even higher complexity. if you want very complex example you should contact consultants, because that is a lot of effort to make it.
some configuration things have to be changed if you upgrade to v3. it doesn't mean that v3 doesn't work, it just means you have to change something. like queue type to "default" for exampleI found that at least on a RB532A and a RB 112 that versions around 3.1X did not function for simple queues. I downgraded to 2.9.51 and those simple queues worked. ( Had to recreate in either version)
I was stuck on this for a while. there are other posts that ask what hapened to the QOS functionality, and no one seemed to of noticed? its not working.
Yes I tried chaging everything from the small defualt, ehter, wireless types... never worked until downgrade. I do not know which version specifically it stopped working at. ALl I know is I am going to stick with 2.9.51 for a while.
2. RouterOS's QoS works just fine, I've mentioned I use it for game/voip traffic all the time. I use many different methods to 'measure' the effectiveness of my QoS, but for those that want an easy way try this website: http://www.testyourvoip.com/, when I turn my rules off my rating goes to 2.3/5.0, with them on I get 4.4/5.0 (This is of course when under load ie. using all available bandwidth).
I mean no harm, but you ar obviously talking about http downloads, at least in some points in teh topic. How can you possibly know wtf is going on in a connection without having something ready-made ?!? You count connection-bytes, or something, or do something else to know it, it wan't fall from the sky ready configured, on your router.according to janisk , we cant control the incomnig packets , i dont think its 100% true , cause these downloads are going to some clients IP's , and we can delay them or letting them go by limiting those IP's max download rate , or by (( Priority )) I suppose !!!! , so these download packets are OUTBOUND for the router !!!!
if we can do nothing to them then how can we avoid the case when the max download rate reached and no one can browse or do anything ?
you , yourself janisk had posted a previous topic to solve this issue , by differentiate between the large size connections and the small size connection , after applaying your example the result is the same if I disable your rules , a page is taking 7 sec to browse in normal condition , wehn large files were downloaded , the same page with or without your example is taking 25 sec ..
HTB is not the solution here , we need to QoS the TCP connections , its not imaginary words , cause this exists with another ISP , as we see them doing exactly what we are talking about ..
the point is giving the long time or large files downloading the lowest priority .. thats it ..
It is possible, IF you throw out youngest man in previous station and train gets to granny's station 95% full, and granny sees that it is possible to get into train at all.
why dont we tell a youngest man* there ( lowest priority ) to get out and wait for the next train , letting the granny to get into the train ??
* this youngest man was in the train for a very long time , maybe he is drunk and sleeping there !!!!
is it possible or not ?
yeah, right. but, as I said, this policeman had to be _before_ the side road, i.e. at your provider's devicesYES we can let the side car to enter the road even if its 100% , a police man can stop the side line making a space for this car ... right ? this police man what i'm searching for ..
it's not cut, the document is complete. just read the few slides before the last oneJanis have explained it well on the USA MUM and we have a PDF from that: http://mum.mikrotik.com/presentations/US08/janism.pdf but the PDF is not enough. How about uploading the whole video/audio or all hos words in another PDF file ? Since this PDF file is cut at the interesting part the priority. In this PDF there is information that IS NOT IN ANY MIKROTIK MANUAL. MikroTik manual have sucked hard for ages - admit it. Cheers
Janisk , that was not even close !!!!!!!
you are talking about general setup , which wont help in this case at all ..
i'm not asking HOW to set Q rules , or HOW to use mangle or else ..
it was a specific idea , its all about the connections of a single dynamic user .. not for the Total MAX Download as in all examples here or even in janism.pdf ..
its like if we say using PCQ for single dynamic IP .. not a group of IP's in address list ..
janisk at his famous example , differentiate between http browsing from http downloading by connection bytes , but in real life its not working , if the user hit his max rate with http downloading there will be no room for http browsing even it has priority 0 or even -100000 !!!!!!!!!!!!!
I agree there should be a way to prioritize the bandwidth of each user (each ip) , priority for all bandwidth is not so useful.By doing mangle ICMP with passthrought=NO, we will extra bandwidth to customer (the IP).
it should be ok since ICMP will eat a little bandwidth only.
How about other protocol which will eat a lot of bandwidth like VoIP, Video Conferencing?
i mean those protocol that need be prioritied.
NO , its the point , it will work per total bandwidth , not per user max limit ..If you do prio for all badnwidth, it will work for each user that is not the point here
How to be sure it can be done in these versions ?because it does not work , I mean it does work
cause it's 90% cant be done , now ..but no one is willing to give just three lines ov mangle and queue rules to get us started
You did not named me but i have this problem too.samsoft08 and loop11 - can we take a look at least one example of your configuration attempts????
At this point this is only random shouting and it looks like you don't know what are you shouting about.
We already described you that your idea how limitation works was incorrect, but it doesn't mean that you can't get it done a little bit differently.
(if you can't go strait over the hill, you must go around)
Create a QoS system. Test it. paste it here, describe the actual disadvantages or problem of the setup. We will try to share ideas how to get things done. This is the way how this forum works.
/ip firewall mangle>
chain=prerouting action=mark-connection new-connection-mark=128_upload_conn passthrough=yes src-address-list=128
chain=prerouting action=mark-packet new-packet-mark=128_upload passthrough=yes connection-mark=128_upload_conn
chain=forward action=mark-connection new-connection-mark=128_download_conn passthrough=yes src-address-list=128
chain=forward action=mark-packet new-packet-mark=128_download passthrough=yes connection-mark=128_download_conn
/queue type>
name="128 Download" kind=pcq pcq-rate=128000 pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=5000
name="128 Upload" kind=pcq pcq-rate=128000 pcq-limit=50 pcq-classifier=src-address pcq-total-limit=5000
/queue simple>
name="128" dst-address=0.0.0.0/0 interface=all parent=ALL packet-marks=128_upload,128_download direction=both
priority=1 queue=128 Upload/128 Download limit-at=0/0 max-limit=1000000/2000000 burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
/queue simple>
name="ALL" target-addresses=10.0.0.0/8,x.x.x.0/23 dst-address=0.0.0.0/0 interface=all parent=none
direction=both priority=1 queue=default/default limit-at=10000000/20000000 max-limit=10000000/20000000 burst-limit=0/0
burst-threshold=0/0 burst-time=0s/0s total-queue=default-small
1) First of all forget about simple queues -> you need to move to queue treeNow the question is this : How can i prioritize the bandwidth of each user to have priorities like last pages of http://mum.mikrotik.com/presentations/US08/janism.pdf and each user should not have 1 bit more than its shape. for example a 128kbps user has 1st priority for ping,telnet,ssh 2nd for http surfing,3rd http download,8th p2p and has its 128kbps NOT MORE
1)a)Why?
1)b)There is an old question with multiple replies.May i use simple queues and queue tree at the same time?
2)Please give example
WHERE is the ANSWER ? macgaiver please can you just read this : How can i prioritize the bandwidth of each user ?????Now the question is this : How can i prioritize the bandwidth of each user
incorrect or impossible in router os ?We already described you that your idea how limitation works was incorrect
OMG can you READ?How can i prioritize the bandwidth of each user ?????
Well it doesn't matter - one way or another in my network everything is fine with QoS and customers are happyand you think you are talking ? you are just repeating what's in the manual and wiki .......
Incorrect, Cisco is exactly the same.incorrect or impossible in router os ?
For matter of fact everything that is necessary was described in the presentation. omidkosari had only one big difference instead of one client interface he had many (pppoe) so I adopted the setup for that change and gave him instructions. IF you can't get it - FORGET IT.prioritize the bandwidth of each user is the point , its so clear that every one can understand it !!!!
What can i do if i want the mangles be interface independent . i mean don't use interface in my rules. i don't have good experience about that . sometimes we have more than one WAN etc.c) mark-packet from those connection where in-interface=WAN as client download passthrough=no
d) mark-packet rest of the packets from those connections as upload passthrough=no
What exactly you mean ? you mean macgaiver suggest is wrong ?to prioritize packets in PCQ subqueues, one need to use packet-submarks... don't think, that it will be realized even in v4 =(
I think Chupaka means that what Samsoft is asking, is impossible.What exactly you mean ? you mean macgaiver suggest is wrong ?to prioritize packets in PCQ subqueues, one need to use packet-submarks... don't think, that it will be realized even in v4 =(
at last .. this answer must have the prize for the best answers ..to prioritize packets in PCQ subqueues, one need to use packet-submarks... don't think, that it will be realized even in v4 =(
In my presentation I told that creating priorities seperatly for each client is suicide - there are no hardware that can handle small queue tree for every user (if you have 1000 of them). So in my presentation I discuse next best thing, that is close as possible to desired behaviour.
The main Idea of the setup is to have two separate QoS steps.
1) in the first step we prioritize traffic, we are making sure that traffic with higher priority have more chance to get to the custumers than traffic with the lower priority.
Example:
we have total of 100Mbps available, but clients at this particular moment would like to receive 10Mbps of Priority=1 traffic 20Mbps of Priority=4 and 150Mbps of Priority=8.
Of course after our prioritization and limitaion 80Mbps of priority=8 will be droped. And only 100Mbps will get to the next step
2) next step is per-user limitation, we already have only higher priority traffic, but now we must make sure that some user will not overuse it, so we have PCQ with limits
This way we get virtually the same behaviour as "per user prioritization"
is it possible to do within one router? i.e. shape twice: first per user, then per service (e.g. in different mangle chains). or we need two routers (either hardware or virtualized)?- give priority to different traffic types first
- then, after prioritization and shaping has taken place, divide the traffic per user
- give priority to different traffic types first
- then, after prioritization and shaping has taken place, divide the traffic per user
other way, first per service, then per user.shape twice: first per user, then per service
QoS includes several facilities, in the following order:is it possible to do within one router? i.e. shape twice: first per user, then per service (e.g. in different mangle chains). or we need two routers (either hardware or virtualized)?
1 chain=prerouting protocol=tcp connection-state=new action=jump
jump-target=tcp-services
2 chain=prerouting protocol=udp connection-state=new action=jump
jump-target=udp-services
3 chain=prerouting connection-state=new action=jump
jump-target=other-services
4 chain=prerouting protocol=tcp action=jump
jump-target=tcp-services-established
5 chain=tcp-services protocol=tcp src-port=1024-65535 dst-port=80
action=mark-connection new-connection-mark=http passthrough=no
6 chain=tcp-services-established protocol=tcp src-port=1024-65535
dst-port=80 connection-bytes=0-2048000 action=mark-connection
new-connection-mark=http-established-2MB passthrough=no
7 chain=tcp-services-established protocol=tcp src-port=1024-65535
dst-port=80 action=mark-connection new-connection-mark=http-established
passthrough=no
47 chain=prerouting connection-mark=http action=mark-packet
new-packet-mark=http-new passthrough=no
48 chain=prerouting connection-mark=http-established-2MB action=mark-packet
new-packet-mark=http-2MB passthrough=no
49 chain=prerouting connection-mark=http-established action=mark-packet
new-packet-mark=http-established passthrough=no
1 name="DOWNLOAD" parent=Lokal packet-mark="" limit-at=0 queue=default priority=8 max-limit=1850000 burst-limit=0
burst-threshold=0 burst-time=0s
2 name="http" parent=DOWNLOAD packet-mark=http-new limit-at=1500000 queue=default priority=1 max-limit=1800000
burst-limit=0 burst-threshold=0 burst-time=0s
3 name="http-2M" parent=DOWNLOAD packet-mark=http-2MB limit-at=10000 queue=default priority=4 max-limit=1800000
burst-limit=0 burst-threshold=0 burst-time=0s
4 name="http-rest" parent=DOWNLOAD packet-mark=http-established limit-at=10000 queue=default priority=8
max-limit=1800000 burst-limit=0 burst-threshold=0 burst-time=0s
move your present per user marking to mange chain "forward" (with my corrections)
Then how can i mangle uploads with forward chain and src-address-list ?Then use src-address or src-address-list. but if you have only one public interface it should be fine and faster.
try this approachIs there a way to use mangle chain FORWARD for marking upload and download of users separately without using (in or out) INTERFACE ?
I tired a lot but i have no success . An example is very helpful . Thanks.
/ip firewall mangle>
chain=forward action=mark-connection new-connection-mark=Special_upload_conn passthrough=yes src-address-list=Special
chain=forward action=mark-packet new-packet-mark=Special_upload passthrough=yes connection-mark=Special_upload_conn
chain=forward action=mark-connection new-connection-mark=Special_download_conn passthrough=yes dst-address-list=Special
chain=forward action=mark-packet new-packet-mark=Special_download passthrough=yes connection-mark=Special_download_conn
name="test" dst-address=0.0.0.0/0 interface=all parent=ALL packet-marks=Special_upload,Special_download direction=both
priority=1 queue=default/default limit-at=1000000/1000000 max-limit=2000000/10000000 burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
/ip firewall mangle>
chain=prerouting action=mark-connection new-connection-mark=Special_upload_conn passthrough=yes src-address-list=Special
chain=prerouting action=mark-packet new-packet-mark=Special_upload passthrough=yes connection-mark=Special_upload_conn
chain=forward action=mark-connection new-connection-mark=Special_download_conn passthrough=yes src-address-list=Special
chain=forward action=mark-packet new-packet-mark=Special_download passthrough=yes connection-mark=Special_download_conn
Now 1,2 is DONE .1) First of all forget about simple queues -> you need to move to queue tree
2) move your present per user marking to mange chain "forward" (with my corrections) and per user limitation to "global-out"
3)now you have free mangle chain "prerouting" and "global-in" for priority configuration (from presentation)
155 chain=prerouting action=mark-connection new-connection-mark=p2p_conn passthrough=yes p2p=all-p2p
156 chain=prerouting action=mark-packet new-packet-mark=p2p_download passthrough=no dst-address-list=Apply QOS connection-mark=p2p_conn
157 chain=prerouting action=mark-packet new-packet-mark=p2p_upload passthrough=no src-address-list=Apply QOS connection-mark=p2p_conn
158 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=110
159 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=995
160 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=143
161 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=993
162 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=25
163 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=20
164 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=21
165 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=22 packet-size=1400-1500
166 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=80 connection-bytes=500000-0
167 chain=prerouting action=mark-connection new-connection-mark=download_conn passthrough=yes protocol=tcp dst-port=443 connection-bytes=500000-0
168 chain=prerouting action=mark-packet new-packet-mark=download_download passthrough=no dst-address-list=Apply QOS connection-mark=download_conn
169 chain=prerouting action=mark-packet new-packet-mark=download_upload passthrough=no src-address-list=Apply QOS connection-mark=download_conn
170 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=53
171 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=udp dst-port=53
172 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=icmp
173 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=443
174 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=8291
175 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=23
176 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=22 packet-size=0-1400
177 chain=prerouting action=mark-connection new-connection-mark=high_prio_conn passthrough=yes protocol=tcp dst-port=80 connection-bytes=0-500000
178 chain=prerouting action=mark-packet new-packet-mark=high_prio_download passthrough=no dst-address-list=Apply QOS connection-mark=high_prio_co>
179 chain=prerouting action=mark-packet new-packet-mark=high_prio_upload passthrough=no src-address-list=Apply QOS connection-mark=high_prio_conn
180 chain=prerouting action=mark-connection new-connection-mark=other_conn passthrough=yes
181 chain=prerouting action=mark-packet new-packet-mark=other_download passthrough=no dst-address-list=Apply QOS connection-mark=other_conn
182 chain=prerouting action=mark-packet new-packet-mark=other_upload passthrough=no src-address-list=Apply QOS connection-mark=other_conn
66 name="QOS_Download" parent=global-in packet-mark="" limit-at=0 queue=default priority=1 max-limit=12000000 burst-limit=0 burst-threshold=0
burst-time=0s
67 name="QOS_Upload" parent=global-in packet-mark="" limit-at=0 queue=default priority=1 max-limit=12000000 burst-limit=0 burst-threshold=0
burst-time=0s
68 name="p2p down" parent=QOS_Download packet-mark=p2p_download limit-at=0 queue=default priority=8 max-limit=2000000 burst-limit=0
burst-threshold=0 burst-time=0s
69 name="p2p up" parent=QOS_Upload packet-mark=p2p_upload limit-at=0 queue=default priority=8 max-limit=1000000 burst-limit=0 burst-threshold=0
burst-time=0s
70 name="High Priority down" parent=QOS_Download packet-mark=high_prio_download limit-at=5000000 queue=default priority=1 max-limit=9000000
burst-limit=0 burst-threshold=0 burst-time=0s
71 name="High Priority up" parent=QOS_Upload packet-mark=high_prio_upload limit-at=2000000 queue=default priority=1 max-limit=6000000
burst-limit=0 burst-threshold=0 burst-time=0s
72 name="Other down" parent=QOS_Download packet-mark=other_download limit-at=0 queue=default priority=6 max-limit=6000000 burst-limit=0
burst-threshold=0 burst-time=0s
73 name="Other up" parent=QOS_Upload packet-mark=other_upload limit-at=0 queue=default priority=6 max-limit=6000000 burst-limit=0
burst-threshold=0 burst-time=0s
74 name="Big Downloads down" parent=QOS_Download packet-mark=download_download limit-at=0 queue=default priority=7 max-limit=6000000 burst-limit=>
burst-threshold=0 burst-time=0s
75 name="Big Downloads up" parent=QOS_Upload packet-mark=download_upload limit-at=0 queue=default priority=7 max-limit=6000000 burst-limit=0
burst-threshold=0 burst-time=0s
How can i prioritize those 10Mbps links to prevent hardware flow ?I'm not sure I understand your question completely, perhaps you could explain it with an example.
In general - if your parent class is not limited, it will behave as if it was limited to full link bandwidth (because of hardware flow control - underlying network hardware will simply not take from queue more data than it can send). So e.g. if you have 1Gbps Ethernet link to your provider, but provider limits traffic received from that link to 200Mbs, it is better to configure parent queue with 200Mbps limit - this way bandwidth control moves to your queues where you can apply your policies (prioritizing, limits, distribution of excess bandwidth and such), instead of just sending everything to upstream provider where you can not control what will get dropped.
But connection bytes are very useful in QOS stuff.if you limit overall user traffic you do not have to worry about how many connections users use.
0 ;;; p2p
chain=prerouting action=mark-connection new-connection-mark=p2p passthrough=yes p2p=all-p2p
1 chain=prerouting action=mark-packet new-packet-mark=p2p_down passthrough=no in-interface=WAN connection-mark=p2p
2 chain=prerouting action=mark-packet new-packet-mark=p2p_up passthrough=no in-interface=LAN connection-mark=p2p
3 ;;; WWW SSL
chain=prerouting action=mark-connection new-connection-mark=www_ssl passthrough=yes protocol=tcp dst-port=80
4 chain=prerouting action=mark-connection new-connection-mark=www_ssl passthrough=yes protocol=udp dst-port=80
5 chain=prerouting action=mark-connection new-connection-mark=www_ssl passthrough=yes protocol=tcp dst-port=443
6 chain=prerouting action=mark-packet new-packet-mark=www_ssl_down passthrough=no in-interface=WAN
connection-mark=www_ssl
7 chain=prerouting action=mark-packet new-packet-mark=www_ssl_up passthrough=no in-interface=LAN connection-mark=www_ss>
8 ;;; DNS ICMP
chain=prerouting action=mark-connection new-connection-mark=dns_icmp passthrough=yes protocol=icmp
9 chain=prerouting action=mark-connection new-connection-mark=dns_icmp passthrough=yes protocol=tcp dst-port=53
10 chain=prerouting action=mark-connection new-connection-mark=dns_icmp passthrough=yes protocol=udp dst-port=53
11 chain=prerouting action=mark-packet new-packet-mark=dns_icmp_down passthrough=no in-interface=WAN
connection-mark=dns_icmp
12 chain=prerouting action=mark-packet new-packet-mark=dns_icmp_up passthrough=no in-interface=LAN
connection-mark=dns_icmp
13 ;;; winbox
chain=prerouting action=mark-connection new-connection-mark=winbox passthrough=yes protocol=tcp dst-port=8291
14 chain=prerouting action=mark-packet new-packet-mark=winbox_down passthrough=no in-interface=WAN connection-mark=winbo>
15 chain=prerouting action=mark-packet new-packet-mark=winbox_up passthrough=no in-interface=LAN connection-mark=winbox
16 ;;; other
chain=prerouting action=mark-connection new-connection-mark=other passthrough=yes
17 chain=prerouting action=mark-packet new-packet-mark=other_down passthrough=no in-interface=WAN connection-mark=other
18 chain=prerouting action=mark-packet new-packet-mark=other_up passthrough=no in-interface=LAN connection-mark=other
19 ;;; 256/128
chain=forward action=mark-connection new-connection-mark=256/128_conn passthrough=yes src-address-list=256/128
20 chain=forward action=mark-connection new-connection-mark=256/128_conn passthrough=yes dst-address-list=256/128
21 chain=forward action=mark-packet new-packet-mark=256/128_upload passthrough=no src-address-list=256/128
connection-mark=256/128_conn
22 chain=forward action=mark-packet new-packet-mark=256/128_download passthrough=no dst-address-list=256/128
23 X chain=forward action=log in-interface=WAN connection-mark=www_ssl log-prefix=""
0 name="DOWN_KOL" parent=global-in packet-mark="" limit-at=0 queue=sfq priority=4 max-limit=950000 burst-limit=0
burst-threshold=0 burst-time=0s
1 name="UP_KOL" parent=global-in packet-mark="" limit-at=0 queue=sfq priority=4 max-limit=256000 burst-limit=0
burst-threshold=0 burst-time=0s
2 name="DOWN_klient" parent=global-out packet-mark="" limit-at=0 queue=sfq priority=4 max-limit=1000000 burst-limit=0
burst-threshold=0 burst-time=0s
3 name="UP_klient" parent=global-out packet-mark="" limit-at=0 queue=sfq priority=4 max-limit=256000 burst-limit=0
burst-threshold=0 burst-time=0s
4 name="256/128" parent=DOWN_klient packet-mark=256/128_download limit-at=0 queue=256_download priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
5 name="256/125" parent=UP_klient packet-mark=256/128_upload limit-at=0 queue=128_upload priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
6 name="www_ssl_down" parent=DOWN_KOL packet-mark=www_ssl_down limit-at=0 queue=download_high priority=2 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
7 name="www_ssl_up" parent=UP_KOL packet-mark=www_ssl_up limit-at=0 queue=upload_high priority=2 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
8 name="dns_icmp_down" parent=DOWN_KOL packet-mark=dns_icmp_down limit-at=0 queue=download_high priority=1 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
9 name="dns_icmp_up" parent=UP_KOL packet-mark=dns_icmp_up limit-at=0 queue=upload_high priority=1 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
10 name="p2p_up" parent=UP_KOL packet-mark=p2p_up limit-at=10000 queue=upload_reszta priority=8 max-limit=20000
burst-limit=0 burst-threshold=0 burst-time=0s
11 name="p2p_down" parent=DOWN_KOL packet-mark=p2p_down limit-at=0 queue=download_reszta priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
12 name="winbox_down" parent=DOWN_KOL packet-mark=winbox_down limit-at=0 queue=download_high priority=3 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
13 name="winbox_up" parent=UP_KOL packet-mark=winbox_up limit-at=0 queue=upload_high priority=3 max-limit=0 burst-limit=>
burst-threshold=0 burst-time=0s
14 name="other_up" parent=UP_KOL packet-mark=other_up limit-at=0 queue=upload_reszta priority=4 max-limit=0 burst-limit=>
burst-threshold=0 burst-time=0s
15 name="other_down" parent=DOWN_KOL packet-mark=other_down limit-at=0 queue=download_reszta priority=8 max-limit=0
burst-limit=0 burst-threshold=0 burst-time=0s
[img][i]btw, 'Mark all downloaded packets from 3 WANs' is actually 'Mark all not marked downloaded packets from 3 WANs' - in previous rules you have passthrough=no
[/i][/img]
and now you just re-mark packets in the rules below...I put those rules upper than 'services' packets mark, passthrough=yes and seems that works well.
May I use PCQ with rate=x for QoS, traffic prioritization queue tree?
Sorry i did not understand . please explain more .Yes, if your provider agrees to DIFFERENTIATE you traffic somehow.
they ARE. but when your clients go to some web server, they send packets with src-address-list=Clients dst-port=80 and src-port=1025-65535 in general. so your 'forward' rule catches those packetsNo, it's just an example. But why is this happening? I thought that the two chains are completely independent of each other...
Appears that they are not, or I do not understand something...
/ip firewall mangle
add chain=prerouting src-address=my_ip dst-address=1.2.3.4 action=mark-connection new-connection-mark=test1
add chain=forward connection-mark=test1 action=mark-packet new-packet-mark=test1
add chain=forward src-address=my_ip dst-address=1.2.3.4 action=mark-connection new-connection-mark=test2
add chain=forward connection-mark=test2 action=mark-packet new-packet-mark=test2