Date: Tue, 19 May 1998 08:15:18 -0700 From: David Greenman <dg@root.com> To: Pierre Beyssac <pb@fasterix.freenix.org> Cc: freebsd-net@FreeBSD.ORG, matt@3am-software.com Subject: Re: patches for fast forwarding (with kernel option & sysctl) Message-ID: <199805191515.IAA22491@implode.root.com> In-Reply-To: Your message of "Mon, 04 May 1998 01:43:10 %2B0200." <19980504014310.A22037@fasterix.frmug.fr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805191515.IAA22491>