Re: Priomap

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

* On Fri, Aug 29, 2003 at 10:54 PM (+0200), Emmanuel SIMON wrote:

> When installing PRIO, it creates 3 "classes" with priority level according
> to the TOS.
> 
> That command line :
> # tc qdisc add dev eth0 root handle 1: prio
> give that result :
> # tc qd sh
> qdisc prio 1: dev eth0 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
> 
> How should i read that priomap, what does it mean and how to change it.

As far as I understood it, it behaves the same like the classless qdisc
"pfifo_fast" using its bands. 

The difference is that (when using the classful qdisc "prio") you have 
got real classes and you can also use classifiers to put packets into 
the classes. 

But, if there aren't any matching classifiers, the packets got distri-
buted to their according classes using the values within their Type
of Service field (TOS) and the given priomap. The default priomap is 
the one you've wrote above.  

What does the priomap "1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1" actually mean?

As it is stated in chapter 9.2.1.1 of the LARTC howto, there are six-
teen values for the TOS files (one byte):

 |  TOS     Bits  Means                    Linux Priority    Band
 |  ------------------------------------------------------------
 |  0x0     0     Normal Service           0 Best Effort     1
 |  0x2     1     Minimize Monetary Cost   1 Filler          2
 |  0x4     2     Maximize Reliability     0 Best Effort     1
 |  0x6     3     mmc+mr                   0 Best Effort     1
 |  0x8     4     Maximize Throughput      2 Bulk            2
 |  0xa     5     mmc+mt                   2 Bulk            2
 |  0xc     6     mr+mt                    2 Bulk            2
 |  0xe     7     mmc+mr+mt                2 Bulk            2
 |  0x10    8     Minimize Delay           6 Interactive     0
 |  0x12    9     mmc+md                   6 Interactive     0
 |  0x14    10    mr+md                    6 Interactive     0
 |  0x16    11    mmc+mr+md                6 Interactive     0
 |  0x18    12    mt+md                    4 Int. Bulk       1
 |  0x1a    13    mmc+mt+md                4 Int. Bulk       1
 |  0x1c    14    mr+mt+md                 4 Int. Bulk       1
 |  0x1e    15    mmc+mr+mt+md             4 Int. Bulk       1

Using the default priomap will send packets with a TOS value of 0x10, 
0x12, 0x14 or 0x16 to class 0, packets with a TOS value of 0x0, 0x4,
0x6, 0x18, 0x1a, 0x1c, 0x1e to class 1 and packets with a TOS value
of 0x2, 0x8, 0xa, 0xc and 0xe to class 2. 

The "prio" qdisc now will dequeue packets from class 0 with the
highest priority. The higher the class numbers the lower the de-
queue priority.

If you would like to send packets with a TOS value of 0x0, 0x2, 0x4,
0x6, 0x8 to class 1 and packets with all other TOS values to class 0
you could change your priomap such (you have to state it when setting
up the "prio" qdisc if you want to have something different from the
default priomap):

  1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 

The TOS bits have the following meaning:

 |  Binary Decimcal  Meaning
 |  -----------------------------------------
 |  1000   8         Minimize delay (md)
 |  0100   4         Maximize throughput (mt)
 |  0010   2         Maximize reliability (mr)
 |  0001   1         Minimize monetary cost (mmc)
 |  0000   0         Normal Service

Of course, they can be combind, and so you can get these 16 values (2^4)
which are stated in the upper table.

You'll find very good documentation not only within the LARTC howto
(chapters 9.2.1 [1] and 9.5.3 [2]) but also within [3].

HTH,
Steffen

[1] http://lartc.org/howto/lartc.qdisc.classless.html#AEN659
[2] http://lartc.org/howto/lartc.qdisc.classful.html#AEN899
[3] http://opalsoft.net/qos/DS-23.htm
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux