Ns2 Installation steps in ubuntu 12.04 / 13.10 / 14.04 (package NS2.35)

1. Firstly download the tar file of ns2.35  NS2 package (ns-allinone-2.35)

2. Copy that tar file in home path

3. Open terminal by ctrl+t

4. Type command on that is... sudo apt-get update

5. Then password your system...

6.  Then type coomand... sudo apt-get install build-essential autoconf automake   libxmu-dev.

7.Then type that command for extract the tar file... tar zxvf ns-allinone-2.35.tar.gz other wise you extract manually its your choice.

8.Then type on terminal .....cd ns-allinone-2.35

9.Then type the command ... gedit ns-2.35/linkstate/ls.h
      (for changing the line 137...) is it
       void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

its change by....that line
  void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

then paste that line on that program file linkstate -> manually also do that

10. Then type the command ./install on terminal.

11. After installation the ns2.35 then you will copy the path on the terminal
     is....
Copy the PATH and LD_LIBRARY_PATH information in to your variable, you may use the /home/usr/.bashrc file and copy and paste the PATH and LD_LIBRARY_PATH.
Here you use command on another terminal is

vikasbro@ubuntu:~$ gedit ~/.bashrc

  and post the following text into your bashrc file


# LD_LIBRARY_PATH
OTCLLIB=/path/to/ns-allinone-2.35/otcl-1.14
NS2=/path/to/ns-allinone-2.35/lib
USR_LocalLIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCLLIB:$NS2:$USR_LocalLIB

# TCL_LIBRARY
TCLIB=/path/to/ns-allinone-2.35/tk8.5.10/library
USRLIB=/usr/lib
export TCL_LIBRARY=$TCLIB:$USRLIB

# PATH
XGRAPH=/path/to/ns-allinone-2.35/xgraph-12.2/:/path/to/ns-allinone-2.35/bin:/path/to/ns-allinone-2.35/tcl8.5.10/unix:/path/to/ns-allinone-2.35/tk8.5.10/unix
NS=/path/to/ns-allinone-2.35/ns-2.35
NAM=/path/to/ns-allinone-2.35/nam-1.15
export PATH=$PATH:$XGRAPH:$NS:$NAM

and replace your path.. just like that
# LD_LIBRARY_PATH
OTCLLIB=/home/vikasbro/ns-allinone-2.35/otcl-1.14
NS2=/home/vikasbro/ns-allinone-2.35/lib
USR_LocalLIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCLLIB:$NS2:$USR_LocalLIB

# TCL_LIBRARY
TCLIB=/home/vikasbro/ns-allinone-2.35/tcl8.5.10/library
USRLIB=/usr/lib
export TCL_LIBRARY=$TCLIB:$USRLIB

# PATH
XGRAPH=/home/vikasbro/ns-allinone-2.35/xgraph-12.2/:/home/vikasbro/ns-allinone-2.35/bin:/home/vikasbro/ns-allinone-2.35/tcl8.5.10/unix:/home/vikasbro/ns-allinone-2.35/tk8.5.10/unix
NS=/home/vikasbro/ns-allinone-2.35/ns-2.35
NAM=/home/vikasbro/ns-allinone-2.35/nam-1.15
export PATH=$PATH:$XGRAPH:$NS:$NAM   


12. After copy and paste  then you type on terminal is ns if a% is show on terminal the ns2    is successfully install if not then problem is occurred so follow above steps carefully otherwise contact me...

13. Then Type on terminal nam the pop up window will be open for nam animator.
 After installation plz comment or not install or error then ask ......
 

