SFQ

The following classes provides access to the sfq (stochastic fairness queuing) queueing discipline and its statistics:


class SFQQDisc(qdisc_handle: Handle, parent_handle: Optional[Handle], perturb: Optional[int] = None, quantum: Optional[int] = None)[source]

Bases: QDisc

This class provides access to the Stochastic Fairness Queueing queueing discipline of Linux (see tc-sfq(8)).

Parameters:
  • qdisc_handle – handle of this SFQQDisc

  • parent_handle – handle of parent, None if this is a root queuing discipline

  • perturb – as documented in tc-sfq(8)

  • quantum – as documented in tc-sfq(8)

get_description() str[source]

Returns a string describing the queuing discipline and its attributes

get_perturb() Optional[int][source]

Returns the perturb value (in seconds), or None.

get_quantum() Optional[int][source]

Returns the quantum value (in bytes), or None.

get_stats() Optional[SFQQDiscStats][source]

Returns the qdisc stats (an SFQQDiscStats instance) or None if no stats are available.

qdisc_creation_args() List[str][source]

Returns the arguments expected by the tc(8) command to create a SFQ 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_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

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 SFQQDiscStats[source]

Bases: QStats

SFQDisc stats

property byte_backlog: int

Backlog in bytes.

This value is not a statistic; it reflects the qdisc state at the time the stats were obtained.

property packet_backlog: int

Backlog in packets.

This value is not a statistic; it reflects the qdisc state at the time the stats were obtained.

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.