]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/tc-sfb.8
bridge: mdb: add support for source address
[mirror_iproute2.git] / man / man8 / tc-sfb.8
CommitLineData
2587c01a
FW
1.TH SFB 8 "August 2011" "iproute2" "Linux"
2.SH NAME
3sfb \- Stochastic Fair Blue
4.SH SYNOPSIS
5.B tc qdisc ... blue
6.B rehash
7milliseconds
8.B db
9milliseconds
10.B limit
11packets
12.B max
13packets
14.B target
15packets
16.B increment
17float
18.B decrement
19float
20.B penalty_rate
21packets per second
22.B penalty_burst
23packets
24
25.SH DESCRIPTION
26Stochastic Fair Blue is a classless qdisc to manage congestion based on
27packet loss and link utilization history while trying to prevent
28non-responsive flows (i.e. flows that do not react to congestion marking
29or dropped packets) from impacting performance of responsive flows.
30Unlike RED, where the marking probability has to be configured, BLUE
31tries to determine the ideal marking probability automatically.
32
33.SH ALGORITHM
34
35The
36.B BLUE
37algorithm maintains a probability which is used to mark or drop packets
a89d5329 38that are to be queued. If the queue overflows, the mark/drop probability
2587c01a
FW
39is increased. If the queue becomes empty, the probability is decreased. The
40.B Stochastic Fair Blue
41(SFB) algorithm is designed to protect TCP flows against non-responsive flows.
42
43This SFB implementation maintains 8 levels of 16 bins each for accounting.
44Each flow is mapped into a bin of each level using a per-level hash value.
45
46Every bin maintains a marking probability, which gets increased or decreased
a89d5329
47based on bin occupancy. If the number of packets exceeds the size of that
48bin, the marking probability is increased. If the number drops to zero, it
2587c01a
FW
49is decreased.
50
51The marking probability is based on the minimum value of all bins a flow is
52mapped into, thus, when a flow does not respond to marking or gradual packet
53drops, the marking probability quickly reaches one.
54
55In this case, the flow is rate-limited to
56.B penalty_rate
57packets per second.
58
59.SH LIMITATIONS
60
61Due to SFBs nature, it is possible for responsive flows to share all of its bins
62with a non-responsive flow, causing the responsive flow to be misidentified as
63being non-responsive.
64
65The probability of a responsive flow to be misidentified is dependent on
a89d5329 66the number of non-responsive flows, M. It is (1 - (1 - (1 / 16.0)) ** M) **8,
2587c01a
FW
67so for example with 10 non-responsive flows approximately 0.2% of responsive flows
68will be misidentified.
69
70To mitigate this, SFB performs performs periodic re-hashing to avoid
71misclassification for prolonged periods of time.
72
73The default hashing method will use source and destination ip addresses and port numbers
74if possible, and also supports tunneling protocols.
75Alternatively, an external classifier can be configured, too.
76
77.SH PARAMETERS
78.TP
79rehash
80Time interval in milliseconds when queue perturbation occurs to avoid erroneously
81detecting unrelated, responsive flows as being part of a non-responsive flow for
82prolonged periods of time.
83Defaults to 10 minutes.
84.TP
85db
86Double buffering warmup wait time, in milliseconds.
87To avoid destroying the probability history when rehashing is performed, this
88implementation maintains a second set of levels/bins as described in section
894.4 of the SFB reference.
90While one set is used to manage the queue, a second set is warmed up:
91Whenever a flow is then determined to be non-responsive, the marking
a89d5329 92probabilities in the second set are updated. When the rehashing
2587c01a
FW
93happens, these bins will be used to manage the queue and all non-responsive
94flows can be rate-limited immediately.
95This value determines how much time has to pass before the 2nd set
96will start to be warmed up.
97Defaults to one minute, should be lower than
98.B
99rehash.
100.TP
101limit
102Hard limit on the real (not average) total queue size in packets.
a89d5329 103Further packets are dropped. Defaults to the transmit queue length of the
2587c01a
FW
104device the qdisc is attached to.
105.TP
106max
107Maximum length of a buckets queue, in packets, before packets start being
a89d5329 108dropped. Should be sightly larger than
2587c01a
FW
109.B target
110, but should not be set to values exceeding 1.5 times that of
111.B target .
112Defaults to 25.
113.TP
114target
a89d5329 115The desired average bin length. If the bin queue length reaches this value,
2587c01a
FW
116the marking probability is increased by
117.B increment.
118The default value depends on the
119.B max
120setting, with max set to 25
121.B target
122will default to 20.
123.TP
124increment
125A value used to increase the marking probability when the queue appears
a89d5329 126to be over-used. Must be between 0 and 1.0. Defaults to 0.00050.
2587c01a
FW
127.TP
128decrement
129Value used to decrease the marking probability when the queue is found
a89d5329 130to be empty. Must be between 0 and 1.0.
2587c01a
FW
131Defaults to 0.00005.
132.TP
133penalty_rate
134The maximum number of packets belonging to flows identified as being
135non-responsive that can be enqueued per second. Once this number has been
136reached, further packets of such non-responsive flows are dropped.
137Set this to a reasonable fraction of your uplink throughput; the
138default value of 10 packets is probably too small.
139.TP
140penalty_burst
141The number of packets a flow is permitted to exceed the penalty rate before packets
142start being dropped.
143Defaults to 20 packets.
144
145.SH STATISTICS
146
147This qdisc exposes additional statistics via 'tc -s qdisc' output.
148These are:
149.TP
150earlydrop
151The number of packets dropped before a per-flow queue was full.
152.TP
153ratedrop
154The number of packets dropped because of rate-limiting.
155If this value is high, there are many non-reactive flows being
a89d5329 156sent through sfb. In such cases, it might be better to
2587c01a
FW
157embed sfb within a classful qdisc to better control such
158flows using a different, shaping qdisc.
159.TP
160bucketdrop
161The number of packets dropped because a per-flow queue was full.
162High bucketdrop may point to a high number of aggressive, short-lived
163flows.
164.TP
165queuedrop
a89d5329 166The number of packets dropped due to reaching limit. This should normally be 0.
2587c01a
FW
167.TP
168marked
169The number of packets marked with ECN.
170.TP
171maxqlen
172The length of the current longest per-flow (virtual) queue.
173.TP
174maxprob
a89d5329 175The maximum per-flow drop probability. 1 means that some
2587c01a
FW
176flows have been detected as non-reactive.
177
178.SH NOTES
179
180SFB automatically enables use of Explicit Congestion Notification (ECN).
181Also, this SFB implementation does not queue packets itself.
182Rather, packets are enqueued to the inner qdisc (defaults to pfifo).
183Because sfb maintains virtual queue states, the inner qdisc must not
184drop a packet previously queued.
185Furthermore, if a buckets queue has a very high marking rate,
186this implementation will start dropping packets instead of
187marking them, as such a situation points to either bad congestion, or an
188unresponsive flow.
189
190.SH EXAMPLE & USAGE
191
192To attach to interface $DEV, using default options:
193.P
194# tc qdisc add dev $DEV handle 1: root sfb
195
196Only use destination ip addresses for assigning packets to bins, perturbing
197hash results every 10 minutes:
198.P
199# tc filter add dev $DEV parent 1: handle 1 flow hash keys dst perturb 600
200
201.SH SEE ALSO
202.BR tc (8),
203.BR tc-red (8),
204.BR tc-sfq (8)
205.SH SOURCES
206.TP
207o
208W. Feng, D. Kandlur, D. Saha, K. Shin, BLUE: A New Class of Active Queue Management Algorithms,
209U. Michigan CSE-TR-387-99, April 1999.
210
211.SH AUTHORS
212
213This SFB implementation was contributed by Juliusz Chroboczek and Eric Dumazet.