Blame man/man8/tc-ets.8

Packit Service 3880ab
.TH TC 8 "December 2019" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
ETS \- Enhanced Transmission Selection scheduler
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
.B tc qdisc ... ets [ bands
Packit Service 3880ab
number
Packit Service 3880ab
.B ] [ strict
Packit Service 3880ab
number
Packit Service 3880ab
.B ] [ quanta
Packit Service 3880ab
bytes bytes bytes...
Packit Service 3880ab
.B ] [ priomap
Packit Service 3880ab
band band band...
Packit Service 3880ab
.B ]
Packit Service 3880ab
Packit Service 3880ab
.B tc class ... ets [ quantum
Packit Service 3880ab
bytes
Packit Service 3880ab
.B ]
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
Packit Service 3880ab
The Enhanced Transmission Selection scheduler is a classful queuing
Packit Service 3880ab
discipline that merges functionality of PRIO and DRR qdiscs in one
Packit Service 3880ab
scheduler. ETS makes it easy to configure a set of strict and
Packit Service 3880ab
bandwidth-sharing bands to implement the transmission selection described
Packit Service 3880ab
in 802.1Qaz.
Packit Service 3880ab
Packit Service 3880ab
On creation with 'tc qdisc add', a fixed number of bands is created. Each
Packit Service 3880ab
band is a class, although it is not possible to directly add and remove
Packit Service 3880ab
bands with 'tc class' commands. The number of bands to be created must
Packit Service 3880ab
instead be specified on the command line as the qdisc is added.
Packit Service 3880ab
Packit Service 3880ab
The minor number of classid to use when referring to a band is the band
Packit Service 3880ab
number increased by one. Thus band 0 will have classid of major:1, band 1
Packit Service 3880ab
that of major:2, etc.
Packit Service 3880ab
Packit Service 3880ab
ETS bands are of two types: some number may be in strict mode, the
Packit Service 3880ab
remaining ones are in bandwidth-sharing mode.
Packit Service 3880ab
Packit Service 3880ab
.SH ALGORITHM
Packit Service 3880ab
When dequeuing, strict bands are tried first, if there are any. Band 0 is
Packit Service 3880ab
tried first. If it did not deliver a packet, band 1 is tried next, and so
Packit Service 3880ab
on until one of the bands delivers a packet, or the strict bands are
Packit Service 3880ab
exhausted.
Packit Service 3880ab
Packit Service 3880ab
If no packet has been dequeued from any of the strict bands, if there are
Packit Service 3880ab
any bandwidth-sharing bands, the dequeuing proceeds according to the DRR
Packit Service 3880ab
algorithm. Each bandwidth-sharing band is assigned a deficit counter,
Packit Service 3880ab
initialized to quantum assigned by a
Packit Service 3880ab
.B quanta
Packit Service 3880ab
element. ETS maintains an (internal) ''active'' list of bandwidth-sharing
Packit Service 3880ab
bands whose qdiscs are non-empty. This list is used for dequeuing. A packet
Packit Service 3880ab
is dequeued from the band at the head of the list if the packet size is
Packit Service 3880ab
smaller or equal to the deficit counter. If the counter is too small, it is
Packit Service 3880ab
increased by
Packit Service 3880ab
.B quantum
Packit Service 3880ab
and the scheduler moves on to the next band in the active list.
Packit Service 3880ab
Packit Service 3880ab
Only qdiscs that own their queue should be added below the
Packit Service 3880ab
bandwidth-sharing bands. Attaching to them non-work-conserving qdiscs like
Packit Service 3880ab
TBF does not make sense \-\- other qdiscs in the active list will be
Packit Service 3880ab
skipped until the dequeue operation succeeds. This limitation does not
Packit Service 3880ab
exist with the strict bands.
Packit Service 3880ab
Packit Service 3880ab
.SH CLASSIFICATION
Packit Service 3880ab
The ETS qdisc allows three ways to decide which band to enqueue a packet
Packit Service 3880ab
to:
Packit Service 3880ab
Packit Service 3880ab
- Packet priority can be directly set to a class handle, in which case that
Packit Service 3880ab
  is the queue where the packet will be put. For example, band number 2 of
Packit Service 3880ab
  a qdisc with handle of 11: will have classid 11:3. To mark a packet for
Packit Service 3880ab
  queuing to this band, the packet priority should be set to 0x110003.
Packit Service 3880ab
Packit Service 3880ab
- A tc filter attached to the qdisc can put the packet to a band by using
Packit Service 3880ab
  the \fBflowid\fR keyword.
Packit Service 3880ab
Packit Service 3880ab
- As a last resort, the ETS qdisc consults its priomap (see below), which
Packit Service 3880ab
  maps packets to bands based on packet priority.
