Renee: Robotic Wireless Network Emulator


Introduction

The goal of this project was to build an emulation and visualization tool which can display several robots in a network flow. We accomplished this by using EMANE, a tool used to simulate a network and Linux containers within the network. Each Linux container runs an instance of Robot to behave as a node in the network, which uses an instance of Graph to track the locations of other nodes in the network and calculate where the node should move to line up in its flow.

A video demo of Renee can be found in https://youtu.be/it0E_B7iWnM

Setup Instructions

  1. Download VirtualBox Manager and the CentOS EMANE Demo Virtual Machine from https://drive.google.com/file/d/0B5ViCEcBphtIMzhkRUpJR3Vab3c/view?usp=sharing
  2. Open VirtualBox Manager.
  3. Under the File Tab, select Import Appliance.
  4. Find where the EMANE Demo Virtual Machine is located on your computer and select it. It should appear in VirtualBox Manager.
  5. Start running the virtual machine. The credentials are:
    Username: emane
    Password: emanedemo
    

    If VirtualBox Manager gives you an error, follow the workaround below (adapted from: https://www.virtualbox.org/ticket/14469):

  6. Go to the the new EMANE VM (imported appliance)and click on the settings button
  7. Select Ports->USB tab
  8. Disable USB and hit save
  9. Return to the same place in the settings menu and check to make sure USB is enabled again
  10. Save and start the new EMANE VM

In the terminal, navigate to the folder Renee/1. Run the renee-start.sh script in the terminal to start the emulation (both the scripts and the GUI):

$ cd Renee/1
$ make
$ ./renee-start.sh

When you are ready to end the emulation, use the route-swarm-stop.sh command in the host terminal:

renee-stop.sh

Preliminary Setup:

  1. If you are not running Linux, download a Linux/Ubuntu 14.04/16.04 virtual machine
  2. Install git, enter the command: sudo apt-get install git
  3. To download Python 2.7, enter the command: sudo apt-get install python2.7 python-pip
  4. To download the networkx Python library, enter the command: pip install networkx
  5. Setup the sshd config properly:
    $ mkdir ~/.ssh
    $ chmod 700 ~/.ssh
    $ ssh-keygen -t rsa
    $ cd ~/.ssh
    $ cat id_rsa.pub  >> authorized_keys
    $ cd ~
    

Download and set up EMANE framework:

If the below instructions do not work, here are the links to where the directions are:

  1. https://github.com/adjacentlink/emane/wiki/Install
  2. https://github.com/adjacentlink/emane/wiki/Install#ubuntu-1404-lts-amd64
  3. https://github.com/adjacentlink/emane/wiki/Install#ubuntu-1604-lts-amd64

Directions:

  1. Install Necessary Packages:
    $ sudo apt-get update
    $ sudo apt-get install libcurl4-gnutls-dev librtmp-dev lxc bridge-utils mgen fping gpsd gpsd-clients iperf multitail olsrd openssh-server python-tk python-pmw python-lxml python-stdeb build-essential python-pycurl
    

    Or,

    $ sudo yum install lxc bridge-utils fping gpsd gpsd-clients iperf multitail openssh-server tkinter python-pmw python-lxml
    
  2. Type this into terminal: wget https://adjacentlink.com/downloads/emane/emane-1.0.1-release-1.ubuntu-14_04.amd64.tar.gz
  3. Then type:
    $ tar zxvf emane-1.0.1-release-1.ubuntu-14_04.amd64.tar.gz 
    $ cd emane-1.0.1-release-1/debs/ubuntu-14_04/amd64
    $ sudo dpkg -i *.deb
    $ sudo apt-get install -f
    $ cd ~
    
  4. Clone our code
    $ git clone git@github.com:ANRGUSC/Renee.git
    $ cd Renee/pynodestatviz
    $ make deb
    $ sudo dpkg -i deb_dist/pynodestatviz*.deb
    $ cd ../1
    $ make
    
  5. (demo only) To setup demo update your /etc/hosts file to include the following:
    10.99.0.1 node-1
    10.99.0.2 node-2
    10.99.0.3 node-3
    10.99.0.4 node-4
    10.99.0.5 node-5
    10.99.0.6 node-6
    10.99.0.7 node-7
    10.99.0.8 node-8
    10.99.0.9 node-9
    10.99.0.10 node-10
    10.99.0.100 node-server
    10.100.0.1 radio-1
    10.100.0.2 radio-2
    10.100.0.3 radio-3
    10.100.0.4 radio-4
    10.100.0.5 radio-5
    10.100.0.6 radio-6
    10.100.0.7 radio-7
    10.100.0.8 radio-8
    10.100.0.9 radio-9
    10.100.0.10 radio-10
    
To run the simulator:
  1. Enter command: ./renee-start.sh
  2. Wait about 30 seconds to observe activity in the GUI
  3. To Stop Enter command: ./renee-stop.sh

Note: In the First time, you might have to manually enter “Yes” in each of the opened xterm to enter the ssh key into known-hosts file.


Configuring Emulation

Initial Node Configuration:

All initial node data is to be put in swarm.cfg in the following format:

[src]
x = 40.031227
y = 74.523247
z = 1
fid = 001
[dst]
x = 40.031165
y = 74.523412
z = 1
fid = 001
[R#]
x = 40.031075
y = 74.523518
z = 1
rid = #
fid = 001

Note: you must have 1 [src] and 1 [dst], and 1 - 8 [R#] nodes where # is replaced with a number 1-8.

Next, open renee-start.sh. You will see the first 4 lines which set up EMANE, the GUI, and the LogCompiler. Lines 7-14 start up each node desired node container. Comment out the lines for nodes that you have not included in your swarm.cfg file.

Motion Controller Configuration:

To change the location that each node will move to, go into Robot.py and in the commController function, change the value of newLoc to be the new location you would like to move in the direction of.

Pathloss Configuration:

See Pathloss & The Physical Layer Model for configuration instructions.


Class Definitions:

ROBOT

  1. The Robot class identifies a Robot instance with an id, its current location, its current flow and a private instance of network graph.
  2. It instantiates itself with the help of config files robot.cfg, flow.cfg and location.cfg.
  3. It creates 4 parallel threads a. Swarm - Update network graph based on information of all Robots b. Communication - Send my current info (rid, location, fid) to communication subsystem (send-command.cfg) c. Motion - Calculate the required motion for me based on other robots in flow PATH and send this new location to motion subsystem (motion-command.cfg) d. Location - update the current location (as it might have changed after motion)
  4. Additionally, it contains list of all robots as a global object

HOST

  1. The Host class identifies a Host (end-point) with id and location

FLOW

  1. The Flow class identifies a Flow with id, source host, destination host and set of robots serving the flow.

LOCATION

  1. The Location class identifies a Location with x, y and z.
  2. It has APIs to calculate centroid of robots and distance between two locations

GRAPH

  1. The Graph class identifies the network graph containing robots and hosts as nodes and distance as weigted edges
  2. It currently provides shortestPath

HELPER

  1. Provides API to read and write config files

Class Diagrams

Robot

The Robot class is an instance of a node in a flow configuration. It opens a socket to send and receive broadcast messages from other nodes in the network. Each message is tagged with an id number, and Robot stores a set of message ids it’s already sent before deciding whether or not to rebroadcast incoming messages to other nodes.​ ​ The Robot class also has a Graph instance which is used to calculate its future location. Each Robot instance is run on a separate Linux container in EMANE.

Attributes:

Functions:

Graph

The Graph class utilizes the networkx library to create an undirected graph configuration of all the nodes in a particular flow. Each instance of Robot contains an instance of Graph in order to track other Robots’ locations and find the closest neighbors with which to compute the centroid. The Graph is updated with each location update received from broadcast messages.

Attributes:

Functions:

LogCompiler

LogCompiler opens a socket and receives input from all nodes within a network. Whenever a node sends updates about their position, LogCompiler writes the information to scenario.eel. EMANE then reads from scenario.eel to get the position of all nodes on the networks and display those locations in the EMANE GUI. It also rebroadcasts messages it receives from the other nodes in the network to implement flooding while controlling the number of times a message is forwarded through the network. LogCompiler does not generate any original messages of its own. Each message is tagged with an id number, and LogCompiler stores a set of message ids it’s already sent before deciding whether or not to forward incoming messages.

Attributes:

Functions:


Flow Diagram

alt text


Component Diagrams

alt text


Sequence Diagrams

alt text


Class/Method Descriptions

Graph.py

This class is used to handle all location calculations. Each node will run Robot.py, each containing an instance of the Graph class. As each Robot receives location data from all other Robots in its network, their locations will be updated in the graph, and used to calculate this Robot’s next location, which it will then broadcast out to all other Robots in the network. Location calculations utilize the following functions:

Robot.py

This class acts as an instance of a robot. Each Robot belongs to both a flow and the overall network graph. It also has two sockets to send and receive location data from other Robot instances in the graph. The networking code from CoordinateSender.py has been integrated into the Robot code. Based on the locations of other Robot instances, it will update its own graph of robots’ information and its own position if needed.

ReneeScript.sh

Shell script that will start the emulator. It starts EMANE, opens the GUI, and starts the LogCompiler (which writes location coordinates to the scenario.eel file which the GUI will read from), and then opens up a terminal for each node (number must be hard-coded prior runtime), sshs into a particular node IP on each terminal, and then and runs an instance of Robot on each.


GUI Components

The left side of the olsrlinkview GUI displays the nodes and their relative positions to each other. Each labelled square in the olsrlinkview GUI represents a node in the network. Links between nodes are displayed as colored lines. The right side of the GUI displays a table with each of the nodes’ longitude and latitude positions which change as reflected in the scenario.eel file.

Pathloss & The Physical Layer Model

Information compiled from AdjacentLink Documentation: https://github.com/adjacentlink/emane/wiki/Physical-Layer-Model

Pathloss:

For each received packet, the physical layer computes the receiver power associated with that packet, and if the rxPower is less than the rxSensitivity, the packet is silenty discarded:

rxPower = txPower + txAntennaGain + rxAntennaGain − pathloss
rxSensitivity = −174 + noiseFigure + 10log(bandWidth)

Configuration:

Physical Layer Model configurations are made in rfpipenem.xml, in between the tags.

Sample configuration (in rfpipenem.xml):

<nem>
    <transport definition="transvirtual.xml"/>
    <mac definition="rfpipemac.xml"/>
    <phy>
        <param name="fixedantennagain"          value="0.0"/>
        <param name="fixedantennagainenable"    value="on"/>
        <param name="bandwidth"                 value="10M"/>
        <param name="noisemode"                 value="outofband"/>
        <param name="propagationmodel"          value="freespace"/>
        <param name="systemnoisefigure"         value="4.0"/>
        <param name="txpower"                   value="0.0"/>
        <param name="subid"                     value="1"/>
    </phy>
</nem>

Configuration Parameters:

bandwidth

Defines receiver bandwidth in Hz and also serves as the default bandwidth for OTA transmissions when not provided by the MAC.

fixedantennagain

Defines the antenna gain in dBi and is valid only when fixedantennagainenable is enabled.

fixedantennagainenable

Defines whether fixed antenna gain is used or whether antenna profiles are in use.

frequency

Defines the default transmit center frequency in Hz when not provided by the MAC.

frequencyofinterest

Defines a set of center frequencies in Hz that are monitored for reception as either in-band or out-of-band.

noisebinsize

Defines the noise bin size in microseconds and translates into timing accuracy associated with aligning the start and end of reception times of multiple packets for modeling of interference effects.

noisemaxclampenable

Defines whether segment offset, segment duration and message propagation associated with a received packet will be clamped to their respective maximums defined by noisemaxsegmentoffset, noisemaxsegmentduration and noisemaxmessagepropagation. When disabled, any packet with an above max value will be dropped.

noisemaxmessagepropagation

Noise maximum message propagation in microseconds.

noisemaxsegmentduration

Noise maximum segment duration in microseconds.

noisemaxsegmentoffset

Noise maximum segment offset in microseconds.

noisemode

Defines the noise processing mode of operation: none, all or outofband.

propagationmodel

Defines the pathloss mode of operation: precomputed, 2ray or freespace.

subid

Defines the emulator PHY subid used by multiple NEM definitions. Once instantiated, these NEMs may be using the same frequency. In order to differentiate between emulator PHY instances for different waveforms, the subid is used as part of the unique waveform identifying tuple: PHY Layer Registration Id, emulator PHY subid and packet center frequency.

systemnoisefigure

Defines the system noise figure in dB and is used to determine the receiver sensitivity.

timesyncthreshold

Defines the time sync detection threshold in microseconds. If a received OTA message is more than this threshold, the message reception time will be used as the source transmission time instead of the time contained in the Common PHY Header. This allows the emulator to be used across distributed nodes without time sync.

txpower

Defines the transmit power in dBm.