[riot-devel] Raw communication between native nodes

Alexander Aring aar at pengutronix.de
Wed Jun 22 21:19:33 CEST 2016


Hi,

On 06/22/2016 05:28 PM, Jose Alamos wrote:
> Hi,
> 
> I was wondering if there's a way to send raw data between nodes running on
> native. I need to send OpenThread packets between nodes (through a radio
> abstraction), and I'm having problems with TAP interface since they only
> process ethernet frames.
> 
> I tried to hack a little bit (put these OT packets in ethernet frames) but
> is not working well. Basically, I need to emulate a radio device.
> 
> Is there an easy way to achieve this?
> 

some of you maybe knowing that I am working on a RIOT native 802154raw
transceiver driver which works with AF_PACKET RAW linux-wpan interfaces.

At the end it should work like the following:

First I need to describe a special virtual 802.15.4 driver, it's named
fakelb (maybe such idea can also be implemented in RIOT).

It works similar like the hwsim80211 driver in linux (but less
functionality, I also was thinking to make a better implementation of
fakelb and name it hwsim802154).

With such driver you can create "virtual phy's" in Linux.

E.g. 2 phy's,


          6LoWPAN/etc               6LoWPAN/etc
               |                         |
      wpan node interface      wpan node interface
               |                         |
           mac802154                 mac802154
               |                         |
           wpan-phy0 <--L1(memcpy)--> wpan-phy1

Descrption:
  - mac820154: Our 802154 SoftMAC stack
  - 6LoWPAN/etc: upper layer IPv6, foo stack
  - wpan node interface: a wpan node interface which does filtering

Now with a 802154raw native RIOT driver the following would be possible:


   RIOT native (Userspace)
     AF_PACKET RAW
           |                    6LoWPAN/etc               6LoWPAN/etc
           |                        |                         |
  wpan monitor interface      wpan node interface      wpan node interface
           |                        |                         |
           |                    mac802154                 mac802154
           |                        |                         |
       wpan-phy2 <-L1(memcpy)-> wpan-phy0 <--L1(memcpy)--> wpan-phy1

In this setup you can ping from Linux IPv6 stack the RIOT Stack which
running in userspace.

I think your use case would be look like the following which is also
be possible:

   RIOT native (Userspace)   OpenThread native (Userspace)
     AF_PACKET RAW                  AF_PACKET RAW
           |                             |
           |                             |
  wpan monitor interface         wpan monitor interface
           |                             |
           |                             |
           |                             |
       wpan-phy0 <----L1(memcpy)----> wpan-phy1

Then you could connect RIOT native with openthread native over the
fakelb driver (maybe also add Linux nodes or more RIOT/OpenThread
nodes).

I know somebody is working for adding such virtual driver in OpenThread,
but I think they want to use real hardware for that (which I don't
recommend). This is just for stack testing, there exists unsolved issues
with ACK handling etc and you really don't want to bypass the great
Linux IPv6 Stack :-).

I cc the guy/girl which wants to add this stuff to OpenThread.

- Alex


More information about the devel mailing list