Community discussions

 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

[Solved] PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 3:36 am

Solved, see last post

Hello,

I have a problem that I've spent many hours trying to solve but still no luck! I have read many forum threads and tried a million things but no dice. The problem: The PCQ Rate value seems to define the "total available bandwidth" ie. if I set the rate to 6M and do a speedtest with 2 devices, they will fight for the 6M, even when I have a simple queue set up for the subnet both devices are in and have set a Max Limit to a much greater value than the rate. Config below, any help would be much appreciated!!

/queue simple> print
Flags: X - disabled, I - invalid, D - dynamic
0 name="Shaping" target=192.168.88.0/24 parent=none packet-marks=""
priority=8/8 queue=pcq-upload/pcq-download limit-at=0/0
max-limit=32M/32M burst-limit=0/0 burst-threshold=0/0 burst-time=0s/0s
bucket-size=0.1/0.1 total-queue=default


/queue type> print
5 name="pcq-download" kind=pcq pcq-rate=6M 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=0
pcq-dst-address-mask=0 pcq-src-address6-mask=64 pcq-dst-address6-mask=64

6 name="pcq-upload" kind=pcq pcq-rate=3M pcq-limit=50KiB
pcq-classifier=src-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=128
pcq-dst-address6-mask=128


Thanks!

Derek
Last edited by lynx649 on Thu Mar 23, 2017 5:42 am, edited 1 time in total.
 
Kevo
Frequent Visitor
Frequent Visitor
Posts: 55
Joined: Wed Oct 12, 2011 1:38 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 4:21 am

I have mine setup with a mangle to mark the upload and download. It works fine from my testing, but I'm not sure it's necessarily the best way. This router is a hex that typically serves 25 users or less.
/ip firewall mangle
add action=mark-packet chain=forward new-packet-mark=client_upload \
    out-interface=ether1 passthrough=yes src-address-list=client_subnets
add action=mark-packet chain=forward dst-address-list=client_subnets \
    in-interface=ether1 new-packet-mark=client_download passthrough=yes
    
    /queue type
add kind=pcq name=pcq_download pcq-classifier=dst-address \
    pcq-dst-address6-mask=64 pcq-rate=11M pcq-src-address6-mask=64
add kind=pcq name=pcq_upload pcq-classifier=src-address \
    pcq-dst-address6-mask=64 pcq-rate=4M pcq-src-address6-mask=64
/queue tree
add name=queue_upload packet-mark=client_upload parent=global queue=\
    pcq_upload
add name=queue_download packet-mark=client_download parent=global queue=\
    pcq_download

 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 4:41 am

Thanks for the reply, I'll try your config soon although I've already tried using a mangle/queue tree/pcq set up and ran into the same issue. It seems no matter what I do, the total bandwidth supply is dictated by 'pcq-rate'

Just to add, fastrack is disabled and use firewall rules is checked in bridge settings. I also tried using mangle/queue tree/pcq on a master slave set up but same problem, I feel like I'm either missing something very simple or it's some kind of bug!

Thanks
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 12:05 pm

Can you confirm what your total upload and download is. What maximum you would like to have to each IP. how many users you expect to have connected at any given time.
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 4:53 pm

Total Download/Upload from ISP is 35M/5M. This is just my home router so probably would not expect more than 10 users at any given time. Maximumn I would like to have to each user is 10M. I'm really trying to learn it to apply the knowledge to Mikrotiks we have for my company.
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 8:07 pm

Try these settings. once you have this workign ask questions on what you would like to understand more on then we can assist further or provide explanation.
/queue type
add kind=pcq name=pcq-down-10M pcq-classifier=dst-address pcq-rate=10M pcq-total-limit=2000KiB
add kind=pcq name=pcq-upload-3M pcq-classifier=src-address pcq-rate=3M pcq-total-limit=2000KiB
/queue simple
add name=LAN-WAN max-limit=35M/5M queue=pcq-upload-3M/pcq-down-10M target=192.168.88.0/24
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 8:26 pm

EDIT:

I tried this on a 450 here in the office and it works beautifully *REDACTED* Still trying to figure out HAP.




Old Post Below
___________
Ok,

I tried your config (I had to swap the 35/5 in the simple queue just fyi as it had applied the 35 to the upload and the 5 to the download) but I see the same symptoms. The 2 computers when running a speedtest simultaneously 'fight' over the 10 Mbps that's specified in PCQ download rate. I am using a HAP router, maybe this unit is not capable of this feature?

