What's new

[Release] FreshJR Adaptive QOS (Improvements / Custom Rules / and Inner workings)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Status
Not open for further replies.
You actually forgot the quotes....it should be
Code:
cru a QOS_CHECK "0 0 * * * /jffs/scripts/firewall-start"

Ill change it to the proper syntax. It also worked without the quotes if I escaped each *, but good to remove bad habits. Im new to shell!
 
Ughhh, found another bug!! While applying the same script to another router, the following commands

Code:
DownCeil="$(nvram get qos_ibw)"
UpCeil="$(nvram get qos_obw)"

sometimes returned a floating point value instead of a integer. When that happened the class bandwidth values could not be calculated properly. The new commands should be

Code:
DownCeil="$(printf "%.0f" $(nvram get qos_ibw))"
UpCeil="$(printf "%.0f" $(nvram get qos_obw))"

From now on qos_check.txt will have a version number. Reference the original post, post 1 for the current version, and make sure you are on the same version as it gets updated.
 
Last edited:
Last update! (Hopefully) v1.4

Changed the way script was coded to making defining category bandwidth allocated percents a lot easier, natural, and universal.

You no longer define percents for cat1-cat7, but rather you define percents by catagory name and the script finds out what corresponding class rule to change.

This means if you move around categories via the UI, the class bandwidth will follow!

Next up, it is possible to change the UI of the router webpage to make defining category bandwidth saved and read as a nvram variable from the web interface, but I doubt I will be spending the time to go that far.

Thank you all for sticking with me! its been fun.
 
Is this working only if you have "Adaptive QOS with Manual Bandwidth Settings"? And what about Automatic Bandwidth Settings?
 
Is this working only if you have "Adaptive QOS with Manual Bandwidth Settings"? And what about Automatic Bandwidth Settings?

Run these two commands in ssh and tell me what you get.

nvram get qos_ibw
nvram get qos_obw

If automatic bandwidth sets those values, which I think it does, it should work. Either way, try it and find out.

My internet speeds rarely change so I don't see a point of using automatic. Don't trust it too much either.
 
Is this working only if you have "Adaptive QOS with Manual Bandwidth Settings"? And what about Automatic Bandwidth Settings?

As I checked yes, its only working with manual bandwith settings. If you configured automatic, router sets max bandwith something around 1800 mbit (wow its too high but my ac88u does this) and guaranteed bandwith becomes 128 bit just like without the script.

you can see what your router sets max bandwith when you set automatic bandwith with below commands;

tc class show dev eth0
tc class show dev br0
 
Run these two commands in ssh and tell me what you get.

nvram get qos_ibw
nvram get qos_obw

If automatic bandwidth sets those values, which I think it does, it should work. Either way, try it and find out.

My internet speeds rarely change so I don't see a point of using automatic. Don't trust it too much either.

when I set to automatic, I get 0 for both;

nvram get qos_ibw
nvram get qos_obw

here is a part of "tc class show dev eth0" when automatic

/tmp/home/root# tc class show dev eth0
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:1 root rate 1895Mbit ceil 1895Mbit burst 1249348b cburst 1249348b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 128Kbit ceil 1895Mbit burst 3200b cburst 1249348b

1895 Mbit changes according to my upload/download settings with manual bandwith
 
Then no, it will not work, since currently rate is based off those nvram values.

If that ceil properly changes from 1895Mbit to smaller proper values over time, then I could modify my script to read the current ciel value instead of nvram. Thats a very simple change.

The issue would then be how often to run the script, since we don't know how often ceil would be changing. That is the same reason why we cannot change the subcatagory guaranteed bandwidth's. They are autogenerated and overwritten, so we do not have a permanent way to write out own changes, without them being overwritten later, at least from this approach.

If you do some experimenting, I can change the script for you, but the complexity doesn't seem worth it.
 
Then no, it will not work, since currently rate is based off those nvram values.

If that ceil properly changes from 1895Mbit to smaller proper values over time, then I could modify my script to read the current ciel value instead of nvram. Thats a very simple change.

The issue would then be how often to run the script, since we don't know how often ceil would be changing.

If you do some experimenting, I can change the script for you, but the complexity doesn't seem worthit.

I will use my router for a couple of hours with automatic bandwith settings and let you know if 1895 Mbit changes :)
 
Run these two commands in ssh and tell me what you get.

nvram get qos_ibw
nvram get qos_obw

If automatic bandwidth sets those values, which I think it does, it should work. Either way, try it and find out.

My internet speeds rarely change so I don't see a point of using automatic. Don't trust it too much either.


admin@RT-AC87U:/tmp/home/root# nvram get qos_ibw
0
admin@RT-AC87U:/tmp/home/root# nvram get qos_obw
0
admin@RT-AC87U:/tmp/home/root#

Mhm...
 
I will use my router for a couple of hours with automatic bandwith settings and let you know if 1895 Mbit changes :)

Trying that right now too because I'm curious. xfinity speed test is unclassified data, speedtest.net is web browsing, should be easy to rack up a lot of data.

So far QOS doesn't seem not working at all.
 
Trying that right now too because I'm curious. xfinity speed test is unclassified data, speedtest.net is web browsing, should be easy to rack up a lot of data.

So far QOS doesn't seem not working at all.

Yes, you're right. 15 minutes has already passed. I've started torrent to help my router to get my bandwith but it still 1895 Mbit. It seems nothing will change. It seems, automatic bandwith setting is just an illusion :) I'm setting it back to manual bandwith.
 
Hi all,
qos_ibw=0
qos_obw=0
they mean for "10Gbps" for qos, it's what we setup for "auto" option.

Thanks,
Vanic
 
Guys new QOS definitions are out! Not sure if the router checks automatically, as I have just updated mine manually.

Version 1.142 ---> 1.146

Unfortunately Tmobile/Iphone Wifi Calling is still missing in action, but I noticed other websites get sorting fixes.

I also noticed that after defintions update that the router does not restart the firewall but does indeed reset the QOS rules. If you remember our script, it is trigger only firewall start and daily at midnight.

This means upon update, the custom rules will be wiped until midnight. I will not be modifying the script to listen for this exception, too much work, that is unless we start receiving very frequent updates. Then I'll look into it.
 
Update:

Version 1.146 ---> 1.150

Tmobile Wifi Calling / IOS wifi calling still missing in action.
 
Last edited:
Is it just me or Adaptive QOS doesn't really work? For me, everything is Default. I have uTorrent doing seeding work and download, but everything is in default instead of file transfer. I watch movie on youtube, still default. I browse the web, default. I start WOW, default.... I'm nearly thinking about going back to legacy QOS with rules but I don't wish to do my 300 rules again...
 
Is it just me or Adaptive QOS doesn't really work? For me, everything is Default. I have uTorrent doing seeding work and download, but everything is in default instead of file transfer. I watch movie on youtube, still default. I browse the web, default. I start WOW, default.... I'm nearly thinking about going back to legacy QOS with rules but I don't wish to do my 300 rules again...

Something has to be wrong with either the implementation on your router, or maybe rules are corrupted.

I usually get equal usage in most categories, with Video Streaming being the majority of my usage. Even torrents get identified as file transfers! Keep in mind all numbers are low in this screenshot since I just updated definitions and reset QOS 2 hours ago, but even still, the categorization is working nicely.

What router do you have with what firmware version. Can you do

Code:
 tc filter show dev br0

and paste the output in between [code ] [/code ] tags, no space within barckets. Since honestly, with this script no traffic should be going to "Default" anymore.
 

Attachments

  • qos.png
    qos.png
    52.8 KB · Views: 659
  • qos2.png
    qos2.png
    337.2 KB · Views: 619
