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.
Are these instructions considered "good" for a stock install?

Yes they should be.
The compatible version is listed as v3 in the filename now (the quoted post had v1 in the file name). That's the only minor change.

The error message after his uninstall/reinstall procedure has been fixed.

Report back if any errors occur during the installation procedure.

Ok but I added the following since I have xbox and ps 192.168.2.9 and 192.168.2.8


Then i'll turn off QOS
upload the file
rename it via mobxterm
then run the dos2unix /jffs/scripts/FreshJR_QOS
then /jffs/scripts/FreshJR_QOS -install
then turn on QOS

Right?
[/INDENT]

192.168.2.8/31 includes 192.168.2.8 - 192.168.2.9.
You can check it with the CIDR calculator.
This was covered within the first posts.

Yes the install instructions should be fine.
 
Last edited:
Yes they should be.
The compatible version is listed a v3 now (the quoted post had v1 in the file name). That's the only minor change.

The error message after his uninstall/reinstall procedure has been fixed.

Report back if any errors occur during the installation procedure.



192.168.2.8/31 includes 192.168.2.8 - 192.168.2.9.
You can check it with the CIDR calculator.
This was covered within the first posts.

Yes the install instructions should be fine.
I got it , i ued the calculator and found out that only by adding one line 192.168.2.8/31 will add both 192.168.2.8 and 192.168.2.9
 
All working fine now, but say i want all downloads.com go to File Transfer instead of Web Surfing, how to do that?
 
All working fine now, but say i want all downloads.com go to File Transfer instead of Web Surfing, how to do that?

Custom rule encompassing the entire downloads.com server range.

The range is not continuous, so I would expand the range and get some overlap instead of adding 11 individual rules.

With this approach you still have to hope your ISP doesn’t use an encrypted caching server for download content since the custom filtered iprange would not match if you would be getting downloads from a local CDN cache server
 
Last edited:
Custom rule encompassing the entire downloads.com server range.

The range is not continuous, so I would expand the range and get some overlap instead of adding 15 individual rules.

With this approach you still have to hope your ISP doesn’t use an encrypted caching server for download content since the custom rule iprange would not match when getting downloads from a local CDN cache server


I understand half of what you said, but can you give me a sample / rule to do that in the file?
 
There is already a sample rule template that filters WAN server ip addresses via CIDR notation.

Filtering by simply adding a downloads.com keyword into the script is not possible if that is what you are asking.

This keyword method should technically be possible to implement via the framework we have at our disposal but it is not a priority for me nor something I am considering spending any time looking into since I am happy with the present state of performance.
 
Last edited:
There is already sample rule template that filters WAN server ip addresses via CIDR notation.

Filtering by simply adding a downloads.com keyword into the script is not possible if that is what you are asking.

This keyword method should technically be possible to implement via the framework we at our disposal but it is not a priority for me nor something I am considering spending any time looking into since I am happy with the present state of performance.

So I should look into finding the IP of downloads.com and use that CIDR notation to add it? can you give me one example please?
 
So I should look into finding the IP of downloads.com and use that CIDR notation to add it? can you give me one example please?

The link I gave you listed ALL registered IP addresses of downloads.com via CIDR notation. (They have a few thousand addresses consolidated into 11 CIDR ranges)

What I have been further saying is that even with 11 rules encompassing all 11 ranges owned by downloads.com, your actual download traffic might be coming from mirror hosted by your local ISP AND NOT “downloads.com” servers.

Your local ISP mirror, called a CDN, wouldnt be included in those 11 filtering ranges. CDNs are used by ISPs to decrease the amount of traffic flowing from outside their networks to decrease network interconnect bottlenecks.

It’s up to you to learn the remainder. When I found deficiencies with QOS for my personal setup, I learned all supporting information via Google & YouTube and figured out how it works and how to make it work. I have no networking certification so it is possible without being spoonfed.
 
Last edited:
The link I gave you listed ALL registered IP addresses of downloads.com via CIDR notation. (They have a few thousand addresses consolidated into 11 CIDR ranges)

What I have been further saying is that even with 11 rules encompassing all 11 ranges owned by downloads.com, your actual download traffic might be coming from mirror hosted by your local ISP instead of “downloads.com” servers.

Your local ISP mirror, called a CDN, wouldnt be included in those 11 ranges. CDNs are used by ISPs to decrease the amount of traffic flowing in from outside their networks to decrease their bottlenecks.
Thanks, but which link?
 
This reminds me of support at my previous employment when there was always 1 customer who was a total pita. 99% of support resources went into supporting this 1 customer.
 
Last edited:
Seems to have worked. Thank you!
Code:
Jun  1 07:12:00 adaptive QOS: Delayed Start Triggered (5min)
Jun  1 07:17:01 adaptive QOS: Applying - Down Rules
Jun  1 07:17:01 adaptive QOS: Applying --- Up Rules
Jun  1 07:17:01 adaptive QOS: Modifying Class Rates
Jun  1 07:17:01 kernel: HTB: quantum of class 10015 is big. Consider r2q change.
 
Any idea what "PS4 Remote Play" is categorized at in the script?

Start a session and look for large amounts of uploads traffic via app analysis or QOS statistics.

If you find it in an undesired category then at least it uses a unique set of ports which you can easily prepare a rule for.

Remote play
UDP 9296, UDP 9297, UDP 9303

Note: this only applies to an remote play session over the internet.

A remote play session between two local (LAN) devices is not affected since QOS is only for internet traffic.
 
Last edited:
Script for users with non typical internet connections

This post is a release intended for users with non typical internet connections.

A majority of QOS users have "eth0" as their interface. The "eth0" interface works with the original scripts as intended.
It has been found that for non "eth0" interfaces, SOME custom rules in the QOS script are not working as intended.

