cygwin-ns3

Tutorial: Install ns-3 in Windows 7 using cygwin

 

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 (as of April 14th, 2010 as of March 22nd 2011 with ns-3.10) on windows 7 with cygwin. It should work with newer releases as they come out, but if not leave me a message and I will update the instructions. I will try to include any common problems I have encountered, or those of users who comment on the post experience in order to make your install easier.

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:
Download ns3.7.1Download the most recent version of ns3 from their website (you will likely want the all-in-one version if you are just starting out. Save the file to “{System Root}/cygwin/home/{your-username}”. Alternatively, you can try downloading the file directly within cygwin using something like “wget http://http://www.nsnam.org/releases/” where filename is the name of the release you wish to install.

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 cygwin windows 7

ns3 on windows 7 with cygwin

Step 5:
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).

 
Post comment as twitter logo facebook logo
Sort: Newest | Oldest

Hi. How to build "build.py" in windows7 86x (win7 32bit) with cygwin for ns3? The errores in cygwin are: Babi@Babi-PC ~ $ cd ns-allinone-3.13 Babi@Babi-PC ~/ns-allinone-3.13 $ ./build.py /usr/bin/env: python: No such file or directory Babi@Babi-PC ~/ns-allinone-3.13 $ build.py -bash: build.py: command not found Babi@Babi-PC ~/ns-allinone-3.13 $

hello jason, i am working on a project that involves ns-3 and mesh networking 802.11s .i was wondering if you could help ?? can i post my doubts here itself or can i contact you through e-mail thanks

Hi thanks very much for your help. I'am facing the "0 of 0 tests passed (0 passed, 0 skipped, 0 failed, 0 crashed, 0 valgrind errors)" error in step 5. for solve this problem read her. Thanks in advance

I've succeeded until step 3 , but now I'm stuck at step 4....please i need help

hi Jason, why i install cygwin .. about 95% happened "incomplete" messagebox... is wrong about my step ?

hi i hav installed cygwin properly thenafter i hav also installed ns-3.11 with the help of above mentioned procedure ..... but,when i tested it using "./test.py" got error as: OSError: [Errno 11] Resource temporarily unavailable can u please tell me how to fix it up

c'est trés important mais je n'arrive pas a instaler cygwin correctement si vous pouvez m'aider merci

Hey Jason! Great work with the blog! However, it didn't work even after the '/bin/rebaseall' command and the link you posted the fix to the script is broken... Can you post a correct one, please? Thank you!

I noticed the link went down, I will try to find a new one or reproduce the method I used to fix it. That will teach me for just hard-linking rather than rewriting the instructions :S

hi, if ./build.py don't work try ./install on dierctory ns-your_version like cd ns-2.29 after ./intall and type "y" for yes that work it for me gud luck PS: I hve a bad english I know

hello could anyone please help me to solve this problem ? $ ./build.py # Build NSC Entering directory `nsc-0.5.2' => python scons.py linux-2.6.18 1 [main] python 1052 C:\cygwin\bin\python.exe: *** fatal error - unable t remap \\?\C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as pare t: 0x2F0000 != 0x360000 Stack trace: Frame Function Args 0028A628 6102749B (0028A628, 00000000, 00000000, 00000000) 0028A918 6102749B (61177B80, 00008000, 00000000, 61179977) 0028B948 61004AFB (611A136C, 6123F47C, 002F0000, 00360000) End of stack trace 2 [main] python 8172 fork: child 1052 - died waiting for dll loading, err o 11 Traceback (most recent call last): File "./build.py", line 117, in sys.exit(main(sys.argv)) File "./build.py", line 93, in main build_nsc() File "./build.py", line 14, in build_nsc run_command(['python', 'scons.py', kernel]) File "/home/jack/ns3/util.py", line 21, in run_command cmd = subprocess.Popen(*args, **kwargs) File "/usr/lib/python2.6/subprocess.py", line 633, in __init__ errread, errwrite) File "/usr/lib/python2.6/subprocess.py", line 1049, in _execute_child self.pid = os.fork() OSError: [Errno 11] Resource temporarily unavailable

Please see my most recent additions at the bottom of the post, these explain how you may be able to solve these errors.

Hello! thanks for the tutorial, i have done all the steps with no problem, but i don't know how to execute an example of simulation, it's the first time that i use NS . thanks so much for help

