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.
I'm not exactly sure if I put those lines in the correct spot. I put it like this:

Re enabled QoS and restarted device. It didn't work.

Also, as I did some testing today, there's few things that I noticed:
- Latency spikes only occur while YouTube or Netflix is streaming, no matter if peak hour or not. It only happens when that connection comes from a Samsung TV via an access point. I tested with a Chromecast with a direct connection to AC68U and it worked fine.
- I have NAT Acceleration enabled. On Sysinfo tab it's showing "HW acceleration Enabled (CTF only)"
- Router's web interface gets extremely slow during that latency spike periods, as it was struggling to process something.
- Every AiProtection is off
- What information would be helpful? I'm running out of ideas...
EDIT: I'm using Adaptive QoS, if I didn't mention it before.

Thanks everyone for helping!
I worked out the pattern match of how to set the rules, look for the matching parameters br0 protocol and eth0 protocol, there are 2 entries of this just match the commands with their locations if you want I can screen shot it for you.
 
Will this script suffer if firewall-start is called mutliple times during a router reboot, or does it already include provisions to prevent overlapping runs?
 
Will this script suffer if firewall-start is called mutliple times during a router reboot, or does it already include provisions to prevent overlapping runs?

Great!. How to use the line please since my knowledge in networking is moderate ?
 
I placed it as follows in the script. I'm sure @FreshJR can point out if I've placed the line in the right place, but it seems to work where it is.

upload_2017-8-20_21-44-51.png
 
Will restore to default reset everything? thinking about doing that since this is too complicated for me. Thanks,
 
Since 563 is the server port, should I change dport to sport, since its traffic coming down from server port 563 to LAN?

Both dport and sport will produce valid rules.
I think dport is the correct rule in 99% of the cases(read below). Fee free to add dport and sport simultaneously.

Download traffic is on the br0 interface
--dport is destination port on your computer
--sport is source port from the sever
(Every source has a destination but they don't have to be the same)

I only I included dport download templates since you have control on what port your application uses to receive data. You really don't have any control of the server originating port. Seemed a lot more logical. But yes, changing the d to an s is all that would be required. Server can have many sports pointing to your constant dport! Do you. Do you not have control of the applications receiving port?

Upload traffic is in the eth0 interface
--sport is the source port of your router **not computer** (router source port may or may not be the same we the source port of your computer depending if different external to internal ports or mapped)
--dport is the sever destination port

The best place for custom rules is AFTER the following prio delete command on each respective interfaces. There are other active rules and comments in the area you should be pasting. Just group the br0 or eth0 rules together.

Code:
tc filter dev (br0 or eth0) del prio1

The already commented rule examples are in the correct position. You can remove the comment and change the single variable pertaining to you, and you will have a fully functioning rule. The comment is the # character.

The comments are pretty extensive. Read them! They really don't leave much to imagination if you try to correlate the variables to their actions.

@maxsteel if you want a custom rule for your traffic you have to know what type of custom rule you want. A rule filtering on destination port is cery common. Figure out what port the application is using and paste that rule in the script in the correct spot before the install process. It's only 1 additional step.

@Jack Yaz no multiple calls should not cause a problem. After its initial rule modification, the script has conditional statements so it doesn't run again unless initial changes disappeared. It will physically run the script but the script will not do much besides generate logs that it started and no actions were taken. If you find issues then post them and I will try to address them.
 
Last edited:
@FreshJR many thanks for the in depth explanation. NZB downloads connect to a fixed server port, in this case, 563, which doesn't change. So in my use it made more sense to look for that port.
 
Hello @FreshJR,

Have you tested script on 380.68? I don't know why but when I download a game via steam, steam gets all my bandwith and I can't even watch a video on youtube @360 px
Screenshot_1.jpg


As you can see Video and Audio Streming is at high priorty and gaming is one of the lowest but steam gets all my bandwith when I download a game and youtube can only get around 800-900k. Also guarenteed bandwiths seems OK but somehow steam takes over all bandwith.

Code:
admin@Fatiii:/tmp/home/root# tc class show dev br0
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 25600Kbit ceil 51200Kbit burst 1596b cburst 1593b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:1 root rate 51200Kbit overhead 18 ceil 51200Kbit burst 64000b cburst 64000b
class htb 1:2 root leaf 2: prio 0 rate 1Gbit overhead 18 ceil 1Gbit burst 1249375b cburst 1249375b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 5120Kbit ceil 51200Kbit burst 1599b cburst 1593b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 15360Kbit ceil 51200Kbit burst 1597b cburst 1593b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 5120Kbit ceil 51200Kbit burst 1599b cburst 1593b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b

admin@Fatiii:/tmp/home/root# tc class show dev eth0
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 1638Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:1 root rate 4096Kbit overhead 18 ceil 4096Kbit burst 4799b cburst 4799b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 1228Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 819Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 1024Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 409Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
 
Tried it but it seems not working.

IP for the router is 192.168.2.1 (will this contradict with the script? ). Can you share your version of the script please.
what are you having issues with I managed to get the https rules put in, seems to be working as intended for me, if you need a hand just ask
 
Hello @FreshJR,

Have you tested script on 380.68? I don't know why but when I download a game via steam, steam gets all my bandwith and I can't even watch a video on youtube @360 px
View attachment 10175

As you can see Video and Audio Streming is at high priorty and gaming is one of the lowest but steam gets all my bandwith when I download a game and youtube can only get around 800-900k. Also guarenteed bandwiths seems OK but somehow steam takes over all bandwith.

Code:
admin@Fatiii:/tmp/home/root# tc class show dev br0
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 25600Kbit ceil 51200Kbit burst 1596b cburst 1593b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:1 root rate 51200Kbit overhead 18 ceil 51200Kbit burst 64000b cburst 64000b
class htb 1:2 root leaf 2: prio 0 rate 1Gbit overhead 18 ceil 1Gbit burst 1249375b cburst 1249375b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 5120Kbit ceil 51200Kbit burst 1599b cburst 1593b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 15360Kbit ceil 51200Kbit burst 1597b cburst 1593b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 5120Kbit ceil 51200Kbit burst 1599b cburst 1593b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 2560Kbit ceil 51200Kbit burst 1600b cburst 1593b

admin@Fatiii:/tmp/home/root# tc class show dev eth0
class htb 1:11 parent 1:1 leaf 11: prio 1 rate 1638Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:10 parent 1:1 leaf 10: prio 0 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:1 root rate 4096Kbit overhead 18 ceil 4096Kbit burst 4799b cburst 4799b
class htb 1:13 parent 1:1 leaf 13: prio 3 rate 1228Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:12 parent 1:1 leaf 12: prio 2 rate 819Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:15 parent 1:1 leaf 15: prio 5 rate 1024Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:14 parent 1:1 leaf 14: prio 4 rate 409Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:17 parent 1:1 leaf 17: prio 7 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
class htb 1:16 parent 1:1 leaf 16: prio 6 rate 204Kbit ceil 4096Kbit burst 1599b cburst 1599b
have you tired the https rules, also may I ask you connection speeds.
 
have you tired the https rules, also may I ask you connection speeds.

What do you mean with https rules? I'm following this post but I think I've seen it, sorry. My speed is 50 mbit down 4 mbit up.
 
What do you mean with https rules? I'm following this post but I think I've seen it, sorry. My speed is 50 mbit down 4 mbit up.
fresh posted some rules to mark https traffic that might be missed
 
Well I couldn't find it I think. The weird thing is it's OK while I'm torrenting. Only steam gets the whole bandwith. Anyway, since I download games 2-3 times in a month it's not a big deal. Thanks.
 
Well I couldn't find it I think. The weird thing is it's OK while I'm torrenting. Only steam gets the whole bandwith. Anyway, since I download games 2-3 times in a month it's not a big deal. Thanks.
${tc} filter add dev br0 protocol all prio 22 u32 match mark 0x80130000 0x803f0000 flowid ${Web}
${tc} filter add dev eth0 protocol all prio 22 u32 match mark 0x40130000 0x403f0000 flowid ${Web}
these
 
${tc} filter add dev br0 protocol all prio 22 u32 match mark 0x80130000 0x803f0000 flowid ${Web}
${tc} filter add dev eth0 protocol all prio 22 u32 match mark 0x40130000 0x403f0000 flowid ${Web}
these

Thank you. let me check this
 
sounds like steam is not being detected as downloads heres the ports

Required Ports for Steam
Which ports do I need to open on my router or firewall for Steam?

To log into Steam and download content:
  • HTTP (TCP port 80) and HTTPS (443)
  • UDP 27015 through 27030
  • TCP 27015 through 27030
Steam Client
  • UDP 27000 to 27015 inclusive (Game client traffic)
  • UDP 27015 to 27030 inclusive (Typically Matchmaking and HLTV)
  • UDP 27031 and 27036 (incoming, for In-Home Streaming)
  • TCP 27036 and 27037 (incoming, for In-Home Streaming)
  • UDP 4380
Dedicated or Listen Servers
  • TCP 27015 (SRCDS Rcon port)
Steamworks P2P Networking and Steam Voice Chat
  • UDP 3478 (Outbound)
  • UDP 4379 (Outbound)
  • UDP 4380 (Outbound)
https://support.steampowered.com/kb_article.php?ref=8571-GLVN-8711
 
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