18 September 2013

NS3 installation in Linux Mint 14 (64bit)

This blog is mainly dealing with Network Simulator 2 (NS2). However, more number of requests coming from my readers about the usage of NS3 for network simulation. So I started learning that too and here is the first post on NS3.

  • NS3 is also a discrete event simulator for internet systems and targeted for mainly Education and research purpose.
  • Ns3 uses two languages python and C++, whereas ns2 uses OTCL and C++.
  • The codes from NS2 will not be executing under NS3, however there are some codes have been converted from NS2 like OLSR, etc.
  • NS3 supports both IP and Non IP Based networks, protocols like OLSR, AODV, etc and networks like WiFi, WiMax, LTE, etc.
This post will tell you how to install Network Simulator 3 (NS3) to be installed on a Linux Mint 14 (64bit OS). May be it will work too good for Ubuntu 13.04 also.
  • The NS3 software can be downloaded from http://nsnam.org. It consists of good documentation too. The recent version is 3.17 (ns-allinone-3.17) . Here is the website snapshot.

  • Since the default build files will not be coming by default in Linux OS, they have to be installed before installing ns3. Here is the way to install as given.
    • sudo apt-get update
    • sudo apt-get install build-essential autoconf automake libxmu-dev
    • sudo apt-get install ia32-libs (Optional – This is to install the 32 bit libraries if you have a 64 bit Linux OS)
  • the downloaded file will be like this ns-allinone-3.17.tar.bz2. Once downloaded, extract it using the following command.
    • tar xjfv ns-allinone-3.17.tar.bz2 (This will create a folder called ns-allinone-3.17)
    • cd ns-allinone-3.17
    • ./build.py  (or alternatively you can use source build.py)
  • If everything works well as shown in the figure below, the installation will proceed.
  • After successful installation,  the build will show this screen. There may be some modules would not have built. In my case, brite, click, openflow and visualizer was not built and there were so many modules were built.
  • Most of the examples comes default in the NS3 source will be disabled by default, using the following command as shown in the figure, the examples may be enabled.
    • cd ns-allinone-3.17/ns-3.17/
    • ./waf configure – - enable-examples
  • Once done, as shown below, simply run the ./waf
    • ./waf
    • ./test.py (or source test.py)
    • this testing will compile some more modules.
  • The above command will take more time to PASS all the modules so that the examples may be run.
  • You can check a simple example or module that is running or not.
./waf –run hello-simulator   
the output will be “Hello Simulator”
That’s the successful installation of NS3. All the simulated modules are available in the folder ~ns-allinone-3.17/ns-3.17/. If you encounter any errors, let you post your queries in the comment section.
The next post will tell you about how to execute the modules either in C++ or Python.