Ns-3.25 Ubuntu and Eclipse

Hi everyone,

I am interested in Ad Hoc mobile networks, recently I installed the Network simulation 3 in a Ubuntu distribution. Here I left a guide for the integration with Eclipse:

IMPORTANT:  Mi paths for the installation:

  • Eclipse:  /home/rommel/eclipse
  • Eclipse workspace:  /home/rommel/developer/workspace
  • Ns3 and waf location:  /home/rommel/developer/workspace/ns-3-dev


  1. Install all prerequisites, in the same way that the demostrated in this link: https://www.nsnam.org/wiki/Installation#Ubuntu.2FDebian
  2. Install Eclipse from their web page:  http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/mars2

Paths important: Note taken from the resources “start eclipse, it will create a workspace directory in your user’s directory named “workspace”. You can choose whatever you want but it is advised to use a directory just for the Eclipse projects. Eclipse will put invisible files there and moving the projects from one place to another might be a pain. Mine is in ~/Development/workspace, others prefer ~/src/workspace. You choose your.”


3. Open Eclipse and install MercurialEclipse from the MarketPlace.


4. Clone the ns3 repositories inside eclipse. On Eclipse Go to Menu, select “File”->  “New” -> “Other” -> “Mercurial” -> “Clone Existing Mercurial Repository”



Now in the url  just put “http://code.nsnam.org/ns-3-dev”. In my case I really got the ns3 distribution. Next click in the Finish button.


5. Configure the correct paths into Eclipse.  When you finish the last step you will have recreated the ns-3 project into Eclipse. Now right-click over the project name in mi case was “ns-3-dev [default]” -> “Properties” -> “C/C++ Build” -> “Builder Settings”. Let this tab with a similar configuration to the next screen. Please note that I am using the complete path.



Now click on the “Behavior” tab and change according with the nest screen:


6. Configure the external tools for running an application. “Run” -> “External Tools -> “External Tools  Configurations”. Here you must to create a new configuration and give it a name. I named “ns3”.


Now is ready.

Now when you need to run an script put it into the “scratch” directory inside your ns3 distribution. Now go again to “Run” -> “External Tools” -> “ns3” (in my case). Then a window prompt will be ask you for the name of the script.



I ran the “scracth-simulator” script.

If all is correct you will see in the “console” tab the next windows. There results are similar to the results in a terminal window.


Enjoy ns3.

Additional resources:




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: