Monday, December 21, 2009

How to Install Network Simulator (NS) and nsnam on Solaris 10

Follow the steps given below.
  • Download the ns-allinone package from here:
  • Extract it or apply following command and cd to the directory where you downloaded the file. Now apply following commands.
    # gtar xzvf \
    http://nchc.dl.sourceforge.net/sourceforge/nsnam/ns-allinone-2.33.tar.gz
    # cd ns-allinone-2.33
  • Now download all the files attached with this post (look at the bottom) in the same directory. After download is complete enter following commands.

    # chmod a+x ns_fix.sh
    # ./ns_fix.sh
Say yes if it asks to over-write any file.

Wordarounds

What fixes have been done to make the installation successful is described here.

I chose ns-allinone-2.33 package which contains
* Tcl release 8.4.18 (required component)
* Tk release 8.4.18 (required component)
* Otcl release 1.13 (required component)
* TclCL release 1.19 (required component)
* Ns release 2.33 (required component)
* Nam release 1.13 (optional component)
* Xgraph version 12 (optional component)
* CWeb version 3.4g (optional component)
* SGB version 1.0 (?) (optional component, builds sgblib for all UNIX
type platforms)
* Gt-itm gt-itm and sgb2ns 1.1 (optional component)
* Zlib version 1.2.3 (optional, but required should Nam be used)

First, Make your system gnu compatible (fix cc, make).

I have seen cases where setting enveronmental variables does not help. Still
you can try.
$ CC=gcc 
$ MAKE=gmake 

Better try this,
# ln -s /usr/sfw/bin/gcc /usr/sfw/bin/cc 
# ln -s /usr/sfw/bin/gmake /usr/sfw/bin/make

Put /usr/sfw/bin in PATH variable.
# export PATH=/usr/sfw/bin/:$PATH
To make it permanent add it to .bashrc in your home directory if you are using bourne again shell. Else add to .profile. To know which shell: give this command "echo $SHELL" without quotations exactly.

After doing this gcc will be used instead of Sun's default compiler. And gnu make will be default make. If there were no problems if you just extracted the package installed them using ./install command inside the dir it was enough. But it is actually not enough.

There is a problem with the Solaris MIN MAX macros. To fix it I have provided files: config.h and mobile/mip-reg.cc Finally provide tcp_cong.c where replaced strsep with getToken function because strsep is not in Solaris 10 (details here: http://does-not-exist.org/mail-archives/mutt-dev/msg10335.html)

It is included with later releases of Solaris. So you might find it easier to install ns in Solaris Express versions (OpenSolaris, SXCE). (Note: Architecture dependant fix: config.h and mip-reg.cc, OS dependant
fix: tcp_cong.c)

Files are attached with this post. Click to download files.
          config.h
          mip-reg.cc
          tcp_cong.c
          ns_fix.sh

1 comment:

  1. thanks for the post

    could you please tell, how to install NS 2or3 on windows XP

    thanks
    Munam
    munam_81@yahoo.com

    ReplyDelete