How to Install NSE3 on CentOS 7

What is NS?

NS, short for Network Simulator, is a series of discrete event network simulators (ns-1, ns-2, ns-3). They are mainly used in teaching and research. It is free and open-source.


NS-1 was known as LBNL Network Simulator. It was derived from a REAL simulator.


NS-2 came into being after the revision of NS-1. Ns-2 holds considerable contributions from third parties, comprising wireless code from the UCB Daedelus and CMU Monarch projects and Sun Microsystems.


NS-3 came as a replacement for NS-2. Backward compatibility with NS-2 was decided to be stopped. The new simulator is being developed and maintained.

To learn about NS3, visit:


Today, we will show you how to install NSE-3 on our machine. To demonstrate the installation of NS3, we have used CentOS 7 as the operating system. CentOS, short for Community Enterprise Operating System, is a free and open-source distribution of the Linux family. It is widely popular among the tech-savvy community because of its focus on user-friendliness and high efficiency when it comes to performance. Its functionality is compatible with its upstream source Red Hat Enterprise Linux (RHEL).

To learn more about CentOS, check out this page:


We will perform the installation using the CentOS command line, also known as ‘Terminal.’ We have divided the installation process into 6 steps. Each step has one or more commands that we will run to install NS-3 and its required tools.

Without any further ado, let’s get started!

Installation Guide

Following are the steps involved in installing NS-3 on CentOS 7:

Step 1: Download gcc compiler 4.9 from this web page:


Once it is downloaded, copy it to /opt directory.

Step 2: Install gcc-c++.4.9 compiler

Following are the commands that we will run one by one to install the compiler:

tar zxf gcc-4.9.2.tar.gz

cd gcc-4.9.2


./configure --disable-multilib –enable-languages=c,c++

make -j 4

make install

You have now successfully installed the gcc compiler.

Step 3: Install necessary tools to install nse-3

Here, we will download rpmforge from the following webpage:


Once it is downloaded, we will install it by executing the following commands:

yum install rpmforge

yum install unrar* mercurial* bzr* cmake p7z* cvs*

Step 4: Download NS-3.27.tar.bz2 file

In this step, download NS-3.27.tar.bz2 file from the following webpage:


Step 5: Paste the package into the right location

Go to the following path:

cd /opt

Unzip the package using the following command:

tar zxvf ns-allinone-3.27.tar.bz2

Now run the following command to go to the ns-allinone-3.2 folder:

cd ns-allinone-3.2

Go to the bake directory by running this command:

cd bake

Once you are inside the directory, execute the following command:

./bake.py check

Step 6: Install NS-3

Go back to the previous directory by executing the following command:

cd ..

Now check what is your current working directory by executing the pwd command:


It is supposed to be /opt/ns-allinone-3.27.

Now run the following commands one by one to install the software:

./build.py --enable-examples --enable-test

cd ns-3.27

./waf --build-profile=debug --enable-examples --enable-tests configure


./test.py -c core

./waf --run hello-simulator

Once all the commands have been successfully run, the software will be automatically installed.

If you have reached this far without running into any errors, congratulations, you made it to the end.


In today’s guide, we saw how to install NS-3.27 on our machine in detail. The system that we have used is centOS 7. We demonstrated the installation process using the command line of CentOS, where we ran a few easy-to-follow commands.

I hope you enjoyed our effort. Stay tuned for more helpful Linux tutorials.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.