Thursday, March 5, 2009

Installing ns2 on Linux.

First step is to get the source. The source can be found at:

http://isi.edu/nsnam/ns/ns-build.html

If you are an expert, then you can download all the parts separately otherwise get everthing at once and download the allinone source from:

http://sourceforge.net/project/showfiles.php?group_id=149743&package_id=169689&release
Currently, the latest version in ns-2.33

After downloading the source, perform the following steps:
1. Log in as root.
2. Copy the .tar.bz2 file to the /usr/src directory.
3. Untar the file using tar xvzf "filename"
4. Go to the /ns-allinone-2.33 directory and run ./install. This would install ns2 into your system.
After this, we need to add certain paths to the PATH variable, so that ns2 can be run from anywhere.
5. Thus, perform PATH=$PATH:/usr/src//ns-allinone-2.33/bin:/usr/src/ns-allinone-2.33/tcl8.4.18/unix:/usr/src/ns-allinone-2.33/tk8.4.18/unix:
Export PATH

We need to store these things in the PATH permanently as normally these are stored just for the current session. So for this, we need to add the same thing exactly in one of files mentioned below:
Add "PATH=$PATH:/usr/src//ns-allinone-2.33/bin:/usr/src/ns-allinone-2.33/tcl8.4.18/unix:/usr/src/ns-allinone-2.33/tk8.4.18/unix:
Export PATH" to /etc/bash_bashrc for openSUSE
If you can find .bashrc file in the root folder then add the same thing at the end of it.

Hopefully, this would work and your ns2 is now ready for use.

I would also like to mention the best tutorial for beginners: It is the MArc Greis Tutorial and it can be found at:

http://www.isi.edu/nsnam/ns/tutorial/

If you want to download the ns manual, it can be done from:

http://www.isi.edu/nsnam/ns/ns-documentation.html

This manual would help you understand how ns2 works and all the intricate details about it.

Hope it turns out to be useful for people new to ns2.



No comments: