netmap, VALE and netmap pipes
Luigi Rizzo
rizzo at iet.unipi.it
Mon Feb 17 21:14:39 UTC 2014
On Mon, Feb 17, 2014 at 03:52:08PM -0500, Mike Tancsa wrote:
...
> > this is just the FreeBSD/head ipfw code with obvious features
>
> Actually, I was thinking more in terms of netmap in general. eg.
> examples of how to use it as a high speed firewall or router, or packet
> generator etc.
i should really write a book on this stuff :)
+ for simple traffic sources/sinks, the pkt-gen program
(FreeBSD: tools/tools/netmap, git repo: examples/ )
is the swiss-army-knife.
In RX mode it can drain and count packets at very high rates.
In TX mode it can create one or more udp streams with programmable
addresses, packet sizes and rates up to the 100+Mpps i was
mentioning in the posting.
It could be trivially extended to create TCP flows
+ the 'bridge' program also in the same directories is an
example of how to move traffic between (2) interfaces.
Note that if you really want to go fast with multiple ports
and concurrent threads you will need to reimplement
the same batching tricks that we use in the in-kernel VALE switch.
I am afraid i do not have a ready-to-use example to point you at.
In general, if you have a tool (generator, software router, etc)
that speaks libpcap it is a no-op to have it working on top of the
netmap-enabled libpcap. Note though that the application itself
might be too slow to exploit the speedup that netmap could give.
I know that tcpreplay has recently added netmap support and needed
some tweaks to work correctly at high rates. Similarly a student
of mine is working on the 'ostinato' traffic generator to
get some speedups.
Keep in mind, the basic I/O costs 500..1000ns per packet
with conventional methods, and 10..50ns with netmap.
This means that the actual rate you will be able to achieve is
dominated by the extra time your application consumes on each packet.
cheers
luigi
More information about the freebsd-net
mailing list