Table Of Contents

Previous topic

3. HowTo List

Next topic

3.2. How to control basic operations with Java

This Page

3.1. How to set an experiment with MAGI

3.1.1. Initial Setup

  1. Begin a new experiment and load the ns file that defines the network topology. Simple ns file modifications are required to support loading the MAGI backend on each node:

    1. Create an additional unconnected node in the experiment called ‘control’ to gather and display statistics and act as the interface for the remote GUI client.
    2. Run the python script /share/magi/v08/magi_bootstrap.py as root on each node at startup.
tb-set-node-startcmd $node "sudo python /share/magi/v08/magi_bootstrap.py"

Note

On Windows images, you should not use sudo in the command.

  1. Connect a graphical interface (original GUI, ELM) to the control node.

3.1.2. Example: A Small DoS Experiment

First, setup a 4 node toplogy, with two attackers, a victim, and a intermediate router. Listed below is the ns file with the MAGI support.

set ns [new Simulator]
source tb_compat.tcl
#Create the topology nodes
foreach node { V R A1 A2 control } {

   #Create new node
   set $node [$ns node]

   #Define the OS image
   tb-set-node-os [set $node] Ubuntu1004-STD

   #Have MAGI install itself and startup when the node is ready
   tb-set-node-startcmd [set $node] "sudo python /share/magi/v08/magi_bootstrap.py"
}

#Create the topology links
set linkRV [$ns duplex-link $V $R 100Mb 3ms DropTail]
set linkRA1 [$ns duplex-link $R $A1 50Mb 3ms DropTail]
set linkRA2 [$ns duplex-link $R $A2 50Mb 3ms DropTail]
$ns rtproto Static
$ns run

Next, swap the experiment in