Sunday, October 26, 2008

How to install iNSpect-3.5 on systems with GCC version 3.4.6

The nam or the Network Animator found in ns2 is built for visualizing the simulations of wired-networks. So it is better to use some other specialised visualization tools built to support wireless-network simulations. One such tool that is built for visualizing Wireless simulations on ns2 is iNSpect which is freely available on request. The tool can be available by sending a request mail to Tracy Camp (tcamp@mines.edu).For more information on this tool visit this web-site

http://toilers.mines.edu/Public/NsInspect

I tried to install the iNSpect-release 3.5 on my system which has the following configuration
OS: Red Hat Enterprise Linux release 4
GCC Version: 3.4.6
and the installation failed.

I tried to figure out the problem and found out that the iNSpect needs at-least GCC version 4.
I tried to update my GCC.....but my net connection was slow and it was taking a hell lot of time...and one of my friend told me that the Linux kernel depends on the GCC and if you try to modify the GCC the OS may give you some problems......
I dont want to change my OS, so was looking for any fixes by which I could install this package....

After spending some time on Google, I realized that GCC version 4 added a new feature called
ffriend-injection
in-order to comply with new ANSI-standards.
Now I observed that I was getting the error because of this new feature......GCC 3.4.6 is not able to recognize ffriend-injection.

Then a post in one of the Help-Forums helped me.......
It said that by disabling the ffriend-injection flag in the installation script you can successfully install the software....
Now these are the steps I tried and successfully installed the iNSpect-release 3.5 on my GCC 3.4.6 system, I think the same steps can be followed to install this package on systems with GCC version less than 4.
1) Open the file install present in package iNSpect-release 3.5, in any editor
2) Search for the line containing -ffriend-injection (I think it is line no 93)
It appears like this
g++ -g -c \$(CFLAGS) \$(gtkCFLAGS) -ffriend-injection \$<
3) Now delete "-ffriend-injection", after deleting the resultant line looks like this
g++ -g -c \$(CFLAGS) \$(gtkCFLAGS) \$<
4) Now save the file and close it.
5) Now try to install the package......

It worked for me.......

Hope it helps
Good Luck
:)

Installing gt-itm and sgb

Yesterday while i was installing ns-allinone-2.33 package in my friends system with the following configuration
OS:RHEL 4
GCC:version 3.4.6
I have observed that sgb and gt-itm were not installed...it flashed a error that gt-itm cannot be installed as sgb is not installed. But as these are optional components the installation continued and the rest of the components were installed successfully.
The gt-itm is an optional software which is used to create topologies in ns2. It uses sgb-A Stanford Graph base for creating topologies.
As we were working on the area of ROUTING this software is very useful to us as we need to test our protocol on various topologies....
So I decided to install the sgb and gt-itm packages manually.After carefully reading the install file of ns-allinone-2.33 package I managed to install them successfully.
These are the steps I followed......
1) Opened the terminal
2) I navigated to ~/ns-allinone-2.33/sgb/ directory and typed make
It gave me some instructions from which i understood that I need to first type
make tests
and after the tests are successful I need to type
make install
After typing the above two make commands I observed that the sgb package was successfully installed.
3) Now you need to go to the gt-itm directory ~ns-allinone-2.33/gt-itm/ directory
(a) Create a folder called lib in that directory and
(b) Copy the libgb.a file found in ~ns-allinone-2.33/sgb/ to ~ns-allinone-2.33/gt-itm/lib/ directory
4) Now come out of lib directory.....and go to ~ns-allinone-2.33/gt-itm/src directory. Now you need to type make. Now you get four .o (output) files namely
itm.0
geog.o
ts.o
dfs.o
and a error saying "Cannot open output file ../bin/itm ------"
5) After seeing the error I created a bin file in ~/ns-allinone-2.33/gt-itm/ directory and copied the above four .o files into ~/ns-allinone-2.33/gt-itm/bin directory
6 Now I navigated to ~/ns-allinone-2.33/gt-itm/src/ directory and typed
make
7) And.....the gt-itm package was installed successfully.

Note:I know the procedure I followed is some-what obscured, there may be a relatively easy procedure to install these packages.

Hope it helped
:)

Sunday, October 12, 2008

Learning NS2

Now you have installed NS2 successfully....Its time for next step, learn the basics and then move on to advanced stuff. There are a lot of resources available in web on ns-2. I have enclosed web-links to some of the resources in this post, for more resources just Google it.
To program NS-2 you need to know C++, TCL and OTCL.
It would be advantageous if you are well versed with C++ programming.If you are a novice, no need to panic, to learn C++ there are a large number of books available.The best book to follow is "C++ Programing Language" by Bjarne Stroustrap. This book is a big one and needs some time to read.You can also refer a large number of resources available freely on C++ in the web, just use Google to search them.
To learn TCL the best book is "Practical programming in TCL/TK" by Brent B Welch. For TCL also you can find a large number of resources in the web.
OTCL is an Object Oriented extension to TCL.I dont think, there are any printed books available on OTCL.

You can refer the below sites for Introduction and Tutorials on OTCL:
For Introduction to OTCL refer : http://en.wikipedia.org/wiki/OTcl
This one is a very good tutorial to OTCL : http://bmrc.berkeley.edu/research/cmt/cmtdoc/otcl/
This site has a short tutorial on OTCL : http://nile.wpi.edu/NS/otcl.html
The NS-Manual available at www.isi.edu/nsnam/ns/doc/ also has a brief introduction to OTCL concepts.

After getting familiar with C++, TCL & OTCL concepts, you can directly start learning the NS-2.

The best resource to start with, is Greiss Tutorial which can be found at http://www.isi.edu/nsnam/ns/tutorial/index.html
Greiss Tutorial is a hands-on tutorial which covers the basics of NS-2. It is better to execute all the programs in this tutorial.

The below web-sites have links to other ns-2 resources
http://www.cse.msu.edu/~wangbo1/ns2/
http://www.matlab.nitech.ac.jp/~khpoo/research/ns2.html
http://www.winlab.rutgers.edu/~zhibinwu/html/network_simulator_2.html

There are a large number of Power Point slides available in web on NS-2. I am here-by enclosing the link to the Google search page on NS-2 PPT's
http://www.google.co.in/search?hl=en&q=NS2+filetype%3Appt&btnG=Search&meta=

After reading the above resources you can start reading the NS-Manual found at site
http://www.isi.edu/nsnam/ns/doc/

This document can also be found in your ns-allinone-2.33 directory at
~/ns-allinone-2.33/ns-2.33/doc/everything.pdf

Hope would be Useful.............

Happy Learning :)
All The Best :)