From owner-freebsd-stable Fri Oct 4 20:23: 5 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11F1137B401 for ; Fri, 4 Oct 2002 20:23:04 -0700 (PDT) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 804D943E4A for ; Fri, 4 Oct 2002 20:23:03 -0700 (PDT) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2653.19) id <42S943ZP>; Fri, 4 Oct 2002 23:23:02 -0400 Message-ID: From: Don Bowman To: "'stable@freebsd.org'" Subject: packet generator, GigE linerate, precomputed packets Date: Fri, 4 Oct 2002 23:23:01 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Is anyone aware of a method to efficiently transmit preconstructed packets under FreeBSD? This is for use in a network product test environment. I have tools to generate the packets I wish, and to transmit them (writing to /dev/bpf). The problem is that bpf is a non-blocking device, not supporting select for write, and its therefore difficult to do this transmit efficiently. With large packets (1500) I can saturate my GE interface, but it consumes most of one of my CPU's. Ideally I would be able to hand a set of preconstructed mbufs or other data structure straight to the ethernet device, and it would dump them all on the dma queue in one fell swoop. Does such a tool exist somewhere? I've been looking. There are products (e.g. smartbits) that do this in the network test space, but they don't give me quite the flexibility I'm looking for. There's no shortage of 'traffic generators' that use a local socket. I can replay tcpdump captures etc, but the rate isn't enough. Should I be looking at netgraph's ng_ether instead of /dev/bpf? Should I be looking @ writing a kernel module to do this? I'd like to hand off a set of packets and have them transmitted until further notice. I'm not sure how i'd do this in a kernel module, wouldn't I need a thread? Or would I make it implement select interface somehow and use it as a device driver, handing off some packet description list? Its important to note that these are arbitrarily constructed ethernet packets, not TCP or UDP sockets. Any suggestions on how to either avoid reinventing a wheel here, or pointers to the appropriate technology would be greatly appreciated. I really need to achieve line rate @ 1Gbps w/ minimal size packets (so a ~3.2Mpps transmit rate). Ideally I could achieve this on 2 GE interfaces simulateously, but I'm not too greedy :) I'd like to do this under fbsd 4.6.2, but -CURRENT would be ok too. --don To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message