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.
Contrary to what Vanic has said. Modifying the filters is possible and does change the sorting priority.

I used the following commands to change my "Default" identified traffic to go into category 3 which in my case was setup as "Others"

What I did was turn on adaptive qos, then issue these commands in SSH.

Code:
tc filter del dev eth0 parent 1: handle 813::800 prio 1 protocol all u32
tc filter replace dev eth0 protocol all prio 1 handle 813::800 u32 match mark 0x40000000 0x4000ffff flowid 1:13
tc filter del dev br0 parent 1: handle 813::800 prio 1 protocol all u32
tc filter replace dev br0 protocol all prio 1 handle 813::800 u32 match mark 0x80000000 0x8000ffff flowid 1:13

Typically the unclassified packets go to the 7th container, by changing the last digit of the flowid you can move them into any container. I moved them into the 3rd container.


Checkout screenshot.

after_change.png

Each test was 4 speed tests, while on face time, then launching a game. Speedtest.net gets identified as web surfing.

Sure it may be unapproved and not typical, but it works.

You may notice that a majority of my traffic, after the tweak was applied in the download section, was identified as VOIP instead of Others. Thats because I messed up when I originally changed the filter rules.
Unidentified traffic on the eth0 interface is marked as 0x4000000.
Unidentified traffic on the br0 interface is marked as 0x8000000.
I mistakenly copied the replacement filter command twice, changing only the interface instead of both the interface and packet mark. So in error both filters were setup as 0x4 instead of 0x4 and 0x8. Since then i updated it to the correct values and the traffic successfully goes to catagory3 on both download/upload.

You may also notice a small amount of data in the "default" category aswell after the tweak. That small ammount is there because it took a few seconds to apply the 4 SSH commands after enabling QOS.

If you are deleting and adding rules on your own router make sure the replacement dev, parent, prio, handle, and mark matches the original. The only thing you want to be changing from original rule is the flowid. I will describe how to read the rules so you know what you are looking at, incase it isn't the same across all asus routers.

To see your currently active rules run.

Code:
tc filter show dev eth0
tc filter show dev br0

Heres a sample of the code output so you know what you are looking at.

Code:
filter parent 1: protocol all pref 1 u32
filter parent 1: protocol all pref 1 u32 fh 813: ht divisor 1
filter parent 1: protocol all pref 1 u32 fh 813::800 order 2048 key ht 813 bkt 0 flowid 1:17
  mark 0x80000000 0x8000ffff (success 17)

filter parent 1: protocol all pref 3 u32
filter parent 1: protocol all pref 3 u32 fh 802: ht divisor 1
filter parent 1: protocol all pref 3 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid 1:11
  mark 0x80000000 0x803f0000 (success 0)

filter parent 1: protocol all pref 4 u32
filter parent 1: protocol all pref 4 u32 fh 810: ht divisor 1
filter parent 1: protocol all pref 4 u32 fh 810::800 order 2048 key ht 810 bkt 0 flowid 1:16
  mark 0x80010000 0x803f0000 (success 0)

Mark has two components for each filter.
The 2nd mark string for unidentified traffic ends in ffff.
The 2nd mark string for identified traffic categories is ends in 0000.
The 1rst mark string for identified traffic has a 4th digit that changes. It is used to read a packets catagory. This 4th digit is in hexadecimal, so you have to convert it to decimal if you want to reference it with RMerlins previously supplied categories. This isn't important since we are not modifying those rules, but i will explain how to read them anyway.

If 4th digit hexadecimal is 0, its decimal value is 0 which is instant message category.
If 4th digit hexadecimal is a, its decimal value is 11 which is tunneling and proxy services.

Anyway, what we are interested is that changing the flowid class of unidentified traffic, so we are looking for a rule where the 2nd string of mark ends in ffff. Mine was at the top.

On my router, the filters for eth0 started with 0x4000000, filters for br0 started with 0x8000000. They went into the 7th catagory as expected. I simply switched it to the 3rd catagory with the commands above.

One last thing I would like to add to my wall of text. This setup works for me since my unidentified traffic was primarily VOIP. I just needed Netflix and downloads to be last in my situation.

