problem with ng_device as tun replacement

Julian Elischer julian at elischer.org
Fri Feb 9 20:54:06 UTC 2007


Tomas Svensson wrote:
> Hi,
> 
> I am trying to replace the tun interface using netgraph by linking 
> ng_device and ng_iface:
> 
> ngctl mkpeer iface dummy inet
> ngctl mkpeer ng0: device inet inet
> 
> then I try to use it as a drop-in replacement for tun, but it doesn't 
> really work:
> 
> 1. If I send an IP packet through /dev/ngd0 (after doing a normal 
> open()), the packet doesn't get sent until I write a second packet to 
> the device.

Do you know it the ng-device device is hanging onto it, or the 
ng_iface device is getting it  but not passing it on?

If you don't know, you can put a 'tee' node between them
and use nghook(8) to see when the packet is passed between the nodes.

> 
> 2. If i route packets to ng0: it works even worse, with very long and 
> strange delays.

once again.. please use a TEE node to isolate the delays..

> 
> I can do the same with tun and it works fine. I also tried using the 
> netgraph user library to open a socket, and this works too (but I can't 
> use it since the performance is very poor).
> Any ideas?
> 
> -Tomas
> 
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list