1TC(8)                                Linux                               TC(8)
2
3
4

NAME

6       ETS - Enhanced Transmission Selection scheduler
7

SYNOPSIS

9       tc  qdisc  ...  ets  [  bands number ] [ strict number ] [ quanta bytes
10       bytes bytes...  ] [ priomap band band band...  ]
11
12       tc class ... ets [ quantum bytes ]
13
14

DESCRIPTION

16       The Enhanced Transmission Selection scheduler  is  a  classful  queuing
17       discipline  that  merges  functionality  of  PRIO and DRR qdiscs in one
18       scheduler. ETS makes it easy to configure a set  of  strict  and  band‐
19       width-sharing  bands  to implement the transmission selection described
20       in 802.1Qaz.
21
22       On creation with 'tc qdisc add', a fixed number of  bands  is  created.
23       Each  band  is a class, although it is not possible to directly add and
24       remove bands with 'tc class' commands. The number of bands to  be  cre‐
25       ated  must  instead  be  specified  on the command line as the qdisc is
26       added.
27
28       The minor number of classid to use when referring to a band is the band
29       number increased by one. Thus band 0 will have classid of major:1, band
30       1 that of major:2, etc.
31
32       ETS bands are of two types: some number may  be  in  strict  mode,  the
33       remaining ones are in bandwidth-sharing mode.
34
35

ALGORITHM

37       When  dequeuing, strict bands are tried first, if there are any. Band 0
38       is tried first. If it did not deliver a packet, band 1 is  tried  next,
39       and so on until one of the bands delivers a packet, or the strict bands
40       are exhausted.
41
42       If no packet has been dequeued from any of the strict bands,  if  there
43       are  any  bandwidth-sharing  bands, the dequeuing proceeds according to
44       the DRR algorithm. Each bandwidth-sharing band is  assigned  a  deficit
45       counter, initialized to quantum assigned by a quanta element. ETS main‐
46       tains an (internal) ''active'' list of  bandwidth-sharing  bands  whose
47       qdiscs  are  non-empty.  This  list  is used for dequeuing. A packet is
48       dequeued from the band at the head of the list if the  packet  size  is
49       smaller  or  equal to the deficit counter. If the counter is too small,
50       it is increased by quantum and the scheduler moves on to the next  band
51       in the active list.
52
53       Only  qdiscs  that own their queue should be added below the bandwidth-
54       sharing bands. Attaching to them non-work-conserving  qdiscs  like  TBF
55       does  not make sense -- other qdiscs in the active list will be skipped
56       until the dequeue operation succeeds. This limitation  does  not  exist
57       with the strict bands.
58
59

CLASSIFICATION

61       The  ETS  qdisc  allows  three  ways  to decide which band to enqueue a
62       packet to:
63
64       - Packet priority can be directly set to a class handle, in which  case
65       that
66         is the queue where the packet will be put. For example, band number 2
67       of
68         a qdisc with handle of 11: will have classid 11:3. To mark  a  packet
69       for
70         queuing to this band, the packet priority should be set to 0x110003.
71
72       -  A  tc  filter  attached to the qdisc can put the packet to a band by
73       using
74         the flowid keyword.
75
76       - As a last resort, the ETS qdisc consults  its  priomap  (see  below),
77       which
78         maps packets to bands based on packet priority.
79
80

PARAMETERS

