Cygwin + NS-2.28 installation Diagram

Source: Internet
Author: User

Simply put, NS-2 is a network simulator, so it is often used in the Teaching of network courses.

NS-2 is opensource, the earliest version is running in Linux/Unix, and later with Windows VC compiled run version, but since 2.26, I gave up support for VC, so now there are only two ways to install NS2. either install Linux or install cygwin on Windows, and then install NS2.

Linux installation (rh9 is about 5 Gb) is not worthwhile for a NS2. therefore, I decided to use cygwin
Go first
Http://www.cygwin.com/setup.exe
Download setup.exe and run it. The following page is displayed:

Click Next. This page is displayed:

Select "Install from Internet". Of course, if you have downloaded the required package locally, you can also select "Install from local directory"

Next, select the installation location:

You can select a directory for installation. Currently (10/13/05) cygwin is fully compatible with NTFS, so don't worry, you can safely install it in NTFS partition. As for the test file type, it is recommended to set it to Unix. Although I have never tried to use the DOS format, since the opensource software was originally in Linux/Unix, it is best to use Unix.

Continue to the next step

Select a place to save the package. The package size is about 60 MB. Of course, if you select install from local directory, this step will change to "specify the location of the package"

Next step

Specifies the proxy server. The machines in CERNET cannot directly access the Internet outside China. Therefore, you must specify a proxy. The most damn thing is that its mirror list is abroad, so even if you know a domestic FTP address (you can download the package address, such as the ftp://ftp.sjtu.edu.cn/cygwin), you have to specify the proxy server, otherwise, you will not be able to obtain the mirror list, and the installation will fail. In Tsinghua, agents are recommended in addition to laboratories. We strongly recommend that you do not directly connect to other countries. If you want to know that international traffic is 1 RMB/MB, you need 60 RMB for one installation!

Next step

Select an image site. Cygwin has many image sites (but the above columns are from outside China). You can select one of them to download the package. You can also specify a site. For example, if you want to use ftp://ftp.sjtu.edu.cn/cygwin, you can enter this address in the user URL and click Add to add this address to the image list above. Then you can select this image for installation.

Next step

Select the software package to install. Here, I only list the packages required by NS2. this does not include the packages installed by the installer by default:
Gcc
Gcc-G ++
Gnuplot
Make
Patch
Perl
Tar
X-startup-Scripts
Xorg-x11-base
Xorg-x11-bin
Xorg-x11-devel
Xorg-x11-bin-dlls
Xorg-x11-bin-lndir
Xorg-x11-etc
Xorg-x11-fenc
Xorg-x11-fnts
Xorg-x11-libs-data
Xorg-x11-xwin
Click View in the upper-right corner to display the status next to it as full. Then you can see the package list in alphabetical order, keep them in a non-"Skip" status

Next step

Start to download the file and prepare for installation. The download process is slow because the total file size is more than 60 MB and is divided into many small files. If it is a proxy server, it may be slower. It is recommended that you start and install it in the morning, and then go to study it. It is estimated that it will be finished at noon.

After the download is complete, the system will automatically start Installation

The installation process is still slow. Just wait.

Installation Complete

Nice tips

At this point, cygwin is installed. A cygwin icon should appear on the desktop. Click Run to view the cygwin interface.

The next step is to install NS2.
Go first
Http://www.isi.edu/nsnam/dist/ns-allinone-2.28.tar.gz
Download the NS-allinone installation package. Of course, you can also download a separate package and install it one by one, but it is not recommended because it is too troublesome.

After downloading the file, use WinRAR. (I'm sure WinZip can decompress the file in tar format. If you want to try it, let me know) decompress all the files to the subdirectory of the home directory under the cygwin installation directory. For example, here is C:/cygwin/home/Hct.

Start cygwin,
CD/home/Hct/ns-allinone-2.28
./Install
The installation process begins. The preceding commands may not be the same because of different directories.

The installation process is very long, because we download the source file and the machine has to compile it first. Wait ......

This prompt is displayed after installation:

In this case, you also need to modify the path information and add the path of the executable file to the PATH environment variable.
Open C:/cygwin/home/Hct/. bashrc (of course, the location of the file varies depending on the installation path) and add the following information to the end of the file:

Export ns_home =/ home/Hct/ns-allinone-2.28
Export Path = $ ns_home/nam-1.11: $ ns_home/tcl8.4.5/Unix: $ ns_home/tk8.4.5/Unix: $ ns_home/bin: $ path
Export LD_LIBRARY_PATH = $ ns_home/tcl8.4.5/Unix: $ ns_home/tk8.4.5/Unix: $ ns_home/otcl-1.9: $ ns_home/lib: $ LD_LIBRARY_PATH
Export tcl_library = $ ns_home/tcl8.4.5/Library

The. bashrc file can be opened in notepad, but it is best to use ue because it is a UNIX text
The added files are as follows:
Http://www.sinzy.net/Test/i1/20051013132448_1dwgbc45_.bashrc

Now we have finished our work.
Save. bashrc, open cygwin, and run startxwin. bat.
The following window should appear:

Run
CD/home/Hct/ns-allinone-2.28/ns-tutorial/Examples
NS example2.tcl

The following window should appear:

This indicates that the NS2!

Problems & Solutions

P: The system prompts "No such file or directory" when running startxwin. bat"
S: It can be that x-startup-scriptsis not installed. Run setup.exe again, and select "Install ".
It may also be that the environment variables are not properly configured. Check again according to the above settings. Note that you should change the HCT to your appropriate name.
In addition, you should run startxwin. BAT instead of startxwin.

P: when running NS examples2.tcl, the system prompts "No such file or directory"
S: if it is not found examples2.tcl, it is when you play CD/home/Hct/ns-allinone-2.28/ns-2.28/ns-tutorial/examples Error
If the NS is not found, the environment variable is not set.

P: when running NS examples2.tcl, the message "Nam: no such file or directory" is displayed"
S: Check whether there is a nam.exe file under your/home/Hct/ns-allinone-2.28/nam-1.11 directory, if there is, your environment variable is set wrong, note to add the nam-1.11 directory to the path
If nam.exe is absent, an error occurs during Nam compilation. Run gcc-dumpversion to check whether your GCC version is 3.4.x. Locate the nam-1.11/agent. h, change null in its 73rd rows to 0, then return to the nam-1.11 directory, run. /configure and run make. After running, try NS example2.tcl again.
If the GCC version is not 3.4.x, I don't know what the problem is, but it must have been compiled incorrectly. So try another Nam version.

 

 

NOTE: If NS-tutorial is not provided after version 2.30, copy it to a previous version.

Reference: http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html
Http: // 140.116.72.80 /~ Smallko/int32/setup.htm

Http: // 140.116.72.80 /~ Smallko/int32/setup_en.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.