Hello,
In my local network there is a server which provide a service on the one specific port (15555) for computers inside and outside my lan.
How to prioritize the traffic into and out of this server?
Thank you in advance.
You really can't. Priority only comes into play between queues which have already been given their guaranteed minimum bandwidth.The question is: how to give the higher priority to the traffic of one host without guarantee the bandwidth?
My internet connection is 50/5M and based on my experience it is 45/4,5 in real.You really can't. Priority only comes into play between queues which have already been given their guaranteed minimum bandwidth.The question is: how to give the higher priority to the traffic of one host without guarantee the bandwidth?
I'd say do something basic like this -
create two simple queues
The first is the "priority queue" and its target is set to the IP address of the priority host.
Guarantee that host (limit-at=) about 50% of the available bandwidth and set the max-limit to the full bandwidth of the connection. Priority=1
Make a second queue with target=x.x.x.0/24 (your LAN IP range) and guarantee it roughly 45% of the bandwidth, and a max-limit=full bandwidth of the connection.
Set the priority of this queue to 8.
That should do what you want and allow the priority host to have up to 55% of the bandwidth no matter what. You can lower the limit-at value for the default queue if you want to guarantee more bandwidth for the priority host. Just don't guarantee 100% to the priority host, as it can basically starve the rest of the network.
add limit-at=512k/5M max-limit=4608k/45M name="priority queue" priority=1/1 target=192.168.88.226/32
add limit-at=4M/40M max-limit=4608k/45M name=rest target=192.168.88.0/23
Which one is better in your opinion?I strongly recommend a guaranteed minimum bandwidth for the "rest" queue.
You don't want the priority host to be able to completely starve out the entire network for its own use.
Give it limit-at=512K/1M
/queue simple
add limit-at=512k/1M max-limit=4710k/46M name="priority queue" priority=1/1 target=192.168.88.226/32
add limit-at=512k/1M max-limit=4710k/46M name=rest target=192.168.88.0/23
/queue simple
add limit-at=2355k/23M max-limit=4710k/46M name="priority queue" priority=1/1 target=192.168.88.226/32
add limit-at=2355k/23M max-limit=4710k/46M name=rest target=192.168.88.0/23
Could you please explain to me the above using some examples?...
The priority queue is basically going to get all of the bandwidth except up to whatever minimum you reserved for the "rest" queue because the priority queue will either be:
a) below its guaranteed minimum, so it's going to get service no matter what in this case
b) above its guaranteed minimum:
- if the "rest" queue is below IT'S guarantee (4M) then "rest" will get up to that much, regardless of priority
- if the "rest" queue is also above IT'S guaranteed minimum, then priority queue gets the first bite at the apple.
It makes sense. Almost clear. Thank you....
Does this make sense now?
What does it means "shares it fairly"?Read the Wiki/Docs on PCQ.
Basically, you want to implement a basic upload/download PCQ type which doesn't specify any limitations on the "subqueues" - just leave it alone so it will just "evenly" divide the bandwidth by the number of streams that it sees. You still use the limit-at / max-limit values on the main queue itself the same way as always. PCQ just "shares it fairly."
What do you think about the rules below? Is this solution functional?Both statements are true - because "equally" is a dynamic concept.
When you set the pcq-classifier, you can configure it to consider each stream to be a sub-queue (specifying address and port number in the hashing function).
/ip firewall mangle add chain=forward src-address=192.168.88.0/23 action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet new-packet-mark=users chain=forward
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
/queue tree add name=Download parent=ether1 max-limit=50M
/queue tree add parent=Download queue=pcq-download packet-mark=users
/queue tree add name=Upload parent=pppoe-out1 max-limit=5M
/queue tree add parent=Upload queue=pcq-upload packet-mark=users
Sorry, I have no idea how to do it....
Or - probably better, just use a simple queue instead of queue trees. The simple queue will see the traffic before it gets masqueraded by the NAT table, so you can use the src-address as the classifier in the upload queue (as your example does).
How to prioritize the traffic of one host is now for me almost clear. Now I would like to know more about the dynamic share the bandwidth the among users. But I will make new topic for it.I believe PCQ queues would work good for what you want to achieve, and priority 1 when creating queues for specific host
http://wiki.mikrotik.com/wiki/Manual:Queue
Is this it?...
Or - probably better, just use a simple queue instead of queue trees. The simple queue will see the traffic before it gets masqueraded by the NAT table, so you can use the src-address as the classifier in the upload queue (as your example does).
/queue type
add kind=pcq name=pcq_download pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=45M pcq-src-address6-mask=64
add kind=pcq name=pcq_upload pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=4500k pcq-src-address6-mask=64
/queue simple
add name=dynamic queue=pcq_upload/pcq_download target=192.168.88.0/23
Remove the red./queue type
add kind=pcq name=pcq_download pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=45M pcq-src-address6-mask=64
add kind=pcq name=pcq_upload pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=4500k pcq-src-address6-mask=64
/queue simple
add name=dynamic queue=pcq_upload/pcq_download target=192.168.88.0/23 max-limit=4500k/45m
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=conn_prio \
passthrough=yes port=22 protocol=tcp
add action=mark-packet chain=prerouting connection-mark=conn_prio \
new-packet-mark=pack_prio passthrough=no
/queue simple
add max-limit=5M/5M name=GlobalQueue queue=pcq-upload-default/pcq-download-default \
target=bridge1-local
add limit-at=512k/512k max-limit=1000M/1000M name=OtherTraffic packet-marks=no-mark parent=\
GlobalQueue queue=pcq-upload-default/pcq-download-default target=bridge1-local
add limit-at=512k/512k max-limit=1000M/1000M name=HighPriorityTraffic packet-marks=\
pack_prio parent=GlobalQueue priority=1/1 queue=\
pcq-upload-default/pcq-download-default target=bridge1-local
I'm not an expert with queues, so some of this could be wrong: (especially #1)My questions are:
What is packet-marks="" mean?All marked and unmarked packets?All packets with any mark set?
I can't set limit-at without setting max-limit on child queue even with its parent queue max-limit is set. With this setup i can change all child queues bandwidth with one click - just change GlobalQueue max-limit.
Will my "dirty hack" with parent-child limits work as expected?
If all child queues with equal priority will use full bandwidth - it will be shared equally?