How to Install NS-2.35 in Ubuntu-13.10 / 14.04 (in 4 easy steps)

In this DIY we will learn how to install Network Simulator (NS)-2.35 in Ubuntu 13.10 OR Ubuntu 14.04. If you found yourself here then I assume you already know about the NS, so I will skip the introduction part. And if you don't then you may want to follow this link.


Step 1: Setting up the Prerequisites

1. First of all, download Network Simulator (NS-2.35) from here.I assume you have downloaded it into your '/home/user_name/Documents' directory.

2 [Optional]. Now we have to update the Ubuntu with its latest components. Open up a terminal and run these commands:

1 sudo apt-get update
2 sudo apt-get dist-upgrade
3 sudo apt-get update

Make sure that your Ubuntu is fully updated ( i.e. there should be no pending updates in your Ubuntu Software Center and in Software Updater).

3. Before installing the NS we have to install some essential packages required by the NS. So run the following commands:

1 sudo apt-get install build-essential autoconf automake
2 sudo apt-get install tcl8.5-dev tk8.5-dev
3 sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev
4 sudo apt-get install gcc-4.4


Step 2: Extract and Install NS

1. Extract the downloaded NS package either using the right click context menu "Extract here" or using the following commands from a terminal:

1 cd /home/user_name/Documents
2 tar -xvzf ns-allinone-2.35.tar.gz

2. After extracting the "ns-allinone-2.35" folder, open up the file "/ns-allinone-2.35/ns-2.35/linkstate/ls.h" in an editor. You can do it either from the terminal or from the file explorer (Nautilus). We have to make some changes in the ls.h file else it will show an error while installing the NS. Once you have opened the file move to the line 137 and replace the erase (image 1) with this—>erase (image 2) and save the file.

Image 1. Replace erase.

Image 2. With this->erase.

NOTE: If you don't make the above stated change then you will see an error while installing the NS (image 3).

Image 3. Error (Please Follow the Previous Step).

3. Now its time to finally install the NS. Open up a terminal and move to the directory where you have extracted the package, in our case its '/home/user_name/Documents' and install NS using the following commands (image 4):

1 cd /home/user_name/Documents/ns-allinone-2.35
2 sudo ./install

It will take around 15 minutes so have patience.

Image 4. Installation in Progress.


Step 3: Set the Environment Variables

1. Assuming everything went well in the previous step and you have successfully installed your NS. Now that NS is installed, there are some environment variables that need to be added to your profile. This can be done by editing the .bashrc file. Open a new terminal and open the file using:

1 sudo gedit .bashrc

NOTE: You may want to create a backup of the .bashrc before editing, the easiest way is to copy the file to a different location. Later you can replace the edited .bashrc with the copied one in case something goes sideways or if you want to remove the NS.

2. Add the following lines AT THE END of the file. Be sure to change "/path_to" to the path of where you have extracted the NS (e.g. '/home/user_name/Documents').

# LD_LIBRARY_PATH
OTCL_LIB=/path_to/ns-allinone-2.35/otcl-1.14/
NS2_LIB=/path_to/ns-allinone-2.35/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=/path_to/ns-allinone-2.35/tcl8.5.10/library/
USR_LIB=/usr/lib/
export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB

# 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

Save the file and restart the system, alternatively you can just reload the .bashrc as:

1 source ~/.bashrc


Step 4: Validate the Installation

You need to validate NS to check if everything is OK but keep in mind that it will take a lot of time (about 1:30 hrs). Open up a terminal and move to the directory ‘/home/user_name/Documents/ns-allinone-2.35/ns-2.35/' and run:

1 ./validate

And That is it ! You can now run ns from a terminal window by executing: ns
If you received the "%" sign, it means that NS is running (image 5). Congratulations !!

Image 5. Installation Successful.


* Uninstalling the NS

If you want to remove the NS from your system then follow these steps:

1 Delete the directory 'ns-allinone-2.35'.
2 Delete the ns related files from '/user/local/bin'.
3 Edit the '.bashrc file' and remove the paths that you have added during the installation.
4 Restart the system and run following commands one by one:
5 sudo apt-get autoremove
6 sudo apt-get clean


* Some Common Problems

1. Many people are getting the following error when they run the ns after the installation:

Image 6. Error: 'ns' is currently not installed.

If you get this error then kindly ensure that you have set the path (as in step 3) correctly and try restarting the system. If the error persists then try running the ns from '/ns-allinone-2.35/ns-2.35/bin/'.


You can start working on NS now, the standard Marc Greis' tutorial on NS can be found here. Another tutorial is 'NS by example' by Jae Chung and Marc Claypool, and is available here.


P.S.

I am not working on ns anymore, if you face any problems then feel free to contact, comment but it's guaranteed that I would be able to help you. Also go through the comments before making your query. Thank you!

Have Fun !!
— * — * — * — * —

