-
Notifications
You must be signed in to change notification settings - Fork 2k
Virtual riot network
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 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 [4][5].
I've now modified the desvirt framework to use it with 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
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 [6] 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).
[4] http://ebtables.sourceforge.net/ [5] http://tldp.org/HOWTO/Traffic-Control-HOWTO/software.html#s-iproute2 [6] http://tmux.sourceforge.net/