Date: Mon, 17 Feb 2014 22:16:49 +0100 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Mike Tancsa <mike@sentex.net> Cc: "freebsd-net@freebsd.org" <net@freebsd.org> Subject: Re: netmap, VALE and netmap pipes Message-ID: <20140217211649.GA42452@onelab2.iet.unipi.it> In-Reply-To: <53027678.2020202@sentex.net> References: <CA%2BhQ2%2Bgbs9aBneUaDGAnKVoPHspzc=5o%2Bh%2Bf_K=T%2BCy8sRxr%2Bw@mail.gmail.com> <1392661063.244494415.kh0fdlsv@frv34.fwdcdn.com> <20140217185832.GB41267@onelab2.iet.unipi.it> <530273BF.5020303@sentex.net> <20140217205213.GC42021@onelab2.iet.unipi.it> <53027678.2020202@sentex.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140217211649.GA42452>