Ns-3 is one of the most popular simulation tools for network simulation. See the website: http://www.nsnam.org/. It is the successor to the popular ns-2 simulator. The tool is written in c++ / python, but I manage to get by using mostly only c++ (as opposed to ns-2 which uses c/c++ and tcl). One major difference between ns-3 and ns-2 is that this version has been designed for wireless network simulation from the ground up. (There is support for many types of 802.11 networks including 802.11s mesh networks which interest me).
The following instructions explain how to install the latest stable version of ns3 (
Step 1:
Download & install cygwin. (note: I install it in the recommended directory “{System Root}/cygwin/”). Make sure you select “install” for python and devel. This will ensure you have python and gcc/g++ as well as all of the dependencies. You can do this by clicking on the word default in the list of packages. I left all of the other package options on default for the install.
Step 2:
Step 3:
Start cygwin. At the cygwin prompt type: “tar xvf ns-allinone-3.7.1.tar.bz2″ (or whatever the filename is depending on the version you downloaded). This will unpack the ns3 archive so you can use it.
Step 4:
After it has unpacked, change directory to the new ns3 directory with the following: “cd ns-allinone-3.7.1″. Then build ns3 by typing the following: “./build.py”. You can probably grab a coffee or tea while it compiles.
ns3 on windows 7 with cygwin
You should be good to go. You can validate the install by changing directory again to the ns-3.7.1 directory (“cd ns-3.7.1″) and running “./test.py”. It will let you know with a PASS / FAIL for each test case. You can now edit the files yourself. The scenario files are located in “” and the source files are located in “”. Good luck!
Note: For those getting remapping errors, I have finally had the same trouble. This is what worked for me: Open command prompt, change to your /cygwin/bin directory. Type: ‘ash’. Then type ‘/bin/rebaseall’. You can now try cygwin again and it may work. If it still does not work (this happened to me), you can apply this fix to the rebaseall script. (you can edit it using some tool like notepad within windows).
4 comments
following your exact instructions i still get error while building ns3 program "Build failed
Reply-> task in 'ns3-core' failed with exit status 1 (run with -v to display more information)"
i encountered the same problem , please did you find the solution to fix this problem
ReplyI also got the same error. Any solution. Please suggest.
Reply$ ./build.py
ReplyFile "/home/ESTEEM/ns-allinone-3.7.1/./build.py", line 25
print "Note: configuring ns-3 without regression traces"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Note: configuring ns-3 without regression traces")?
i got this after i enter ./build.py please i need help on this issue God will help you all