82       strict The  number  of  bands that should be created in strict mode. If
83              not given, this value is 0.
84
85
86       quanta Each bandwidth-sharing band needs to know its quantum, which  is
87              the  amount  of  bytes  a  band is allowed to dequeue before the
88              scheduler moves to the next bandwidth-sharing band.  The  quanta
89              argument  lists  quanta  for  the  individual  bandwidth-sharing
90              bands.  The minimum value of each quantum is 1. If quanta is not
91              given,  the default is no bandwidth-sharing bands, but note that
92              when specifying a large number of bands, the extra ones  are  in
93              bandwidth-sharing mode by default.
94
95
96       bands  Number  of bands given explicitly. This value has to be at least
97              large enough to cover the strict  bands  specified  through  the
98              strict  keyword and bandwidth-sharing bands specified in quanta.
99              If a larger value is given, any extra bands  are  in  bandwidth-
100              sharing  mode,  and  their quanta are deduced from the interface
101              MTU. If no value is given, as many bands are created  as  neces‐
102              sary  to  cover  all bands implied by the strict and quanta key‐
103              words.
104
105
106       priomap
107              The priomap maps the priority of a packet to a band.  The  argu‐
108              ment is a list of numbers. The first number indicates which band
109              the packets with priority 0 should be put to, the second is  for
110              priority 1, and so on.
111
112              There  can  be up to 16 numbers in the list. If there are fewer,
113              the default band that traffic with one of the unmentioned prior‐
114              ities goes to is the last one.
115
116

EXAMPLE & USAGE

118       Add  a qdisc with 8 bandwidth-sharing bands, using the interface MTU as
119       their quanta. Since all quanta are the same, this will  lead  to  equal
120       distribution  of bandwidth between the bands, each will get about 12.5%
121       of the link. The low 8 priorities go to individual bands in  a  reverse
122       1:1 fashion (such that the highest priority goes to the first band).
123
124
125       #  tc qdisc add dev eth0 root handle 1: ets bands 8 priomap 7 6 5 4 3 2
126       1 0
127       # tc qdisc show dev eth0
128       qdisc ets 1: root refcnt 2 bands 8 quanta 1514 1514 1514 1514 1514 1514
129       1514 1514 priomap 7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
130
131
132       Tweak  the  first band of the above qdisc to give it a quantum of 2650,
133       which will give it about 20% of  the  link  (and  about  11.5%  to  the
134       remaining bands):
135
136
137       # tc class change dev eth0 classid 1:1 ets quantum 2650
138       # tc qdisc show dev eth0
139       qdisc ets 1: root refcnt 2 bands 8 quanta 2650 1514 1514 1514 1514 1514
140       1514 1514 priomap 7 6 5 4 3 2 1 0 7 7 7 7 7 7 7 7
141
142
143       Create a purely strict Qdisc with reverse 1:1 mapping  between  priori‐
144       ties and bands:
145
146
147       # tc qdisc add dev eth0 root handle 1: ets strict 8 priomap 7 6 5 4 3 2
148       1 0
149       # tc qdisc sh dev eth0
150       qdisc ets 1: root refcnt 2 bands 8 strict 8 priomap 7 6 5 4 3 2 1 0 7 7
151       7 7 7 7 7 7
152
153
154       Add a Qdisc with 6 bands, 3 strict and 3 ETS with 35%-30%-25% weights:
155
156       #  tc  qdisc  add dev eth0 root handle 1: ets strict 3 quanta 3500 3000
157       2500 priomap 0 1 1 1 2 3 4 5
158       # tc qdisc sh dev eth0
159       qdisc ets 1: root refcnt 2 bands 6 strict 3 quanta 3500 3000 2500  pri‐
160       omap 0 1 1 1 2 3 4 5 5 5 5 5 5 5 5 5
161
162
163       Create  a  Qdisc  such  that  traffic  with  priorities  2, 3 and 4 are
164       strictly prioritized over other traffic, and the rest goes  into  band‐
165       width-sharing classes with equal weights:
166
167       # tc qdisc add dev eth0 root handle 1: ets bands 8 strict 3 priomap 3 4
168       0 1 2 5 6 7
169       # tc qdisc sh dev eth0
170       qdisc ets 1: root refcnt 2 bands 8 strict 3 quanta 1514 1514 1514  1514
171       1514 priomap 3 4 0 1 2 5 6 7 7 7 7 7 7 7 7 7
172
173

SEE ALSO

175       tc(8), tc-prio(8), tc-drr(8)
176
177

AUTHOR

179       Parts  of both this manual page and the code itself are taken from PRIO
180       and DRR qdiscs.
181       ETS qdisc itself was written by Petr Machata.
182
183
184
185iproute2                         December 2019                           TC(8)
Impressum