1TC(8) Linux TC(8)
2
3
4
6 sfq - Stochastic Fairness Queueing
7
9 tc qdisc ... perturb seconds quantum bytes
10
11
13 Stochastic Fairness Queueing is a classless queueing discipline avail‐
14 able for traffic control with the tc(8) command.
15
16 SFQ does not shape traffic but only schedules the transmission of pack‐
17 ets, based on 'flows'. The goal is to ensure fairness so that each
18 flow is able to send data in turn, thus preventing any single flow from
19 drowning out the rest.
20
21 This may in fact have some effect in mitigating a Denial of Service
22 attempt.
23
24 SFQ is work-conserving and therefore always delivers a packet if it has
25 one available.
26
28 On enqueueing, each packet is assigned to a hash bucket, based on
29
30 (i) Source address
31
32 (ii) Destination address
33
34 (iii) Source port
35
36 If these are available. SFQ knows about ipv4 and ipv6 and also UDP, TCP
37 and ESP. Packets with other protocols are hashed based on the 32bits
38 representation of their destination and the socket they belong to. A
39 flow corresponds mostly to a TCP/IP connection.
40
41 Each of these buckets should represent a unique flow. Because multiple
42 flows may get hashed to the same bucket, the hashing algorithm is per‐
43 turbed at configurable intervals so that the unfairness lasts only for
44 a short while. Perturbation may however cause some inadvertent packet
45 reordering to occur.
46
47 When dequeuing, each hashbucket with data is queried in a round robin
48 fashion.
49
50 The compile time maximum length of the SFQ is 128 packets, which can be
51 spread over at most 128 buckets of 1024 available. In case of overflow,
52 tail-drop is performed on the fullest bucket, thus maintaining fair‐
53 ness.
54
55
57 perturb
58 Interval in seconds for queue algorithm perturbation. Defaults
59 to 0, which means that no perturbation occurs. Do not set too
60 low for each perturbation may cause some packet reordering.
61 Advised value: 10
62
63 quantum
64 Amount of bytes a flow is allowed to dequeue during a round of
65 the round robin process. Defaults to the MTU of the interface
66 which is also the advised value and the minimum value.
67
68
70 To attach to device ppp0:
71
72 # tc qdisc add dev ppp0 root sfq perturb 10
73
74 Please note that SFQ, like all non-shaping (work-conserving) qdiscs, is
75 only useful if it owns the queue. This is the case when the link speed
76 equals the actually available bandwidth. This holds for regular phone
77 modems, ISDN connections and direct non-switched ethernet links.
78
79 Most often, cable modems and DSL devices do not fall into this cate‐
80 gory. The same holds for when connected to a switch and trying to send
81 data to a congested segment also connected to the switch.
82
83 In this case, the effective queue does not reside within Linux and is
84 therefore not available for scheduling.
85
86 Embed SFQ in a classful qdisc to make sure it owns the queue.
87
88
90 o Paul E. McKenney "Stochastic Fairness Queuing", IEEE INFOCOMM'90
91 Proceedings, San Francisco, 1990.
92
93
94 o Paul E. McKenney "Stochastic Fairness Queuing", "Interworking:
95 Research and Experience", v.2, 1991, p.113-131.
96
97
98 o See also: M. Shreedhar and George Varghese "Efficient Fair Queu‐
99 ing using Deficit Round Robin", Proc. SIGCOMM 95.
100
101
103 tc(8)
104
105
107 Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru>. This manpage maintained by
108 bert hubert <ahu@ds9a.nl>
109
110
111
112
113
114iproute2 8 December 2001 TC(8)