From owner-freebsd-net@FreeBSD.ORG Mon Jun 21 15:52:47 2004 Return-Path: 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 17C6216A4EC for ; Mon, 21 Jun 2004 15:52:47 +0000 (GMT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1657743D1D for ; Mon, 21 Jun 2004 15:52:46 +0000 (GMT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.11/8.12.11) with ESMTP id i5LFoqhc033280; Mon, 21 Jun 2004 11:50:52 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i5LFoq1w033277; Mon, 21 Jun 2004 11:50:52 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 21 Jun 2004 11:50:51 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Long Le In-Reply-To: <20040621121945.GB18534@quartet.cs.unc.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org Subject: Re: Blasting UDP packets on a 1-Gbps link X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2004 15:52:47 -0000 On Mon, 21 Jun 2004, Long Le wrote: > I've been trying to get iperf to blast UDP packets for 10 minutes on a > 1-Gbps link. However, iperf stops after a few seconds and complains that > it can't write to the socket because no buffer space is available. > > 'netstat -m' shows that there are lots of mbufs available. I modified > iperf source code to set the socket's send buffer to 200000 bytes (*) > but it didn't really help much. In another attempt, I modified iperf > source code such that it would not quit after failing to write to the > socket. However, this caused iperf to hang. I use iperf 1.7.0 and > FreeBSD 4.5. The machine I am using has a 1-GHz CPU and 1 Gbytes of > memory. I could try to write my own program to blast UDP packets but > would prefer to use available software if possible. > > Has anyone successfully blasted UDP packets on a 1-Gbps link for a > sustained period and can anyone give me some useful hints? The ENOBUFS you're getting is likely generated by IFQ_ENQUEUE() when the outgoing interface queue fills, as lossy datagram protocols will generally attempt to deliver straight to the interface and drop if there's no room. I believe this happens regardless of socket buffer size, hence your '*' below. What you probably want to do is use an interval timer to schedule sending packets at the rate you want to accomplish. Or, if you really just want to send as fast as you can, you can spin and ignore ENOBUFS. :-) Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research > > Thanks, > Long > > (*) Apparently, iperf doesn't have an option to set the socket buffer for > UDP sockets. And there seems to be a limit that doesn't allow to set a > larger buffer size than around 200000 bytes (this is not related to iperf > but FreeBSD in general). > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >