QoS does not work properly on RT-N66R [380.70 Merlin]

sebaaalecha

Occasional Visitor
Hi everyone!

I have had this router for a little over a week, it is my first good router and I am really happy with it.

Today I decided to install the latest firmware available from Merlin, first time I do this on a router.

Before installing merlin I had the latest official firmware developed by asus: firmware - 3.0.0.4. - 382.52272 which worked well especially the QoS that after 1 day looking for the configuration I could get this result in DSLreports (A+ in bufferload approximately 50ms in both) but as you can see it had a bad quality which I thought to improve it by changing the MTU, the original firmware does not bring MTU for the type of connection I have (DHCP Automatic IP), that's why I decided to go to Merlin today plus it had more advantages so I did not think about it and I did it.
QoS - Final funcionando.PNG

QoS - Final funcionando 3.PNG

DSLreports - QoS - Final funcionando (Sin MTU).PNG

The QoS of the latest asus version of 2020 respected the established limits as you can see, it is not exact but it is an approximate value.

My actual oficial firmware - 3.0.0.4. -  382.52272 -.PNG


Today with Merlin [380.70 FINAL] hours after trying over and over again I still can't get the QoS to work.

The problem is that it does not respect the set download limits.

As far as Upload is concerned the QoS seems to work and respect the parameters.

The problem is in the download, it doesn't matter if I set 100% or 50% or 30% it doesn't matter, it ALWAYS downloads at the maximum of my ISP.

It is also unstable in the results of dslreports, the official also had some variations but generally remained stable in the measurements.

I would really like to be able to use Asuswrt Merlin as it has a very good reputation and interesting options, but I need the QoS to work as it does with the latest asus firmware 3.0.0.4. - 382.52272 [ 2020/06/18]

Thank you very much for reading!
 

RMerlin

Asuswrt-Merlin dev
I dropped support for that model a couple of years ago, sorry.
 

dave14305

Part of the Furniture

John’s fork is the best option for an old N66 router today.
 

sebaaalecha

Occasional Visitor
I dropped support for that model a couple of years ago, sorry.
I understand, even so; Is there any trick for the QoS to limit the maximum download to 70% ? because if I manage to limit the download to 70% of the maximum bandwidth I could make the bufferload have values between 50 and 75ms as before and everything would work much better.

Any hint you can give me would be of great help, thank you very much!

I am looking into the latest version 374.43 - 49E4j9527 (Merlin Fork) but apparently it doesn't bring options that I need like support for the phone application, client renaming and the truth is I don't know if it's a good idea to go to that version because maybe I will encounter some other problem, I only need 1 more option in the official firmware and that is the MTU which is in Merlin 380.70 but I only have the problem with the maximum download bandwidth, I need to limit it to 70%. If there is a way to do it myself it would be a great help.

Maybe some code or something?
Is there an option that is preventing the download bandwidth from being limited?

I would really like to avoid having to install another version since the fork is more complicated and I have no guarantee that everything will work as I expect.

I understand you must be very busy, maybe you can't help me but if you know of something I can do it would be great!

Thanks a lot!
 

RMerlin

Asuswrt-Merlin dev
I understand, even so; Is there any trick for the QoS to limit the maximum download to 70% ?
QoS is not intended to be used as a bandwidth limiter. It's been years since I've looked at that code, but if I recall, clients will use 100% of the available bandwidth unless there are other clients with different priorities, at which point it will get allocated per queue as indicated.
 

dave14305

Part of the Furniture
Post the output of these commands when QoS is enabled:
Bash:
tc -s qdisc
tc -s class show dev eth0
iptables -t mangle -nvL
cat /tmp/qos
No promises, but if I see anything useful I‘ll let you know.
 

sebaaalecha

Occasional Visitor
Post the output of these commands when QoS is enabled:
Bash:
tc -s qdisc
tc -s class show dev eth0
iptables -t mangle -nvL
cat /tmp/qos
No promises, but if I see anything useful I‘ll let you know.
thank you very much for trying to help me

