[Ns-developers] How to tap an NetDevice into another one ?
Lalith Suresh
suresh.lalith at gmail.com
Wed Nov 16 15:51:27 PST 2011
Hi Tommaso,
On Thu, Nov 17, 2011 at 12:20 AM, Tommaso Pecorella <tpecorella at mac.com> 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 ?
>
> 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 would go for the approach used to insert a shim between layer 4 and
layer 3 using the Ipv4L4Protocol::SetDownTarget() method. In your
case, you'll need to refactor Ipv4L3Protocol a bit to use a
"DownTargetCallback", have your ghost layer set this callback to say
GhostLayer::Send() which can do the IP header compression and follow
on from there.
Does that work for you?
> Cheers,
>
> Tommaso
>
>
>
> Tommaso Pecorella - Ph.D.
>
> Assistant professor
> Dpt. Elettronica e Telecomunicazioni
> Università di Firenze
>
> CNIT - Università di Firenze Unit
>
> via di S. Marta 3
> 50139, Firenze
> ITALY
>
> email: tommaso.pecorella at unifi.it
> tommaso.pecorella at cnit.it
>
> phone : +39-055-4796412
> mobile: +39-320-4379803
> fax : +39-055-494569
>
--
Lalith Suresh
www.lalith.in
More information about the Ns-developers
mailing list