3 Comments

  1. Thanks for your tuorial :)
    I got a problem… I cannot find this path build/optimized/examples/
    Any suggestions on how to run udp-echo example ?

    thanks a lot!

  2. Install ns-allinone-2.35 in fedora 18
    NS2 stands for network simulator and it is not in fedora repository but it’s allinone package is available on isi.edurecently ns-2.35 RC7 is there with updated tcl and tk library but still it is not support gcc-4.5 series (does not like the X:() construct) so i made 2 patches.

    After apply those patches you can follow below steps.

    Installation of NS-2.35
    Open Terminal, Give the following command one by one
    su (press enter and enter your root or super user password)
    yum groupinstall “X Software Tools” {development software tools}
    exit (to come out of root user mode)
    Once installed, download the NS-2.35 allinone software from the following link. https://dl.dropbox.com/u/24623828/ns-allinone-2.35.tar.gz
    Copy that file to /home/pradeep (This is my home folder)
    Open terminal again and execute the following commands one by one
    tar zxvf ns-allinone-2.35.tar.gz
    cd ns-allinone-2.35

    Install Dependences : 
    yum install autoconf
    yum install automake
    yum install gcc-c++
    yum install libX11-devel
    yum install xorg-x11-proto-devel
    yum install libXt-devel
    yum install libXmu-devel

    Build ns-allinone-2.35 
    Go to you download directory and extract package (tar -xvf tarball), go to extracted directory and run
    #./install 

    You may possibly get one error during your installation is linkstate/ls.h error
    If you get the above error, open the file (~ns-2.35/linkstate/ls.h) using gedit or any text editor
    Go to line number 137 and change this line (void eraseAll() { erase(baseMap::begin(), baseMap::end()); })  to
    void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
    again you try the command ./install and this time the installation will be successful.
    Once installed the PATH information will be provided to you.
    Copy the PATH and LD_LIBRARY_PATH Variable to /home/madhurpremg/NS2/nsallinone-2.35/.bash_profile (see a dot in the beginning)
    Input the path information in .bash_profile file like this
    export PATH=$PATH: {don’t put}
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: here.
    Once done, save the file and close
    execute the command
    source .bash_profile
    try ns or nam to see whether your installation succeeded.

    Add PATH in .bashrc
    vim ~/.bashrc
    Add the following lines to the end of it. Remember replace “/opt/” by your installation path like “/home/username”. And accordingly also change the version numbers. This is for ns 2.35.

    # LD_LIBRARY_PATH
    OTCL_LIB=/home/madhurpremg/NS2//ns-allinone-2.35/otcl-1.14
    NS2_LIB=/home/madhurpremg/NS2//ns-allinone-2.35/lib
    X11_LIB=/usr/X11R6/lib
    USR_LOCAL_LIB=/usr/local/lib
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$USR_LOCAL_LIB

    # TCL_LIBRARY
    TCL_LIB=/home/madhurpremg/NS2//ns-allinone-2.35//tcl8.5.8/library
    USR_LIB=/usr/lib
    export TCL_LIBRARY=$TCL_LIB:$USR_LIB

    # PATH
    XGRAPH=/home/madhurpremg/NS2//ns-allinone-2.35/tcl8.5.8/unix:/home/madhurpremg/NS2//ns-allinone-2.35//tk8.5.8/unix
    NS=/home/madhurpremg/NS2//ns-allinone-2.35/ns-2.35/
    NAM=/home/madhurpremg/NS2//ns-allinone-2.35/nam-1.15/
    PATH=$PATH:$XGRAPH:$NS:$NAM

    Let it take effect immediately

    source ~/.bashrc

    Note: the step described above is important; otherwise, you cannot run ns successfully.
    or you can restart your X windows.i.e. logout and then login, or reboot your system, to make it work.)

    Now, the installation has been completed. If you try:
    $ ns

    Then a “%” will appear on the screen.type “exit” to quit the mode and back to “$
    Validate ns-2.35 
    Go to ns-2.35 directory and run
    #./validate (take almost 1 hour so keep patience)

Leave a Reply

Your email address will not be published. Required fields are marked *