| 1 |
.TH TC 8 "December 2019" "iproute2" "Linux" |
| 2 |
.SH NAME |
| 3 |
ETS \- Enhanced Transmission Selection scheduler |
| 4 |
.SH SYNOPSIS |
| 5 |
.B tc qdisc ... ets [ bands |
| 6 |
number |
| 7 |
.B ] [ strict |
| 8 |
number |
| 9 |
.B ] [ quanta |
| 10 |
bytes bytes bytes... |
| 11 |
.B ] [ priomap |
| 12 |
band band band... |
| 13 |
.B ] |
| 14 |
|
| 15 |
.B tc class ... ets [ quantum |
| 16 |
bytes |
| 17 |
.B ] |
| 18 |
|
| 19 |
.SH DESCRIPTION |
| 20 |
|
| 21 |
The Enhanced Transmission Selection scheduler is a classful queuing |
| 22 |
discipline that merges functionality of PRIO and DRR qdiscs in one |
| 23 |
scheduler. ETS makes it easy to configure a set of strict and |
| 24 |
bandwidth-sharing bands to implement the transmission selection described |
| 25 |
in 802.1Qaz. |
| 26 |
|
| 27 |
On creation with 'tc qdisc add', a fixed number of bands is created. Each |
| 28 |
band is a class, although it is not possible to directly add and remove |
| 29 |
bands with 'tc class' commands. The number of bands to be created must |
| 30 |
instead be specified on the command line as the qdisc is added. |
| 31 |
|
| 32 |
The minor number of classid to use when referring to a band is the band |
| 33 |
number increased by one. Thus band 0 will have classid of major:1, band 1 |
| 34 |
that of major:2, etc. |
| 35 |
|
| 36 |
ETS bands are of two types: some number may be in strict mode, the |
| 37 |
remaining ones are in bandwidth-sharing mode. |
| 38 |
|
| 39 |
.SH ALGORITHM |
| 40 |
When dequeuing, strict bands are tried first, if there are any. Band 0 is |
| 41 |
tried first. If it did not deliver a packet, band 1 is tried next, and so |
| 42 |
on until one of the bands delivers a packet, or the strict bands are |
| 43 |
exhausted. |
| 44 |
|
| 45 |
If no packet has been dequeued from any of the strict bands, if there are |
| 46 |
any bandwidth-sharing bands, the dequeuing proceeds according to the DRR |
| 47 |
algorithm. Each bandwidth-sharing band is assigned a deficit counter, |
| 48 |
initialized to quantum assigned by a |
| 49 |
.B quanta |
| 50 |
element. ETS maintains an (internal) ''active'' list of bandwidth-sharing |
| 51 |
bands whose qdiscs are non-empty. This list is used for dequeuing. A packet |
| 52 |
is dequeued from the band at the head of the list if the packet size is |
| 53 |
smaller or equal to the deficit counter. If the counter is too small, it is |
| 54 |
increased by |
| 55 |
.B quantum |
| 56 |
and the scheduler moves on to the next band in the active list. |
| 57 |
|
| 58 |
Only qdiscs that own their queue should be added below the |
| 59 |
bandwidth-sharing bands. Attaching to them non-work-conserving qdiscs like |
| 60 |
TBF does not make sense \-\- other qdiscs in the active list will be |
| 61 |
skipped until the dequeue operation succeeds. This limitation does not |
| 62 |
exist with the strict bands. |
| 63 |
|
| 64 |
.SH CLASSIFICATION |
| 65 |
The ETS qdisc allows three ways to decide which band to enqueue a packet |
| 66 |
to: |
| 67 |
|
| 68 |
- Packet priority can be directly set to a class handle, in which case that |
| 69 |
is the queue where the packet will be put. For example, band number 2 of |
| 70 |
a qdisc with handle of 11: will have classid 11:3. To mark a packet for |
| 71 |
queuing to this band, the packet priority should be set to 0x110003. |
| 72 |
|
| 73 |
- A tc filter attached to the qdisc can put the packet to a band by using |
| 74 |
the \fBflowid\fR keyword. |
| 75 |
|
| 76 |
- As a last resort, the ETS qdisc consults its priomap (see below), which |
| 77 |
maps packets to bands based on packet priority. |
| 78 |
|
| 79 |
.SH PARAMETERS |
| 80 |
.TP |
| 81 |
strict |
| 82 |
The number of bands that should be created in strict mode. If not given, |
| 83 |
this value is 0. |
| 84 |
|
| 85 |
.TP |
| 86 |
quanta |
| 87 |
Each bandwidth-sharing band needs to know its quantum, which is the amount |
| 88 |
of bytes a band is allowed to dequeue before the scheduler moves to the |
| 89 |
next bandwidth-sharing band. The |
| 90 |
.B quanta |
| 91 |
argument lists quanta for the individual bandwidth-sharing bands. |
| 92 |
The minimum value of each quantum is 1. If |
| 93 |
.B quanta |
| 94 |
is not given, the default is no bandwidth-sharing bands, but note that when |
| 95 |
specifying a large number of |
| 96 |
.B bands, |
| 97 |
the extra ones are in bandwidth-sharing mode by default. |
| 98 |
|
| 99 |
.TP |
| 100 |
bands |
| 101 |
Number of bands given explicitly. This value has to be at least large |
| 102 |
enough to cover the strict bands specified through the |
| 103 |
.B strict |
| 104 |
keyword and bandwidth-sharing bands specified in |
| 105 |
.B quanta. |
| 106 |
If a larger value is given, any extra bands are in bandwidth-sharing mode, |
| 107 |
and their quanta are deduced from the interface MTU. If no value is given, |
| 108 |
as many bands are created as necessary to cover all bands implied by the |
| 109 |
.B strict |
| 110 |
and |
| 111 |
.B quanta |
| 112 |
keywords. |
| 113 |
|
| 114 |
.TP |
| 115 |
priomap |
| 116 |
The priomap maps the priority of a packet to a band. The argument is a list |
| 117 |
of numbers. The first number indicates which band the packets with priority |
| 118 |
0 should be put to, the second is for priority 1, and so on. |
| 119 |
|
| 120 |
There can be up to 16 numbers in the list. If there are fewer, the default |
| 121 |
band that traffic with one of the unmentioned priorities goes to is the |
| 122 |
last one. |
| 123 |
|
| 124 |
.SH EXAMPLE & USAGE |
| 125 |
|
| 126 |
.P |
| 127 |
Add a qdisc with 8 bandwidth-sharing bands, using the interface MTU as |
| 128 |
their quanta. Since all quanta are the same, this will lead to equal |
| 129 |
distribution of bandwidth between the bands, each will get about 12.5% of |
| 130 |
the link. The low 8 priorities go to individual bands in a reverse 1:1 |
| 131 |
fashion (such that the highest priority goes to the first band). |
| 132 |
|
| 133 |
.P |
| 134 |
# tc qdisc add dev eth0 root handle 1: ets bands 8 priomap 7 6 5 4 3 2 1 0 |
| 135 |
.br |
| 136 |
# tc qdisc show dev eth0 |
| 137 |
.br |
| 138 |
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 |
| 139 |
|
| 140 |
.P |
| 141 |
Tweak the first band of the above qdisc to give it a quantum of 2650, which |
| 142 |
will give it about 20% of the link (and about 11.5% to the remaining |
| 143 |
bands): |
| 144 |
|
| 145 |
.P |
| 146 |
# tc class change dev eth0 classid 1:1 ets quantum 2650 |
| 147 |
.br |
| 148 |
# tc qdisc show dev eth0 |
| 149 |
.br |
| 150 |
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 |
| 151 |
|
| 152 |
.P |
| 153 |
Create a purely strict Qdisc with reverse 1:1 mapping between priorities |
| 154 |
and bands: |
| 155 |
|
| 156 |
.P |
| 157 |
# tc qdisc add dev eth0 root handle 1: ets strict 8 priomap 7 6 5 4 3 2 1 0 |
| 158 |
.br |
| 159 |
# tc qdisc sh dev eth0 |
| 160 |
.br |
| 161 |
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 |
| 162 |
|
| 163 |
.P |
| 164 |
Add a Qdisc with 6 bands, 3 strict and 3 ETS with 35%-30%-25% weights: |
| 165 |
.P |
| 166 |
# tc qdisc add dev eth0 root handle 1: ets strict 3 quanta 3500 3000 2500 priomap 0 1 1 1 2 3 4 5 |
| 167 |
.br |
| 168 |
# tc qdisc sh dev eth0 |
| 169 |
.br |
| 170 |
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 |
| 171 |
|
| 172 |
.P |
| 173 |
Create a Qdisc such that traffic with priorities 2, 3 and 4 are strictly |
| 174 |
prioritized over other traffic, and the rest goes into bandwidth-sharing |
| 175 |
classes with equal weights: |
| 176 |
.P |
| 177 |
# tc qdisc add dev eth0 root handle 1: ets bands 8 strict 3 priomap 3 4 0 1 2 5 6 7 |
| 178 |
.br |
| 179 |
# tc qdisc sh dev eth0 |
| 180 |
.br |
| 181 |
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 |
| 182 |
|
| 183 |
.SH SEE ALSO |
| 184 |
.BR tc (8), |
| 185 |
.BR tc-prio (8), |
| 186 |
.BR tc-drr (8) |
| 187 |
|
| 188 |
.SH AUTHOR |
| 189 |
Parts of both this manual page and the code itself are taken from PRIO and |
| 190 |
DRR qdiscs. |
| 191 |
.br |
| 192 |
ETS qdisc itself was written by Petr Machata. |