This is going to be about 800 questions so I apologize in advance... Is there any sort of "QoS rules 101" outline anywhere? I'm toying with it to get it to behave like I want, but I am encountering problems and realizing that it might just be because I'm not setting it up properly.
I always like good questions Makes me think and gives me a chance to double check things. And to give someone a chance to correct me when I'm wrong
User defined QoS rules - This is where I have the most questions, particularly surrounding leaving fields empty.
If I leave the source IP/MAC empty, I assume it just treats the type of traffic regardless of the source/destination device.
True, any traffic of the selected protocol regardless of port.
Is the reverse true - specifiy the source IP/MAC and leave the port empty, and all traffic to/from a device is treated in a particular way?
Right again
The "Transferred" fields - I assume it's a min/max, but same questions surrounding blanks. I see 0~512 for the HTTPS for instance. But then file transfer is 512~(blank). So sensibly that means no max, but if you don't want to specifiy the size at all, leave it completely blank?
You are on a roll
Is that the same as 0~(blank)?
From an end user point of view it's the same, but not the same from the point of view of optimizing iptables/cpu utilization. If you specify limits, it means the QoS iptables chain must be run for each matching packet to check the number of bytes transferred. If you don't specify limits, it means we can set the priority and restore it as the transfer continues without having to run the QoS chain again. My recommendation would be to use transfer limits only where it really makes sense to do so.
And beyond that, how do you come up with sensible values?
Research and tuning to what you want in your environment. For example, I want to throttle back big downloads a bit, but allow full bandwidth to web browsing. A bit of google searching found that the average web site transfer was 1600KB in 2014....so I set my web limit to 0-2048K. (This is what the default rules are trying to do, but their 512K limit seems a bit out of date).
User defined priorities - The maximums make sense here, but I'm curious about the minimums. The effects of having the minimums for upload being too high/low aren't clear.
The min/max values are used in setting up the tc qdisc (Traffic Control Queuing Discipline) classes. Think of the min as the target value you want to achieve, but it's OK to go up to the maximum if you can. It also controls how the available bandwidth is 'shared' between the various tc classes...when one class can give up some bandwidth to help another class meet it's target. So the min/max helps to control which class will be impacted first and by how much as the link gets saturated.
Highest Priority packet (ACK/SYN/FIN/RST/ICMP) - I have done some rudimentary research on my own and have some borderline working knowledge of what's going on here, but I haven't decided if there's any reason to deviate from the default values here. But frankly it's a little further down the todo list right at the moment.
Not much to add here, except when you check the box it's added to the 'Highest' priority tc class. Unchecked, it falls to the default priority setting.
Just one other thing bears mentioning again. The rules are processed in order, first to last. So for example when you are adding both application (specifying only a port) and client (specifying only a MAC), you need to think of which one you want to take precedence.