212 lines
8.1 KiB
HTML
212 lines
8.1 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of STAB</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>STAB</H1>
|
|
Section: Linux (8)<BR>Updated: 31 October 2011<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
tc-stab - Generic size table manipulations
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
<PRE>
|
|
tc qdisc add ... stab
|
|
<DL COMPACT><DT id="1"><DD>[ <B>mtu</B> BYTES ] [ <B>tsize</B> SLOTS ]
|
|
[ <B>mpu</B> BYTES ] [ <B>overhead</B> BYTES ]
|
|
[ <B>linklayer</B> { adsl | atm | ethernet } ] ...
|
|
</DL>
|
|
</PRE>
|
|
|
|
<P>
|
|
<A NAME="lbAD"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
For the description of BYTES - please refer to the <B>UNITS</B>
|
|
section of <B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8).
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT id="2"><B>mtu</B><DD>
|
|
<BR>
|
|
|
|
maximum packet size we create size table for, assumed 2048 if not specified explicitly
|
|
<DT id="3"><B>tsize</B><DD>
|
|
<BR>
|
|
|
|
required table size, assumed 512 if not specified explicitly
|
|
<DT id="4"><B>mpu</B><DD>
|
|
<BR>
|
|
|
|
minimum packet size used in computations
|
|
<DT id="5"><B>overhead</B><DD>
|
|
<BR>
|
|
|
|
per-packet size overhead (can be negative) used in computations
|
|
<DT id="6"><B>linklayer</B><DD>
|
|
<BR>
|
|
|
|
required linklayer specification.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
Size tables allow manipulation of packet sizes, as seen by the whole scheduler
|
|
framework (of course, the actual packet size remains the same). Adjusted packet
|
|
size is calculated only once - when a qdisc enqueues the packet. Initial root
|
|
enqueue initializes it to the real packet's size.
|
|
<P>
|
|
Each qdisc can use a different size table, but the adjusted size is stored in
|
|
an area shared by whole qdisc hierarchy attached to the interface. The effect is
|
|
that if you have such a setup, the last qdisc with a stab in a chain "wins". For
|
|
example, consider HFSC with simple pfifo attached to one of its leaf classes.
|
|
If that pfifo qdisc has stab defined, it will override lengths calculated
|
|
during HFSC's enqueue; and in turn, whenever HFSC tries to dequeue a packet, it
|
|
will use a potentially invalid size in its calculations. Normal setups will
|
|
usually include stab defined only on root qdisc, but further overriding gives
|
|
extra flexibility for less usual setups.
|
|
<P>
|
|
The initial size table is calculated by <B>tc</B> tool using <B>mtu</B> and
|
|
<B>tsize</B> parameters. The algorithm sets each slot's size to the smallest
|
|
power of 2 value, so the whole <B>mtu</B> is covered by the size table. Neither
|
|
<B>tsize</B>, nor <B>mtu</B> have to be power of 2 value, so the size
|
|
table will usually support more than is required by <B>mtu</B>.
|
|
<P>
|
|
For example, with <B>mtu</B>~=~1500 and <B>tsize</B>~=~128, a table with 128
|
|
slots will be created, where slot 0 will correspond to sizes 0-16, slot 1 to
|
|
17~-~32, ..., slot 127 to 2033~-~2048. Sizes assigned to each slot
|
|
depend on <B>linklayer</B> parameter.
|
|
<P>
|
|
Stab calculation is also safe for an unusual case, when a size assigned to a
|
|
slot would be larger than 2^16-1 (you will lose the accuracy though).
|
|
<P>
|
|
During the kernel part of packet size adjustment, <B>overhead</B> will be added
|
|
to original size, and then slot will be calculated. If the size would cause
|
|
overflow, more than 1 slot will be used to get the final size. This of course
|
|
will affect accuracy, but it's only a guard against unusual situations.
|
|
<P>
|
|
Currently there are two methods of creating values stored in the size table -
|
|
ethernet and atm (adsl):
|
|
<P>
|
|
<DL COMPACT>
|
|
<DT id="7">ethernet<DD>
|
|
<BR>
|
|
|
|
This is basically 1-1 mapping, so following our example from above
|
|
(disregarding <B>mpu</B> for a moment) slot 0 would have 8, slot 1 would have 16
|
|
and so on, up to slot 127 with 2048. Note, that <B>mpu</B>~>~0 must be
|
|
specified, and slots that would get less than specified by <B>mpu</B> will get
|
|
<B>mpu</B> instead. If you don't specify <B>mpu</B>, the size table will not be
|
|
created at all (it wouldn't make any difference), although any <B>overhead</B>
|
|
value will be respected during calculations.
|
|
<DT id="8">atm, adsl<DD>
|
|
<BR>
|
|
|
|
ATM linklayer consists of 53 byte cells, where each of them provides 48 bytes
|
|
for payload. Also all the cells must be fully utilized, thus the last one is
|
|
padded if/as necessary.
|
|
<P>
|
|
When the size table is calculated, adjusted size that fits properly into lowest
|
|
amount of cells is assigned to a slot. For example, a 100 byte long packet
|
|
requires three 48-byte payloads, so the final size would require 3 ATM cells
|
|
- 159 bytes.
|
|
<P>
|
|
For ATM size tables, 16~bytes sized slots are perfectly enough. The default
|
|
values of <B>mtu</B> and <B>tsize</B> create 4~bytes sized slots.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="lbAF"> </A>
|
|
<H2>TYPICAL OVERHEADS</H2>
|
|
|
|
The following values are typical for different adsl scenarios (based on
|
|
<B>[1]</B> and <B>[2]</B>):
|
|
<P>
|
|
<PRE>
|
|
LLC based:
|
|
<DL COMPACT><DT id="9"><DD>PPPoA - 14 (PPP - 2, ATM - 12)
|
|
PPPoE - 40+ (PPPoE - 8, ATM - 18, ethernet 14, possibly FCS - 4+padding)
|
|
Bridged - 32 (ATM - 18, ethernet 14, possibly FCS - 4+padding)
|
|
IPoA - 16 (ATM - 16)
|
|
</DL>
|
|
|
|
VC Mux based:
|
|
<DL COMPACT><DT id="10"><DD>PPPoA - 10 (PPP - 2, ATM - 8)
|
|
PPPoE - 32+ (PPPoE - 8, ATM - 10, ethernet 14, possibly FCS - 4+padding)
|
|
Bridged - 24+ (ATM - 10, ethernet 14, possibly FCS - 4+padding)
|
|
IPoA - 8 (ATM - 8)
|
|
</DL>
|
|
</PRE>
|
|
|
|
There are a few important things regarding the above overheads:
|
|
<DL COMPACT>
|
|
<DT id="11">•<DD>
|
|
IPoA in LLC case requires SNAP, instead of LLC-NLPID (see rfc2684) - this is
|
|
the reason why it actually takes more space than PPPoA.
|
|
<DT id="12">•<DD>
|
|
In rare cases, FCS might be preserved on protocols that include Ethernet frames
|
|
(Bridged and PPPoE). In such situation, any Ethernet specific padding
|
|
guaranteeing 64 bytes long frame size has to be included as well (see RFC2684).
|
|
In the other words, it also guarantees that any packet you send will take
|
|
minimum 2 atm cells. You should set <B>mpu</B> accordingly for that.
|
|
<DT id="13">•<DD>
|
|
When the size table is consulted, and you're shaping traffic for the sake of
|
|
another modem/router, an Ethernet header (without padding) will already be added
|
|
to initial packet's length. You should compensate for that by subtracting 14
|
|
from the above overheads in this case. If you're shaping directly on the router
|
|
(for example, with speedtouch usb modem) using ppp daemon, you're using raw ip
|
|
interface without underlying layer2, so nothing will be added.
|
|
<P>
|
|
For more thorough explanations, please see <B>[1]</B> and <B>[2]</B>.
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>ETHERNET CARDS CONSIDERATIONS</H2>
|
|
|
|
It's often forgotten that modern network cards (even cheap ones on desktop
|
|
motherboards) and/or their drivers often support different offloading
|
|
mechanisms. In the context of traffic shaping, 'tso' and 'gso' might cause
|
|
undesirable effects, due to massive TCP segments being considered during
|
|
traffic shaping (including stab calculations). For slow uplink interfaces,
|
|
it's good to use <B>ethtool</B> to turn off offloading features.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+tc">tc</A></B>(8), <B><A HREF="/cgi-bin/man/man2html?7+tc-hfsc">tc-hfsc</A></B>(7), <B><A HREF="/cgi-bin/man/man2html?8+tc-hfsc">tc-hfsc</A></B>(8),
|
|
<BR>
|
|
|
|
<B>[1]</B> <A HREF="http://ace-host.stuart.id.au/russell/files/tc/tc-atm/">http://ace-host.stuart.id.au/russell/files/tc/tc-atm/</A>
|
|
<BR>
|
|
|
|
<B>[2]</B> <A HREF="http://www.faqs.org/rfcs/rfc2684.html">http://www.faqs.org/rfcs/rfc2684.html</A>
|
|
<P>
|
|
Please direct bugreports and patches to: <<A HREF="mailto:netdev@vger.kernel.org">netdev@vger.kernel.org</A>>
|
|
<A NAME="lbAI"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
Manpage created by Michal Soltys (<A HREF="mailto:soltys@ziu.info">soltys@ziu.info</A>)
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="14"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="15"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="16"><A HREF="#lbAD">OPTIONS</A><DD>
|
|
<DT id="17"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DT id="18"><A HREF="#lbAF">TYPICAL OVERHEADS</A><DD>
|
|
<DT id="19"><A HREF="#lbAG">ETHERNET CARDS CONSIDERATIONS</A><DD>
|
|
<DT id="20"><A HREF="#lbAH">SEE ALSO</A><DD>
|
|
<DT id="21"><A HREF="#lbAI">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:17 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|