LinuxCommandLibrary

tc-stab

Display traffic control filter information

SYNOPSIS

tc qdisc add dev DEV root | parent QDISC_HANDLE [ handle QDISC_HANDLE ] QDISC_KIND [ OPTIONS ]
stab [ overhead BYTES ] [ mpu BYTES ] [ rtab FILE ] [ ttab FILE ]

PARAMETERS

overhead BYTES
    Specifies an amount in BYTES to be added to the reported size of each packet. This is typically used to account for Layer 2 protocol headers (e.g., Ethernet header, VLAN tags) or other encapsulations that contribute to the actual on-wire packet size but are not included in the IP layer size reported by the kernel.

mpu BYTES
    Sets the Minimum Packet Unit. If a packet's size, after overhead has been added, is less than BYTES, its size is effectively treated as BYTES. This option helps in accurately accounting for network media's minimum frame sizes, such as the 64-byte minimum for Ethernet.

rtab FILE
    Designates a file that contains the size table entries for received (incoming) packets. Each line in the file should consist of two space-separated numbers: a size threshold and the corresponding classid. Packets are assigned the classid of the first entry whose size threshold is greater than or equal to the packet's effective size.

ttab FILE
    Similar to rtab, but specifies the size table entries for transmitted (outgoing) packets. This allows for different size-based classifications for ingress and egress traffic flows.

DESCRIPTION

The tc-stab functionality, described by this man page, allows for attaching a 'size table' (stab) to a queuing discipline (qdisc) configured with the tc (traffic control) command. This feature enables flexible packet classification based on their size, potentially adjusted by overhead and minimum packet unit settings. The size table can be defined to map specific packet size ranges to distinct classids, which can then be utilized by tc filters (such as u32 filters) to apply different traffic management rules. This is particularly useful for implementing differentiated services based on packet sizes, for instance, prioritizing small interactive packets over larger bulk data transfers.

CAVEATS

The availability and functionality of the stab feature depend on kernel support and the specific qdisc being used. Not all qdiscs may fully utilize or support the stab data internally. While it primarily provides packet size information to tc filters (like u32) for classification, some qdiscs (e.g., fq_codel) might use this information directly for their internal logic.

SIZE TABLE FILE FORMAT

The files specified by rtab and ttab should contain entries in a simple format, with each line specifying a size threshold and a corresponding classid. For example:
0 1:1
500 1:2
1500 1:3
In this example, a packet with an effective size from 0 up to 499 bytes would be assigned classid 1:1. A packet from 500 up to 1499 bytes would get classid 1:2, and packets 1500 bytes and larger would receive classid 1:3.

EXAMPLE USAGE

To add stab data to an htb qdisc on device eth0 with an overhead of 14 bytes and a minimum packet unit of 64 bytes, you would use a command similar to:
tc qdisc add dev eth0 root handle 1: htb stab overhead 14 mpu 64
This configures the qdisc to use the specified stab parameters for its packet size calculations.

HISTORY

The stab functionality is an integral part of the iproute2 suite's tc (traffic control) tools for Linux. It has evolved alongside the capabilities of the Linux kernel's networking stack, providing more granular control over traffic shaping and classification. Its development aligns with the ongoing efforts to enhance network performance and quality of service through sophisticated packet management.

SEE ALSO

tc(8), tc-u32(8), tc-fq_codel(8), ip(8)

Copied to clipboard