I don't have any visible error in my QoS configs. I checked it many times, rechecked it with others qos implementations, with mikrotik wiki, and etc etc.If you can't do it now in HTB (currently implemented), you most probably will not be able to do it in LLQ also.
Well, then you and others are doing something wrong. I have no such problems. it just take a little bit of magic in mangle with packet-marks - queues are simple afterwards.I don't have any visible error in my QoS configs. I checked it many times, rechecked it with others qos implementations, with mikrotik wiki, and etc etc.If you can't do it now in HTB (currently implemented), you most probably will not be able to do it in LLQ also.
Even Traffic Inspector on windows provides more useful (if not ideal) qos, but with bad throughput (no more than 1000 pps).
Most better way to check if qos working ideally - ping running at lower latencies with torrents running at max speed.
If ping goes nicely, then voice, games, dns requests will do the same for sure.
In our network there is many gamers, while their os or antivirus downloading updates - their online games becoming a slideshow.
It seems that it's not only my problem.
Do you even read my post?Well, then you and others are doing something wrong. I have no such problems. it just take a little bit of magic in mangle with packet-marks - queues are simple afterwards.
I don't have any visible error in my QoS configs. I checked it many times, rechecked it with others qos implementations, with mikrotik wiki, and etc etc.
# jan/06/1970 05:42:18 by RouterOS 5.20 # /queue tree add max-limit=9400k name=bandwidth-control parent=global-out add limit-at=8M max-limit=9400k name=users-down parent=bandwidth-control add limit-at=1400k max-limit=9400k name=users-up parent=bandwidth-control add max-limit=9400k name=qos-total packet-mark="" parent=global-in add limit-at=8M max-limit=9400k name=qos-down parent=qos-total add limit-at=1400k max-limit=9400k name=qos-up parent=qos-total add limit-at=2M max-limit=9400k name=qos-http-down packet-mark=qos-http-down parent=qos-down priority=2 add max-limit=9400k name=qos-other-down packet-mark=qos-other-down parent=qos-down add limit-at=256k max-limit=9400k name=qos-http-up packet-mark=qos-http-up parent=qos-up priority=2 add max-limit=9400k name=qos-other-up packet-mark=qos-other-up parent=qos-up add limit-at=1M max-limit=9400k name=qos-cs16-down packet-mark=qos-cs16-down parent=qos-down priority=1 add limit-at=1M max-limit=9400k name=qos-cs16-up packet-mark=qos-cs16-up parent=qos-up priority=1 /queue type set 0 pfifo-limit=45 add kind=pcq name=pcq-unlim256-down pcq-burst-time=5s pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=512k pcq-src-address6-mask=64 add kind=pcq name=pcq-unlim256-up pcq-burst-time=5s pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-limit=30 pcq-rate=192k pcq-src-address6-mask=64 add kind=pcq name=pcq-unlim512-down pcq-burst-time=5s pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=1024k pcq-src-address6-mask=64 add kind=pcq name=pcq-unlim512-up pcq-burst-time=5s pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=256k pcq-src-address6-mask=64 add kind=pcq name=pcq-workers-down pcq-burst-time=4s pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-limit=30 pcq-rate=4M pcq-src-address6-mask=64 pcq-total-limit=1000 add kind=pcq name=pcq-workers-up pcq-burst-time=4s pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-limit=30 pcq-rate=6M pcq-src-address6-mask=64 pcq-total-limit=1000 add kind=pcq name=pcq-unlim1024-up pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=512k pcq-src-address6-mask=64 add kind=pcq name=pcq-unlim1024-down pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=2048k pcq-src-address6-mask=64 /queue tree add max-limit=9400k name=unlim256-down packet-mark=unlim256_traffic_down parent=users-down queue=pcq-unlim256-down add max-limit=9400k name=unlim512-down packet-mark=unlim512_traffic_down parent=users-down queue=pcq-unlim512-down add max-limit=9400k name=workers-down packet-mark=workers_traffic_down parent=users-down queue=pcq-workers-down add max-limit=9400k name=unlim256-up packet-mark=unlim256_traffic_up parent=users-up queue=pcq-unlim256-up add max-limit=9400k name=unlim512-up packet-mark=unlim512_traffic_up parent=users-up queue=pcq-unlim512-up add max-limit=9400k name=workers-up packet-mark=workers_traffic_up parent=users-up queue=pcq-workers-up add max-limit=9400k name=unlim1024-down packet-mark=unlim1024-traffic-down parent=users-down queue=pcq-unlim1024-down add max-limit=9400k name=unlim1024-up packet-mark=unlim1024-traffic-up parent=users-up queue=pcq-unlim1024-up /ip firewall address-list add address=00.00.49.233 comment="{-5BAD-4C96-BC65-}" list=unlim1024_clients add address=00.00.49.132 comment="{-7387-4EDC-928B-}" list=unlim256_clients add address=00.00.49.148 comment="{-C3CC-4FEA-BDE2-}" list=unlim256_clients add address=00.00.49.147 comment="{-52AD-4139-9758-}" list=unlim256_clients add address=00.00.49.199 comment="{-A7C0-4C09-A870-}" list=unlim512_clients add address=00.00.49.20 comment="{-BD9D-4BE5-8E14-}" list=unlim256_clients add address=00.00.49.186 comment="{-CCDD-4C5E-83D1-}" list=unlim256_clients add address=00.00.49.37 comment="{-455C-490F-9992-}" list=unlim256_clients add address=00.00.49.26 comment="{-7B2B-4678-B26F-}" list=workers_clients add address=00.00.49.134 comment="{-7B82-4E33-A612-}" list=unlim256_clients add address=00.00.49.188 comment="{-46B3-4A1A-933F-}" list=unlim256_clients /ip firewall filter add chain=input protocol=icmp add chain=input connection-state=established in-interface=WAN add chain=input connection-state=related in-interface=WAN add chain=forward comment="Authorize users" out-interface=WAN src-address-list=unlim256_clients add chain=forward out-interface=WAN src-address-list=unlim512_clients add chain=forward out-interface=WAN src-address-list=unlim1024_clients add chain=forward out-interface=WAN src-address-list=workers_clients add action=drop chain=forward out-interface=WAN add chain=forward dst-address-list=unlim256_clients in-interface=WAN add chain=forward dst-address-list=unlim512_clients in-interface=WAN add chain=forward dst-address-list=unlim1024_clients in-interface=WAN add chain=forward dst-address-list=workers_clients in-interface=WAN add action=drop chain=forward in-interface=WAN add action=drop chain=input comment="Block all another traffic from internet" in-interface=WAN /ip firewall mangle add action=mark-packet chain=forward comment=unlim256 dst-address-list=unlim256_clients in-interface=WAN new-packet-mark=unlim256_traffic_down out-interface=LAN passthrough=no src-address-list=!local_subnet add action=mark-packet chain=forward dst-address-list=!local_subnet in-interface=LAN new-packet-mark=unlim256_traffic_up out-interface=WAN passthrough=no src-address-list=unlim256_clients add action=mark-packet chain=forward comment=unlim512 dst-address-list=unlim512_clients in-interface=WAN new-packet-mark=unlim512_traffic_down out-interface=LAN passthrough=no src-address-list=!local_subnet add action=mark-packet chain=forward dst-address-list=!local_subnet in-interface=LAN new-packet-mark=unlim512_traffic_up out-interface=WAN passthrough=no src-address-list=unlim512_clients add action=mark-packet chain=forward comment=unlim1024 dst-address-list=unlim1024_clients in-interface=WAN new-packet-mark=unlim1024-traffic-down out-interface=LAN passthrough=no src-address-list=!local_subnet add action=mark-packet chain=forward dst-address-list=!local_subnet in-interface=LAN new-packet-mark=unlim1024-traffic-up out-interface=WAN passthrough=no src-address-list=unlim1024_clients add action=mark-packet chain=forward comment=workers dst-address-list=workers_clients in-interface=WAN new-packet-mark=workers_traffic_down out-interface=LAN passthrough=no src-address-list=!local_subnet add action=mark-packet chain=forward dst-address-list=!local_subnet in-interface=LAN new-packet-mark=workers_traffic_up out-interface=WAN passthrough=no src-address-list=workers_clients add action=mark-packet chain=prerouting comment=QoS-HTTP dst-address-list=local_subnet in-interface=WAN new-packet-mark=qos-http-down passthrough=no protocol=tcp src-address-list=!local_subnet src-port=80 add action=mark-packet chain=prerouting dst-address-list=!local_subnet dst-port=80 in-interface=LAN new-packet-mark=qos-http-up passthrough=no protocol=tcp src-address-list=local_subnet add action=mark-packet chain=prerouting comment=QoS-CS1.6 dst-address-list=local_subnet in-interface=WAN new-packet-mark=qos-cs16-down passthrough=no protocol=tcp src-address-list=!local_subnet src-port=27000-27150 add action=mark-packet chain=prerouting dst-address-list=!local_subnet dst-port=27000-27150 in-interface=LAN new-packet-mark=qos-cs16-up passthrough=no protocol=tcp src-address-list=local_subnet add action=mark-packet chain=prerouting comment=QoS-Other dst-address-list=local_subnet in-interface=WAN new-packet-mark=qos-other-down passthrough=no src-address-list=!local_subnet add action=mark-packet chain=prerouting dst-address-list=!local_subnet in-interface=LAN new-packet-mark=qos-other-up passthrough=no src-address-list=local_subnetWhat can I say... I've posted similiar configs on the forum, and no one found any problems.
I think, no. Not at all.Is the silence a proof that my config correct?
Yes, all these clients belong to the local_subnet.From the snippet you've posted it is not cleat what local_subnet address list is. I assume that all entries of the unlim256_clients, unlim512_clients, unlim1024_clients and workers_clients address lists belong to the local_subnet as well. Please correct me if I'm wrong.
Why do you think that the previous packet mark gets lost? I don't get your point, please explain.Then as far as I understand any packet can be marked with only a single packet mark at a time, so any time you mark the packet with a new packet mark the previous packet mark gets lost.
By what? Why?Mangle Forward and thus all your 'qos-*' packet marks get overwritten in Mangle Forward.
I don't understand your point there either. passthrough=no used to ignore all next mangle rules for this marked packets in a current chain.And specifying 'passthrough=no' in one chain does not make any difference for the rules from another chain.
That's how it works. I did not find it documented anywhere, so I found it out by experiment. As soon as you mark a packet with a new packet mark, previous packet mark (if any) gets discarded.Why do you think that the previous packet mark gets lost? I don't get your point, please explain.Then as far as I understand any packet can be marked with only a single packet mark at a time, so any time you mark the packet with a new packet mark the previous packet mark gets lost.
Lets take, for example, the 0.0.49.20 IP address from your config. It falls into the unlim256_clients address list as well as into the local_subnet address list. When packet from 0.0.49.20 to (say) 1.2.3.4 port 80/tcp passes you router it first gets into the prerouting mangle chain, hits the ruleBy what? Why?Mangle Forward and thus all your 'qos-*' packet marks get overwritten in Mangle Forward.
add action=mark-packet chain=prerouting comment=QoS-HTTP dst-address-list=local_subnet in-interface=WAN new-packet-mark=qos-http-down passthrough=no protocol=tcp src-address-list=!local_subnet src-port=80
add action=mark-packet chain=forward comment=unlim256 dst-address-list=unlim256_clients in-interface=WAN new-packet-mark=unlim256_traffic_down out-interface=LAN passthrough=no src-address-list=!local_subnet
First packets gets caught by mangle prerouting, 'passthrough=no' sends packet directly to HTB, where it get prioritizes in global-in queue. Next 'shaped unmarked packets' gets caught by mangle forward (or postrouting), after that it goes into HTB where they get shaped according to user bandwidth limit in the global-out queue.Lets take, for example, the 0.0.49.20 IP address from your config. It falls into the unlim256_clients address list as well as into the local_subnet address list. When packet from 0.0.49.20 to (say) 1.2.3.4 port 80/tcp passes you router it first gets into the prerouting mangle chain, hits the ruleat which point the qos-http-down packet mark is assigned to the packet. But while being further processed by the router the packet then gets into the forward mangle chain, where it hits the following ruleCode: Select alladd action=mark-packet chain=prerouting comment=QoS-HTTP dst-address-list=local_subnet in-interface=WAN new-packet-mark=qos-http-down passthrough=no protocol=tcp src-address-list=!local_subnet src-port=80
and at this point the unlim256_traffic_down is assigned to the packet while the previous packet mark (qos-http-down) is discarded.Code: Select alladd action=mark-packet chain=forward comment=unlim256 dst-address-list=unlim256_clients in-interface=WAN new-packet-mark=unlim256_traffic_down out-interface=LAN passthrough=no src-address-list=!local_subnet
Well, you are right here, the packet gets into the global-in HTB before it reaches Forward.First packets gets caught by mangle prerouting, 'passthrough=no' sends packet directly to HTB
Wrong. In the definition of a queue 'priority' has nothing to do with prioritization of packets- it prioritizes child queues in case there's not enough bandwidth to satisfy limit-at for all of them.where it get prioritizes in global-in queue.
Wrong. Actually all packets gets caught by your mangle forward rules, regardless of whether they are marked or not. You have to specify 'packet-mark=no-mark' in a rule to match unmarked packets only.Next 'shaped unmarked packets' gets caught by mangle forward (or postrouting)
That's right. So, what do you expect to achieve?after that it goes into HTB where they get shaped according to user bandwidth limit in the global-out queue. After shaping these packets will not being qos'ed, because qos queues is in global-in, as packet flow diagram says it isn't after global-out for sure.
I'm not using any kind of nat.1) do you use src-nat (private IP addresses for clients)? - if yes, prerouting is not aware of them.
In case of client communication with another client - mangle rules doesn't capture packets on these connections.2) Do you have all the clients in the same IP network subnet? - if no, what happens when one client from one local subnet is communicated with other client in other local subnet?
Sure. Even in that case, for example - http pages loads very slowly.3) Are you aware that "priority" does not rearrange packet sequence - it just decide what packets to drop. So packets come out from global-in in the same order as they came in. (only some of them might be dropped by global-in)
I does make connection marking before. With absolutely no changes on the problem.Regarding the setup itself:
1) use a lot more of "mark-connection", and use "mark packet" only with connection-mark matcher - this will increase performance a lot as main checks will be done only once per connection, not per every packet.
2) you have relatively small amount of possible marks 3x4=12. make all marking in the same place and have 12 different marks (without remarking every packet 2x. Then in queues you can apply multiple marks to the same queue.
If not CS1.6, which is a good indicator of low latency (voip have very same latencies).next time also describe what doesn't work in queues - you can't see traffic or your latency to CS1,6 servers are high. etc.
Well, that's expected behavior with your current setup.Let's see. For example my client have 512kbit line. He run torrent at no limit. Pings goes up to 500-800ms (from 33ms in normal). Then he wants to open some page (after browser cache clear), and page loads fully only in 8 seconds. He stop torrents and web page (after browser cache clear) loads in 1-2 seconds.
I watched presentations, forums and from them I understand that mikrotik is a powerful thing for QoS and bandwidth limitation. VOIP, games - they can be prioritized to make users feel more comfortable.That's right. So, what do you expect to achieve?
Could you point where is a problem in my config or at least give some hints?Well, that's expected behavior with your current setup.
Yeah, it's not helping on <100% load link, which I expected per-pcq-subqueue QoS, as andriys correctly noted.Suggestions:
+1 for LLQAnd now I'm feeling that I've been fooled.
So I vote for LLQ.
not an elegant solution ? Paint the router in some colour then it will be elegant for you
I have one RB1100, so I using Dual QoS in one router.I understand. Have you considered Dual QoS (in one MT router) or two hop solution (use gigabit and powerful machines plz) one for client max limit and one for overall QoS selective drop?
You've missed the whole point. Nobody wants LLQ as such. What people really want is a way to solve their real-life needs, and many see LLQ (i.e. packet reordering) as a possible solution.If we think about it in a simple way, the strict prio/LLQ will make a sub-millisecond difference some of the time. Do we really need something like this?
If you read this http://wiki.mikrotik.com/wiki/NetworkPr ... of_Service do you have any further questions?
Ditto.If some of this is not what you believe - please e-mail me and explain. I can reply in a simple and logical way that relieves any concerns. I can also correct the article to reflect the actual truth by choosing better words. Thank you.
Welcome.Thanks for the reply.
Wrong. Please read what I wrote in the previous message once again. We are talking about the situation when a client's PCQ sub-stream is out of bandwidth (i.e. the corresponding sub-queue is full and client's link is effectively congested). The packets are not processed immediately in this case, but rather wait in a queue for some time so that the overall speed was lower then the configured limit, or get dropped if they are not in the queue yet, and there are no space left in the queue.The VoIP/gaming/ packets arrive in between other packets as they were put on the wire by customers PC.
Before we can reorder packets in the router, we process the ones we get from the interface.
This leaves no time for putting a packet in a queue for it to wait for the next packet.
The packets leave the router before it is possible to rearrange them.
Exactly. That is what traffic shaping is all about after all. And while we add some extra latency to the packets en masse, there are the necessity sometimes to process some higher-priority packets with lower latency then all others.If we decide we want to delay packets and rearrange them - we will surely be damaging everything with the extra latency for all packets
Let me say it once again. Packet reordering (or LLQ, or whatever whoever names it) is not an end in itself. What is required is the ability to prioritize packets within a single PCQ sub-stream. The implementation details do not really matter. Packet rearrangement is just one possible way. Adding the possibility for a PCQ sub-queue to be a parent of another (sub)queues is another possible way. I'm sure there are others.We have to reach an agreement on the Theory here and now, so that no other person gets infected with packet reorder virus in their head and feel bad about it.
Well, PCQ should not be radically different from an ordinary child queue. The only major difference is that PCQ creates sub-queues base on the configured aggregation criteria (usually source or destination address). Ordinary child queues do queue packets, do delay them to satisfy max-limit of itself and limit-at of the others, and do drop packets when there are no more space left in the queue.I understand your two posts now. I am able to put the PCQ queueing in slightly different perspective now - it's like "bufferbloat".
In this case we have to drop rather than queue stuff in PCQ, right ?
No, it is not. It can solve the problem of congested uplink. In can not solve problem of congested client's PCQ substream.Let's put the priority packets in another queue which has nice limit-at setting. Is this not going to solve the problem?
No, it does not work that way. And it is actually not possibly to do it that way, because only a particular PCQ sub-stream "knows" if and when a low-priority packets need to be dropped. In other words, we need to drop low-priority packets that are already queued in favor of a higher priority packets only in case PCQ sub-stream is congested, and the congestion can not be detected until we actually try to put the packet in a particular sub-stream.We drop low priority packets before they get to the PCQ to cause queueing and dropping of the high priority ones. This is the two setp QoS that Janis Megis gave us.
It helps to understand why/how we "stamp" traffic and where that "stamp" (mark) is read.Control is Outbound
Router Inbound traffic - traffic that is received by the router from any side. Any frames serialised by someone else on the wire and travelling towards the router.
Router Outbound traffic - traffic that goes out of a router's interface, towards the world or towards our clients. This is where we set up limits and manage the bandwidth.
RuterOS HTB allows us to work with the Outgoing traffic - the traffic that is leaving the router via any interface.
There are 4 ways we can look at traffic:
1) client's upload that the router receives on the local interface
2) client's upload that the router sends to the Internet
3) client's download that the router receives on the public interface
4) client's download that the router sends to the customer
1) and 3) - is Inbound traffic
2) and 4) - is Outbound traffic
We control 1) when its sent out as 2), and 3) when its sent out as 4)
and i cut out the sections that limit by IP since I have no need for that since my users don't have per-device or per-user priority, just traffic type.So the plan is to mark by traffic type in prerouting and limit by traffic type in global-in.
1) we mark all traffic, that would be managed by one particular Queue, at the same place (prerouting)
2) we must mark upload and download for every type of traffic separately
5) we need 2 sets of queues - one for upload, one for download
Thank you for the reply. The problem is increased number of packets during the work day with low bandwidth utilization. We are a wireless ISP and yes, our equipment is gigabit ethernet in the relay stations but the gear we use Ubiquiti is not and I can't change that.interesting situation - this is a good question
so you have a radio network with high pps rates ? If you test the same setup on Gigabit Ethernet what would be the result ?
I think, in your particular case, it is your wireless equipment that should do packet prioritization. It should be doing it based on the DSCP, which you can set/adjust using some mangle rules on you Mikrotik router.We are a wireless ISP and yes, our equipment is gigabit ethernet in the relay stations but the gear we use Ubiquiti is not and I can't change that.
Thing is, it does work well during peak hours when bandwidth is maxed, so what I need is to be able to prioritize the packets based on the nature of the packet and not based on whether a queue is saturated or not.
Been there, done that!@macgaiver
I see that you have good dominance on QOS and reply to user questions in forum . but reading and understanding a multipage forum topic is boring . Why you don't create some wiki documents with full examples (it is better with pictures) and share your knowledge with other users ?
Your efforts will be appreciated .
When I need to do something new, first I websearch into the wiki.Been there, done that!@macgaiver
I see that you have good dominance on QOS and reply to user questions in forum . but reading and understanding a multipage forum topic is boring . Why you don't create some wiki documents with full examples (it is better with pictures) and share your knowledge with other users ?
Your efforts will be appreciated .
Full examples make people lazy - they just copy/paste and do not think, only complain.
Complain that example presented is different from situation they have,
There is no point of making another page of theoretical stuff - nobody will read it - i know that just because it looks like nobody bothers to read the manual
i will stick to this forum - less effort, more results.