I can't find anything about it in General Logs.

What do you need me to submit
What can I do to facilitate your help?
 

dave14305

Part of the Furniture
thank you very much for trying to help me

I can't find anything about it in General Logs.

What do you need me to submit
What can I do to facilitate your help?
You would need to login to the router over SSH/PuTTY and run those commands.
 

ColinTaylor

Part of the Furniture
Traditional QoS works in John's firmware. It's also kept up to date with security (and other) patches which 380.70 doesn't have.
 

sebaaalecha

Occasional Visitor
You would need to login to the router over SSH/PuTTY and run those commands.
I am researching how to do this.

So far I downloaded PuTTY and enabled SSH on the router.

Now I have to type in PuTTY the address 192.168.1.1.1 and it will open a cmd, right?
In cmd I will have to type username and password and then I type those commands exactly as you typed them?

So far I got it right or is there something I am doing wrong? I have never done this before
 

sebaaalecha

Occasional Visitor
Traditional QoS works in John's firmware. It's also kept up to date with security (and other) patches which 380.70 doesn't have.
How does the wifi programming work to turn off the wifi signal during the night?

Does the latest version support the cell phone application?

Can I change the name of connecting users by tapping on "View List", assign IPs?

Does it have MTU option for "DHCP Automatic IP" ?

Any limitations with respect to the latest version of Merlin 380.70?

Thanks for your help
 

dave14305

Part of the Furniture
I am researching how to do this.

So far I downloaded PuTTY and enabled SSH on the router.

Now I have to type in PuTTY the address 192.168.1.1.1 and it will open a cmd, right?
In cmd I will have to type username and password and then I type those commands exactly as you typed them?

So far I got it right or is there something I am doing wrong? I have never done this before
Sounds correct. It will probably be easier to run each command individually and copy/paste the output into a forum post.
 

sebaaalecha

Occasional Visitor
Sounds correct. It will probably be easier to run each command individually and copy/paste the output into a forum post.
Code:
login as: sebaaalecha
[email protected]'s password:


