...
Next figure explains the difference between rate limiting and rate equalizing:
As you can see in the first case all traffic exceeds a specific rate and is dropped. In another case, traffic exceeds a specific rate and is delayed in the queue and transmitted later when it is possible, but note that the packet can be delayed only until the queue is not full. If there is no more space in the queue buffer, packets are dropped.
...
In the following example, we have one SOHO device with two connected units PC and Server.
We have a 15 Mbps connection available from ISP in this case. We want to be sure the server receives enough traffic, so we will configure a simple queue with a limit-at parameter to guarantee a server to receive 5Mbps:
...
The queue tree creates only a one-directional queue in one of the HTBs. It is also the only way how to add a queue on the a separate interface. This way it is possible to ease mangle configuration - you don't need separate marks for download and upload - only the upload will get to the Public interface and only the download will get to a Private interface. The main difference from Simple Queues is that the Queue tree is not ordered - all traffic passes it together.
...
Random Early Drop is a queuing mechanism that tries to avoid network congestion by controlling the average queue size. The average queue size is compared to two thresholds: a minimum (minth) and maximum (maxth) threshold. If the average queue size (avgq) is less than the minimum threshold, no packets are dropped. When the average queue size is greater than the maximum threshold, all incoming packets are dropped. But if the average queue size is between the minimum and maximum thresholds packets are randomly dropped with probability Pd where probability is exact a function of the average queue size: Pd = Pmax(avgq – minth)/ (maxth - minth). If the average queue grows, the probability of dropping incoming packets grows too. Pmax - ratio, which can adjust the packet discarding probability abruptness, (the simplest case Pmax can be equal to one. The 8.2 diagram shows the packet drop probability in the RED algorithm.
SFQ
Stochastic Fairness Queuing (SFQ) is ensured by hashing and round-robin algorithms. SFQ is called "Stochastic" because it does not really allocate a queue for each flow, it has an algorithm that divides traffic over a limited number of queues (1024) using a hashing algorithm.
Traffic flow may be uniquely identified by 4 options (src-address, dst-address, src-port, and dst-port), so these parameters are used by the SFQ hashing algorithm to classify packets into one of 1024 possible sub-streams. Then round-robin algorithm will start to distribute available bandwidth to all sub-streams, on each round giving sfq-allot bytes of traffic. The whole SFQ queue can contain 128 packets and there are 1024 sub-streams available. The 8.3 diagram shows the SFQ operation:
PCQ
PCQ algorithm is very simple - at first, it uses selected classifiers to distinguish one sub-stream from another, then applies individual FIFO queue size and limitation on every sub-stream, then groups all sub-streams together and applies global queue size and limitation.
...
It is possible to assign a speed limitation to sub-streams with the pcq-rate option. If "pcq-rate=0" sub-streams will divide available traffic equally.
For example, instead of having 100 queues with 1000kbps limitation for download, we can have one PCQ queue with 100 sub-streams
...
CoDel (Controlled-Delay Active Queue Management) algorithm uses the local minimum queue as a measure of the persistent queue, similarly, it uses a minimum delay parameter as a measure of the standing queue delay. Queue size is calculated using packet residence time in the queue.
Properties
Property | Description |
---|---|
codel-ce-threshold (default: ) | Marks packets above a configured threshold with ECN. |
codel-ecn (default: no) | An option is used to mark packets instead of dropping them. |
codel-interval (default: 100ms) | Interval should be set on the order of the worst-case RTT through the bottleneck giving endpoints sufficient time to react. |
codel-limit (default: 1000) | Queue limit, when the limit is reached, incoming packets are dropped. |
codel-target (default: 5ms) | Represents an acceptable minimum persistent queue delay. |
FQ-Codel
CoDel - Fair Queuing (FQ) with Controlled Delay (CoDel) uses a randomly determined model to classify incoming packets into different flows and is used to provide a fair share of the bandwidth to all the flows using the queue. Each flow is managed using CoDel queuing discipline which internally uses a FIFO algorithm.
Properties
Property | Description |
---|---|
fq-codel-ce-threshold (default: ) | Marks packets above a configured threshold with ECN. |
fq-codel-ecn (default: yes) | An option is used to mark packets instead of dropping them. |
fq-codel-flows (default: 1024) | A number of flows into which the incoming packets are classified. |
fq-codel-interval (default: 100ms) | Interval should be set on the order of the worst-case RTT through the bottleneck giving endpoints sufficient time to react. |
fq-codel-limit (default: 10240) | Queue limit, when the limit is reached, incoming packets are dropped. |
fq-codel-memlimit (default: 32.0MiB) | A total number of bytes that can be queued in this FQ-CoDel instance. Will be enforced from the fq-codel-limit parameter. |
fq-codel-quantum (default: 1514) | A number of bytes used as 'deficit' in the fair queuing algorithm. Default (1514 bytes) corresponds to the Ethernet MTU plus the hardware header length of 14 bytes. |
fq-codel-target (default: 5ms) | Represents an acceptable minimum persistent queue delay. |
CAKE
CAKE - Common Applications Kept Enhanced (CAKE) implemented as a queue discipline (qdisc) for the Linux kernel uses COBALT (AQM algorithm combining Codel and BLUE) and a variant of DRR++ for flow isolation. In other words, Cake’s fundamental design goal is user-friendliness. All settings are optional; the default settings are chosen to be practical in most common deployments. In most cases, the configuration requires only a bandwidth parameter to get useful results,
Properties
Property | Description |
---|---|
cake-ack-filter (default: none ) | |
cake-atm (default: ) | Compensates for ATM cell framing, which is normally found on ADSL links. |
cake-autorate-ingress (default: ) | Automatic capacity estimation based on traffic arriving at this qdisc |
cake-bandwidth (default: ) | Sets the shaper bandwidth. |
cake-diffserv (default: diffserv3) | CAKE can divide traffic into "tins" based on the Diffserv field:
|
cake-flowmode (dsthost/dual-dsthost/dual-srchost/flowblind/flows/hosts/srchost/triple-isolate, default: triple-isolate) |
|
cake-memlimit (default: ) | Limit the memory consumed by Cake to LIMIT bytes. By default, the limit is calculated based on the bandwidth and RTT settings. |
cake-mpu ( -64 ... 256, default: ) | Rounds each packet (including overhead) up to a minimum length BYTES. |
cake-nat (default: no) | Instructs Cake to perform a NAT lookup before applying a flow-isolation rule. |
cake-overhead ( -64 ... 256, default: ) | Adds BYTES to the size of each packet. BYTES may be negative. |
cake-overhead-scheme (default: ) | |
cake-rtt (default: 100ms ) | Manually specify an RTT. Default 100ms is suitable for most Internet traffic. |
cake-rtt-scheme (datacentre/internet/interplanetary/lan/metro/none/oceanic/regional/satellite, default: ) |
|
cake-wash (default: no ) | Apply the wash option to clear all extra DiffServ (but not ECN bits), after priority queuing has taken place. |
Interface Queue
Code Block | ||
---|---|---|
| ||
/queue interface |
...