Subject: Re: tun.c non formal header protocol?

From: "Rémi Denis-Courmont" <[email-masked]>
Date: Thu, 24 Feb 2011 21:04:40 +0200

Le jeudi 24 février 2011 20:37:32 Kfir Lavi, vous avez écrit :
> I would like to use custom protocol over tun/tap device.

Over TAP, you can only exchange Ethernet frames. However you can use whatever 
network layer you like (so long as it has an Ethernet type associated).

Over TUN, you can exchange packets without any link layer header, for any 
network layer protocol defined in Linux.

In principles, you can probably just use a (Ethernet) type that is not used by 
any existing stack in the Linux kernel. But I don't see any point in doing so, 
as the kernel will just drop the packets on the floor afterward.

> I'm grabbing packets, and changing them, to deliver via tap,
> to a listener that knows this custom protocol.
> The custom protocol is just wrapping the packet with another
> small header.
> Is it possible to move custom packets via tun.c ?

It's difficult to say without a clearer picture what you are trying to do.

-- 
Rémi Denis-Courmont
http://www.remlab.info/
http://fi.linkedin.com/in/remidenis