Thanks for your help.
Last edited by lynx649 on Wed Mar 22, 2017 12:47 am, edited 2 times in total.
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 8:42 pm

I dont believe there is a limitation as to which of the mikrotik routers can run PCQ.What firmware version are you running? Just to confirm when you run you test without PCQ what speed are you getting per computer?
Also what is the wan port speed if you view your ethernet status
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 8:49 pm

HAP Version: 6.38.1

Speeds: On HAP with your config, 2 Computers contend for the 10M specified in pcq download rate. They get about 5M Each. With RB450 using your same config, they get 10M each no problem. Tested multiple times on both routers. One thing I notice is, the color of the simple queue doesn't change on HAP but goes Yellow on the 450 when running these tests. Tested on HAP and HAP ac lite, same results on both, they contend for rate specified in PCQ queue type but same config works perfectly on 450.

Ethernet Port Speed: 100Mbps

EDIT: HAP Speed Per Computer without PCQ: 25 Mbps (My office bandwidth) When run simultaneously, about 12-13 Mbps Each
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 9:03 pm

Have you insured fast track is disabled onthe HAP. from my research you should not have an issue running simple queues on this router as it is available under the licence. there is something running preventing it from working as it should. you can post export of config if you get a chance just hide anything you dont want on forum.
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 9:21 pm

fasttrack is disabled, I'll post my home router's config tonight when I get home as the office HAP has lots of things in it, the home one is a cleaner config but still isn't working. Office HAP is regular HAP 2,4ghz, home HAP is HAP AC Lite. Again, same config is not working on either HAP but does work on 450, it would be nice if you're right though and we can get it to work on the HAP at my home because I want to limit devices from downloading too fast and screwing up other device's video streams etc.

Thanks!
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 9:28 pm

lets look at config see what could be issue.
 
freemannnn
Long time Member
Long time Member
Posts: 669
Joined: Sun Oct 13, 2013 7:29 pm

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 9:53 pm

Maybe u can try to Reset the hap and setup from scratch
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Tue Mar 21, 2017 10:29 pm

Ya, I'll definitely try that if we can't fix the router as is... it would be nice to know if anyone has the HAP working with PCQ correctly, you'd have to run speed tests on 2 devices to find out for sure as it took me a while to realize that the devices were actually contending for the pcq rate, if I just test with one device it 'appears' that the pcq is working but once I test with 2 they contend for the bandwidth.

Thanks.
 
freemannnn
Long time Member
Long time Member
Posts: 669
Joined: Sun Oct 13, 2013 7:29 pm

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 12:21 am

i just test with my hap lite 10M max limit download and 4M pcq-rate download.
i run speedtest at the same time at 2 windows installations in vmware and each got 4M. total queue usage while running speedtest was 8M.
as i expected hap lite is ok with pcq.
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 12:46 am

i just test with my hap lite 10M max limit download and 4M pcq-rate download.
i run speedtest at the same time at 2 windows installations in vmware and each got 4M. total queue usage while running speedtest was 8M.
as i expected hap lite is ok with pcq.
Thanks freemannnn, I edited my previous post saying PCQ does not work with that model as obviously it does! I'll post home router config tonight and see if we can get to the bottom of it.

edit: I had a few minutes at the end of the day in the office so thought I'd factory default an "hAP ac lite" I applied dgnevan's config but the same results with 2 computers... config below. I don't think I'll bother posting home router config as a factory defaulted one is exhibiting the same symptoms. If anyone has any ideas I'm all ears :)
[admin@MikroTik] > export
# jan/01/2002 01:02:00 by RouterOS 6.37.1
# software id = *REDACTED*
#
/interface bridge
add admin-mac=*REDACTED* auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] name=ether2-master
set [ find default-name=ether3 ] master-port=ether2-master
set [ find default-name=ether4 ] master-port=ether2-master
set [ find default-name=ether5 ] master-port=ether2-master
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n channel-width=20/40mhz-Ce disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=MikroTik-487F9C wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n/ac channel-width=20/40/80mhz-Ceee disabled=no distance=indoors frequency=auto mode=ap-bridge ssid=MikroTik-487F9B wireless-protocol=802.11
/ip neighbor discovery
set ether1 discover=no
set bridge comment=defconf
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=bridge name=defconf
/queue type
add kind=pcq name=pcq-down-10M pcq-classifier=dst-address pcq-rate=10M
add kind=pcq name=pcq-upload-3M pcq-classifier=src-address pcq-rate=3M
/queue simple
add max-limit=5M/35M name=LAN-WAN queue=pcq-upload-3M/pcq-down-10M target=192.168.88.0/24
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge comment=defconf interface=wlan2
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=ether1
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=input comment="defconf: drop all from WAN" in-interface=ether1
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related disabled=yes
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf:  drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=ether1
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1
/system routerboard settings
set cpu-frequency=650MHz protected-routerboot=disabled
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=bridge
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=bridge
Speedtest with 1 Device