If in your case, your unidentified traffic is torrents or some other bandwidth hog, you will be in a world of pain moving if you are moving it up above websurfing and streaming. I do not know what torrents are recognized as, since I do not use them, but make sure your default category is relatively small before moving it up.

This workaround will be unnecessary if the filters improve.

Up next I am going to learn how to modify the class priority and see if it works as well. The current way it comes setup right now, bandwidth is rationed terribly. If a qos catagory can saturate the available bandwidth entirely, the classes below it get nothing.

I think the correct way would be to give each class the same priority. Guarantee each class a minimum bandwidth out of total available. When more bandwidth is available than the guaranteed rate, it would be rationed between the catagories in percents of that catagories guarenteed rate vs the other categories guarenteed rate. But maybe I won't mess with it since it's working perfect with this setup, and I don't care if low categories get cut off in the order I have it working.

IF THIS INFORMATION IS NOT ALLOWED, DELETE MY POST OR PM ME TO REMOVE IT.
 
Last edited:
Last update: Correct me if I am wrong, because this is all data I have aquired by trial and error.

Here is a typical class setup.

Code:
1:1                                                                           ;all traffic
  1:2         priority 0 guarented rate 1GBit   max rate 1Gbit                   ;LAN traffic
  1:10        priority 0 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 0 (Net Control)
    see 1:14
  1:11        priority 1 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 1 (VOIP)
    see 1:14
  1:12        priority 2 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 2 (Gaming)
    see 1:14
  1:13        priority 3 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 3 (Others)
    see 1:14
  1:14        priority 4 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 4 (Web Surfing)
    14:2        priority 0 guarented rate 128kbit max rate 29184Kbit              ;device in bandwitdh monitor (continously auto generated do not modify sub catagories) (highest priority in this example)
    14:3                                                                          ;device in bandwitdh monitor (continously auto generated do not modify sub catagories)
    14:4        priority 1 guarented rate 128kbit max rate 29184Kbit              ;device in bandwitdh monitor (continously auto generated do not modify sub catagories) (high priority in this example)
    14:..                                                                         ;device in bandwitdh monitor (continously auto generated do not modify sub catagories)
    14:..       priority 2 guarented rate 128kbit max rate 29184Kbit              ;device in bandwitdh monitor (continously auto generated do not modify sub catagories) (medium priority in this example)
    14:..       priority 4 guarented rate 128kbit max rate 29184Kbit              ;device in bandwitdh monitor (continously auto generated do not modify sub catagories) (default priority in this example)
    14:..       priority 5 guarented rate 128kbit max rate 29184Kbit              ;device in bandwitdh monitor (continously auto generated do not modify sub catagories) (lowest priority in this example)
    14:9                                                                          ;device in bandwitdh monitor (continously auto generated do not modify sub catagories)
    14:256      priority 4 guarented rate 128kbit max rate 29184Kbit              ;if rule for device not explicitly generated yet, go here                                 (always default priority)
  1:15          priority 5 guarented rate 128kbit max rate 29184Kbit           ;WAN QOS catagory 5 (Video)
    see 1:14
  1:16        priority 6 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 6 (File Transfer)
    see 1:14
  1:17        priority 6 guarented rate 128kbit max rate 29184Kbit             ;WAN QOS catagory 7 (Default)
    see 1:14

So the way this works each QOS category has a guaranteed speed of 128kbit/s (8kB/s). The left over bandwidth gets distributed according to priority. If two classes were to have the same priority, they would share the excess guaranteed speed equally.

So lets say my internet is 30 mbps. I am:
  • web surfing @ 1 mbps(cat4)
  • watching a video @ 10mbps (cat5)
  • downloading a file @ whatever is left (cat6).

What would happen is that web suring would get 1mbps, video would get 10mbps, and the file would get 19mbps. All QOS really did was allow web surfing and video streaming to consume the server supplied data rates while forcing the file download to use the remainder. Without QOS, it would be possible for the file download to choke the video and web surfing. So adaptive QOS helped in this case.