Comments

  1. Hi Vikas, I am stuck at 11. Can you guide me how to set the path. When i did the path command, and lastly run the ns command, a% is not shown. So i guess it didn't work.

    ReplyDelete
  2. Done with ns command...but when i run nam command, this is the error :

    This probably means that tk wasn't installed properly.

    child process exited abnormally

    ReplyDelete
  3. settled as i browsed through the solution from the net...

    ReplyDelete
    Replies
    1. Can you please share the solution for this issue. As im also facing the same issue with nam command. I am able to get % with ns command but nam gives "child process exited abnormally" error. Please help needed.

      Delete
  4. Sry for late reply due to hell busy schedule
    i think you did not copy the path properly in your bashrc file..

    ReplyDelete
  5. Done, thank you for the post. Though it was not easy, especially in item 11. What readers should do here is that once after installation completed (in 10) they'l be given information regarding to the LD_LIBRARY_PATH, LD_LIBRARY_PATH and TCL_LIBRARY in the IMPORTANT NOTICE part (in terminal), they should copy this information and paste them as directed in .bashrc (sudo nano .bashrc), this will work !!

    ReplyDelete
  6. I clarify the 1oth and 11th steps again i hope that is helpful for you. If any problem faced please ask me

    ReplyDelete
  7. after the whole installation when i check nam , it gives segmentation fault (core dumped), give me solution

    ReplyDelete
    Replies
    1. Segmentation fault" means that you tried to access memory that you do not have access to. so its problem related to your pointer

      Delete
  8. Hi Vikas i am installing ns2 software and i stuking at the last step i.e after % when i m writing nam they are saying "child killed: segmentation violation" so plese help me for this

    ReplyDelete
    Replies
    1. copy the 'nam' file from your '/home/[username]/ns-allinone-2.35/nam-1.15' folder and paste it into '/usr/local/bin' folder now surely it will work... restart your terminal and execute your tcl script

      Delete
  9. Hey vikas, I tried to copy the "nam" file from the folder but it showed some permission error. Also segmentation error was shown. Please guide me for this...

    ReplyDelete
    Replies
    1. hey using root user to use the the nam and ns2 file for copy and paste. If any extra file copy then configure ns2 again

      Delete
  10. i my friend i wan to know about ns 2 pls help me

    ReplyDelete
    Replies
    1. Yes my friend post any problem regarding to NS2 i try my best to solve them @ Karthik Dakshinm...

      Delete
  11. hiii dere,, m stucked,,,file u have mentioned dere linkstate/Is.h to edit....m not able to find this file neither by GUI nor by command through terminal,,,if i try to open this via gedit via terminal...file is empty,,,,
    and also command "sudo apt-get install build-essential autoconf automake libxmu-dev"
    gives an error package not found,,,,
    sir please help

    ReplyDelete
    Replies
    1. my system specification: ubuntu 12.04
      and is fully updated

      Delete
    2. Can you follow all the above steps and where you stucked the problem please provide the screen shot.
      ubuntu 12.04 is ok for NS2.5

      Delete
  12. sir i have get segmentation fault error is coming how to resolve this problem...

    ReplyDelete
    Replies
    1. Dear V Dharm segmentation fault error accrue when pointer not linked that means you did not provide the path for nam on vi edit shell use my last steps carefully...

      Delete
  13. sir i too got segmentation fault(core dumped) error while trying name command. how to solve it. please help me

    ReplyDelete
  14. nam popup window not opening

    ReplyDelete
  15. Dear Santhi Sri and unknown you also faced same problem segmentation fault error accrue when pointer not linked that means you did not provide the path for nam on vi edit shell use my last steps carefully...

    ReplyDelete
  16. hi i am working on ns 2 software, trying to implement teen protocols...but couldnt get anywhere near the code , can u please share the code for the teen protocol

    ReplyDelete
  17. hi!!! i am unable to open nam when i type nam
    getting message that "segmentation fault(core dumped)"
    what should i do??

    ReplyDelete
  18. hi!!! i am unable to open nam when i type nam
    getting message that "segmentation fault(core dumped)"
    what should i do??

    ReplyDelete
  19. segmentation fault(core dumped).i installed ns2 and nam from synaptic package.nam file is created but animater is not shown

    ReplyDelete
  20. This comment has been removed by the author.

    ReplyDelete
  21. Hello
    I want to integrate mannasim with ns2.35 but when I run ./configure I got this error "Installation of tcl seems incomplete orcan't be found automatically" and I didn't find a solution to my problem please help me and thanks in advance

    ReplyDelete
  22. my nam pop up window is not opening

    ReplyDelete
  23. bash: /usr/local/bin/nam: No such file or directory
    sir please help me out..when i put nam in terminal then this error occur..what i do..?

    ReplyDelete
  24. i followed all steps according to your post..

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. Hi I did everything correct (ns and nam works fine) however when I try to execute xgraph commands, I get the following error:
    Segmentation fault (core dumped)
    Can you help me solve this problem?

    ReplyDelete

Post a Comment

Popular posts from this blog

Castalia :- Simulator Installation steps with OMNET++ in ubuntu 14.04

Installation steps for CupCarbon simulator on Ubuntu 14.04