IDIT SDN Installation Guide
IDIT SDN Installation Guide
IDIT SDN Installation Guide
Contents
1 Introduction 2
2 Requirements 3
2.1 Obtain Contiki OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Obtain IDIT-SDN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Obtain the GCC toolchain for MSP430 . . . . . . . . . . . . . . . . . . . 3
2.4 Obtain Qt framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 IDIT-SDNcompilation 5
3.1 Compile enabled-nodes and controller-node . . . . . . . . . . . . . . . . 5
3.2 Compile controller-pc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Simulating IDIT-SDN 7
4.1 Running controller-pc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Starting Cooja . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.3 Connecting controller-pc to controller-node . . . . . . . . . . . . . . . . 7
4.4 Running Cooja Simulation using GUI . . . . . . . . . . . . . . . . . . . 7
4.5 Simulation using script (no GUI) . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction
IDIT-SDN is an intrusion detection framework for Software Defined Wireless Sensor Net-
work (SDWSN). This tool is completely open and freely available, designed to be inde-
pendent of the operating system and its functions. Although, it is currently implemented
on IT-SDN v 0.41 [Alves et al. 2019, Alves et al. 2017]
IT-SDN comprises SDN-enabled WSN nodes developed under Contiki OS
[Dunkels et al. 2004]. We provide sample code for data generating nodes (named
enabled-nodes throughout the document) and sink-nodes. The controller is developed
in C and C++ with Qt (we call this software controller-pc). The controller-pc software
must connect to a WSN node for communicating with the other nodes in the network. The
node programmed with the interfacing software is called controller-node.
In order to compile and run IDIT-SDN nodes and controller, you need to follow
these steps (described in the next sections):
2. Obtain Contiki OS;
3. Obtain IDIT-SDN;
4. Obtain the GCC toolchain for MSP430;
5. Obtain Qt framework;
6. IDIT-SDNcompilation;
7. Simulating IDIT-SDN;
2
2. Requirements
2.1. Obtain Contiki OS
Download Contiki release 3.0 available at https://github.com/contiki-os/
contiki/releases/tag/3.0
After downloading, place the contiki directory in the home folder
/home/USERNAME.
Alternatively, you can get Contiki release 3.0 in the command line, as follows:
$ cd /home/USERNAME
$ wget https://github.com/contiki-os/contiki/archive/3.0.zip
$ unzip 3.0.zip
To test if download and extraction succeeded, run the command ant run on
folder /home/USERNAME/contiki-3.0/tools/cooja:
~/contiki-3.0/tools/cooja$ ant run
If everything was installed correctly, it will start with a blue empty window (Cooja:
The Contiki Network Simulator) as shown in Figure 1.
You can get more information about Cooja at https://github.com/
contiki-os/contiki/wiki/An-Introduction-to-Cooja.
3
Figure 1. Cooja execution interface.
ContikiOS.
4
Figure 2. Qt Creator opened.
3. IDIT-SDNcompilation
In the next sections, we describe how to compile and execute IDIT-SDN.
The compilation script is located in the applications directory. Please, verify the
script has the appropriate permission to execute.
$ cd ~/idit-sdn/applications/
$ ./compile.sh
By default, the script compiles the code for the sky mote (TelosB mote). How-
ever, the target platform can be changed by typing its name as script parameter of the
compile.sh file. Example:
$ ./compile.sh PLATFORM
If compilation succeeded, you will see the size of the three firmwares (enabled-
node, sink-node and controller-node), as shown in Figure 3.
5
Figure 3. Compiling enabled-node, sink-node and controller-node.
CONTIKI=/home/USERNAME/contiki-3.0
You will see the Configure Project window, such as the one depicted in Figure 4).
Then, click on [Configure Project].
Now you are ready to compile the controller-pc. Click on menu Build→Build All.
6
4. Simulating IDIT-SDN
4.1. Running controller-pc
After compiling, click on menu Build→Run on Qt Creator to run controller-pc. You will
see the controller-pc window as shown in Figure 5.
After Cooja opened, go to the File menu and click Open simulation →
Browse. . . Navigate to /home/USERNAME/idit-sdn/simulation/ and open file
ITSDN_n36_s1_a1_3_GRID.csc, as shown in Figure 6 and Figure 6.
7
Figure 6. Opening Cooja simulation.
8
Figure 8. Connecting the controller-pc to controller-node.
Using-Cooja-Test-Scripts-to-Automate-Simulations
The script we provide is named as run_simulations.sh and
it is located in the folder /home/USERNAME/idit-sdn/simulation.
Before using the script, you should check the paths in the file
/home/USERNAME/idit-sdn/path_simulation.sh and set them accord-
ing to your user paths.
Then, you should create a copy of Contiki’s folder but changing its name to
contiki-3.01. If you want to run more than one simulation in parallel, you should
9
create as many copies of Contiki’s folder as simulations you want. For example, if you
want to run three simulations in parallel, you should have something such as shown in
Figure 10.
The parameters MIN_ITER and MAX_ITER defines the number of the first and
the last simulation. If you want 10 replications, you should set them as MIN_ITER=1
and MAX_ITER=10. Then, the parameter COOJA_INSTANCES defines the number of
simulations in parallel.
The parameters nodes_v and topologies defines the number of nodes and
the topology variation. For the examples we provide, the number of nodes is 36 and
there are two topologies: a1_1 and a1_3. However, you can create new simulations
environments (.csc files) following the same nomenclature and use this script without
changes. The parameter SIM_TIME_MS defines the simulation time in milliseconds.
The parameters in the script should look like shown in Figure 11.
The script will compile IT-SDN and controller server code, do the connection with
Cooja and start the simulation. If everything went well, you should see somehting like
shown in Figure 12.
The logs will be in in the folder /home/USERNAME/idit-sdn/simulation/results,
such as shown in Figure 13.
10
Figure 12. Simulation script parameters
References
Alves, R. C. A., Oliveira, D., Segura, G. N., and Margi, C. B. (2017). IT-SDN: Improved
architecture for SDWSN. In XXXV Simpósio Brasileiro de Redes de Computadores.
Available at https://sites.google.com/usp.br/cintia/it-sdn.
Alves, R. C. A., Oliveira, D. A. G., Nunez Segura, G. A., and Margi, C. B. (2019). The
Cost of Software-Defining Things: A Scalability Study of Software-Defined Sensor
Networks. IEEE Access, 7:115093–115108.
Dunkels, A., Gronvall, B., and Voigt, T. (2004). Contiki - a lightweight and flexible
operating system for tiny networked sensors. In LCN ’04: Proceedings of the 29th
Annual IEEE International Conference on Local Computer Networks, pages 455–462,
Washington, DC, USA. IEEE Computer Society.
11