Blame man/man8/tc-sfb.8

Packit d3f73b
.TH SFB 8 "August 2011" "iproute2" "Linux"
Packit d3f73b
.SH NAME
Packit d3f73b
sfb \- Stochastic Fair Blue
Packit d3f73b
.SH SYNOPSIS
Packit d3f73b
.B tc qdisc ... blue
Packit d3f73b
.B rehash
Packit d3f73b
milliseconds
Packit d3f73b
.B db
Packit d3f73b
milliseconds
Packit d3f73b
.B limit
Packit d3f73b
packets
Packit d3f73b
.B max
Packit d3f73b
packets
Packit d3f73b
.B target
Packit d3f73b
packets
Packit d3f73b
.B increment
Packit d3f73b
float
Packit d3f73b
.B decrement
Packit d3f73b
float
Packit d3f73b
.B penalty_rate
Packit d3f73b
packets per second
Packit d3f73b
.B penalty_burst
Packit d3f73b
packets
Packit d3f73b
Packit d3f73b
.SH DESCRIPTION
Packit d3f73b
Stochastic Fair Blue is a classless qdisc to manage congestion based on
Packit d3f73b
packet loss and link utilization history while trying to prevent
Packit d3f73b
non-responsive flows (i.e. flows that do not react to congestion marking
Packit d3f73b
or dropped packets) from impacting performance of responsive flows.
Packit d3f73b
Unlike RED, where the marking probability has to be configured, BLUE
Packit d3f73b
tries to determine the ideal marking probability automatically.
Packit d3f73b
Packit d3f73b
.SH ALGORITHM
Packit d3f73b
Packit d3f73b
The
Packit d3f73b
.B BLUE
Packit d3f73b
algorithm maintains a probability which is used to mark or drop packets
Packit d3f73b
that are to be queued. If the queue overflows, the mark/drop probability
Packit d3f73b
is increased. If the queue becomes empty, the probability is decreased. The
Packit d3f73b
.B Stochastic Fair Blue
Packit d3f73b
(SFB) algorithm is designed to protect TCP flows against non-responsive flows.
Packit d3f73b
Packit d3f73b
This SFB implementation maintains 8 levels of 16 bins each for accounting.
Packit d3f73b
Each flow is mapped into a bin of each level using a per-level hash value.
Packit d3f73b
Packit d3f73b
Every bin maintains a marking probability, which gets increased or decreased
Packit d3f73b
based on bin occupancy. If the number of packets exceeds the size of that
Packit d3f73b
bin, the marking probability is increased. If the number drops to zero, it
Packit d3f73b
is decreased.
Packit d3f73b
Packit d3f73b
The marking probability is based on the minimum value of all bins a flow is
Packit d3f73b
mapped into, thus, when a flow does not respond to marking or gradual packet
Packit d3f73b
drops, the marking probability quickly reaches one.
Packit d3f73b
Packit d3f73b
In this case, the flow is rate-limited to
Packit d3f73b
.B penalty_rate
Packit d3f73b
packets per second.
Packit d3f73b
Packit d3f73b
.SH LIMITATIONS
Packit d3f73b
Packit d3f73b
Due to SFBs nature, it is possible for responsive flows to share all of its bins
Packit d3f73b
with a non-responsive flow, causing the responsive flow to be misidentified as
Packit d3f73b
being non-responsive.
Packit d3f73b
Packit d3f73b
The probability of a responsive flow to be misidentified is dependent on
Packit d3f73b
the number of non-responsive flows, M. It is (1 - (1 - (1 / 16.0)) ** M) **8,
Packit d3f73b
so for example with 10 non-responsive flows approximately 0.2% of responsive flows
Packit d3f73b
will be misidentified.
Packit d3f73b
Packit d3f73b
To mitigate this, SFB performs performs periodic re-hashing to avoid
Packit d3f73b
misclassification for prolonged periods of time.
Packit d3f73b
Packit d3f73b
The default hashing method will use source and destination ip addresses and port numbers
Packit d3f73b
if possible, and also supports tunneling protocols.
Packit d3f73b
Alternatively, an external classifier can be configured, too.
Packit d3f73b
Packit d3f73b
.SH PARAMETERS
Packit d3f73b
.TP
Packit d3f73b
rehash
Packit d3f73b
Time interval in milliseconds when queue perturbation occurs to avoid erroneously
Packit d3f73b
detecting unrelated, responsive flows as being part of a non-responsive flow for
Packit d3f73b
prolonged periods of time.
Packit d3f73b
Defaults to 10 minutes.
Packit d3f73b
.TP
Packit d3f73b
db
Packit d3f73b
Double buffering warmup wait time, in milliseconds.
Packit d3f73b
To avoid destroying the probability history when rehashing is performed, this
Packit d3f73b
implementation maintains a second set of levels/bins as described in section
Packit d3f73b
4.4 of the SFB reference.
Packit d3f73b
While one set is used to manage the queue, a second set is warmed up:
Packit d3f73b
Whenever a flow is then determined to be non-responsive, the marking
Packit d3f73b
probabilities in the second set are updated. When the rehashing
Packit d3f73b
happens, these bins will be used to manage the queue and all non-responsive
Packit d3f73b
flows can be rate-limited immediately.
Packit d3f73b
This value determines how much time has to pass before the 2nd set
Packit d3f73b
will start to be warmed up.
Packit d3f73b
Defaults to one minute, should be lower than
Packit d3f73b
.B
Packit d3f73b
rehash.
Packit d3f73b
.TP
Packit d3f73b
limit
Packit d3f73b
Hard limit on the real (not average) total queue size in packets.
Packit d3f73b
Further packets are dropped. Defaults to the transmit queue length of the
Packit d3f73b
device the qdisc is attached to.
Packit d3f73b
.TP
Packit d3f73b
max
Packit d3f73b
Maximum length of a buckets queue, in packets, before packets start being
Packit d3f73b
dropped. Should be sightly larger than
Packit d3f73b
.B target
Packit d3f73b
, but should not be set to values exceeding 1.5 times that of
Packit d3f73b
.B target .
Packit d3f73b
Defaults to 25.
Packit d3f73b
.TP
Packit d3f73b
target
Packit d3f73b
The desired average bin length. If the bin queue length reaches this value,
Packit d3f73b
the marking probability is increased by
Packit d3f73b
.B increment.
Packit d3f73b
The default value depends on the
Packit d3f73b
.B max
Packit d3f73b
setting, with max set to 25
Packit d3f73b
.B target
Packit d3f73b
will default to 20.
Packit d3f73b
.TP
Packit d3f73b
increment
Packit d3f73b
A value used to increase the marking probability when the queue appears
Packit d3f73b
to be over-used. Must be between 0 and 1.0. Defaults to 0.00050.
Packit d3f73b
.TP
Packit d3f73b
decrement
Packit d3f73b
Value used to decrease the marking probability when the queue is found
Packit d3f73b
to be empty. Must be between 0 and 1.0.
Packit d3f73b
Defaults to 0.00005.
Packit d3f73b
.TP
Packit d3f73b
penalty_rate
Packit d3f73b
The maximum number of packets belonging to flows identified as being
Packit d3f73b
non-responsive that can be enqueued per second. Once this number has been
Packit d3f73b
reached, further packets of such non-responsive flows are dropped.
Packit d3f73b
Set this to a reasonable fraction of your uplink throughput; the
Packit d3f73b
default value of 10 packets is probably too small.
Packit d3f73b
.TP
Packit d3f73b
penalty_burst
Packit d3f73b
The number of packets a flow is permitted to exceed the penalty rate before packets
Packit d3f73b
start being dropped.
Packit d3f73b
Defaults to 20 packets.
Packit d3f73b
Packit d3f73b
.SH STATISTICS
Packit d3f73b
Packit d3f73b
This qdisc exposes additional statistics via 'tc -s qdisc' output.
Packit d3f73b
These are:
Packit d3f73b
.TP
Packit d3f73b
earlydrop
Packit d3f73b
The number of packets dropped before a per-flow queue was full.
Packit d3f73b
.TP
Packit d3f73b
ratedrop
Packit d3f73b
The number of packets dropped because of rate-limiting.
Packit d3f73b
If this value is high, there are many non-reactive flows being
Packit d3f73b
sent through sfb. In such cases, it might be better to
Packit d3f73b
embed sfb within a classful qdisc to better control such
Packit d3f73b
flows using a different, shaping qdisc.
Packit d3f73b
.TP
Packit d3f73b
bucketdrop
Packit d3f73b
The number of packets dropped because a per-flow queue was full.
Packit d3f73b
High bucketdrop may point to a high number of aggressive, short-lived
Packit d3f73b
flows.
Packit d3f73b
.TP
Packit d3f73b
queuedrop
Packit d3f73b
The number of packets dropped due to reaching limit. This should normally be 0.
Packit d3f73b
.TP
Packit d3f73b
marked
Packit d3f73b
The number of packets marked with ECN.
Packit d3f73b
.TP
Packit d3f73b
maxqlen
Packit d3f73b
The length of the current longest per-flow (virtual) queue.
Packit d3f73b
.TP
Packit d3f73b
maxprob
Packit d3f73b
The maximum per-flow drop probability. 1 means that some
Packit d3f73b
flows have been detected as non-reactive.
Packit d3f73b
Packit d3f73b
.SH NOTES
Packit d3f73b
Packit d3f73b
SFB automatically enables use of Explicit Congestion Notification (ECN).
Packit d3f73b
Also, this SFB implementation does not queue packets itself.
Packit d3f73b
Rather, packets are enqueued to the inner qdisc (defaults to pfifo).
Packit d3f73b
Because sfb maintains virtual queue states, the inner qdisc must not
Packit d3f73b
drop a packet previously queued.
Packit d3f73b
Furthermore, if a buckets queue has a very high marking rate,
Packit d3f73b
this implementation will start dropping packets instead of
Packit d3f73b
marking them, as such a situation points to either bad congestion, or an
Packit d3f73b
unresponsive flow.
Packit d3f73b
Packit d3f73b
.SH EXAMPLE & USAGE
Packit d3f73b
Packit d3f73b
To attach to interface $DEV, using default options:
Packit d3f73b
.P
Packit d3f73b
# tc qdisc add dev $DEV handle 1: root sfb
Packit d3f73b
Packit d3f73b
Only use destination ip addresses for assigning packets to bins, perturbing
Packit d3f73b
hash results every 10 minutes:
Packit d3f73b
.P
Packit d3f73b
# tc filter add dev $DEV parent 1: handle 1 flow hash keys dst perturb 600
Packit d3f73b
Packit d3f73b
.SH SEE ALSO
Packit d3f73b
.BR tc (8),
Packit d3f73b
.BR tc-red (8),
Packit d3f73b
.BR tc-sfq (8)
Packit d3f73b
.SH SOURCES
Packit d3f73b
.TP
Packit d3f73b
o
Packit d3f73b
W. Feng, D. Kandlur, D. Saha, K. Shin, BLUE: A New Class of Active Queue Management Algorithms,
Packit d3f73b
U. Michigan CSE-TR-387-99, April 1999.
Packit d3f73b
Packit d3f73b
.SH AUTHORS
Packit d3f73b
Packit d3f73b
This SFB implementation was contributed by Juliusz Chroboczek and Eric Dumazet.