CSE247 on YouTube

Installing Castalia in Omnet++ with Video Tutorial

Use of Castalia simulator -Wireless Sensor Networks and Body Area Networks.


For this, I assume you have installed Omnet++ (version 4.6) and Castalia (version 3.3) in Linux (Ubuntu). If not you can download and install from the link below:

Omnet++ (version 4.6) 

Castalia (version 3.3)

Installation Guide for Omnet++

Before starting the installation, refresh the database of available packages. Type in the terminal:

$ sudo -i

$ sudo apt-get update

To install the required packages, type in the terminal:

$ sudo apt-get install build-essential gcc g++ bison flex perl \python python3 qt5-default libqt5opengl5-dev tcl-dev tk-dev \libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-1.0 openscenegraph-plugin-osgearth libosgearth-dev openmpi-bin libopenmpi-dev libpcap-dev gnome-color-chooser nemiver

open a new terminal

$ sudo -i

reach the download section using the command cd

$ cd Downloads

unzip the omnet downloaded file in Download Section

$ cd omnetpp-4.6

$ . setenv
*space between . and setenv

$ pwd
** Now copy the path which is /home/user/Downloads/omnetpp-4.6
*** here user is your pc name

$ gedit ~/.bashrc

Add the following line at the end of the file, then save it:

export PATH=$PATH:/home/user/Downloads/omnetpp-4.6/bin
export PATH=$PATH:/home/user/Downloads/omnetpp-4.6/lib

**now closed the current terminal which is very important


open a new terminal

$ sudo -i

reach the download section using the command cd

$ cd Downloads

$ cd omnetpp-4.6

$ ./configure

$ make

Now omnet is installed in your system.

Coming back to question- How to install Castalia in omnet?

Installation Guide for Castalia++

open a new terminal

$ sudo -i

reach the download section using the command cd

$ cd Downloads

$ cd Castalia

$ ./makemake

$ make

Now Castalia is installed in your system

Next is to RUN your Omnet++ IDE and do as follows:

  1. Create new empty Omnet++ Project:
    • File -> New -> Omnet++ Project.
    • Choose a project name (Eg: “castalia”) and click next.
    • Select Empty project and click Finish
  2. Import the Castalia files:
    • Right click on the new Omnet++ project (“castalia”) and select Import
    • Select General -> File System. Then click Next
    • Click Browse and search for your Castalia-3.3 directory (Root directory of the one you have downloaded and extracted) and click OK
    • Click on “Select All” button and then Finish.
  3. You should now see the directory hierarchy under the project “castalia”
  4. Changing NED source folders:
    • Right click the project (“castalia”) -> Properties.
    • In the window that opens, expand OMNeT++ on the left side menu, and select “NED Source Folders”.
    • Expand the project name and mark “Simulations” and “src” directories as NED Source Folders. Click OK.
  5. Edit the NED files in project folder(“castalia”) in main IDE:
    • Navigate into the project (“castalia”) -> src
    • Open SensorNetwork.ned file and select the “source” tab
    • Add “.*” to the three import lines. You should end up with something like this: import wirelessChannel.*; import physicalProcess.*; import node.*;
    • Save the file
    • Now open src -> node -> Node.ned file and go to source tab
    • Add “.*” at the end of the import mobility manager line. You’ll end up with this: import node.mobilityManager.*;
    • Save the file.

Now you are done and should not see any errors. You can test it by running simulations under the Simulation folder.

No comments:

Powered by Blogger.