As I understand it, it depends on the architecture of your router hardware. The problematic case is where you have both ethernet and wifi LAN interfaces on the router. The veth workaround essentially allows you to shape both interfaces as one, by placing a virtual interface in front of them and putting the SQM instance on that.
In my case I don't have to do that because my router doesn't handle wifi - I have separate wifi access points which are wired into the LAN elsewhere.
More info from far more knowledgeable people than me can be found in this thread:
Ok, you should be able to do something like me then. Even simpler if you don't have a guest VLAN.
You need to split your SQM instance in half - egress on the WAN interface to handle upload traffic, and egress on the LAN interface to handle download traffic.
And in between them you have your iptables rules which mark packets with DSCP tags before they hit the SQM instances.
Okay, amazing - and are you able to provide the script you use for your side and to help me set it up? I would be very grateful.
What I am not clear about, is if I put BitTorrent traffic into low effort bin say, does this mean BitTorrent is always limited to low bandwidth or is this only the case if the connection is saturated?
My script is pretty complicated with separate chains to do the tagging and connmarking and loads of aliases which simplify things for me, but would probably confuse anyone else!
It works out as something like this though:
# Tag outgoing Bittorrent packets (and mark their connections) as DSCP CS1 (8) (low priority).
# My Bittorrent traffic uses outbound ports 46792 and 46800-46849.
iptables -t mangle -A PREROUTING -p tcp ! -d 192.168.0.0/16 -m multiport --sports 46792,46800:46849 -j DSCP --set-dscp 8
iptables -t mangle -A PREROUTING -p udp ! -d 192.168.0.0/16 -m multiport --sports 46792,46800:46849 -j DSCP --set-dscp 8
iptables -t mangle -A PREROUTING -p tcp ! -d 192.168.0.0/16 -m multiport --sports 46792,46800:46849 -j CONNMARK --set-mark 8
iptables -t mangle -A PREROUTING -p udp ! -d 192.168.0.0/16 -m multiport --sports 46792,46800:46849 -j CONNMARK --set-mark 8
# Tag incoming Bittorrent packets (and mark their connections) as DSCP CS1 (8) (low priority).
# My Bittorrent traffic uses incoming port 46792 on the router.
iptables -t mangle -A PREROUTING -p tcp -m addrtype --dst-type LOCAL ! -d 192.168.0.0/16 -m multiport --dports 46792 -j DSCP --set-dscp 8
iptables -t mangle -A PREROUTING -p udp -m addrtype --dst-type LOCAL ! -d 192.168.0.0/16 -m multiport --dports 46792 -j DSCP --set-dscp 8
iptables -t mangle -A PREROUTING -p tcp -m addrtype --dst-type LOCAL ! -d 192.168.0.0/16 -m multiport --dports 46792 -j CONNMARK --set-mark 8
iptables -t mangle -A PREROUTING -p udp -m addrtype --dst-type LOCAL ! -d 192.168.0.0/16 -m multiport --dports 46792 -j CONNMARK --set-mark 8
# Identify any packets in any direction on connections marked with DSCP CS1 (8), and apply the DSCP tag.
iptables -t mangle -A PREROUTING -m connmark --mark 8 -j DSCP --set-dscp 8
Low priority traffic will only be guaranteed a very small amount of bandwidth, but it can use all the bandwidth if nothing else is using it.
Maybe a bit less if G.INP is in use, so 53.0/7.7 should be o problem for your sync, assuming that BT does not use a traffic shaper at their side. Could you please post a speedtest with SQM disabled (and one just after that with SQM enabled again? To get an idea what kind of bandwidth your link can actualy deliver.
Could you log into your router via ssh and run the following commands and copy and paste the output here, please:
cat /etc/config/sqm
ifstatus wan
tc -s qdisc
(I know you posted tc -s qdisc above, but it would be nice to see this again with the config sqm contents).
That is somewhat easier to look at than screen shots
Yes. Personally I have all my SQM related rules/commands in a separate script and launch that from the custom rules script, but it amounts to the same thing.
I've got lots of classification rules so I've optimised my setup by ensuring that only the first packet on each connection goes through the full ruleset. Packets on established connections go through a much smaller set of reclassification rules, which downgrade the priority of large downloads on web ports and things like that.
Thanks. So the 53 Mbps without SQM results indicates, that at least towards netflix's CDN nodes you do not see goodput commensurate with your Sync. That said your selected 50 Mbps for SQM should still work, and: 50 * ((1500-8-20-20)/(1526)) = 47.575 Mbps
seems close enough to the measured 46 Mbps (which due to rounding can be between [45.5 and 46.5[) to be acceptable (at least to me ). So things seem to be configured okayish.
Now on to your network, I assume you only operate a single WiFi router and all machines connect to that directly, so no additional router or AP in use?
Specifically, with your torrent versus browsing tests, were both machines connected via cables? The question is basically is the issie caused by sqm on the wan link or is it a secondary wifi issue?
The IP profile for my line - just tested - is 56Mbps so 53Mbps throughput would seem to tally up with that reasonably well. I am using PPPoE.
On my network, I have a TP-LINK Archer C7 which performs the routing and DHCP and then I have a separate mesh network via Plume which connects to the Archer C7. That provides all of the Wi-Fi in the house, hence the Wi-Fi on the Archer C7 is disabled and not in use.
For the torrenting test, one machine is connected via a cable and the other via Wi-Fi.
But I ran a ping from the router directly and I could see ping spikes upwards of 30ms+ (8ms is my unloaded ping). So possibly not enough on its own to cause an issue but I think this confirms Wi-Fi isn't entirely at fault.
Mmmh, if you switch roles between the browsing and torrenting machine, does the latency effect stay the same?
And for the latency test from the router, could you try to run something like mtr -ezb4 8.8.8.8 while performing your test, with different endhosts to see whether under load it is only the RTT to the emd host that increases or whether you see an RTT "step" along the path?
Mmmh, looking at the worst case RTT, the issue seems to happen after/upstream of your router. If true this would indicate that SQM is not going to be able fix your latency issues... since it is not in control of the true bottleneck.
Maybe you can repeat this test with different end points for mtr, like e.g. 1.1.1.1 and 9.9.9.9 (other anycasted DNS servers that hopefully resolve to instances in CDNs nearby).
Also, it might be interesting to repeat this test with the sqm set to 25 Mbps.