Can I set distinct ingress/egress speeds for different interfaces with SQM scripts?

At the expense of some bandwidth, SQM with cake/piece_of_cake has provided a much smoother and snappier experience on my network, using a router running LEDE 17.01.00.

My situation may be a rather unusual case. My ISP is a cellular provider that provides unlimited data, subject to deprioritization above a certain limit. Streaming video is throttled to around 1.5mbps to limit data usage. However, on streaming devices such as Chromecast and Amazon Fire, the throttling does not apply. This certainly provides a quality advantage, but does mean that those devices eat up much more data. I would like the option to throttle video (all traffic) to those devices through the router in order to gain more control of how much data they use.

I've looked into ways to throttle traffic to specific IPs/MACs, but it appears that SQM/cake are designed for overall traffic shaping (for which they perform excellently), but not designed for the level of granularity that I'm searching for. I would prefer not to use another qos tool (qos-scripts, gargoyle, etc.) and am trying to think creatively to see if SQM could work for the use case above.

If I create a dedicated wlan for the streaming devices (wlan1-2, for instance), would it be possible to edit /etc/config/sqm to set different ingress/egress speeds for that wlan interface while keeping my current config for my WAN interface? I've not seen an example of /etc/config/sqm configured for two interfaces at once, so perhaps this is not supported.

Sure you can instantiate as many SQM instances as you have interfaces (it does not make sense to instantiate more than one per interface, and older sqm-scripts will not behave well with multiple instances on the same interface).
But note these different instances are fully independent, so that:
a) the WLAN shaper should be set lower than the WAN shaper to have any effect on data saving
b) the WLAN shaper's packets will still compete with your other packets at the WAN shaper, so there is no guarantee that the streaming devices will get a dedicated bandwidth, effectively you can introduce a hard upper limit but no strong guarantees beyond that.
c) Having more shaper instances will, in the case of actual traffic, cause more load on the router's CPU and might start to run into issues with available CPU cycles.

From my reading of your post, these issues (with the potential issue of c) ) would not matter to your use case...

1 Like

I have done an initial test of this config and it seems to be working great for my use case. I will keep an eye on the CPU load. Thank you moeller0 for the detailed reply! I've run across many of your other posts during my search on this forum and others, and have appreciated your thoughtful analysis and responses on the topic of SQM.