Packit Service 3880ab
Packit Service 3880ab
.SH PARAMETERS
Packit Service 3880ab
.TP
Packit Service 3880ab
strict
Packit Service 3880ab
The number of bands that should be created in strict mode. If not given,
Packit Service 3880ab
this value is 0.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
quanta
Packit Service 3880ab
Each bandwidth-sharing band needs to know its quantum, which is the amount
Packit Service 3880ab
of bytes a band is allowed to dequeue before the scheduler moves to the
Packit Service 3880ab
next bandwidth-sharing band. The
Packit Service 3880ab
.B quanta
Packit Service 3880ab
argument lists quanta for the individual bandwidth-sharing bands.
Packit Service 3880ab
The minimum value of each quantum is 1. If
Packit Service 3880ab
.B quanta
Packit Service 3880ab
is not given, the default is no bandwidth-sharing bands, but note that when
Packit Service 3880ab
specifying a large number of
Packit Service 3880ab
.B bands,
Packit Service 3880ab
the extra ones are in bandwidth-sharing mode by default.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
bands
Packit Service 3880ab
Number of bands given explicitly. This value has to be at least large
Packit Service 3880ab
enough to cover the strict bands specified through the
Packit Service 3880ab
.B strict
Packit Service 3880ab
keyword and bandwidth-sharing bands specified in
Packit Service 3880ab
.B quanta.
Packit Service 3880ab
If a larger value is given, any extra bands are in bandwidth-sharing mode,
Packit Service 3880ab
and their quanta are deduced from the interface MTU. If no value is given,
Packit Service 3880ab
as many bands are created as necessary to cover all bands implied by the
Packit Service 3880ab
.B strict
Packit Service 3880ab
and
Packit Service 3880ab
.B quanta
Packit Service 3880ab
keywords.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
priomap
Packit Service 3880ab
The priomap maps the priority of a packet to a band. The argument is a list
Packit Service 3880ab
of numbers. The first number indicates which band the packets with priority
Packit Service 3880ab
0 should be put to, the second is for priority 1, and so on.
Packit Service 3880ab
Packit Service 3880ab
There can be up to 16 numbers in the list. If there are fewer, the default
Packit Service 3880ab
band that traffic with one of the unmentioned priorities goes to is the
Packit Service 3880ab
last one.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLE & USAGE
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Add a qdisc with 8 bandwidth-sharing bands, using the interface MTU as
Packit Service 3880ab
their quanta. Since all quanta are the same, this will lead to equal
Packit Service 3880ab
distribution of bandwidth between the bands, each will get about 12.5% of
Packit Service 3880ab
the link. The low 8 priorities go to individual bands in a reverse 1:1
Packit Service 3880ab
fashion (such that the highest priority goes to the first band).
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
# tc qdisc add dev eth0 root handle 1: ets bands 8 priomap 7 6 5 4 3 2 1 0
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc show dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc ets 1: root refcnt 2 bands 8 quanta 1514 1514 1514 1514 1514 1514 1514 1514 priomap 7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Tweak the first band of the above qdisc to give it a quantum of 2650, which
Packit Service 3880ab
will give it about 20% of the link (and about 11.5% to the remaining
Packit Service 3880ab
bands):
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
# tc class change dev eth0 classid 1:1 ets quantum 2650
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc show dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc ets 1: root refcnt 2 bands 8 quanta 2650 1514 1514 1514 1514 1514 1514 1514 priomap 7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Create a purely strict Qdisc with reverse 1:1 mapping between priorities
Packit Service 3880ab
and bands:
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
# tc qdisc add dev eth0 root handle 1: ets strict 8 priomap 7 6 5 4 3 2 1 0
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc sh dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc ets 1: root refcnt 2 bands 8 strict 8 priomap 7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Add a Qdisc with 6 bands, 3 strict and 3 ETS with 35%-30%-25% weights:
Packit Service 3880ab
.P
Packit Service 3880ab
# tc qdisc add dev eth0 root handle 1: ets strict 3 quanta 3500 3000 2500 priomap 0 1 1 1 2 3 4 5
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc sh dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc ets 1: root refcnt 2 bands 6 strict 3 quanta 3500 3000 2500 priomap 0 1 1 1 2 3 4 5 5 5 5 5 5 5 5 5
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Create a Qdisc such that traffic with priorities 2, 3 and 4 are strictly
Packit Service 3880ab
prioritized over other traffic, and the rest goes into bandwidth-sharing
Packit Service 3880ab
classes with equal weights:
Packit Service 3880ab
.P
Packit Service 3880ab
# tc qdisc add dev eth0 root handle 1: ets bands 8 strict 3 priomap 3 4 0 1 2 5 6 7
Packit Service 3880ab
.br
Packit Service 3880ab
# tc qdisc sh dev eth0
Packit Service 3880ab
.br
Packit Service 3880ab
qdisc ets 1: root refcnt 2 bands 8 strict 3 quanta 1514 1514 1514 1514 1514 priomap 3 4 0 1 2 5 6 7 7 7 7 7 7 7 7 7
Packit Service 3880ab
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR tc (8),
Packit Service 3880ab
.BR tc-prio (8),
Packit Service 3880ab
.BR tc-drr (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Parts of both this manual page and the code itself are taken from PRIO and
Packit Service 3880ab
DRR qdiscs.
Packit Service 3880ab
.br
Packit Service 3880ab
ETS qdisc itself was written by Petr Machata.