]> git.proxmox.com Git - mirror_iproute2.git/blame - man/man8/tc-prio.8
bridge: mdb: add support for source address
[mirror_iproute2.git] / man / man8 / tc-prio.8
CommitLineData
985794ad
SH
1.TH PRIO 8 "16 December 2001" "iproute2" "Linux"
2.SH NAME
3PRIO \- Priority qdisc
4.SH SYNOPSIS
5.B tc qdisc ... dev
6dev
7.B ( parent
5699275b
SH
8classid
9.B | root) [ handle
10major:
11.B ] prio [ bands
985794ad
SH
12bands
13.B ] [ priomap
8c8a9089 14band band band...
5699275b 15.B ] [ estimator
985794ad
SH
16interval timeconstant
17.B ]
18
19.SH DESCRIPTION
20The PRIO qdisc is a simple classful queueing discipline that contains
21an arbitrary number of classes of differing priority. The classes are
5699275b 22dequeued in numerical descending order of priority. PRIO is a scheduler
985794ad
SH
23and never delays packets - it is a work-conserving qdisc, though the qdiscs
24contained in the classes may not be.
25
26Very useful for lowering latency when there is no need for slowing down
27traffic.
28
29.SH ALGORITHM
30On creation with 'tc qdisc add', a fixed number of bands is created. Each
31band is a class, although is not possible to add classes with 'tc qdisc
32add', the number of bands to be created must instead be specified on the
b096fa5f 33command line attaching PRIO to its root.
985794ad
SH
34
35When dequeueing, band 0 is tried first and only if it did not deliver a
36packet does PRIO try band 1, and so onwards. Maximum reliability packets
37should therefore go to band 0, minimum delay to band 1 and the rest to band
382.
39
40As the PRIO qdisc itself will have minor number 0, band 0 is actually
41major:1, band 1 is major:2, etc. For major, substitute the major number
42assigned to the qdisc on 'tc qdisc add' with the
43.B handle
44parameter.
45
46.SH CLASSIFICATION
47Three methods are available to PRIO to determine in which band a packet will
48be enqueued.
49.TP
50From userspace
51A process with sufficient privileges can encode the destination class
52directly with SO_PRIORITY, see
9e318455 53.BR socket(7).
5699275b 54.TP
985794ad
SH
55with a tc filter
56A tc filter attached to the root qdisc can point traffic directly to a class
5699275b 57.TP
985794ad
SH
58with the priomap
59Based on the packet priority, which in turn is derived from the Type of
60Service assigned to the packet.
61.P
5699275b 62Only the priomap is specific to this qdisc.
985794ad
SH
63.SH QDISC PARAMETERS
64.TP
65bands
66Number of bands. If changed from the default of 3,
67.B priomap
68must be updated as well.
5699275b 69.TP
985794ad
SH
70priomap
71The priomap maps the priority of
72a packet to a class. The priority can either be set directly from userspace,
73or be derived from the Type of Service of the packet.
74
75Determines how packet priorities, as assigned by the kernel, map to
76bands. Mapping occurs based on the TOS octet of the packet, which looks like
77this:
78
79.nf
800 1 2 3 4 5 6 7
81+---+---+---+---+---+---+---+---+
82| | | |
83|PRECEDENCE | TOS |MBZ|
84| | | |
85+---+---+---+---+---+---+---+---+
86.fi
87
88The four TOS bits (the 'TOS field') are defined as:
89
90.nf
b096fa5f 91Binary Decimal Meaning
985794ad
SH
92-----------------------------------------
931000 8 Minimize delay (md)
940100 4 Maximize throughput (mt)
950010 2 Maximize reliability (mr)
960001 1 Minimize monetary cost (mmc)
970000 0 Normal Service
98.fi
99
100As there is 1 bit to the right of these four bits, the actual value of the
101TOS field is double the value of the TOS bits. Tcpdump -v -v shows you the
102value of the entire TOS field, not just the four bits. It is the value you
103see in the first column of this table:
104
105.nf
106TOS Bits Means Linux Priority Band
107------------------------------------------------------------
1080x0 0 Normal Service 0 Best Effort 1
96e8ab7c 1090x2 1 Minimize Monetary Cost 0 Best Effort 1
985794ad
SH
1100x4 2 Maximize Reliability 0 Best Effort 1
1110x6 3 mmc+mr 0 Best Effort 1
1120x8 4 Maximize Throughput 2 Bulk 2
1130xa 5 mmc+mt 2 Bulk 2
1140xc 6 mr+mt 2 Bulk 2
1150xe 7 mmc+mr+mt 2 Bulk 2
1160x10 8 Minimize Delay 6 Interactive 0
1170x12 9 mmc+md 6 Interactive 0
1180x14 10 mr+md 6 Interactive 0
1190x16 11 mmc+mr+md 6 Interactive 0
1200x18 12 mt+md 4 Int. Bulk 1
1210x1a 13 mmc+mt+md 4 Int. Bulk 1
1220x1c 14 mr+mt+md 4 Int. Bulk 1
1230x1e 15 mmc+mr+mt+md 4 Int. Bulk 1
124.fi
125
126The second column contains the value of the relevant
127four TOS bits, followed by their translated meaning. For example, 15 stands
b096fa5f 128for a packet wanting Minimal Monetary Cost, Maximum Reliability, Maximum
5699275b 129Throughput AND Minimum Delay.
985794ad
SH
130
131The fourth column lists the way the Linux kernel interprets the TOS bits, by
132showing to which Priority they are mapped.
133
b096fa5f 134The last column shows the result of the default priomap. On the command line,
985794ad
SH
135the default priomap looks like this:
136
8c8a9089 137 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
985794ad
SH
138
139This means that priority 4, for example, gets mapped to band number 1.
140The priomap also allows you to list higher priorities (> 7) which do not
141correspond to TOS mappings, but which are set by other means.
142
143This table from RFC 1349 (read it for more details) explains how
144applications might very well set their TOS bits:
145
146.nf
147TELNET 1000 (minimize delay)
148FTP
149 Control 1000 (minimize delay)
150 Data 0100 (maximize throughput)
151
152TFTP 1000 (minimize delay)
153
5699275b 154SMTP
985794ad
SH
155 Command phase 1000 (minimize delay)
156 DATA phase 0100 (maximize throughput)
157
158Domain Name Service
159 UDP Query 1000 (minimize delay)
160 TCP Query 0000
161 Zone Transfer 0100 (maximize throughput)
162
163NNTP 0001 (minimize monetary cost)
164
165ICMP
166 Errors 0000
167 Requests 0000 (mostly)
168 Responses <same as request> (mostly)
169.fi
170
171
172.SH CLASSES
173PRIO classes cannot be configured further - they are automatically created
174when the PRIO qdisc is attached. Each class however can contain yet a
175further qdisc.
176
177.SH BUGS
178Large amounts of traffic in the lower bands can cause starvation of higher
5699275b 179bands. Can be prevented by attaching a shaper (for example,
985794ad
SH
180.BR tc-tbf(8)
181to these bands to make sure they cannot dominate the link.
182
183.SH AUTHORS
184Alexey N. Kuznetsov, <kuznet@ms2.inr.ac.ru>, J Hadi Salim
185<hadi@cyberus.ca>. This manpage maintained by bert hubert <ahu@ds9a.nl>