Last edited:
I just implemented the scrip on page 1 and now, everything is others instead (so no change in sorting). I do have a small bit in VOIP/Messaging, might be skype. It's also a brand new router I bought 2 weeks ago when my older linksys totally died. I though it was a firmware problem so I flashed merlin, but that didn't solved anything. You can see that everything is into others. Upload is the utorrent, download must be youtube playing video in background combine with minor web browsing I did to the the filter.

Also, I'm using custom rules order instead of one of the predefined set, but I don't recall seeing a difference when using the others.

Code:
filter parent 1: protocol all pref 1 u32
filter parent 1: protocol all pref 1 u32 fh 813: ht divisor 1
filter parent 1: protocol all pref 1 u32 fh 813::800 order 2048 key ht 813 bkt 0 flowid 1:16
  mark 0x80000000 0x8000ffff (success 107822)
filter parent 1: protocol all pref 3 u32
filter parent 1: protocol all pref 3 u32 fh 806: ht divisor 1
filter parent 1: protocol all pref 3 u32 fh 806::800 order 2048 key ht 806 bkt 0 flowid 1:14
  mark 0x80000000 0x803f0000 (success 130)
filter parent 1: protocol all pref 4 u32
filter parent 1: protocol all pref 4 u32 fh 80b: ht divisor 1
filter parent 1: protocol all pref 4 u32 fh 80b::800 order 2048 key ht 80b bkt 0 flowid 1:15
  mark 0x80010000 0x803f0000 (success 0)
filter parent 1: protocol all pref 6 u32
filter parent 1: protocol all pref 6 u32 fh 80c: ht divisor 1
filter parent 1: protocol all pref 6 u32 fh 80c::800 order 2048 key ht 80c bkt 0 flowid 1:15
  mark 0x80030000 0x803f0000 (success 0)
filter parent 1: protocol all pref 7 u32
filter parent 1: protocol all pref 7 u32 fh 803: ht divisor 1
filter parent 1: protocol all pref 7 u32 fh 803::800 order 2048 key ht 803 bkt 0 flowid 1:12
  mark 0x80040000 0x803f0000 (success 0)
filter parent 1: protocol all pref 8 u32
filter parent 1: protocol all pref 8 u32 fh 807: ht divisor 1
filter parent 1: protocol all pref 8 u32 fh 807::800 order 2048 key ht 807 bkt 0 flowid 1:14
  mark 0x80050000 0x803f0000 (success 0)
filter parent 1: protocol all pref 9 u32
filter parent 1: protocol all pref 9 u32 fh 808: ht divisor 1
filter parent 1: protocol all pref 9 u32 fh 808::800 order 2048 key ht 808 bkt 0 flowid 1:14
  mark 0x80060000 0x803f0000 (success 0)
filter parent 1: protocol all pref 10 u32
filter parent 1: protocol all pref 10 u32 fh 80e: ht divisor 1
filter parent 1: protocol all pref 10 u32 fh 80e::800 order 2048 key ht 80e bkt 0 flowid 1:16
  mark 0x80070000 0x803f0000 (success 0)
filter parent 1: protocol all pref 11 u32
filter parent 1: protocol all pref 11 u32 fh 802: ht divisor 1
filter parent 1: protocol all pref 11 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid 1:11
  mark 0x80080000 0x803f0000 (success 0)
filter parent 1: protocol all pref 12 u32
filter parent 1: protocol all pref 12 u32 fh 800: ht divisor 1
filter parent 1: protocol all pref 12 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
  mark 0x80090000 0x803f0000 (success 0)
filter parent 1: protocol all pref 13 u32
filter parent 1: protocol all pref 13 u32 fh 80f: ht divisor 1
filter parent 1: protocol all pref 13 u32 fh 80f::800 order 2048 key ht 80f bkt 0 flowid 1:16
  mark 0x800a0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 14 u32
filter parent 1: protocol all pref 14 u32 fh 810: ht divisor 1
filter parent 1: protocol all pref 14 u32 fh 810::800 order 2048 key ht 810 bkt 0 flowid 1:16
  mark 0x800b0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 16 u32
