Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2002 23:23:01 -0400 
From:      Don Bowman <don@sandvine.com>
To:        "'stable@freebsd.org'" <stable@freebsd.org>
Subject:   packet generator, GigE linerate, precomputed packets
Message-ID:  <FE045D4D9F7AED4CBFF1B3B813C8533701022BCB@mail.sandvine.com>

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

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




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