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.
Script Update Released

Changes:
- Changed VoIP rule parameters to now support Android + Embedded devices VoIP
Previous rule was only tested against iOS wifi calling.
Users reported that rule not working well with Android/Embedded devices.
- Changed port 80/443 "Gaming" traffic destination to "Defaults" instead of "Downloads"
Users reported that "Download" traffic had a chance to drown out authentication protocols on 80/443
Now gaming port 80/443 has it's own category with a guaranteed bandwidth, so this will not happen again.
- Bumped "Defaults" traffic priority up a notch. Decreased user defined "Bottom WebUI" Category down a notch.
Eg. If "Downloads" is the user defined bottom category then now "Defaults" will have priority over "Downloads". (The bottom two classes essentially had their priority swapped).
This will allow gaming 80/443 download traffic, to get excess bandwidth before "Downloads" given that "Downloads" is the last defined category in WebUI.
- Introduced "-stock_install" function in the compatible version allowing the script to be installed on official AsusWRT
The install process is a hacky workaround that will require a USB drive to remain in the router 24/7
Basically the stock firmware also has "post_mount" script trigger.
I used that "post_mount" script trigger, in conjuction with CRON, to have the script persistent throughout reboots & definitions updates.
** Note: This is not officially supported, so enjoy it while it works. **
** Do not use -install on stock firmware!! **
- Added "-appdb" function to script, so getting the parameters to perform a traffic destination redirection based on an AppAnalysis name is easier
eg. /jffs/scripts/FreshJR_QOS appdb "iTunes"
- Version numbering scheme has changed.... again
--

Still updated the first posts. Not much else has changed, will be ready within the hour.
 
Last edited:
Also a new update for gaming rules is coming. Currently the gaming rules direct 80/443 traffic into downloads.

Users have reported that actual download traffic is drowning out port 80/443 gaming traffic.

Going forward, the default configuration will be to place 80/443 gaming traffic "Defaults" category. (This is the non WebUI adjustable category that is locked in the bottom place.)
This will allow gaming port 80/443 traffic to have it's own guaranteed traffic allotment making it so file downloads, torrent, etc will not drown it out anymore.
(This is necessary since log-in + matchmaking also operates on these ports in addition to the bulky game updates, This traffic was being heavily drown out by downloads leading to a poor experience logging in/matchmaking )

I will also move the priority of "Defaults" up one position. This means that if you last traffic category in WebUI is "Downloads", then the actual QOS traffic priority will be "Defaults" and then "Downloads".

I am a little busy right now, but the update will come soon.

@FreshJR with the new update you mentioned, i havent had issues with online gaming..wld u recommend we update to your new release for those using it for gaming as priority with current script? Thanks

Update: the new scripts will be added on pg. 1 correct?
 
Last edited:
Thank you FreshJR for your great work! I have been using your script since it was beta 3 and I have to say that it has been fantastic, with VoIP calls show much fewer lag.
However, when reviewing your updated information on page 1:

Screenshot-2018-5-8 [Release] FreshJR Adaptive QOS.png


may I have two questions?
- I am using Internet mostly for VoIP, Web surfing, watching online videos and sometimes file transfering. Therefore, can I change your suggested order to:
VoIP
Web Surfing
Video and Audio Streaming
Gaming
Others
File transfers
- Is my bandwidth adjustment in your script correct for my Internet usage?

FreshJR_QOS.jpg



Thank you, FreshJR :)
 
The recommended traffic setup is ordered by ping sensitivity.

Instead of increasing the priority of video streaming so your videos get excess bandwidth, I would keep the recommended order and instead guarantee a higher bandwidth percent for video streaming.

This can be done by decreasing "others" & "gaming" bandwidths down to the minimum of 5% (since you do not plan on using them), after that roll the extra available bandwidth into video streaming.

I prefer to have traffic sorted from in order of bufferbloat sensitivity so even if you have some traffic in ping sensitive categories it will work as expected. Just a personal preference of mine.

I only recommended videos high up for very slow connections (less than 5mbps). Give it a shot. If it doesn't work, then revert back to your working setup and submit that as feedback in this thread.
 
Last edited:
@FreshJR - I didn't install the scripts for the first time until 7p EDT on 5/7. Did I luck out and install the new scripts? Also - I installed the fast scripts. If they are working, which they are, is there any benefit to switching over to the compatible version?

Thanks for all of your work! You took my buffer bloat from an D/F to a consistent A!!
 
@FreshJR - I didn't install the scripts for the first time until 7p EDT on 5/7. Did I luck out and install the new scripts?

While I think the new scripts were present in the first post at that time, I do not think the install instructions in the second post had the file names for the pscp upload steps updated to reflect the changes at that time.

If you had to modify the pscp upload commands to get it installed, I think you have the newest version.

Either way, a reupload is two commands away. It should take under a minute since you have all the tools already.

Also - I installed the fast scripts. If they are working, which they are, is there any benefit to switching over to the compatible version?

No, they both have the same exact performance. The compatible version is more for people on legacy firmware or people who want a more stable script in theory.

I haven't had stability issues with the fast version and haven't received any reports of instability either. ( I personally run the fast version but support both )
 
I must be missing something, I installed this last week - all went in good with some fine instructions on Page 1.
Today I am trying to 'update' it to this new version '1'.

I did this :
Downloaded the two 'new' files to C:\Users\Vaise\Downloads\
pscp -scp C:\Users\Vaise\Downloads\FreshJR_QOS_fast_v1.txt admin@192.168.1.1:/jffs/scripts/FreshJR_QOS
pscp -scp C:\Users\Vaise\Downloads\FreshJR_QOS_fast_v1_fakeTC.txt admin@192.168.1.1:/jffs/scripts/FreshJR_QOS_fakeT
Use router admin to TURN OFF QOS
dos2unix /jffs/scripts/FreshJR_QOS_fast_v1
dos2unix /jffs/scripts/FreshJR_QOS_fast_v1_fakeTC

all the above commands worked fine.

Then I did this :

sh /jffs/scripts/FreshJR_QOS -install

and I get :

Option "-install" is unknown, try "tc -help".

Is this because it is already 'installed' ?
What am I missing ? if anything ?
 
pscp -scp C:\Users\Vaise\Downloads\FreshJR_QOS_fast_v1_fakeTC.txt admin@192.168.1.1:/jffs/scripts/FreshJR_QOS_fakeT
dos2unix /jffs/scripts/FreshJR_QOS_fast_v1
dos2unix /jffs/scripts/FreshJR_QOS_fast_v1_fakeTC

missing C at the end of that line
dos2unix commands should be
dos2unix /jffs/scripts/FreshJR_QOS
dos2unix /jffs/scripts/FreshJR_QOS_fakeTC

--

More importantly, I think you reversed the files while uploading. (aka different from what you wrote above)

Eg.

Uploaded FreshJR_QOS_fast_v1_fakeTC.txt as FreshJR_QOS

&&

Upload FreshJR_QOS_fast_v1.txt as FreshJR_QOS_fakeTC

---

Is this because it is already 'installed' ?
What am I missing ? if anything ?

no that's not it, make the corrections and try again. There were quite a few mistakes made!

--

Instructions on page1 are correct and in the same spot.
 
Last edited:
ah - the old copy/paste error.
Done that now.
Am I correct that QOS gets turned on again AFTER the -install

(as it comes up and says) :

FreshJR QOS was successfully installed
(Adaptive QOS is turned OFF in router UI)
 
and one more thing - you say it is best to use fq_codel.
What should WAN packet overhead be set to then ? select Preset: say 0
 
and one more thing - you say it is best to use fq_codel.
What should WAN packet overhead be set to then ? select Preset: say 0

There can only be one correct value but it is hard to determine what your ISP is actually is using since no one made a tool.

This setting was important when many small packets could saturate your bandwidth link.

Since most traffic now a days is bandwidth heavy, setting this variable correctly isn't too critical. This is because the sum of small packets, even if your ISP has overheads above the norm, will ultimately be a tiny fraction of your total bandwidth usuage compared to full size packets.

You are safe using the templates values. I prefer use the template and over estimate, even if my had a ISP tiny overhead, rather than assume a value of zero.

The main advantages of fq-codel are not defined by the variable. Don't sweat it.
 
Last edited:
The recommended traffic setup is ordered by ping sensitivity.

Instead of increasing the priority of video streaming so your videos get excess bandwidth, I would keep the recommended order and instead guarantee a higher bandwidth percent for video streaming.

This can be done by decreasing "others" & "gaming" bandwidths down to the minimum of 5% (since you do not plan on using them), after that roll the extra available bandwidth into video streaming.

I prefer to have traffic sorted from in order of bufferbloat sensitivity so even if you have some traffic in ping sensitive categories it will work as expected. Just a personal preference of mine.

I only recommended videos high up for very slow connections (less than 5mbps). Give it a shot. If it doesn't work, then revert back to your working setup and submit that as feedback in this thread.

Thank you for your fast reply! I will try your suggestion to see if there is anything different from my previous settings :)
 
