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:
- 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.
- 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.
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