Help configuring cable and SQM


#1

Hi want to set sqm for a friend's router, its a D-Link DGL-5500 with latest snapshot firmware (linux 4.14.91-1). Internet speed is Cable 200mb/20mb, dslreports speed test says 174/19.23mb and C in Bufferbloat (the test runs for about 16s for dl and ul).

I'm trying to set SQM like this

config queue 'eth1'
        option debug_logging '0'
        option verbosity '5'
        option linklayer 'ethernet'
        option interface 'eth0.2'
        option overhead '18'
        option qdisc_advanced '1'
        option squash_ingress '1'
        option qdisc_really_really_advanced '1'
        option squash_dscp '1'
        option ingress_ecn 'ECN'
        option egress_ecn 'NOECN'
        option download '0'
        option eqdisc_opts 'nat dual-srchost'
        option qdisc 'cake'
        option script 'layer_cake.qos'
        option upload '17000'
        option enabled '1'

like this dslreports says A in bufferbloat but the speeds are not good enough 40mb/16.17mb.

here are the other reports

root@DGL-5500:~# tc -d qdisc
qdisc noqueue 0: dev lo root refcnt 2
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
qdisc noqueue 0: dev br-lan root refcnt 2
qdisc noqueue 0: dev eth0.1 root refcnt 2
qdisc cake 8074: dev eth0.2 root refcnt 2 bandwidth 17Mbit diffserv3 dual-srchost nat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 18
qdisc noqueue 0: dev wlan1 root refcnt 2
qdisc noqueue 0: dev wlan0 root refcnt 2
qdisc noqueue 0: dev wlan1-1 root refcnt 2

root@DGL-5500:~# tc -s qdisc
qdisc noqueue 0: dev lo root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc fq_codel 0: dev eth0 root refcnt 2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
 Sent 1880220469 bytes 3413006 pkt (dropped 0, overlimits 0 requeues 169)
 backlog 0b 0p requeues 169
  maxpacket 1514 drop_overlimit 0 new_flow_count 171 ecn_mark 0
  new_flows_len 0 old_flows_len 0
qdisc noqueue 0: dev br-lan root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev eth0.1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc cake 8074: dev eth0.2 root refcnt 2 bandwidth 17Mbit diffserv3 dual-srchost nat nowash no-ack-filter split-gso rtt 100.0ms noatm overhead 18
 Sent 83880 bytes 309 pkt (dropped 0, overlimits 39 requeues 0)
 backlog 0b 0p requeues 0
 memory used: 8960b of 4Mb
 capacity estimate: 17Mbit
 min/max network layer size:           28 /    1500
 min/max overhead-adjusted size:       46 /    1518
 average network hdr offset:           10

                   Bulk  Best Effort        Voice
  thresh       1062Kbit       17Mbit     4250Kbit
  target         17.1ms        5.0ms        5.0ms
  interval      112.1ms      100.0ms      100.0ms
  pk_delay          9us        855us         49us
  av_delay          0us         54us          0us
  sp_delay          0us         17us          0us
  backlog            0b           0b           0b
  pkts                4          299            6
  bytes             272        83110          498
  way_inds            0            0            0
  way_miss            1           41            2
  way_cols            0            0            0
  drops               0            0            0
  marks               0            0            0
  ack_drop            0            0            0
  sp_flows            0            0            1
  bk_flows            0            0            0
  un_flows            0            0            0
  max_len            74         3882          202
  quantum           300          518          300

qdisc noqueue 0: dev wlan1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan0 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc noqueue 0: dev wlan1-1 root refcnt 2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
root@DGL-5500:~#

What do you guys think?? I'd like it to have around 190mb/18mb and good bufferbloat.


#2

Strange that your download dropped so much when you have disabled download direction... Makes me think ACK starvation or some such thing. Or maybe just a temporary congestion on your line, try test again?


#3

That was after a couple of tests. I trued again today and its about 118mb/16mb. I noticed that the 118mb were the maximum speed, like capped at that speed.


