Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2004 11:55:49 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        "Don Bowman" <don@sandvine.com>
Cc:        freebsd-net@freebsd.org
Subject:   RE: packet generator
Message-ID:  <16709.49925.44017.257631@grasshopper.cs.duke.edu>
In-Reply-To: <A8535F8D62F3644997E91F4F66E341FC150AE4@exchange.sandvine.com>
References:  <A8535F8D62F3644997E91F4F66E341FC150AE4@exchange.sandvine.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Don Bowman writes:
 > From: owner-freebsd-net@freebsd.org
 > > [mailto:owner-freebsd-net@freebsd.org]On Behalf Of Andrew Gallatin
 > > Sent: September 10, 2004 19:08 PM
 > > To: freebsd-net@freebsd.org
 > > Subject: packet generator
 > > 
 > > Does anybody have a free, in-kernel tool to generate packets quicky
 > > and send them out a particular etherent interface on FreeBSD?
 > > Something similar to pktgen on linux?
 > > 
 > > I'm trying to excersize just the send-side of programmable firmware
 > > based NIC.  The recieve side of the NIC firmware is not yet written,
 > > but I want to get started tuning and shaking the bugs out of the send
 > > side while the firmware author does the recieve path.  The packets
 > > just get dropped on the floor by the NIC, so its a good way to test
 > > the interface..
 > > 
 > 
 > ng_source was a netgraph module we wrote and contributed.
 > It can transmit ~800Kpps on a PCI-X system. The code is in
 > src/sys/netgraph/ng_source.c.
 > I drive it with a tcl library that can create arbitrary
 > packets with an object-oriented model, let me know if you'd
 > like to try that.

That would be wonderful..  I think I also need a clue ;)

Right now, what I've done is this:

ifconfig mx0 inet 192.168.1.7 up
kldload ng_ether
kldload ng_source
ngctl mkpeer mx0: source orphans output
# use a captured icmp frame as transmit data
cat ~/icmp.raw | nghook mx0:orphans input
ngctl msg mx0:orphans start 1600


This all works fine, and netstat tells me my driver sent the 1600
frames.  ngctl msg mx0:orphans getstats shows me the elapsted time,
etc.

However, I can't seem to do it twice in a row.  Eg, a second
	 ngctl msg mx0:orphans start 1600 
does not result in any frames being sent.  I've also tried this on an
em interface, so I don't think its anything about my driver.  I've
tried clrdata and re-doing the nghook input, and it does not seem to
help.   The only way I've found to re-test is to reboot the machine..

What am I doing wrong?  (this is RELENG_5 from ~1 week ago).

Thanks,

Drew






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16709.49925.44017.257631>