Date: Thu, 18 Nov 2004 10:49:44 -0800 From: Julian Elischer <julian@elischer.org> To: Robert Watson <rwatson@freebsd.org> Cc: net@freebsd.org Subject: Re: How can I create and use a Tap device Message-ID: <419CEEC8.8010203@elischer.org> In-Reply-To: <Pine.NEB.3.96L.1041118164144.66045F-100000@fledge.watson.org> References: <Pine.NEB.3.96L.1041118164144.66045F-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson wrote: >On Thu, 18 Nov 2004, Elton Machado wrote: > > > >>I need a virtual ethernet device, can I use tap for that? >> >>How can I create it? >> >> >[...] > >A couple of performance caveats: > >- Every packet delivery requires going to user space, so possibly a > context switch and certainly a system call. >- Every packet is copied to user space, and/or from user space, so you get > a lot of memory copying. > You can also use netgraph's eiface node. thid delivers teh packet to a netgraph interface which can be then used for further processing in the kernel.. (e.g. a ksocket node to encapsulate it in UDP).. No extra context switches.. > >For prototyping or light-weight stuff, tap is a great tool, but to improve >performance you want to run network code in the kernel, especially if >there are other applications running (and/or processing packets), which >will increase the number of context switches. The cost as it stands isn't >bad -- I regularly use tap-derived tunnel software for remote network >access without a hitch. There were recently some posts made with patches >to optimize the allocation of kernel memory for packets sent using a tap >device, which are in the mailing list archives (not sure if they were >merged yet). > >Robert N M Watson FreeBSD Core Team, TrustedBSD Projects >robert@fledge.watson.org Principal Research Scientist, McAfee Research > > >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?419CEEC8.8010203>