connect to RIOT native instances through local UDP ports
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
marz.config
marz.py
riot.py
setup.sh
sixlowpan.patch

README.md

marz

This allows any process to communicate with RIOT nativenet nodes on TAP interfaces through local ports. This is not a border router but may help you in simple use cases.

Installation & Dependencies

Marz depends on a patched development version of scapy. setup.sh will download the right version and apply the necessary patches automatically. It also depends on Twisted (including Twisted-pairs) and bidict. You can get these with pip:

pip install --user Twisted
pip install --user bidict

Usage

Marz reads the config file marz.config in the current directory.

[marz]
interface=tap0
hwaddr=256
panid=43981

It is preconfigured to use the IEEE 802.15.4 hardware address 0x100 and listen to the tap0 interface (which you have to create beforehand and should be bridged to at least one RIOT nativenet instance). It will receive and send frames with the configured panid value (these are decimal values).

[UDP6:5683]
recipient=1
port=5683

This opens the local port UDP6 port 5683 and will relay every packet received to hardware address 1 on the same port.

Marz generates its own IP address by using ff02::1:0:ff00: + hwaddr, so the default address is ff02::1:0:ff00:100. Recipient addresses are generated by fe80::ff:fe00: + recipient.

SixLoWPAN fragmentation only works one-way (from the outside to RIOT).

Example

This section will walk you through setting up one RIOT native instance, hooking it to marz and prodding it with netcat. You will need three terminal windows for this.

Terminal 1

First, you will need to set up the tapbridge connecting marz and your RIOT instance. In your RIOT directury, run

./cpu/native/tapsetup.sh create 2

Then, start your RIOT application. Make sure to run it on tap1, since marz will be running on tap0. This should look something like this:

sudo ./bin/native/my-app.elf tap1

You need to find out the hardware ID of your RIOT application. If your application has a shell, you can use the addr command to do this:

addr
[transceiver] got address: 8960

Now, set the recipient fields of your marz.config to the address your RIOT application just told you.

Terminal 2

Now, in your marz directory, run

pip install --user Twisted
pip install --user bidict
./setup.sh

to install and patch everything you need to run marz.
To start marz, run

./marz.py

Terminal 3

Now it's time to send packets to your RIOT ecosystem. Execute

echo "foo" | nc -6u ::1 5683

Terminal 2 should now display something like this: make new connection [UDP6 5683] Received 4 data bytes from ('::1', 56218): Relaying through 56218 to RiotEndpoint(hwaddr=5367, ipv6='fe80::ff:fe00:14f7', port=5683)

Terminal 1's exact output depends on the application's implementation, but there should be something along the lines of

> Received packet: 66 6F 6F 0A

To show that our packet has arrived.