Prioritizing Host with qos/qos-scripts

I have 8 phones in my lan 3 of them connect to my wifi others are connected to the other router which is connected to my router with lan cable. Also 4 PCs in my lan 2 of them connect to my wifi and 1 SMARTTV also connected with wifi. I have 50 Mbit/s connection and WNDR3700v4 router with LEDE.

Yesterday i set up IPTV with ottplayer and sometimes when i watch 1080p streams it's stopping and playing many times. I want to prioritize my TV so it always gets minimum 20 Mbit/s and also lock 1 PC to not be able to use more then 20 Mbit/s ever.

Can you help me with this?
Thank you in advance.

1 Like

I handle QOS using FireQOS which has packages that work on LEDE just fine.
it's extremely well documented and independent of the firehol firewall software. You would accomplish your task with something like

interface lan lanout output  rate 49500kbit qdisc fq_codel
    class highprio rate 20mbit
        match dst mytvhere
   class lowprio rate 1mbit ceil 20mbit
        match dst mylimiteddsktophere

This gives mytvhere at least 20mbit guaranteed, and mylimiteddsktophere gets at least 1mbit but no more than 20mbit, note you need minor changes to support ipv6 as well. there is always an implied defaul tclass where your remaining traffic goes

1 Like

I should clarify, you get the firehol software along with fireqos, but you can disable firehol and just use the fireqos portion so that the LEDE firewall is unaffected.

1 Like

I have 4.9.57 kernel version and it says that it needs 4.9.65

Can't i just make that with qos which is included and it also has luci-app?

hmm that's strange as I am using it fine on my machine, not sure what kernel, but default for lede 17.01.4 installed this package:

re your question can you do it with qos scripts? I'm sure it's doable. I dropped those like a hot potato when I found FireQOS because it is very good and very well documented and capable of doing lots of much more sophisticated things that I needed it to do (like using ipsets to bandwidth limit any inbound video streams from youtube, amazon, netflix, etc in combination with dnsmasq automatically adding ips to the ipsets when it does DNS lookups for related domains)

1 Like

I tried to install that same package but it gave me that error. This is my compiled LEDE i changed it's default 4.4 kernel version with 4.9 and compiled it with GCC 6.3.

I asked about qos becaus i could not install that package and it's not in LEDE software menu too.

FireQOS is I think entirely written in bash shell script, the package probably requires certain kernel features and requiring a particular kernel was the easiest way to ensure them.

According to the FireHOL website they started making packages because OWRT didn't ship a "make" package, but LEDE ships make, so if you install make and then install FireHOL from source you'll probably be fine.

these days I think LEDE uses packages called "sqm-qos" or "cake" or some such thing. Most of these seem to be oriented towards fighting bufferbloat, which is a good thing, but it's not so clear that these scripts make it easy to do more sophisticated manual controls. as I say, FireQOS seems to be the best thing going when you actually want detailed control over specific traffic shaping rather than just to keep bufferbloat down and do some smart default things with SIP streams and a few games etc.

anyway you might look at sqm-scripts package or the like and if it does what you want then that might be easier.

1 Like

now i have fireqos running normally as's even better than qos and sqm!
i can control any traffic with fireqos,many thanks for dlakelan who teaches me and helped me a lot.

Do you also have the bufferbloat and latency under control ?
Im my opinion this is why a well configured sqm qos is so useful.
Of course it would be even better if you could manualy choose which device and/or service would get the highest prioritization. And another downside are the missing manuel (min/max) bandwidth settings for specific devices.

FireQOS sounds indeed very interesting !
But i think you have to invest quite some time* to get a good config done.
*well i guess it will depend on your needs, the actual network setup and your QoS skills/expirience

1 Like