Now here is what typically happens to me.
  • web surfing speed test @ 30 mbps(cat4)
  • watching a video @ 10mbps (cat5)
  • downloading a file @ whatever is left (cat6).
What would happen with QOS is that

Web surfing would get 29.75 mbps, video .125 mbps, download .125. This is because websurfing can consume my entire bandwidth, all the other catagories were only guarenteed 0.125mbps Was this intended by design, since while prioritization is working, it doesn't seem very fair.

I have updated my class setup so the total guaranteed rates in each category are percents of my available bandwidth using these following commands. As you can see the rates add up to the ceil value.

Code:
tc class change dev br0 parent 1:1 classid 1:10 htb prio 0 rate 1459Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:11 htb prio 1 rate 5836Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:12 htb prio 2 rate 4377Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:13 htb prio 3 rate 2918Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:14 htb prio 4 rate 2918Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:15 htb prio 5 rate 8755Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:16 htb prio 6 rate 1459Kbit ceil 29184Kbit burst 3200b cburst 35195b
tc class change dev br0 parent 1:1 classid 1:17 htb prio 7 rate 1459Kbit ceil 29184Kbit burst 3200b cburst 35195b

tc class change dev eth0 parent 1:1 classid 1:10 htb prio 0 rate 294Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:11 htb prio 1 rate 1177Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:12 htb prio 2 rate 883Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:13 htb prio 3 rate 1766Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:14 htb prio 4 rate 588Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:15 htb prio 5 rate 588Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:16 htb prio 6 rate 294Kbit ceil 5888Kbit burst 3200b cburst 6398b
tc class change dev eth0 parent 1:1 classid 1:17 htb prio 7 rate 294Kbit ceil 5888Kbit burst 3200b cburst 6398b

If you are wanting to do this, make sure you use different rate, ciel, burst and cburst values. Ciel is the user defined upload/download. burst and cburst are calculated and vary depending on the user defined upload/download speed.

So run these two commands

Code:
tc class show dev eth0
tc class show dev br0

and note you ciel, burst, and cburst values, then modify the individual rates.

With higher guaranteed rates, you wouldn't even have to move default traffic into a higher catagory. I still did, because it is VOIP for me, and I want it to get bandwidth first to prevent latency.

Last thing to note. I like to have all my devices on Default priority. That is because if one device has a higher priority than the other and CAN consume all the bandwidth in its category, it will while the lower device would get its guarented rate of 0.125 mbps. I wish I could change that too, but those rules are continously generatedand modified so you should NOT touch subcategories.

I wish asus would calculated guaranteed rates to become the sum of the available rate. That way higher priority users/catagories would just get a larger chunk of bandwidth instead of the ability to consume it all.

Last thing I might do is to write a script to auto apply these user defined changes on boot, upon modification of QOS values, and a daily check to see if they are persistent.

ONCE AGAIN, IF THIS INFORMATION IS NOT ALLOWED, DELETE MY POST OR PM ME TO REMOVE IT.
 
Last edited:
Contrary to what Vanic has said. Modifying the filters does change the sorting priority.

IF THIS INFORMATION IS NOT ALLOWED, DELETE MY POST OR PM ME TO REMOVE IT.

Hi @FreshJR ,

I appreciate your sharing and investigation for myself, it must be very helpful for other users to understand how adaptive qos works.

Thanks,
Vanic
 
Excellent post works as stated. I tested this against Magic Jack and it is now classifying the traffic as VOIP as I put it to container 1 which I have VOIP at the top of the list.

So my issue is that I work from home quite often and I SSL VPN into my corporate network. I'm on a lot of phone calls or video conferences throughout the day. I utilize my corporate soft client to complete these calls. Since I SSL VPN in and the traffic is encrypted all that traffic gets shoved to the default container. This change did not help that traffic as I think it's an issue that it is encrypted thru the tunnel. Would I be better off using a different mechanism traditional or BW limiter so I have priority when my kids are home streaming videos?
 
Excellent post works as stated. I tested this against Magic Jack and it is now classifying the traffic as VOIP as I put it to container 1 which I have VOIP at the top of the list.

