|
Packit Service |
3880ab |
.TH TC 8 "16 December 2001" "iproute2" "Linux"
|
|
Packit Service |
3880ab |
.SH NAME
|
|
Packit Service |
3880ab |
tc \- show / manipulate traffic control settings
|
|
Packit Service |
3880ab |
.SH SYNOPSIS
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B qdisc [ add | change | replace | link | delete ] dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B
|
|
Packit Service |
3880ab |
[ parent
|
|
Packit Service |
3880ab |
\fIqdisc-id\fR
|
|
Packit Service |
3880ab |
.B | root ]
|
|
Packit Service |
3880ab |
.B [ handle
|
|
Packit Service |
3880ab |
\fIqdisc-id\fR ]
|
|
Packit Service |
3880ab |
.B [ ingress_block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR ]
|
|
Packit Service |
3880ab |
.B [ egress_block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR ] qdisc
|
|
Packit Service |
3880ab |
[ qdisc specific parameters ]
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B class [ add | change | replace | delete ] dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B parent
|
|
Packit Service |
3880ab |
\fIqdisc-id\fR
|
|
Packit Service |
3880ab |
.B [ classid
|
|
Packit Service |
3880ab |
\fIclass-id\fR ] qdisc
|
|
Packit Service |
3880ab |
[ qdisc specific parameters ]
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B filter [ add | change | replace | delete | get ] dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B [ parent
|
|
Packit Service |
3880ab |
\fIqdisc-id\fR
|
|
Packit Service |
3880ab |
.B | root ] [ handle \fIfilter-id\fR ]
|
|
Packit Service |
3880ab |
.B protocol
|
|
Packit Service |
3880ab |
\fIprotocol\fR
|
|
Packit Service |
3880ab |
.B prio
|
|
Packit Service |
3880ab |
\fIpriority\fR filtertype
|
|
Packit Service |
3880ab |
[ filtertype specific parameters ]
|
|
Packit Service |
3880ab |
.B flowid
|
|
Packit Service |
3880ab |
\fIflow-id\fR
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B filter [ add | change | replace | delete | get ] block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR
|
|
Packit Service |
3880ab |
.B [ handle \fIfilter-id\fR ]
|
|
Packit Service |
3880ab |
.B protocol
|
|
Packit Service |
3880ab |
\fIprotocol\fR
|
|
Packit Service |
3880ab |
.B prio
|
|
Packit Service |
3880ab |
\fIpriority\fR filtertype
|
|
Packit Service |
3880ab |
[ filtertype specific parameters ]
|
|
Packit Service |
3880ab |
.B flowid
|
|
Packit Service |
3880ab |
\fIflow-id\fR
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B chain [ add | delete | get ] dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B [ parent
|
|
Packit Service |
3880ab |
\fIqdisc-id\fR
|
|
Packit Service |
3880ab |
.B | root ]\fR filtertype
|
|
Packit Service |
3880ab |
[ filtertype specific parameters ]
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B chain [ add | delete | get ] block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR filtertype
|
|
Packit Service |
3880ab |
[ filtertype specific parameters ]
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.RI "[ " FORMAT " ]"
|
|
Packit Service |
3880ab |
.B qdisc { show | list } [ dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B ] [ root | ingress | handle
|
|
Packit Service |
3880ab |
\fIQHANDLE\fR
|
|
Packit Service |
3880ab |
.B | parent
|
|
Packit Service |
3880ab |
\fICLASSID\fR
|
|
Packit Service |
3880ab |
.B ] [ invisible ]
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.RI "[ " FORMAT " ]"
|
|
Packit Service |
3880ab |
.B class show dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B filter show dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B filter show block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B chain show dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B chain show block
|
|
Packit Service |
3880ab |
\fIBLOCK_INDEX\fR
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ]"
|
|
Packit Service |
3880ab |
.B monitor [ file
|
|
Packit Service |
3880ab |
\fIFILENAME\fR
|
|
Packit Service |
3880ab |
.B ]
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.ti 8
|
|
Packit Service |
3880ab |
.IR OPTIONS " := {"
|
|
Packit Service |
3880ab |
\fB[ -force ] -b\fR[\fIatch\fR] \fB[ filename ] \fR|
|
|
Packit Service |
3880ab |
\fB[ \fB-n\fR[\fIetns\fR] name \fB] \fR|
|
|
Packit Service |
3880ab |
\fB[ \fB-N\fR[\fIumeric\fR] \fB] \fR|
|
|
Packit Service |
3880ab |
\fB[ \fB-nm \fR| \fB-nam\fR[\fIes\fR] \fB] \fR|
|
|
Packit Service |
3880ab |
\fB[ \fR{ \fB-cf \fR| \fB-c\fR[\fIonf\fR] \fR} \fB[ filename ] \fB] \fR
|
|
Packit Service |
3880ab |
\fB[ -t\fR[imestamp\fR] \fB\] \fR| \fB[ -t\fR[short\fR] \fR| \fB[
|
|
Packit Service |
3880ab |
-o\fR[neline\fR] \fB]\fR }
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.ti 8
|
|
Packit Service |
3880ab |
.IR FORMAT " := {"
|
|
Packit Service |
3880ab |
\fB\-s\fR[\fItatistics\fR] |
|
|
Packit Service |
3880ab |
\fB\-d\fR[\fIetails\fR] |
|
|
Packit Service |
3880ab |
\fB\-r\fR[\fIaw\fR] |
|
|
Packit Service |
3880ab |
\fB\-i\fR[\fIec\fR] |
|
|
Packit Service |
3880ab |
\fB\-g\fR[\fIraph\fR] |
|
|
Packit Service |
3880ab |
\fB\-j\fR[\fIjson\fR] |
|
|
Packit Service |
3880ab |
\fB\-p\fR[\fIretty\fR] |
|
|
Packit Service |
3880ab |
\fB\-col\fR[\fIor\fR] }
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH DESCRIPTION
|
|
Packit Service |
3880ab |
.B Tc
|
|
Packit Service |
3880ab |
is used to configure Traffic Control in the Linux kernel. Traffic Control consists
|
|
Packit Service |
3880ab |
of the following:
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
SHAPING
|
|
Packit Service |
3880ab |
When traffic is shaped, its rate of transmission is under control. Shaping may
|
|
Packit Service |
3880ab |
be more than lowering the available bandwidth - it is also used to smooth out
|
|
Packit Service |
3880ab |
bursts in traffic for better network behaviour. Shaping occurs on egress.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
SCHEDULING
|
|
Packit Service |
3880ab |
By scheduling the transmission of packets it is possible to improve interactivity
|
|
Packit Service |
3880ab |
for traffic that needs it while still guaranteeing bandwidth to bulk transfers. Reordering
|
|
Packit Service |
3880ab |
is also called prioritizing, and happens only on egress.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
POLICING
|
|
Packit Service |
3880ab |
Whereas shaping deals with transmission of traffic, policing pertains to traffic
|
|
Packit Service |
3880ab |
arriving. Policing thus occurs on ingress.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
DROPPING
|
|
Packit Service |
3880ab |
Traffic exceeding a set bandwidth may also be dropped forthwith, both on
|
|
Packit Service |
3880ab |
ingress and on egress.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
Processing of traffic is controlled by three kinds of objects: qdiscs,
|
|
Packit Service |
3880ab |
classes and filters.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH QDISCS
|
|
Packit Service |
3880ab |
.B qdisc
|
|
Packit Service |
3880ab |
is short for 'queueing discipline' and it is elementary to
|
|
Packit Service |
3880ab |
understanding traffic control. Whenever the kernel needs to send a
|
|
Packit Service |
3880ab |
packet to an interface, it is
|
|
Packit Service |
3880ab |
.B enqueued
|
|
Packit Service |
3880ab |
to the qdisc configured for that interface. Immediately afterwards, the kernel
|
|
Packit Service |
3880ab |
tries to get as many packets as possible from the qdisc, for giving them
|
|
Packit Service |
3880ab |
to the network adaptor driver.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
A simple QDISC is the 'pfifo' one, which does no processing at all and is a pure
|
|
Packit Service |
3880ab |
First In, First Out queue. It does however store traffic when the network interface
|
|
Packit Service |
3880ab |
can't handle it momentarily.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH CLASSES
|
|
Packit Service |
3880ab |
Some qdiscs can contain classes, which contain further qdiscs - traffic may
|
|
Packit Service |
3880ab |
then be enqueued in any of the inner qdiscs, which are within the
|
|
Packit Service |
3880ab |
.B classes.
|
|
Packit Service |
3880ab |
When the kernel tries to dequeue a packet from such a
|
|
Packit Service |
3880ab |
.B classful qdisc
|
|
Packit Service |
3880ab |
it can come from any of the classes. A qdisc may for example prioritize
|
|
Packit Service |
3880ab |
certain kinds of traffic by trying to dequeue from certain classes
|
|
Packit Service |
3880ab |
before others.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH FILTERS
|
|
Packit Service |
3880ab |
A
|
|
Packit Service |
3880ab |
.B filter
|
|
Packit Service |
3880ab |
is used by a classful qdisc to determine in which class a packet will
|
|
Packit Service |
3880ab |
be enqueued. Whenever traffic arrives at a class with subclasses, it needs
|
|
Packit Service |
3880ab |
to be classified. Various methods may be employed to do so, one of these
|
|
Packit Service |
3880ab |
are the filters. All filters attached to the class are called, until one of
|
|
Packit Service |
3880ab |
them returns with a verdict. If no verdict was made, other criteria may be
|
|
Packit Service |
3880ab |
available. This differs per qdisc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
It is important to notice that filters reside
|
|
Packit Service |
3880ab |
.B within
|
|
Packit Service |
3880ab |
qdiscs - they are not masters of what happens.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The available filters are:
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
basic
|
|
Packit Service |
3880ab |
Filter packets based on an ematch expression. See
|
|
Packit Service |
3880ab |
.BR tc-ematch (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
bpf
|
|
Packit Service |
3880ab |
Filter packets using (e)BPF, see
|
|
Packit Service |
3880ab |
.BR tc-bpf (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
cgroup
|
|
Packit Service |
3880ab |
Filter packets based on the control group of their process. See
|
|
Packit Service |
3880ab |
. BR tc-cgroup (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
flow, flower
|
|
Packit Service |
3880ab |
Flow-based classifiers, filtering packets based on their flow (identified by selectable keys). See
|
|
Packit Service |
3880ab |
.BR tc-flow "(8) and"
|
|
Packit Service |
3880ab |
.BR tc-flower (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
fw
|
|
Packit Service |
3880ab |
Filter based on fwmark. Directly maps fwmark value to traffic class. See
|
|
Packit Service |
3880ab |
.BR tc-fw (8).
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
route
|
|
Packit Service |
3880ab |
Filter packets based on routing table. See
|
|
Packit Service |
3880ab |
.BR tc-route (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
rsvp
|
|
Packit Service |
3880ab |
Match Resource Reservation Protocol (RSVP) packets.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
tcindex
|
|
Packit Service |
3880ab |
Filter packets based on traffic control index. See
|
|
Packit Service |
3880ab |
.BR tc-tcindex (8).
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
u32
|
|
Packit Service |
3880ab |
Generic filtering on arbitrary packet data, assisted by syntax to abstract common operations. See
|
|
Packit Service |
3880ab |
.BR tc-u32 (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
matchall
|
|
Packit Service |
3880ab |
Traffic control filter that matches every packet. See
|
|
Packit Service |
3880ab |
.BR tc-matchall (8)
|
|
Packit Service |
3880ab |
for details.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH QEVENTS
|
|
Packit Service |
3880ab |
Qdiscs may invoke user-configured actions when certain interesting events
|
|
Packit Service |
3880ab |
take place in the qdisc. Each qevent can either be unused, or can have a
|
|
Packit Service |
3880ab |
block attached to it. To this block are then attached filters using the "tc
|
|
Packit Service |
3880ab |
block BLOCK_IDX" syntax. The block is executed when the qevent associated
|
|
Packit Service |
3880ab |
with the attachment point takes place. For example, packet could be
|
|
Packit Service |
3880ab |
dropped, or delayed, etc., depending on the qdisc and the qevent in
|
|
Packit Service |
3880ab |
question.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
For example:
|
|
Packit Service |
3880ab |
.PP
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
tc qdisc add dev eth0 root handle 1: red limit 500K avpkt 1K \\
|
|
Packit Service |
3880ab |
qevent early_drop block 10
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
tc filter add block 10 matchall action mirred egress mirror dev eth1
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH CLASSLESS QDISCS
|
|
Packit Service |
3880ab |
The classless qdiscs are:
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
choke
|
|
Packit Service |
3880ab |
CHOKe (CHOose and Keep for responsive flows, CHOose and Kill for unresponsive
|
|
Packit Service |
3880ab |
flows) is a classless qdisc designed to both identify and penalize flows that
|
|
Packit Service |
3880ab |
monopolize the queue. CHOKe is a variation of RED, and the configuration is
|
|
Packit Service |
3880ab |
similar to RED.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
codel
|
|
Packit Service |
3880ab |
CoDel (pronounced "coddle") is an adaptive "no-knobs" active queue management
|
|
Packit Service |
3880ab |
algorithm (AQM) scheme that was developed to address the shortcomings of
|
|
Packit Service |
3880ab |
RED and its variants.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
[p|b]fifo
|
|
Packit Service |
3880ab |
Simplest usable qdisc, pure First In, First Out behaviour. Limited in
|
|
Packit Service |
3880ab |
packets or in bytes.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
fq
|
|
Packit Service |
3880ab |
Fair Queue Scheduler realises TCP pacing and scales to millions of concurrent
|
|
Packit Service |
3880ab |
flows per qdisc.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
fq_codel
|
|
Packit Service |
3880ab |
Fair Queuing Controlled Delay is queuing discipline that combines Fair
|
|
Packit Service |
3880ab |
Queuing with the CoDel AQM scheme. FQ_Codel uses a stochastic model to classify
|
|
Packit Service |
3880ab |
incoming packets into different flows and is used to provide a fair share of the
|
|
Packit Service |
3880ab |
bandwidth to all the flows using the queue. Each such flow is managed by the
|
|
Packit Service |
3880ab |
CoDel queuing discipline. Reordering within a flow is avoided since Codel
|
|
Packit Service |
3880ab |
internally uses a FIFO queue.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
fq_pie
|
|
Packit Service |
3880ab |
FQ-PIE (Flow Queuing with Proportional Integral controller Enhanced) is a
|
|
Packit Service |
3880ab |
queuing discipline that combines Flow Queuing with the PIE AQM scheme. FQ-PIE
|
|
Packit Service |
3880ab |
uses a Jenkins hash function to classify incoming packets into different flows
|
|
Packit Service |
3880ab |
and is used to provide a fair share of the bandwidth to all the flows using the
|
|
Packit Service |
3880ab |
qdisc. Each such flow is managed by the PIE algorithm.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
gred
|
|
Packit Service |
3880ab |
Generalized Random Early Detection combines multiple RED queues in order to
|
|
Packit Service |
3880ab |
achieve multiple drop priorities. This is required to realize Assured
|
|
Packit Service |
3880ab |
Forwarding (RFC 2597).
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
hhf
|
|
Packit Service |
3880ab |
Heavy-Hitter Filter differentiates between small flows and the opposite,
|
|
Packit Service |
3880ab |
heavy-hitters. The goal is to catch the heavy-hitters and move them to a
|
|
Packit Service |
3880ab |
separate queue with less priority so that bulk traffic does not affect the
|
|
Packit Service |
3880ab |
latency of critical traffic.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
ingress
|
|
Packit Service |
3880ab |
This is a special qdisc as it applies to incoming traffic on an interface, allowing for it to be filtered and policed.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
mqprio
|
|
Packit Service |
3880ab |
The Multiqueue Priority Qdisc is a simple queuing discipline that allows
|
|
Packit Service |
3880ab |
mapping traffic flows to hardware queue ranges using priorities and a
|
|
Packit Service |
3880ab |
configurable priority to traffic class mapping. A traffic class in this context
|
|
Packit Service |
3880ab |
is a set of contiguous qdisc classes which map 1:1 to a set of hardware exposed
|
|
Packit Service |
3880ab |
queues.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
multiq
|
|
Packit Service |
3880ab |
Multiqueue is a qdisc optimized for devices with multiple Tx queues. It has
|
|
Packit Service |
3880ab |
been added for hardware that wishes to avoid head-of-line blocking. It will
|
|
Packit Service |
3880ab |
cycle though the bands and verify that the hardware queue associated with the
|
|
Packit Service |
3880ab |
band is not stopped prior to dequeuing a packet.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
netem
|
|
Packit Service |
3880ab |
Network Emulator is an enhancement of the Linux traffic control facilities that
|
|
Packit Service |
3880ab |
allow to add delay, packet loss, duplication and more other characteristics to
|
|
Packit Service |
3880ab |
packets outgoing from a selected network interface.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
pfifo_fast
|
|
Packit Service |
3880ab |
Standard qdisc for 'Advanced Router' enabled kernels. Consists of a three-band
|
|
Packit Service |
3880ab |
queue which honors Type of Service flags, as well as the priority that may be
|
|
Packit Service |
3880ab |
assigned to a packet.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
pie
|
|
Packit Service |
3880ab |
Proportional Integral controller-Enhanced (PIE) is a control theoretic active
|
|
Packit Service |
3880ab |
queue management scheme. It is based on the proportional integral controller but
|
|
Packit Service |
3880ab |
aims to control delay.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
red
|
|
Packit Service |
3880ab |
Random Early Detection simulates physical congestion by randomly dropping
|
|
Packit Service |
3880ab |
packets when nearing configured bandwidth allocation. Well suited to very
|
|
Packit Service |
3880ab |
large bandwidth applications.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
rr
|
|
Packit Service |
3880ab |
Round-Robin qdisc with support for multiqueue network devices. Removed from
|
|
Packit Service |
3880ab |
Linux since kernel version 2.6.27.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
sfb
|
|
Packit Service |
3880ab |
Stochastic Fair Blue is a classless qdisc to manage congestion based on
|
|
Packit Service |
3880ab |
packet loss and link utilization history while trying to prevent
|
|
Packit Service |
3880ab |
non-responsive flows (i.e. flows that do not react to congestion marking
|
|
Packit Service |
3880ab |
or dropped packets) from impacting performance of responsive flows.
|
|
Packit Service |
3880ab |
Unlike RED, where the marking probability has to be configured, BLUE
|
|
Packit Service |
3880ab |
tries to determine the ideal marking probability automatically.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
sfq
|
|
Packit Service |
3880ab |
Stochastic Fairness Queueing reorders queued traffic so each 'session'
|
|
Packit Service |
3880ab |
gets to send a packet in turn.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
tbf
|
|
Packit Service |
3880ab |
The Token Bucket Filter is suited for slowing traffic down to a precisely
|
|
Packit Service |
3880ab |
configured rate. Scales well to large bandwidths.
|
|
Packit Service |
3880ab |
.SH CONFIGURING CLASSLESS QDISCS
|
|
Packit Service |
3880ab |
In the absence of classful qdiscs, classless qdiscs can only be attached at
|
|
Packit Service |
3880ab |
the root of a device. Full syntax:
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc qdisc add dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B root
|
|
Packit Service |
3880ab |
QDISC QDISC-PARAMETERS
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
To remove, issue
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
.B tc qdisc del dev
|
|
Packit Service |
3880ab |
\fIDEV\fR
|
|
Packit Service |
3880ab |
.B root
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The
|
|
Packit Service |
3880ab |
.B pfifo_fast
|
|
Packit Service |
3880ab |
qdisc is the automatic default in the absence of a configured qdisc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH CLASSFUL QDISCS
|
|
Packit Service |
3880ab |
The classful qdiscs are:
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
ATM
|
|
Packit Service |
3880ab |
Map flows to virtual circuits of an underlying asynchronous transfer mode
|
|
Packit Service |
3880ab |
device.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
CBQ
|
|
Packit Service |
3880ab |
Class Based Queueing implements a rich linksharing hierarchy of classes.
|
|
Packit Service |
3880ab |
It contains shaping elements as well as prioritizing capabilities. Shaping is
|
|
Packit Service |
3880ab |
performed using link idle time calculations based on average packet size and
|
|
Packit Service |
3880ab |
underlying link bandwidth. The latter may be ill-defined for some interfaces.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
DRR
|
|
Packit Service |
3880ab |
The Deficit Round Robin Scheduler is a more flexible replacement for Stochastic
|
|
Packit Service |
3880ab |
Fairness Queuing. Unlike SFQ, there are no built-in queues \-\- you need to add
|
|
Packit Service |
3880ab |
classes and then set up filters to classify packets accordingly. This can be
|
|
Packit Service |
3880ab |
useful e.g. for using RED qdiscs with different settings for particular
|
|
Packit Service |
3880ab |
traffic. There is no default class \-\- if a packet cannot be classified, it is
|
|
Packit Service |
3880ab |
dropped.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
DSMARK
|
|
Packit Service |
3880ab |
Classify packets based on TOS field, change TOS field of packets based on
|
|
Packit Service |
3880ab |
classification.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
ETS
|
|
Packit Service |
3880ab |
The ETS qdisc is a queuing discipline that merges functionality of PRIO and DRR
|
|
Packit Service |
3880ab |
qdiscs in one scheduler. ETS makes it easy to configure a set of strict and
|
|
Packit Service |
3880ab |
bandwidth-sharing bands to implement the transmission selection described in
|
|
Packit Service |
3880ab |
802.1Qaz.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
HFSC
|
|
Packit Service |
3880ab |
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.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
HTB
|
|
Packit Service |
3880ab |
The Hierarchy Token Bucket implements a rich linksharing hierarchy of
|
|
Packit Service |
3880ab |
classes with an emphasis on conforming to existing practices. HTB facilitates
|
|
Packit Service |
3880ab |
guaranteeing bandwidth to classes, while also allowing specification of upper
|
|
Packit Service |
3880ab |
limits to inter-class sharing. It contains shaping elements, based on TBF and
|
|
Packit Service |
3880ab |
can prioritize classes.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
PRIO
|
|
Packit Service |
3880ab |
The PRIO qdisc is a non-shaping container for a configurable number of
|
|
Packit Service |
3880ab |
classes which are dequeued in order. This allows for easy prioritization
|
|
Packit Service |
3880ab |
of traffic, where lower classes are only able to send if higher ones have
|
|
Packit Service |
3880ab |
no packets available. To facilitate configuration, Type Of Service bits are
|
|
Packit Service |
3880ab |
honored by default.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
QFQ
|
|
Packit Service |
3880ab |
Quick Fair Queueing is an O(1) scheduler that provides near-optimal guarantees,
|
|
Packit Service |
3880ab |
and is the first to achieve that goal with a constant cost also with respect to
|
|
Packit Service |
3880ab |
the number of groups and the packet length. The QFQ algorithm has no loops, and
|
|
Packit Service |
3880ab |
uses very simple instructions and data structures that lend themselves very
|
|
Packit Service |
3880ab |
well to a hardware implementation.
|
|
Packit Service |
3880ab |
.SH THEORY OF OPERATION
|
|
Packit Service |
3880ab |
Classes form a tree, where each class has a single parent.
|
|
Packit Service |
3880ab |
A class may have multiple children. Some qdiscs allow for runtime addition
|
|
Packit Service |
3880ab |
of classes (CBQ, HTB) while others (PRIO) are created with a static number of
|
|
Packit Service |
3880ab |
children.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
Qdiscs which allow dynamic addition of classes can have zero or more
|
|
Packit Service |
3880ab |
subclasses to which traffic may be enqueued.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
Furthermore, each class contains a
|
|
Packit Service |
3880ab |
.B leaf qdisc
|
|
Packit Service |
3880ab |
which by default has
|
|
Packit Service |
3880ab |
.B pfifo
|
|
Packit Service |
3880ab |
behaviour, although another qdisc can be attached in place. This qdisc may again
|
|
Packit Service |
3880ab |
contain classes, but each class can have only one leaf qdisc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
When a packet enters a classful qdisc it can be
|
|
Packit Service |
3880ab |
.B classified
|
|
Packit Service |
3880ab |
to one of the classes within. Three criteria are available, although not all
|
|
Packit Service |
3880ab |
qdiscs will use all three:
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
tc filters
|
|
Packit Service |
3880ab |
If tc filters are attached to a class, they are consulted first
|
|
Packit Service |
3880ab |
for relevant instructions. Filters can match on all fields of a packet header,
|
|
Packit Service |
3880ab |
as well as on the firewall mark applied by iptables.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
Type of Service
|
|
Packit Service |
3880ab |
Some qdiscs have built in rules for classifying packets based on the TOS field.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
skb->priority
|
|
Packit Service |
3880ab |
Userspace programs can encode a \fIclass-id\fR in the 'skb->priority' field using
|
|
Packit Service |
3880ab |
the SO_PRIORITY option.
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
Each node within the tree can have its own filters but higher level filters
|
|
Packit Service |
3880ab |
may also point directly to lower classes.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
If classification did not succeed, packets are enqueued to the leaf qdisc
|
|
Packit Service |
3880ab |
attached to that class. Check qdisc specific manpages for details, however.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH NAMING
|
|
Packit Service |
3880ab |
All qdiscs, classes and filters have IDs, which can either be specified
|
|
Packit Service |
3880ab |
or be automatically assigned.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
IDs consist of a
|
|
Packit Service |
3880ab |
.BR major " number and a " minor
|
|
Packit Service |
3880ab |
number, separated by a colon -
|
|
Packit Service |
3880ab |
.BR major ":" minor "."
|
|
Packit Service |
3880ab |
Both
|
|
Packit Service |
3880ab |
.BR major " and " minor
|
|
Packit Service |
3880ab |
are hexadecimal numbers and are limited to 16 bits. There are two special
|
|
Packit Service |
3880ab |
values: root is signified by
|
|
Packit Service |
3880ab |
.BR major " and " minor
|
|
Packit Service |
3880ab |
of all ones, and unspecified is all zeros.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
QDISCS
|
|
Packit Service |
3880ab |
A qdisc, which potentially can have children, gets assigned a
|
|
Packit Service |
3880ab |
.B major
|
|
Packit Service |
3880ab |
number, called a 'handle', leaving the
|
|
Packit Service |
3880ab |
.B minor
|
|
Packit Service |
3880ab |
number namespace available for classes. The handle is expressed as '10:'.
|
|
Packit Service |
3880ab |
It is customary to explicitly assign a handle to qdiscs expected to have children.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
CLASSES
|
|
Packit Service |
3880ab |
Classes residing under a qdisc share their qdisc
|
|
Packit Service |
3880ab |
.B major
|
|
Packit Service |
3880ab |
number, but each have a separate
|
|
Packit Service |
3880ab |
.B minor
|
|
Packit Service |
3880ab |
number called a 'classid' that has no relation to their
|
|
Packit Service |
3880ab |
parent classes, only to their parent qdisc. The same naming custom as for
|
|
Packit Service |
3880ab |
qdiscs applies.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
FILTERS
|
|
Packit Service |
3880ab |
Filters have a three part ID, which is only needed when using a hashed
|
|
Packit Service |
3880ab |
filter hierarchy.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH PARAMETERS
|
|
Packit Service |
3880ab |
The following parameters are widely used in TC. For other parameters,
|
|
Packit Service |
3880ab |
see the man pages for individual qdiscs.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
RATES
|
|
Packit Service |
3880ab |
Bandwidths or rates.
|
|
Packit Service |
3880ab |
These parameters accept a floating point number, possibly followed by
|
|
Packit Service |
3880ab |
either a unit (both SI and IEC units supported), or a float followed by a '%'
|
|
Packit Service |
3880ab |
character to specify the rate as a percentage of the device's speed
|
|
Packit Service |
3880ab |
(e.g. 5%, 99.5%). Warning: specifying the rate as a percentage means a fraction
|
|
Packit Service |
3880ab |
of the current speed; if the speed changes, the value will not be recalculated.
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
bit or a bare number
|
|
Packit Service |
3880ab |
Bits per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
kbit
|
|
Packit Service |
3880ab |
Kilobits per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
mbit
|
|
Packit Service |
3880ab |
Megabits per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
gbit
|
|
Packit Service |
3880ab |
Gigabits per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
tbit
|
|
Packit Service |
3880ab |
Terabits per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
bps
|
|
Packit Service |
3880ab |
Bytes per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
kbps
|
|
Packit Service |
3880ab |
Kilobytes per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
mbps
|
|
Packit Service |
3880ab |
Megabytes per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
gbps
|
|
Packit Service |
3880ab |
Gigabytes per second
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
tbps
|
|
Packit Service |
3880ab |
Terabytes per second
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
To specify in IEC units, replace the SI prefix (k-, m-, g-, t-) with
|
|
Packit Service |
3880ab |
IEC prefix (ki-, mi-, gi- and ti-) respectively.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
TC store rates as a 32-bit unsigned integer in bps internally,
|
|
Packit Service |
3880ab |
so we can specify a max rate of 4294967295 bps.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
TIMES
|
|
Packit Service |
3880ab |
Length of time. Can be specified as a floating point number
|
|
Packit Service |
3880ab |
followed by an optional unit:
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
s, sec or secs
|
|
Packit Service |
3880ab |
Whole seconds
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
ms, msec or msecs
|
|
Packit Service |
3880ab |
Milliseconds
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
us, usec, usecs or a bare number
|
|
Packit Service |
3880ab |
Microseconds.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
TC defined its own time unit (equal to microsecond) and stores
|
|
Packit Service |
3880ab |
time values as 32-bit unsigned integer, thus we can specify a max time value
|
|
Packit Service |
3880ab |
of 4294967295 usecs.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
SIZES
|
|
Packit Service |
3880ab |
Amounts of data. Can be specified as a floating point number
|
|
Packit Service |
3880ab |
followed by an optional unit:
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
b or a bare number
|
|
Packit Service |
3880ab |
Bytes.
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
kbit
|
|
Packit Service |
3880ab |
Kilobits
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
kb or k
|
|
Packit Service |
3880ab |
Kilobytes
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
mbit
|
|
Packit Service |
3880ab |
Megabits
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
mb or m
|
|
Packit Service |
3880ab |
Megabytes
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
gbit
|
|
Packit Service |
3880ab |
Gigabits
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
gb or g
|
|
Packit Service |
3880ab |
Gigabytes
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.P
|
|
Packit Service |
3880ab |
TC stores sizes internally as 32-bit unsigned integer in byte,
|
|
Packit Service |
3880ab |
so we can specify a max size of 4294967295 bytes.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
VALUES
|
|
Packit Service |
3880ab |
Other values without a unit.
|
|
Packit Service |
3880ab |
These parameters are interpreted as decimal by default, but you can
|
|
Packit Service |
3880ab |
indicate TC to interpret them as octal and hexadecimal by adding a '0'
|
|
Packit Service |
3880ab |
or '0x' prefix respectively.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH TC COMMANDS
|
|
Packit Service |
3880ab |
The following commands are available for qdiscs, classes and filter:
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
add
|
|
Packit Service |
3880ab |
Add a qdisc, class or filter to a node. For all entities, a
|
|
Packit Service |
3880ab |
.B parent
|
|
Packit Service |
3880ab |
must be passed, either by passing its ID or by attaching directly to the root of a device.
|
|
Packit Service |
3880ab |
When creating a qdisc or a filter, it can be named with the
|
|
Packit Service |
3880ab |
.B handle
|
|
Packit Service |
3880ab |
parameter. A class is named with the
|
|
Packit Service |
3880ab |
.B \fBclassid\fR
|
|
Packit Service |
3880ab |
parameter.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
delete
|
|
Packit Service |
3880ab |
A qdisc can be deleted by specifying its handle, which may also be 'root'. All subclasses and their leaf qdiscs
|
|
Packit Service |
3880ab |
are automatically deleted, as well as any filters attached to them.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
change
|
|
Packit Service |
3880ab |
Some entities can be modified 'in place'. Shares the syntax of 'add', with the exception
|
|
Packit Service |
3880ab |
that the handle cannot be changed and neither can the parent. In other words,
|
|
Packit Service |
3880ab |
.B
|
|
Packit Service |
3880ab |
change
|
|
Packit Service |
3880ab |
cannot move a node.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
replace
|
|
Packit Service |
3880ab |
Performs a nearly atomic remove/add on an existing node id. If the node does not exist yet
|
|
Packit Service |
3880ab |
it is created.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
get
|
|
Packit Service |
3880ab |
Displays a single filter given the interface \fIDEV\fR, \fIqdisc-id\fR,
|
|
Packit Service |
3880ab |
\fIpriority\fR, \fIprotocol\fR and \fIfilter-id\fR.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
show
|
|
Packit Service |
3880ab |
Displays all filters attached to the given interface. A valid parent ID must be passed.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
link
|
|
Packit Service |
3880ab |
Only available for qdiscs and performs a replace where the node
|
|
Packit Service |
3880ab |
must exist already.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH MONITOR
|
|
Packit Service |
3880ab |
The\fB\ tc\fR\ utility can monitor events generated by the kernel such as
|
|
Packit Service |
3880ab |
adding/deleting qdiscs, filters or actions, or modifying existing ones.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
The following command is available for\fB\ monitor\fR\ :
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
\fBfile\fR
|
|
Packit Service |
3880ab |
If the file option is given, the \fBtc\fR does not listen to kernel events, but opens
|
|
Packit Service |
3880ab |
the given file and dumps its contents. The file has to be in binary
|
|
Packit Service |
3880ab |
format and contain netlink messages.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH OPTIONS
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-b", " \-b filename", " \-batch", " \-batch filename"
|
|
Packit Service |
3880ab |
read commands from provided file or standard input and invoke them.
|
|
Packit Service |
3880ab |
First failure will cause termination of tc.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-force"
|
|
Packit Service |
3880ab |
don't terminate tc on errors in batch mode.
|
|
Packit Service |
3880ab |
If there were any errors during execution of the commands, the application return code will be non zero.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-o" , " \-oneline"
|
|
Packit Service |
3880ab |
output each record on a single line, replacing line feeds
|
|
Packit Service |
3880ab |
with the
|
|
Packit Service |
3880ab |
.B '\e'
|
|
Packit Service |
3880ab |
character. This is convenient when you want to count records
|
|
Packit Service |
3880ab |
with
|
|
Packit Service |
3880ab |
.BR wc (1)
|
|
Packit Service |
3880ab |
or to
|
|
Packit Service |
3880ab |
.BR grep (1)
|
|
Packit Service |
3880ab |
the output.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-n" , " \-net" , " \-netns " <NETNS>
|
|
Packit Service |
3880ab |
switches
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
to the specified network namespace
|
|
Packit Service |
3880ab |
.IR NETNS .
|
|
Packit Service |
3880ab |
Actually it just simplifies executing of:
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B ip netns exec
|
|
Packit Service |
3880ab |
.IR NETNS
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
|
|
Packit Service |
3880ab |
.BR help " }"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
to
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
|
|
Packit Service |
3880ab |
.BR help " }"
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-N" , " \-Numeric"
|
|
Packit Service |
3880ab |
Print the number of protocol, scope, dsfield, etc directly instead of
|
|
Packit Service |
3880ab |
converting it to human readable name.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-cf" , " \-conf " <FILENAME>
|
|
Packit Service |
3880ab |
specifies path to the config file. This option is used in conjunction with other options (e.g.
|
|
Packit Service |
3880ab |
.BR -nm ")."
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-t", " \-timestamp"
|
|
Packit Service |
3880ab |
When\fB\ tc monitor\fR\ runs, print timestamp before the event message in format:
|
|
Packit Service |
3880ab |
Timestamp: <Day> <Month> <hh:mm:ss> <YYYY> <usecs> usec
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-ts", " \-tshort"
|
|
Packit Service |
3880ab |
When\fB\ tc monitor\fR\ runs, prints short timestamp before the event message in format:
|
|
Packit Service |
3880ab |
[<YYYY>-<MM>-T<hh:mm:ss>.<ms>]
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH FORMAT
|
|
Packit Service |
3880ab |
The show command has additional formatting options:
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-s" , " \-stats", " \-statistics"
|
|
Packit Service |
3880ab |
output more statistics about packet usage.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-d", " \-details"
|
|
Packit Service |
3880ab |
output more detailed information about rates and cell sizes.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-r", " \-raw"
|
|
Packit Service |
3880ab |
output raw hex values for handles.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-p", " \-pretty"
|
|
Packit Service |
3880ab |
for u32 filter, decode offset and mask values to equivalent filter commands based on TCP/IP.
|
|
Packit Service |
3880ab |
In JSON output, add whitespace to improve readability.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-iec"
|
|
Packit Service |
3880ab |
print rates in IEC units (ie. 1K = 1024).
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-g", " \-graph"
|
|
Packit Service |
3880ab |
shows classes as ASCII graph. Prints generic stats info under each class if
|
|
Packit Service |
3880ab |
.BR "-s"
|
|
Packit Service |
3880ab |
option was specified. Classes can be filtered only by
|
|
Packit Service |
3880ab |
.BR "dev"
|
|
Packit Service |
3880ab |
option.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR \-c [ color ][ = { always | auto | never }
|
|
Packit Service |
3880ab |
Configure color output. If parameter is omitted or
|
|
Packit Service |
3880ab |
.BR always ,
|
|
Packit Service |
3880ab |
color output is enabled regardless of stdout state. If parameter is
|
|
Packit Service |
3880ab |
.BR auto ,
|
|
Packit Service |
3880ab |
stdout is checked to be a terminal before enabling color output. If parameter is
|
|
Packit Service |
3880ab |
.BR never ,
|
|
Packit Service |
3880ab |
color output is disabled. If specified multiple times, the last one takes
|
|
Packit Service |
3880ab |
precedence. This flag is ignored if
|
|
Packit Service |
3880ab |
.B \-json
|
|
Packit Service |
3880ab |
is also given.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-j", " \-json"
|
|
Packit Service |
3880ab |
Display results in JSON format.
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.TP
|
|
Packit Service |
3880ab |
.BR "\-nm" , " \-name"
|
|
Packit Service |
3880ab |
resolve class name from
|
|
Packit Service |
3880ab |
.B /etc/iproute2/tc_cls
|
|
Packit Service |
3880ab |
file or from file specified by
|
|
Packit Service |
3880ab |
.B -cf
|
|
Packit Service |
3880ab |
option. This file is just a mapping of
|
|
Packit Service |
3880ab |
.B classid
|
|
Packit Service |
3880ab |
to class name:
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.RS 10
|
|
Packit Service |
3880ab |
# Here is comment
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.RS 10
|
|
Packit Service |
3880ab |
1:40 voip # Here is another comment
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.RS 10
|
|
Packit Service |
3880ab |
1:50 web
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.RS 10
|
|
Packit Service |
3880ab |
1:60 ftp
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.RS 10
|
|
Packit Service |
3880ab |
1:2 home
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.RS
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
will not fail if
|
|
Packit Service |
3880ab |
.B -nm
|
|
Packit Service |
3880ab |
was specified without
|
|
Packit Service |
3880ab |
.B -cf
|
|
Packit Service |
3880ab |
option but
|
|
Packit Service |
3880ab |
.B /etc/iproute2/tc_cls
|
|
Packit Service |
3880ab |
file does not exist, which makes it possible to pass
|
|
Packit Service |
3880ab |
.B -nm
|
|
Packit Service |
3880ab |
option for creating
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
alias.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH "EXAMPLES"
|
|
Packit Service |
3880ab |
.PP
|
|
Packit Service |
3880ab |
tc -g class show dev eth0
|
|
Packit Service |
3880ab |
.RS 4
|
|
Packit Service |
3880ab |
Shows classes as ASCII graph on eth0 interface.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
.PP
|
|
Packit Service |
3880ab |
tc -g -s class show dev eth0
|
|
Packit Service |
3880ab |
.RS 4
|
|
Packit Service |
3880ab |
Shows classes as ASCII graph with stats info under each class.
|
|
Packit Service |
3880ab |
.RE
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH HISTORY
|
|
Packit Service |
3880ab |
.B tc
|
|
Packit Service |
3880ab |
was written by Alexey N. Kuznetsov and added in Linux 2.2.
|
|
Packit Service |
3880ab |
.SH SEE ALSO
|
|
Packit Service |
3880ab |
.BR tc-basic (8),
|
|
Packit Service |
3880ab |
.BR tc-bfifo (8),
|
|
Packit Service |
3880ab |
.BR tc-bpf (8),
|
|
Packit Service |
3880ab |
.BR tc-cake (8),
|
|
Packit Service |
3880ab |
.BR tc-cbq (8),
|
|
Packit Service |
3880ab |
.BR tc-cgroup (8),
|
|
Packit Service |
3880ab |
.BR tc-choke (8),
|
|
Packit Service |
3880ab |
.BR tc-codel (8),
|
|
Packit Service |
3880ab |
.BR tc-drr (8),
|
|
Packit Service |
3880ab |
.BR tc-ematch (8),
|
|
Packit Service |
3880ab |
.BR tc-ets (8),
|
|
Packit Service |
3880ab |
.BR tc-flow (8),
|
|
Packit Service |
3880ab |
.BR tc-flower (8),
|
|
Packit Service |
3880ab |
.BR tc-fq (8),
|
|
Packit Service |
3880ab |
.BR tc-fq_codel (8),
|
|
Packit Service |
3880ab |
.BR tc-fq_pie (8),
|
|
Packit Service |
3880ab |
.BR tc-fw (8),
|
|
Packit Service |
3880ab |
.BR tc-hfsc (7),
|
|
Packit Service |
3880ab |
.BR tc-hfsc (8),
|
|
Packit Service |
3880ab |
.BR tc-htb (8),
|
|
Packit Service |
3880ab |
.BR tc-mqprio (8),
|
|
Packit Service |
3880ab |
.BR tc-pfifo (8),
|
|
Packit Service |
3880ab |
.BR tc-pfifo_fast (8),
|
|
Packit Service |
3880ab |
.BR tc-pie (8),
|
|
Packit Service |
3880ab |
.BR tc-red (8),
|
|
Packit Service |
3880ab |
.BR tc-route (8),
|
|
Packit Service |
3880ab |
.BR tc-sfb (8),
|
|
Packit Service |
3880ab |
.BR tc-sfq (8),
|
|
Packit Service |
3880ab |
.BR tc-stab (8),
|
|
Packit Service |
3880ab |
.BR tc-tbf (8),
|
|
Packit Service |
3880ab |
.BR tc-tcindex (8),
|
|
Packit Service |
3880ab |
.BR tc-u32 (8),
|
|
Packit Service |
3880ab |
.br
|
|
Packit Service |
3880ab |
.RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
|
|
Packit Service |
3880ab |
|
|
Packit Service |
3880ab |
.SH AUTHOR
|
|
Packit Service |
3880ab |
Manpage maintained by bert hubert (ahu@ds9a.nl)
|