Linux QoS for humans
github.com
github.com
TCP will throttle down nicely to one packet in flight, and the connection won't stall, although it may be slow. Routers which discard all the packets from a single stream are doing a very bad job, unless they're dealing with hostile action.
Much of the trouble comes from network devices with big, dumb, FIFO buffers. DSL routers are notorious for this on their uplink side. So are Ethernet interfaces, which have a big FIFO buffer. It's important to avoid too much dumb buffering in the chain between TCP and the Ethernet cable/WiFi air link.
A typical problem is ACKs from downloads being lost during heavy uplink usage. If you're a choke point (much more bandwidth in than out), big dumb FIFO buffers will suck. You at least need fair queuing. The "bufferbloat" crowd is into this.
Linux QOS is more about fixing this as an endpoint. You're trying to avoid overloading the next choke point upstream. This works only if everybody using the next choke point upstream plays nice. One bad guy will ruin it for everybody.
Any packet you drop eventually has to be resent. Packet dropping should be rare. Again, each flow should be allowed at least one packet in flight. This keeps the connection moving forward, and it means the endpoints can measure round-trip time and bandwidth, which should be reasonably stable because the algorithm is deterministic.
If you have so many flows that you can't handle one packet in flight per flow, you're so badly overloaded that no congestion management strategy will work.
Fair queuing is about dropping the newest packet on the flow with the longest queue. Thus, each flow competes with itself, and over-sending penalizes itself.
We really need to get home router/modems, cable headends, and outgoing routers just before the air link for mobile fixed. Those are the big choke points. You can't fix this from the end points alone.
I completely agree that "tc" is one of the most confusing CLI programs I have encountered. tc & iptables pushed me away from Linux (for router purposes) to *BSD and pf has been a refreshing experience.
OK, I confess... all my life I've reused a tc script I inherited from a gentoo sysadmin.
It works, I edit the available bandwitch and magic happens. The iptables cmd is more easy to understand and I even did an output parser and input generators, but tc is hard.
It just uses a packet mark convention. There is no magic.
FireHOL: https://github.com/firehol/firehol/blob/master/sbin/firehol....
FireQOS: https://github.com/firehol/firehol/blob/master/sbin/fireqos....
Link-Balancer: https://github.com/firehol/firehol/blob/master/sbin/link-bal...
tcng on $ourceForge: http://tcng.sourceforge.net/
Source code mirror by Debian (if wary of downloading from $ourceForge): https://packages.debian.org/source/wheezy/tcng
The QoS userspace interface (tc) has not changed much at all, and at least my configuration has no issues.
My only complaint is the fact is the proprietary nature of Mikrotik. When I was running a small linux box as a router, or when I was running DD-WRT I could always extend the functionality in the ways that's not possible with Mikrotik. The configuration, QoS, everything is Mikrotik specific. I understand that it's reminiscent of enterprise grade hardware though.
Wow, that "netdata" daemon/dashboard this is associated with is awesome. I'm wondering if it can be extended for more app metrics, like a custom solution we had at a former employer using grafana.
Regarding netdata, of course it can be extended. Check this: https://github.com/firehol/netdata/wiki/External-Plugins A lot of other users are already writing their plugins - check the github issues
I don't care about traffic (actually I don't want unrelated traffic - a lot of noise - the key resource wasted is my time), but I do care a lot about involvement.
Since a title can actually trigger involvement, I understand it is good, especially for the readers. Isn't it?
To my understanding, it is good since people that should have been informed about the context in question, have actually been found and informed.
Check this thread for example. A lot of people found something new, learned something. Compare it to the previous one. No one learned anything.
So, what do you think? Shall I pay some attention on titles and their effectiveness?
Please don't do things to make titles stand out, like using uppercase or exclamation points, or adding a parenthetical remark saying how great an article is. It's implicit in submitting something that you think it's important.
...
Otherwise please use the original title, unless it is misleading or linkbait.
Take also into account, I am the author of the original article too. So, would it be better to copy the old article to a new one with the new title?
You are avoiding the question though: Since a title triggers involvement, is experimentation on the titles something good or bad?
My understanding is one can only "shape" outbound traffic. You are under no control at all of the incoming packets.
Here's an example for something I was working on yesterday (traffic policing to simulate slow download):
sudo tc qdisc add dev eth0 handle ffff: ingress
sudo tc filter add dev etch0 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 30kbit burst 3k drop flowid :1
Here's an example of using IFB to shape incoming traffic (what the OP was referencing): http://serverfault.com/a/386791/301799http://www.bufferbloat.net/projects/cerowrt/wiki/Wondershape...
sudo wondershaper eth0 7500 850
sysctl -w net.core.default_qdisc=fq_codel
on as many machines as possible, and use something like OpenWRT's SQM instead of wondershaper on your router.
1. It seems like the first QoS-solution I ever used is still being actively developed. It’s called Mastershaper and you can find it here: https://oss.netshadow.net/redmine/projects/mastershaper Though it seems like the maintainer is doing some heavy work right now so there is no usable version at the moment. In my old days Mastershaper was programmed in PHP and it either worked with iptables as filter or with the faster tc-filters. It had a nice GUI and also some flow analysis through a graph. It was made to run under Debian and the like.
2. The other project I would like to mention is a router firmware called Tomato. The original website might be still available but the original author has ceased development for several years now. It’s only being developed by its community now. You can find the forum here: http://linksysinfo.org/index.php?forums/tomato-firmware.33/ This firmware can be run on several open commercial home-routers (MIPSR1, MIPSR2, ARM), one of them being the old and very popular WRT54GL. But of course it also runs on more recent models. Tomato has several flavours. Toastman’s Tomato is known for its well implemented QoS and stability. You can find it here: http://www.linksysinfo.org/index.php?threads/toastman-mips-a... Tomato probably has one of the most easily usable QoS-systems there is. Once installed, all you need to do is measure your line speed throughout the day, deduce a safety margin of about 15-30% to start with, enter your upstream and downstream values into the GUI, hit “Save” and you are running a pretty decently pre-configured QoS-system. It even supports overhead calculations for ADSL. Unfortunately it doesn’t work with IPv6, yet, and also uses the old netfilter L7-filters, which are pretty outdated. A switch to nDPI hasn’t been undertaken, yet. If you think about using Tomato with QoS, keep in mind that QoS needs a lot of CPU power, so it’s important to know your line speed and buy accordingly.
3. Another firmware that probably has well-made QoS is Gargoyle: https://www.gargoyle-router.com/ I haven’t been using it but maybe it’s worth a look.