From owner-freebsd-net Tue May 19 08:17:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA04632 for freebsd-net-outgoing; Tue, 19 May 1998 08:17:03 -0700 (PDT) (envelope-from owner-freebsd-net@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA04601 for ; Tue, 19 May 1998 08:16:53 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id IAA22491; Tue, 19 May 1998 08:15:18 -0700 (PDT) Message-Id: <199805191515.IAA22491@implode.root.com> To: Pierre Beyssac cc: freebsd-net@FreeBSD.ORG, matt@3am-software.com Subject: Re: patches for fast forwarding (with kernel option & sysctl) In-reply-to: Your message of "Mon, 04 May 1998 01:43:10 +0200." <19980504014310.A22037@fasterix.frmug.fr.net> From: David Greenman Reply-To: dg@root.com Date: Tue, 19 May 1998 08:15:18 -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Here are new patches to use NetBSD's IPFLOW stuff on -current. To Thanks! I just committed them after making a few minor changes myself. After reviewing the implementation, I think there is plenty of room for efficiency improvement, especially with the hash algorithm. The current hash algorithm does 18 adds, 12 shifts, 6 subtracts, and 6 compares for every packet. I think this is a bit excessive. I think a hash with similar quality could be acheived with just 3 xors and a 2 shifts. There is also an issue of the LRU algorithm being extremely expensive when IPFLOW_MAX is reached. One solution would be to create a list of the ip_flow structs that is kept sorted, but this would slow down the fast path. Another solution might be to do a pseudo-random drop of some kind - for instance, use the count of total forwarded packets in the calculation of a hash index and then drop the last (oldest) entry in that bucket. I'm sure there are many more possible solutions that I haven't considered and I welcome any suggestions on this. Anyway, thanks go to Matt Thomas for implementing this in the first place. It looks to be quite useful. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message