Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Feb 2007 12:53:58 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Tomas Svensson <tomas@tutus.se>
Cc:        freebsd-net@freebsd.org
Subject:   Re: problem with ng_device as tun replacement
Message-ID:  <45CCDF66.90505@elischer.org>
In-Reply-To: <45CC686F.1050409@tutus.se>
References:  <45CC686F.1050409@tutus.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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?45CCDF66.90505>