Skip to content

Virtual riot network

LudwigOrtmann edited this page Oct 2, 2013 · 5 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 now 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

This will start a new tmux session with two windows, each containing one RIOT native process. You can interact with the RIOT processes by attaching the tmux session (tmux attach-session).

Clone this wiki locally