From owner-freebsd-questions Fri Jun 14 13:14:15 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA13308 for questions-outgoing; Fri, 14 Jun 1996 13:14:15 -0700 (PDT) Received: from twwells.com (twwells.com [199.79.159.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id NAA13300 for ; Fri, 14 Jun 1996 13:14:11 -0700 (PDT) Received: by twwells.com (Smail3.1.29.1 #8) id m0uUfFx-00012fC; Fri, 14 Jun 96 16:14 EDT To: freebsd-questions@freebsd.org From: bill@twwells.com (T. William Wells) Subject: Re: performance effects of many interface addresses? Date: 14 Jun 1996 16:14:06 -0400 Lines: 19 Message-ID: <4psh6e$ba3@twwells.com> References: <4pqeud$ohs@twwells.com> <7122.834716598@palmer.demon.co.uk> <9606141410.AA17238@halloran-eldar.lcs.mit.edu> NNTP-Posting-Host: localhost.twwells.com Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In article <9606141410.AA17238@halloran-eldar.lcs.mit.edu>, Garrett Wollman wrote: : 2) For every packet received, the system much search (potentially) the : entire address list (potentially twice) to determine whether it should : accept or forward/drop the packet. Ignoring the packet filter and the firewall code.... There is a loop that looks through in_ifaddr in ipintr. It takes about 7 tests/address. Even with caching, each of them is going to require at least one memory access, and at 60ns/access, that's 420ns. Assuming random access to the list, 250 addresses require 125 accesses, or 52 microseconds, conservatively and on average, to search that list. A 1500 byte ethernet packet takes 1.2 milliseconds, so I'm spending about 4% of a packet time in that loop alone. Alternately, as I'm doing perhaps 80 packets/second, that's .4% of the time the system is spending in that loop alone. This isn't catastrophic but it isn't especially wonderful, either.