]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/tc-stab.8
rdma: Add the prefix for driver attributes
[mirror_iproute2.git] / man / man8 / tc-stab.8
CommitLineData
9bac173f 1.TH STAB 8 "31 October 2011" iproute2 Linux
41f60041
MS
2.
3.SH NAME
4tc\-stab \- Generic size table manipulations
5.
6.SH SYNOPSIS
7.nf
11eb9396 8tc qdisc add ... stab
41f60041 9.RS 4
11eb9396 10[ \fBmtu\fR BYTES ] [ \fBtsize\fR SLOTS ]
11[ \fBmpu\fR BYTES ] [ \fBoverhead\fR BYTES ]
12[ \fBlinklayer\fR { adsl | atm | ethernet } ] ...
41f60041 13.RE
41f60041
MS
14.fi
15
11eb9396 16.SH OPTIONS
41f60041
MS
17For the description of BYTES \- please refer to the \fBUNITS\fR
18section of \fBtc\fR(8).
19
20.IP \fBmtu\fR 4
21.br
22maximum packet size we create size table for, assumed 2048 if not specified explicitly
23.IP \fBtsize\fR
24.br
25required table size, assumed 512 if not specified explicitly
26.IP \fBmpu\fR
27.br
28minimum packet size used in computations
29.IP \fBoverhead\fR
30.br
31per\-packet size overhead (can be negative) used in computations
32.IP \fBlinklayer\fR
33.br
11eb9396 34required linklayer specification.
41f60041
MS
35.PP
36.
37.SH DESCRIPTION
38.
11eb9396 39Size tables allow manipulation of packet sizes, as seen by the whole scheduler
41f60041
MS
40framework (of course, the actual packet size remains the same). Adjusted packet
41size is calculated only once \- when a qdisc enqueues the packet. Initial root
42enqueue initializes it to the real packet's size.
43
11eb9396 44Each qdisc can use a different size table, but the adjusted size is stored in
45an area shared by whole qdisc hierarchy attached to the interface. The effect is
46that if you have such a setup, the last qdisc with a stab in a chain "wins". For
9bac173f
MS
47example, consider HFSC with simple pfifo attached to one of its leaf classes.
48If that pfifo qdisc has stab defined, it will override lengths calculated
11eb9396 49during HFSC's enqueue; and in turn, whenever HFSC tries to dequeue a packet, it
50will use a potentially invalid size in its calculations. Normal setups will
9bac173f
MS
51usually include stab defined only on root qdisc, but further overriding gives
52extra flexibility for less usual setups.
41f60041 53
11eb9396 54The initial size table is calculated by \fBtc\fR tool using \fBmtu\fR and
41f60041
MS
55\fBtsize\fR parameters. The algorithm sets each slot's size to the smallest
56power of 2 value, so the whole \fBmtu\fR is covered by the size table. Neither
57\fBtsize\fR, nor \fBmtu\fR have to be power of 2 value, so the size
58table will usually support more than is required by \fBmtu\fR.
59
60For example, with \fBmtu\fR\~=\~1500 and \fBtsize\fR\~=\~128, a table with 128
61slots will be created, where slot 0 will correspond to sizes 0\-16, slot 1 to
9bac173f
MS
6217\~\-\~32, \&..., slot 127 to 2033\~\-\~2048. Sizes assigned to each slot
63depend on \fBlinklayer\fR parameter.
41f60041
MS
64
65Stab calculation is also safe for an unusual case, when a size assigned to a
66slot would be larger than 2^16\-1 (you will lose the accuracy though).
67
11eb9396 68During the kernel part of packet size adjustment, \fBoverhead\fR will be added
69to original size, and then slot will be calculated. If the size would cause
70overflow, more than 1 slot will be used to get the final size. This of course
9bac173f 71will affect accuracy, but it's only a guard against unusual situations.
41f60041 72
11eb9396 73Currently there are two methods of creating values stored in the size table \-
41f60041
MS
74ethernet and atm (adsl):
75
76.IP ethernet 4
77.br
78This is basically 1\-1 mapping, so following our example from above
79(disregarding \fBmpu\fR for a moment) slot 0 would have 8, slot 1 would have 16
80and so on, up to slot 127 with 2048. Note, that \fBmpu\fR\~>\~0 must be
11eb9396 81specified, and slots that would get less than specified by \fBmpu\fR will get
41f60041 82\fBmpu\fR instead. If you don't specify \fBmpu\fR, the size table will not be
9bac173f
MS
83created at all (it wouldn't make any difference), although any \fBoverhead\fR
84value will be respected during calculations.
41f60041
MS
85.IP "atm, adsl"
86.br
87ATM linklayer consists of 53 byte cells, where each of them provides 48 bytes
88for payload. Also all the cells must be fully utilized, thus the last one is
89padded if/as necessary.
90
11eb9396 91When the size table is calculated, adjusted size that fits properly into lowest
41f60041
MS
92amount of cells is assigned to a slot. For example, a 100 byte long packet
93requires three 48\-byte payloads, so the final size would require 3 ATM cells
94\- 159 bytes.
95
96For ATM size tables, 16\~bytes sized slots are perfectly enough. The default
97values of \fBmtu\fR and \fBtsize\fR create 4\~bytes sized slots.
98.PP
99.
100.SH "TYPICAL OVERHEADS"
101The following values are typical for different adsl scenarios (based on
102\fB[1]\fR and \fB[2]\fR):
103
104.nf
105LLC based:
106.RS 4
107PPPoA \- 14 (PPP \- 2, ATM \- 12)
108PPPoE \- 40+ (PPPoE \- 8, ATM \- 18, ethernet 14, possibly FCS \- 4+padding)
109Bridged \- 32 (ATM \- 18, ethernet 14, possibly FCS \- 4+padding)
110IPoA \- 16 (ATM \- 16)
111.RE
112
113VC Mux based:
114.RS 4
115PPPoA \- 10 (PPP \- 2, ATM \- 8)
116PPPoE \- 32+ (PPPoE \- 8, ATM \- 10, ethernet 14, possibly FCS \- 4+padding)
117Bridged \- 24+ (ATM \- 10, ethernet 14, possibly FCS \- 4+padding)
118IPoA \- 8 (ATM \- 8)
119.RE
120.fi
11eb9396 121There are a few important things regarding the above overheads:
41f60041
MS
122.
123.IP \(bu 4
124IPoA in LLC case requires SNAP, instead of LLC\-NLPID (see rfc2684) \- this is
11eb9396 125the reason why it actually takes more space than PPPoA.
41f60041 126.IP \(bu
11eb9396 127In rare cases, FCS might be preserved on protocols that include Ethernet frames
128(Bridged and PPPoE). In such situation, any Ethernet specific padding
129guaranteeing 64 bytes long frame size has to be included as well (see RFC2684).
41f60041
MS
130In the other words, it also guarantees that any packet you send will take
131minimum 2 atm cells. You should set \fBmpu\fR accordingly for that.
132.IP \(bu
11eb9396 133When the size table is consulted, and you're shaping traffic for the sake of
134another modem/router, an Ethernet header (without padding) will already be added
41f60041 135to initial packet's length. You should compensate for that by subtracting 14
11eb9396 136from the above overheads in this case. If you're shaping directly on the router
9bac173f
MS
137(for example, with speedtouch usb modem) using ppp daemon, you're using raw ip
138interface without underlying layer2, so nothing will be added.
41f60041
MS
139
140For more thorough explanations, please see \fB[1]\fR and \fB[2]\fR.
141.
9bac173f
MS
142.SH "ETHERNET CARDS CONSIDERATIONS"
143.
11eb9396 144It's often forgotten that modern network cards (even cheap ones on desktop
9bac173f 145motherboards) and/or their drivers often support different offloading
11eb9396 146mechanisms. In the context of traffic shaping, 'tso' and 'gso' might cause
147undesirable effects, due to massive TCP segments being considered during
9bac173f
MS
148traffic shaping (including stab calculations). For slow uplink interfaces,
149it's good to use \fBethtool\fR to turn off offloading features.
150.
41f60041
MS
151.SH "SEE ALSO"
152.
153\fBtc\fR(8), \fBtc\-hfsc\fR(7), \fBtc\-hfsc\fR(8),
154.br
155\fB[1]\fR http://ace\-host.stuart.id.au/russell/files/tc/tc\-atm/
156.br
157\fB[2]\fR http://www.faqs.org/rfcs/rfc2684.html
158
509dcd43 159Please direct bugreports and patches to: <netdev@vger.kernel.org>
41f60041
MS
160.
161.SH "AUTHOR"
162.
509dcd43 163Manpage created by Michal Soltys (soltys@ziu.info)