Differentiated Services on Linux
Hosted by
SourceForge Logo

2.4 Kernel iproute2 2.2 Kernel Mailing list Documentation Links

Differentiated Services (short: Diffserv) is an architecture for providing different types or levels of service for network traffic. One key characteristic of Diffserv is that flows are aggregated in the network, so that core routers only need to distinguish a comparably small number of aggregated flows, even if those flows contain thousands or millions of individual flows.

Support for Differentiated Services on Linux is part of the more general Traffic Control architecture. A kernel patch is available for 2.2 kernels. 2.4 and late 2.3 kernels already contain the necessary kernel changes.

This page contains material about the support for Differentiated Services on Linux, traffic control on Linux in general, and links to sites with related information.

 2.4 Kernel
Support for Diffserv is already integrated into 2.4 kernels. In order to enable it, you may have to reconfigure and rebuild your kernel, or at least some modules. The general procedure for this is described in the The Linux Kernel HOWTO.

The following kernel configuration options have to be enabled in the section Networking options:

  • Kernel/User netlink socket (CONFIG_NETLINK)
  • Network packet filtering (CONFIG_NETFILTER)
  • QoS and/or fair queueing (CONFIG_NET_SCHED)

The following kernel configuration options should be enabled in the section Networking options, QoS and/or fair queueing:

  • CBQ packet scheduler (CONFIG_NET_SCH_CBQ)
  • The simplest PRIO pseudoscheduler (CONFIG_NET_SCH_PRIO)
  • RED queue (CONFIG_NET_SCH_RED)
  • GRED queue (CONFIG_NET_SCH_GRED)
  • Diffserv field marker (CONFIG_NET_SCH_DSMARK)
  • Ingress Qdisc (CONFIG_NET_SCH_INGRESS)
  • QoS support (CONFIG_NET_QOS)
  • Packet classifier API (CONFIG_NET_CLS)
  • TC index classifier (CONFIG_NET_CLS_TCINDEX)
  • Firewall based classifier (CONFIG_NET_CLS_FW)
  • U32 classifier (CONFIG_NET_CLS_U32)
  • Traffic policing (CONFIG_NET_CLS_POLICE)
In some cases, additional elements may be needed. It is therefore recommended to enable all options in QoS and/or fair queueing.

When the kernel is successfully built and booted, proceed with the instructions in the "iproute2" section just below.

 iproute2
Linux Traffic Control is configured with the utility tc. It is part of the iproute2 package. Some Linux distributions already include tc, but it may be an old version, without support for Diffserv.

iproute2 is available from many places all over the world, e.g.

To build tc with Diffserv support, proceed as follows:

  • Extract iproute2:
    tar xfz iproute2-current.tar.gz
  • Edit iproute2/Config to enable Diffserv support:
    TC_CONFIG_DIFFSERV=y
  • In iproute2/, run make:
    cd iproute2
    make
The tc executable is now in ./tc/tc

 2.2 Kernel
The Diffserv code for 2.2 kernels is no longer maintained. Several significant bugs have been fixed in the 2.4 kernel. It is therefore strongly recommended to use 2.4 instead of 2.2.

You're still reading, so you seem to be determined ... Okay, here is how Diffserv support is added to a 2.2 kernel:

  • Download the old Diffserv distribution from ftp://icaftp.epfl.ch/pub/linux/diffserv/dist/ds-8.tar.gz
  • Extract it with
    tar xfz ds-8.tar.gz
  • Follow the instructions in the file ds/README for patching and configuring the kernel
  • Instead of doing what is described under "TC installation", follow the instructions above.
Note: the patch is known to work with the 2.2.14 kernel. It may need manual editing, or may fail completely, with different kernel versions.

 Mailing list
There is a mailing list for discussion concerning the development and use of support for Differentiated Services on Linux. You can subscribe and unsubscribe via the Web interface on http://lists.sourceforge.net/lists/listinfo/diffserv-general

The mailing list is archived at http://www.geocrawler.com/redir-sf.php3?list=diffserv-general

Note: if you no longer want to receive mails from this mailing list, but you don't know how to unsubscribe, just wait a little while. A reminder with all the information you need for unsubscribing (including your list password) is automatically sent every month.

 Documentation
Usage information:
(nothing at the moment)

Implementation details:

  • "Linux Network Traffic Control - Implementation Overview", April 1999
    (Postscript: gziped)
  • 2.4 update of the paper above, February 2001 (work in progress)
    (Postscript: gziped)
  • "Differentiated Services on Linux", June 1999 (draft-almesberger-wajhak-diffserv-linux-01.txt)
    (ASCII: gziped; Postscript: gziped)

 Links
Linux Diffserv:
(nothing at the moment)

Linux Traffic Control:

Diffserv in general:

Last update: 29-MAY-2001