Configuring QoS for specific program

Hello, I am a newbie for setting up QoS, recently I got SFM QoS and QoS packages on LEDE , and I need help configuring QoS to prioritize an application on my network, can anyone help me set it up? I would be able to use teamviewer, and would greatly appreciate help. Thank you in advance.

I just need help as I don't know how to set it up properly, as I have no experience with LEDE software and networking in depth. Please help.

This is more or less outside of the scope of sqm-scripts, the one thing sqm would allow is to use DSCP markings on packets from that application. That would work for packets sent from that application, but configuring that is going to be hard, unless the application actually offers different DSCP markings itself, but only very few applications do. And that still leaves the problem of dscp marking incoming packets. In short not easy.
But what exactly is the problematic application you are trying to prioritize and what kind of link and bandwidth di you use?

I think my SFM qos isn't properly set up either, I can either set up SFM qos or regular qos , it's just when I have other people on my network I sometimes get ping spikes , well that is a gaming application, so latency is an issue there. Currently I have 10/ sometimes 13mbps down on a good day, and 680kbps up. 1 thing I have noticed, I had resource monitor open and network bar, is that when those spikes occur, My downloading line drops to 0, so I guess it stops receiving data, and the application is detecting about 50% loss out in packet loss. So I guess it just caps downloading speed when that other person on my network is using up all the bandwidth. My application takes about 180 kbps down and 50kbps up speed, so I just need to prioritize that application's traffic, I just don't know how. well SFM qos is also needed because of bloatbuffering on the network. I would greatly appreciate any help, and well, if you try to explain me how, I don't understand many terms, so I would appreciate help by using teamviewer, or simply telling me what to do. Thank you.I forgot to add, I am currently on ethernet cable which is plugged into my Archer C20 , and the archer is plugged into my Technicolor modem, which is provided by IP. I would directly use my Archer, but it doesn't have DSL cable which connects to cable in wall. I use ethernet cable, but my other family uses Wifi provided from my Archer.

To add to the topic, I have no problem with my latency in the application, as long as there are no other people on network, and well, when they are there, it's not always there, but when it becomes too often, you definitely notice it, definitely in evenings, so, since the applications takes about 10% or less of bandwidth provided by my ISP , I thought the ping and data required by it could somehow be prioritized. Thank you.

If I might ask, how many other users and more important how many (concurrently active) devices?

Could you report the sync rates as reported by your modem please?

You could try dscp marking, but I belive there might be something easier (but slightly more approximate) that might work for your situation.

I will try, but uou will need to do some reading first, please start with https://lede-project.org/docs/user-guide/sqm. I have alas no time for IRC or on-line video connections.