#4

Well 118/16 is giving you close to the 17 you asked for. The device has a relatively weak 750Mhz MIPS processor, it may have to do with the speed limitation. These days lots of people here in the forum are asking similar questions and the result is usually that they recently updated their link speed but they have not enough CPU power to handle it.

You might do well with a WRT-32X with substantially more horsepower.

You can check by running top -d 1 during speed test and watching the idle % on the router.


#5

In a situation like this it would be really helpful to also test with SQM disabled immediately before or after the sqm-enabled test...


#6

I've done that and the tests report 215mb/22mb, but with a crappy bufferbloat xD.


#7

I will check the cpu idle % when I get back home, I have also tried the connection with my DIR-835 and sqm works great in LAN, but not on wifi as it is only 300mbps N 5Ghz so it wont give the 200mb on wifi, I assume that it has a less powerful cpu and it works great, but I wish to have the 200mb on wifi.


#8

I tested measuring the idle percent while doing the speedtest and in the download phase it stays between 9% - 24% so I guess that the router is really lacking. I'm gonna try changing the governor settings that I saw in anther thread to see if it helps.


#9

DIR-835 can do 450mbps on the 5 ghz band and actually has a slightly slower CPU than the DGL-5500. Make sure you're connected to 5 GHz and that it's configured for 80 MHz channel width. The device needs to support that as well of course.

Your download shaping according to the config file is set to 0, which I think disables shaping on the download. If you're only shaping upload, you should be ok, but maybe something funny is going on here. That said, both of these devices should top out under 150mbps before the CPU maxes out. I don't think the governor is going to help you here. The 120ish you're getting sounds right.

Something with a Mediatek MT7621AT (dual core) CPU will get you to around 200mbps. The Xiaomi MiWifi 3G fit this requirement, is supported by OpenWrt, and is only ~$40. Bonus - you get AC wifi, but only 2 LAN ports. If you're not using wifi, the Ubiquiti Edgerouter X is another good option.


#10

thanks for the help, the funny thing is that the DIR-835 manages well sqm on lan but not on wifi, I tried disabling wifi on the DIR-835 and use the ac wifi from the DGL-5500 connected by lan to the DIR-835 and I get 171mb/18mb on wifi which is what I wanted, but im using 2 devices. Of course I disabled dhcp and a other services in the DGL-5500 to use it as a simple switch.


#11

Hmm the DGL-5500 should be faster than the DIR-835 all around, including at SQM on the LAN. Not sure how to help you troubleshoot though.

I suspect the reason the DGL-5500 wifi is faster is just that it's 802.11ac. What device are you testing with? Is it single stream 5 ghz?


#12

That's what I thought, but it seems that sqm on wifi demands a lot more resources than lan, I'm using 16 threads for 30s, chrome in my desktop pc with no other apps using intermet.


#13

Not really, but SQMF requires that the shaper bandwidth is below the physical net-rate of an interface which with wifi is not guranteed. Also wifi itself can use up a lot of CPU-cycles so that with heavy wifi usage the CPU might have not enough cycles for both SQM and wifi. Now it is not a bad idea, to run a lan-only router as primary gateway router to the internet (with a proper SQM config to debloat the Internet access) and use a second device as dumb AP, that will keep wifi and sqm cpu load nicely away from each other (at the cost of operating two devices); this also allows tp place the AP where it is optimal for wifi coverage and the primary router close to the modem...


#14

yeah, is not a bad sacrifice... I could have gone with the Xiaomi, but I have always preferred qualcomm devices and not mediatek, I could also create guest wifi by creating different vlan and switch using more cables from the DGL-5500 to the DIR-835, I have some ideas. Thanks a lot everybody, I'm gonna keep this setup for now and see what happens.


#15

Sorry to revive this, but I was wondering.. I've been using the latest snapshots for the DIR-835 and noticed that the device has been included in the ath79 firmwares, will I get an improve in performance by using that firmware??