[Ns-developers] How to tap an NetDevice into another one ?

Tommaso Pecorella tpecorella at mac.com
Thu Nov 17 16:10:09 PST 2011


Hi Tom,

On 17 Nov, 2011,at 07:16 AM, Tom Henderson <tomh at tomh.org> wrote:


On 11/16/2011 03:20 PM, Tommaso Pecorella wrote:
> Hi all,
>
> request for suggestions (maybe I missed something).
>
> I want to stick an NetDevice on top of another one, masquerading it in
> the "right" way. So far I borrowed the idea from the Bridge interface,
> but I'm far from happy about the results.
>
> Let me first explain the problem better.
>
> Normal stack Custom stack
> +------------------+ +--------------------+
> | IP layer | | IP layer |
> | | +--------------------+
> +------------------+ | ghost layer |
> | MAC layer | +--------------------+
> | | | MAC layer |
> +------------------+ +--------------------+
>
> The problem with the approach I used is that it works BUT I have one
> extra NetDevice in the list of the node devices, so a dumb code could
> try to use it, while it should be invisible but for the ones explicitly
> checking for it.
>
> Any smart ideas ?

Are there particular problems with existing code getting confused? I 
think it is probably a job of the upper-layer code to be smarter about 
which devices to use or not. For example, IPv4 global routing code will 
not try to use net devices that do not have a corresponding IPv4 
interface defined.
 
Not really at the moment, it was more a stylistic thing. On the other hand the module is not yet fully tested, so when I'll do some serious testing I'll know if it's needed to be changed.


>
> BTW, if you're wondering the ghost layer is basically shrinking IP
> packet headers, as is, it's the 6LoWPAN layer. I was even thinking to
> add it to the IP stack as a decorator, but it's a bit an overkill... or
> not ?

I was thinking that 6LoWPAN could be instead supported by a single 
NetDevice that combined 802.15.4 mac and phy with the 802.2 LLC and 
convergence layers specific to 6LoWPAN. Does your 6LoWPAN layer have to 
be another NetDevice?
 
I don't like this solution, as 6LoWPAN is born for 802.15.4 but it's not really bound to it. Well, on 802.11 it works but it confuses a LOT the .pcap, but that's another issue and it's related on how the traces are parsed (Wireshark doesn't expect a 6LoWPAN header instead of the classical IPv4/v6).

The way it's done right now allows a bold experimenter to stick 6LoWPAN on almost anything, so it's way more flexible. Plus, as I said, the very same approach could be used for ROHC. In the future we could even think about an ancestor class dealing with sub-IP compressions.

Anyway, the stack is far from finished and, when it will be the time, I'll be happy to gather comments.

BTW, I'm pushing a private repo containing the code, for those interested.

Cheers,

Tommaso




More information about the Ns-developers mailing list