DHCP oddity

Chuck Swiger cswiger at mac.com
Tue Dec 27 19:54:17 PST 2005


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)?


More information about the freebsd-net mailing list