From owner-freebsd-net@FreeBSD.ORG Wed Dec 28 03:54:17 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6BC0A16A41F for ; Wed, 28 Dec 2005 03:54:17 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id C581943D58 for ; Wed, 28 Dec 2005 03:54:16 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 38C195DBC; Tue, 27 Dec 2005 22:54:16 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05940-01; Tue, 27 Dec 2005 22:54:15 -0500 (EST) Received: from [192.168.1.3] (pool-68-161-122-227.ny325.east.verizon.net [68.161.122.227]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 1DE4E5CFE; Tue, 27 Dec 2005 22:54:15 -0500 (EST) Message-ID: <43B20C73.6040107@mac.com> Date: Tue, 27 Dec 2005 22:54:27 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: skylar@cs.earlham.edu References: <43B03332.2010904@cs.earlham.edu> In-Reply-To: <43B03332.2010904@cs.earlham.edu> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-net@freebsd.org Subject: Re: DHCP oddity X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2005 03:54:17 -0000 Skylar Thompson wrote: > While doing some network stress-tests from a dual-CPU x86 FreeBSD 5.4 > server, I noticed that a "ping -f" drives dhcpd's CPU usage way up. I > put dhcpd into debug mode and didn't get any error messages. I then ran > dhcpd with strace, and saw loads of these messages when I started the > ping flood: > > select(8, [?], [?], [?], NULL) = 1 () > gettimeofday({...}, NULL) = 0 > recvfrom(4, 0xbfbfe090, 1500, 0, {...}, [?]) = 84 > select(8, [?], [?], [?], NULL) = 1 () > gettimeofday({...}, NULL) = 0 > recvfrom(4, 0xbfbfe090, 1500, 0, {...}, [?]) = 84 > > Does anyone know why this would happen? Flood-pinging a machine will stress many things which look at raw packets. At a guess, dhcpd isn't using a PCAP/BPF filter (*) to restrict itself to only paying attention to the traffic which it should care about, so it has to spend CPU in userland to process and discard all of the extra traffic. -- -Chuck (*): I suppose you need to pay attention to ICMP too, if you are going to ping-test IPs before assigning leases. Something like (arp or icmp or port 67)?