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