You can execute a simulation by using the waf tool. The simulation parameters are set in scenario files (usually you locate them in the scratch folder). There are also some others located in the example folder. So, for example if you want to run a script in example called "first.c" you would execute "./waf --run=first" (Another note, if you are running a file located in scratch, you need to include the scratch folder in the run command like this: "./waf --run=scratch/myfile" See more here: http://www.nsnam.org/docs/release/tutorial/html/getting-started.html#running-a-script

How to make NS-3 file executable so that I can run it in windows.

It is likely quite difficult to do this because of the libraries involved in ns3. It is easily to simply use cygwin and emulate linux, that is why I have posted this guide.

After tar command, I change to the directory specified, but when I execute ./build.py I get the error: "/usr/bin/env: python: No such file or directory What shall I do? Thanks in advance Alberto

I'm facing the same problem too, kindly provide solution if you could help us.

Yes, i find the solution myself on this problem : “/usr/bin/env: python: No such file or directory by includes all the installation part (click on one by one to select 'install', especially python) during ns3 installation. Now, the new problem occurs, same as Pavlos Basaras and manou: fatal error - unable remap \\?C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as pa:0x2D0000 != 0x3C0000 ..... I run it in administrator mode, same thing is happened. Can anyone provide further steps? Thanks

I have a problem to install ns3. 1 [main] python 4560 C:\cygwin\bin\python.exe: *** fatal error – unable to remap How to resolve it.

thanks very much for your information on installing ns3

i have a problem to execute the cygwin ..that file cann't be open in window7.how to work on ns3?

Hello i need ns for my univercity project.I am new to ns. While i followed your instructions i encountered some error messages it has something to do with python: 2 [main] python 6092 C:\cygwin\bin\python.exe:***fatal error-unable to remap \\?\C:\cygwin\lib\python2.6\lib\dynload\_random.dll to same address as parent Thank you

Hello, I have the same error when installing ns: $ ./build.py # Build NSC Entering directory `nsc-0.5.2' => python scons.py linux-2.6.18 scons: Reading SConscript files ... 1 [main] python 4560 C:\cygwin\bin\python.exe: *** fatal error - unable to remap \\?\C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as paren t: 0x260000 != 0x2C0000 Stack trace: Frame Function Args 00227918 6102749B (00227918, 00000000, 00000000, 00000000) 00227C08 6102749B (61177B80, 00008000, 00000000, 61179977) 00228C38 61004AFB (611A136C, 6123F91C, 00260000, 002C0000) End of stack trace 2 [main] python 4292 fork: child 4560 - died waiting for dll loading, Can you, please, help me to resolve this problem.

I follow through the steps but encountered problem installing it. It just stopped half way and exiting the installation when i'm installing ns3. Please advise on the ways to overcome the problem. FYI, i'm using windows vista

Do you get any error messages when it stops installing?

Hey, your content makes for authentic beneficial studying. right now there is not sufficient blogs outthere of which contain good studying materials, big thumbs up from me and i’ll be hanging around quite a little bit in the future.

Trackbacks

  1. [...] In order to run or install native Linux or Unix based simulators like NS2 or NS3 (Network Simulators) and OMNeT++ (not a native though) in Windows (without installing Linux), you will need Cygwin. Read Tutorial: How to install ns-3 in Windows 7 using Cygwin by Jason. [...]

Recent Articles

Simple Telnet - Example Application

OpenGL Console Library for Blackberry Native SDK (Playbook)

January 24, 2012

Over the break, I decided to try my hand at some Blackberry native SDK...

Creating a Bluetooth Access point (NAP) in Ubuntu 11.10

Creating a Bluetooth Access point (NAP) in Ubuntu 11.10

November 29, 2011

A Bluetooth NAP is similar to a Wi-Fi access point. In this case, we will...

Screenshot at 2011-11-29 08:54:32

Burg / Grub 2 Icons for Meego

November 29, 2011

Only recently I noticed that Moblin (which I sometimes use) has changed...

 
Aircrack suite + Ubuntu 11.10 problems with monitor mode channel

Aircrack suite + Ubuntu 11.10 problems with monitor mode...

November 4, 2011

Recently I have been playing around with the aircrack suite and in...

Upcoming PhD QE Progress

Upcoming PhD QE Progress

July 27, 2011

So I've been doing my PhD for over two years now, and I haven't posted a...

waterloo

Why Blanket Wireless Coverage in Waterloo Failed, and...

July 22, 2011

Today the KW Record ran an article entitled "Blanket Wi-Fi plans unplugged...