Windows  + Cygwin + NS2 (Installation)  (Video Demo)


[Cygwin Installation] (Download and decompress the file. It is in AVI format)

1. Open IE browser.


2. Connect to my website:


3. Download the software. (


4. Decompress the downloaded file.


5. Click "setup.exe" to install cygwin.


6. Choose "Install from Local Directory".


7. Keep the default settings.


8. Click "Browse" to choose where the software is.

(Choose "")


9. Click "View" first to make the word "Category" change to "Full".


10. XFree86-base, XFree86-bin, XFree86-prog, XFree86-lib, XFree86-etc, make, patch,

perl, gcc, gcc-g++, gawk, gnuplot, tar and gzip must be chosen.


11. Please be patient. It may take a long time to finish the installation.


12. Done.


[NS2 Installation] (Download and decompress the file)

1. copy ns-allinone-2.27.tar.gz into your home directory.


2. type "tar xvfz ns-allin-2.27.tar.gz" to decompress the tarball.


3. Begin to install ns-allinone-2.27.

Change path to the ns-allinone-2.27 by typing "cd ns-allinone-2.27". Then type "./install".


4. Please type "y" to continue.


5. Done.


6. copy the ".bashrc" to your home directory. It will replace the original one.



1. Close the cygwin window and open it again. (Important)


2. To initial graphical mode. ( type "startxwin.bat")


3. Run the example tcl script.

(change to ~/ns-allinone-2.27/ns-2.27/ns-tutorial/examples. Then run the command “ns example2.tcl)


4. Success.


Author: Chih-Heng, Ke



phd candidate, EE department, NCKU, Taiwan