Community discussions

MikroTik App
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Wireless Bandwidth Share Equal

Fri Jan 08, 2016 10:59 am

Hello everyone @ mikrotik forums
i have this router
951G-2HnD with current firmware 3.19 and RouterOS v6.33.3

i want to apply on my wireless card share bandwidth equally
for X users
the only way i made it i some way was to
create new Queue Type PCQ one and then apply this on Interface Queue Wlan Interface

but i believe that is not the correct way to do it

is there any other way ?

Thanks everyone
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Wireless Bandwidth Share Equal

Fri Jan 08, 2016 1:34 pm

PCQ is the way to go. You can check on the wiki page some examples on how to implement it to your needs, like:
http://wiki.mikrotik.com/index.php?titl ... edirect=no

Try it out, and then post your config in here if anything does not goes to plan.
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Re: Wireless Bandwidth Share Equal

Fri Jan 08, 2016 2:44 pm

PCQ is the way to go. You can check on the wiki page some examples on how to implement it to your needs, like:
http://wiki.mikrotik.com/index.php?titl ... edirect=no

Try it out, and then post your config in here if anything does not goes to plan.
Hello
i have try it
i copy paste the commands doesnt works :(

i want to limit a whole wireless subnet
in order everyone to have for example 512 download and 50 upload

doesnt work even if i try it via winbox

only thing that works is to create new PCQ Queue Type with limit for 512k and change the
wireless card from hardware only to my new PCQ queue

but isnt shared the same among the users

Thanks
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Wireless Bandwidth Share Equal

Fri Jan 08, 2016 4:55 pm

It is not about copy paste, is about understanding the example and then implement it on your network.

First, you should start with marking packets coming and going from your wireless interface in the mangle. Then those packet marks are used in the queue tree using the pcq type you have defined. If you establish a pcq rate in the pcq type, that means that customers will get at best the rate specified even if there might be more bandwidth available. If you put the rate at 0 that means that all customers will divide the available bandwidth equally (more or less).

Now, the router does not know what the available bandwidth is, so you need to create a parent queue with the total bandwidth that ISP gives you. Under this parent you create the child queues using the pcq type you have created and the packet marks from mangle mentioned above. You should not attach the queue on the interface in this case.

Post your configs here so that we can have a look at them.
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Re: Wireless Bandwidth Share Equal

Sat Jan 09, 2016 2:16 pm

It is not about copy paste, is about understanding the example and then implement it on your network.

First, you should start with marking packets coming and going from your wireless interface in the mangle. Then those packet marks are used in the queue tree using the pcq type you have defined. If you establish a pcq rate in the pcq type, that means that customers will get at best the rate specified even if there might be more bandwidth available. If you put the rate at 0 that means that all customers will divide the available bandwidth equally (more or less).

Now, the router does not know what the available bandwidth is, so you need to create a parent queue with the total bandwidth that ISP gives you. Under this parent you create the child queues using the pcq type you have created and the packet marks from mangle mentioned above. You should not attach the queue on the interface in this case.

Post your configs here so that we can have a look at them.

Hello Caci99 thanks for the informations
i try and test still nothing i want more help if possible thanks

here is my configuration from the terminal

Mangle:
    chain=forward action=mark-packet new-packet-mark=wifiin passthrough=yes in-interface=qbtcm log=no 
      log-prefix="" 

   chain=forward action=mark-packet new-packet-mark=wifiout passthrough=yes out-interface=qbtcm 
      log=no log-prefix="" 
Queue Tree:
 0   name="ispbandwithup" parent=global packet-mark="" limit-at=0 queue=default priority=8 max-limit=0 
     burst-limit=0 burst-threshold=0 burst-time=0s 

 1   name="clienddownload" parent=ispbandwithdown packet-mark=wifidown limit-at=0 queue=wifidown 
     priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s 

 2   name="ispbandwithdown" parent=global packet-mark="" limit-at=0 queue=wifiup priority=8 max-limit=0 
     burst-limit=0 burst-threshold=0 burst-time=0s 

 3   name="clientup" parent=ispbandwithup packet-mark=wifiupload limit-at=0 queue=wifiup priority=8 
     max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s 
Queue Types:
 5   name="wifidown" kind=pcq pcq-rate=64k pcq-limit=50KiB pcq-classifier=dst-address 
     pcq-total-limit=2000KiB pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s 
     pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64 

 6   name="wifiup" kind=pcq pcq-rate=64k pcq-limit=50KiB pcq-classifier=dst-address 
     pcq-total-limit=2000KiB pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s 
     pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64
i tested by donwloading a large file the speed is the provider max still :(

can you tell me where i am wrong
Thanks

PS:in Mangle what is the difference between packet mark on General tab vs the action packet mark NEW packet mark?
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Wireless Bandwidth Share Equal

Sat Jan 09, 2016 3:13 pm

Good, that's the way to start getting help :), try it first and post your config.

Now to the point, first it is important that wireless interface named qbtcm is not part of any bridge interface. I will assume it is not.

Second, your mangle seem correct to some extent, but I would mark connections first and then packets, it is less resource hungry this way:
/ip firewall mangle
add chain=forward in-interface=qbtcm out-interface=WAN action=mark-connection new-connection-mark=upload passthrough=yes
add chain=forward in-interface=WAN out-interface=qbtcm action=mark-connection new-connection-mark=download passthrough=yes
add chain=forward connection-mark=upload action=mark-packet new-packet-mark=upload passthrough=no
add chain=forward connection-mark=download action=mark-packet new-packet-mark=download passthrough=no 
Note that last two rules have passthrough=no, that means that packets are not processed anymore and leave the firewall.

Your queues do not have max-limit specified, that is why you probably see no difference. What are the concepts behind limit-at and max-limit? Limit-at is the value that the queue must satisfy no matter what (CIR), it is the least bandwidth that you always guarantee to the customer. Be careful that the sum of limit-at of all child queues should not exceed the max-limit of the parent queue. Once the limit-at is reached the queue will start shaping and limiting the traffic up to the max-limit value. Max-limit as you might understand is the max value of bandwidth allowed by the queue.
In the parent queue you only need to specify the max-limit, in child queue you might need to specify limit-at and max-limit.
/queue tree
add name="ispbandwithup" parent=WAN packet-mark="" limit-at=0 queue=default priority=8 max-limit=Value
     burst-limit=0 burst-threshold=0 burst-time=0s
add name="clientup" parent=ispbandwithup packet-mark=upload limit-at=Value queue=wifiup priority=8
     max-limit=Value burst-limit=0 burst-threshold=0 burst-time=0s  
Same for download. Attach the download parent queue to the wireless interface. Remember to fill in the values for limit-at and max-limit.

Last, the queue type. The specification on wifiup is wrong pcq-classifier=dst-address, it should be pcq-classifier=src-address. Also you have specified a rate in there, which I don't think you would want. As mentioned before, specifying the rate means that customer will get 64k even if there might be more available. If there is only one person using the internet he will get 64k even if there might be 10M.
Better have rate=0, this way customer will have the max bandwidth available, depending on the number of active users.
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Re: Wireless Bandwidth Share Equal

Sat Jan 09, 2016 3:46 pm

Good, that's the way to start getting help :), try it first and post your config.

Now to the point, first it is important that wireless interface named qbtcm is not part of any bridge interface. I will assume it is not.

Second, your mangle seem correct to some extent, but I would mark connections first and then packets, it is less resource hungry this way:
/ip firewall mangle
add chain=forward in-interface=qbtcm out-interface=WAN action=mark-connection new-connection-mark=upload passthrough=yes
add chain=forward in-interface=WAN out-interface=qbtcm action=mark-connection new-connection-mark=download passthrough=yes
add chain=forward connection-mark=upload action=mark-packet new-packet-mark=upload passthrough=no
add chain=forward connection-mark=download action=mark-packet new-packet-mark=download passthrough=no 
Note that last two rules have passthrough=no, that means that packets are not processed anymore and leave the firewall.

Your queues do not have max-limit specified, that is why you probably see no difference. What are the concepts behind limit-at and max-limit? Limit-at is the value that the queue must satisfy no matter what (CIR), it is the least bandwidth that you always guarantee to the customer. Be careful that the sum of limit-at of all child queues should not exceed the max-limit of the parent queue. Once the limit-at is reached the queue will start shaping and limiting the traffic up to the max-limit value. Max-limit as you might understand is the max value of bandwidth allowed by the queue.
In the parent queue you only need to specify the max-limit, in child queue you might need to specify limit-at and max-limit.
/queue tree
add name="ispbandwithup" parent=WAN packet-mark="" limit-at=0 queue=default priority=8 max-limit=Value
     burst-limit=0 burst-threshold=0 burst-time=0s
add name="clientup" parent=ispbandwithup packet-mark=upload limit-at=Value queue=wifiup priority=8
     max-limit=Value burst-limit=0 burst-threshold=0 burst-time=0s  
Same for download. Attach the download parent queue to the wireless interface. Remember to fill in the values for limit-at and max-limit.

Last, the queue type. The specification on wifiup is wrong pcq-classifier=dst-address, it should be pcq-classifier=src-address. Also you have specified a rate in there, which I don't think you would want. As mentioned before, specifying the rate means that customer will get 64k even if there might be more available. If there is only one person using the internet he will get 64k even if there might be 10M.
Better have rate=0, this way customer will have the max bandwidth available, depending on the number of active users.

Hello
yea wlan interface is out of bridge in bridge mode is only the ethernet ports
wlan operates in seperate subnet out of bridge

i try ur code just right now
i paste the code in order to see
still when i download i see full speed at download i set pcq queue at 0 and then at 64k still download is around 770KB
also i noticed in Mangle that while i download the numbers doesnt not increase

please check and tell me where are i am wrong

Mangle
 3    chain=forward action=mark-connection new-connection-mark=upload passthrough=yes in-interface=qbtcm 
      out-interface=ether1-gateway log=no log-prefix="" 

 4    chain=forward action=mark-connection new-connection-mark=download passthrough=yes in-interface=ether1-gateway 
      out-interface=qbtcm log=no log-prefix="" 

 5    chain=forward action=mark-packet new-packet-mark=upload passthrough=no connection-mark=upload log=no log-prefix="" 

 6    chain=forward action=mark-packet new-packet-mark=download passthrough=no connection-mark=download log=no log-prefix="" 
Queue Tree
 0   name="ispbandwithup" parent=ether1-gateway packet-mark="" limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 
     burst-threshold=0 burst-time=0s 

 1   name="clientup" parent=ispbandwithup packet-mark=upload limit-at=0 queue=wifiup priority=8 max-limit=64k burst-limit=0 
     burst-threshold=0 burst-time=0s 

 2   name="ispbandwithdown" parent=qbtcm packet-mark="" limit-at=0 queue=default priority=8 max-limit=0 burst-limit=0 
     burst-threshold=0 burst-time=0s 

 3   name="clientdown" parent=ispbandwithdown packet-mark=download limit-at=0 queue=wifidown priority=8 max-limit=64k 
     burst-limit=0 burst-threshold=0 burst-time=0s 
Thanks
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Re: Wireless Bandwidth Share Equal

Sat Jan 09, 2016 7:04 pm

ok sorry for double post

i keep playing with the settings
nothing works as intended

i see connections in firewall
packets are marked as intended upload and download
queue not working
even forcing pcq at rate of 64k and setting on interface one
tested and on one ethernet port out no slave one,
not in bridge mode

and still does the same thing

did the bridge mode makes the problem at all
or i am missing something important?

thanks
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1076
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: Wireless Bandwidth Share Equal

Sun Jan 10, 2016 11:40 pm

If you see counters running in mangle than that config is working.
As for the queues, don't forget to specify limit-at and max-limit of the queues. If you leave them 0 they will not work.
 
Rurouni89
just joined
Topic Author
Posts: 15
Joined: Fri Jan 08, 2016 10:29 am

Re: Wireless Bandwidth Share Equal

Mon Jan 11, 2016 8:51 am

If you see counters running in mangle than that config is working.
As for the queues, don't forget to specify limit-at and max-limit of the queues. If you leave them 0 they will not work.
Hello Caci99
done it
done almost every combination at max-limit and every aspect limit in the queue trees
and doesnt work
i start to download in one wireless computer a big file
and nothing happened
i read precisely and done whatever u said and nothing works

while i download i have mangle open
from ether-1 to wlan interface
and from wlan interface from ether-1
the packets counter are limited almost not moving
i play with settings all settings
also i apply the queue in another interface ethernet interface by changing approprietly the
queuee trees dont know why it doesnt listen

Thanks
i will do a configuration reset to test i noticed 2 dynamics mangle rules doesnt show in mangle UI aswell
retrying and reposting thanks again

Who is online

Users browsing this forum: sindy and 24 guests