From: Amin Azez Subject: Re: Hash Function to Seperate Flows Date: Wed, 03 May 2006 10:35:00 +0100 Message-ID: <44587944.30707@ufomechanic.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: To: netfilter-devel@lists.netfilter.org In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: netfilter-devel-bounces@lists.netfilter.org Errors-To: netfilter-devel-bounces@lists.netfilter.org List-Id: netfilter-devel.vger.kernel.org Srinivas Krishnan wrote: > hi, > > i am trying to separate different flows, and was wondering if there is > a standard hash function with low collisions i can use to hash based > on src ip, dest ip, src port, dest port and protocol. > > there seems to be as hash fn in freeBSD's dummynet code but I do not > know if it can be directly applied, as it does some bit fiddling with > flow_mask. > > any help/thoughts would be greatly appreciated I suggest you read a few times through all kernel source files with "conntrack" in the name. I did, and it did me a world of good. jhash is probably the hash function you want. Look out for it, and happy reading. Sam