Wednesday, October 28, 2015

Easy step by step procedure for beginners in NS-3.24 installation in UBUNTU 12.04 LTS or UBUNTU 14.04LTS

Easy step by step procedure for beginners in NS-3.24 installation in UBUNTU 12.04 LTS or UBUNTU 14.04LTS

D.VINAYAGAM M.Tech

vinotd@gmail.com

+918681954006

NS3 Installation in Ubuntu 12.04 version

Ubuntu 2012(12) april(04) RELEASE


Installation of Dependencies


vina@ubuntu:~/workspace/bake$ sudo apt-get update

vina@ubuntu:~/workspace$ sudo apt-get install gcc g++ python python-dev qt4-dev-tools mercurial bzr cmake libc6-dev g++-multilib gdb valgrind gsl-bin libgsl0-dev libgsl0ldbl flex bison libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev uncrustify python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev

vina@ubuntu:~/workspace$ sudo apt-get install vtun lxc bridge-utils uml-utilities

vina@ubuntu:~/workspace$ sudo apt-get install doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra python-sphinx dia

vina@ubuntu:~/workspace$ sudo apt-get install python-pygccxml

vina@ubuntu:~/workspace$ sudo apt-get install libxml2-dev

vina@ubuntu:~/workspace$ sudo apt-get install python-setuptools

vina@ubuntu:~/workspace$ sudo apt-get install gnuplot plotdrop

vina@ubuntu:~/workspace$ sudo apt-get install wireshark

----------------------------------------end package updation------------------------------------
know your location/directory at present
vina@ubuntu$ pwd

make a directory
vina@ubuntu$ mkdir workspace

download ns-3 package
vina@ubuntu:~/workspace$ sudo apt-get install wget
vina@ubuntu:~/workspace$ wget http://www.nsnam.org/release/ns-allinone-3.23.tar.bz2


unrar the ns-3-allinone package
vina@ubuntu:~/workspace$ tar -xvjf ns-allinone-3.24.tar.bz2
vina@ubuntu:~/workspace$ cd ns-allinone-3.24/

Compilation, installation, building
vina@ubuntu:~/workspace$ chmod +x build.py
vina@ubuntu:~/workspace$ ./build.py --enable-examples --enable-tests

vina@ubuntu:~/workspace$ cd ns-3.24/
vina@ubuntu:~/workspace$ ./waf --enable-examples --enable-tests configure
vina@ubuntu:~/workspace$ ./waf

run command the file
vina@ubuntu:~/workspace$ ./waf --run scratch/scratch-simulator
vina@ubuntu:~/workspace$ ./waf --run scratch/first


------------------------------------------------------------------------------------------------------
If anyone require workshop (hand on training for beginners) can contact me for further details and i had mentioned the details below (contact no. and email id)
-------------------------------------------------------------------------------------------------------

Aim : to promote the research in NS-3 open source simulation software with free GPL license) with Advanced features to visualize, trace the logging, animate the networks virtually and emulate the test network in NS-3 before hardware implementation. 

Objective : Providing Practical and Theoretical training related to NS-3 simulator.

Content: 

Introduction of use of NS-3 simulator and features

NS-3 Installation, 
Bake installation with all modules & development package for research
Tarball installation with all modules 

Basic programming console (python and C++), how to use the simulator,

Develop the NS-3 code with explanation from basic step

Basic programs execution (build, compile, run) in NS-3

Simulate all wireless scenarios and also examples programs for easy understanding  

Verifying and tracing output using real world software (graphically, visually, Animated, logging).

optional : Basic procedures for including modules, 
Adding protocols/modules in specific, testing the protocol.

Requirements for Ns-3 installation

1. Vmware version 9 or Version 8 or higher with ubuntu 12.04 Operating system.