ASUSWRT-Merlin RT-N66U 380.70-0 Sun Apr  8 18:03:20 UTC 2018
[email protected]:/tmp/home/root# tc -s qdisc
qdisc htb 1: dev eth0 root r2q 10 default 40 direct_packets_stat 5
Sent 4432359632 bytes 6721520 pkt (dropped 9540, overlimits 653094 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo 60: dev eth0 parent 1:60 limit 1000p
Sent 3758613237 bytes 3555890 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 10: dev eth0 parent 1:10 limit 127p quantum 1514b perturb 10sec
Sent 157009937 bytes 2500931 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 20: dev eth0 parent 1:20 limit 127p quantum 1514b perturb 10sec
Sent 454055442 bytes 361524 pkt (dropped 9540, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 30: dev eth0 parent 1:30 limit 127p quantum 1514b perturb 10sec
Sent 59541857 bytes 252156 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc sfq 40: dev eth0 parent 1:40 limit 127p quantum 1514b perturb 10sec
Sent 3138737 bytes 51014 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc ingress ffff: dev eth0 parent ffff:fff1 ----------------
Sent 4467718558 bytes 4212730 pkt (dropped 1, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo_fast 0: dev eth1 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1      1
Sent 6012210065 bytes 4667775 pkt (dropped 12643, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
qdisc pfifo_fast 0: dev eth2 root bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1      1
Sent 120466 bytes 1439 pkt (dropped 58920, overlimits 0 requeues 0)
rate 0bit 0pps backlog 120466b 1439p requeues 0
[email protected]:/tmp/home/root# tc -s class show dev eth0
class htb 1:10 parent 1:1 leaf 10: prio 1 rate 2027Kbit ceil 4915Kbit burst 4132b cbu
Sent 157054853 bytes 2501195 pkt (dropped 0, overlimits 0 requeues 0)
rate 312bit 0pps backlog 0b 0p requeues 0
lended: 2497170 borrowed: 4025 giants: 0
tokens: 15744 ctokens: 12231

class htb 1:1 root rate 6144Kbit ceil 6144Kbit burst 9278b cburst 9278b
Sent 673756539 bytes 3166243 pkt (dropped 0, overlimits 0 requeues 0)
rate 808bit 1pps backlog 0b 0p requeues 0
lended: 184938 borrowed: 0 giants: 0
tokens: 11729 ctokens: 11729

class htb 1:20 parent 1:1 leaf 20: prio 2 rate 2027Kbit ceil 4915Kbit burst 4132b cbu
Sent 454061852 bytes 361551 pkt (dropped 9540, overlimits 0 requeues 0)
rate 24bit 0pps backlog 0b 0p requeues 0
lended: 185619 borrowed: 175932 giants: 0
tokens: 15528 ctokens: 12142

class htb 1:2 root rate 1000Mbit ceil 1000Mbit burst 9875b cburst 9875b
Sent 3758622938 bytes 3555997 pkt (dropped 0, overlimits 0 requeues 0)
rate 168bit 0pps backlog 0b 0p requeues 0
lended: 0 borrowed: 0 giants: 0
tokens: 78 ctokens: 78

class htb 1:30 parent 1:1 leaf 30: prio 3 rate 1966Kbit ceil 4915Kbit burst 4056b cbu
Sent 59543449 bytes 252160 pkt (dropped 0, overlimits 0 requeues 0)
rate 0bit 0pps backlog 0b 0p requeues 0
lended: 247179 borrowed: 4981 giants: 0
tokens: 15836 ctokens: 12193

class htb 1:40 parent 1:1 leaf 40: prio 4 rate 61000bit ceil 4915Kbit burst 1675b cbu
Sent 3156450 bytes 51337 pkt (dropped 0, overlimits 0 requeues 0)
rate 448bit 1pps backlog 0b 0p requeues 0
lended: 51337 borrowed: 0 giants: 0
tokens: 207480 ctokens: 12219

class htb 1:60 parent 1:2 leaf 60: prio 6 rate 1000Mbit ceil 1000Mbit burst 9875b cbu
Sent 3758622938 bytes 3555997 pkt (dropped 0, overlimits 0 requeues 0)
rate 152bit 0pps backlog 0b 0p requeues 0
lended: 3555997 borrowed: 0 giants: 0
tokens: 78 ctokens: 78

[email protected]:/tmp/home/root# iptables -t mangle -nvL
Chain PREROUTING (policy ACCEPT 41343 packets, 19M bytes)
pkts bytes target     prot opt in     out     source               destination   
18876   15M CONNMARK   all  --  eth0   *       0.0.0.0/0            0.0.0.0/0           CONNMARK restore mask 0x7

Chain INPUT (policy ACCEPT 251K packets, 32M bytes)
pkts bytes target     prot opt in     out     source               destination   

Chain FORWARD (policy ACCEPT 14M packets, 12G bytes)
pkts bytes target     prot opt in     out     source               destination   
11005 2484K QOSO0      all  --  *      eth0    0.0.0.0/0            0.0.0.0/0     

Chain OUTPUT (policy ACCEPT 11897 packets, 5757K bytes)
pkts bytes target     prot opt in     out     source               destination   
  374 26854 QOSO0      all  --  *      eth0    0.0.0.0/0            0.0.0.0/0     

Chain POSTROUTING (policy ACCEPT 15M packets, 12G bytes)
pkts bytes target     prot opt in     out     source               destination   
25879   20M QOSO0      all  --  *      br0     0.0.0.0/0            0.0.0.0/0     

Chain QOSO0 (3 references)
pkts bytes target     prot opt in     out     source               destination   
37258   22M CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           CONNMARK restore mask 0x7
    0     0 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0           CONNMARK match !0x0/0xff00
   46  3743 CONNMARK   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 connbytes 0:524287 bytes direction both CONNMARK set-return 0x2/0x7
3702  540K CONNMARK   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:443 connbytes 0:524287 bytes direction both CONNMARK set-return 0x2/0x7
1969  297K CONNMARK   tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           multiport dports 80,443 connbytes 524288:4294967295 bytes direction both CONNMARK set-return 0x2/0x7
3450 1008K CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC 44:6D:57:03:93:D5 CONNMARK set-return 0x1/0x7
    0     0 CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC 58:6D:8F:9D:01:78 CONNMARK set-return 0x1/0x7
    0     0 CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC 14:DA:E9:E2:6D:6C CONNMARK set-return 0x1/0x7
   69  4835 CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           MAC 00:22:15:C8:CB:05 CONNMARK set-return 0x1/0x7
    0     0 CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           source IP range 192.168.1.0-192.168.1.0 CONNMARK set-return 0x3/0x7
1769  631K CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           source IP range 192.168.1.2-192.168.1.255 CONNMARK set-return 0x3/0x7
   15  1110 CONNMARK   all  --  *      *       0.0.0.0/0            224.0.0.0/4         CONNMARK set-return 0x6/0x7
25833   20M CONNMARK   all  --  *      *       0.0.0.0/0            192.168.1.0/24      CONNMARK set-return 0x6/0x7
  407 46028 CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0           CONNMARK set-return 0x4/0x7
[email protected]:/tmp/home/root# cat /tmp /qos
cat: read error: Is a directory
cat: can't open '/qos': No such file or directory
[email protected]:/tmp/home/root#

Its okey? let me know if i do all good haha
 

Attachments

  • Qos.....PNG
    Qos.....PNG
    45.5 KB · Views: 76
  • SSH config.PNG
    SSH config.PNG
    8.9 KB · Views: 71
  • QoS priottys.PNG
    QoS priottys.PNG
    35.8 KB · Views: 78
  • QoS rules.PNG
    QoS rules.PNG
    40.6 KB · Views: 75
Last edited:

sebaaalecha

Occasional Visitor
Oh, wasn‘t expecting that. How about
Code:
cat /tmp/qos.0
Code:
[email protected]:/tmp/home/root# cat /tmp /qos
cat: read error: Is a directory
cat: can't open '/qos': No such file or directory
[email protected]:/tmp/home/root# cat /tmp/qos
#!/bin/sh
[ -e /tmp/qos.0 ] && /tmp/qos.0 "$1"
[email protected]:/tmp/home/root# cat /tmp/qos.0
#!/bin/sh
#LAN/WAN
I=eth0
SFQ="sfq perturb 10"
TQA="tc qdisc add dev $I"
TCA="tc class add dev $I"
TFA="tc filter add dev $I"
case "$1" in
start)
#LAN/WAN
        tc qdisc del dev $I root 2>/dev/null
        $TQA root handle 1: htb default 40
# upload 2:1
        $TCA parent 1: classid 1:1 htb rate 6144kbit ceil 6144kbit
# download 1:2
        $TCA parent 1: classid 1:2 htb rate 1000000kbit ceil 1000000kbit burst 10000           cburst 10000
# 1:60 ALL Download for BCM
        $TCA parent 1:2 classid 1:60 htb rate 1000000kbit ceil 1000000kbit burst 1000          0 cburst 10000 prio 6
        $TQA parent 1:60 handle 60: pfifo
        $TFA parent 1: prio 6 protocol 802.1q handle 6 fw flowid 1:60
# egress 0: 33-80%
        $TCA parent 1:1 classid 1:10 htb rate 2027kbit ceil 4915kbit   prio 1 quantum           1500
        $TQA parent 1:10 handle 10: sfq perturb 10
        $TFA parent 1: prio 10 protocol ip handle 1 fw flowid 1:10
# egress 1: 33-80%
        $TCA parent 1:1 classid 1:20 htb rate 2027kbit ceil 4915kbit   prio 2 quantum           1500
        $TQA parent 1:20 handle 20: sfq perturb 10
        $TFA parent 1: prio 20 protocol ip handle 2 fw flowid 1:20
# egress 2: 32-80%
        $TCA parent 1:1 classid 1:30 htb rate 1966kbit ceil 4915kbit   prio 3 quantum           1500
        $TQA parent 1:30 handle 30: sfq perturb 10
        $TFA parent 1: prio 30 protocol ip handle 3 fw flowid 1:30
# egress 3: 1-80%
        $TCA parent 1:1 classid 1:40 htb rate 61kbit ceil 4915kbit   prio 4 quantum 1          500
        $TQA parent 1:40 handle 40: sfq perturb 10
        $TFA parent 1: prio 40 protocol ip handle 4 fw flowid 1:40

        $TFA parent 1: prio 14 protocol ip u32 match ip protocol 6 0xff match u8 0x05           0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowid 1:10

        $TFA parent 1: prio 15 protocol ip u32 match ip protocol 6 0xff match u8 0x05           0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x02 0x02 at 33 flowid 1:10

        $TFA parent 1: prio 13 protocol ip u32 match ip protocol 1 0xff flowid 1:10


        tc qdisc del dev $I ingress 2>/dev/null
        $TQA handle ffff: ingress
# ingress 0: 95%
        $TFA parent ffff: prio 1 protocol ip handle 1 fw police rate 40857kbit burst           20428kbit drop flowid ffff:1
# ingress 1: 95%
        $TFA parent ffff: prio 2 protocol ip handle 2 fw police rate 40857kbit burst           20428kbit drop flowid ffff:2
# ingress 2: 95%
        $TFA parent ffff: prio 3 protocol ip handle 3 fw police rate 40857kbit burst           20428kbit drop flowid ffff:3
# ingress 3: 95%
        $TFA parent ffff: prio 4 protocol ip handle 4 fw police rate 40857kbit burst           20428kbit drop flowid ffff:4
        ;;
stop)
        tc qdisc del dev $I root 2>/dev/null
        tc qdisc del dev $I ingress 2>/dev/null
        ;;
*)
        #---------- Upload ----------
        tc -s -d class ls dev $I
        tc -s -d qdisc ls dev $I
        echo
esac
[email protected]:/tmp/home/root#
 

dave14305

Part of the Furniture
Ok, I see it is only “policing” download (ingress) traffic, but not using a dedicated htb qdisc like newer versions of firmware (or John’s fork).

Thanks for the output. I think the best results will come from switching to John’s fork. But you will lose access via the Asus app.
 

ColinTaylor

Part of the Furniture
How does the wifi programming work to turn off the wifi signal during the night?
The wireless scheduler is in the Wireless > Professional settings.

Does the latest version support the cell phone application?
No.

Can I change the name of connecting users by tapping on "View List", assign IPs?
John's firmware doesn't have the same "View List" but you can change client host names under LAN > DHCP Server > Manually Assigned IP...

Does it have MTU option for "DHCP Automatic IP" ?
Yes.

Any limitations with respect to the latest version of Merlin 380.70?
Not that I can think of.
 

sebaaalecha

Occasional Visitor
Ok, veo que solo está “controlando” el tráfico de descarga (entrada), pero no está usando una qdisc htb dedicada como las versiones más nuevas de firmware (o la bifurcación de John).

Gracias por la salida. Creo que los mejores resultados se obtendrán al cambiar a la bifurcación de John. Pero perderá el acceso a través de la aplicación Asus.
Thanks so much for your help and time, Dave!

Isn't there an alternative / simple way to set a maximum download bandwidth limit of 70% and have it respected?

Sending you hugs, regards and many thanks for your advice!
 
Last edited:

Similar threads

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