ns-3 version considered: ns-allinone-3.20
List of Prerequisite Packages to be installed:
4. python-dev (Optional: If you want to use Python as the main language for network configuration)
5. mercurial (Optional: If you choose Method 2 (explained below) for downloading and installing ns-3)
6. qt4-dev-tools (Optional: If you want to install *NetAnim* (animator for ns-3) along with ns-3)
7. tcpdump (Optional: Required for analyzing packet capture files (.pcap) generated by ns-3)
8. wireshark (Optional: Alternative to tcpdump. You can use anyone of these)
9. gnuplot (Optional: Required for plotting high quality graphs through *.dat* files generated by ns-3)
Installing Prerequisite Packages:
Give the following command to install the above mentioned packages:
sudo apt-get install gcc g++ python python-dev mercurial qt4-dev-tools tcpdump wireshark gnuplot
You may remove the optional package's name from the above command if it is not required!
ns-3 can be downloaded in at least two different ways :
Method 1 (Recommended for beginners): Downloading a ns-3 tarball i.e., a zipped folder (This method is explained in this blog post)
Go to following link to download ns-allinone-3.20 tarball:
For older versions of ns-3, you can download the tarball from the following link:
Method 2: Downloading through *bake*
You need to have packages 4 and 5 from the list shown above to download ns-3 using bake. Once the prerequisite packages are installed, follow the instructions given on  to download ns-3:
Installing ns-3 and NetAnim:
ns-3 can be installed in three different ways :
Method 1: by using build.py (This method is explained in this blog post)
Method 2: by using bake
Method 3: by using Waf
For Method 2 and Method 3 of installation, follow .
After you have followed Method 1 for downloading ns-allinone-3.20, you may keep your downloaded tarball on the Desktop and then follow the steps given below to install it:
Step 1: Go to Desktop via terminal and unzip the ns-allinone-3.20.tar.bz2 tarball
tar xjf ns-allinone-3.20.tar.bz2
Step 2: Go in ns-allinone-3.20 folder and give the following command for installation:
./build.py --enable-examples --enable-tests
After a while, you may see the following message
Leaving directory './ns-3.20'
which indicates that ns-3 is installed !!!
To test whether all modules of ns-3 are installed successfully, follow the procedure as given below:
Step 1: Go to ns-allinone-3.20/ns-3.20 folder and give the following directory:
./test.py -c core
Some tests may be skipped while testing but that should not bother you if your module is not among those that were skipped!
Testing NetAnim (only for those users who installed qt4-dev-tools package before ns-3 installation):
To test whether NetAnim is installed successfully, follow the procedure given below:
Step 1: Go to ns-allinone-3.20/netanim-3.105 and give the following command:
A window as shown below should open:
You are done with it!
 Downloading ns-3, http://www.nsnam.org/docs/release/3.20/tutorial/singlehtml/index.html#downloading-ns3
 Building ns-3, http://www.nsnam.org/docs/release/3.20/tutorial/singlehtml/index.html#building-ns3