So my issue is that I work from home quite often and I SSL VPN into my corporate network. I'm on a lot of phone calls or video conferences throughout the day. I utilize my corporate soft client to complete these calls. Since I SSL VPN in and the traffic is encrypted all that traffic gets shoved to the default container. This change did not help that traffic as I think it's an issue that it is encrypted thru the tunnel. Would I be better off using a different mechanism traditional or BW limiter so I have priority when my kids are home streaming videos?

Just to clarify, if you took the 0x(4/8)0000000 0x(4/8)000fff rule and changed the flowid from 1:17 to 1:11, that traffic is STILL unindentified, but now unindentified traffic is placed in your VOIP category. The change did not update the definitions that explain to the router how to identify traffic.

With this change, is your VPN traffic now not going into the VOIP or possibly the others category as well? Since after the change, I do not see any remaining filters that could direct anything to the 1:17 default category.

Can you pm your ssh output of

Tc filter show dev eth0
Tc filter show dev br0
 
Last edited:
Understood and you are correct the tunneled traffic still goes to the default category. Knowing nothing can be done with the traffic in the tunnel I would like to affect the tunnel as a whole and put it in a different category.
 
Understood and you are correct the tunneled traffic still goes to the default category. Knowing nothing can be done with the traffic in the tunnel I would like to affect the tunnel as a whole and put it in a different category.

So do you have the router acting as the VPN client, or is it software on your pc. If it's a pc client, then traffic shouldn't be going over a tunneled interface. It should be regular encrytped traffic between you and the vpn server.

Send me the ssh output of those filter rules, so I can see if they properly took effect. I can't see why traffic would be sent to category 1:17 if the first rule is modified.
 
SO I updated the firmware to 380.65. I made the changes to the filter and now the traffic is being put into category 1 when using the Cisco Anyconnect secure mobility client on the machine.