https://ibb.co/iF601F
9.74x2.99

Speedtest with 2 Devices

https://ibb.co/cgpbaa
5.69x1.75 other device 4.66x1.33
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 12:51 pm

I would try a different firmware to ensure this is not a firmware bug.
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 4:36 pm

I would try a different firmware to ensure this is not a firmware bug.
I upgraded to 3.36 and RouterOS to 6.38.5 but the same problem remains. I think I'll give up the ghost for now, at least I know it works on my 450 and hopefully any other RB i try. I'll just use a simple queue for every IP at my home. Thanks everyone for all your help. If anyone has a last minute suggestion, I'm happy to try,

Thanks!
 
User avatar
dgnevans
Member
Member
Posts: 463
Joined: Fri Mar 08, 2013 11:24 am
Location: Zimbabwe
Contact:

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 4:42 pm

I have used this shaping on the RB 750 about 4 years ago. Rb 1100ahx2 and the ccr1009 without any issues. If I get my hands on the hap or hap lite will run a test and see if I can replicate. This is definately not normal. May be worth while sending to support with a supout.rif so they can comment.
 
lynx649
newbie
Topic Author
Posts: 25
Joined: Tue May 27, 2014 5:22 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Mar 22, 2017 8:22 pm

I have used this shaping on the RB 750 about 4 years ago. Rb 1100ahx2 and the ccr1009 without any issues. If I get my hands on the hap or hap lite will run a test and see if I can replicate. This is definately not normal. May be worth while sending to support with a supout.rif so they can comment.
Thanks dgnevans, I was looking at the support page but it says if the purchase is over 30 days ago to contact the reseller... I could do this but it would probably involve alot of time and red tape? Maybe someone from Mikrotik Support on the forums can volunteer to look at the support file?

Also, just tried your config on a 750 factory defaulted and it worked like a charm.

Thanks.

Update! I think I have gotten it to work, I removed the bridge and used master slave and the PCQ seems to be working correctly :D Does this make sense though? I would think PCQ should work with bridge too no?

Update 2: Hmmm, went back to bridge mode and it still seems to be working lol... I'll mess around with my home router tonight and see if I can replicate!

Update 3: Still couldn't get it working on the unit at my home, I'll bring the working one home tomorrow and set that up on my home network.

Update 4: Well I'm an idiot... Thanks to everyone for all their help, especially dgnevans. There's a few stupid mistakes on my part coupled with my lack of understanding of queues so I apologize for wasting anyone's time... But if you feel like wasting more time and finding out how I realized my mistakes please read on!

What was happening at the office (which I now realize) with the defaulted HAP 'not working' was it was behind another router with PCQ enabled... so to the first router in line with PCQ, it was just seeing the WAN port of the HAP as one client if you will and the 2 devices behind it were 'contending' for the 10M. This was not the case, however, in my home network that led me to the office testing. What I decided to do tonight was try dgnevans' config on my home router and it worked! I had done an export just prior to this to see any difference between my set up and his config..

My PCQ type.. (the values are a bit random as I was trying different things out of frustration!)

/queue type
add kind=pcq name=pcq-download pcq-classifier=dst-address pcq-dst-address-mask=24 pcq-dst-address6-mask=64 pcq-rate=7M pcq-src-address-mask=24 pcq-src-address6-mask=64
add kind=pcq name=pcq-upload pcq-classifier=src-address pcq-dst-address-mask=24 pcq-rate=3M pcq-src-address-mask=24
set 7 pcq-rate=1M
set 8 pcq-rate=19M
I then applied dgnevans' config
/queue type
add kind=pcq name=pcq-down-10M pcq-classifier=dst-address pcq-rate=10M pcq-total-limit=2000KiB
add kind=pcq name=pcq-upload-3M pcq-classifier=src-address pcq-rate=3M pcq-total-limit=2000KiB
/queue simple
add name=LAN-WAN max-limit=35M/5M queue=pcq-upload-3M/pcq-down-10M target=192.168.88.0/24
And it worked instantly! I'm very happy and now have a working PCQ system on my home router. I must have added the src-address mask flags etc. out of desperation in trying different things but it ended up breaking my config, at least I think that's what did...

