[Ns-developers] VirtualNetDevice (TUN/TAP)

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Sun May 25 10:18:32 PDT 2008


On Sun, 2008-05-25 at 17:12 +0100, Gustavo Carneiro wrote:

>         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.

I see. What is the interface between the TAP interface and the
application on linux ? Does it open a special socket for reading and
writing ?

>         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? :-)

I see.

> Anyway, I don't think adding a VirtualChannel to this picture helps.

Maybe it does not help your specific use-case but the API was designed
to be implemented that way and, since there is nothing in your use-case
which makes this impossible, it would make sense to attempt to implement
the API fully.

regards,
Mathieu




More information about the Ns-developers mailing list