tc-hfsc
Shape network traffic using Hierarchical Fair Service Curve
SYNOPSIS
tc qdisc add dev device parent parent handle major: hfsc [default minor] [rsc {rate} dsc {rate} usc {rate}]
PARAMETERS
dev device
Specifies the network device to which the qdisc is attached (e.g., eth0, wlan0).
parent parent
Specifies the parent of this qdisc. Can be 'root' or another classid (e.g., 1:1). Determines where in the hierarchy this qdisc is located.
handle major:
Assigns a major number to the qdisc. This is a unique identifier used to refer to the qdisc later (e.g., 10:).
default minor
Specifies the default classid to which packets will be sent if no filters match (e.g., 1:1). It is the minor number of the class.
rsc {rate}
Specifies the real-time service curve. Rate is the bandwidth allocated to the real-time service curve.
dsc {rate}
Specifies the delay-sensitive service curve. Rate is the bandwidth allocated to the delay-sensitive service curve.
usc {rate}
Specifies the upper-limit service curve. Rate is the bandwidth allocated to the upper-limit service curve.
DESCRIPTION
The tc-hfsc command is used to configure the Hierarchical Fair Service Curve (HFSC) queuing discipline in Linux. HFSC is a complex queuing discipline designed to provide a high degree of fairness and control over network bandwidth allocation. It allows you to define a hierarchy of classes, each with its own service curve, which specifies the minimum, maximum, and average bandwidth that the class should receive. This enables sophisticated traffic shaping and prioritization.
HFSC is particularly well-suited for scenarios where you need to guarantee a certain level of service to different types of traffic or different users. For example, you could use HFSC to ensure that interactive traffic (e.g., VoIP, online gaming) receives a higher priority than bulk data transfers.
Configuring HFSC involves creating a qdisc, defining classes within the qdisc's hierarchy, and attaching filters to direct traffic to the appropriate classes. The service curve for each class is defined using three parameters: minimum rate (m1), maximum rate (m2), and virtual real-time (d) rate. HFSC is considered one of the more advanced queuing disciplines in Linux, and requires a thorough understanding of queuing theory and network traffic characteristics to configure effectively.
CAVEATS
HFSC is computationally intensive and can introduce significant overhead, especially with deep class hierarchies. Careful planning and testing are essential to avoid performance degradation. Incorrectly configured HFSC can severely impact network performance.
SERVICE CURVES
HFSC uses three service curves (real-time, delay-sensitive, and upper-limit) to define the bandwidth allocation for each class. These curves determine the minimum, maximum, and average bandwidth that the class should receive. These curves are specified in bits per second.
CLASSES AND HIERARCHY
HFSC relies on a hierarchical structure of classes to manage traffic. Each class can have its own service curve and can contain other classes, allowing for fine-grained control over bandwidth allocation. Filters are used to direct traffic to the appropriate classes within the hierarchy.
HISTORY
HFSC was developed as an alternative to other queuing disciplines, aiming to provide better fairness and control over bandwidth allocation. It was designed to address the limitations of earlier qdiscs like CBQ and HTB in specific scenarios, particularly those requiring precise bandwidth guarantees. It has undergone several revisions and improvements to enhance its performance and features.