How to install ns3 Linux Ubuntu 16.04

In this tutorial , You can get simple steps to install ns3 on linux ubuntu 16.04. This ns3 is written using the C++ & Python programming language. The ns3 library is wrapped by Python. C++ headers to gccxml and pygccxml  which automatically generate the corresponding C++ binding files which are finally compiled into the ns3 Python module. It allows users to interact with the C++.

Let’s started, First we need to Install prerequisite packages and libraries which need to run ns3 on linux ubuntu. Press Ctrl + Alt + T to open terminal. login as Sudo su. Just copy following commands one by one on your terminal.

Install required compilers & additional packages

qt4 development tools are needed for Netanim animator

Compilation packages

Debugging tools, valgrind for memory debugging

GNU Scientific Library (GSL) support for more accurate WiFi error models

for flex lexical analyzer and bison parser generator

To read pcap packet traces

Database support for statistics framework

for Xml library support

for creating graphical user interface

for virtual machines and ns-3

for source code modification

for editing image and texlive for documentation

for pyviz visualizer

for openflow module

for MPI-based distributed emulation

Create a directory NS3 under opt directory for downloading ns3 files.

As the hg (Mercurial) command executes, you should see something like the following displayed

After the clone command completes, you can find directory ns-3-allinone under your /opt/NS3 directory. run the python file to download and build the ns-3 distribution

After download process completes, you can find several new directories under /opt/NS3/ns-3-allinone as below.

Now compile and build the package. run build python file

Configuration with Waf

Now verify installation

u will get output as below

It means your installation is successful !

In my next post, I will show how to run first program in ns-3.

Thanks !

You can ask any query by mail  at [email protected]