From owner-freebsd-net@FreeBSD.ORG Mon Sep 13 15:55:55 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 7C08E16A4CE for ; Mon, 13 Sep 2004 15:55:55 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E06DF43D45 for ; Mon, 13 Sep 2004 15:55:54 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8DFtsJt025484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Sep 2004 11:55:54 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8DFtnWC067217; Mon, 13 Sep 2004 11:55:49 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16709.49925.44017.257631@grasshopper.cs.duke.edu> Date: Mon, 13 Sep 2004 11:55:49 -0400 (EDT) To: "Don Bowman" In-Reply-To: References: X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-net@freebsd.org Subject: RE: packet generator 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, 13 Sep 2004 15:55:55 -0000 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