The following is an installation guide for Ns2 from its source code on Windows platform (95/98/2000) for ns versions up to 2.1b9. Later versions of ns work under Windows using Cygwin. If you would like to provide updated information for ns after 2.1b9, please send it to the ns mailing list.
Before installing Ns2 it is important to note that pre-compiled versions already exists. A precompiled version of the latest release (ns-2.1b8a-win32.exe) exists for win2000. This serves as an excellent trial tool for anyone getting started with Ns2. For those who plan on implementing an extension for Ns2 you will have to compile it from its source distribution. You can use WinZip to untar the files. This guide is designed to clarify this.
SHELL= C:\COMMAND.COM C:\ /E:32000 /P
Note: makefile.win for tclcl and ns2 is found in the respective directories for each ..\conf, while makefile.vc resides in their base directory. otcl only has makefile.vc but not makefile.win. Here are some sample makefiles.
cd D:\NetSim\ns-2.1b6-currentBatch files are saved with the extension .bat.c:\progra~1\micros~3\vc98\bin\nmake /f makefile.vc
Compiling TCL is done in two steps. For the first step use nmake /f makefile.vc. After this use nmake /f makefile.vc install. The install option will create directories for binary, include and library files.
The file mkd.bat in TCl8.3.2\win and TK8.3.2\win needs to be modified. Every instance of "md" should be changed to "mkdir". This is because the DOS command to make a directory is "mkdir" and not "md"
What is Cygwin?
The Cygwin tools are ports of the popular GNU development tools for Windows NT, 95, 98 & 2000. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect.
Dowloading Cygwin
Go to Cygwin web page for downloading Cygwin. This page gives the most recent version of Cygwin.
Note: With Cygwin-1.3.2 we have been unable to make awk work. And since ns' validation scripts makes use of awk, the ns-2.1b8a-win version has not been validated under windows.
What is Perl?
Short for Practical Extraction and Report Language, Perl is a programming language developed by Larry Wall, especially for processing text. Because of its strong text processing abilities, Perl has become one of the most popular languages for writing CGI scripts and other Internet applications. Perl is an interpretive language which makes it easy to build and test simple programs. However, Perl is also robust enough to allow for the creation of complex programs. Because Perl is extremely useful in "gluing" together smaller programs into larger applications, it has often been referred to as "the duct tape of the Internet."
Dowloading Perl
Running the validation
Important Note:
The paragraph below describes validation that was run on win95 for ns-2.1b6 version using cygwin-1.1.2. However the cygwin release 1.3.2 currently available (as of 07/2001), which we installed in win2000, doesn't seem to have a functional awk utility. A significant portion of the ns validation script uses awk, so we tried to replace awk with perl; but now the bash shell (another cygwin utility) didnot handle stdin/stdout correctly. So we were unable to validate the windows version (ns2.1b8a) in this platform. We welcome any suggestion from windows users to help solve this problem.
To run the validation on win95 a patch must be applied to
test-all-template1 which resides in ~ns/tcl/test/.
Download and run the patch.exe program included in Cygwin. A
description of the syntax for "patch" is available by typing
patch --help
. If you prefer having it in a text file, -->
--type
patch --help > out.txt
+++ test-all-template1.win Fri Jul 2 14:33:25 1999 @@ -116,14 +116,16 @@ cp $datafile.bk $datafile mv $datafile.Z $directory/$t.Z else - uncompress -c $directory/$t.Z | cmp -s - $datafile +# uncompress -c $directory/$t.Z | cmp -s - $datafile + gzip -dc $directory/$t.Z | perl -ne 'print $_;' | cmp -s - $datafile if [ $? = 0 ]; then echo Test output agrees with reference output else echo Test output differs from reference output success="false" cp $datafile $directory/$t.test - uncompress -c $directory/$t.Z > $directory/$t +# uncompress -c $directory/$t.Z > $directory/$t + gzip -dc $directory/$t.Z > $directory/$t echo "Diagnose with: diff $directory/$t.test $directory/$t" echo "Differences due to floating-point formatting are not significant."Some of the test suites will fail on win32 platform. As of Feburary 26, 1999 snapshot of ns, the following test suites fail:
./test-all-simple ./test-all-tcp ./test-all-red ./test-all-sack ./test-all-schedule ./test-all-red-v1 ./test-all-sack-v1 ./test-all-v1 ./test-all-vegas-v1 ./test-all-ecn ./test-all-manual-routing ./test-all-intserv ./test-all-webcache ./test-all-srmHowever, the above test suites failed because of floating point rounding differences on win32 and on unix, or because of incompatibilities of the unix awk program and its cygwin variation. We will test current ns snapshots and update the results here. Thanks to Christian Joensson for providing these information.