Question about bridging code
Robert Watson
rwatson at freebsd.org
Thu Oct 16 16:21:24 PDT 2003
On Thu, 16 Oct 2003, Barney Wolff wrote:
> On Thu, Oct 16, 2003 at 05:18:24PM -0400, Robert Watson wrote:
> >
> > My conclusion from my BPF bridge experience was that prototyping in
> > userspace made it a lot easier to experiment with changes, and
> > dramatically reduced the development time. On the other hand, it did
> > terrible things to performance on high bandwidth tests, and because we
> > weren't using mbufs in userspace, made it harder to port to the kernel.
> > One nice benefit, though, was that we had TCP/IP people programming TCP/IP
> > stuff without having to teach them about mbuf semantics or kernel
> > debugging :-).
>
> It's actually not so hard to get kernel mbuf-oriented code running in
> userspace. I did a userspace PPP implementation in 1994, and when it
> came time to do VJ compression I took the BSD kernel VJ code (from
> lbl.gov, if I recall correctly), defined some of the mbuf fields in my
> own structs, and it compiled and worked correctly without changing a
> single line of the VJ code.
>
> That project would never have survived if every bug had caused a kernel
> panic. The code is still running in commercial service today.
There are also at least a couple of implementations of a full BSD network
stack in userspace (Alpine being one, I believe), as well as the Linux
network stack. A number of pretty large product companies also ship
network appliances and related products based on userspace network stacks
optimized for what they're doing, using the OS basically as a device
driver and development framework.
Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org Network Associates Laboratories
More information about the freebsd-net
mailing list