Issues in setting up different priorities for the MAC match filter

Linux Advanced Routing and Traffic Control

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

 



Hi,
I am currently using TC for setting up user MAC based filters,and I am
seeing a problem when I try to assign different priorities to the MAC
Match filter apart from the root qdisc and parent class.
Here is my script.

/*****************************************************/

First of all I create the qdisc and class based on priority 2 and also
the Hash mask

tc qdisc add dev eth1 root handle 1:0 htb r2q 1
tc class add dev eth1 parent 1:0 classid 1:fffe htb rate 100mbit
tc filter add dev eth1 parent 1:0 prio 2 protocol ip u32
tc filter add dev eth1 parent 1:0 prio 2 handle ffe:0 protocol ip u32
divisor 256
tc filter add dev eth1 parent 1:0 prio 2 protocol ip u32 ht 800:: match
u32 \
       0x00000800 0x0000FFFF at -4 hashkey mask 0x00ff0000 at -8 link
ffe:

Then I am trying to create a MAC match filter for each user with a
different priority.

User 1:

tc class add dev eth1 parent 1:fffe classid 1:140 htb rate 100mbit
tc qdisc add dev eth1 parent 1:140 handle 140:0 htb r2q 1
tc class add dev eth1 parent 140:0 classid 140:1 htb rate 100mbit
tc class add dev eth1 parent 140:0 classid 140:2 htb rate 100mbit
tc qdisc add dev eth1 parent 140:2 tbf rate 1bps burst 1 latency 50ms
tc filter add dev eth1 parent 1:0 prio 3 protocol ip u32 ht ffe:40 match
u32 \
     0x000bcd59 0xffffffff at -12 match u16 0x1240 0xffff at -8 flowid
1:140
     
User 2:

tc class add dev eth1 parent 1:fffe classid 1:13E htb rate 100mbit
tc qdisc add dev eth1 parent 1:13E handle 13E:0 htb r2q 1
tc class add dev eth1 parent 13E:0 classid 13E:1 htb rate 100mbit
tc class add dev eth1 parent 13E:0 classid 13E:2 htb rate 100mbit
tc qdisc add dev eth1 parent 13E:2 tbf rate 1bps burst 1 latency 50ms
tc filter add dev eth1 parent 1:0 prio 4 protocol ip u32 ht ffe:3E match
u32 \
    0x000bcd59 0xffffffff at -12 match u16 0x123E 0xffff at -8 flowid
1:13E

/* test ends here */


Output from tc:

~ # tc qdisc show dev eth1
qdisc htb 1: r2q 1 default 0 direct_packets_stat 193
qdisc htb 140: parent 1:140 r2q 1 default 0 direct_packets_stat 0
qdisc tbf 8001: parent 140:2 rate 8bit burst 0b lat 1us
qdisc htb 13e: parent 1:13e r2q 1 default 0 direct_packets_stat 0
qdisc tbf 8002: parent 13e:2 rate 8bit burst 0b lat 1us

The output from the tc when I type "tc filter show dev eth1" is as shown
below:

~ # tc filter show dev eth1
filter parent 1: protocol ip pref 2 u32
filter parent 1: protocol ip pref 2 u32 fh ffe: ht divisor 256
filter parent 1: protocol ip pref 2 u32 fh ffe:3e:800 order 2048 key ht
ffe bkt 3e flowid 1:13e
  match 000bcd59/ffffffff at -12
  match 123e0000/ffff0000 at -8
filter parent 1: protocol ip pref 2 u32 fh ffe:40:800 order 2048 key ht
ffe bkt 40 flowid 1:140
  match 000bcd59/ffffffff at -12
  match 12400000/ffff0000 at -8
filter parent 1: protocol ip pref 2 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 2 u32 fh 800::800 order 2048 key ht
800 bkt 0 link ffe:
  match 00000800/0000ffff at -4
    hash mask 00ff0000 at -8
filter parent 1: protocol ip pref 3 u32
filter parent 1: protocol ip pref 3 u32 fh 801: ht divisor 1
filter parent 1: protocol ip pref 4 u32
filter parent 1: protocol ip pref 4 u32 fh 802: ht divisor 1


Note: Here the priority given to the MAC match filters are not assigned
properly.

I am currently using Linux kernel 2.4.30.

Could  anyone of you help me out on this.

Thanks
Swami
    
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


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