PoPPE connection may have "ppp0" as their interface.
Fiber connections may have "vlanXXX" as their interface.

These different interfaces leave some script custom rules partially broken.
For users, with non typical interfaces, feel free to TRY using this alternate script.

--

A quick way to check your WAN interface is to launch QOS and then look at system log.
Keep an eye out for this line. **Only appears on RMerlin firmware.

Code:
custom_script: Running /jffs/scripts/firewall-start (args: eth0)

As you can see, on my computer I am using eth0

Stock users need to manually consult iptables to find their WAN interface as the above line will not be present in your system log.

Stock users could potentiality try this command after QOS is up and running running and see if it will correctly identify and return your interface name:

Code:
iptables -vL -t mangle | grep "BWDPI_FILTER  " |  awk '{print $6}'

If the interface is found NOT to be eth0, then this alternate version is recommended instead of the compatible version in the first post.

To use the alternate version with stock firmware, the WAN interface, found from the previous step, will need to be manually defined within the script via a commented out variable located towards the top the script, immediately after the start of the "iptable_up_rules" section.

** To be clear, this section does not apply to RMerlin Users as WAN interface identification will happen automatically for RMerlin users. **

Script for users with non typical internet connections
(users with non "eth0" interfaces)

Changes:
--Implemented custom rules a different way since some TC rules have been found not functioning as intended for non "eth0" interfaces
--Added ability to pass a multi-word query to appdb function instead of being limited to a single word
--Changed wording in template comments hopefully reducing questions as to why custom port rules are not working

Note: This release uses a different firewall-start entry.

You will have to fully uninstall any previous version of the script, and then fresh install this one.


** IF IT HASN'T BEEN CLEAR, ONCE AGAIN THIS IS INTENDED FOR USERS WITH NON eth0 INTERFACES **
 

Attachments

  • FreshJR_QOS_v5_ALTERNATIVE_WAN_INTERFACE.txt
    40.2 KB · Views: 548
Last edited:
This post is a BETA release intended for users with non typical internet connections.

A majority of QOS users have "eth0" as their interface. This interface works with the original scripts as intended.
It has been found that for any non "eth0" interface SOME custom rules in the QOS script are not working as intended.

PoPPE connection may have "ppp0" as their interface.
Fiber connections may have "vlanXXX" as their interface.

These different interfaces leave some script custom rules partially broken. For users, with non typical interfaces, feel free to TRY using this alternate approach.

Note: This release, uses the COMPATIBLE version of the script as a base. If you are coming from the fast version of the script, you will need to uninstall it before installing this one

--

A quick way to check what interface your internet connections is using is to launch QOS and then look at system log.
You should keep an eye out for this line.

Code:
custom_script: Running /jffs/scripts/firewall-start (args: eth0)

As you can see, on my computer I am using eth0



Script (BETA) for users with non typical internet connections
(users with non "eth0" interfaces)

Changes:
--Implemented custom rules a different way since some TC rules have been found not functioning as intended for non "eth0" interfaces
--Added ability to pass a multi-word query to appdb function instead of being limited to a single word
--Changed wording in template comments hopefully reducing questions as to why custom port rules are not working

For installation, treat as if this was the compatible version with a different name.

This script should work, but as always, report any bugs.

** IF IT HASN'T BEEN CLEAR, THIS IS INTENDED FOR USERS WITH NON eth0 INTERFACES **

--

I would also appreciate if users with non "eth0" interfaces could check if this command

Code:
nvram get wan0_ifname

matches your non "eth0" interface.
Is this just for the iptables or the tc bits too? FYI DSL is not "non-typical" for an Internet connection :)

You need to check based on:
Code:
nvram get wan0_proto
 
Last edited:
Is this just for the iptables or the tc bits too? FYI DSL is not "non-typical" for an Internet connection :)

I know dsl is primarily pppo. ;)
I was just trying to use easier keywords rather than non eth0 interfaces.

Custom TC rules that are ONLY dealing with marks will work regardless of any interface.
Anything that deals with IP’s or port’s for non eth0 connections **might** need to be implemented via iptables.

As uploaded, all the default rules in the alternate version should work.

You need to check based on:
Code:
nvram get wan0_proto

Id rather not have two sets of rules in one script that users will both have to setup.

I’ll just leave it as two separate scripts without the check.

Since your wireless script works in this area, do you know if wan0_ifname the correct value to query?

Keep in mind the script not working on non eth0 are generalizations based on bug reports.
I am not in a position to test this first hand.
 
Last edited:
I know dsl is primarily pppo. ;)
I was just trying to use easier keywords rather than non eth0 interfaces.

Custom TC rules that ONLY deal with marks will work.
Anything that deals with IP’s or port’s for non eth0 connections needs to be implemented via iptables.

As uploaded, all the default rules should work.

Code:
You need to check based on: [CODE]nvram get wan0_proto

Id rather not have two sets of rules in one script that users both have to setup.

I’ll just leave it as two separate scripts without the check.

Since your script works in this area, is wan0_ifname the correct value to query?
Output of wan0_ifname on my DSL reports eth0 still.

TC on down with ports seems to be OK, but thats perhaps because I'm working on sport rather than dport?

Code:
${tc} filter add dev br0 protocol all prio $1 u32 match ip sport 563 0xffff flowid ${Downloads}

I think I spotted that TC on upload didnt work so I resorted to iptables. I was lazy and didn't specify an out interface, figured setting a mark wouldn't hurt if it wasn't WAN destined (correct me if that's wrong!)

Code:
iptables -t mangle $ACTION POSTROUTING -p tcp --dport 563 -j MARK --set-mark ${Downloads_mark} 2>/dev/null
 
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