Forget Priority here !! we tried hard to get the same results , giving ICMP highest priority without any hope ..First, thanks for reading!
pls see my scenario below:
1. I want do limitation to one IP. let say 172.16.31.89. so, i do mangle(connection-mark and packet-mark) in prerouting(upload) and postrouting(download) with Passthrought=NO and then apply it in global-in(upload), global-out(download) in Queue Tree. i also set limit-at to 32k and max-limit to 128k for both download and upload traffic. please refer to below config:
>ip mangle print
82 ;;172.16.31.89-conn-down
chain=postrouting action=mark-connection new-connection-mark=chanty-conn-download passthrough=yes src-address=172.16.31.89
83 ;;172.16.31.89-pack-down
chain=postrouting action=mark-packet new-packet-mark=chanty-packet-download passthrough=no connection-mark=chanty-conn-download
84 ;;172.16.31.89-conn-up
chain=pretrouting action=mark-connection new-connection-mark=chanty-conn-upload passthrough=yes src-address=172.16.31.89
85 ;;172.16.31.89-pack-up
chain=prerouting action=mark-packet new-packet-mark=chanty-packet-upload passthrough=no connection-mark=chanty-pack-upload
>queue tree print
86 name="chanty-inner-download" parent=Total-Download packet-mark="" limit-at=128000 queue=default priority=8 max-limit=128000 burst-limit=0 burst-threshold=0 burst-time=0s
87 name="chanty-inner-upload" parent=Total-Upload packet-mark="" limit-at=128000 queue=default priority=8 max-limit=128000 burst-limit=0 burst-threshold=0 burst-time=0s
64 name="chanty-down" parent=chanty-inner-download packet-mark=chanty-packet-download limit-at=100000 queue=default priority=8 max-limit=120000 burst-limit=0 burst-threshold=0 burst-time=0s
65 name="chanty-up" parent=chanty-inner-upload packet-mark=chanty-packet-upload limit-at=100000 queue=default priority=8 max-limit=120000 burst-limit=0 burst-threshold=0 burst-time=0s
2. I want to give priority to incoming ICMP traffic. so, i do mangle(packet-mark only) in both prerouting(upload) and postrouting(download) specifying Protocol=ICMP.
>ip firewall mangle print
0 ;;; icmp-packet-upload
chain=prerouting action=mark-packet new-packet-mark=icmp-packet-upload passthrough=yes protocol=icmp
1 ;;; icmp-packet-download
chain=postrouting action=mark-packet new-packet-mark=icmp-packet-download passthrough=yes protocol=icmp
>queue tree print
66 name="icmp-priority-download" parent=chanty-inner-upload packet-mark=icmp-packet-upload limit-at=28000 queue=default priority=2 max-limit=120000 burst-limit=0 burst-threshold=0 burst-time=0s
67 name="icmp-priority-download" parent=chanty-inner-download packet-mark=icmp-packet-download limit-at=28000 queue=default priority=2 max-limit=120000 burst-limit=0 burst-threshold=0 burst-time=0s
My problem is ICMP cannot get priority. Everytime, i try to test full download or upload, ICMP will get a lot delay time.
can anyone please advise on the configuration?
Thanks,
here is from nomisIn 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"
i have made some testing configuration as below:QoS includes several facilities, in the following order:
1. mangle chain prerouting
2. HTB global-in
3. Mangle chain forward
4. Mangle chain postrouting
5. HTB global-out
6. HTB out interface
so, inside one router, you can do shape twice if you use:
a) #1 and #2 for first marking and shaping, and #3+#5 for second
b) #1 and #2 for first marking and shaping, and #3+#6 for second
c) #1 and #2 for first marking and shaping, and #4+#5 for second
d) #1 and #2 for first marking and shaping, and #4+#6 for second
3. try to change from ICMP to HTTP protocol. just to make sure that user cannot use over the bandwidth as Janisk saidif ICMP is your problem so : isolate it , exclude it by mangle , give it a simple unlimited queue , put this q always on top of other simple q's , it wont take much bandwidth at all ..
Here is new configuration:This way we get virtually the same behaviour as "per user prioritization"
QoS includes several facilities, in the following order:
1. Mangle chain prerouting
2. HTB global-in
3. Mangle chain forward
4. Mangle chain postrouting
5. HTB global-out
6. HTB out interface
So, in one router, you can shape twice if you use:
a) #1 and #2 for first marking and shaping, and #3+#5 for second
b) #1 and #2 for first marking and shaping, and #3+#6 for second
c) #1 and #2 for first marking and shaping, and #4+#5 for second
d) #1 and #2 for first marking and shaping, and #4+#6 for second
In my presentation I told that creating priorities separately for each client is suicide - there is no hardware that can handle small queue tree for every user (if you have 1000 of them). So in my presentation I discuss next best thing, which is close as possible to desired behavior.
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 has more chance to get to the customers than traffic with 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 limitation 80Mbps of priority=8 will be dropped. 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 behavior as "per user prioritization".
So the plan for you might be to mark by traffic type in prerouting and limit by traffic type in global-in.
Then remark traffic by IP addresses in forward and limit them on the outgoing interface.
1) you need to mark all traffic at the same place (prerouting) (that would be shaped by one Queue)
2) you must mark upload and download for every type of traffic separately (if you use global-total or Queue Simple)
4) you must have a parent queue, that has max-limit and parent=global-in - all other queues parent=<parent>
5) you need 2 sets of those queues - one for upload one for download
Priority doesn't work without limitation.
Each simple queue creates 3 separate queues:
One in global-in (“direct” part)
One in Global-out (“reverse” part)
One in Global-total (“total” part)
Simple queues are ordered - similar to firewall rules
further down = longer packet processing
further down = smaller chance to get traffic
(necessary to reduce number of queues)
Queuing Placement
Limitation for in mangle chain “forward” marked traffic can be placed in the “global-out” or interface queue
If queues will be placed in the interface queues
queues on the public interface will capture only client upload
queues on the local interface will capture only client's download
If queues will be placed in global-out
download and upload will be limited together (separate marks needed)
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.
i think if you just do the queue tree and the MAIN QUEUE for upload and the MAIN QUEUE for download for an example 95% of your total down/up bandwidth the priorities and qos should work better coz they will have some room to work.
Take a look at:i think if you just do the queue tree and the MAIN QUEUE for upload and the MAIN QUEUE for download for an example 95% of your total down/up bandwidth the priorities and qos should work better coz they will have some room to work.
and thisImagine you are in metro train and in the next station granny is waiting.
Granny is highest priority and as soon as she will get into train someone for sure will give her a place to sit. (at least where I'm from)
Now imagine that train is so full, that granny will not even get into train, so at this point it doesn't matter what priority granny had, she is staying on the station.
But if train was only 95% full granny will have no problems to get in and use her highest priority.
Imagine high-speed road with lots of traffic on it, and there are one car coming from side road and need to get on the main high-speed road. In order to make it much more easier you need an acceleration line - where car can build up speed to main roads speed and then blend into rest of the traffic. If there are no acceleration line, this car will have hard time getting on the main road.
If there are 100% of traffic used - similar to situation without acceleration line
If there are 95% and less of traffic used - similar to situation with acceleration line