So I hope you have lede running on the archer then? Could ypu log into the router via ssh (on windows you can use putty for that). And type the following commands into the terminal window and copy and paste the output from the terminal window here into the forum: (only execute the parts between the double quotes ")

  1. "cat /etc/config/sqm"
  2. "cat /etc/config/qos"
  3. "tc -d qdisc"
  4. "tc -s qdisc"

That should give a decent idea about the capabilities of your link. Then please run a dslreports speedtest (see https://forum.openwrt.org/t/sqm-qos-recommended-settings-for-the-dslreports-speedtest-bufferbloat-testing/2803/7 for recommendations how to configure that test and how to report the results here, with your link I believe you might need to set the "No. upload streams:" to 8 or even to 4 though)

In theory prioritization is a decent solution, it is just that in reality that is much harder to do reliably. But assuming you do not share your internet with too many people/devices is to follow the recommendation of the "Making cake sing and dance, on a tight rope without a safety net" section of the user guide. That will aim to fairly divide the bandwidth between the concurrently active users (actually IP addresses), so typically if there are less than 10 concurrently active devices in your network you should get the 10% of bandwidth you need (you will however need to make sure that no other application on your gaming computer uses significant amounts of bandwidth, as all traffic from your computer will be treated to that imaginary 10% of the available bandwidth share).

I recommend to try to configure that and then test how well your games works with other users concurrently active. With a bit of luck that might be good enough for you to not having to bother with the more difficult how to prioritize on a per-application basis.

It's about 1 other user or 2 at a rare case.
Sync rate- I guess you want the amount that my router page provides, well then here you go Bandwidth (Up/Down) [kbps/kbps]: 893 / 16.245 as provided by my DSL connection router info.

  1. root@LEDE:~# cat /etc/config/sqm

    config queue 'eth1'
         option qdisc_advanced '0'
         option interface 'eth0.2'
         option debug_logging '0'
         option verbosity '5'
         option qdisc 'cake'
         option script 'piece_of_cake.qos'
         option linklayer 'atm'
         option overhead '44'
         option upload '550'
         option enabled '1'
         option download '10000'
    
  2. I think you can have 1 active, either SFM qos or qos, and anyhow, I don't have ''qos''enabled now, just SFM.

  3. root@LEDE:~# 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 8007: dev eth0.2 root refcnt 2 bandwidth 550Kbit besteffort triple-isolate rtt 100.0ms raw
     linklayer atm overhead 44 mtu 2047 tsize 512
    qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
    qdisc mq 0: dev wlan0 root
    qdisc fq_codel 0: dev wlan0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
    qdisc fq_codel 0: dev wlan0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
    qdisc fq_codel 0: dev wlan0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
    qdisc fq_codel 0: dev wlan0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
    qdisc cake 8008: dev ifb4eth0.2 root refcnt 2 bandwidth 10Mbit besteffort triple-isolate wash rtt 100.0ms raw
    linklayer atm overhead 44 mtu 2047 tsize 512
    
  4. root@LEDE:~# tc -s qdisc

    qdisc noqueue 0: dev lo root refcnt 2
      Sent 0 bytes 0 pkts (dropped 0, overlimits 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 1153443456 bytes 1618461 pkts (dropped 0, overlimits 0)
       maxpacket 1434 drop_overlimit 0 new_flow_count 1 ecn_mark 0
       new_flows_len 0 old_flows_len 0
     qdisc noqueue 0: dev br-lan root refcnt 2
      Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
     qdisc noqueue 0: dev eth0.1 root refcnt 2
      Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
     qdisc cake 8007: dev eth0.2 root refcnt 2 bandwidth 550Kbit besteffort triple-isolate rtt 100.0ms raw
      Sent 2518932 bytes 10526 pkt (dropped 653, overlimits 16017 requeues 0)
      backlog 0b 0p requeues 0
      memory used: 595264b of 4Mb
      capacity estimate: 550Kbit
                      Tin 0
       thresh       550Kbit
       target        33.0ms
       interval     128.0ms
       pk_delay      97.8ms
       av_delay      21.8ms
       sp_delay       272us
       pkts           11179
       bytes        2725632
       way_inds         132
       way_miss         560
       way_cols           0
       drops            653
       marks              0
       sp_flows           0
       bk_flows           1
       un_flows           0
       max_len         2809
    
     qdisc ingress ffff: dev eth0.2 parent ffff:fff1 ----------------
      Sent 17293451 bytes 15335 pkt (dropped 0, overlimits 0 requeues 0)
      backlog 0b 0p requeues 0
     qdisc mq 0: dev wlan0 root
      Sent 162713479 bytes 162203 pkt (dropped 0, overlimits 0 requeues 3)
      backlog 0b 0p requeues 3
     qdisc fq_codel 0: dev wlan0 parent :4 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
      Sent 94225189 bytes 90586 pkts (dropped 0, overlimits 0)
       maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
       new_flows_len 0 old_flows_len 0
     qdisc fq_codel 0: dev wlan0 parent :3 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
      Sent 68485416 bytes 71604 pkts (dropped 0, overlimits 0)
       maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
       new_flows_len 0 old_flows_len 0
     qdisc fq_codel 0: dev wlan0 parent :2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
      Sent 0 bytes 0 pkts (dropped 0, overlimits 0)
       maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
       new_flows_len 0 old_flows_len 0
     qdisc fq_codel 0: dev wlan0 parent :1 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 4Mb ecn
      Sent 2874 bytes 13 pkts (dropped 0, overlimits 0)
       maxpacket 0 drop_overlimit 0 new_flow_count 0 ecn_mark 0
       new_flows_len 0 old_flows_len 0
     qdisc cake 8008: dev ifb4eth0.2 root refcnt 2 bandwidth 10Mbit besteffort triple-isolate wash rtt 100.0ms raw
      Sent 20006077 bytes 15074 pkt (dropped 261, overlimits 20321 requeues 0)
      backlog 0b 0p requeues 0
      memory used: 104832b of 4Mb
      capacity estimate: 10Mbit
                      Tin 0
       thresh        10Mbit
       target         5.0ms
       interval     100.0ms
       pk_delay       1.6ms
       av_delay       315us
       sp_delay         1us
       pkts           15335
       bytes       20459217
       way_inds          37
       way_miss         561
       way_cols           0
       drops            261
       marks              0
       sp_flows           0
       bk_flows           1
       un_flows           0
       max_len         3392

Speaking of DSLreports speedtest, I have noticed if I change values in SFM qos kbps speed download/up it changes my results there, so I don't know what to believe. I do have less blufferbloat with those SFM qos settings I currently have, it just limits my speed somehow.

Anyhow, with these SFM settings I get this DSL speed result, if I increase the kbps in SFM settings I get more,

New speed test, using your settings download streams 16 and upload streams 8

If i understand, are you using both SQM and QOS Packages at the same time?

I do not, as I installed qos, but didn't continue to use it as I didn't set it up, I just want to fix my problem I mentioned before, and I can use any means to fix it, so please , if you know how, then help.

Okay in that case I recommend to use the configuration as described in the last section of lede's sqm user guide (https://lede-project.org/docs/user-guide/sqm). That shold almost guarantee 1/3 of the bandwidth to your computer and will give any single user the full bandwidth until others are active at the same time. As a guide line here are the relevant lines from my /etc/config/sqm:

option linklayer 'ethernet'
option overhead '34'
option linklayer_advanced '1'
option tcMTU '2047'
option tcTSIZE '128'
option tcMPU '64'
option linklayer_adaptation_mechanism 'default'
option qdisc_advanced '1'
option ingress_ecn 'ECN'
option egress_ecn 'NOECN'
option qdisc_really_really_advanced '1'
option squash_dscp '0'
option squash_ingress '0'
option qdisc 'cake'
option script 'layer_cake.qos'
option iqdisc_opts 'nat dual-dsthost'
option eqdisc_opts 'nat dual-srchost

Are you using PPPoE by any chance for you internet access? In that case I would recommend to instantiate the shaper on the pppoe-wan interface (but that might not exist). I am assuming here the ISP-modem is running bridged modem and your lede router does the pp handling (and these assumptions might simply be wrong).

option enabled '1'

Yes those are the numbers I am interested in. Personally I would try setting the bandwidth to 16245 * 0.85 = 13808.25 -> 13800 for the downlink and to 893*0.99 = 884.07 -> 884 for the uplink.

This looks decent, if you want to make sure that 44 is the correct verhead, you could use https://github.com/moeller0/ATM_overhead_detector to try to measure your real per packet overhead empirically. But 44 is a [pretty conservative guess that not very likely to be too small (even though there are ISP that reach 48 bytes overhead).

Good, that is exactly what I wanted to look for concurrent shapers instantiated on the same interface, but of qos-scripts is not enabled we can rule this out.

This indicates that you use the tc stab method of overhead accounting, while for cake this is not ideal, especially since your cake shaper sees larger packets than the 2047 bytes that stab is prepared to handle. Just go to the link layer adjustment tab check the advanced option check box and select cake in the list-box at the bottom.

These being larger than 1500 (plus minus a few bytes) indicate your router uses either GSO/TSO or GRO on some of the interfaces, this is not a problem with cake, but it will confuse the tc stab link layer accounting method.

Thanks for the data

But this is pretty much what you should expect if you set the shaper to lower values expect to measaure lower values with a speedtest. Or are you concerned, that the speedtest goodput numbers are lower than the shaper settings? In that case please remember that the shaper is set as gross ATM rate and you will need to account for all overhead, so for your case I would expect the TCP/IPv4/HTTP goodput to be around

100 * (48/53) * ((1500-8 -20-20)/(48*32)) = 85.6% of your sqm configured bandwidths.

From your speedtest it seems clear that on upstream 8 flows are too much (look at the initial spike in the upload plot).

With new settings I applied, not complete as you said, with these settings
root@LEDE:~# cat /etc/config/sqm

config queue 'eth1'
        option interface 'eth0.2'
        option debug_logging '0'
        option verbosity '5'
        option qdisc 'cake'
        option linklayer 'atm'
        option overhead '44'
        option enabled '1'
        option download '13800'
        option upload '884'
        option script 'layer_cake.qos'
        option qdisc_advanced '1'
        option squash_dscp '1'
        option squash_ingress '1'
        option ingress_ecn 'ECN'
        option egress_ecn 'NOECN'
        option linklayer_advanced '1'
        option tcMTU '2047'
        option tcTSIZE '128'
        option tcMPU '0'
        option linklayer_adaptation_mechanism 'cake'
        option qdisc_really_really_advanced '1'
        option iqdisc_opts 'nat dual-dsthost'
        option eqdisc_opts 'nat dual-srchost'

I get this DSLreports speedtest

About your doubts of PPPoE, I do not know what you mean, but my ethernet cable is connected to my Archer C20 Ethernet ports, and my Archer C20 is connected to my IP's provided modem Technicolor TG788v2 through Internet port on Archer. I would directly use my Technicolor modem, however Archer doesn't have DSL port at back that connects to wall, also, Technicolor modem isn't supported by LEDE.
I wasn't sure about those other settings you had, before applying, so I do not know if I should set my linklayer to ethernet or ATM, so I didn't apply those settings.

Oh, you did exactly the right thing, when I copied the lines from my router I failed to edit linklayer from ethernet (which is correct for my vdsl2 link) to atm as required for your link.

The soeedtest, for my taste, show too many latency spikes during the upload, so it seems "option download '13800’
" is a bit too aggressive, so I would try 13000 next and keep reducing that number until the bufferbloat plot shows only a few spikes left. Also 13800 * 0.865 = 11937 while you get 10700, so it seems that 13800 is too aggressive.

Mmmh, which ISP are we talking about here? And what IP address does the Archer C20 report for its WAN interface?

Best Regards

I have Lattelecom as ISP, which is only in my country, Latvia.
Here are all 3 of my interfaces: https://i.imgur.com/x7HklR1.png

With 12400 down in SFM settings I get this result: