LARTC
[Top] [All Lists]

[LARTC] filter hashkey without match

To: <lartc@mailman.ds9a.nl>
Subject: [LARTC] filter hashkey without match
From: "Deepak Agarwal" <dagarwal@juniper.net>
Date: Fri, 3 Aug 2007 06:49:33 +0530
Delivered-to: sp-com-lists@consult.net
Delivered-to: lartc-list@securepoint.com
Delivered-to: lartc@outpost.ds9a.nl
List-archive: <http://mailman.ds9a.nl/pipermail/lartc>
List-help: <mailto:lartc-request@mailman.ds9a.nl?subject=help>
List-id: "Mailinglist of the Linux Advanced Routing &amp; Traffic Control project" <lartc.mailman.ds9a.nl>
List-post: <mailto:lartc@mailman.ds9a.nl>
List-subscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=subscribe>
List-unsubscribe: <http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc>, <mailto:lartc-request@mailman.ds9a.nl?subject=unsubscribe>
Sender: lartc-bounces@mailman.ds9a.nl
Thread-index: AcfVbFiyh4T6kPFrRgSWNcyp/HfkNw==
Thread-topic: filter hashkey without match

Hi,

 

I need to set filter-hash and use source-port as hashkey. It seems that I can’t use “hashkey” without using “match”.

 

I am using following commands:

tc qdisc add … root handle 1:0 htb

 

# Loop to add 1000 classes  (i = 1 to 1000)

tc class add … parent 1:0 classid 1:$i

 

#set filters

tc filter add … protocol ip parent 1:0 u32

tc filter add … protocol ip parent 1:0 handle 2: u32 divisor 256

 

# Loop to add 1000 filter: one for each class

# $p is for port; $b is the bucket id (0 to 256); $f is for classid (1 to 1000)

tc filter add … parent 1:0 u32 match ip sport $p 0xffff ht 2:$b: flowid 1:$f

 

#hashkey

tc filter add … protocol ip parent 1:0 u32 hashkey mask 0xffff at 20 link 2:

 

Problem is the last command. I want to match all the traffic coming to the interface and use lower-order of the source-port to decide the filter-bucket.

 

When I run the last command, it throws an error:

RTNETLINK answers: Invalid argument

We have an error talking to the kernel

 

Do we need to necessarily use “match ip ..” before using “hashkey”? If so, how do I match all the traffic?

 

Thanks for the help,

deepak

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
<Prev in Thread] Current Thread [Next in Thread>