Debian Codegraph @

upstream/debian-unstable/man8/tc.8

raw
1 .TH TC 8 "16 December 2001" "iproute2" "Linux"
2 .SH NAME
3 tc \- show / manipulate traffic control settings
4 .SH SYNOPSIS
5 .B tc
6 .RI "[ " OPTIONS " ]"
7 .B qdisc [ add | change | replace | link | delete ] dev
8 \fIDEV\fR
9 .B
10 [ parent
11 \fIqdisc-id\fR
12 .B | root ]
13 .B [ handle
14 \fIqdisc-id\fR ]
15 .B [ ingress_block
16 \fIBLOCK_INDEX\fR ]
17 .B [ egress_block
18 \fIBLOCK_INDEX\fR ] qdisc
19 [ qdisc specific parameters ]
20 .P
21
22 .B tc
23 .RI "[ " OPTIONS " ]"
24 .B class [ add | change | replace | delete | show ] dev
25 \fIDEV\fR
26 .B parent
27 \fIqdisc-id\fR
28 .B [ classid
29 \fIclass-id\fR ] qdisc
30 [ qdisc specific parameters ]
31 .P
32
33 .B tc
34 .RI "[ " OPTIONS " ]"
35 .B filter [ add | change | replace | delete | get ] dev
36 \fIDEV\fR
37 .B [ parent
38 \fIqdisc-id\fR
39 .B | root ] [ handle \fIfilter-id\fR ]
40 .B protocol
41 \fIprotocol\fR
42 .B prio
43 \fIpriority\fR filtertype
44 [ filtertype specific parameters ]
45 .B flowid
46 \fIflow-id\fR
47
48 .B tc
49 .RI "[ " OPTIONS " ]"
50 .B filter [ add | change | replace | delete | get ] block
51 \fIBLOCK_INDEX\fR
52 .B [ handle \fIfilter-id\fR ]
53 .B protocol
54 \fIprotocol\fR
55 .B prio
56 \fIpriority\fR filtertype
57 [ filtertype specific parameters ]
58 .B flowid
59 \fIflow-id\fR
60
61 .B tc
62 .RI "[ " OPTIONS " ]"
63 .B chain [ add | delete | get ] dev
64 \fIDEV\fR
65 .B [ parent
66 \fIqdisc-id\fR
67 .B | root ]\fR filtertype
68 [ filtertype specific parameters ]
69
70 .B tc
71 .RI "[ " OPTIONS " ]"
72 .B chain [ add | delete | get ] block
73 \fIBLOCK_INDEX\fR filtertype
74 [ filtertype specific parameters ]
75
76
77 .B tc
78 .RI "[ " OPTIONS " ]"
79 .RI "[ " FORMAT " ]"
80 .B qdisc { show | list } [ dev
81 \fIDEV\fR
82 .B ] [ root | ingress | handle
83 \fIQHANDLE\fR
84 .B | parent
85 \fICLASSID\fR
86 .B ] [ invisible ]
87 .P
88 .B tc
89 .RI "[ " OPTIONS " ]"
90 .RI "[ " FORMAT " ]"
91 .B class show dev
92 \fIDEV\fR
93 .P
94 .B tc
95 .RI "[ " OPTIONS " ]"
96 .B filter show dev
97 \fIDEV\fR
98 .P
99 .B tc
100 .RI "[ " OPTIONS " ]"
101 .B filter show block
102 \fIBLOCK_INDEX\fR
103 .P
104 .B tc
105 .RI "[ " OPTIONS " ]"
106 .B chain show dev
107 \fIDEV\fR
108 .P
109 .B tc
110 .RI "[ " OPTIONS " ]"
111 .B chain show block
112 \fIBLOCK_INDEX\fR
113
114 .P
115 .B tc
116 .RI "[ " OPTIONS " ]"
117 .B monitor [ file
118 \fIFILENAME\fR
119 .B ]
120
121 .P
122 .ti 8
123 .IR OPTIONS " := {"
124 \fB[ -force ] -b\fR[\fIatch\fR] \fB[ filename ] \fR|
125 \fB[ \fB-n\fR[\fIetns\fR] name \fB] \fR|
126 \fB[ \fB-N\fR[\fIumeric\fR] \fB] \fR|
127 \fB[ \fB-nm \fR| \fB-nam\fR[\fIes\fR] \fB] \fR|
128 \fB[ \fR{ \fB-cf \fR| \fB-c\fR[\fIonf\fR] \fR} \fB[ filename ] \fB] \fR
129 \fB[ -t\fR[imestamp\fR] \fB\] \fR| \fB[ -t\fR[short\fR] \fR| \fB[
130 -o\fR[neline\fR] \fB] \fR| \fB[ -echo ]\fR }
131
132 .ti 8
133 .IR FORMAT " := {"
134 \fB\-s\fR[\fItatistics\fR] |
135 \fB\-d\fR[\fIetails\fR] |
136 \fB\-r\fR[\fIaw\fR] |
137 \fB\-i\fR[\fIec\fR] |
138 \fB\-g\fR[\fIraph\fR] |
139 \fB\-j\fR[\fIson\fR] |
140 \fB\-p\fR[\fIretty\fR] |
141 \fB\-col\fR[\fIor\fR] }
142
143 .SH DESCRIPTION
144 .B Tc
145 is used to configure Traffic Control in the Linux kernel. Traffic Control consists
146 of the following:
147
148 .TP
149 SHAPING
150 When traffic is shaped, its rate of transmission is under control. Shaping may
151 be more than lowering the available bandwidth - it is also used to smooth out
152 bursts in traffic for better network behaviour. Shaping occurs on egress.
153
154 .TP
155 SCHEDULING
156 By scheduling the transmission of packets it is possible to improve interactivity
157 for traffic that needs it while still guaranteeing bandwidth to bulk transfers. Reordering
158 is also called prioritizing, and happens only on egress.
159
160 .TP
161 POLICING
162 Whereas shaping deals with transmission of traffic, policing pertains to traffic
163 arriving. Policing thus occurs on ingress.
164
165 .TP
166 DROPPING
167 Traffic exceeding a set bandwidth may also be dropped forthwith, both on
168 ingress and on egress.
169
170 .P
171 Processing of traffic is controlled by three kinds of objects: qdiscs,
172 classes and filters.
173
174 .SH QDISCS
175 .B qdisc
176 is short for 'queueing discipline' and it is elementary to
177 understanding traffic control. Whenever the kernel needs to send a
178 packet to an interface, it is
179 .B enqueued
180 to the qdisc configured for that interface. Immediately afterwards, the kernel
181 tries to get as many packets as possible from the qdisc, for giving them
182 to the network adaptor driver.
183
184 A simple QDISC is the 'pfifo' one, which does no processing at all and is a pure
185 First In, First Out queue. It does however store traffic when the network interface
186 can't handle it momentarily.
187
188 .SH CLASSES
189 Some qdiscs can contain classes, which contain further qdiscs - traffic may
190 then be enqueued in any of the inner qdiscs, which are within the
191 .B classes.
192 When the kernel tries to dequeue a packet from such a
193 .B classful qdisc
194 it can come from any of the classes. A qdisc may for example prioritize
195 certain kinds of traffic by trying to dequeue from certain classes
196 before others.
197
198 .SH FILTERS
199 A
200 .B filter
201 is used by a classful qdisc to determine in which class a packet will
202 be enqueued. Whenever traffic arrives at a class with subclasses, it needs
203 to be classified. Various methods may be employed to do so, one of these
204 are the filters. All filters attached to the class are called, until one of
205 them returns with a verdict. If no verdict was made, other criteria may be
206 available. This differs per qdisc.
207
208 It is important to notice that filters reside
209 .B within
210 qdiscs - they are not masters of what happens.
211
212 The available filters are:
213 .TP
214 basic
215 Filter packets based on an ematch expression. See
216 .BR tc-ematch (8)
217 for details.
218 .TP
219 bpf
220 Filter packets using (e)BPF, see
221 .BR tc-bpf (8)
222 for details.
223 .TP
224 cgroup
225 Filter packets based on the control group of their process. See
226 . BR tc-cgroup (8)
227 for details.
228 .TP
229 flow, flower
230 Flow-based classifiers, filtering packets based on their flow (identified by selectable keys). See
231 .BR tc-flow "(8) and"
232 .BR tc-flower (8)
233 for details.
234 .TP
235 fw
236 Filter based on fwmark. Directly maps fwmark value to traffic class. See
237 .BR tc-fw (8).
238 .TP
239 route
240 Filter packets based on routing table. See
241 .BR tc-route (8)
242 for details.
243 .TP
244 u32
245 Generic filtering on arbitrary packet data, assisted by syntax to abstract common operations. See
246 .BR tc-u32 (8)
247 for details.
248 .TP
249 matchall
250 Traffic control filter that matches every packet. See
251 .BR tc-matchall (8)
252 for details.
253
254 .SH QEVENTS
255 Qdiscs may invoke user-configured actions when certain interesting events
256 take place in the qdisc. Each qevent can either be unused, or can have a
257 block attached to it. To this block are then attached filters using the "tc
258 block BLOCK_IDX" syntax. The block is executed when the qevent associated
259 with the attachment point takes place. For example, packet could be
260 dropped, or delayed, etc., depending on the qdisc and the qevent in
261 question.
262
263 For example:
264 .PP
265 .RS
266 tc qdisc add dev eth0 root handle 1: red limit 500K avpkt 1K \\
267 qevent early_drop block 10
268 .RE
269 .RS
270 tc filter add block 10 matchall action mirred egress mirror dev eth1
271 .RE
272
273 .SH CLASSLESS QDISCS
274 The classless qdiscs are:
275 .TP
276 choke
277 CHOKe (CHOose and Keep for responsive flows, CHOose and Kill for unresponsive
278 flows) is a classless qdisc designed to both identify and penalize flows that
279 monopolize the queue. CHOKe is a variation of RED, and the configuration is
280 similar to RED.
281 .TP
282 codel
283 CoDel (pronounced "coddle") is an adaptive "no-knobs" active queue management
284 algorithm (AQM) scheme that was developed to address the shortcomings of
285 RED and its variants.
286 .TP
287 [p|b]fifo
288 Simplest usable qdisc, pure First In, First Out behaviour. Limited in
289 packets or in bytes.
290 .TP
291 fq
292 Fair Queue Scheduler realises TCP pacing and scales to millions of concurrent
293 flows per qdisc.
294 .TP
295 fq_codel
296 Fair Queuing Controlled Delay is queuing discipline that combines Fair
297 Queuing with the CoDel AQM scheme. FQ_Codel uses a stochastic model to classify
298 incoming packets into different flows and is used to provide a fair share of the
299 bandwidth to all the flows using the queue. Each such flow is managed by the
300 CoDel queuing discipline. Reordering within a flow is avoided since Codel
301 internally uses a FIFO queue.
302 .TP
303 fq_pie
304 FQ-PIE (Flow Queuing with Proportional Integral controller Enhanced) is a
305 queuing discipline that combines Flow Queuing with the PIE AQM scheme. FQ-PIE
306 uses a Jenkins hash function to classify incoming packets into different flows
307 and is used to provide a fair share of the bandwidth to all the flows using the
308 qdisc. Each such flow is managed by the PIE algorithm.
309 .TP
310 gred
311 Generalized Random Early Detection combines multiple RED queues in order to
312 achieve multiple drop priorities. This is required to realize Assured
313 Forwarding (RFC 2597).
314 .TP
315 hhf
316 Heavy-Hitter Filter differentiates between small flows and the opposite,
317 heavy-hitters. The goal is to catch the heavy-hitters and move them to a
318 separate queue with less priority so that bulk traffic does not affect the
319 latency of critical traffic.
320 .TP
321 ingress
322 This is a special qdisc as it applies to incoming traffic on an interface, allowing for it to be filtered and policed.
323 .TP
324 mqprio
325 The Multiqueue Priority Qdisc is a simple queuing discipline that allows
326 mapping traffic flows to hardware queue ranges using priorities and a
327 configurable priority to traffic class mapping. A traffic class in this context
328 is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed
329 queues.
330 .TP
331 multiq
332 Multiqueue is a qdisc optimized for devices with multiple Tx queues. It has
333 been added for hardware that wishes to avoid head-of-line blocking. It will
334 cycle though the bands and verify that the hardware queue associated with the
335 band is not stopped prior to dequeuing a packet.
336 .TP
337 netem
338 Network Emulator is an enhancement of the Linux traffic control facilities that
339 allow one to add delay, packet loss, duplication and more other characteristics to
340 packets outgoing from a selected network interface.
341 .TP
342 pfifo_fast
343 Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band
344 queue which honors Type of Service flags, as well as the priority that may be
345 assigned to a packet.
346 .TP
347 pie
348 Proportional Integral controller-Enhanced (PIE) is a control theoretic active
349 queue management scheme. It is based on the proportional integral controller but
350 aims to control delay.
351 .TP
352 red
353 Random Early Detection simulates physical congestion by randomly dropping
354 packets when nearing configured bandwidth allocation. Well suited to very
355 large bandwidth applications.
356 .TP
357 sfb
358 Stochastic Fair Blue is a classless qdisc to manage congestion based on
359 packet loss and link utilization history while trying to prevent
360 non-responsive flows (i.e. flows that do not react to congestion marking
361 or dropped packets) from impacting performance of responsive flows.
362 Unlike RED, where the marking probability has to be configured, BLUE
363 tries to determine the ideal marking probability automatically.
364 .TP
365 sfq
366 Stochastic Fairness Queueing reorders queued traffic so each 'session'
367 gets to send a packet in turn.
368 .TP
369 tbf
370 The Token Bucket Filter is suited for slowing traffic down to a precisely
371 configured rate. Scales well to large bandwidths.
372 .SH CONFIGURING CLASSLESS QDISCS
373 In the absence of classful qdiscs, classless qdiscs can only be attached at
374 the root of a device. Full syntax:
375 .P
376 .B tc qdisc add dev
377 \fIDEV\fR
378 .B root
379 QDISC QDISC-PARAMETERS
380
381 To remove, issue
382 .P
383 .B tc qdisc del dev
384 \fIDEV\fR
385 .B root
386
387 The
388 .B pfifo_fast
389 qdisc is the automatic default in the absence of a configured qdisc.
390
391 .SH CLASSFUL QDISCS
392 The classful qdiscs are:
393 .TP
394 ATM
395 Map flows to virtual circuits of an underlying asynchronous transfer mode
396 device.
397 .TP
398 DRR
399 The Deficit Round Robin Scheduler is a more flexible replacement for Stochastic
400 Fairness Queuing. Unlike SFQ, there are no built-in queues \-\- you need to add
401 classes and then set up filters to classify packets accordingly. This can be
402 useful e.g. for using RED qdiscs with different settings for particular
403 traffic. There is no default class \-\- if a packet cannot be classified, it is
404 dropped.
405 .TP
406 ETS
407 The ETS qdisc is a queuing discipline that merges functionality of PRIO and DRR
408 qdiscs in one scheduler. ETS makes it easy to configure a set of strict and
409 bandwidth-sharing bands to implement the transmission selection described in
410 802.1Qaz.
411 .TP
412 HFSC
413 Hierarchical Fair Service Curve guarantees precise bandwidth and delay allocation for leaf classes and allocates excess bandwidth fairly. Unlike HTB, it makes use of packet dropping to achieve low delays which interactive sessions benefit from.
414 .TP
415 HTB
416 The Hierarchy Token Bucket implements a rich linksharing hierarchy of
417 classes with an emphasis on conforming to existing practices. HTB facilitates
418 guaranteeing bandwidth to classes, while also allowing specification of upper
419 limits to inter-class sharing. It contains shaping elements, based on TBF and
420 can prioritize classes.
421 .TP
422 PRIO
423 The PRIO qdisc is a non-shaping container for a configurable number of
424 classes which are dequeued in order. This allows for easy prioritization
425 of traffic, where lower classes are only able to send if higher ones have
426 no packets available. To facilitate configuration, Type Of Service bits are
427 honored by default.
428 .TP
429 QFQ
430 Quick Fair Queueing is an O(1) scheduler that provides near-optimal guarantees,
431 and is the first to achieve that goal with a constant cost also with respect to
432 the number of groups and the packet length. The QFQ algorithm has no loops, and
433 uses very simple instructions and data structures that lend themselves very
434 well to a hardware implementation.
435 .SH THEORY OF OPERATION
436 Classes form a tree, where each class has a single parent.
437 A class may have multiple children. Some qdiscs allow for runtime addition
438 of classes (HTB) while others (PRIO) are created with a static number of
439 children.
440
441 Qdiscs which allow dynamic addition of classes can have zero or more
442 subclasses to which traffic may be enqueued.
443
444 Furthermore, each class contains a
445 .B leaf qdisc
446 which by default has
447 .B pfifo
448 behaviour, although another qdisc can be attached in place. This qdisc may again
449 contain classes, but each class can have only one leaf qdisc.
450
451 When a packet enters a classful qdisc it can be
452 .B classified
453 to one of the classes within. Three criteria are available, although not all
454 qdiscs will use all three:
455 .TP
456 tc filters
457 If tc filters are attached to a class, they are consulted first
458 for relevant instructions. Filters can match on all fields of a packet header,
459 as well as on the firewall mark applied by iptables.
460 .TP
461 Type of Service
462 Some qdiscs have built in rules for classifying packets based on the TOS field.
463 .TP
464 skb->priority
465 Userspace programs can encode a \fIclass-id\fR in the 'skb->priority' field using
466 the SO_PRIORITY option.
467 .P
468 Each node within the tree can have its own filters but higher level filters
469 may also point directly to lower classes.
470
471 If classification did not succeed, packets are enqueued to the leaf qdisc
472 attached to that class. Check qdisc specific manpages for details, however.
473
474 .SH NAMING
475 All qdiscs, classes and filters have IDs, which can either be specified
476 or be automatically assigned.
477
478 IDs consist of a
479 .BR major " number and a " minor
480 number, separated by a colon -
481 .BR major ":" minor "."
482 Both
483 .BR major " and " minor
484 are hexadecimal numbers and are limited to 16 bits. There are two special
485 values: root is signified by
486 .BR major " and " minor
487 of all ones, and unspecified is all zeros.
488
489 .TP
490 QDISCS
491 A qdisc, which potentially can have children, gets assigned a
492 .B major
493 number, called a 'handle', leaving the
494 .B minor
495 number namespace available for classes. The handle is expressed as '10:'.
496 It is customary to explicitly assign a handle to qdiscs expected to have children.
497
498 .TP
499 CLASSES
500 Classes residing under a qdisc share their qdisc
501 .B major
502 number, but each have a separate
503 .B minor
504 number called a 'classid' that has no relation to their
505 parent classes, only to their parent qdisc. The same naming custom as for
506 qdiscs applies.
507
508 .TP
509 FILTERS
510 Filters have a three part ID, which is only needed when using a hashed
511 filter hierarchy.
512
513 .SH PARAMETERS
514 The following parameters are widely used in TC. For other parameters,
515 see the man pages for individual qdiscs.
516
517 .TP
518 RATES
519 Bandwidths or rates.
520 These parameters accept a floating point number, possibly followed by
521 either a unit (both SI and IEC units supported), or a float followed by a '%'
522 character to specify the rate as a percentage of the device's speed
523 (e.g. 5%, 99.5%). Warning: specifying the rate as a percentage means a fraction
524 of the current speed; if the speed changes, the value will not be recalculated.
525 .RS
526 .TP
527 bit or a bare number
528 Bits per second
529 .TP
530 kbit
531 Kilobits per second
532 .TP
533 mbit
534 Megabits per second
535 .TP
536 gbit
537 Gigabits per second
538 .TP
539 tbit
540 Terabits per second
541 .TP
542 bps
543 Bytes per second
544 .TP
545 kbps
546 Kilobytes per second
547 .TP
548 mbps
549 Megabytes per second
550 .TP
551 gbps
552 Gigabytes per second
553 .TP
554 tbps
555 Terabytes per second
556
557 .P
558 To specify in IEC units, replace the SI prefix (k-, m-, g-, t-) with
559 IEC prefix (ki-, mi-, gi- and ti-) respectively.
560
561 .P
562 TC store rates as a 32-bit unsigned integer in bps internally,
563 so we can specify a max rate of 4294967295 bps.
564 .RE
565
566 .TP
567 TIMES
568 Length of time. Can be specified as a floating point number
569 followed by an optional unit:
570 .RS
571 .TP
572 s, sec or secs
573 Whole seconds
574 .TP
575 ms, msec or msecs
576 Milliseconds
577 .TP
578 us, usec, usecs or a bare number
579 Microseconds.
580
581 .P
582 TC defined its own time unit (equal to microsecond) and stores
583 time values as 32-bit unsigned integer, thus we can specify a max time value
584 of 4294967295 usecs.
585 .RE
586
587 .TP
588 SIZES
589 Amounts of data. Can be specified as a floating point number
590 followed by an optional unit:
591 .RS
592 .TP
593 b or a bare number
594 Bytes.
595 .TP
596 kbit
597 Kilobits
598 .TP
599 kb or k
600 Kilobytes
601 .TP
602 mbit
603 Megabits
604 .TP
605 mb or m
606 Megabytes
607 .TP
608 gbit
609 Gigabits
610 .TP
611 gb or g
612 Gigabytes
613
614 .P
615 TC stores sizes internally as 32-bit unsigned integer in byte,
616 so we can specify a max size of 4294967295 bytes.
617 .RE
618
619 .TP
620 VALUES
621 Other values without a unit.
622 These parameters are interpreted as decimal by default, but you can
623 indicate TC to interpret them as octal and hexadecimal by adding a '0'
624 or '0x' prefix respectively.
625
626 .SH TC COMMANDS
627 The following commands are available for qdiscs, classes and filter:
628 .TP
629 add
630 Add a qdisc, class or filter to a node. For all entities, a
631 .B parent
632 must be passed, either by passing its ID or by attaching directly to the root of a device.
633 When creating a qdisc or a filter, it can be named with the
634 .B handle
635 parameter. A class is named with the
636 .B \fBclassid\fR
637 parameter.
638
639 .TP
640 delete
641 A qdisc can be deleted by specifying its handle, which may also be 'root'. All subclasses and their leaf qdiscs
642 are automatically deleted, as well as any filters attached to them.
643
644 .TP
645 change
646 Some entities can be modified 'in place'. Shares the syntax of 'add', with the exception
647 that the handle cannot be changed and neither can the parent. In other words,
648 .B
649 change
650 cannot move a node.
651
652 .TP
653 replace
654 Performs a nearly atomic remove/add on an existing node id. If the node does not exist yet
655 it is created.
656
657 .TP
658 get
659 Displays a single filter given the interface \fIDEV\fR, \fIqdisc-id\fR,
660 \fIpriority\fR, \fIprotocol\fR and \fIfilter-id\fR.
661
662 .TP
663 show
664 Displays all filters attached to the given interface. A valid parent ID must be passed.
665
666 .TP
667 link
668 Only available for qdiscs and performs a replace where the node
669 must exist already.
670
671 .SH MONITOR
672 The\fB\ tc\fR\ utility can monitor events generated by the kernel such as
673 adding/deleting qdiscs, filters or actions, or modifying existing ones.
674
675 The following command is available for\fB\ monitor\fR\ :
676 .TP
677 \fBfile\fR
678 If the file option is given, the \fBtc\fR does not listen to kernel events, but opens
679 the given file and dumps its contents. The file has to be in binary
680 format and contain netlink messages.
681
682 .SH OPTIONS
683
684 .TP
685 .BR "\-b", " \-b filename", " \-batch", " \-batch filename"
686 read commands from provided file or standard input and invoke them.
687 First failure will cause termination of tc.
688
689 .TP
690 .BR "\-force"
691 don't terminate tc on errors in batch mode.
692 If there were any errors during execution of the commands, the application return code will be non zero.
693
694 .TP
695 .BR "\-o" , " \-oneline"
696 output each record on a single line, replacing line feeds
697 with the
698 .B '\e'
699 character. This is convenient when you want to count records
700 with
701 .BR wc (1)
702 or to
703 .BR grep (1)
704 the output.
705
706 .TP
707 .BR "\-n" , " \-net" , " \-netns " <NETNS>
708 switches
709 .B tc
710 to the specified network namespace
711 .IR NETNS .
712 Actually it just simplifies executing of:
713
714 .B ip netns exec
715 .IR NETNS
716 .B tc
717 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
718 .BR help " }"
719
720 to
721
722 .B tc
723 .RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
724 .BR help " }"
725
726 .TP
727 .BR "\-N" , " \-Numeric"
728 Print the number of protocol, scope, dsfield, etc directly instead of
729 converting it to human readable name.
730
731 .TP
732 .BR "\-cf" , " \-conf " <FILENAME>
733 specifies path to the config file. This option is used in conjunction with other options (e.g.
734 .BR -nm ")."
735
736 .TP
737 .BR "\-t", " \-timestamp"
738 When\fB\ tc monitor\fR\ runs, print timestamp before the event message in format:
739 Timestamp: <Day> <Month> <DD> <hh:mm:ss> <YYYY> <usecs> usec
740
741 .TP
742 .BR "\-ts", " \-tshort"
743 When\fB\ tc monitor\fR\ runs, prints short timestamp before the event message in format:
744 [<YYYY>-<MM>-<DD>T<hh:mm:ss>.<ms>]
745
746 .TP
747 .BR "\-echo"
748 Request the kernel to send the applied configuration back.
749
750 .SH FORMAT
751 The show command has additional formatting options:
752
753 .TP
754 .BR "\-s" , " \-stats", " \-statistics"
755 output more statistics about packet usage.
756
757 .TP
758 .BR "\-d", " \-details"
759 output more detailed information about rates and cell sizes.
760
761 .TP
762 .BR "\-r", " \-raw"
763 output raw hex values for handles.
764
765 .TP
766 .BR "\-p", " \-pretty"
767 for u32 filter, decode offset and mask values to equivalent filter commands based on TCP/IP.
768 In JSON output, add whitespace to improve readability.
769
770 .TP
771 .BR "\-iec"
772 print rates in IEC units (ie. 1K = 1024).
773
774 .TP
775 .BR "\-g", " \-graph"
776 shows classes as ASCII graph. Prints generic stats info under each class if
777 .BR "-s"
778 option was specified. Classes can be filtered only by
779 .BR "dev"
780 option.
781
782 .TP
783 .BR \-c [ color ][ = { always | auto | never }
784 Configure color output. If parameter is omitted or
785 .BR always ,
786 color output is enabled regardless of stdout state. If parameter is
787 .BR auto ,
788 stdout is checked to be a terminal before enabling color output. If parameter is
789 .BR never ,
790 color output is disabled. If specified multiple times, the last one takes
791 precedence. This flag is ignored if
792 .B \-json
793 is also given.
794
795 .TP
796 .BR "\-j", " \-json"
797 Display results in JSON format.
798
799 .TP
800 .BR "\-nm" , " \-name"
801 resolve class name from
802 .B /etc/iproute2/tc_cls
803 file or from file specified by
804 .B -cf
805 option. This file is just a mapping of
806 .B classid
807 to class name:
808
809 .RS 10
810 # Here is comment
811 .RE
812 .RS 10
813 1:40 voip # Here is another comment
814 .RE
815 .RS 10
816 1:50 web
817 .RE
818 .RS 10
819 1:60 ftp
820 .RE
821 .RS 10
822 1:2 home
823 .RE
824
825 .RS
826 .B tc
827 will not fail if
828 .B -nm
829 was specified without
830 .B -cf
831 option but
832 .B /etc/iproute2/tc_cls
833 file does not exist, which makes it possible to pass
834 .B -nm
835 option for creating
836 .B tc
837 alias.
838 .RE
839
840 .TP
841 .BR "\-br" , " \-brief"
842 Print only essential data needed to identify the filter and action (handle,
843 cookie, etc.) and stats. This option is currently only supported by
844 .BR "tc filter show " and " tc actions ls " commands.
845
846 .SH "EXAMPLES"
847 .PP
848 tc -g class show dev eth0
849 .RS 4
850 Shows classes as ASCII graph on eth0 interface.
851 .RE
852 .PP
853 tc -g -s class show dev eth0
854 .RS 4
855 Shows classes as ASCII graph with stats info under each class.
856 .RE
857
858 .SH HISTORY
859 .B tc
860 was written by Alexey N. Kuznetsov and added in Linux 2.2.
861 .SH SEE ALSO
862 .BR tc-basic (8),
863 .BR tc-bfifo (8),
864 .BR tc-bpf (8),
865 .BR tc-cake (8),
866 .BR tc-cgroup (8),
867 .BR tc-choke (8),
868 .BR tc-codel (8),
869 .BR tc-drr (8),
870 .BR tc-ematch (8),
871 .BR tc-ets (8),
872 .BR tc-flow (8),
873 .BR tc-flower (8),
874 .BR tc-fq (8),
875 .BR tc-fq_codel (8),
876 .BR tc-fq_pie (8),
877 .BR tc-fw (8),
878 .BR tc-gact (8),
879 .BR tc-hfsc (7),
880 .BR tc-hfsc (8),
881 .BR tc-htb (8),
882 .BR tc-mqprio (8),
883 .BR tc-pfifo (8),
884 .BR tc-pfifo_fast (8),
885 .BR tc-pie (8),
886 .BR tc-red (8),
887 .BR tc-route (8),
888 .BR tc-sfb (8),
889 .BR tc-sfq (8),
890 .BR tc-stab (8),
891 .BR tc-tbf (8),
892 .BR tc-u32 (8)
893 .br
894 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <[email protected]>
895
896 .SH AUTHOR
897 Manpage maintained by bert hubert ([email protected])