[Ns-developers] VirtualNetDevice (TUN/TAP)
Gustavo Carneiro
gjcarneiro at gmail.com
Sun May 25 09:12:37 PDT 2008
On 25/05/2008, Mathieu Lacage <mathieu.lacage at sophia.inria.fr> wrote:
>
> On Sun, 2008-05-18 at 15:19 +0100, Gustavo Carneiro wrote:
>
> > http://code.nsnam.org/gjc/ns-3-virtual-netdevice/
> >
> > It is very simple. It is based on ns-3.0.11. Incidentally it won't work
> on
> > ns-3.0.11 due to missing bug fixes only present on ns-3-dev.
> >
> > I am willing to port to ns-3-dev and add an example, if there is interest
> in
> > inclusion in ns-3 (but I have more urgent things to do otherwise).
>
>
> My first reaction is that I would have expected the packet
> encapsulation to be part of the VirtualNetDevice class and to not be
> delegated to the application.
This is exactly what is done by TAP interfaces; userspace just receives a
packet to be sent, from the IP stack, and this is where the job of the TAP
interface ends on the TX path. This model is simple and flexible, as it
allows you to do more than tunneling, and allows to do tunneling in anyway
you want.
If I am not totally wrong, the
> decapsulation at the other side of the connection also needs to be done
> by a VirtualNetDevice and a matching application ? If so, it really
> seems to me that supporting a VirtualChannel would make a lot of sense
> because the two VirtualNetDevice (tx and rx) and indeed connected.
The way I am using is roughly like this (it's more complicated, but...):
On the transmitter node:
Application -> UdpSocket1 -> IPv4 -> VirtualNetDevice -> Tunneling Code ->
UdpSocket2 -> IPv4 -> PointToPointNetDevice ...........
On the receiver node:
---> WifiNetDevice -> IPv4 -> UdpSocket3 -> Tunneling Code ->
VirtualNetDevice -> IPv4 -> UdpSocket4 -> SinkApp
Fun, isn't it? :-)
Anyway, I don't think adding a VirtualChannel to this picture helps.
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
More information about the Ns-developers
mailing list