Hi FreshJR. On this recent release, I noticed the custom_up_rules() and custom_down_rules() for ${VOIP} look reversed in terms of destination/source ports.
For download, your previous release had matching ports 500, 4500 and 16384 all on dport.
The new release has 500,4500 on sport and 16384 on dport.
For upload, the new one has the ports reversed. For the older release, they were all sport.

The reason I ask is that I am attempting to setup similar rules for Skype for Business.
S4B uses TCP 443, UDP 3478-3481 and TCP/UDP 50,000-59,999
 
Sorry if this has already been asked, I browsed through the last 20 pages but I couldn’t find any info on it. Is using device priorities still recommended against?
 
Not quite sure what I'm doing wrong. I'm very sure the script is installed correctly, but I'm getting a consistent bufferbloat score of D or F.

My Settings:
Adaptive QOS
Manual Setting
fq_codel
WAN packet overhead = 0
Upload = 5
Download = 60
I selected "CUSTOMIZE" and am using the order from page 1 of this thread.

My internet is capped @ 60 down and 5 up. I consistently get speeds of 10% over those limits, so I left alone.
I've even tried lowering the upload value to 1, but still get high bufferbloat.


FWIW, I also get high bufferbloat with QOS disabled. If I change to traditional QOS (with all preset values) I get a bufferbloat score of A or A+.
 
Hi FreshJR. On this recent release, I noticed the custom_up_rules() and custom_down_rules() for ${VOIP} look reversed in terms of destination/source ports.
For download, your previous release had matching ports 500, 4500 and 16384 all on dport.
The new release has 500,4500 on sport and 16384 on dport.
For upload, the new one has the ports reversed. For the older release, they were all sport.

The reason I ask is that I am attempting to setup similar rules for Skype for Business.
S4B uses TCP 443, UDP 3478-3481 and TCP/UDP 50,000-59,999

I have had a go ... at creating a new rule for S4B... at least the first part.
I added the following line... using the PORT=3478, with a mask of 0xFFFC (e.g. 4 ports, giving the range 3478-3481)
though to be honest, I have not seen a change in the Traffic Classification Statistics page.

Code:
realtc filter add dev br0 protocol all prio $1 u32 match ip sport 3478 0xfffc flowid ${VOIP}

I am guessing that Port 443 is captured by "Web Surfing" at the moment, which is a lower priority in my case


*EDIT*
just realised I had only added a custom rule for DOWN. just added an equivalent (changed sport to dport) to cover the UPLOAD priority. now for some testing
 
I have had a go ... at creating a new rule for S4B... at least the first part.
I added the following line... using the PORT=3478, with a mask of 0xFFFC (e.g. 4 ports, giving the range 3478-3481)
though to be honest, I have not seen a change in the Traffic Classification Statistics page.

Code:
realtc filter add dev br0 protocol all prio $1 u32 match ip sport 3478 0xfffc flowid ${VOIP}

I am guessing that Port 443 is captured by "Web Surfing" at the moment, which is a lower priority in my case


*EDIT*
just realised I had only added a custom rule for DOWN. just added an equivalent (changed sport to dport) to cover the UPLOAD priority. now for some testing

Good luck, let me know how it goes. I had been using:

Port 443, 3478-3481 and 50000-58192 (2 entries of 4K using mask 0xf000 for each). I did see classification changing.

What has confused me is that FreshJR, in the new version has changed dport/sport for the VOIP rules in the custom rules section.
For the down rules, he had used dport for all the VOIP rules. For the up rules he had used sport. As a result, I did the same.

In the new version posted a day or two ago, down rules now uses sport for 500 and 4500 and dport for the 16384 range. For the up rules these are reversed (as one would expect ;-)

At this point, I will wait for FreshJR to point me in the right direction!
 
Good luck, let me know how it goes. I had been using:

Port 443, 3478-3481 and 50000-58192 (2 entries of 4K using mask 0xf000 for each). I did see classification changing.

What has confused me is that FreshJR, in the new version has changed dport/sport for the VOIP rules in the custom rules section.
For the down rules, he had used dport for all the VOIP rules. For the up rules he had used sport. As a result, I did the same.

In the new version posted a day or two ago, down rules now uses sport for 500 and 4500 and dport for the 16384 range. For the up rules these are reversed (as one would expect ;-)

At this point, I will wait for FreshJR to point me in the right direction!

Good to hear I was on the right tracks :)
can you post the 50000-58192 lines...

and ... did you set 443 as VOIP? since it is standard HTTPS I have avoided that

Thanks
 
Last edited:
Status
Not open for further replies.

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