filter parent 1: protocol all pref 1 u32
filter parent 1: protocol all pref 1 u32 fh 813: ht divisor 1
filter parent 1: protocol all pref 1 u32 fh 813::800 order 2048 key ht 813 bkt 0 flowid 1:11
mark 0x40000000 0x4000ffff (success 15665)
filter parent 1: protocol all pref 3 u32
filter parent 1: protocol all pref 3 u32 fh 802: ht divisor 1
filter parent 1: protocol all pref 3 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid 1:11
mark 0x40000000 0x403f0000 (success 14)
filter parent 1: protocol all pref 4 u32
filter parent 1: protocol all pref 4 u32 fh 80a: ht divisor 1
filter parent 1: protocol all pref 4 u32 fh 80a::800 order 2048 key ht 80a bkt 0 flowid 1:14
mark 0x40010000 0x403f0000 (success 0)
filter parent 1: protocol all pref 6 u32
filter parent 1: protocol all pref 6 u32 fh 80b: ht divisor 1
filter parent 1: protocol all pref 6 u32 fh 80b::800 order 2048 key ht 80b bkt 0 flowid 1:14
mark 0x40030000 0x403f0000 (success 31)
filter parent 1: protocol all pref 7 u32
filter parent 1: protocol all pref 7 u32 fh 809: ht divisor 1
filter parent 1: protocol all pref 7 u32 fh 809::800 order 2048 key ht 809 bkt 0 flowid 1:13
mark 0x40040000 0x403f0000 (success 111)
filter parent 1: protocol all pref 8 u32
filter parent 1: protocol all pref 8 u32 fh 803: ht divisor 1
filter parent 1: protocol all pref 8 u32 fh 803::800 order 2048 key ht 803 bkt 0 flowid 1:11
mark 0x40050000 0x403f0000 (success 141)
filter parent 1: protocol all pref 9 u32
filter parent 1: protocol all pref 9 u32 fh 804: ht divisor 1
filter parent 1: protocol all pref 9 u32 fh 804::800 order 2048 key ht 804 bkt 0 flowid 1:11
mark 0x40060000 0x403f0000 (success 28)
filter parent 1: protocol all pref 10 u32
filter parent 1: protocol all pref 10 u32 fh 80e: ht divisor 1
filter parent 1: protocol all pref 10 u32 fh 80e::800 order 2048 key ht 80e bkt 0 flowid 1:16
mark 0x40070000 0x403f0000 (success 0)
filter parent 1: protocol all pref 11 u32
filter parent 1: protocol all pref 11 u32 fh 80d: ht divisor 1
filter parent 1: protocol all pref 11 u32 fh 80d::800 order 2048 key ht 80d bkt 0 flowid 1:15
mark 0x40080000 0x403f0000 (success 41)
filter parent 1: protocol all pref 12 u32
filter parent 1: protocol all pref 12 u32 fh 800: ht divisor 1
filter parent 1: protocol all pref 12 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
mark 0x40090000 0x403f0000 (success 36)
filter parent 1: protocol all pref 13 u32
filter parent 1: protocol all pref 13 u32 fh 80f: ht divisor 1
filter parent 1: protocol all pref 13 u32 fh 80f::800 order 2048 key ht 80f bkt 0 flowid 1:16
mark 0x400a0000 0x403f0000 (success 0)
filter parent 1: protocol all pref 14 u32
filter parent 1: protocol all pref 14 u32 fh 810: ht divisor 1
filter parent 1: protocol all pref 14 u32 fh 810::800 order 2048 key ht 810 bkt 0 flowid 1:16
mark 0x400b0000 0x403f0000 (success 0)
filter parent 1: protocol all pref 16 u32
filter parent 1: protocol all pref 16 u32 fh 807: ht divisor 1
filter parent 1: protocol all pref 16 u32 fh 807::800 order 2048 key ht 807 bkt 0 flowid 1:12
mark 0x400d0000 0x403f0000 (success 1753)
filter parent 1: protocol all pref 17 u32
filter parent 1: protocol all pref 17 u32 fh 80c: ht divisor 1
filter parent 1: protocol all pref 17 u32 fh 80c::800 order 2048 key ht 80c bkt 0 flowid 1:14
mark 0x400e0000 0x403f0000 (success 103)
filter parent 1: protocol all pref 18 u32
filter parent 1: protocol all pref 18 u32 fh 805: ht divisor 1
filter parent 1: protocol all pref 18 u32 fh 805::800 order 2048 key ht 805 bkt 0 flowid 1:11
mark 0x400f0000 0x403f0000 (success 0)
filter parent 1: protocol all pref 20 u32
filter parent 1: protocol all pref 20 u32 fh 806: ht divisor 1
filter parent 1: protocol all pref 20 u32 fh 806::800 order 2048 key ht 806 bkt 0 flowid 1:11
mark 0x40110000 0x403f0000 (success 5)
filter parent 1: protocol all pref 23 u32
filter parent 1: protocol all pref 23 u32 fh 801: ht divisor 1
filter parent 1: protocol all pref 23 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10
mark 0x40140000 0x403f0000 (success 1974)
filter parent 1: protocol all pref 24 u32
filter parent 1: protocol all pref 24 u32 fh 811: ht divisor 1
filter parent 1: protocol all pref 24 u32 fh 811::800 order 2048 key ht 811 bkt 0 flowid 1:16
mark 0x40150000 0x403f0000 (success 0)
filter parent 1: protocol all pref 26 u32
filter parent 1: protocol all pref 26 u32 fh 812: ht divisor 1
filter parent 1: protocol all pref 26 u32 fh 812::800 order 2048 key ht 812 bkt 0 flowid 1:16
mark 0x40170000 0x403f0000 (success 0)
filter parent 1: protocol all pref 27 u32
filter parent 1: protocol all pref 27 u32 fh 808: ht divisor 1
filter parent 1: protocol all pref 27 u32 fh 808::800 order 2048 key ht 808 bkt 0 flowid 1:12
mark 0x40180000 0x403f0000 (success 2725)




