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