top of page

ns 3 installation instructions for dummies

  • Writer: Peshal Nayak
    Peshal Nayak
  • Jul 14, 2017
  • 3 min read

DISCLAIMER: This blog is not to promote ns 3 and I'm not one of the developers. I'm writing these notes as a reference for myself and anyone else who might find these useful.

What is ns 3?

ns 3 is a discrete event simulator which is popular for research on communication networks. The software is open source so its entire code base is available for viewing and modifications. This includes all the lower level libraries as well. However, ns 3 is a bit intimidating at first mainly due to its vastness and the level of sophistication that it intends to capture. Prior to ns 3, researchers used ns 2 which was a similar software but with a different code structure.

Official website: https://www.nsnam.org/

How to install ns 3:

While writing these instructions, I was using Ubuntu 14.04 on a Lenovo T450s laptop. These instructions might not be applicable to other operating systems.

Step 1: Install all the prerequisites.

Visit this page: https://www.nsnam.org/wiki/Installation . Scroll down to the the section that says Ubuntu/Debian and follow all the mentioned commands for per-requisite installations in this section only. I did not face any errors while executing any of these commands.

Step 2: get all the ns 3 code.

The installation page describes some command line instructions to do this. But I'm going to take a bit lazier approach. Go to this page: https://www.nsnam.org/releases/ (if the page is not accessible search ns 3 installation on google).

Download your favorite release. The latest release is generally mentioned in the top bullet point on this page. Do not download ns3-dev. This is a developer's version which keeps getting updated frequently as they add new upgrades/changes to the system. So this is not a stable release and might change periodically until it becomes the next stable release.

When the download completes, you'll get a zip file. Paste this in your favorite folder and unzip it. You should see a folder that says: ns-allinone-<version that you just downloaded>

Use the command line and go inside this folder using the “cd” command. If you don't know how "cd" works, look it up online. Its pretty simple :)

Now inside this folder there is another folder called ns-< version that you just downloaded>. Eg: if you downloaded ns-3.26, then that will be the name of this folder. Go into this folder (via the command line). Now type ./waf configure and hit enter. Watch a bunch of lines coming up on the screen. When all this is done, you'll see a green line at the bottom saying 'configure' finished successfully (2.355s). There will be a bunch of red lines too. Don't worry about them right now (and hopefully in the future as well). A snapshot of what the command line terminal looks for me is below. Note that this is only the bottom few lines that got printed on the command line as the configuration occurred. If you get an error in this step, something is wrong with the prerequisite installation, you might want to be sure that you ran those properly. I've installed ns 3 on a bunch of machines so far and never faced any problems in this step or the next steps either.

Now type ./waf --build and hit enter in the command line. Watch as a few more lines start appearing on the screen. This might take a while. Let is finish. When this is done, you should see what I've shown in the snapshot below. Now you're all set!

I've seen a bunch of people install ns 3 on windows using a virtual machine. However, I do not recommend that to anyone. I have no experience installing this on Mac. I've tried to install this on Fedora once and gave up eventually due to a few errors in the installation stages.


 
 
 

Comments


  • LinkedIn Clean Grey
  • github-mark
  • Facebook - Grey Circle
bottom of page