filter parent 1: protocol all pref 1 u32
filter parent 1: protocol all pref 1 u32 fh 813: ht divisor 1
filter parent 1: protocol all pref 1 u32 fh 813::800 order 2048 key ht 813 bkt 0 flowid 1:11
mark 0x80000000 0x8000ffff (success 17097)
filter parent 1: protocol all pref 3 u32
filter parent 1: protocol all pref 3 u32 fh 802: ht divisor 1
filter parent 1: protocol all pref 3 u32 fh 802::800 order 2048 key ht 802 bkt 0 flowid 1:11
mark 0x80000000 0x803f0000 (success 1)
filter parent 1: protocol all pref 4 u32
filter parent 1: protocol all pref 4 u32 fh 80a: ht divisor 1
filter parent 1: protocol all pref 4 u32 fh 80a::800 order 2048 key ht 80a bkt 0 flowid 1:14
mark 0x80010000 0x803f0000 (success 0)
filter parent 1: protocol all pref 6 u32
filter parent 1: protocol all pref 6 u32 fh 80b: ht divisor 1
filter parent 1: protocol all pref 6 u32 fh 80b::800 order 2048 key ht 80b bkt 0 flowid 1:14
mark 0x80030000 0x803f0000 (success 48)
filter parent 1: protocol all pref 7 u32
filter parent 1: protocol all pref 7 u32 fh 809: ht divisor 1
filter parent 1: protocol all pref 7 u32 fh 809::800 order 2048 key ht 809 bkt 0 flowid 1:13
mark 0x80040000 0x803f0000 (success 105)
filter parent 1: protocol all pref 8 u32
filter parent 1: protocol all pref 8 u32 fh 803: ht divisor 1
filter parent 1: protocol all pref 8 u32 fh 803::800 order 2048 key ht 803 bkt 0 flowid 1:11
mark 0x80050000 0x803f0000 (success 300)
filter parent 1: protocol all pref 9 u32
filter parent 1: protocol all pref 9 u32 fh 804: ht divisor 1
filter parent 1: protocol all pref 9 u32 fh 804::800 order 2048 key ht 804 bkt 0 flowid 1:11
mark 0x80060000 0x803f0000 (success 26)
filter parent 1: protocol all pref 10 u32
filter parent 1: protocol all pref 10 u32 fh 80e: ht divisor 1
filter parent 1: protocol all pref 10 u32 fh 80e::800 order 2048 key ht 80e bkt 0 flowid 1:16
mark 0x80070000 0x803f0000 (success 0)
filter parent 1: protocol all pref 11 u32
filter parent 1: protocol all pref 11 u32 fh 80d: ht divisor 1
filter parent 1: protocol all pref 11 u32 fh 80d::800 order 2048 key ht 80d bkt 0 flowid 1:15
mark 0x80080000 0x803f0000 (success 69)
filter parent 1: protocol all pref 12 u32
filter parent 1: protocol all pref 12 u32 fh 800: ht divisor 1
filter parent 1: protocol all pref 12 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:10
mark 0x80090000 0x803f0000 (success 31)
filter parent 1: protocol all pref 13 u32
filter parent 1: protocol all pref 13 u32 fh 80f: ht divisor 1
filter parent 1: protocol all pref 13 u32 fh 80f::800 order 2048 key ht 80f bkt 0 flowid 1:16
mark 0x800a0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 14 u32
filter parent 1: protocol all pref 14 u32 fh 810: ht divisor 1
filter parent 1: protocol all pref 14 u32 fh 810::800 order 2048 key ht 810 bkt 0 flowid 1:16
mark 0x800b0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 16 u32
filter parent 1: protocol all pref 16 u32 fh 807: ht divisor 1
filter parent 1: protocol all pref 16 u32 fh 807::800 order 2048 key ht 807 bkt 0 flowid 1:12
mark 0x800d0000 0x803f0000 (success 1374)
filter parent 1: protocol all pref 17 u32
filter parent 1: protocol all pref 17 u32 fh 80c: ht divisor 1
filter parent 1: protocol all pref 17 u32 fh 80c::800 order 2048 key ht 80c bkt 0 flowid 1:14
mark 0x800e0000 0x803f0000 (success 166)
filter parent 1: protocol all pref 18 u32
filter parent 1: protocol all pref 18 u32 fh 805: ht divisor 1
filter parent 1: protocol all pref 18 u32 fh 805::800 order 2048 key ht 805 bkt 0 flowid 1:11
mark 0x800f0000 0x803f0000 (success 0)
filter parent 1: protocol all pref 20 u32
filter parent 1: protocol all pref 20 u32 fh 806: ht divisor 1
filter parent 1: protocol all pref 20 u32 fh 806::800 order 2048 key ht 806 bkt 0 flowid 1:11
mark 0x80110000 0x803f0000 (success 10)
filter parent 1: protocol all pref 23 u32
filter parent 1: protocol all pref 23 u32 fh 801: ht divisor 1
filter parent 1: protocol all pref 23 u32 fh 801::800 order 2048 key ht 801 bkt 0 flowid 1:10
mark 0x80140000 0x803f0000 (success 2854)
filter parent 1: protocol all pref 24 u32
filter parent 1: protocol all pref 24 u32 fh 811: ht divisor 1
filter parent 1: protocol all pref 24 u32 fh 811::800 order 2048 key ht 811 bkt 0 flowid 1:16
mark 0x80150000 0x803f0000 (success 0)
filter parent 1: protocol all pref 26 u32
filter parent 1: protocol all pref 26 u32 fh 812: ht divisor 1
filter parent 1: protocol all pref 26 u32 fh 812::800 order 2048 key ht 812 bkt 0 flowid 1:16
mark 0x80170000 0x803f0000 (success 0)
filter parent 1: protocol all pref 27 u32
filter parent 1: protocol all pref 27 u32 fh 808: ht divisor 1
filter parent 1: protocol all pref 27 u32 fh 808::800 order 2048 key ht 808 bkt 0 flowid 1:12
mark 0x80180000 0x803f0000 (success 4988)
 
