Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Let The Music Play: Join EFF Today

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 84 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       tc  qdisc [ add | change | replace | link ] dev DEV [ par­
       ent qdisc-id | root ] [ handle qdisc-id ]  qdisc  [  qdisc
       specific parameters ]

       tc  class [ add | change | replace ] dev DEV parent qdisc-
       id [ classid class-id ] qdisc [ qdisc specific  parameters

       tc  filter  [  add  |  change | replace ] dev DEV [ parent
       qdisc-id | root ] protocol protocol prio priority  filter­
       type [ filtertype specific parameters ] flowid flow-id

       tc [-s | -d ] qdisc show [ dev DEV ]

       tc [-s | -d ] class show dev DEV

       tc filter show dev DEV


       Tc  is used to configure Traffic Control in the Linux ker­
       nel. Traffic Control consists of the following:

              When traffic is shaped, its rate of transmission is
              under  control.  Shaping  may be more than lowering
              the available bandwidth - it is also used to smooth
              out bursts in traffic for better network behaviour.
              Shaping occurs on egress.

              By scheduling the transmission  of  packets  it  is
              possible  to improve interactivity for traffic that
              needs it while still guaranteeing bandwidth to bulk
              transfers.  Reordering is also called prioritizing,
              and happens only on egress.

              Where shaping deals with transmission  of  traffic,
              policing  pertains  to  traffic  arriving. Policing
              thus occurs on ingress.

              Traffic exceeding  a  set  bandwidth  may  also  be
              dropped forthwith, both on ingress and on egress.

       A simple QDISC is the 'pfifo' one, which does no  process­
       ing  at  all  and  is a pure First In, First Out queue. It
       does however store  traffic  when  the  network  interface
       can't handle it momentarily.


       Some  qdiscs  can  contain  classes, which contain further
       qdiscs - traffic may then be enqueued in any of the  inner
       qdiscs,  which  are  within  the classes.  When the kernel
       tries to dequeue a packet from such a  classful  qdisc  it
       can  come from any of the classes. A qdisc may for example
       prioritize certain kinds of traffic by trying  to  dequeue
       from certain classes before others.


       A filter is used by a classful qdisc to determine in which
       class a packet will be enqueued. Whenever traffic  arrives
       at  a  class  with  subclasses, it needs to be classified.
       Various methods may be employed to do so, one of these are
       the filters. All filters attached to the class are called,
       until one of them returns with a verdict.  If  no  verdict
       was  made,  other  criteria may be available. This differs
       per qdisc.

       It is important  to  notice  that  filters  reside  within
       qdiscs - they are not masters of what happens.


       The classless qdiscs are:

              Simplest  usable  qdisc,  pure  First In, First Out
              behaviour. Limited in packets or in bytes.

              Standard qdisc for 'Advanced Router'  enabled  ker­
              nels.  Consists  of a three-band queue which honors
              Type of Service flags, as well as the priority that
              may be assigned to a packet.

       red    Random  Early  Detection simulates physical conges­
              tion by randomly dropping packets when nearing con­
              figured  bandwidth  allocation. Well suited to very
              large bandwidth applications.

       sfq    Stochastic Fairness Queueing reorders queued  traf­
              fic  so  each  'session'  gets  to send a packet in

       The  pfifo_fast  qdisc  is  the  automatic  default in the
       absence of a configured qdisc.


       The classful qdiscs are:

       CBQ    Class Based Queueing implements a rich  linksharing
              hierarchy of classes.  It contains shaping elements
              as well as prioritizing  capabilities.  Shaping  is
              performed  using  link idle time calculations based
              on average packet size and  underlying  link  band­
              width.  The  latter  may  be  ill-defined  for some

       HTB    The  Hierarchy  Token  Bucket  implements  a   rich
              linksharing  hierarchy  of classes with an emphasis
              on conforming to existing  practices.  HTB  facili­
              tates guaranteeing bandwidth to classes, while also
              allowing specification of upper  limits  to  inter-
              class  sharing. It contains shaping elements, based
              on TBF and can prioritize classes.

       PRIO   The PRIO qdisc is a  non-shaping  container  for  a
              configurable  number  of classes which are dequeued
              in order. This allows for  easy  prioritization  of
              traffic,  where lower classes are only able to send
              if higher ones have no packets available. To facil­
              itate  configuration, Type Of Service bits are hon­
              ored by default.


       Classes form a tree, where each class has a single parent.
       A  class may have multiple children. Some qdiscs allow for
       runtime addition of classes (CBQ, HTB) while others (PRIO)
       are created with a static number of children.

       Qdiscs  which  allow  dynamic addition of classes can have
       zero or more subclasses to which traffic may be  enqueued.

       Furthermore,  each  class  contains  a leaf qdisc which by
       default has pfifo behaviour though another  qdisc  can  be
       attached  in  place. This qdisc may again contain classes,
       but each class can have only one leaf qdisc.

       When a packet enters a classful qdisc it can be classified
       to  one  of  the classes within. Three criteria are avail­
       able, although not all qdiscs will use all three:

       tc filters
              If tc filters are attached to  a  class,  they  are

       higher level filters may  also  point  directly  to  lower

       If classification did not succeed, packets are enqueued to
       the leaf qdisc attached to that class.  Check  qdisc  spe­
       cific manpages for details, however.


       All qdiscs, classes and filters have IDs, which can either
       be specified or be automatically assigned.

       IDs consist of a major number and a  minor  number,  sepa­
       rated by a colon.

       QDISCS A  qdisc, which potentially can have children, gets
              assigned a major number, called a 'handle', leaving
              the  minor  number namespace available for classes.
              The handle is expressed as '10:'.  It is  customary
              to explicitly assign a handle to qdiscs expected to
              have children.

              Classes residing under a qdisc  share  their  qdisc
              major number, but each have a separate minor number
              called a 'classid' that has no  relation  to  their
              parent  classes,  only  to  their parent qdisc. The
              same naming custom as for qdiscs applies.

              Filters have a three part ID, which is only  needed
              when using a hashed filter hierarchy, for which see


       All parameters accept a floating  point  number,  possibly
       followed by a unit.

       Bandwidths or rates can be specified in:

       kbps   Kilobytes per second

       mbps   Megabytes per second

       kbit   Kilobits per second

       mbit   Megabits per second

       bps or a bare number
       b or a bare number

       Lengths of time can be specified in:

       s, sec or secs
              Whole seconds

       ms, msec or msecs

       us, usec, usecs or a bare number


       The  following  commands are available for qdiscs, classes
       and filter:

       add    Add a qdisc, class or filter to  a  node.  For  all
              entities,  a parent must be passed, either by pass­
              ing its ID or by attaching directly to the root  of
              a  device.   When  creating a qdisc or a filter, it
              can be named with the handle parameter. A class  is
              named with the classid parameter.

       remove A  qdisc  can  be removed by specifying its handle,
              which may also be 'root'. All subclasses and  their
              leaf  qdiscs  are automatically deleted, as well as
              any filters attached to them.

       change Some entities can be modified  'in  place'.  Shares
              the  syntax  of  'add', with the exception that the
              handle cannot be changed and neither can  the  par­
              ent. In other words, change cannot move a node.

              Performs  a nearly atomic remove/add on an existing
              node id. If the node does not exist yet it is  cre­

       link   Only  available  for  qdiscs and performs a replace
              where the node must exist already.


       tc was written by Alexey N. Kuznetsov and added  in  Linux

More information about the site can be found in the FAQ



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.07 Seconds