LinuxCommandLibrary

tc-drr

Configure traffic shaping using Deficit Round Robin

SYNOPSIS

tc qdisc add ... drr [quantum NUMBER] [ecn] [deficit NUMBER]

PARAMETERS

quantum NUMBER
    Specifies the minimum amount of data (in bytes) that a queue can send in each round. This parameter is crucial for fairness and bandwidth allocation. Higher values allow queues to send more data before being requeued.

ecn
    Enables Explicit Congestion Notification (ECN) marking on packets. ECN allows routers experiencing congestion to notify endpoints, allowing them to reduce their transmission rate to avoid packet loss. This requires that both endpoints support ECN.

deficit NUMBER
    Sets the initial deficit counter value. The default is the quantum. This parameter is rarely modified in typical configurations.

DESCRIPTION

The `tc-drr` command is a component of the Linux Traffic Control (tc) subsystem. It is used to configure and manage the Deficit Round Robin (DRR) queuing discipline (qdisc). DRR is a fair queuing algorithm that aims to provide fair allocation of bandwidth among different flows or classes of traffic. It works by assigning a quantum (a minimum amount of data to be sent) to each queue. The scheduler serves packets from each queue in a round-robin fashion, using the quantum to ensure that no single queue monopolizes the bandwidth. `tc-drr` allows you to create DRR qdiscs, attach them to network interfaces, and configure the parameters like quantum for each child class. Using the `tc` command along with DRR scheduling enables fine-grained control over network traffic, improving network performance by minimizing latency and jitter and improving overall network resource allocation among different types of traffic.

CAVEATS

DRR is suitable for scenarios where fairness and bandwidth allocation are critical. However, it might not be the best choice for minimizing latency in scenarios with bursty traffic. Understanding the trade-offs between fairness, latency, and throughput is crucial when choosing a queuing discipline.

EXAMPLE

Add a DRR qdisc to interface eth0 with a quantum of 1000 bytes:
tc qdisc add dev eth0 root drr quantum 1000
This command establishes a DRR queuing discipline as the root qdisc on the eth0 interface, ensuring that each queue receives a minimum transmission opportunity of 1000 bytes per round.

WHEN TO USE

Use DRR when:
- You need to ensure fair bandwidth allocation among different traffic flows.
- You want to prevent any single flow from monopolizing network resources.
- Latency sensitivity is not paramount. In situations demanding ultra-low latency, consider other algorithms.

HISTORY

The DRR qdisc was introduced as part of the Linux Traffic Control subsystem to provide a fair queuing mechanism that addresses some of the limitations of simpler queuing disciplines like FIFO. It builds upon the Round Robin scheduling algorithm and incorporates the concept of 'deficit' to improve fairness and prevent starvation of queues with smaller packets. It has become a commonly used option for configuring fairness-based queuing in network traffic shaping configurations. DRR can be used to improve Quality of Service (QoS) for different kind of network traffic.

SEE ALSO

Copied to clipboard