Blame man/man8/tc-fq_pie.8

Packit Service 3880ab
.TH FQ-PIE 8 "23 January 2020" "iproute2" "Linux"
Packit Service 3880ab
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
Packit Service 3880ab
FQ-PIE - Flow Queue Proportional Integral controller Enhanced
Packit Service 3880ab
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
Packit Service 3880ab
.B tc qdisc ... fq_pie
Packit Service 3880ab
[ \fBlimit\fR PACKETS ] [ \fBflows\fR NUMBER ]
Packit Service 3880ab
.br
Packit Service 3880ab
                    \
Packit Service 3880ab
[ \fBtarget\fR TIME ] [ \fBtupdate\fR TIME ]
Packit Service 3880ab
.br
Packit Service 3880ab
                    \
Packit Service 3880ab
[ \fBalpha\fR NUMBER ] [ \fBbeta\fR NUMBER ]
Packit Service 3880ab
.br
Packit Service 3880ab
                    \
Packit Service 3880ab
[ \fBquantum\fR BYTES ] [ \fBmemory_limit\fR BYTES ]
Packit Service 3880ab
.br
Packit Service 3880ab
                    \
Packit Service 3880ab
[ \fBecn_prob\fR PERENTAGE ] [ [\fBno\fR]\fBecn\fR ]
Packit Service 3880ab
.br
Packit Service 3880ab
                    \
Packit Service 3880ab
[ [\fBno\fR]\fBbytemode\fR ] [ [\fBno_\fR]\fBdq_rate_estimator\fR ]
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
FQ-PIE (Flow Queuing with Proportional Integral controller Enhanced) is a
Packit Service 3880ab
queuing discipline that combines Flow Queuing with the PIE AQM scheme. FQ-PIE
Packit Service 3880ab
uses a Jenkins hash function to classify incoming packets into different flows
Packit Service 3880ab
and is used to provide a fair share of the bandwidth to all the flows using the
Packit Service 3880ab
qdisc. Each such flow is managed by the PIE algorithm.
Packit Service 3880ab
Packit Service 3880ab
.SH ALGORITHM
Packit Service 3880ab
The FQ-PIE algorithm consists of two logical parts: the scheduler which selects
Packit Service 3880ab
which queue to dequeue a packet from, and the PIE AQM which works on each of the
Packit Service 3880ab
queues. The major work of FQ-PIE is mostly in the scheduling part. The
Packit Service 3880ab
interaction between the scheduler and the PIE algorithm is straight forward.
Packit Service 3880ab
Packit Service 3880ab
During the enqueue stage, a hashing-based scheme is used, where flows are hashed
Packit Service 3880ab
into a number of buckets with each bucket having its own queue. The number of
Packit Service 3880ab
buckets is configurable, and presently defaults to 1024 in the implementation.
Packit Service 3880ab
The flow hashing is performed on the 5-tuple of source and destination IP
Packit Service 3880ab
addresses, port numbers and IP protocol number. Once the packet has been
Packit Service 3880ab
successfully classified into a queue, it is handed over to the PIE algorithm
Packit Service 3880ab
for enqueuing. It is then added to the tail of the selected queue, and the
Packit Service 3880ab
queue's byte count is updated by the packet size. If the queue is not currently
Packit Service 3880ab
active (i.e., if it is not in either the list of new or the list of old queues)
Packit Service 3880ab
, it is added to the end of the list of new queues, and its number of credits
Packit Service 3880ab
is initiated to the configured quantum. Otherwise, the queue is left in its
Packit Service 3880ab
current queue list.
Packit Service 3880ab
Packit Service 3880ab
During the dequeue stage, the scheduler first looks at the list of new queues;
Packit Service 3880ab
for the queue at the head of that list, if that queue has a negative number of
Packit Service 3880ab
credits (i.e., it has already dequeued at least a quantum of bytes), it is given
Packit Service 3880ab
an additional quantum of credits, the queue is put onto the end of the list of
Packit Service 3880ab
old queues, and the routine selects the next queue and starts again. Otherwise,
Packit Service 3880ab
that queue is selected for dequeue again. If the list of new queues is empty,
Packit Service 3880ab
the scheduler proceeds down the list of old queues in the same fashion
Packit Service 3880ab
(checking the credits, and either selecting the queue for dequeuing, or adding
Packit Service 3880ab
credits and putting the queue back at the end of the list). After having
Packit Service 3880ab
selected a queue from which to dequeue a packet, the PIE algorithm is invoked
Packit Service 3880ab
on that queue.
Packit Service 3880ab
Packit Service 3880ab
Finally, if the PIE algorithm does not return a packet, then the queue must be
Packit Service 3880ab
empty and the scheduler does one of two things:
Packit Service 3880ab
Packit Service 3880ab
If the queue selected for dequeue came from the list of new queues, it is moved
Packit Service 3880ab
to the end of the list of old queues. If instead it came from the list of old
Packit Service 3880ab
queues, that queue is removed from the list, to be added back (as a new queue)
Packit Service 3880ab
the next time a packet arrives that hashes to that queue. Then (since no packet
Packit Service 3880ab
was available for dequeue), the whole dequeue process is restarted from the
Packit Service 3880ab
beginning.
Packit Service 3880ab
Packit Service 3880ab
If, instead, the scheduler did get a packet back from the PIE algorithm, it
Packit Service 3880ab
subtracts the size of the packet from the byte credits for the selected queue
Packit Service 3880ab
and returns the packet as the result of the dequeue operation.
Packit Service 3880ab
Packit Service 3880ab
.SH PARAMETERS
Packit Service 3880ab
.SS limit
Packit Service 3880ab
It is the limit on the queue size in packets. Incoming packets are dropped when
Packit Service 3880ab
the limit is reached. The default value is 10240 packets.
Packit Service 3880ab
Packit Service 3880ab
.SS flows
Packit Service 3880ab
It is the number of flows into which the incoming packets are classified. Due
Packit Service 3880ab
to the stochastic nature of hashing, multiple flows may end up being hashed
Packit Service 3880ab
into the same slot. Newer flows have priority over older ones. This
Packit Service 3880ab
parameter can be set only at load time since memory has to be allocated for
Packit Service 3880ab
the hash table. The default value is 1024.
Packit Service 3880ab
Packit Service 3880ab
.SS target
Packit Service 3880ab
It is the queue delay which the PIE algorithm tries to maintain. The default
Packit Service 3880ab
target delay is 15ms.
Packit Service 3880ab
Packit Service 3880ab
.SS tupdate
Packit Service 3880ab
It is the time interval at which the system drop probability is calculated.
Packit Service 3880ab
The default is 15ms.
Packit Service 3880ab
Packit Service 3880ab
.SS alpha
Packit Service 3880ab
.SS beta
Packit Service 3880ab
alpha and beta are parameters chosen to control the drop probability. These
Packit Service 3880ab
should be in the range between 0 and 32.
Packit Service 3880ab
Packit Service 3880ab
.SS quantum
Packit Service 3880ab
quantum signifies the number of bytes that may be dequeued from a queue before
Packit Service 3880ab
switching to the next queue in the deficit round robin scheme.
Packit Service 3880ab
Packit Service 3880ab
.SS memory_limit
Packit Service 3880ab
It is the maximum total memory allowed for packets of all flows. The default is
Packit Service 3880ab
32Mb.
Packit Service 3880ab
Packit Service 3880ab
.SS ecn_prob
Packit Service 3880ab
It is the drop probability threshold below which packets will be ECN marked
Packit Service 3880ab
instead of getting dropped. The default is 10%. Setting this parameter requires
Packit Service 3880ab
\fBecn\fR to be enabled.
Packit Service 3880ab
Packit Service 3880ab
.SS \fR[\fBno\fR]\fBecn\fR
Packit Service 3880ab
It has the same semantics as \fBpie\fR and can be used to mark packets
Packit Service 3880ab
instead of dropping them. If \fBecn\fR has been enabled, \fBnoecn\fR can
Packit Service 3880ab
be used to turn it off and vice-a-versa.
Packit Service 3880ab
Packit Service 3880ab
.SS \fR[\fBno\fR]\fBbytemode\fR
Packit Service 3880ab
It is used to scale drop probability proportional to packet size
Packit Service 3880ab
\fBbytemode\fR to turn on bytemode, \fBnobytemode\fR to turn off
Packit Service 3880ab
bytemode. By default, \fBbytemode\fR is turned off.
Packit Service 3880ab
Packit Service 3880ab
.SS \fR[\fBno_\fR]\fBdq_rate_estimator\fR
Packit Service 3880ab
\fBdq_rate_estimator\fR can be used to calculate queue delay using Little's
Packit Service 3880ab
Law, \fBno_dq_rate_estimator\fR can be used to calculate queue delay
Packit Service 3880ab
using timestamp. By default, \fBdq_rate_estimator\fR is turned off.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
# tc qdisc add dev eth0 root fq_pie
Packit Service 3880ab
.br
Packit Service 3880ab
# tc -s qdisc show dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc fq_pie 8001: root refcnt 2 limit 10240p flows 1024 target 15.0ms tupdate
Packit Service 3880ab
16.0ms alpha 2 beta 20 quantum 1514b memory_limit 32Mb ecn_prob 10
Packit Service 3880ab
 Sent 159173586 bytes 105261 pkt (dropped 24, overlimits 0 requeues 0)
