LEPTON   Documentation Download Videos About

How to run LEPTON with DodwanDroid (on Android devices)

Preamble

lepton-with-smartphones.svg

LEPTON can orchestrate communications between Android devices running DodwanDroid, thus simulating the mobility of these devices. This mode of operation can be useful during demo sessions, as each participant can use DodwanDroid on a smartphone or tablet, while a display screen shows how LEPTON simulates the mobility of all devices involved in the demo, and thus allows or prevents radio contacts between these devices.

Requirements

Running LEPTON with DodwanDroid: a short tutorial

Before starting LEPTON, please note down the IP address of the workstation or laptop it will run on. This address will be required to configure DodwanDroid on the Android devices.

Starting LEPTON

When starting LEPTON a reference to DoDWAN's adapter must be provided, so LEPTON knows how to process the traffic it will receive from the Android devices. This is obtained by defining argument oppnet_adapter when starting LEPTON:

lepton.sh start oppnet_adapter=${DODWAN_ADAPTER_HOME}/bin/adapter.sh \
                nodes=0

In this example, LEPTON is started with argument nodes=0, which means that LEPTON will not attempt to create virtual nodes at startup. Instead it will simply wait to receive beacons from real devices, thus discovering these devices at runtime.

Starting DodwanDroid on a smarpthone or tablet

Before starting DodwanDroid on an Android device, make sure this device is connected to the Wi-Fi access point, and thus belongs to the same LAN as the host running LEPTON.

Also make sure that the clock of the device is set correctly. This is important for DodwanDroid to run as expected.

When starting DodwanDroid for the first time, you will be asked to enter a pseudo. This pseudo should be unique.

DodwanDroid supports several modes of operation. In "Direct mode" Android devices interact directly with one another, using UDP multicast for neighbor discovery, and TCP unicast for peer-to-peer interaction. In "Hub mode", all traffic is sent to --and received from-- a software hub. This is the mode we need for DodwanDroid to run with LEPTON: all traffic must be controlled by LEPTON's hub.

By default DodwanDroid runs in "Direct mode". In order to switch to "Hub mode", click on tab "More" on the screen, then enter the "Settings" menu, and then the "DoDWAN Network Config" submenu. You should see that the Network mode is presently set to "direct". Change this mode to "hub", and replace the IP address registered under "Hub/Remote address" by the address of the host running LEPTON.
These changes will be effective as soon as you leave the "Settings" sub-menu.

What happens on the display screen?

As soon as LEPTON starts receiving beacons from Android devices, you should see blips appear on the screen. Each blip is labeled with the corresponding device's id (in DodwanDroid you can find this id at the bottom of the "Settings" sub-menu).

If you'd like the displayed labels to be more user-friendly, you can create a file containing a list of nodeid=label pairs, and use this file when starting LEPTON:

cat << EOF > labels.txt
# nodeid=label
TA3956AW=Alice
BI4698FA=Bob
EOF

lepton.sh stop
lepton.sh start oppnet_adapter=${DODWAN_ADAPTER_HOME}/bin/adapter.sh \
          nodes=0 node_labels=labels.txt

Running LEPTON in "manual mode"

By default LEPTON simulates the mobility of nodes according to the Levy Walk mobility pattern. During a demo session it may sometimes be more convenient to control the connectivity between nodes manually:

lepton.sh stop
lepton.sh start oppnet_adapter=${DODWAN_ADAPTER_HOME}/bin/adapter.sh \
          nodes=0 node_labels=labels.txt manual=true

With argument manual=true, no mobility pattern is applied to move the nodes discovered at runtime. Instead LEPTON applies an "auto-layout" pattern, which means that it tries to distribute the nodes evenly in the window. In that case the distance between nodes in the window has no incidence on their being connected or not: you are the one who can decide which pairs of nodes should be connected or disconnected.

To connect two nodes together, first select the edge editing option (button in the bottom-right side of the window). Then select a node, and with a drag-and-drop action, connect this node to another node. A blue vertex should appear to show that these nodes are now connected. This vertex will turn red as soon as the nodes have discovered one another, and have reacted accordingly by establishing a TCP connection.

To disconnect two nodes, select the edge between these nodes and press the delete key on your keyboard.

Stopping LEPTON

Do not forget to stop LEPTON after your demo session.

lepton.sh stop