So I think I know what happened and looking to see if there is a solution for this. Any time a change is made to the Adaptive QOS in the GUI or if the router reboots which I have a schedule to reboot daily at 2AM the filters go back to default. Is there a way to write these to the startup configuration?
 
So I think I know what happened and looking to see if there is a solution for this. Any time a change is made to the Adaptive QOS in the GUI or if the router reboots which I have a schedule to reboot daily at 2AM the filters go back to default. Is there a way to write these to the startup configuration?

Yup exactly what happened.

If you reboot, turn adaptive QOS on/off, change priority order in the UI, or even turn app analysis on/off, it resets to original values. Maybe a few other actions trigger a reset of the rules but I haven't thoroughly looked into it yet.

We are honestly lucky that TC accepts our modifications at all since it was not intended by design.

I did say at the end of the post 24 that I have to write a script.

Last thing I might do is to write a script to auto apply these user defined changes on boot, upon modification of QOS values, and a daily check to see if they are persistent.

But I haven't gotten around to it yet. Also you can encase your SSH output between

[c ode] OUTPUT HERE, no space between c and o in code. [/c ode]

tags in your previous post and it'll truncate your SSH output like a quote.
 
Last edited:
Thanks for the follow up and efforts on this. If you write that script would you be posting in this thread?
 
Heres the script

http://pastebin.com/yMCFs8SK <SCRIPT 1.0>

It works flawlessly for me.

The only thing I dont like is for getting the current Down/Up rates variables, i keep calling tc class show, and that wastes a lot of performance.

Can anyone help me rewrite it so I can call tc class show once, grep it once, and save the lines I need into array? I learned all of these basic shell commands just today so I'm not well versed with the syntax at all. I couldn't find array examples. The ones I found were for bash, not sh.

Forgot to change the echo into logger. Change that so you can monitor status from GUI.
 
Last edited:
Being able to modify QOS rules would be very nice. As it is, downloading a game from Steam at the tune of up to 60GB in size now days, kills everybody else on the router because it gets flagged as Game traffic and comes in full blast.
I'm currently trying out Untangle on a seperate box and using my AC88U as an access point.
I'm able to create any kind of rules I want. Performance seems pretty good so far on my 100/100mbps fiber optic interweb connection.
 
Being able to modify QOS rules would be very nice. As it is, downloading a game from Steam at the tune of up to 60GB in size now days, kills everybody else on the router because it gets flagged as Game traffic and comes in full blast.
I'm currently trying out Untangle on a seperate box and using my AC88U as an access point.
I'm able to create any knid of rules I want. Performance seems pretty good so far on my 100/100mbps fiber optic interweb connection.

