Skip to main content

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.

Comments

Popular posts from this blog

AWK Scripts for NS2 to process data from Trace Files

AWK Scripts are very good in processing the data from the log (trace files) which we get from NS2. If you want to process the trace file manually, here is the detailHere is a sample of trace file from NS2 (However ns2 supports a new type of trace file also), but this post will make you understand the old trace format only.r 0.030085562 _0_ MAC  --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] r 0.030110562 _0_ RTR  --- 0 message 32 [0 ffffffff 1 800] ------- [1:255 -1:255 32 0] s 1.119926192 _0_ RTR  --- 1 message 32 [0 0 0 0] ------- [0:255 -1:255 32 0]
AWK Scripts are very good in processing the data column wise. For example
the first column in the above trace file represents r, s which indicates receive, sent respectively. If we want to trace the entire r and s alone from this trace file we can represent it as $1
So
$1 represents ACTION
$2 Time
$3 Node ID
$4 Layer
$5 Flags
$6 seqno
$7 type
$8 Size
$14 Energy (if the network nodes includes EnergyModel)To run the awk script in Li…

nam installation - Segmentation Fault (Solved)

If you are encountering "Segmentation Fault" error while running nam in Ubuntu 14.04 or Linux Mint 17+ editions, this post will be helpful for you.

Download the nam file from this link

First, remove the nam which was installed earlier using the following command 

pradeep@localhost $] sudo apt-get remove nam

and install the new nam which was downloaded just now. go to the folder where the file was downloaded and issue the following command

pradeep@localhost $]  sudo dpkg --install nam_1.15-10_i386.deb

See the screenshot below to install and use nam

 T S Pradeep Kumar

Installation of ns2 in Ubuntu 18.04 - NS2 Tutorial # 2

ns2 installation in Ubuntu 18.04

Unlike earlier version of ubuntu, the 18,04 version does not support the direct installation of ns2, because of the latest C/C++ compiler (7.x), but the latest C/C++ compiler supported by ns2 is gcc-4.8. So this post and video tells you about the installation of gcc-4.8 version, then ns2 and then configuration.
Here are the steps, Please follow the video given below for more information.

$] tar zxvf ns-allinone-2.35.tar.gz


$] sudo apt install gcc-4.8 g++-4.8

if you have installed ubuntu just now, you can try these commands also in the beginning

$] sudo apt update
$] sudo apt install build-essential autoconf automake libxmu-dev

$] cd ns-allinone-2.35/ns-2.35
$] gedit Makefile.in
$] gedit linkstate/ls.h

line number 137, change erase to this->erase
$] cd ..
$] ./install

export PATH=$PATH:/home/pradeepkumar/ns-allinone-2.35/bin:/home/pradeepkumar/ns-allinone-2.35/tcl8.5.10/unix:/home/pradeepkumar/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=$L…