1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

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

Discussion in 'Asuswrt-Merlin' started by FreshJR, Jan 12, 2017.

  1. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    Your ul/dl setting on the qos setup page need to be slightly lower than your reliable average actual speeds you can achieve with qos off. Reason for that is qos(the router) needs to be the bottleneck for your connection so it is in control. As soon as you actual connection drops below what you set there qos is broken and cant work because it doesnt know theres an issue. As for the %'s i was previously referring to, those are in the script and are my suggestions
     
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    Well understood, and they are :)

    Assume you mean the bandwidth percentages that I put in post 1656?

    Is it necessary to add / modify custom rates / ciel, or does the script just do it all for you?

    Code:
    custom_rates() {
            echo "Modifying Class Rates"
            ${tc} class change dev br0 parent 1:1 classid 1:10 htb ${PARMS}prio 0 rate ${DownRate0}Kbit ceil ${DownCeil}Kbit burst ${DownBurst0} cburst ${DownCburst0}
            ${tc} class change dev br0 parent 1:1 classid 1:11 htb ${PARMS}prio 1 rate ${DownRate1}Kbit ceil ${DownCeil}Kbit burst ${DownBurst1} cburst ${DownCburst1}
            ${tc} class change dev br0 parent 1:1 classid 1:12 htb ${PARMS}prio 2 rate ${DownRate2}Kbit ceil ${DownCeil}Kbit burst ${DownBurst2} cburst ${DownCburst2}
            ${tc} class change dev br0 parent 1:1 classid 1:13 htb ${PARMS}prio 3 rate ${DownRate3}Kbit ceil ${DownCeil}Kbit burst ${DownBurst3} cburst ${DownCburst3}
            ${tc} class change dev br0 parent 1:1 classid 1:14 htb ${PARMS}prio 4 rate ${DownRate4}Kbit ceil ${DownCeil}Kbit burst ${DownBurst4} cburst ${DownCburst4}
            ${tc} class change dev br0 parent 1:1 classid 1:15 htb ${PARMS}prio 5 rate ${DownRate5}Kbit ceil ${DownCeil}Kbit burst ${DownBurst5} cburst ${DownCburst5}
            ${tc} class change dev br0 parent 1:1 classid 1:16 htb ${PARMS}prio 7 rate ${DownRate6}Kbit ceil ${DownCeil}Kbit burst ${DownBurst6} cburst ${DownCburst6}
            ${tc} class change dev br0 parent 1:1 classid 1:17 htb ${PARMS}prio 6 rate ${DownRate7}Kbit ceil ${DownCeil}Kbit burst ${DownBurst7} cburst ${DownCburst7}
            
            ${tc} class change dev eth0 parent 1:1 classid 1:10 htb ${PARMS}prio 0 rate ${UpRate0}Kbit ceil ${UpCeil}Kbit burst ${UpBurst0} cburst ${UpCburst0}
            ${tc} class change dev eth0 parent 1:1 classid 1:11 htb ${PARMS}prio 1 rate ${UpRate1}Kbit ceil ${UpCeil}Kbit burst ${UpBurst1} cburst ${UpCburst1}
            ${tc} class change dev eth0 parent 1:1 classid 1:12 htb ${PARMS}prio 2 rate ${UpRate2}Kbit ceil ${UpCeil}Kbit burst ${UpBurst2} cburst ${UpCburst2}
            ${tc} class change dev eth0 parent 1:1 classid 1:13 htb ${PARMS}prio 3 rate ${UpRate3}Kbit ceil ${UpCeil}Kbit burst ${UpBurst3} cburst ${UpCburst3}
            ${tc} class change dev eth0 parent 1:1 classid 1:14 htb ${PARMS}prio 4 rate ${UpRate4}Kbit ceil ${UpCeil}Kbit burst ${UpBurst4} cburst ${UpCburst4}
            ${tc} class change dev eth0 parent 1:1 classid 1:15 htb ${PARMS}prio 5 rate ${UpRate5}Kbit ceil ${UpCeil}Kbit burst ${UpBurst5} cburst ${UpCburst5}
            ${tc} class change dev eth0 parent 1:1 classid 1:16 htb ${PARMS}prio 7 rate ${UpRate6}Kbit ceil ${UpCeil}Kbit burst ${UpBurst6} cburst ${UpCburst6}
            ${tc} class change dev eth0 parent 1:1 classid 1:17 htb ${PARMS}prio 6 rate ${UpRate7}Kbit ceil ${UpCeil}Kbit burst ${UpBurst7} cburst ${UpCburst7}
     
  4. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    Code:
    custom_rates() {
            echo "Modifying Class Rates"
            ${tc} class change dev br0 parent 1:1 classid 1:10 htb ${PARMS}prio 0 rate ${DownRate0}Kbit ceil ${DownCeil}Kbit burst ${DownBurst0} cburst ${DownCburst0}
            ${tc} class change dev br0 parent 1:1 classid 1:11 htb ${PARMS}prio 1 rate ${DownRate1}Kbit ceil ${DownCeil}Kbit burst ${DownBurst1} cburst ${DownCburst1}
            ${tc} class change dev br0 parent 1:1 classid 1:12 htb ${PARMS}prio 2 rate ${DownRate2}Kbit ceil ${DownCeil}Kbit burst ${DownBurst2} cburst ${DownCburst2}
            ${tc} class change dev br0 parent 1:1 classid 1:13 htb ${PARMS}prio 3 rate ${DownRate3}Kbit ceil ${DownCeil}Kbit burst ${DownBurst3} cburst ${DownCburst3}
            ${tc} class change dev br0 parent 1:1 classid 1:14 htb ${PARMS}prio 4 rate ${DownRate4}Kbit ceil ${DownCeil}Kbit burst ${DownBurst4} cburst ${DownCburst4}
            ${tc} class change dev br0 parent 1:1 classid 1:15 htb ${PARMS}prio 5 rate ${DownRate5}Kbit ceil ${DownCeil}Kbit burst ${DownBurst5} cburst ${DownCburst5}
            ${tc} class change dev br0 parent 1:1 classid 1:16 htb ${PARMS}prio 7 rate ${DownRate6}Kbit ceil ${DownCeil}Kbit burst ${DownBurst6} cburst ${DownCburst6}
            ${tc} class change dev br0 parent 1:1 classid 1:17 htb ${PARMS}prio 6 rate ${DownRate7}Kbit ceil ${DownCeil}Kbit burst ${DownBurst7} cburst ${DownCburst7}
            
            ${tc} class change dev eth0 parent 1:1 classid 1:10 htb ${PARMS}prio 0 rate ${UpRate0}Kbit ceil ${UpCeil}Kbit burst ${UpBurst0} cburst ${UpCburst0}
            ${tc} class change dev eth0 parent 1:1 classid 1:11 htb ${PARMS}prio 1 rate ${UpRate1}Kbit ceil ${UpCeil}Kbit burst ${UpBurst1} cburst ${UpCburst1}
            ${tc} class change dev eth0 parent 1:1 classid 1:12 htb ${PARMS}prio 2 rate ${UpRate2}Kbit ceil ${UpCeil}Kbit burst ${UpBurst2} cburst ${UpCburst2}
            ${tc} class change dev eth0 parent 1:1 classid 1:13 htb ${PARMS}prio 3 rate ${UpRate3}Kbit ceil ${UpCeil}Kbit burst ${UpBurst3} cburst ${UpCburst3}
            ${tc} class change dev eth0 parent 1:1 classid 1:14 htb ${PARMS}prio 4 rate ${UpRate4}Kbit ceil ${UpCeil}Kbit burst ${UpBurst4} cburst ${UpCburst4}
            ${tc} class change dev eth0 parent 1:1 classid 1:15 htb ${PARMS}prio 5 rate ${UpRate5}Kbit ceil ${UpCeil}Kbit burst ${UpBurst5} cburst ${UpCburst5}
            ${tc} class change dev eth0 parent 1:1 classid 1:16 htb ${PARMS}prio 7 rate ${UpRate6}Kbit ceil ${UpCeil}Kbit burst ${UpBurst6} cburst ${UpCburst6}
            ${tc} class change dev eth0 parent 1:1 classid 1:17 htb ${PARMS}prio 6 rate ${UpRate7}Kbit ceil ${UpCeil}Kbit burst ${UpBurst7} cburst ${UpCburst7}
    this stuff you don't need to touch at all ever.. these lines use the %'s that are changeable further up.. the only thing you may be interested in changing are the..
    Code:
    ####################  Bandwidth Setup #####################
    
        user_variables() {
            #Percent of download speed guaranteed per QOS category, change below as desired     (minimum value per section 5, sum should not be greater than 100)
            NetControl_DownBandPercent=10                    #This value can be adjust as desired        **  no spaces before or after the "=" sign **
            VoIP_DownBandPercent=10                            #This value can be adjust as desired        **                no decimals              **
            Gaming_DownBandPercent=10                        #This value can be adjust as desired
            Others_DownBandPercent=10                        #This value can be adjust as desired        #Note: New destination for unidentified traffic
            WebSurfing_DownBandPercent=10                    #This value can be adjust as desired
            Video_DownBandPercent=30                        #This value can be adjust as desired
            FileTransfer_DownBandPercent=10                    #This value can be adjust as desired
            Default_DownBandPercent=10                        #This value can be adjust as desired        #Note: Original destination for unidentified traffic, repurposed for "Gaming Downloads on ports 80/443"
        
            #Percent of upload speed guaranteed per QOS category, change below as desired         (minimum value per section 5, sum should not be greater than 100)
            NetControl_UpBandPercent=10                        #This value can be adjust as desired
            VoIP_UpBandPercent=10                            #This value can be adjust as desired
            Gaming_UpBandPercent=10                            #This value can be adjust as desired
            Others_UpBandPercent=10                            #This value can be adjust as desired        #Note: New destination for unidentified traffic
            WebSurfing_UpBandPercent=10                        #This value can be adjust as desired
            Video_UpBandPercent=30                            #This value can be adjust as desired
            FileTransfer_UpBandPercent=10                    #This value can be adjust as desired
            Default_UpBandPercent=10                            #This value can be adjust as desired        #Note: Original destination for unidentified traffic, repurposed for "Gaming Downloads on ports 80/443
    adjust those as desired if needed and that's it.
     
    FadgewackeR likes this.
  5. skeal

    skeal Very Senior Member

    Joined:
    Apr 30, 2016
    Messages:
    1,746
    Location:
    Canada
    Your custom rates are in the script. Defaults work out of the box. I raised my video bandwidth to 40 by taking from voip. I left my upload values alone. Works flawless.
    Code:
    user_variables() {
            #Percent of download speed guaranteed per QOS category, change below as desired     (minimum value per section 5, sum should not be greater than 100)
            NetControl_DownBandPercent=5                    #This value can be adjust as desired        **  no spaces before or after the "=" sign **
            VoIP_DownBandPercent=10                            #This value can be adjust as desired        **                no decimals              **
            Gaming_DownBandPercent=15                        #This value can be adjust as desired
            Others_DownBandPercent=10                        #This value can be adjust as desired        #Note: New destination for unidentified traffic
            WebSurfing_DownBandPercent=10                    #This value can be adjust as desired
            Video_DownBandPercent=40                        #This value can be adjust as desired
            FileTransfer_DownBandPercent=5                    #This value can be adjust as desired
            Default_DownBandPercent=5                        #This value can be adjust as desired        #Note: Original destination for unidentified traffic, repurposed for "Gaming Downloads on ports 80/443"
        
            #Percent of upload speed guaranteed per QOS category, change below as desired         (minimum value per section 5, sum should not be greater than 100)
            NetControl_UpBandPercent=5                        #This value can be adjust as desired
            VoIP_UpBandPercent=20                            #This value can be adjust as desired
            Gaming_UpBandPercent=15                            #This value can be adjust as desired
            Others_UpBandPercent=20                            #This value can be adjust as desired        #Note: New destination for unidentified traffic
            WebSurfing_UpBandPercent=10                        #This value can be adjust as desired
            Video_UpBandPercent=20                            #This value can be adjust as desired
            FileTransfer_UpBandPercent=5                    #This value can be adjust as desired
            Default_UpBandPercent=5                            #This value can be adjust as desired        #Note: Original destination for unidentified traffic, repurposed for "Gaming Downloads on ports 80/443"
        }
     
  6. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    Great, cheers. I've already tweaked those marginally, so I should be good to go.

    PS4 downloads are all showing in gaming, be it from web browse or store, so I'll need to address that next up. Thanks for your help.
     
  7. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    Cheers @skeal - I seem to be making it more complicated than it need be! I'd already tweaked those marginally and all seems to be ok. No VOIP as such in my house to be honest either, so I dropped that a touch.
     
  8. skeal

    skeal Very Senior Member

    Joined:
    Apr 30, 2016
    Messages:
    1,746
    Location:
    Canada
    You have to watch VOIP because if you use voice and video in gaming it can be messed up. Just a heads up I took to much from voip and skype suffered so its a delicate balance really to suit your needs.
     
    FadgewackeR likes this.
  9. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    Last ridiculous question for a little while I hope while I try to figure out why my NAS traffic isn't sticking to a rule... If I make a modification to the script (bandwidth %s) will I need to re-flash the script to the router, or does it periodically go back to the script to check for mods?
     
  10. skeal

    skeal Very Senior Member

    Joined:
    Apr 30, 2016
    Messages:
    1,746
    Location:
    Canada
    When making modifications to the FreshJR_QOS file you really should disable the service do your fixing and then enable the service again.
     
    FadgewackeR likes this.
  11. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    that depends on whre your modifying the script. if your modifying a file on your pc then yes you need to reflash/upload it to the router. if your directly editing the script on the router well you could just turn off and on qos or also daily at 3am or 330 now the script re-runs to make sure all is good.

    and feel free to modify those % to as closely as your household usage will be. if you got 5 people on Netflix all day long and the wife likes to brows the web. and if the nets not workin for her and it may be certain death.. you can go like 60% video and make sure to leave a chunk maybe 20% for web. ultimately it doesn't matter a whole lot but im finding mild performance gains if theyre as close to your needs as possible so it works less.
     
    FadgewackeR and skeal like this.
  12. FreshJR

    FreshJR Very Senior Member

    Joined:
    Oct 8, 2016
    Messages:
    868
    @Vexira, Feel free to send me the output of /jffs/scripts/FreshJR_QOS -debug via PM and your WebUI bandwidth values.
    The reduction from those two additional lines in your script should still take effect.

    @FadgewackeR, Feel free to send me your script (as configured) via pastebin via PM so I can take a look at it. You PS4 traffic is acting a little weird. Also tell me the local IP of your PS4.

    As others have stated, you don't have to make any changes that deep in the script. All user variables were located towards the top. I guess you missed this message!

    Code:
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    ####################  DO NOT MODIFY BELOW  #####################
    
    When I said to define your bandwidth to 85-95% in the instructions I meant via WebUI. (this defines ciel)
    The minimum category guaranteed bandwidth can be anything you wish. (this defines rates as percentages of ciel)
    All un-used bandwidth will always flow downward so the numbers are pretty resistant to error.

    ---

    For modifications to the script I use the following procedure.

    1) Re-upload the script (with new values into the router)
    2) Click Apply in the QOS WebUI Page
    *) I don't bother turning QOS off/on during modifications.

    -- If changing between script implementations (compatible, fast, modified, etc), then I

    1) Disable QOS
    2) Uninstall
    3) Upload / Install New Script
    4) Enable QOS
     
    Last edited: Jul 9, 2018
    Quoc Huynh, skeal and FadgewackeR like this.
  13. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    Thanks, I'll send it across. The two things I'm trying to achieve are the gaming rules to work as intended (or so I think) where the true gaming packets are operated from the bulk activity (store downloads / game updates / web browser activity / dslreports).

    The second is to create a rule around my NAS to make all activity go to downloads... It's been getting routed to "other" which wasn't ideal so I removed the rule while I worked out how to correctly implement it.

    I actually did, it was the custom rates section (rate/ciel/burst) which is above this message that was concerning me. Thought I was missing something!!

    All square on the script flash procedure thanks. Will PM you my pastebin and highlight the IPs I'm having difficulty with. Thanks for taking a look.
     
  14. WalkedDave

    WalkedDave Occasional Visitor

    Joined:
    May 26, 2017
    Messages:
    11
    Any problem if i use WinSCP-5.13.3-Portable to modify the script?
     
  15. skeal

    skeal Very Senior Member

    Joined:
    Apr 30, 2016
    Messages:
    1,746
    Location:
    Canada
    No. It is a great program I use it as well.
     
  16. shelleyevans

    shelleyevans Regular Contributor

    Joined:
    Dec 17, 2009
    Messages:
    54
    Hello! I got a lot of help (on a different thread) installing this script which I now run, unaltered, to help manage my VOIP traffic. Since installing the script (or possibly since implementing QoS, even before installing the script), I notice that my Crashplan backup service is running in the background almost all the time. If I manually open the service and hit "backup now" I can force it to back up the relatively small amount of data that is queued (usually about 120MB), which leads me to believe that Crashplan is being told to wait by some QoS rule. I read an earlier discussion in this thread about setting a custom rule for Back Blaze/Crashplan, but it was actually way over my head. I wonder if anybody here would have the patience to walk me through the process of creating and implementing a rule that might allow Crashplan to run more effectively? I am very reluctant to "break" the solution that I worked so hard to implement. o_O
     
  17. skeal

    skeal Very Senior Member

    Joined:
    Apr 30, 2016
    Messages:
    1,746
    Location:
    Canada
    Do you know what specific ports it uses or ip address ?
     
  18. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    im not familiar with crashplan but I assume its backing up to a remote server? It may be that you got fairly high traffic and the container its being put in is lower priority which may be a good thing. the whole point of qos is to slow down lower priority bandwidth hogging things to allow for higher priority to get thru uninterrupted with little to no lag. that being said some lower priority transmissions will take longer than without qos enabled but shouldn't be ridiculously longer so something might be acting up if it is taking much much longer than normal.
     
  19. FadgewackeR

    FadgewackeR Regular Contributor

    Joined:
    Jun 19, 2018
    Messages:
    83
    The lower priority stuff would only be slower than usual if the connection was heavily utilised by higher priority tasks, as far as I can see... Correct?
     
  20. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    Correct
     
  21. Sinner

    Sinner Senior Member

    Joined:
    Sep 30, 2017
    Messages:
    245
    Location:
    Canada
    If its slowing it down with no heavy usage by higher priority data streams then something isnt right but isnt ness the router or script but worth looking into
     
    FadgewackeR likes this.
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!