186 comments:

  1. You Man! Superb and clear cut steps. It works like charm! Thank You so much! keep writing!

    ReplyDelete
  2. Thanx bro... you write very well about ns2 installation.. keep writing bro... i get more idea about installation

    ReplyDelete
  3. hello, i had a mistake when i typed 'nam' on terminal like that: segmentation fault (core dumped), how can i solve it. Please help me as soon as possible.
    Thanks in advance

    ReplyDelete
    Replies
    1. Hello...would you please share the screenshot of your problem, and explain what did you do when u got that error ??

      Delete
    2. yeah, i did all above steps, but error 'segmentaion fault (core dumped)
      after some times 'sudo get - apt remove ns', 'sudo get - apt remove nam',
      it still appear '%' when i write 'ns' :)
      then i type 'sudo get-apt autoremove' 2 times
      luckily, 'nam' is run,
      i dont know what happen.
      sorry that i reply later.
      thanks,

      Delete
    3. Hi,
      I install ns-allinone-2.35 successfully but when I type nam and error(segmentation fail(core dumped)) is displayed.
      what is my problem and how can I solve it plz.
      shehu

      Delete
  4. Hii..

    I followed the steps mentioned above to install NS2. But after validating, if i give "ns" command in my terminal i get the below message,

    "The program ns is currently not installed , you can install it by sudo apt-get install ns2"

    Can you please provide some suggestion on the same

    Thanks...!!!

    ReplyDelete
  5. hii

    I would like add couple of screen shots o the same regarding my installation and validation report.. But i am not sure of how i can add the screen shots here..

    ReplyDelete
  6. Hii...

    The solution to the mentioned error is
    ""
    thats the message you get when your ns installation is not complete. You can write the following command and run it.

    sudo apt-get install ns2 nam xgraph
    Provide the password. It will download some packaged online and install ns2.

    You surely need internet connectivity for that. Otherwise, your problem cannot be resolved. ""

    Thank you very much for posting the steps in this Blog.. I was able to install NS2 really fast.. :)

    ReplyDelete
  7. Hiii'

    Any time I try to run the nam executable I get a segmentation fault:

    $> nam
    Segmentation fault (core dumped)

    when i searched for this issue, one website had mentioned

    to copy nam-1.15 directory from /home//Documents/ns-allinone-2.35 to /usr/local/bin

    and restart the terminal.

    i did it , but i m still getting the same error..

    Do u have any suggestions on the same..

    Thanks and regards,
    Deepthi

    ReplyDelete
    Replies
    1. Hii

      You can try this

      1. Update your nam version
      $ sudo apt-get install --reinstall nam libotcl1 libtclcl1

      if it still shows error please follow following steps:

      a) Delete the nam-1.15/ folder and any other / folder.
      b) $ sudo apt-get remove nam

      download the following nam and install
      https://drive.google.com/file/d/0B7S255p3kFXNUkx0LVU1NnFVQTA/view

      hope this will help. Goodluck :)

      Delete
  8. Hii,

    thanks for the the quick reply.. i have downloaded nam patch from the link u specified and
    i tried to extract it using command

    sudo dpkg -i

    it has created a nam* file in /usr/local/bin directory.

    when i run the executable nam .i,e, $nam
    it give the below message,

    bash: /usr/local/bin/nam : No such file or directory

    i am not sure of how to install nam patch..

    should i use the
    "sudo apt-get install nam" command to install the nam pacth.

    can u please suggest on the same..

    Thanks and Regards,
    Deepthi

    ReplyDelete
    Replies
    1. Hello...

      Its a deb package it will install on its own you just need to open it by double clicking.

      Delete
  9. I am getting the folowing message when i tried to install by clicking on the file,

    The Package is of Bad Quality
    The installation of a package which violates the quality standards isn't allowed. This could cause serious problems on your computer. Please contact the person or organisation who provided this package file and include the details beneath.

    Details ->
    Lintian check results for /home/deepthi/Documents/ns-allinone-2.35/nam_1.15-10_i386.deb:
    perl:warning:setting locale failed.
    perl:warning:please check that your locale settings:
    Language=(unset),
    LC_ALL=(unset),
    LANG ="en_IN.ISO8859-1"
    are supported and installed on your system.
    perl:warning:Falling back to the standard locale("C").
    E: nam: wrong-file-owner-uid-or-gid usr/ 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/ 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/bin/ 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/bin/lib 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/bin/nam 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/lib/ 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/lib/nam-1.15 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/lib/nam-1.15/bin 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/lib/nam-1.15/bin/tclsh8.5 1000/1000
    E: nam: wrong-file-owner-uid-or-gid usr/local/lib/nam-1.15/bin/wish8.5 1000/1000

    goes on and on and on...

    ----------------------------------------------
    to get rid of pearl error i tried to do the following and tried to reinstall nam-1.15-10 but it again popped up the same error mentioned above during the installation,

    # locale-gen en_US en_US.UTF-8 hu_HU hu_HU.UTF-8

    # dpkg-reconfigure locales
    -----------------------------------------------

    If ignore the error and go ahead with the installation, and it appears to install correctly. However, I do not see any nam folder created in /home/deepthi/Documents/na-allinone-2.35/ directory. but nam* file is created in /usr/local/bin

    i tried to install the pacth manually by using command --> sudo dpkg -i nam_1.15-10*.deb
    but still did not work , it does not show any error but no folders of nam are created as required ..

    when i run the executable nam .i,e, $nam
    it gives the below message,

    bash: /usr/local/bin/nam : No such file or directory

    but i see some folders and file in /usr/local/lib/nam-1.15 of today's date and time

    i am not sure if it is of old installation or the new nam pacth one.

    i tried to creat a link from /usr/local/bin/nam to /usr/local/lib/nam-1.15,

    but it did not help since when i again run the executable nam .i,e, $nam
    it give the below message,

    bash: /usr/local/bin/nam : is a directory.


    Any help would be appreciated..!!!

    Also please let me know how to upload screen shots , it will help me to explain better..


    Thanks..

    ReplyDelete
  10. i have done all the steps above but receiving the following error at the end
    The program 'ns' is currently not installed. You can install it by typing:
    sudo apt-get install ns2

    ReplyDelete
    Replies
    1. Please do not try to install ns by 'sudo apt-get install ns2'. First of all you have to undo all the changes you have made so far. So delete the 'ns-allinone-2.35' directory, remove the path you have set in the .bashrc file restart your system and run the following commands one by one
      1. sudo apt-get upgrade
      2. sudo apt-get update
      3. sudo apt-get autoremove
      4. sudo apt-get clean

      Again restart your system and install the ns from the beginning. You may want to look at the next comment by "Deepthi" for more information.

      Goodluck.

      Delete
    2. @ Shabeer
      check if u have set ur enivnoment variables properly in .bashrc file and make sure you have executed source ~/.bashrc after changing,

      if u r still facing problem after doing the above step

      try again by adding
      export TCL_LIBRARY=$TCL_LIBRARY$TCLIB:$USRLIB

      insted of

      export TCL_LIBRARY=$TCLIB:$USRLIB
      in ur .bashrc file and load it by "source ~/.bashrc" command.

      if the problem still persist.
      make sure ur ubuntu has all the softwares updated ( i.e, there should be no pending software update in you Appstore), also execute sudo apt-get update and sudo-apt get upgrade

      do not install ns2 by typing sudo apt-get insatll, for me this created segementaton fault (core dump) error when executing nam

      Delete
  11. hii,

    Thanks for the reply
    i am finally able to run the nam executable ... !!!! :) :)

    This is what i did,
    I unistalled ns2 ,
    since i was running ubuntu on a virtual machine. i deleted ubuntu and reinstalled it on my VM ware

    i updated ubuntu software from the app store - it took some time.

    i also executed sudo apt-get upgrade,sudo apt-get update, as u suggested..

    then as suggested in link -> http://askubuntu.com/questions/467901/segmentation-fault-core-dumped-in-ns2-ubuntu-14-04
    i downloaded ns2-2.35 again from the link -> http://garr.dl.sourceforge.net/project/nsnam/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz.

    for installation of ns2 - i followed the similar steps as u mentioned

    this time i did not execute "sudo apt-get install ns2 nam xgraph" from terminal since i was able to run ns and nam command after updating .bashrc file.
    As per the link mentioned above , i suppose segmentaion fault error was because i installed it by terminal using command "sudo apt-get install ns2 nam xgraph" .

    and also updating ubuntu before ns2 installation also helped i suppose.

    Thank You for ur suggestions.

    Best Regards,
    Deepthi

    ReplyDelete
  12. hi
    i m installing ns2.35 on ubuntu 14.04 lts
    i have got error BACKWORD COMPATIBILITY MODE while executing command ./validate
    what solution will you suggest for this.

    ReplyDelete
    Replies
    1. It seems that you have some problem with your installation. You may consider to re-install your ns from the beginning. For instruction on removal of ns and other steps to follow pls have a look at previous comments.

      Good luck.

      Delete
  13. FYI..

    The uninstallation process is pretty simple. Please follow these steps:

    1. Delete the directory 'ns-allinone-2.35'.
    2. Delete the ns related files from /user/local/bin
    3. Edit the .bashrc file and remove the paths that you have added during the installation.
    4. restart the system and run following commands one by one
    5. sudo apt-get autoremove
    6. sudo apt-get clean
    7. sudo apt-get upgrade
    8. sudo apt-get update

    After these restart your system and proceed the installation as usual.

    ReplyDelete
  14. error is shown when ./install
    permission denied

    ReplyDelete
    Replies
    1. You should change to permission of the ns directory for your current user. You may use chown or chmod command to do so.

      Delete
  15. )\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_PW_GECOS=1 -DTCL_NO_DEPRECATED /home/rajveer/ns-allinone-2.35/tk8.5.10/unix/../generic/tk3d.c
    In file included from /home/rajveer/ns-allinone-2.35/tk8.5.10/unix/../generic/tkInt.h:19:0,
    from /home/rajveer/ns-allinone-2.35/tk8.5.10/unix/../generic/tk3d.c:14:
    /home/rajveer/ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
    # include
    ^
    compilation terminated.
    make: *** [tk3d.o] Error 1
    tk8.5.10 make failed! Exiting ...
    For problems with Tcl/Tk see http://www.scriptics.com

    help me to resolve this error

    ReplyDelete
  16. hi i have installed ns2 on my ubuntu 14.04lts by steps. but while validating it gives this error..

    Running test quiescent_500ms_coarse:
    ../../ns test-suite-tcp.tcl quiescent_500ms_coarse QUIET
    Guide: Tahoe TCP after a quiescent period, coarse-grained timer, tcpTick_ 0.5.
    ns: _o4 cleanup file5 quiescent_500ms_coarse(EnblRTTCtr__1): Can't locate getopts.pl in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ../../bin/raw2xg line 37.
    while executing
    "exec $PERL ../../bin/set_flow_id -s all.tr | $PERL ../../bin/getrc -s 2 -d 3 | $PERL ../../bin/raw2xg -s 0.01 -m 90 -t $file > temp.rands"
    (procedure "_o4" line 3)
    (TestSuite finish line 3)
    invoked from within
    "$self finish $testname"
    (procedure "_o4" line 11)
    (TestSuite cleanup line 11)
    invoked from within
    "_o4 cleanup file5 quiescent_500ms_coarse(EnblRTTCtr__1)"
    Test output differs from reference output
    Diagnose with: diff test-output-tcp/quiescent_500ms_coarse.test test-output-tcp/quiescent_500ms_coarse
    Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".

    ReplyDelete
    Replies
    1. Hi there, I am facing the same issue. Please could you tell me in case you have solved it. Any help would be highly appreciated.

      Delete
    2. try installing perl using
      sudo apt-get install perl

      Delete
  17. in these lines,

    # LD_LIBRARY_PATH
    OTCLLIB=/path/to/ns-allinone-2.35/otcl-1.14
    NS2=/path/to/Documents/ns-allinone-2.35/lib

    here above in ns2= path/to/______ you have written documents again, we have to do it that way or its a mistake??

    ReplyDelete
    Replies
    1. Hey..thank you for pointing it out. Its a mistake, you dont have to add the 'Documents'.

      Delete
    2. My extracted files are in "Downloads" folder...
      What do i have to replace "path/to" with?

      1. my_user_name/Downloads

      or

      2. my_user_name/to


      Thank you...

      Delete
  18. hey i installed ns-2.34 according to steps given here,
    when i run the tcl script nam file will be generated but not able to get output.

    ReplyDelete
    Replies
    1. Not able to get output ? As in nam file in empty or nam file is not running automatically ? If its not running automatically then you have to include 'exec nam namefile.nam' in your tcl script.

      Delete
    2. i also have the same problem
      plz tell me if u solved it ..... thx

      Delete
  19. hey i included "exec nam out.nam &" in tcl but then also not able to get output.
    (nam file generated is not empty,i think its not running automatically)

    ReplyDelete
    Replies
    1. Ok. please try to run your file manually from the terminal, it will ensure whether you have a properly installed nam or not.

      Delete
  20. Thank you so much....becz of u im able 2 install ns2 successfully....tnx again #Dhyan

    ReplyDelete
  21. after installation i set my library paths

    # LD_LIBRARY_PATH
    OTCL_LIB=/home/shabeer/ns-allinone-2.35/otcl-1.14
    NS2_LIB=/home/shabeer/ns-allinone-2.35/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/shabeer/ns-allinone-2.35/tcl8.5.10/library
    USR_LIB=/usr/lib
    export TCL_LIBRARY=$TCL_LIB:$USR_LIB
    # PATH
    XGRAPH=/home/shabeer/ns-allinone-2.35/bin:/your/path/ns-allinone-2.35/tcl8.5.10/unix:/home/shabeer/ns-allinone-2.35/tk8.5.10/unix
    NS=/home/shabeer/ns-allinone-2.35/ns-2.35/
    NAM=/home/shabeer/ns-allinone-2.35/nam-1.15/
    export PATH=$PATH:$XGRAPH:$NS:$NAM

    and save it and after that i give the following command
    shabeer@shabeer-Aspire-5742:~/ns-allinone-2.35$ source ~/.bashrc
    it give the following error what can i do now plz give me quick reply

    bash: 2.35/tcl8.5.10/unix:/home/shabeer/ns-allinone-2.35/tk8.5.10/unix: No such file or directory

    ReplyDelete
    Replies
    1. hey....look at the path for the XGRAPH variable you forgot to replace '/your/path/' with '/home/shabeer/'. Correct it and it should run fine. Goodluck !!

      Delete
  22. thanx bro ...it really helpful for me....

    ReplyDelete
  23. hello sir

    after installation of ns2.35 when i tried to run some tcl file it gives following error

    divya@divya-hp-dv6:~$ cd ns2\ files/
    divya@divya-hp-dv6:~/ns2 files$ ns nodes.tcl
    divya@divya-hp-dv6:~/ns2 files$ Can't find a usable init.tcl in the following directories:
    /home/divya/NS/ns-allinone-2.35/tk8.5.10/library:/usr/lib /home/divya/ns-allinone-2.35/lib/tcl8.5 ./lib/tcl8.5 ./lib/tcl8.5 ./library ./library ./tcl8.5.10/library ./tcl8.5.10/library



    This probably means that Tcl wasn't installed properly.

    i removed tcl and reinstalled again..but again it shows the same error.

    ReplyDelete
    Replies
    1. Hello...

      It seems like there is some problem with the path that you have set, kindly ensure that you have set the path correctly. Also are you getting a '%' when you simply run the 'ns' ?

      Delete
    2. yes... its showing % when i run the "ns"

      Delete
    3. I am getting the same error.I have entered the path correctly.How to solve it?? Do reply

      Delete
    4. Pls double check your locations and paths that you are giving. In the case of Miss Divya she has missed some path variables.

      Delete
  24. i follow all the above steps but when i write command (ns) i get this messages
    segmentation fault(core dumped)
    and appers the fault window (sorry, the application nam has stopped unexpectedly)

    ReplyDelete
    Replies
    1. It happens sometimes. Pls uninstall the ns, follow the following steps and start the installation from the beginning

      1. Delete the directory 'ns-allinone-2.35'.
      2. Delete the ns related files from /user/local/bin
      3. Edit the .bashrc file and remove the paths that you have added during the installation.
      4. restart the system and run following commands one by one
      5. sudo apt-get autoremove
      6. sudo apt-get clean
      7. sudo apt-get upgrade
      8. sudo apt-get update

      Delete
    2. i am unable to uninstall ns2
      i del the drc
      no files were in usr/local/bin
      edit .bashrc
      restart system and run autoremove and clean cmds
      but still when i type ns it shows %
      plz help.......................

      Delete
    3. Seems like ns executables are still in your system. pls run this command on a terminal

      locate -i "ns.*"

      it will return the every location which contains a ns executable file. delete these files and proceed further.

      Delete
  25. where cAN I FIND TCL SCRIPTS FOR TCP VARIANTS ????????

    ReplyDelete
    Replies
    1. Pardon me I don't understand, TCP Variants for what ?

      Delete
    2. tcp variants like vegas , reno , new reno , tcp door , tcp-f , to check tcp performance...on diferrent variants

      Delete
    3. Try this:

      https://sites.google.com/a/seecs.edu.pk/network-technologies-tcp-ip-suite/home/performance-analysis-of-tcp-variants-for-wireless-networks-using-ns-2

      Delete
  26. hi.. when i try to do this command"sudo gedit .bashrc" getting like this,
    arjun@arjun-HP-2000-Notebook-PC:~/sanju/ns-allinone-2.35$ sudo gedit .bashrc

    (gedit:26982): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
    arjun@arjun-HP-2000-Notebook-PC:~/sanju/ns-allinone-2.35$

    ReplyDelete
  27. hi.. in new terminal bash file is opening.. after editing that when i save it.. im getting like this...

    arjun@arjun-HP-2000-Notebook-PC:~$ sudo gedit .bashrc
    [sudo] password for arjun:

    (gedit:27739): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:27739): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    ReplyDelete
  28. arjun@arjun-HP-2000-Notebook-PC:~/sanju/ns-allinone-2.35$ nam
    Segmentation fault (core dumped)
    arjun@arjun-HP-2000-Notebook-PC:~/sanju/ns-allinone-2.35$ source ~/.bashrc
    Does: command not found
    bash: allinone-2.35/tcl8.5.10/unix:/sanju/ns-allinone-2.35/tk8.5.10/unix: No such file or directory
    the: nothing found -- skipped.
    file: nothing found -- skipped.
    and: nothing found -- skipped.
    restart: nothing found -- skipped.
    the: nothing found -- skipped.
    system,: nothing found -- skipped.
    alternatively: nothing found -- skipped.
    you: nothing found -- skipped.
    can: nothing found -- skipped.
    just: nothing found -- skipped.
    reload: nothing found -- skipped.
    the: nothing found -- skipped.
    .bas: nothing found -- skipped.
    done.

    ReplyDelete
  29. hello friend i hv a doubt that ... i save my file in home/sanju/.... but when i type a command cd home it showiing "such a file or directory not found", so in bash file which path should i give?
    1) home/sanju/ns.....
    2)sanju/ns....
    3)arjun/sanju/ns...

    ReplyDelete
    Replies
    1. you should give the complete path to, at which you have your 'ns-allinone-2.35' folder.

      Delete
    2. im getting this error after ./validate

      validate overall report: some tests failed:
      ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
      to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

      Delete
    3. Its allright....are you getting the "%" sign >

      Delete
  30. ya dude im getting when i typed as "ns".
    tnq 4 ur response dude:)

    ReplyDelete
  31. hi sir.

    i already follow the step for install ns 2.35 on ubuntu 14.04 but there's missing .bashrc . how to solve this problem?

    ReplyDelete
    Replies
    1. hello...

      Plz refer the following link:

      http://superuser.com/questions/584540/no-bashrc-file-in-my-home-directory

      Delete
  32. Hello frnd... while executing ns2 prgrm, which file extension we hv to use and what is the command to obtain output or run the program?should we write program in editor window i.e by typing vi .... .... or in the starting terminal wr v get % symbol?

    ReplyDelete
    Replies
    1. Hello...Plz go through the tutorials first. Links are given in the Step 4, after the screenshot.

      Delete
    2. thank u ... u helped me lot... just now i run my 1st ns2 prgrm :)

      Delete
  33. Thanx for your kind information......

    ReplyDelete
  34. thank you :) it was easy to install ns throuh your tutorial

    ReplyDelete
  35. hey bro, after installing ns2 and validating, when i type 'ns' it says ns is not currently installed.
    what should i do? should i re install?

    ReplyDelete
    Replies
    1. You should reinstall it. It happens sometimes reasons unknown.

      Delete
    2. hey Dhyan , should i remove ns first and reinstalla it ? or enter : sudo apt-get install ns2 directly ?

      Delete
    3. Hello, You should remove it first and then reinstall it. Please don't use sudo apt-get install ns2, it will not work.

      Delete
  36. thank you :) tutorial very well done

    ReplyDelete
  37. how to applying the SCTP patch to NS2 package,

    ReplyDelete
    Replies
    1. Please refer the following link:

      http://www.linuxjournal.com/article/5929

      Hope it helps. Goodluck :)

      Delete
  38. is this ns 2.35 compatible to 64 bit?

    ReplyDelete
  39. thank u so mch sir........ its working .....

    ReplyDelete
  40. I got following validation report and error

    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

    root@ubuntu:/home/shivanshu/ns-allinone-2.35/ns-2.35# ns
    ns: error while loading shared libraries: libtcl8.5.so.0: cannot open shared object file: No such file or directory

    please help....

    ReplyDelete
    Replies
    1. Did you manage to solve this problem?

      Delete
    2. Try this:

      TCLIB=/path/to/ns-allinone-2.35/tcl8.5.10/library
      instead of
      TCLIB=/path/to/ns-allinone-2.35/tk8.5.10/library

      Delete
    3. Problem remain the same unfortunately. Are there any other suggestion to solve it?

      Delete
    4. Hello Mr. Dhyan
      After validation I found the same problem TCLIB=/path/to/ns-allinone-2.35/tcl8.5.10/library already there in .bashrc file. would you please advise ?

      Delete
  41. When i am doing step 2, at "sudo apt-get upgrade" i got interrupted and saying "dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem."
    What should i do now?

    ReplyDelete
  42. This problem is related to your ubuntu configuration. Kindly run the command suggested by the system i.e. sudo dpkg --configure -a

    ReplyDelete
  43. can ns2.35 run LTE projects ?

    ReplyDelete
    Replies
    1. You may try these links:

      1. http://naveenshanmugam.blogspot.in/2014/02/lte-long-term-evaluation-network-in-ns2.html
      2. https://www.academia.edu/5258157/Traffic_Modeling_of_LTE_Mobile_Broadband_Network_Based_on_NS2_Simulator

      Delete
  44. 3. Before installing the NS we have to install some essential packages required by the NS. So run the following commands:

    1 sudo apt-get install tcl8.5-dev tk8.5-dev
    For the above step i'm getting error message as
    "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"
    What to do?

    ReplyDelete
    Replies
    1. You may try to run:

      1. sudo apt-get update --fix-missing
      2. sudo dpkg-reconfigure -all

      Delete
  45. Dhyan...when i tried to validate, the terminal shows "permission denied"...what can i do?

    ReplyDelete
  46. Please make sure that you the admin of the system or have necessary rights to run the command. You can also try "sudo ./validate".

    ReplyDelete
  47. thank you works for me exactly!

    ReplyDelete
  48. TCLIB=/path/to/ns-allinone-2.35/tcl8.5.10/library
    instead of
    TCLIB=/path/to/ns-allinone-2.35/tk8.5.10/library

    ReplyDelete
  49. after success full installation ns 2.34 in ubuntu 14.04
    adding path using gedit .barshrc ir=t works well and close terminal and again type ns it says "ns currently not installed"
    i add path at proper location no doubt
    can help me

    ReplyDelete
    Replies
    1. Did you tried reloading the .bashrc using 'source ~/.bashrc' or tried restarting the system ?
      Also check your .bashrc and ensure that your changes have been saved successfully.

      Delete
  50. i have ah problem on during installation. i followed your steps it will perfectly working untiil the validation
    process after i validate it shows " some test failed" after i type ns means "ns is not currently installed" this will be displayed plz hlp me go ahead

    ReplyDelete
    Replies
    1. I have modified the procedure, please uninstall the NS first then start from the 1st step. Also let me know if it helps.

      Delete
  51. ns installed successfully
    but when in run nam
    it gives
    bash /usr/local/bin/nam no such file or directory
    please help

    ReplyDelete
    Replies
    1. I have modified the procedure, please set the environmental variables again and follow the procedure from 3rd step. Let me know if it helps.

      Delete
  52. i got % symbol after the installation but while i type nam means "segmentation fault (core dumped)" this error will be suited plz help me

    ReplyDelete
    Replies
    1. I have modified the procedure, please uninstall the NS first then start from the 1st step. Also let me know if it helps.

      Delete
    2. while uninstalling...how to edit .bashrc file i am not finding what i have edited in .bashrc file

      Delete
  53. hello sir im facing problem when trying to run tcl file, it said "the program ns currently not installed, you can install by type sudo apt-get ns2" , but i havent type that command, so what should i do sir? thank you for your respon

    ReplyDelete
    Replies
    1. Please ensure that you have set the path correctly. Also see the P.S. section of the above post.

      Delete
  54. I have followed all the steps but when I run 'ns' in terminal this error is displayed-
    "The program 'ns' is currently not installed. You can install it by typing:
    sudo apt-get install ns2"

    ReplyDelete
    Replies
    1. Please ensure that you have set the path correctly. Also see the P.S. section of the above post.

      Delete
    2. i installed ns2 suceessfully
      but nam was not working
      can u help me out of this

      Delete
    3. i also got the same problem ...so i installed it by typing:
      sudo apt-get install ns2"

      Delete
  55. i follow all the above steps but when i write command (ns) it give me %
    but when i write nam i get this messages
    segmentation fault(core dumped)
    when execute scenario tcl it's OK but without nam

    ReplyDelete
    Replies
    1. Try to run the nam from the "ns-allinone-2.35/nam-1.15/bin". Also see if there's a nam file in "/usr/local/bin". Try to run the both one by one; see whether anyone of them is working correctly or not.

      Delete
    2. nam which is in "/usr/local/bin" is working when ı click double.But when ı write "nam" in terminal,again ı got segmentation fault error.Then what should ı do? thanks in advance

      Delete
    3. i get ....running nam... but nam animation will not open

      Delete
  56. please help removing this error

    gaurav@ubuntu:~$ ns
    ns: error while loading shared libraries: libtcl8.5.so.0: cannot open shared object file: No such file or directory

    ReplyDelete
  57. Dear Dhyan
    i'am a new ns2 my question is how do to integrate a new algorithm of scheduling packets in MANET by using ns2, please tell me the steps
    thanks

    ReplyDelete
  58. Awesome sequential help! thumbs up bro. keep it up the good work!!!!!

    ReplyDelete
  59. i hav a problem when calling nam
    child killed: segmentation voilation
    this error arise..
    i insalled every thing you told above..
    kindly help to get it working

    ReplyDelete
  60. immediately after adding path in .bashrc file i am getting this error in terminal

    (gedit:28544): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    ReplyDelete
  61. Hi Dhyan,

    After installation I have tried to run "ns" command which gives me the % which was fine.
    But when I tried to run "nam" command I got the following error:

    abhi@abhi-Inspiron-3521:~/Documents/ns-allinone-2.35$ nam
    nam: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    abhi@abhi-Inspiron-3521:~/Documents/ns-allinone-2.35$

    I have gone through all the comments and replies in this page, but didn't helped me out.

    Hope you can help me out.
    Thanks

    ReplyDelete
  62. sir i follow ur manual i git error while i give nam command error was segmentation fault(core dumped)
    i got % also.pls give suggestion very soon

    ReplyDelete
  63. I have following your guide up to the install. Everything seems to be running fine until I reach the "Build OTcl-1.14" section. Specifically, I see the following error:

    checking for X11 header files
    can't find X includes
    otcl-1.14 configuration failed! Exiting ...

    Can you please help me fix this? Thanks in advance.

    ReplyDelete
  64. In regards to my previous question (concerning OTcl-1.14 build), here is that entire section of the install:

    ============================================================
    * Build OTcl-1.14
    ============================================================
    No .configure file found in current directory
    Continuing with default options...
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking how to run the C preprocessor... gcc -E
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for string.h... (cached) yes
    checking for main in -lXbsd... no
    checking for socket in -lsocket... no
    checking for gethostbyname in -lnsl... yes
    checking for dcgettext in -lintl... no
    checking for getnodebyname in -ldnet_stub... no
    checking that g++ can handle -O2... yes
    checking standard STL is available... no
    checking for tcl.h... -I../include
    checking for tclInt.h... -I../include
    checking for libtcl8.5... -L../lib -ltcl8.5
    checking for init.tcl... ../lib/tcl8.5
    checking for http.tcl... ../lib/tcl8.5/http1.0
    checking Tcl http.tcl library... yes
    checking for tclsh8.5.10... no
    checking for tclsh8.5... ../bin/tclsh8.5
    checking for tk.h... -I../include
    checking for libtk8.5... -L../lib -ltk8.5
    checking for tk.tcl... ../lib/tk8.5
    checking for X11 header files
    can't find X includes
    otcl-1.14 configuration failed! Exiting ...
    Please check http://www.isi.edu/nsnam/ns/ns-problems.html
    for common problems and bug fixes.

    ReplyDelete
  65. hi
    I have set the path as per the directions given above in ubuntu 11.10 and reload the bash file also. During validation following response occurs in the terminal. Plz help why this is happening.

    Some test failed.
    Mon May 25 15:58:49 IST 2015
    Mon May 25 15:58:51 IST 2015
    *** ./test-all-sack
    Tests: sack1 sack1z sack1a sack1aa sack1b sack1c sack3 sack5 sack5a sackB2 sackB4 sackB4a FalsePipe FalsePipe1 sack_dupacks sack_finiteflow sack_dupacks1
    Running test sack1:
    ../../ns test-suite-sack.tcl sack1 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1z:
    ../../ns test-suite-sack.tcl sack1z QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1a:
    ../../ns test-suite-sack.tcl sack1a QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1aa:
    ../../ns test-suite-sack.tcl sack1aa QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1b:
    ../../ns test-suite-sack.tcl sack1b QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1c:
    ../../ns test-suite-sack.tcl sack1c QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack3:
    ../../ns test-suite-sack.tcl sack3 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack5:
    ../../ns test-suite-sack.tcl sack5 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack5a:
    ../../ns test-suite-sack.tcl sack5a QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sackB2:

    ReplyDelete
  66. Hi
    I am getting the following response during validation. plz help..

    Some test failed.
    Mon May 25 15:58:49 IST 2015
    Mon May 25 15:58:51 IST 2015
    *** ./test-all-sack
    Tests: sack1 sack1z sack1a sack1aa sack1b sack1c sack3 sack5 sack5a sackB2 sackB4 sackB4a FalsePipe FalsePipe1 sack_dupacks sack_finiteflow sack_dupacks1
    Running test sack1:
    ../../ns test-suite-sack.tcl sack1 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1z:
    ../../ns test-suite-sack.tcl sack1z QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1a:
    ../../ns test-suite-sack.tcl sack1a QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1aa:
    ../../ns test-suite-sack.tcl sack1aa QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1b:
    ../../ns test-suite-sack.tcl sack1b QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack1c:
    ../../ns test-suite-sack.tcl sack1c QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack3:
    ../../ns test-suite-sack.tcl sack3 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack5:
    ../../ns test-suite-sack.tcl sack5 QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sack5a:
    ../../ns test-suite-sack.tcl sack5a QUIET
    ./test-all-template1: 149: ../../ns: not found
    Running test sackB2:

    ReplyDelete
  67. Hi;
    I follow all these steps but when I wrote ./validate or sudo ./validate,firstly I saw in terminal "some test outputs agrees with reference outputs" but after that I saw this and it repeats for other tests ;

    Running test resetSack1:
    ../../ns test-suite-tcpReset.tcl resetSack1 QUIET
    Guide: Sack TCP, resetting a TCP connection.
    ns: _o4 cleanup file5 resetSack1: Can't locate getopts.pl in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ../../bin/raw2xg line 37.
    while executing
    "exec $PERL ../../bin/set_flow_id -s all.tr | $PERL ../../bin/getrc -s 2 -d 3 | $PERL ../../bin/raw2xg -s 0.01 -m 90 -t $file > temp.rands"
    (procedure "_o4" line 3)
    (TestSuite finish line 3)
    invoked from within
    "$self finish $testname"
    (procedure "_o4" line 11)
    (TestSuite cleanup line 11)
    invoked from within
    "_o4 cleanup file5 resetSack1"
    Test output differs from reference output
    Diagnose with: diff test-output-tcpReset/resetSack1.test test-output-tcpReset/resetSack1
    Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".
    Running test resetReno:
    ../../ns test-suite-tcpReset.tcl resetReno QUIET
    Guide: Reno TCP, resetting a TCP connection.
    ns: _o4 cleanup file5 resetReno: Can't locate getopts.pl in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at ../../bin/raw2xg line 37.
    while executing
    "exec $PERL ../../bin/set_flow_id -s all.tr | $PERL ../../bin/getrc -s 2 -d 3 | $PERL ../../bin/raw2xg -s 0.01 -m 90 -t $file > temp.rands"
    (procedure "_o4" line 3)
    (TestSuite finish line 3)
    invoked from within
    "$self finish $testname"
    (procedure "_o4" line 11)
    (TestSuite cleanup line 11)
    invoked from within
    "_o4 cleanup file5 resetReno"
    Test output differs from reference output
    Diagnose with: diff test-output-tcpReset/resetReno.test test-output-tcpReset/resetReno
    Or see URL "http://www.isi.edu/nsnam/ns/ns-problems.html".
    Some test failed.

    Could you help me please? thanks.

    ReplyDelete
  68. vikram2403@vikram2403-Inspiron-3541:~/vikram/ns-allinone-2.35$ sudo gedit .bashrc
    [sudo] password for vikram2403:

    (gedit:19447): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:19447): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
    ^Cvikram2403@vikram2403-Inspiron-3541:~/vikram/ns-allinone-2.35$ pwd
    /home/vikram2403/vikram/ns-allinone-2.35
    vikram2403@vikram2403-Inspiron-3541:~/vikram/ns-allinone-2.35$ sudo gedit .bashrc

    (gedit:19499): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:19499): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:19499): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:19499): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    (gedit:19499): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    ReplyDelete
  69. devanshi@devanshi-virtual-machine:~$ ns lab1.tcl
    warning: no class variable LanRouter::debug_

    see tcl-object.tcl in tclcl for info about this warning.

    devanshi@devanshi-virtual-machine:~$

    ReplyDelete
  70. hiii dere
    i m new to ns2,,i install ns2 using following commands
    sudo apt-get update
    sudo apt-get install ns2
    sudo apt-get install nam
    sudo apt-get install tcl
    sudo apt-get install Xgraph

    installed successfully,,,,tcl scripts are running smoothly
    but tutorials m following describes some c files ,,, m not able to search any directory of such files
    i search some cc files of protocol but not able to figure out where to compile these files and how to link those files with ns2,,,
    please help
    i tried nsallinone for installation of ns2 earlier but all in vain ,,,shows error file not found etc etc

    ReplyDelete
  71. warning is shown in terminal while editing in bashrc file
    (gedit:27884): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

    ReplyDelete
  72. hiii dere ..i m stucked ,,,file u have mentioned here to modify "erase" .. m not able to fing dis file ,,not manually not by GUI....what to do please. help...

    ReplyDelete
  73. Hello !
    I have completed all the instruction as said and got % after entering ns.
    but after entering nam , it says dumped or something like that. How can I resolve ?

    ReplyDelete
  74. i cant remove ns from /user/local/bin
    pemishon denaid
    file protected

    ReplyDelete
  75. Hi Dhyan Singh
    I am getting error "package gcc-4.4 has no installation candidate" when i entered the following command "sudo apt-get install gcc-4.4"
    kindly help me out.
    thanks

    ReplyDelete
  76. Hey
    I am getting this error after ./validate

    These messages are NOT errors and can be ignored:
    warning: using backward compatibility mode
    This test is not implemented in backward compatibility mode


    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

    kindly help me out
    thanks

    ReplyDelete
  77. Hi...!!
    im not able to edit ls.h file...its an readonly file so what shall i do to make it writable to make necessary changes as stated above?

    ReplyDelete
  78. Hi! thanks for evry thing ......I have ubuntu 15.10 desktop amd64 and ns2.35 i need help to install it, so help me please.......THANKS

    ReplyDelete
  79. Can you please share steps to patch DTNAgent to ns2.35 ? Thanks in advance.

    ReplyDelete
  80. Can anybody help me with these errors? This happened when i tried to validate

    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

    ReplyDelete
  81. Hi
    I installed ns2.35 in ubuntu 12.04 LTS. It works. I changed the type of DSR cache from mobicache(the default cache) to linkcache. then recompile ns2. It gives me the following error
    dsr/linkcache .cc: fatal error: list.h: no such file or directory.
    I used locate list.h and this is its directory
    /usr/src/linux-headers-3.2.0-29/include/linux/list.h
    I tried to pass this directory then use #include "list.h" but it doesn't work. it gives another error
    poisson.h no such file or directory
    Please help me

    ReplyDelete
  82. hi,
    how to add leach protocol for ns2.35 in ubuntu 14.04 64 bit.
    please help

    ReplyDelete
  83. ram@ram-Lenovo-E40-70:~/Documents/ns-allinone-2.35/ns-2.35$ ns mannasim-rede-plana.tcl
    num_nodes is set 12
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead
    invalid command name "EnergyModel/Battery"
    while executing
    "EnergyModel/Battery create _o33 _o15 100.0 0.5 0.2"
    invoked from within
    "catch "$className create $o $args" msg"
    invoked from within
    "if [catch "$className create $o $args" msg] {
    if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
    delete $o
    return ""
    }
    global errorInfo
    error "class $..."
    (procedure "new" line 3)
    invoked from within
    "new $energyModel_ $node $initialEnergy_ $l1 $l2"
    invoked from within
    "if [info exists energyModel_] {
    if [info exists level1_] {
    set l1 $level1_
    } else {
    set l1 0.5
    }
    if [info exists level2_] {
    set l2 $level2_
    } else {..."
    (procedure "_o3" line 115)
    (Simulator create-wireless-node line 115)
    invoked from within
    "_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
    "eval $self create-wireless-node $args"
    (procedure "_o3" line 23)
    (Simulator node line 23)
    invoked from within
    "$ns_ node"
    (procedure "create_sink" line 8)
    invoked from within
    "create_sink"
    (file "mannasim-rede-plana.tcl" line 350)

    ReplyDelete
  84. i am getting an error called cant open file or directory.what to do please reply

    ReplyDelete
  85. how can i intergrate realapp patch in ns2.33

    ReplyDelete
  86. after installation i set my library paths
    # LD_LIBRARY_PATH
    OTCL_LIB=/home/jaziri/ns-allinone-2.35/otcl-1.14/
    NS2_LIB=/home/jaziri/ns-allinone-2.35/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/jaziri/ns-allinone-2.35/tcl8.5.10/library/
    USR_LIB=/usr/lib/
    export TCL_LIBRARY=$TCL_LIBRARY:$TCL_LIB:$USR_LIB
     
    # PATH
    XGRAPH=/home/jaziri/ns-allinone-2.35/xgraph-12.2/:/home/jaziri/ns-allinone-2.35/bin/:/home/jaziri/ns-allinone-2.35/tcl8.5.10/unix/:/home/jaziri/ns-allinone-2.35/tk8.5.10/unix/
    NS=/home/jaziri/ns-allinone-2.35/ns-2.35/
    NAM=/home/jaziri/ns-allinone-2.35/nam-1.15/
    export PATH=$PATH:$XGRAPH:$NS:$NAM


    and save it and after that i give the following command
    source ~/.bashrc
    it give the following error what can i do now plz give me quick reply
    jaziri@jaziri-virtual-machine:~$ source ~/.bashrc
     : command not found

    ReplyDelete
  87. After Validating I am getting error as follows:-

    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

    What do I do?
    My ubuntu version is 15.10.
    Please do reply and help!

    ReplyDelete
  88. Hello, i have a problem when i run tcl script on ns, there is a text appear
    warning: using backward compability mode
    error when calling clas OldSim: x.tcl
    So, what should i do? Please help me

    ReplyDelete
  89. Worked perfectly on Ubuntu 15.04. Thank you..

    ReplyDelete
  90. Thank you sir.You have explained very well about the installation.The installation worked perfectly in Ubuntu 14.04 LTS.

    ReplyDelete
  91. hello sir,
    could you please guide me regarding broadcasting in one hop neighbors in mobile ad hoc networks.

    ReplyDelete
  92. hi.
    can you please tell me how to run xgraph?

    ReplyDelete
  93. thanks Mr. Dhyan singh. The steps are very explanatory. It worked really well for me

    ReplyDelete
  94. Hi Sir,
    I have completed my installation, it gives the final reports which is basically some tests are failed. the output is below

    These messages are NOT errors and can be ignored:
    warning: using backward compatibility mode
    This test is not implemented in backward compatibility mode


    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME

    so how could i fix these failures.
    bundle of thanks!

    ReplyDelete
  95. hi!!
    im getting the same error as that is in the screenshot you put above.i tried the things u asked me to do.but im still getting the same error

    ReplyDelete
  96. I got this error:
    --------------------------------------------------------------------------------
    /home/aa/Documents/ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: No such file or directory
    compilation terminated.
    make: *** [tk3d.o] Error 1
    --------------------------------------------------------------------------------
    Any ideas?

    ReplyDelete
  97. rm: cannot remove ‘/home/adil/Documents/ns-allinone-2.35/lib/libtcl8.5.a’: Permission denied
    mv: cannot stat ‘/home/adil/Documents/ns-allinone-2.35/lib/#inst.32334#’: No such file or directory
    ranlib: could not create temporary file whilst writing archive: No more archived files
    make: *** [install-binaries] Error 1
    tcl8.5.10 installation failed.
    Tcl is not part of the ns project. Please see www.Scriptics.com
    to see if they have a fix for your platform.


    how to overcome this error sir

    ReplyDelete
    Replies
    1. Hi dear Sir, I met the same problem as you. I want to know if you solved it or not and could you tell me the way to overcome it?
      Many Thanks

      Delete
  98. Hello
    I try to integrate mannasim with ns2.35 and when I run the command ./configure it shows me this error "Installation of tcl seems incomplete orcan't be found automatically" So I fix it with "./configure --with-tcl-ver=8.5" but unfortunetaly when I ran the command "make" I got this error "No rule to make target mannasim/accessPointApp.o,needed by 'ns'.Stop" So what should I do? and thanks in advance

    ReplyDelete
  99. Please can you guide me if i want to install some earlier release of NS-2 that is NS-2.1b4.SO there will be same installation process or any other way please guide me.
    writetooadnan@gmail.com

    ReplyDelete
  100. Hi,

    I have extracted the tar of nsallinone-2.35.
    Downloaded the implementation of mptcp from https://code.google.com/archive/p/multipath-tcp/source/default/source.
    Copied the mptcp and mptcp-full files in ns-2.35/tcp and trace files in ns-2.35/trace.
    Made changes in Makefile accordingly.

    I then build/install the ns-2.35 using ./install command. Confiured and validated; everything worked perfectly.

    But now when I execute the mptcp script, I get this error

    invalid command name "Agent/TCP/FullTcp/Sack/Multipath"
    while executing
    "Agent/TCP/FullTcp/Sack/Multipath create _o300 "
    invoked from within
    "catch "$className create $o $args" msg"
    invoked from within
    "if [catch "$className create $o $args" msg] {
    if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
    delete $o
    return ""
    }
    global errorInfo
    error "class $..."
    (procedure "new" line 3)
    invoked from within
    "new Agent/TCP/FullTcp/Sack/Multipath"
    invoked from within
    "set tcp0 [new Agent/TCP/FullTcp/Sack/Multipath]"
    (file "mptcp-sample.tcl" line 98)


    Please help me with it !!

    Thank you in advance.


    ReplyDelete
  101. validate overall report: some tests failed:
    ./test-all-tcpLinux
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME


    what to do although I am getting the % sign??

    ReplyDelete
  102. In file included from ./mdart/mdart.h:52:0,

    from ./mdart/mdart_adp.h:51,

    from mdart/mdart_adp.cc:47:

    ./mdart/mdart_function.h:230:17:
    note: candidates are: nsaddr_t hash(nsaddr_t)
    inline nsaddr_t hash(nsaddr_t id) {

    ^~~~
    In file included from /usr/include/c++/6.2.1/bits/basic_string.h:5628:0,

    from /usr/include/c++/6.2.1/string:52,

    from /usr/include/c++/6.2.1/bitset:47,

    from ./mdart/mdart_function.h:62,

    from ./mdart/mdart.h:52,

    from ./mdart/mdart_adp.h:51,

    from mdart/mdart_adp.cc:47:
    /usr/include/c++/6.2.1/bits/functional_hash.h:58:12: note:
    template struct std::hash
    struct hash;

    ^~~~
    Makefile:93: recipe for target 'mdart/mdart_adp.o' failed
    make: *** [mdart/mdart_adp.o]
    Error 1
    Ns make failed!

    I AM FACING ABOVE PROBLEM....

    ReplyDelete
  103. In file included from ./mdart/mdart.h:52:0,

    from ./mdart/mdart_adp.h:51,

    from mdart/mdart_adp.cc:47:

    ./mdart/mdart_function.h:230:17:
    note: candidates are: nsaddr_t hash(nsaddr_t)
    inline nsaddr_t hash(nsaddr_t id) {

    ^~~~
    In file included from /usr/include/c++/6.2.1/bits/basic_string.h:5628:0,

    from /usr/include/c++/6.2.1/string:52,

    from /usr/include/c++/6.2.1/bitset:47,

    from ./mdart/mdart_function.h:62,

    from ./mdart/mdart.h:52,

    from ./mdart/mdart_adp.h:51,

    from mdart/mdart_adp.cc:47:
    /usr/include/c++/6.2.1/bits/functional_hash.h:58:12: note:
    template struct std::hash
    struct hash;

    ^~~~
    Makefile:93: recipe for target 'mdart/mdart_adp.o' failed
    make: *** [mdart/mdart_adp.o]
    Error 1
    Ns make fail


    I AM FACING THIS PROBLEM....

    ReplyDelete
  104. Hello
    while i'm running simple tcl file nam file is not generating

    please help me with this

    ReplyDelete
  105. hii
    i am not able to copy nam-1.14 from desktop to usr/local/bin and dont know how to use comand cdmod or cdowr plz help

    ReplyDelete
    Replies
    1. copying name from desktop to your desired location use cp /home/user_name/Desktop/nam-1.14 /usr/local/bin

      Delete
  106. i need a package of AES in NS2.35....how can we include that package... pls help me

    ReplyDelete
  107. how can we include AES package in ns2.35.

    ReplyDelete
  108. im getting this error after ./validate

    validate overall report: some tests failed:
    ./test-all-tcp ./test-all-testReno ./test-all-newreno ./test-all-sack ./test-all-tcpOptions ./test-all-tcpReset ./test-all-testReno-full ./test-all-testReno-bayfull ./test-all-sack-full ./test-all-tcp-init-win ./test-all-tcpVariants ./test-all-LimTransmit ./test-all-aimd ./test-all-rfc793edu ./test-all-rfc2581 ./test-all-rbp ./test-all-tcpLinux ./test-all-frto ./test-all-ecn ./test-all-ecn-ack ./test-all-ecn-full ./test-all-quickstart ./test-all-manual-routing ./test-all-red ./test-all-adaptive-red ./test-all-red-pd ./test-all-rio ./test-all-vq ./test-all-rem ./test-all-gk ./test-all-pi ./test-all-cbq ./test-all-schedule ./test-all-links ./test-all-oddBehaviors
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME
    thanks

    ReplyDelete
  109. hi, i am getting this problem after doing all the steps , what should i do plz let me know,
    iqtidar@iqtidar:~$ ns
    The program 'ns' is currently not installed. You can install it by typing:
    sudo apt-get install ns2
    iqtidar@iqtidar:~$ ns
    The program 'ns' is currently not installed. You can install it by typing:
    sudo apt-get install ns2

    ReplyDelete
  110. Hi sir,

    I want to fix the number of packets for transmission from node1 to node2 in wireless scenario. Like i need to transmit only 50 packets from node 1 to 2. If this is possible please send me the tcl script sir

    my mailid: gowthamsankarss@gmail.com

    ReplyDelete
  111. hi.
    num_nodes is set 20
    warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
    INITIALIZE THE LIST xListHead
    channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
    highestAntennaZ_ = 1.5, distCST_ = 156.7
    SORTING LISTS ...DONE!
    Segmentation fault (core dumped)

    ReplyDelete
  112. hi guys i have done every thing as mentioned ..but i have getting error at last step..as follows: "sudo: ./install:command not found.pls help me

    ReplyDelete
  113. after writing sudo gedit .bashrc
    the .bashrc file is created empty....what to do..?????????????..

    ReplyDelete
    Replies
    1. i also got the same error...please anyone tell what to do

      Delete
  114. Hello sir when i tried to run the following command "sudo apt-get install perl xgraph libxt-dev libx11-dev libxmu-dev" to install essential for ns2 it show error 404 means the link are down. Can you provide this file manually through email(janafridi678@gmail.com). I am waiting for your response.

    ReplyDelete
  115. after writing sudo gedit .bashrc
    the .bashrc file is created empty....what to do..?????????????..

    ReplyDelete
  116. Which Ubuntu version is needed for ns2 xgraph ??
    I am not able to run xgraph .. awk tcl files works properly in my Ubuntu 18 version .. please help

    ReplyDelete