Packit Service 3880ab
 backlog 75700b 50p requeues 0
Packit Service 3880ab
  pkts_in 105311 overlimit 0 overmemory 0 dropped 24 ecn_mark 0
Packit Service 3880ab
  new_flow_count 7332 new_flows_len 0 old_flows_len 4 memory_used 108800
Packit Service 3880ab
Packit Service 3880ab
# tc qdisc add dev eth0 root fq_pie dq_rate_estimator
Packit Service 3880ab
.br
Packit Service 3880ab
# tc -s qdisc show dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc fq_pie 8001: root refcnt 2 limit 10240p flows 1024 target 15.0ms tupdate
Packit Service 3880ab
16.0ms alpha 2 beta 20 quantum 1514b memory_limit 32Mb ecn_prob 10
Packit Service 3880ab
dq_rate_estimator
Packit Service 3880ab
 Sent 8263620 bytes 5550 pkt (dropped 4, overlimits 0 requeues 0)
Packit Service 3880ab
 backlog 805448b 532p requeues 0
Packit Service 3880ab
  pkts_in 6082 overlimit 0 overmemory 0 dropped 4 ecn_mark 0
Packit Service 3880ab
  new_flow_count 94 new_flows_len 0 old_flows_len 8 memory_used 1157632
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR tc-pie (8),
Packit Service 3880ab
.BR tc-fq_codel (8)
Packit Service 3880ab
Packit Service 3880ab
.SH SOURCES
Packit Service 3880ab
RFC 8033: https://tools.ietf.org/html/rfc8033
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHORS
Packit Service 3880ab
FQ-PIE was implemented by Mohit P. Tahiliani. Please report corrections to the
Packit Service 3880ab
Linux Networking mailing list <netdev@vger.kernel.org>.