To summarize

Mistake #1 - Having a broken (by my own doing) PCQ config
Mistake #2 - Using a good working PCQ config behind a router with PCQ and being fooled into thinking there was a problem when there was none.
Mistake #3 - Being a n00b

The good news is now I know a little bit about PCQ and mangle rules, I'll continue to learn, again thanks for everyone's help and have a great day :)[/b]
 
sash7
Frequent Visitor
Frequent Visitor
Posts: 69
Joined: Sun Mar 20, 2016 10:39 pm

Re: [Solved] PCQ Rate and Simple Queue - Per IP Shaping Problem

Fri Mar 31, 2017 2:12 pm

Hi. For me, mistake in your rules in first post is in address mask.
pcq-src-address-mask=0
pcq-dst-address-mask=0

If you network is 192.168.88.0/24 - src and dst mask should to be 32 not 0
/queue type> print
5 name="pcq-download" kind=pcq pcq-rate=6M 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=0
pcq-dst-address-mask=0 pcq-src-address6-mask=64 pcq-dst-address6-mask=64

last config is also little strange for me:
/queue type
add kind=pcq name=pcq-down-10M pcq-classifier=dst-address pcq-rate=10M pcq-total-limit=2000KiB
add kind=pcq name=pcq-upload-3M pcq-classifier=src-address pcq-rate=3M pcq-total-limit=2000KiB
/queue simple
add name=LAN-WAN max-limit=35M/5M queue=pcq-upload-3M/pcq-down-10M target=192.168.88.0/24
Why you limit download to 10M if you have 35M, and upload to 3M if you have 5M ?
Better use pcq-rate=0 and all behind router will get equality speed. Dont forget for mask 32, and pcq-classifier = Dst Address for you pcq-down-10M and pcq-classifier = Src Address for you pcq-upload-3M

https://wiki.mikrotik.com/wiki/Manual:Queues_-_PCQ
Best regards )
 
robtx
just joined
Posts: 6
Joined: Wed Jun 21, 2017 7:58 am

Re: PCQ Rate and Simple Queue - Per IP Shaping Problem

Sat Jul 01, 2017 3:52 am

Try these settings. once you have this workign ask questions on what you would like to understand more on then we can assist further or provide explanation.
/queue type
add kind=pcq name=pcq-down-10M pcq-classifier=dst-address pcq-rate=10M pcq-total-limit=2000KiB
add kind=pcq name=pcq-upload-3M pcq-classifier=src-address pcq-rate=3M pcq-total-limit=2000KiB
/queue simple
add name=LAN-WAN max-limit=35M/5M queue=pcq-upload-3M/pcq-down-10M target=192.168.88.0/24
Ok, I've got a similar issue and I'm trying to move from simple queues (across both ipv6 and ipv4, so i'm using conn_mark + pkt_mark and putting the simple queue on the pkt_mark).

I don't understand the pcq-rate=10M and pcq-total-limit=2000KiB. That seems counter intuitive to my understanding of PCQ. Doesn't that say: Each host can have 10M of download, but all the hosts can only have 2M (2000KiB) between them, or do I misunderstand pcq-rate/pcq-total-limit interaction?

(Possibly related, I realize that if a host is using ipv4 and ipv6 they could get around the PCQ limit because they would be 2+ hosts by classifier...i'm not worried, it's at home and I'm trying to limit my kids only...if they figure out that little secret then I've succeeded past my wildest dreams in technology teaching!)

Edit: Nevermind I just realized that I was reading it wrong: That's 2000KiB/s == 2MiB/s == 16Mb/s, leaving the question here for someone else who read it wrong. That setting really should follow the rest of the notations on the Mikrotik.
 
User avatar
DanielJB
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Mon May 27, 2013 3:05 pm

Re: [Solved] PCQ Rate and Simple Queue - Per IP Shaping Problem

Wed Oct 23, 2019 8:05 am

Also, please note that you will need
/ip settings set allow-fast-path=no
for queuing to work as you expect here.

Who is online

Users browsing this forum: No registered users and 84 guests