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.
Last edited:
Sorry if its been alluded to but how can i enforce a hard cap on bandwidth for a device? Basically I don't want any devices apart from my gaming machine to get more than 15mb/s dl, including the TV, the script seems to work well most of the time but the TV is causing my latency to spike even though my pc is specified as the gaming device my qos bandwidth is set to 60/10 on a 79/19 line and I get A+ bufferbloat etc
 
Hi thanks for this. Just wondering if the extra gaming settings are required for console only or the PC I game with also?
 
Your (Asus) QOS saved settings were lost during the update.

It wasn’t anything caused by the script as I maintain default behavior .

The funny part was I thought when I upgraded my RT-AX88U to V384.10 Beta1, I was expecting your FreshJR QOS Classification Page to be overwritten with the ASUS Merlin classification page (and I expected to possibly have to run a re-install, or an -update), in order to get it back up and running, but it was still there after the firmware upgrade and reboot (Maybe Merlin added code to test for your FreshJR QOS Classification Page, and if so, to leave it)?

Just an FYI for others potentially when upgrading firmware.
 
@FreshJR , check out this commit. It provides a smoother first load here (tested with around 275 connections), as the browser won't be retrieving and sorting the data through Ajax while it's already doing so from the initial page load.

I also tried to separate pie chart from conntrack table, but the Chart animation was horribly jerky as the browser was trying to sort the conntrack data at the same time.

I also did some optimizations to the Table sort code, tho you're no longer using that. Sorting should be a tad faster now.
 
Sorry if its been alluded to but how can i enforce a hard cap on bandwidth for a device? Basically I don't want any devices apart from my gaming machine to get more than 15mb/s dl, including the TV, the script seems to work well most of the time but the TV is causing my latency to spike even though my pc is specified as the gaming device my qos bandwidth is set to 60/10 on a 79/19 line and I get A+ bufferbloat etc

At the moment, the only way you can do it is to put all the devices you want to give a bandwidth limit in one of the QoS categories. Here's how you can do it. Let's say you have 8 devices that you want to bandwidth limit.

1. Give those devices a static IP. Make sure the IP addresses you give are covered inside a CIDR range. For example, 192.168.1.32/29 gives you IPs from 192.168.1.32 to 192.168.1.39.

2. Inside the router, go to: Adaptive QoS > Classification. Click on "FreshJR Mod (Customize)" and add this "192.168.1.32/29" under Local IP/CIDR. Set the class to Game Downloads.

3. Now, we want to make Game Downloads take a maximum of whatever you want. Under "Download Bandwidth", set the % of your download bandwidth you don't want this category to exceed.

4. Apply and wait 5 minutes.

Note that if you do this, none of the devices with IPs from 192.168.1.32 to 192.168.1.39 will enjoy the benefits of adaptive QoS, but they will be bandwidth limited.
 
@FreshJR , check out this commit. It provides a smoother first load here (tested with around 275 connections), as the browser won't be retrieving and sorting the data through Ajax while it's already doing so from the initial page load.

I also tried to separate pie chart from conntrack table, but the Chart animation was horribly jerky as the browser was trying to sort the conntrack data at the same time.

I also did some optimizations to the Table sort code, tho you're no longer using that. Sorting should be a tad faster now.

Hi @RMerlin,

I already caught that the table was generated twice on initial load. I already had that line removed from my variant of the Qos_Stats page.

Code:
    get_data();
    //draw_conntrack_table();  get_data() already draws table

Its was not the sort functions from the tableApi that were the culprit for slow and non-responsive load times.
It is the generation of the table html code with the use of jquery calls.

I did the following testing done with ~500 connections.

With the string concatenate method, I generated the table in ~30-50ms.
When I used a more optimized jquery approach I hit 150ms.
With Asus' tableApi's jquery method, it always ended up being 300-500ms for generation.
That was really terrible in terms of responsiveness and CPU intensity.​

