next up previous contents
Next: Processing directives Up: The tcng language Previous: Parameter propagation   Contents


Class selection paths

Linux Traffic Control supports the creation of configurations where all classification and metering is done once, but the result is used several times, e.g. to select classes in subsequent queuing disciplines.

This is done using the dsmark queuing discipline and the tcindex filter. Since their use can be fairly complicated, the tcng language provides a construct that substantially simplifies building such configurations.

This construct is called a ``class selection path''. Such a path describes the classes that are selected by a given egress or dsmark class. Class selection paths are used instead of egress or dsmark class numbers, and consist of a space-separated list of variable names in angle brackets. The classes to select are later on assigned to these variables (see section 3.7 for more information on assigning classes to variables).

Example:

egress {
    class (<$c1>) ...;
    ...
    class (<$c2>) ...;
    ...
}

Note that specifying a single class is normally sufficient to uniquely define the set of classes to use. If more classes along the path are specified, they are ignored. (Note that only one class per queuing discipline can be selected in a path, so parent classes in a CBQ hierarchy must not be specified.)

The classes to select are simply assigned to the corresponding variables, as shown in the example below:

egress {
    class (<$c1>)
        if ...;
    class (<$c2>)
        if ...;
    ...
    prio {
        $c1 = class {}
        $c2 = class {}
    }
}

A more interesting example:

egress {
    class (<$c1>)
        if ...;
    class (<$c2>)
        if ...;
    class (<$c3>)
        if ...;
    ...
    prio {
        prio {
            $c1 = class {}
            $c2 = class {}
        }
        $c3 = class {}
    }
}

If there is no class to select, e.g. because the inner queuing discipline has no classes, the class selection path is simply left empty, e.g.

egress {
    class (<>)
        if tcp_dport == 80;
    drop if 1;

    fifo;
}


next up previous contents
Next: Processing directives Up: The tcng language Previous: Parameter propagation   Contents
Martin A. Brown 2003-11-06