in my country, we have a worst internet and network infrastructure,with a lot of packet loss,i have 1Mbps down and 2 Mbps up.but they provide 16 mbps for youtube,google traffic.4 mbps for facebook cdn.
in my case sqm and qos is useless,cause i can't control many traffic with different speeds,
but in fireqos i can control the high speed and low speed traffic independent from each other.
before i have fireqos, when i do viber calls,whatsapp calls...etc,sound wasn't clear especially when someone is do a download,also "LOL game" have a high ping and a lot of lags.
but when i got fireqos to work now,calls are have a low ping so no lags,many thanks to @dlakelan who helped me for more than 2 weeks!.

about buffer-bloat as i said before: isp's are very bad in my country so i'm not sure if the
buffer-bloat are accurate ,form what i test

without fireqos:
i have more than 253ms for download and 153 ms for upload.
with fireqos:
i have less than 53ms for download and 3ms for upload.
all tests done while i have download from internet.

it's very useful and easy to control a bandwidth for multiply devices or services.

but config is easy and you don't need a lot of lines or settings!

1 Like

Not to put too much a point on wordimg, but I believe you are talking about the packages known as qos-scripts and sqm-scripts; what you implemented with fireqos is a mechanism to ascertain your desired quality of service (qos) using and advanced/smart queueing method (aqm/sqm).

The advantage of a custom-tailored set-up like yours is that it does exactly what you want it to; the disadvantage is that most of the time you are using heuristics to map packets the the different priority tiers and hence will be forced to play a continuous game of whack-a-mole to confirm/adapt your heuristics to to have the desired false positive and false negative rates.

sqm-scripts goal is pretty much to break out of this cycle by more or less doing the right thing with a minimal amount of heuristics/configuration. So it will give sparse flows some boost (important for DNS and also reasonably sparse ACK streams) but otherwise will not play too many games. It also allows to distribute the available bandwidth fairly between internal or external IP addresses (which for most people on a shared line seems to be the desired sharing method, it is only gamers who always want absolute priority (I personally wonder how many gamers actually would be fine with simple per-internal-IP-fasirness, but it is hard to get feed-back of happy users, and I am not inclined to start playing latency-bound games myself just to figure out :wink: )) I also want to add that diffserv/DSCP offers a meaningful method for applications to request prioritization and sqm-scripts actually honors many diffserv codepoints (look at layer_cake); it is somewhat puzzling to me that almost 0% of FPS games actually use meaningful DSCPs on their packets or at least would allow the user to configure which DSCPs to use...

Best Regards

1 Like

i'm using dscp tags,and tagged my important traffic,medium traffic and bulk.
also bandwidth is shareable between all of my clients.

So your ISP is doing some sort of bandwidth shaping in his own backbone/network ?
Imho it's ok if your ISP is prioritizing his own voip packets but any form of splitting and downgrading the bandwidth (on the provider side) is very bad.
If your connection is capable of doing 16mbps of downstream your ISP should allow it for every service and type of connection.

What type of internet connection are you using (dsl, cable, fiber) ?

Thanks for the explanations.
Afaik sqm qos with cake (piece_of_cake or layer_cake) works quite well with online gaming but im also not a hardcore gamer and i dont know how the feedback should look like.
I heared it's possible to set up DSCP tags with windows 10... but i dont know how sqm qos (e.g. with layer_cake) will benefit from it.

Is there any guide or link you could share about DSCP's with sqm qos ?

1 Like

no isp is not doing any prioritization,but they give a 16 mbps for google traffic and 4 mbps for facebook,1 mbps for other sites.for that reason i did traffic prioritization on my side.
it's WISP.internet here is trash.

so now i'm using dscp with fireqos.

Do we just only choose layer_cake without editing the sqm script to diffserv priority tiers? if so, how go about adding such for inquired minds. lol.

Yes, layer-cake will default to diffserv3, if you want another diffserv profile (like diffserv4) you can edit this in /usr/lib/sqm/; but please note that on ingress if you selects ignore DSCPs (which is the default) the diffserv mode will be besteffort (basically a single tier with no differentiation based on DSCPs).