I choose my concat method. Its so fast there is no reason to worry about performance.
I am actually sorting+redrawing the entire table + the pie charts anytime a user selects a device from the device filter.
There is zero choppiness, even on mobile devices, and you can scroll through the devices with your keyboard arrow keys as fast as you please.

I only limited the table to 500 entries was to eliminate a very long scrollbar and not due to performance issues. You can easily crank that sucker up without worry.

I can whip up the QoS_Stats with my table generation approach and non of the others stuff I ended up including, BUT only if you are interested in using it.
I don't want to waste my time if you are not interested.


So give my page a shot and see for yourself. I did retain the sort features of Asus' tableApi.

--

I simply used java's built-in sort(), both string and integer variants.
The sorting of the table for all purposes can be considered instant.

I am actually sorting the tabledata TWICE and the double sort takes less than ~3ms for a multicolumn sort.

The only sort that is a negligibly slower (~5ms) is the ip column sort since I end up expanding all the ip addresses using the full_IPv6() function before performing the string sort. I do think that was the wrong area to optimize for performance gains.

--

I can also optimize the string sorts I am using, but I already consider my approach to the process very efficient, so I am not going to bother.
 
Last edited:
Sorry if its been alluded to but how can i enforce a hard cap on bandwidth for a device? Basically I don't want any devices apart from my gaming machine to get more than 15mb/s dl, including the TV, the script seems to work well most of the time but the TV is causing my latency to spike even though my pc is specified as the gaming device my qos bandwidth is set to 60/10 on a 79/19 line and I get A+ bufferbloat etc

Your issue most likely either the tv once it starts downloading is spiking over total bandwidth over your qos cap initially for miliseconds until qos can equalize it which is normal. You reduce your limits slightly to combat that.

Or its another issue ive read about. Some tvs have flaky wireless cards or drivers and upon initially connecting to the network more or less freeze the entire network for a sec or two. All you can do here is keep the tv updated and hope it stops that im aware of.
 
Your issue most likely either the tv once it starts downloading is spiking over total bandwidth over your qos cap initially for miliseconds until qos can equalize it which is normal. You reduce your limits slightly to combat that.

Or its another issue ive read about. Some tvs have flaky wireless cards or drivers and upon initially connecting to the network more or less freeze the entire network for a sec or two. All you can do here is keep the tv updated and hope it stops that im aware of.

Or bursts can be lowered for the streaming, file downloads, & game downloads category by manually modifying the script.
I am thinking about including this as a future toggle in the UI but I am currently busy.

For the time being I can supply an alternative curl link with VERY low bursts (hardcoded) for for users that are have this problem if they are interested in performing A/B testing.
 
Last edited:
Give my page a shot and see for yourself. I did retain the features of Asus' tableApi.

The primary reason I use the Table API is for sorting capabilities - takes me only minutes to develop the code that handles rendering + sorting, while doing so manually back when I implemented IPTraffic was a huge PITA, with my spare time usually better spent in other areas. I haven't checked your implementation yet because at the time you mentioned sorting still required implementing. I'll take a look in the coming days, will see if it now suits my needs, and if I can insert it within the current beta cycle.

The IP sort code probably benefited a good bit from the recent optimization I made, as it was requiring every single IP string to go through an upperstr() call. That means 2 calls per compares, and a few hundred compares (if not thousands) total as data gets sorted.
 
I haven't checked your implementation yet because at the time you mentioned sorting still required implementing.

Haha I did say that, but I held off the initial release until I had everything implemented.

All of these .X releases in the last two days mostly were minor bug fixes and user requested features.

The IP sort code probably benefited a good bit from the recent optimization I made, as it was requiring every single IP string to go through an upperstr() call. That means 2 calls per compares, and a few hundred compares (if not thousands) total as data gets sorted.

Nice, I will have to take a look at it, since that is the ONLY one I used. I saw its performance impact negligible at 500 connections.

My sort approach does NOT sort the entire bwdpi_conntack list.
It only sorts whatever will be shown to the user so it's capped at 500 possible entries vs however large the connections table data could get.

Also you can stick the modded qos_stats page over the existing one without installing the script.

(It will function fine, just don't press the apply as that will set two nvram variables. The page and script and completely decoupled sans sharing two nvram variables)
 
Last edited:
At the moment, the only way you can do it is to put all the devices you want to give a bandwidth limit in one of the QoS categories. Here's how you can do it. Let's say you have 8 devices that you want to bandwidth limit.

1. Give those devices a static IP. Make sure the IP addresses you give are covered inside a CIDR range. For example, 192.168.1.32/29 gives you IPs from 192.168.1.32 to 192.168.1.39.

2. Inside the router, go to: Adaptive QoS > Classification. Click on "FreshJR Mod (Customize)" and add this "192.168.1.32/29" under Local IP/CIDR. Set the class to Game Downloads.

3. Now, we want to make Game Downloads take a maximum of whatever you want. Under "Download Bandwidth", set the % of your download bandwidth you don't want this category to exceed.

4. Apply and wait 5 minutes.

Note that if you do this, none of the devices with IPs from 192.168.1.32 to 192.168.1.39 will enjoy the benefits of adaptive QoS, but they will be bandwidth limited.
Thanks, I'll try to set up every device with a static IP and see if it helps
 
I use an Aruba 203R AP (for work) connected to my router and it appears that when I reboot the router it will stop calculating the data for the Aruba. If I manually unplug/plug in the Aruba after the 5 minute wait it will begin calculating correctly again. Normally, I don't mind doing this but, apparently, it sends a signal to my work when is loses power, so I try not to unplug it a lot. If I run the router without the script installed it works correctly all the time but I don't what to do that because I use the script mainly to keep the Aruba QOS high. Is there any way to get around or fix this?
 
I use an Aruba 203R AP (for work) connected to my router and it appears that when I reboot the router it will stop calculating the data for the Aruba. If I manually unplug/plug in the Aruba after the 5 minute wait it will begin calculating correctly again. Normally, I don't mind doing this but, apparently, it sends a signal to my work when is loses power, so I try not to unplug it a lot. If I run the router without the script installed it works correctly all the time but I don't what to do that because I use the script mainly to keep the Aruba QOS high. Is there any way to get around or fix this?

What will be fixed.

Game Traffic & Untracked traffic connections opened during the 5 minute wait will NOT have chance to become white listed anymore.​

What issues will remain.

Any connections opened during the initial 5 minute wait expecting to get a redirection from an AppDB rules, will go into original Asus QoS categories instead.

This will occur until that particular connection is closed and reopened. Of course anything opened after the 5minute wait will work as you expect it too.

This has always been happening since the first script was released. New structure changes will come so that a whitelisted blackhole isn’t possible.
Will this be an issue?

Generally no as as most connections are not opened indefinitely. Just think of it as a quirk that will settle down once everything is running for a while and all the original connections are closed or reset.

If you are expecting important during the 5 minute then you can use the IPv4 rule table for it to reach your custom destination (even if open during the 5 minue wait).

This happens since iptable rule get modified marks before the TC structure even starts to setup.​

@tmcb82 you can create an ipv4 rule for your box until the fix is released.
 
Last edited:
@tmcb82 you can create an ipv4 rule for your box until the fix is released.
That's the thing I'm already using a ipv4 rule to route all traffic from the Aruba's local ip to the VOIP category but I still have to unplug it after the 5 minute wait to get it to register correctly.
 
That's the thing I'm already using a ipv4 rule to route all traffic from the Aruba's local ip to the VOIP category but I still have to unplug it after the 5 minute wait to get it to register correctly.

Does it not register at all or does it go into the wrong category ?
 
Does it not register at all or does it go into the wrong category ?
I'm not 100% sure. The Aruba doesn't register any tracked connections until unplugged but it does show data use in traffic analyzer. I feel like it may have been going into "Others" but I can't say for sure.
 
Status
Not open for further replies.

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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