filter parent 1: protocol all pref 16 u32 fh 804: ht divisor 1
filter parent 1: protocol all pref 16 u32 fh 804::800 order 2048 key ht 804 bkt 0 flowid 1:13
  mark 0x800d0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 17 u32
filter parent 1: protocol all pref 17 u32 fh 80d: ht divisor 1
filter parent 1: protocol all pref 17 u32 fh 80d::800 order 2048 key ht 80d bkt 0 flowid 1:15
  mark 0x800e0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 18 u32
filter parent 1: protocol all pref 18 u32 fh 809: ht divisor 1
filter parent 1: protocol all pref 18 u32 fh 809::800 order 2048 key ht 809 bkt 0 flowid 1:14
  mark 0x800f0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 20 u32
filter parent 1: protocol all pref 20 u32 fh 80a: ht divisor 1
filter parent 1: protocol all pref 20 u32 fh 80a::800 order 2048 key ht 80a bkt 0 flowid 1:14
  mark 0x80110000 0x803f0000 (success 0)
filter parent 1: protocol all pref 23 u32
filter parent 1: protocol all pref 23 u32 fh 801: ht divisor 1
filter parent 1: protocol all pref 23 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10
  mark 0x80140000 0x803f0000 (success 0)
filter parent 1: protocol all pref 24 u32
filter parent 1: protocol all pref 24 u32 fh 811: ht divisor 1
filter parent 1: protocol all pref 24 u32 fh 811::800 order 2048 key ht 811 bkt 0 flowid 1:16
  mark 0x80150000 0x803f0000 (success 0)
filter parent 1: protocol all pref 26 u32
filter parent 1: protocol all pref 26 u32 fh 812: ht divisor 1
filter parent 1: protocol all pref 26 u32 fh 812::800 order 2048 key ht 812 bkt 0 flowid 1:16
  mark 0x80170000 0x803f0000 (success 0)
filter parent 1: protocol all pref 27 u32
filter parent 1: protocol all pref 27 u32 fh 805: ht divisor 1
filter parent 1: protocol all pref 27 u32 fh 805::800 order 2048 key ht 805 bkt 0 flowid 1:13
  mark 0x80180000 0x803f0000 (success 0)
 

Attachments

  • qos.jpg
    qos.jpg
    74.8 KB · Views: 574
Also, I'm using custom rules order instead of one of the predefined set, but I don't recall seeing a difference when using the others.

Your rule output is correct. Seems like QOS packet tagging was broken before the script was applied and remained broken after the modifications were applied.

You are having the same issue as user Sar Mange in post #18 in this thread. Your QOS sorting is not tagging the packets correctly, since all packets go to Default and my script just routes all defaults into others.

One possible reason: Do you possibly have a VPN active on the computer? If you do, then your VPN is encrypting all traffic so the router picks up everything as unclassified since it cannot tell the contents of the packets or even see the destination server beyond the VPN.

If that's not the issue: Does anyone else have a Asus AC-3100 that can check if their QOS works. If it does, anyone have an Asus AC-3100 on merlin 380.65_2. That's what I saw in the screenshot.

Also for my script it doesn't matter if you use custom classifications or one of the predefined sets. The only requirements are adaptive QOS is on with manual bandwidth limits defined.
 
Last edited:
I don't have any VPN. I do have encryption enable on uTorrent but that's it.

I'm on Asus RT-AC3100, Firmware 380.65_2. I do had this problem with stock Asus Firmware too. I tried updating the definition, which is at 1.150 right now, changed nothing.

I tried changing some of the feature on/off, like apps analysis, aiprotection, I disabled NAt Acceleration (was messing port forwarding) and Bonding/Link aggregation (spanning-tree protocol is enable), I disabled firewall (was killing port forwarding), I activated all AI protection (no change if disabled)...
 
Status
Not open for further replies.

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top