NETEM¶
The following class provides access to the netem
(Network Emulator) queuing discipline:
- class NetemQDisc(qdisc_handle: Handle, parent_handle: Optional[Handle], *, delay: Optional[Union[float, int, Tuple]] = None, limit: Optional[int] = None, drop: Optional[Union[int, Tuple]] = None, duplicate: Optional[Union[int, Tuple]] = None, corrupt: Optional[Union[int, Tuple]] = None, reorder: Optional[Union[int, Tuple]] = None, gap: Optional[int] = None)[source]¶
Bases:
QDiscThis class provides access to the
netemqueueing discipline (see tc-netem(8)).- Parameters:
qdisc_handle –
Handleof thisNetemQDiscparent_handle –
Handleof the parentQDisc, orNoneif this is a root queuing disciplinedelay – delay (in ms) added to each outgoing packet;
delaycan be specified as afloat, as anint, or as a tuple of the form(delay, [jitter, [correlation]])limit – packet limit
drop – drop percentage;
dropcan be specified as anint, or as a tuple of the form(percent, [correlation])duplicate – duplicate percentage;
duplicatecan be specified as anint, or as a tuple of the form(percent, [correlation])corrupt – corrupt percentage;
corruptcan be specified as anint, or as a tuple of the form(percent, [correlation])reorder – reorder percentage;
reordercan be specified as anint, or as a tuple of the form(percent, [correlation])gap – packet distance when reordering
- get_description() str[source]¶
Returns a string describing this
NetemQDiscinstance and its attributes
- get_delay_all() Optional[Tuple][source]¶
Returns the delay parameters as the tuple
(delay, [jitter, [correlation]])
- get_loss_all() Optional[Tuple][source]¶
Returns the packet loss parameters as the tuple
(percent, [correlation])
- get_duplicate_all() Optional[Tuple][source]¶
Returns the packet duplication parameters as the tuple
(percent, [correlation])
- get_corrupt_all() Optional[int][source]¶
Returns the packet corruption parameters as the tuple
(percent, [correlation])
- dump(outfile: TextIO, level=0, qclass_map: Optional[Mapping[Handle, QClass]] = None)¶
Recursively dump this
Qdisctooutfile.The
qclass_map, if present, is used to determine the destinationQClassobjects of traffic filters.
- get_config() QDiscConfig¶
Returns the
QDiscConfigwhere thisQDisc/QClasshas been instantiated, orNoneif not instantiated.
- get_handle() Handle¶
Returns the
QDisc/QClasshandle
- get_interface() Optional[str]¶
Returns the interface where this
QDisc/QClasshas been instantiated, orNoneif theQDisc/QClassis not instantiated.
- get_parent_handle() Optional[Handle]¶
Returns the handle of the parent of this
QDisc/QClass
- is_default() bool¶
Returns
Trueif thisQDiscis the default qdisc used by the kernel.
- static is_ingress() bool¶
Returns
Trueif thisQDiscis the ingress qdisc
- is_root() bool¶
Returns
Trueif this is a rootQDisc