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