DRR

The following classes provides access to the drr (deficit round robin) queueing discipline and its statistics:


class DRRQDisc(handle: Handle, parent_handle: Optional[Handle])[source]

Bases: QDisc

This class provides access to the multiqueue (drr) queueing discipline of Linux

Parameters:
  • handleHandle of this QDisc

  • parent_handleHandle of the parent of this QDisc (if None, this is a root QDisc)

qdisc_creation_args() List[str][source]

Returns the arguments expected by the tc(8) command to create a DRR qdisc

dump(outfile: TextIO, level=0, qclass_map: Optional[Mapping[Handle, QClass]] = None)

Recursively dump this Qdisc to outfile.

The qclass_map, if present, is used to determine the destination QClass objects of traffic filters.

get_config() QDiscConfig

Returns the QDiscConfig where this QDisc/QClass has been instantiated, or None if not instantiated.

get_description() str

Return a string that fully describes this QDisc

get_handle() Handle

Returns the QDisc/QClass handle

get_interface() Optional[str]

Returns the interface where this QDisc/QClass has been instantiated, or None if the QDisc/QClass is not instantiated.

get_parent_handle() Optional[Handle]

Returns the handle of the parent of this QDisc/QClass

get_stats() Optional[QStats]

Returns queuing stats.

is_default() bool

Returns True if this QDisc is the default qdisc used by the kernel.

static is_ingress() bool

Returns True if this QDisc is the ingress qdisc

is_root() bool

Returns True if this is a root QDisc


class DRRQClass(class_handle: Handle, parent_handle: Handle, *, quantum: int)[source]

Bases: QClass

A class of the DRRQDisc (drr) queuing discipline.

Parameters:
  • class_handle – handle of this DRRQClass

  • parent_handle – handle of parent DRRQDisc

  • quantum – number of bytes to dequeue per turn

get_description() str[source]

Returns a string describing the class and its attributes

get_quantum() int[source]

Returns the quantum (bytes)

get_stats() Optional[DRRQClassStats][source]

Returns class stats (an DRRQClassStats instance) or None if no stats are available.

qclass_creation_args() List[str][source]

Returns the tc arguments to create this DRR class

dump(outfile: TextIO, level: int, qclass_map: Optional[Mapping[Handle, QClass]] = None)

Recursively dump this QClass to outfile.

The qclass_map, if present, is used to determine the destination QClass objects of traffic filters.

get_class_name() str

Returns the class name

get_config() QDiscConfig

Returns the QDiscConfig where this QDisc/QClass has been instantiated, or None if not instantiated.

get_handle() Handle

Returns the QDisc/QClass handle

get_interface() Optional[str]

Returns the interface where this QDisc/QClass has been instantiated, or None if the QDisc/QClass is not instantiated.

get_parent_handle() Optional[Handle]

Returns the handle of the parent of this QDisc/QClass

get_qdisc() Optional[QDisc]

Returns the QDisc under this QClass; returns None if there is no QDisc, or if this is not a leaf queuing class

is_leaf() bool

Returns True if this is a leaf queuing class

set_class_name(class_name: str) None

Sets the class name

set_qdisc(qdisc: QDisc) None

Set the QDisc under this queuing class


class DRRQClassStats[source]

Bases: QStats

DRR-specific class stats (see QStats for inherited stats)

property deficit: int

Byte deficit

dump(outfile: TextIO, width: Optional[int] = None) None[source]

Dump stats to outfile. There is one stat per line output. Each line has the format:

header: value

The header: part occupies at least width characters.

property bitrate: int

Consumed bandwidth measured in bits/sec

property bytes_sent: int

Number of bytes sent.

property dropped_packets: int

Number of packets dropped.

get_byte_backlog() int

Queue backlog in bytes

get_overlimits() int

Number of times a packet was delayed due to rate limits.

get_packet_backlog() int

Queue backlog in packets

property packetrate: int

Consumed bandwidth measured in packets/sec

property packets_sent: int

Number of packets sent.

property requeued_packets: int

Number of packets that were requeued for some reason.