Skip to content

Virtual riot network

sgso edited this page May 5, 2014 · 9 revisions

RIOT features the native port with networking support. This allows you to run any RIOT application on your Linux or Mac computer and setup a virtual connection between these processes. In order to do this, the nativenet module uses TAP devices (https://www.kernel.org/doc/Documentation/networking/tuntap.txt) and provides a simple script to configure an Ethernet bridge connecting these devices.

For the virtualization of the DES-Testbed we developed a Python framework called desvirt (Virtualizing a testbed). Desvirt allows to setup a virtual network, by starting qemu instances, connect them over TAP devices, and implementing the packet loss rates between the interfaces with ebtables and tc.

Desvirt also supports RIOT nativenet. You can use the topology_generator to define a virtual network. For example:

./topology_creator -e /tmp/default-native.elf -n riot_native -r ieee802154 -s2 -tline -l50 -f .desvirt/line2

will create an XML configuration file, for a very basic network, containing two connected RIOT native instances and 50% packet loss. Copy the resulting XML file to .desvirt/, read in the configuration by running

./vnet -n line2 -d

and start the network:

./vnet -n line2 -s

Limitations:

Linux

There is a hard limit of 1024 interfaces per bridge in Linux at the moment. If you need more instances in one network you will have to modify and recompile your kernel. Compare https://github.com/dotcloud/docker/issues/1320#issuecomment-22346764 .

On the bright side, 1000 instances only need 200MB of RAM (examples/default with ltc disabled) and about no CPU (while they're not doing anything), so at least the trouble pays off.

desvirt

Due to a bug in desvirt, it is not possible to define grid networks with more than 26 nodes per line. Compare https://github.com/des-testbed/desvirt/issues/10 .

Clone this wiki locally