tcng TCP ACK match

Linux Advanced Routing and Traffic Control

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

 



Hello.

I have been trying to duplicate these u32 matching rules using TCNG, but 
without much success:

tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32\
match ip protocol 6 0xff \
match u8 0x05 0x0f at 0 \
match u16 0x0000 0xffc0 at 2 \
match u8 0x10 0xff at 33 \
flowid 1:10

Wondershaper 1.1a implements this and if I run it things seem to be shaped as 
expected.  But this TCNG configuration doesn't product the same results.  
Does anyone know what I did wrong?

dev "eth0" {
 egress {

/* if (raw[33] >> 4) & 1; */

  class( <$ack> )
  if (ip_hl == 0x5) &&
  (ip_len & 0xffc0) &&
  tcp_ACK;

  class( <$other> ) if 1;

    htb() {
     class ( rate 230kbps, ceil 230kbps ) {
     $ack = class( rate 64kbps, ceil 230kbps, prio 1 ) {
      sfq;
     }
     $other = class( rate 64kbps, ceil 230kbps, prio 2 ) {
     sfq;
     }
   }
  }
 }
}

Which generates:

tc qdisc add dev eth0 handle 1:0 root dsmark indices 4 default_index 0
tc qdisc add dev eth0 handle 2:0 parent 1:0 htb
tc class add dev eth0 parent 2:0 classid 2:1 htb rate 28750bps ceil 28750bps
tc class add dev eth0 parent 2:1 classid 2:2 htb rate 8000bps ceil 28750bps 
prio 1
tc qdisc add dev eth0 handle 3:0 parent 2:2 sfq
tc class add dev eth0 parent 2:1 classid 2:3 htb rate 8000bps ceil 28750bps 
prio 2
tc qdisc add dev eth0 handle 4:0 parent 2:3 sfq
tc filter add dev eth0 parent 2:0 protocol all prio 1 tcindex mask 0x3 shift 0
tc filter add dev eth0 parent 2:0 protocol all prio 1 handle 2 tcindex classid 
2:3
tc filter add dev eth0 parent 2:0 protocol all prio 1 handle 1 tcindex classid 
2:2
tc filter add dev eth0 parent 1:0 protocol all prio 1 u32 match u8 0x6 0xff at 
9 match u8 0x5 0xf at 0 match u16 0x0 0xffc0 at 2 classid 1:2
tc filter add dev eth0 parent 1:0 protocol all prio 1 handle 1:0:0 u32 divisor 
1
tc filter add dev eth0 parent 1:0 protocol all prio 1 u32 match u8 0x6 0xff at 
9 match u8 0x5 0xf at 0 offset at 0 mask 0f00 shift 6 eat link 1:0:0
tc filter add dev eth0 parent 1:0 protocol all prio 1 handle 1:0:1 u32 ht 
1:0:0 match u8 0x10 0x10 at 13 classid 1:1
tc filter add dev eth0 parent 1:0 protocol all prio 1 u32 match u8 0x6 0xff at 
9 match u8 0x5 0xf at 0 classid 1:2
tc filter add dev eth0 parent 1:0 protocol all prio 1 u32 match u32 0x0 0x0 at 
0 classid 1:2

Thanks in advance!

-- 

Jason Boxman
Perl Programmer / *NIX Systems Administrator
Shimberg Center for Affordable Housing | University of Florida
http://edseek.com/ - Linux and FOSS stuff

_______________________________________________
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