table of contents
other versions
- wheezy 20120521-3+b3
- wheezy-backports 3.16.0-2~bpo70+1
- jessie 3.16.0-2
- testing 4.9.0-1
- unstable 4.9.0-1
| STAB(8) | Linux | STAB(8) |
NAME¶
tc-stab - Generic size table manipulationsSYNOPSIS¶
tc qdisc add ... stab \
[ mtu BYTES ] [ tsize SLOTS ] \ [ mpu BYTES ] [ overhead BYTES ] [ linklayer TYPE ] ...
TYPE := adsl | atm | ethernet
- mtu
-
maximum packet size we create size table for, assumed 2048 if not specified explicitly
- tsize
-
required table size, assumed 512 if not specified explicitly
- mpu
-
minimum packet size used in computations
- overhead
-
per-packet size overhead (can be negative) used in computations
- linklayer
-
required linklayer adaptation.
DESCRIPTION¶
Size tables allow manipulation of packet size, as seen by 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.- ethernet
-
This is basically 1-1 mapping, so following our example from above (disregarding mpu for a moment) slot 0 would have 8, slot 1 would have 16 and so on, up to slot 127 with 2048. Note, that mpu > 0 must be specified, and slots that would get less than specified by mpu, will get mpu instead. If you don't specify mpu, the size table will not be created at all (it wouldn't make any difference), although any overhead value will be respected during calculations.
- atm, adsl
-
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.When 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.For ATM size tables, 16 bytes sized slots are perfectly enough. The default values of mtu and tsize create 4 bytes sized slots.
TYPICAL OVERHEADS¶
The following values are typical for different adsl scenarios (based on [1] and [2]):LLC based:
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)
VC Mux based:
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)
p There're few important things regarding the above overheads:
- •
- IPoA in LLC case requires SNAP, instead of LLC-NLPID (see rfc2684) - this is the reason, why it actually takes more space than PPPoA.
- •
- In rare cases, FCS might be preserved on protocols that include ethernet frame (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 mpu accordingly for that.
- •
- When size table is consulted, and you're shaping traffic
for the sake of another modem/router, 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 such 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.
For more thorough explanations, please see [1] and [2].
ETHERNET CARDS CONSIDERATIONS¶
It's often forgotten, that modern network cards (even cheap ones on desktop motherboards) and/or their drivers often support different offloading mechanisms. In 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 ethtool to turn off offloading features.SEE ALSO¶
tc(8), tc-hfsc(7), tc-hfsc(8),AUTHOR¶
Manpage created by Michal Soltys (sol...@ziu.info)| 31 October 2011 | iproute2 |