Did you read the first post, or even the title. The issue is SOLVED.

Specifically what you want is in post 24.

Unless you meant an easier way from the UI.
 
Heres the script

http://pastebin.com/yMCFs8SK

It works flawlessly for me.

The only thing I dont like is for getting the current Down/Up rates variables, i keep calling tc class show, and that wastes a lot of performance.

Can anyone help me rewrite it so I can call tc class show once, grep it once, and save the lines I need into array? I learned all of these basic shell commands just today so I'm not well versed with the syntax at all. I couldn't find array examples. The ones I found were for bash, not sh.

Forgot to change the echo into logger. Change that so you can monitor status from GUI.

This is great!. Which script shoud we put this in JFFS to auto apply after boot?
 
So here's a guide since i'm assuming not everyone is well versed in ssh and custom scripts.

Step1:

You will need putty and pscp, as well as the script.

http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

You do not have to install these executables, they are portable. Move them, and the script, into a new folder called Putty on your C:\ drive.

It should look like this:

  • C:\Putty\putty.exe
  • C:\Putty\pscp.exe
  • C:\Putty\qos_check.txt
Warning if you are opening and saving the script in a texteditor. Windows and Linux new lines (ENTER) are different and incompatible, use notepad++.

Step2:
Open your router log in page, go to Administration -> System -> Enable JFFS custom scripts and configs -> YES -> Apply

Step3:

Shift right click in the putty folder with the 3 files.
Select open command window here.

Paste this command

Code:
pscp -scp C:\Putty\qos_check.txt admin@192.168.1.1:/jffs/scripts/firewall-start

Type in password.

Step4:

Open putty. Hostname is router ip. Port is 22. Connection Type SSH. Click open.

Type in Password.

Paste this command from clipboard by right clicking.

chmod 755 /jffs/scripts/firewall-start

Step5:

You are done, restart or toggle QOS on/off. You can look for logging output in system log from the script.

Note this script has been updated from the previous. I cut down on the calls to tc class show by assuming if one needs to be changed, that they all will. It also will only execute if qos is on and set to adaptive. Also a minor sleep was required to give the original qos rules to enumerate before being overwritten.

NOTE: if you have multiple firewall start scripts this would overwrite your other one, but at that point you wouldn't be needing this guide and you know how to setup multiple.

http://pastebin.com/1qWZHqFV

I've done this and I can see the logs like "Adaptive QOS: Modification Script Started" etc but I also see logs;

Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh
Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh
Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh

is this normal?
 
I've done this and I can see the logs like "Adaptive QOS: Modification Script Started" etc but I also see logs;

Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh
Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh
Feb 19 18:51:00 crond[537]: user admin: parse error at server1-fw.sh

is this normal?

No, but i fixed it the issue.

Issue was that the daily scheduled check command had an error.

The command

Code:
 cru a QOS_CHECK 0 0 * * * /jffs/scripts/firewall-start

was actually supposed to be

Code:
 cru a QOS_CHECK "0 0 * * * /jffs/scripts/firewall-start"

For those that have already installed the script, go to ssh, login, then issue the following two commands that deletes the script.
Code:
cru d QOS_CHECK
rm /jffs/scripts/firewall-start

Follow the previous steps to install. The script file has been updated.

I hope the other 7 people notice the same issue!!
 
Last edited:
No, but i fixed it the issue.

Issue was that the daily scheduled check command had an error.

The command

Code:
 cru a QOS_CHECK 0 0 * * * /jffs/scripts/firewall-start

was actually supposed to be

Code:
 cru a QOS_CHECK 0 0 \* \* \* /jffs/scripts/firewall-start

For those that have already installed the script, go to ssh, login, then issue command. That deletes the script.
Code:
rm /jffs/scripts/firewall-start
.

Follow the previous steps to install. The script file is updated.

I hope the other 7 people notice the same issue!!

Thank you very much :) btw, script is working really good :)
 
Status
Not open for further replies.

Latest threads

Sign Up For SNBForums Daily Digest

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