| 1 |
.TH FQ-PIE 8 "23 January 2020" "iproute2" "Linux" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
|
| 5 |
FQ-PIE - Flow Queue Proportional Integral controller Enhanced |
| 6 |
|
| 7 |
.SH SYNOPSIS |
| 8 |
|
| 9 |
.B tc qdisc ... fq_pie |
| 10 |
[ \fBlimit\fR PACKETS ] [ \fBflows\fR NUMBER ] |
| 11 |
.br |
| 12 |
\ |
| 13 |
[ \fBtarget\fR TIME ] [ \fBtupdate\fR TIME ] |
| 14 |
.br |
| 15 |
\ |
| 16 |
[ \fBalpha\fR NUMBER ] [ \fBbeta\fR NUMBER ] |
| 17 |
.br |
| 18 |
\ |
| 19 |
[ \fBquantum\fR BYTES ] [ \fBmemory_limit\fR BYTES ] |
| 20 |
.br |
| 21 |
\ |
| 22 |
[ \fBecn_prob\fR PERENTAGE ] [ [\fBno\fR]\fBecn\fR ] |
| 23 |
.br |
| 24 |
\ |
| 25 |
[ [\fBno\fR]\fBbytemode\fR ] [ [\fBno_\fR]\fBdq_rate_estimator\fR ] |
| 26 |
|
| 27 |
.SH DESCRIPTION |
| 28 |
FQ-PIE (Flow Queuing with Proportional Integral controller Enhanced) is a |
| 29 |
queuing discipline that combines Flow Queuing with the PIE AQM scheme. FQ-PIE |
| 30 |
uses a Jenkins hash function to classify incoming packets into different flows |
| 31 |
and is used to provide a fair share of the bandwidth to all the flows using the |
| 32 |
qdisc. Each such flow is managed by the PIE algorithm. |
| 33 |
|
| 34 |
.SH ALGORITHM |
| 35 |
The FQ-PIE algorithm consists of two logical parts: the scheduler which selects |
| 36 |
which queue to dequeue a packet from, and the PIE AQM which works on each of the |
| 37 |
queues. The major work of FQ-PIE is mostly in the scheduling part. The |
| 38 |
interaction between the scheduler and the PIE algorithm is straight forward. |
| 39 |
|
| 40 |
During the enqueue stage, a hashing-based scheme is used, where flows are hashed |
| 41 |
into a number of buckets with each bucket having its own queue. The number of |
| 42 |
buckets is configurable, and presently defaults to 1024 in the implementation. |
| 43 |
The flow hashing is performed on the 5-tuple of source and destination IP |
| 44 |
addresses, port numbers and IP protocol number. Once the packet has been |
| 45 |
successfully classified into a queue, it is handed over to the PIE algorithm |
| 46 |
for enqueuing. It is then added to the tail of the selected queue, and the |
| 47 |
queue's byte count is updated by the packet size. If the queue is not currently |
| 48 |
active (i.e., if it is not in either the list of new or the list of old queues) |
| 49 |
, it is added to the end of the list of new queues, and its number of credits |
| 50 |
is initiated to the configured quantum. Otherwise, the queue is left in its |
| 51 |
current queue list. |
| 52 |
|
| 53 |
During the dequeue stage, the scheduler first looks at the list of new queues; |
| 54 |
for the queue at the head of that list, if that queue has a negative number of |
| 55 |
credits (i.e., it has already dequeued at least a quantum of bytes), it is given |
| 56 |
an additional quantum of credits, the queue is put onto the end of the list of |
| 57 |
old queues, and the routine selects the next queue and starts again. Otherwise, |
| 58 |
that queue is selected for dequeue again. If the list of new queues is empty, |
| 59 |
the scheduler proceeds down the list of old queues in the same fashion |
| 60 |
(checking the credits, and either selecting the queue for dequeuing, or adding |
| 61 |
credits and putting the queue back at the end of the list). After having |
| 62 |
selected a queue from which to dequeue a packet, the PIE algorithm is invoked |
| 63 |
on that queue. |
| 64 |
|
| 65 |
Finally, if the PIE algorithm does not return a packet, then the queue must be |
| 66 |
empty and the scheduler does one of two things: |
| 67 |
|
| 68 |
If the queue selected for dequeue came from the list of new queues, it is moved |
| 69 |
to the end of the list of old queues. If instead it came from the list of old |
| 70 |
queues, that queue is removed from the list, to be added back (as a new queue) |
| 71 |
the next time a packet arrives that hashes to that queue. Then (since no packet |
| 72 |
was available for dequeue), the whole dequeue process is restarted from the |
| 73 |
beginning. |
| 74 |
|
| 75 |
If, instead, the scheduler did get a packet back from the PIE algorithm, it |
| 76 |
subtracts the size of the packet from the byte credits for the selected queue |
| 77 |
and returns the packet as the result of the dequeue operation. |
| 78 |
|
| 79 |
.SH PARAMETERS |
| 80 |
.SS limit |
| 81 |
It is the limit on the queue size in packets. Incoming packets are dropped when |
| 82 |
the limit is reached. The default value is 10240 packets. |
| 83 |
|
| 84 |
.SS flows |
| 85 |
It is the number of flows into which the incoming packets are classified. Due |
| 86 |
to the stochastic nature of hashing, multiple flows may end up being hashed |
| 87 |
into the same slot. Newer flows have priority over older ones. This |
| 88 |
parameter can be set only at load time since memory has to be allocated for |
| 89 |
the hash table. The default value is 1024. |
| 90 |
|
| 91 |
.SS target |
| 92 |
It is the queue delay which the PIE algorithm tries to maintain. The default |
| 93 |
target delay is 15ms. |
| 94 |
|
| 95 |
.SS tupdate |
| 96 |
It is the time interval at which the system drop probability is calculated. |
| 97 |
The default is 15ms. |
| 98 |
|
| 99 |
.SS alpha |
| 100 |
.SS beta |
| 101 |
alpha and beta are parameters chosen to control the drop probability. These |
| 102 |
should be in the range between 0 and 32. |
| 103 |
|
| 104 |
.SS quantum |
| 105 |
quantum signifies the number of bytes that may be dequeued from a queue before |
| 106 |
switching to the next queue in the deficit round robin scheme. |
| 107 |
|
| 108 |
.SS memory_limit |
| 109 |
It is the maximum total memory allowed for packets of all flows. The default is |
| 110 |
32Mb. |
| 111 |
|
| 112 |
.SS ecn_prob |
| 113 |
It is the drop probability threshold below which packets will be ECN marked |
| 114 |
instead of getting dropped. The default is 10%. Setting this parameter requires |
| 115 |
\fBecn\fR to be enabled. |
| 116 |
|
| 117 |
.SS \fR[\fBno\fR]\fBecn\fR |
| 118 |
It has the same semantics as \fBpie\fR and can be used to mark packets |
| 119 |
instead of dropping them. If \fBecn\fR has been enabled, \fBnoecn\fR can |
| 120 |
be used to turn it off and vice-a-versa. |
| 121 |
|
| 122 |
.SS \fR[\fBno\fR]\fBbytemode\fR |
| 123 |
It is used to scale drop probability proportional to packet size |
| 124 |
\fBbytemode\fR to turn on bytemode, \fBnobytemode\fR to turn off |
| 125 |
bytemode. By default, \fBbytemode\fR is turned off. |
| 126 |
|
| 127 |
.SS \fR[\fBno_\fR]\fBdq_rate_estimator\fR |
| 128 |
\fBdq_rate_estimator\fR can be used to calculate queue delay using Little's |
| 129 |
Law, \fBno_dq_rate_estimator\fR can be used to calculate queue delay |
| 130 |
using timestamp. By default, \fBdq_rate_estimator\fR is turned off. |
| 131 |
|
| 132 |
.SH EXAMPLES |
| 133 |
# tc qdisc add dev eth0 root fq_pie |
| 134 |
.br |
| 135 |
# tc -s qdisc show dev eth0 |
| 136 |
.br |
| 137 |
qdisc fq_pie 8001: root refcnt 2 limit 10240p flows 1024 target 15.0ms tupdate |
| 138 |
16.0ms alpha 2 beta 20 quantum 1514b memory_limit 32Mb ecn_prob 10 |
| 139 |
Sent 159173586 bytes 105261 pkt (dropped 24, overlimits 0 requeues 0) |
| 140 |
backlog 75700b 50p requeues 0 |
| 141 |
pkts_in 105311 overlimit 0 overmemory 0 dropped 24 ecn_mark 0 |
| 142 |
new_flow_count 7332 new_flows_len 0 old_flows_len 4 memory_used 108800 |
| 143 |
|
| 144 |
# tc qdisc add dev eth0 root fq_pie dq_rate_estimator |
| 145 |
.br |
| 146 |
# tc -s qdisc show dev eth0 |
| 147 |
.br |
| 148 |
qdisc fq_pie 8001: root refcnt 2 limit 10240p flows 1024 target 15.0ms tupdate |
| 149 |
16.0ms alpha 2 beta 20 quantum 1514b memory_limit 32Mb ecn_prob 10 |
| 150 |
dq_rate_estimator |
| 151 |
Sent 8263620 bytes 5550 pkt (dropped 4, overlimits 0 requeues 0) |
| 152 |
backlog 805448b 532p requeues 0 |
| 153 |
pkts_in 6082 overlimit 0 overmemory 0 dropped 4 ecn_mark 0 |
| 154 |
new_flow_count 94 new_flows_len 0 old_flows_len 8 memory_used 1157632 |
| 155 |
|
| 156 |
.SH SEE ALSO |
| 157 |
.BR tc (8), |
| 158 |
.BR tc-pie (8), |
| 159 |
.BR tc-fq_codel (8) |
| 160 |
|
| 161 |
.SH SOURCES |
| 162 |
RFC 8033: https://tools.ietf.org/html/rfc8033 |
| 163 |
|
| 164 |
.SH AUTHORS |
| 165 |
FQ-PIE was implemented by Mohit P. Tahiliani. Please report corrections to the |
| 166 |
Linux Networking mailing list <[email protected]>. |