Specification in ubuntu 12.04 installation:

  • (20GB HDD for comfortable usage os ubuntu in future use)

  • (miminum 1.5GB ram guest OS (ubuntu 12.-04) allocated out 3GB ram mother OS(windows10 or 8 or 7)

2. INTERNET facilities with interruption or minimum 512kps link

or

1. Dual OS ubuntu 12.04 (updated)

(40GB HDD and minimum 2GB ram)

2. Internet connection for 2 to 6 hours

Requirements for Ns-3 installation

1. Vmware version 9 or Version 8 or higher with ubuntu 12.04 Operating system.

Specification in ubuntu 12.04 installation:

  • (20GB HDD for comfortable usage os ubuntu in future use)

  • (miminum 1.5GB ram guest OS (ubuntu 12.-04) allocated out 3GB ram mother OS(windows10 or 8 or 7)

2. INTERNET facilities with interruption or minimum 512kps link

or

1. Dual OS ubuntu 12.04 (updated) (40GB HDD and minimum 2GB ram)

2. Internet connection for 2 to 6 hours

Documents and ubuntu 12.04 module Given to students:

A VMWARE Module (ubuntu.vmx) with Ns-2.34-allinone package preinstalled in ubuntu 12.04 LTS

A VMWARE Module (ubuntu.vmx) with Ns-2.34-allinone & Ns-3-development (NS 2.24 package late 2015 release) package preinstalled in ubuntu 12.04 lts

Benefits: NS-3 workshop Manuals (Installation, NS-3 programs with output simulation, and prequites for Ns-3 Softwares installation will be provided.





Contact: Vinotd@gmail.com                                       Contact no.   +918681954006
Location: Pondicherry

Classes will be handled in their colleges (located within India)
Give the details of college/institutions for conducting the workshop.
Minimum 1 day for hand on training for full  NS-3 installation.

installing ns3.16 in opensuse 12 using vmware

Install and configure Eclipse IDE on ns-3

In this article, I want to review my video about install and configure Eclipse for ns-3.
In articles install ns-3 on OpenSuse Part 1, Part 2 and Part 3, we sow that how we can install ns-3. So I already have installed ns-3.17 on OpenSuse 12.2.

You can find my videos about installing ns-3 on OpenSuse Linux in: 
Part1: Install OpenSuse 12.2 On VM-Ware
Part2: Install Pre-requirements Package for ns-3 (ns3.16)
Part3: Install ns-3 and Run Example (ns-3.16)
And now we want to install and configure Eclipse IDE on ns-3.



Please notice that I installed ns-3.17 on OpenSuse Linux from ns-allinone-3.17.tar.bz2 in Documentspath in OpenSuse Linux. We need this path later. (/home/ns3user/ Documents/ns-allinone-3.17/)

I suppose, you already have Mercurial installed on your machine. You can find how to install Mercurialat "Part2: Install Pre-requirements Package for ns-3"

What we need:
1. Eclipse IDE for C/C++ Developers. You can download it from http://www.eclipse.org/downloads/
Depend on your CPU which is 32-bit or 64-bit, you can download eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz or eclipse-cpp-juno-SR2-linux-gtk.tar.gz. In this video, I downloaded "eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz".
Eclipse IDE for C/C++ Developers version in this video is: Version: Juno Service Release 2 - Build id: 20130225-0426

2. An Internet Connection.

In this tutorial, we have 4 parts:
• Part A: Install Eclipse and Configure Mercurial
• Part B: Configure Waf Builder
• Part C: Configure Debugger
• Part D: Create new source code, and run it.
   o D-1: Use Eclipse for running source code
   o D-2: Use Eclipse for creating new source code, but use ns-3 for running it (I Recommend)


Part A: Install Eclipse and Configure Mercurial 

1. Open Terminal and go to Eclipse path by cd command. Then use tar command to extract Eclipse
 tar -xvf eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz

2. Open Eclipse and choose a path for your projects.
You can choose whatever you want but it is advised to use a directory just for the Eclipse projects.

3. Be sure your Internet is connected.

4. In Eclipse, go to Help → Install New Software.
You should insert http://cbes.javaforge.com/update and mercurialeclipse in the form. It is simple, just follow the video. (After this step, the Internet is no longer needed)

 5. Create new C++ Project and with your preferred name. (I choose NS-3 Projects as project name)
You should choose the installed ns-3 path for the project. As I told you before, I installed ns-3 in Documents. The path is:  /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/

6. Right Click on the project and go to Team→ Share Project. Then click on Next and select local Mercurial.


B: Configure Waf Builder 

1. Right Click on the project and click on Properties. Then, click on C/C++ build. After that uncheck the boxes: "Use default build command" and "Generate make file automatically"

2. Insert this path as Build command: /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/waf

3. Insert this path as Build directory: /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/build

4. Click on the Behaviour tab and remove the `all` option in front of the Build (Incremental build) check-box and then write build


Part C: Configure Debugger

1. Go to Run → Debug Configurations and create a new configuration and choose a name for it.
2. Click on the "Browse" button under the "Project" section and select your project.
3. Click on the "Search Project" button under the "C/C++ Application" section and type scratch-simulator
4. Go to Environment tab and click on New button to create a new variable. You will need these:LD_LIBRARY_PATH  and /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/build
5. Be sure the "Append environment to native environment" is selected. Now, let run an example


Part D: Create new source code, and run it.
There are two different ways for compiling source codes:
 • D-1: Use Eclipse for running source codes
 • D-2: Use Eclipse for creating new source code, but use waf for running it (I recommend this one)

D-1: Use Eclipse for running source code

1. Create your source code, in scratch directory. As you will watch in the video, I create reza.cc file and copy the third.cc content into reza.cc. (The third.cc is one of the ns-3.17 example.) You can suppose it is a new code. The path is:  /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/scratch/
2. Click on Run button to compile all the source codes in scratch directory. So your source code is compiled too.
3. Go to Run Configurations and in Search Project option, select your project. Then click again on Run button and wait until compile complete. You will see your source code output

D-2: Use Eclipse for creating new source code, but use waf for running it (I Recommend) 

 1. Create your source code, in scratch directory. As you will watch in the video, I create reza.cc file and copy the third.cc content into reza.cc. (The third.cc is one of the ns-3.17 example.) You can suppose it is a new code. The path is: • /home/ns3user/Documents/ns-allinone-3.17/ns-3.17/scratch/
2. Open terminal, go to ns-3 path by cd command, and run the source code by waf command.:   ./waf  or ./waf --run scratch/reza

You see D-1 and D-2 ways have same output. but when you use way D-2 you can use --visualize for visualizing.for example: ./waf --run scratch/reza --visualize


References:
http://www.nsnam.org
http://www.nsnam.org/documentation/videos/
http://www.nsnam.org/documentation/presentations/
http://www.nsnam.org/wiki/index.php/HOWTO_configure_Eclipse_with_ns-3