Saturday, October 20, 2012

Installing NS-2.31 in Ubuntu 12.04

Follow the below given steps:


  • Download ns-allinnone-2.31 from nasam website
             http://sourceforge.net/projects/nsnam/files/ns-2
  • Create a folder in /home with the name ns2
  •  Extract the tar file in ns2 
  • Open terminal and type cd ns2/ns-allinone-2.31
  •  Install required libraries for ns2 using terminal
            sudo apt-get install build-essential autoconf automake libxmu-dev
  •  Then, sudo ./install 
 -----------------------------------------------------------------------------------------------------------------
 For errors,
  

1.

ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems


Solution:
In otcl-1.13/configure, line number 5516

-SHLIB_LD="ld -shared"
+SHLIB_LD="gcc -shared"


93 comments:

  1. Hi sir,

    For my project I want to implement blackhole attack.I added new protocol for this files and all edited sir.
    ns2 recompilation is not giving error ,but am getting following error during tcl script compilation

    [vidya@localhost ns-allinone-2.34]$ ns BlackHole.tcl

    ns:

    [code omitted because of length]

    : invalid command name "Agent/blackholeAODV"

    while executing

    "Agent/blackholeAODV instproc init args {

    $self next $args

    }"


    Please help me to solve this error.

    ReplyDelete
  2. please help me,do u know how to install this software Mr.ramkrishna?

    ReplyDelete
  3. sorry itz Mr.ramakrishna,by mistake i wrote Mr.ramkrihna

    ReplyDelete
  4. Avani sangram jadhavFebruary 25, 2013 at 8:51 PM

    Respected Sir
    I'm trying to add a new protocol in NS2.34 and getting this error...pls help me..

    user@user-OptiPlex-980:~/ns/ns-allinone-2.34/ns-2.32_tbmnd$ ./configure
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    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 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 minix/config.h usability... no
    checking minix/config.h presence... no
    checking for minix/config.h... no
    checking whether it is safe to define __EXTENSIONS__... yes
    No .configure file found in current directory
    Continuing with default options...
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking target system type... i686-pc-linux-gnu
    checking for gcc... (cached) gcc
    checking whether we are using the GNU C compiler... (cached) yes
    checking whether gcc accepts -g... (cached) yes
    checking for gcc option to accept ISO C89... (cached) none needed
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking for ANSI C header files... (cached) 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... no
    checking if C++ libraries work without any namespace... no
    checking if C++ libraries work with namespace std... yes
    checking if STL works without any namespace... no
    checking if STL works with namespace std... yes
    checking should use STL... yes
    checking for tcl.h... -I../include
    checking for libtcl8.4... -L../lib -ltcl8.4
    checking for init.tcl... ../lib/tcl8.4
    checking for tclsh8.4.15... no
    checking for tclsh8.4... ../bin/tclsh8.4
    checking for tk.h... -I../include
    checking for libtk8.4... -L../lib -ltk8.4
    checking for tk.tcl... ../lib/tk8.4
    checking for otcl.h... -I../otcl-1.13
    checking for libotcl1.13... -L../otcl-1.13 -lotcl
    checking for tclcl.h... -I../tclcl-1.19
    checking for libtclcl... no
    checking for tcl2c++... /usr/bin
    configure: error: Installation of tclcl seems incomplete or can't be found automatically.
    Please correct the problem by telling configure where tclcl is
    using the argument --with-tclcl=/path/to/package
    (perhaps after installing it),
    or the package is not required, disable it with --with-tclcl=no.
    user@user-OptiPlex-980:~/ns/ns-allinone-2.34/ns-2.32_tbmnd$

    ReplyDelete
  5. Hello sir how can i use lagrangian relaxation method in my coding part and where i use this .

    ReplyDelete
    Replies
    1. Hi,

      Sorry, I don't know what is lagrangian relaxation method.

      Delete
  6. hi sir is there any chance to use algorithm in ns2?

    ReplyDelete
  7. Your instructions are ambiguous, the title says "Installing NS-2.31", first step says "Download ns-allinnone-2.34", 4th instruction says "Open terminal and type cd ns2/ns-allinone-2.31"..

    I am confused!? are these instructions are for ns-2.31 or ns-2.34!?

    ReplyDelete
    Replies
    1. Thanks for the quick turnaround.

      and Thanks for keeping anonymous postings ON!!

      Delete
    2. Hi,

      Thank you very much for you comments and suggestions.

      Delete
  8. I am getting the error while 'make'ing the file, it's related to ls.cc & ls.h!? Any help will be appreciated..

    In file included from linkstate/ls.cc:67:0:
    linkstate/ls.h: In instantiation of ‘void LsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
    linkstate/ls.cc:396:28: required from here
    linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
    linkstate/ls.h:137:20: note: use ‘this->erase’ instead
    make: *** [linkstate/ls.o] Error 1
    Ns make failed!

    ReplyDelete
  9. Hi,

    Please check other pages of this blog, you will get solution for the above error.

    ReplyDelete
    Replies
    1. Hello Sir..
      I have got same problem as above during installation of ns 2.31 in ubuntu 12.04.
      can u plz give solution.

      Delete
    2. Hello Sir,
      i have got same problem while installing ns2.31 in ubuntu

      linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
      linkstate/ls.h:137:20: note: use ‘this->erase’ instead
      make: *** [linkstate/ls.o] Error 1
      Ns make failed!
      See http://www.isi.edu/nsnam/ns/ns-problems.html for problems


      can u plz give solution

      Delete
    3. Hi,

      Please check other pages of this blog, you will get solution for the above error.

      Delete
    4. Hello Sir!
      Thank you for reply..
      I have installed ns 2.31 success fully bue while making changes in bashrc file problem occurs.
      im editing bashrc file located at /home using 'gedit ~./bashc'
      it opens in gedit, i can madify and save it..
      but while running script 'source ~./bash', 'No such file or directory found error' occurs..
      can u plz tell me exact location of bashrc file?
      Thank Tou.

      Delete
    5. Hello sir,
      Xgraph is not installed when ns2.31 is installed.
      it gave message like "please compile your xgraph separately".
      what changes i should make in bashrc file, bcz it contains path for xgraph also..

      Delete
    6. HI,

      It should be ./bashrc.

      Compile xgraph separately in xgraph folder.
      ./configure
      make

      Delete
  10. Hi,,,my problems..

    validate overall report: some tests failed:
    ./test-all-newreno ./test-all-tcpOptions ./test-all-tcpVariants ./test-all-aimd ./test-all-frto ./test-all-quickstart ./test-all-manual-routing ./test-all-session ./test-all-links
    to re-run a specific test, cd tcl/test; ./test-all-TEST-NAME
    Notice that some tests in webcache will fail on freebsd when -O is turned on.
    This is due to some event reordering, which will disappear when -g is turned on.


    please help me...thanks

    ReplyDelete
    Replies
    1. HI,

      That is not error. It will show that message to validate very specific TCL scripts.

      Delete
    2. thanks Ramakrishna, its very helpfull...

      Delete
    3. Ramakrishna, how to patch wimax in ns-2.31 ?

      thank you very much

      Delete
  11. 1. 0$ sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3
    2. In ns-allinone-2.34/otcl-1.13/Makefile.in I changed
    CC= gcc-4.3
    3.$ sudo su

    # ./install
    4. after installation i have changed path variable in ~/.bashrc
    5. then i did, # source ~/.bashrc
    then ns. It shows %. when i opened nam, animator window opens.

    the problem is when i run my program, it says ns command not found.
    pls help me how to rectify this. Is my installation steps correct.

    ReplyDelete
    Replies
    1. i done coding and save it as sample.tcl
      in terminal i changed the directoty to ns-allinone-2.34 folder.
      then i run my coding as ns sample.tcl
      it shows ns command not found

      Delete
  12. hello sir this error is come in ns 2.31 and nam will not appear

    [code omitted because of length]
    : no event type or button # or keysym
    while executing
    "bind Listbox {
    %W yview scroll [expr {- (%D / 120) * 4}] units
    }"
    invoked from within
    "if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
    bind Listbox {
    %W yview scroll [expr {- (%D)}] units
    }
    bind Li..."

    ReplyDelete
  13. sir how to install patch provided by muAmps project for wireless sensor network? i.e., leach, leach-c?

    ReplyDelete
    Replies
    1. HI,


      http://ppvbhat.blogspot.in/2012/07/ns-227-installation-on-fc8-with.html

      Delete
  14. hello sir. can u help me with this error..how to solve it? ur help is highly appreciated.

    g++-4.3 -c -Wall -Wno-unused-variable -D_TIMIP_ -D_CIMS_ -D_CIMS_DEBUG_ -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -I. -I. -I/home/ashghazali/ns-allinone-2.31/tclcl-1.19 -I/home/ashghazali/ns-allinone-2.31/otcl-1.13 -I/home/ashghazali/ns-allinone-2.31/include -I/home/ashghazali/ns-allinone-2.31/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./cims -I./../tcl-debug-2.0 -I./diffserv -I./satellite -I./wpan -o utils_ns.o utils_ns.cc
    make: g++-4.3: Command not found
    make: *** [utils_ns.o] Error 127
    Ns make failed!

    ReplyDelete
  15. hello sir
    I use the NS allinone 2.31 and I installed the WiMAX patch (release-041707.tgz ) from:
    http://w3.antd.nist.gov/seamlessandsecure/files/80216/
    but when I tried to run the examples, there were errors like:
    gap size=1
    invalid command name "Mac/802_16"
    while executing
    "Mac/802_16 set debug_ 1"
    (file "wimax1.tcl" line 54)

    can anyone help me, please?

    ReplyDelete
    Replies
    1. hey. im beginner in ns-2.31.. are u already installed it?can u share with me how to install ns-2.31? with patch from this link:

      http://tagus.inesc-id.pt/~pestrela/ns2/ist-cims.html

      i got errors during installation. ur help is highly appreciated. this for my final project.

      Delete
    2. Hi,

      For installation of NS-2.31, please check this page. The error is due to mismatch in gcc compiler. Follow the instruction given in this page.

      Delete
    3. Hi IDsurvei,

      I am not able to access the link you have given.

      Delete
    4. hello sir is there chances to create the graph in ns2 and how to generate sir?

      Delete
    5. Hi,

      You can generate graph using Xgraph and GNUPlot.

      Delete
    6. Hi; have u got any solution for this. If s mns plz tel me. even i also facing same problem. plz

      Delete
  16. hi Ramakrishna....

    how make a lot of nodes with conection in one Base Station...?

    Thanks

    ReplyDelete
  17. hi sir, i have problem when installing ns2 in ubuntu 12.04
    i have followed your instruction to install my simulator but still can't use ns2

    this is my problem.. please help

    root@nurhay-PC:~/ns-2.31# sudo ./install
    sudo: ./install: command not found
    root@nurhay-PC:~/ns-2.31# sudo ./install-sh
    install: no input file specified
    root@nurhay-PC:~/ns-2.31# ns
    The program 'ns' is currently not installed. You can install it by typing:
    apt-get install ns2
    root@nurhay-PC:~/ns-2.31#

    ReplyDelete
    Replies
    1. HI,

      Run the command in ns-allinone-2.31 directory.

      Delete
    2. thank you Mr Ramakrishna for your answer, :)
      i have tried to installed ns in the directory. n then this is the result :


      Ns-allinone package has been installed successfully.
      Here are the installation places:
      tcl8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
      tk8.4.14: /home/nurhay/Documents/ns-allinone-2.31/{bin,include,lib}
      otcl: /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13
      tclcl: /home/nurhay/Documents/ns-allinone-2.31/tclcl-1.19
      ns: /home/nurhay/Documents/ns-allinone-2.31/ns-2.31/ns
      nam: /home/nurhay/Documents/ns-allinone-2.31/nam-1.13/nam
      gt-itm: /home/nurhay/Documents/ns-allinone-2.31/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

      ----------------------------------------------------------------------------------

      Please put /home/nurhay/Documents/ns-allinone-2.31/bin:/home/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/unix:/home/nurhay/Documents/ns-allinone-2.31/tk8.4.14/unix
      into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

      IMPORTANT NOTICES:

      (1) You MUST put /home/nurhay/Documents/ns-allinone-2.31/otcl-1.13, /home/nurhay/Documents/ns-allinone-2.31/lib,
      into your LD_LIBRARY_PATH environment variable.
      If it complains about X libraries, add path to your X libraries
      into LD_LIBRARY_PATH.
      If you are using csh, you can set it like:
      setenv LD_LIBRARY_PATH
      If you are using sh, you can set it like:
      export LD_LIBRARY_PATH=

      (2) You MUST put /home/nurhay/Documents/ns-allinone-2.31/tcl8.4.14/library into your TCL_LIBRARY environmental
      variable. Otherwise ns/nam will complain during startup.


      After these steps, you can now run the ns validation suite with
      cd ns-2.31; ./validate

      For trouble shooting, please first read ns problems page
      http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
      for related posts.

      nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$ ns
      The program 'ns' is currently not installed. You can install it by typing:
      sudo apt-get install ns2
      nurhay@nurhay-PC:~/Documents/ns-allinone-2.31$


      what should i do next?
      waiting for your response

      Delete
    3. Hi,

      Please follow the steps given in following link:
      http://ramakrishnamundugar.blogspot.in/2012/09/ns-234-installation-in-ubuntu-1204.html



      Delete
    4. hi sir, finally i have finished installing ns2.31 in ubuntu 12.04
      then i make some documentation in indonesian language with your blog as my reference,

      thank you very much

      here the link :
      http://asmanuha.blogspot.com/2013/04/instalasi-ns231-pada-ubuntu-1204.html


      Delete
  18. hello sir,
    i have followed he above steps and installed successfully, it is prompting % symbol when is again installed it i.e ./install it is showing the following errors pls help me out..

    cp: cannot create regular file `/home/abrar/ns-allinone-2.34/lib/#inst.30808#': Permission denied
    rm: cannot remove `/home/abrar/ns-allinone-2.34/lib/libtcl8.4.a': Permission denied
    mv: cannot stat `/home/abrar/ns-allinone-2.34/lib/#inst.30808#': No such file or directory
    ranlib: could not create temporary file whilst writing archive: No more archived files
    make: *** [install-binaries] Error 1
    tcl8.4.18 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.

    ReplyDelete
    Replies
    1. Hi,

      Use root privileged for installing and compiling.

      Delete
  19. HI
    i am install the clustering patch in ns2-2.29
    an this error has been accure
    make: ***[clustering/rajaraman/rajaraman.o] error 1

    how can solve this error?
    can any one help me??
    my mail is bejarzahi@gmail.com
    tanks alot

    ReplyDelete
    Replies
    1. Hi,

      Please share the details of error you are getting. At least few lines of error message.

      Delete
  20. hello sir
    invalid command name "Agent/LocReq"
    while executing
    "Agent/LocReq create _o1764 "
    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/LocReq"
    ("for" body line 3)
    invoked from within
    "for {set i 0} {$i < $val(nu)} {incr i} {
    #Setup the request agent
    set lreq_($i) [new Agent/LocReq]
    $ns_ attach-agent $node_($i) $lreq_($i)

    #Setup..."
    (file "main.tcl" line 193)
    when i run my tcl file i get this error i dnt know what is the problem plz reply soon

    ReplyDelete
    Replies
    1. hi i m also facing same problem..
      do v hv to modify or hv to do any entry in gen/ns_tcl.cc file ?

      Delete
  21. hiii

    please tell me which compiler version is required for installing ns-2.33 on ubuntu 12.04 I am facing this error
    make: *** [example.o] Error 1
    Zlib make failed, but it's optional Continue ...
    ============================================================
    * Build tcl8.4.18
    ============================================================
    configure: WARNING: unrecognized options: --enable-gcc
    checking whether to use symlinks for manpages... no
    checking whether to compress the manpages... no
    checking whether to add a package name suffix for the manpages... no
    checking for gcc... gcc41
    checking whether the C compiler works... no
    configure: error: in `/home/soumya/ns-allinone-2.33/tcl8.4.18/unix':
    configure: error: C compiler cannot create executables
    See `config.log' for more details
    tcl8.4.18 configuration failed! Exiting ...
    Tcl is not part of the ns project. Please see www.Scriptics.com
    to see if they have a fix for your platform.

    ReplyDelete
  22. hello sir, please tell me what are the steps to follow for connect c++ file with tcl code. i am using NS2.34

    ReplyDelete
    Replies
    1. Hi,

      Please check the below link:
      http://manipal.academia.edu/RamakrishnaM

      Delete
    2. sir , in that linke no documents for how to connect c++ file with tcl file.

      Delete
  23. sir i am doing my final year project in wireless network security (DOS attack ,Man in the middle attack) how to detect the dos attack using c++ file .
    i am using ns2.34

    ReplyDelete
  24. sir,
    i am doing blockhole attack in ns2.34 wireless netwok my friend gave a code if i run it shows following errors how can i fix please help me


    num_nodes is set 20
    INITIALIZE THE LIST xListHead

    (_o433 cmd line 1)
    invoked from within
    "_o433 cmd addr"
    invoked from within
    "catch "$self cmd $args" ret"
    invoked from within
    "if [catch "$self cmd $args" ret] {
    set cls [$self info class]
    global errorInfo
    set savedInfo $errorInfo
    error "error when calling class $cls: $args" $..."
    (procedure "_o433" line 2)
    (SplitObject unknown line 2)
    invoked from within
    "_o433 addr"
    ("eval" body line 1)
    invoked from within
    "eval $node addr $args"
    ("default" arm line 2)
    invoked from within
    "switch -exact $routingAgent_ {
    DSDV {
    set ragent [$self create-dsdv-agent $node]
    }
    DSR {
    $self at 0.0 "$node start-dsr"
    }
    AODV {
    set ragent [$self cre..."
    (procedure "_o3" line 14)
    (Simulator create-wireless-node line 14)
    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"
    ("for" body line 2)
    invoked from within
    "for {set i $val(nnaodv) } {$i<$val(nn) } {incr i} {
    set node_($i) [$ns_ node]
    $node_($i) random-motion 0;
    $ns_ at 0.01 "$node_($i) l..."
    (file "blockhole.tcl" line 57)
    rajasekar@ubuntu:~/Desktop/secondreview/final$ ns blockhole.tcl
    num_nodes is set 20
    INITIALIZE THE LIST xListHead

    (_o433 cmd line 1)
    invoked from within
    "_o433 cmd addr"
    invoked from within
    "catch "$self cmd $args" ret"
    invoked from within
    "if [catch "$self cmd $args" ret] {
    set cls [$self info class]
    global errorInfo
    set savedInfo $errorInfo
    error "error when calling class $cls: $args" $..."
    (procedure "_o433" line 2)
    (SplitObject unknown line 2)
    invoked from within
    "_o433 addr"
    ("eval" body line 1)
    invoked from within
    "eval $node addr $args"
    ("default" arm line 2)
    invoked from within
    "switch -exact $routingAgent_ {
    DSDV {
    set ragent [$self create-dsdv-agent $node]
    }
    DSR {
    $self at 0.0 "$node start-dsr"
    }
    AODV {
    set ragent [$self cre..."
    (procedure "_o3" line 14)
    (Simulator create-wireless-node line 14)
    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"
    ("for" body line 2)
    invoked from within
    "for {set i $val(nnaodv)} {$i<$val(nn) } {incr i} {
    set node_($i) [$ns_ node]
    $node_($i) random-motion 0;
    $ns_ at 0.01 "$node_($i) la..."
    (file "blockhole.tcl" line 57)

    ReplyDelete
  25. tools/ranvar.cc:219:4: error: expected primary-expression before ‘return’
    tools/ranvar.cc:219:4: error: expected ‘;’ before ‘return’
    tools/ranvar.cc:220:4: error: expected primary-expression before ‘return’
    tools/ranvar.cc:220:4: error: expected ‘;’ before ‘return’
    tools/ranvar.cc:221:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
    tools/ranvar.cc:221:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
    make: *** [tools/ranvar.o] Error 1

    ReplyDelete
  26. While installing ns2 in the above said procedure, I am recieving the following error. Please help me solve it

    tools/ranvar.cc:219:4: error: expected primary-expression before ‘return’
    tools/ranvar.cc:219:4: error: expected ‘;’ before ‘return’
    tools/ranvar.cc:220:4: error: expected primary-expression before ‘return’
    tools/ranvar.cc:220:4: error: expected ‘;’ before ‘return’
    tools/ranvar.cc:221:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
    tools/ranvar.cc:221:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
    make: *** [tools/ranvar.o] Error 1

    ReplyDelete
  27. when i install ns-2.31 for mptcp, i saw some errors:
    tcp/mptcp-full.cc: In member function ‘virtual void MpFullTcpAgent::sendpacket(int, int, int, int, int, Packet*)’:
    tcp/mptcp-full.cc:144:32: error: ‘ecn_syn_next_’ was not declared in this scope
    make: *** [tcp/mptcp-full.o] Error 1
    ---------
    please help me to solve it. thanks

    ReplyDelete
    Replies
    1. Hi,

      The error is due to missing header deceleration.

      Delete
  28. Hi all,
    Am getting error as:
    gap size=1
    invalid command name "Mac/802_16"
    while executing
    "Mac/802_16 set debug_ 1"
    (file "wimax1.tcl" line 54)

    in example file. actually am usin ns-2.33 in fedora 18 can anybody help plz.

    ReplyDelete
  29. Ramakrishna sir; plz help me.

    ReplyDelete
    Replies
    1. Hi,

      Check the agent declaration in ns2.

      Delete
    2. Sir i tried all the steps but i didn't get. Still am getting same error.

      Delete
    3. sir after installing ns-2.33 successfully i hv used wimax prerelease-041707 patch and i did manuall function and then i compiled && make the ns-2.33 then i tried to run wimax1.tcl; datarate.tcl; l2handover.tcl; test-be.tcl files but the same error has been occure every time. I was trying to sort out from past 2 days sir but am not.

      Delete
    4. sir plz tel me the steps; i will follow that.

      Delete
    5. Hello RamaKrishna sir; you are write sir, there was a mistake in agent declaration kw am getting output for wimax1.tcl and l2handover.tcl but am getting error in datarate.tcl and test-be.tcl.

      Can u help me. plz sir

      and THANK u very much sir.

      Delete
    6. Ramakrishna sir, am getting output as:

      Wrong Number of Arguments! 2 arguments for this script
      Usage: ns datarate.tcl profile cyclic_prefix
      modulation: 1-7
      cyclic_prefix: 0.25, 0.125, 0.0625, 0.03125

      For datarate.tcl

      and for test-be.tcl

      Wrong Number of Arguments! No arguments in this topology
      Syntax: ns test-be.tcl nbMNs

      expected integer but got "(1)"
      while executing
      "exit (1)"
      invoked from within
      "if {$argc != 1} {
      puts ""
      puts "Wrong Number of Arguments! No arguments in this topology"
      puts "Syntax: ns test-be.tcl nbMNs"
      puts ""
      exit..."
      (file "test-be.tcl" line 33)

      Delete
    7. hi friends;

      plz he me solve this problem plz.

      Delete
  30. Hello every one plz help me out of this. what's the solution for this.

    ReplyDelete
  31. Hi,
    tcp/mptcp-full.cc:144:32: error: ‘ecn_syn_next_’ was not declared in this scope
    make: *** [tcp/mptcp-full.o] Error 1
    How declare ecn_syn_next_’ in this scope?

    i'm a beginer. i'm researching about ns2 for mptcp,
    thanks..
    regard.

    ReplyDelete
  32. Hi Ramakrishna,
    am Goutham , a Big thanks for maintaining such a good blog.
    am new to NS2. am trying to install NS2 in fedora. i was facing some issues during ./install i did cd ns-allinone-2.35/ && export CC=gcc-4.7.0 CXX=g++-4.7.0 && ./install [suggested from some online source) from that time am facing
    configure: WARNING: unrecognized options: --enable-gcc
    checking whether to use symlinks for manpages... no
    checking whether to compress the manpages... no
    checking whether to add a package name suffix for the manpages... no
    checking for gcc... gcc-4.7.0
    checking whether the C compiler works... no
    configure: error: in `/home/Goutham/opt/ns-allinone-2.34/tcl8.4.18/unix':
    configure: error: C compiler cannot create executables
    See `config.log' for more details
    tcl8.4.18 configuration failed! Exiting ...
    Tcl is not part of the ns project. Please see www.Scriptics.com
    to see if they have a fix for your platform.

    Could you please help me in this regard ?

    ReplyDelete
  33. Hi, i want to implement MulTFRC using ns-2 version 2.31.
    How i implement multfrc?
    please guide me?
    thanks

    ReplyDelete
  34. when i tryed to install ns-2.31 but i see some errors to show below:
    /usr/bin/ld: skipping incompatible /root/ns-allinone-2.31/tclcl-1.19/libtclcl.a when searching for -ltclcl
    /usr/bin/ld: cannot find -ltclcl
    /usr/bin/ld: skipping incompatible /root/ns-allinone-2.31/otcl-1.13/libotcl.a when searching for -lotcl
    /usr/bin/ld: cannot find -lotcl
    collect2: ld returned 1 exit status
    make: *** [ns] Error 1
    Ns make failed!
    -----
    plz help me sovle it.
    thanks

    ReplyDelete
    Replies
    1. i am getting same error.
      Please tell me how u have removed this error?

      thanks.


      My system is 64 bit. Same set up was working fine on 32 bit system.

      Delete
  35. when i tried to simulate the localisation on wsn in ns2 after successfull integration of modified files once i'll try to run tcl script the following error occurs please give me solution regarding the same

    num_nodes is set 4
    INITIALIZE THE LIST xListHead
    invalid command name "Agent/LocReq"
    while executing
    "Agent/LocReq create _o82 "
    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/LocReq"
    ("for" body line 3)
    invoked from within
    "for {set i 0} {$i < $val(nu)} {incr i} {
    # Setup the request agent
    set lreq_($i) [new Agent/LocReq]
    $ns_ attach-agent $node_($i) $lreq_($i)

    # Set..."
    (file "loc1.tcl" line 185)

    ReplyDelete
  36. Hi,
    I have created a project under ns2 with C++ support, but when I bild the
    project I have the following error:

    /home/mary/Ns2/ns-allinone-2.29/bin/tclsh8.4 bin/tcl-expand.tcl tcl/lib/ns-
    lib.tcl tcl/lib/ns-diffusion.tcl | ../tclcl-1.17/tcl2c++ et_ns_lib >
    gen/ns_tcl.cc
    /bin/sh: ../tclcl-1.17/tcl2c++: No such file or directory
    error writing "stdout": broken pipe
    while executing
    "puts $line"
    (procedure "expand_file" line 18)
    invoked from within
    "expand_file [file tail $name]"
    ("foreach" body line 5)
    invoked from within
    "foreach name $argv {
    set dirname [file dirname $name]
    if {$dirname != "."} {
    cd $dirname
    expand_file [file tail $name]
    cd $startupDir
    } else ..."
    (file "bin/tcl-expand.tcl" line 65)
    make: *** [gen/ns_tcl.cc] Error 127

    ReplyDelete
  37. Hi,
    I have created a project under ns2 with C++ support, but when I bild the
    project I have the following error:

    /home/dragana/ns-allinone-2.31.mulTFRC/bin/tclsh8.4 bin/tcl-expand.tcl tcl/lib/ns-lib.tcl tcl/lib/ns-diffusion.tcl tcl/delaybox/delaybox.tcl tcl/packmime/packmime.tcl | ../tclcl-1.19/tcl2c++ et_ns_lib > gen/ns_tcl.cc
    ../tclcl-1.19/tcl2c++: 1: Syntax error: "(" unexpected
    error writing "stdout": broken pipe
    while executing
    "puts $line"
    (procedure "expand_file" line 18)
    invoked from within
    "expand_file [lindex $L 1]"
    (procedure "expand_file" line 16)
    invoked from within
    "expand_file [file tail $name]"
    ("foreach" body line 5)
    invoked from within
    "foreach name $argv {
    set dirname [file dirname $name]
    if {$dirname != "."} {
    cd $dirname
    expand_file [file tail $name]
    cd $startupDir
    } else ..."
    (file "bin/tcl-expand.tcl" line 65)
    make: *** [gen/ns_tcl.cc] Error 2
    ----
    please help me, thanks.

    ReplyDelete
  38. Hello Sir,

    While executing make command ,I am getting following error:

    common/tclAppInit.o: In function `Tcl_AppInit':
    /home/admin/ns-allinone-2.28-n1/ns-2.28/common/tclAppInit.cc:252: undefined reference to `Tcldbg_Init'
    collect2: ld returned 1 exit status
    make: *** [ns] Error 1

    Please guide me how to solve this?

    ReplyDelete
  39. Installing header files
    Installing library files to /home/sumedh/ns-allinone-2.31/lib/tk8.4
    Installing library images directory
    Installing translation directory
    Installing demos to /home/sumedh/ns-allinone-2.31/lib/tk8.4/demos/
    Installing demo images
    Installing and cross-linking top-level (.1) docs
    Installing and cross-linking C API (.3) docs
    Installing and cross-linking command (.n) docs
    tk8.4.14 installation succeeded.
    ============================================================
    * Build OTcl-1.13
    ============================================================
    ./configure: line 722: test: ./otcl.c-SHLIB_LD=ld: binary operator expected
    ./configure: line 728: test: ./otcl.c-SHLIB_LD=ld: binary operator expected
    configure: error: sources are in ., but `cd .' does not work
    otcl-1.13 configuration failed! Exiting ...
    Please check http://www.isi.edu/nsnam/ns/ns-problems.html
    for common problems and bug fixes.

    hi sir , im getting this error while installing ns-allinone-2.31 on ubuntu 12.04
    please help

    ReplyDelete
  40. hi sir,
    how to implement primary user emulation attacks of cognitive radio in ns2????which version supports it????

    ReplyDelete
  41. Hello,

    Please are you using Ubuntu 32 bit or 64 bit? and your computer is what 32 bit or 64 bit architecture? since I am facing many problems in such things, ns2 freezes and I do not know why!!!

    Regards,

    ReplyDelete
  42. /usr/bin/ld: skipping incompatible /home/ns-allinone-2.34/tclcl-1.19/libtclcl.a when searching for -ltclcl
    /usr/bin/ld: cannot find -ltclcl
    collect2: ld returned 1 exit status
    make: *** [ns] Error 1


    i am using 64 bit system, and i am getting the above error.
    Please guide me that how i can remove this error. Waiting for your reply, thanks.

    ReplyDelete
  43. Hi
    my simulation need 10 node to create...
    How to create node in module wimax NIST, if code from NIST :

    for {set i 0} {$i < $nb_mn} {incr i} {
    set wl_node_($i) [$ns node 1.0.[expr $i + 1]] ;# create the node with given @.
    $wl_node_($i) random-motion 0 ;# disable random motion
    $wl_node_($i) base-station [AddrParams addr2id [$bstation node-addr]] ;#attach mn to basestation
    #compute position of the node
    $wl_node_($i) set X_ 30.0
    #$ns at 4.0 "$wl_node_($i) set X_ 80"
    #$ns at 6.0 "$wl_node_($i) set X_ 50"
    $wl_node_($i) set Y_ 20.0
    $wl_node_($i) set Z_ 0.0
    $wl_node_($i) label "SS"
    $ns at 0 "$wl_node_($i) setdest 560.0 550.0 1.0"
    puts "wireless node $i created ..." ;# debug info

    ReplyDelete