Skip to main content

NS2 BUGS AND FIXES

Hello, In this section we will discuss about installation problems and possible fixes for them between releases. In general, these are fixes for ns/otcl/tclcl installation problems.

For Tclcl/Tk-8.0 installation problems refer to Tcl/Tk installation info page.

If you experience problem when building a ns daily snapshot, you probably want to update your otcl and tclcl to the most current snapshot as well. Sometimes changes in ns will require an updated tclcl. If you are using nam with ns snapshot, it is recommended that you update nam together with ns because ns may provide new visualization features which requires an updated nam.

Categories of problems on this page:

If a problem is not listed here, you may also want to search the ns-users mailing list archives (how to subscribe to the listthe archives themselves).

If something worked in an old verison of ns and no longer works, you can look at our CVS archives (read-only) to see what we changed. (Thanks to the MASH project for setting up and maintaining this service.)

General Problems

  • Problem: I can't download ns from your web site.

    Work-arounds: First, many people have successfully downloaded ns (unless you're the first person to get a brand new release!). Odds are that the solution to problems downloading lie on your end: make sure that your browser isn't compressing or uncompressing it for you; try Netscape if you're using IE, or try another program to download like GNU wget; make sure you use (GNU) gunzip to uncompress it, not PKZIP.

    If these tricks don't help, you might also try getting it via FTP (from ftp://ftp.isi.edu/nsnam) instead of HTTP (from http://www.isi.edu/nsnam/dist). If ftp'ing, try using a dedicated FTP client instead of a web browser, and make sure you transfer in BINARY mode, not TEXT.

  • Problem: I can't subscribe or unsubscribe to the mailing list. I get error messages back like:
    >>>>> This is a multi-part message in MIME format.
    >**** Command 'this' not recognized.
    >>>>>
    >>>>> ------=_NextPart_000_0013_01C00841.7A1B9BA0
    >END OF COMMANDS
    

    Solution: Send simple text (ASCII) e-mail to the subscribe address, not MIME. Majordomo, the mailing list management program we use, can't handle MIME.

  • Problem: My posts to the mailing list are rejected. I'm even subscribed to it.

    Solution: Please see the mailing-list FAQ.

  • Problem: I was successful in installation, but I can't run the example script in in tutorial simple.tcl. When i tried to run it gives few errors like:
    use-scheduler: command not found 
    attach-node: command not found
    ...
    

    Solution: you need to run the script by issuing command: ns simple.tcl and you should add ns' directory to the environment variable PATH.

  • Problem: Ok, but I still can't run simple.tcl under the ~ns/tcl/ex directory, it gives an error saying:
    couldnt execute nam: 
    no such file or directory while executing "exec nam out.nam &".
    
    (Also, when I try typing the comamnd "ns simple.tcl", and I get the error "ns: command not found".)

    Solution: Well, you need to add nam' directory to the environment variable PATH or specify its location in the tcl script. (PATH is part of Unix, so if you're not sure how it works, please consult a local Unix expert or search the web on "unix PATH".)

  • Problem: To fix another problem it says to "apply a patch file". What's that? How do I do that?

    Solution: To apply a patch file, get the the "patch" program (it ships with Linux and FreeBSD, or you can get it from ftp.gnu.org. Change into the directory with the source code you want to patch and type "patch < /path/to/patch-file.patch". See the patch(1) man page for details about what messages you'll see.

    Bonus answer: how to generate a patch file. To generate a patch file, use the "diff" program with the "-u" or "-c" option: "diff -u old-copy-of-file.cc file.cc". (This requires that you have saved a copy of the file before you modified it.)

  • Problem: I tried to apply a patch, but it failed. For example, I got messages like:
    [root@srn04 ns-2.27]# patch < newfi.patch
    patching file Makefile.in
    Hunk #1 FAILED at 25.
    1 out of 1 hunk FAILED -- saving rejects to file
    Makefile.in.rej
    patching file Makefile.in
    

    Solution: Patches will succeed when applied to the same version of code against which they were generated. If the code has changed, you will get error messages like "hunk failed".

    Unfortunately, there is no general solution to failed patches. It could be that the underlying code changed so much the old patch will not work. But it could be that there were minor changes to the basic code and you could apply the patch manually.

    Some hints if you want to try manually applying a patch: If you want to try applying a patch by hand, you need to understand what you're patching, more or less. If you're trying to patch a Makefile and you have no idea what a makefile is, it's very possible you'll make an accidental error that prevents things from working. But don't fear, you can at least try, and you can always read the documentation about the make program and learn something! In the worst case you have to undo what you did. Also, although you will need some clue about what you're doing, you probably don't have to completely understand the code. If you try to manually apply a patch, you should study the patch manual page so you can understand the simple format that a patch file and a .rej file use.

    If you're not willing or able to manually apply a patch, you have one other alternative. A patch file takes original code (call it X-orig) and changes it into new code (call it X-new) by applying the differences described in the patch. Patches fail if the patch program cannot find what's described in the patch in X-orig. So an alternative to manually applying the patch is to find different original code. If you find the same original code the person who made the patch used, you should get it to apply cleanly. So, for example, if a patch was generated against ns-2.26 and it fails when applied to ns-2.27, you could get rid of your copy of ns-2.27 and go get ns-2.26, then apply the patch to that older version. (Of course, this approach has other problems, since you may want other things that are only in ns-2.27. TANSTAAFL.)

  • Problem: When I run validate or one of the test suites, I get these messages: warning: using backward compatibility mode and using backward compatible Agent/CBR; use Application/Traffic/CBR instead. Is my simulator broken?

    Solution: No, ns is not broken. These are warning messages output by the test suites, not errors. (However, if you get these messages from your scripts, we encourage you to move to the newer APIs.)

  • Problem: I got the following error message during building OTcl
    creating cache ./config.cache
    No .configure file found in current directory
    Continuing with default options...
    checking host system type... alpha-dec-osf4.0
    checking target system type... alpha-dec-osf4.0
    checking build system type... alpha-dec-osf4.0
    checking for gcc... gcc
    checking whether the C compiler (gcc  ) works... yes
    checking whether the C compiler (gcc  ) is a cross-compiler... no
    checking whether we are using GNU C... yes
    checking whether gcc accepts -g... yes
    checking for c++... c++
    checking whether the C++ compiler (c++  ) works... no
    configure: error: installation or configuration problem: C++ compiler
    cannot create executables.             
    

    Solution: Your c++ compiler (with exact name c++) does not seem to work. Check with your sytem admin.

  • Problem: I get linking errors when building ns or nam like
    Undefined                       first referenced
     symbol                             in file
    et_tclobject
    /space/opt/ns-allinone-2.1b6/tclcl-1.0b9/libtclcl.a(Tcl.o)
    ld: fatal: Symbol referencing errors. No output written to ns
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `ns'
    
    (or other symbols that begin with et_*).

    Solution: Build everything with gcc, don't mix gcc/g++ and cc/ld. (Insure that if you build any C++ code with g++ that you link with g++, and that they're the same version.)

    (These very confusing errors are from gcc. "et" is part of the run-time type checking. This code is generated at load time; gcc gets confused if you mix compilers.)

  • Problem: I get errors like this when building ns-allinone:
    [root@localhost unix]# make
    gcc -pipe -c -O2  -Wall -Wno-implicit-int -fno-strict-aliasing -fPIC -I/home/vahid/Desktop/Temp/tk8.4.7/unix -I/home/vahid/Desktop/Temp/tk8.4.7/unix/../generic -I/home/vahid/Desktop/Temp/tk8.4.7/unix/../bitmaps -I/home/vahid/Desktop/Temp/tcl8.4.7/generic  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_PW_GECOS=1      -DTCL_NO_DEPRECATED -DUSE_TCL_STUBS  /home/vahid/Desktop/Temp/tk8.4.7/unix/../generic/tk3d.c
    In file included from /home/vahid/Desktop/Temp/tk8.4.7/generic/tkInt.h:21,
                     from /home/vahid/Desktop/Temp/tk8.4.7/generic/tk3d.h:18,
                     from /home/vahid/Desktop/Temp/tk8.4.7/generic/tk3d.c:16:
    /home/vahid/Desktop/Temp/tk8.4.7/generic/tk.h:96:29: X11/Xlib.h: No such file or directory
    In file included from /home/vahid/Desktop/Temp/tk8.4.7/generic/tkInt.h:21,
                     from /home/vahid/Desktop/Temp/tk8.4.7/generic/tk3d.h:18,
                     from /home/vahid/Desktop/Temp/tk8.4.7/generic/tk3d.c:16:
    /home/vahid/Desktop/Temp/tk8.4.7/generic/tk.h:573: parse error before "Window"
    ...
           

    Solution: You don't have the development libraries for X11 installed on your system (see "X11/Xlib.h: No such file or directory").

    Fix: install the X11 development libraries. How you do this is system-specific. In Redhat-like Linux distributions, make sure you have the X11 -devel packages installed. (In Fedora Core 2, installing xorg-x11-devel will fix this specific problem; in general you may need other -devel packages for libc, X11, and Tcl.)

  • Problem: Validation under Windows does not work.

    Solution: As of ns 2.26, the windows port uses Cygwin which should substantly reduce validation errors. Please have a look at individual ns versions for specific details. The following information is way outdated.

    First, you need to download Cygwin, as of 2000-06-22 at version 1.1.2, which provides GNU binary utilities for the Windows platforms. You may also want to download pre-compiled Perl for Windows. After you've got all these tools, apply the following patch to ~ns/tcl/test/test-all-template1 to get around the \r\n problem:

    *** test-all-template1.orig   Wed Jan  5 01:01:00 2000
    --- test-all-template1        Thu Jun 22 16:04:10 2000
    ***************
    *** 117,123 ****
              cp $datafile.bk $datafile
              mv $datafile.Z $directory/$t.Z
          else
    !         gzip -dc $directory/$t.Z | cmp -s - $datafile
              if [ $? = 0 ]; then
                  echo Test output agrees with reference output
              else
    --- 117,123 ----
              cp $datafile.bk $datafile
              mv $datafile.Z $directory/$t.Z
          else
    !         gzip -dc $directory/$t.Z | perl -ne 'print $_;' |cmp -s - $datafile
              if [ $? = 0 ]; then
                  echo Test output agrees with reference output
              else
    
    NOTE: Some of the test suites will fail on win32 platform. As of Feburary 26, 1999 snapshot of ns, the following test suites fail:
     ./test-all-simple ./test-all-tcp ./test-all-red ./test-all-sack
     ./test-all-schedule ./test-all-red-v1 ./test-all-sack-v1 ./test-all-v1
     ./test-all-vegas-v1 ./test-all-ecn ./test-all-manual-routing
     ./test-all-intserv ./test-all-webcache ./test-all-srm
    
    However, all of them failed because of floating point rounding differences on win32 and on unix. We will test current ns snapshots and update the results here. Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases.

    IMPORTANT NOTE: The cygwin release 1.3.2 currently available (as of 07/2001), which we installed in win2000, doesn't seem to have a functional awk utility. A significant portion of the ns validation script uses awk, so we tried to replace awk with perl; but now the bash shell (another cygwin utility) didnot handle stdin/stdout correctly. So we were unable to validate the windows version (ns2.1b8a) in this platform. We welcome any suggestion from windows users to help solve this problem.

  • Problem: The test suites and validation fail with errors like
    ns: _o3 cleanup file5 sackB4: Syntax error in file ../../bin/raw2xg at
    line 43, next 2 tokens "my("
    Syntax error in file ../../bin/raw2xg at line 59, next 2 tokens
    "translate_point("
    Syntax error in file ../../bin/raw2xg at line 94, next 2 tokens
    "translate_point("
    Execution of ../../bin/raw2xg aborted due to compilation errors.
    Can't locate 5.0010000000000003 in @INC at ../../bin/getrc line 4.
        while executing
    
    (where the key parts are "syntax error near my(" and "can't locate 5.001").

    Solution: Get perl5 and/or make sure the programs in ~ns/bin are invoking perl5.

    Ns's configure checks for perl5, but apparently this check is not sufficient for many people's systems. Suggestions for improving the check are encouraged (it already works on our systems).

  • Problem: Things built OK but don't run because of missing shared libraries (for example, you get the message "can't load library 'libotcl.so'" or "fatal: libotcl.so: can't open file: errno=2" [from Solaris]) or "libotcl.so can not open shared object file: No such file or directory".

    Solution: Many systems require that you do something special when installing new shared libraries. Shared-library loading is system-dependent, so consult the man page for ld(1) on your system. On many systems the program ``ldd'' can be used to diagnose shared-libary problems.

    A couple of hints: many systems require that you set the environment LD_LIBRARY_PATH to specify where to look for shared libraries. So if (let's say), you get the above error with otcl shared library (libotcl.so), you should append the path to your libotcl.so (which typically would be in the directory you have installed and built otcl) to the LD_LIBRARY_PATH macro in your .cshrc file. Other systems require that you run ldconfig when using new libraries.

  • Problem: Ns (or otcl or tclcl) gets link errors when building with references to "dlopen" similar functions beginning with dl.

    Work-around: You need to manually add the library for dynamic linking to ns's Makefile. Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl).

    Solution: Unfortunately ns's autoconf support for dynamic linking isn't currently very good, and we can't test ns on all the platforms on which it's used. This configuration is done in ~ns/conf/configure.in.dynamic. If you can adjust the code there to correctly detect your system we'll be happy to add your patch to our sources.

  • Problem:While building ns, it gets compiled but bails out with the following error message during linking:
    	c++ -static  -o ns \
             tclAppInit.o  random.o rng.o ranvar.o misc.o
             ....
             ....
             -lXext -lX11  -lsocket -lnsl -ldl -lm
             ld: fatal: library -ldl: not found
             ld: fatal: File processing errors. No output written to ns
             *** Error code 1
             make: Fatal error: Command failed for target `ns'
            

    Solution:This error appears due to compiling with the static flag on. In static mode, ld selects only the shared object and archive files ending with .a, (unlike dynamic mode where files ending with either .so or .a are acceptable).

    Thus you will need to either

    • configure with static option explicitly turned off with --disable-static, or
    • edit ns makefile to replace the value "static" for the macro STATIC with blank (Dynamic mode is the default option).

  • Problem: Ns is running out of memory and segfaulting.

    Solution: See the memory debugging tips section of the debugigng tips web page.

  • Problem: I want to simulate ATM networks in ns. What should I do?

    Solution: If you just want to treat ATM as a 155Mb/s link for IP packets, you can get a pretty good approximation by, well, making a 155Mb/s link. Or a better approximation by accounting for ATM framing and using a 135Mb/s link.

    If you actually want to explore the interaction between ATM cells and IP packets, or MPLS, or something like that, you may have to implement it yourself or pack up a third-party package.

    One user (thanks L.) suggested in ns-users:

    http://freebsd1.lums.edu.pk/~umair/NS/doc/index.html (there's a mirror at: http://www.ee.surrey.ac.uk/Personal/L.Wood/ns/ATM/ if you can't reach that.)

    It's for ns version 1, it's third-party, it's unsupported, you're on your own.

    Deriving an ATM node class for ns-2 would actually be one of the few cases where you'd expect incompatibilities between the derived class and everything else, and where the rest of the things ns simulates are _supposed_ to fail badly across it... would make it easier to implement; less testing required!

  • Problem: How do I properly reference the ns-2 simulatorin my papers ?.

    Solution:

    There are two answers to that question.
    If you want to cite the software itself, you can cite:
    
    S. McCanne and S. Floyd. ns Network 
    Simulator. http://www.isi.edu/nsnam/ns/.
    
    and/or the manual:
    Kevin Fall, Kannan Varadhan, and the VINT project.
      The ns manual.
        
        
        
    
    
    
    If you want something published in a refereed location, 
    
    [Breslau00a]
    Lee Breslau, Deborah Estrin, Kevin Fall, Sally Floyd, John Heidemann, Ahmed
    Helmy, Polly Huang, Steven McCanne, Kannan Varadhan, Ya Xu, and Haobo Yu.
      Advances in Network Simulation.
      _IEEE Computer_, V. 33  (N. 5 ), pp. 59-67, May, 2000.
      Expanded version available as USC TR 99-702b
                             at \urlhttp://www.isi.edu/ johnh/PAPERS/Bajaj99a.html.
      .
    

  • Problem: What should I do if the ns executable has its modification time in the future when I re-start my machine after shutdown?

    Solution: We recommend that you talk to your local sysadmin since this indicates a clock difference between the file server and the client (this has nothing to do with ns).

  • Problem: When using nam I get the following error: no display name and no $DISPLAY"

    Solution: Start the X server using startx at the prompt. Set the display environment variable using setenv DISPLAY my_hostname:0.0 (if you are using cshrc) or export DISPLAY=my_hostname:0.0 (if you are using sh or bash). This solution works for both cygwin and unix.



ns-2.29

  • Problem: Some validation tests fail under Windows. This is a carry-over from ns-2.28 (see below).

ns-2.28

  • Problem: Some validation tests fail under Windows.

    Solution:Currently, on Windows XP SP2 and Cygwin 1.5.12, only two test should fail -- newreno_rto_loss_ackf, and the new smac-multihop test-suite. Until now, if your research direction involves these features, it's best to use ns under some kind of Unix.

  • Problem: When installing ns-allinone-2.28 in solaris, there may be build problems.

  • Solution: Apply the following patch. Reported and fixed by Qihe Wang.

ns-2.27

  • Problem: Ns doesn't build with gcc-3.4 (as ships in Fedora Core 3).

    Solution: Several changes are required both to ns and tclcl. Either see the Dec. 8 post to the ns-users mailing list by Mathieu Robin, or get a daily snapshot after Dec. 11. (Changes are also required to tclcl, see below for details.)

  • Problem: setdest doesn't compile with an error like:
    $ make
    g++ -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@  -o setdest.o
    setdest.cc
    In file included from ../../../config.h:54,
                     from setdest.h:5,
                     from setdest.cc:57:
    ../../../autoconf.h:85: error: namespace `CPP_NAMESPACE' undeclared
    make: *** [setdest.o] Error 1
           

    Solution: Apply this patch, then re-run configure

    --- indep-utils/cmu-scen-gen/setdest/Makefile.in        20 Jan 2004 19:56:42 -0000        1.9
    +++ indep-utils/cmu-scen-gen/setdest/Makefile.in        18 May 2004 15:05:27 -0000@@ -36,8 +36,8 @@
     CC = @CC@
     MKDEP  = ../../../conf/mkdep
      
    -# when including files from ns, we need to take care STL_NAMESPACE
    -DEFINE = -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=@CPP_NAMESPACE@
    +# when including files from ns, we need to take care CPP_NAMESPACE
    +DEFINE = -Dstand_alone -DCPP_NAMESPACE=@CPP_NAMESPACE@ -DCPP_NAMESPACE=@CPP_NAMESPACE@
     CFLAGS = @V_CCOPT@
     LDFLAGS = @V_STATIC@
     LIBS = @V_LIB@ -lm @LIBS@
    --- indep-utils/webtrace-conv/nlanr/Makefile.in 8 Oct 2002 07:11:33 -0000       1.5
    +++ indep-utils/webtrace-conv/nlanr/Makefile.in 18 May 2004 15:10:42 -0000      1.7
    @@ -25,17 +25,16 @@
     #
     # Makefile for NLANR web cache trace processing (http://ircache.nlanr.org).
     #
    -# $Header: /nfs/jade/vint/CVSROOT/www/ns/ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
    +# $Header: /nfs/jade/vint/CVSROOT/www/ns/ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
      
     # Top level hierarchy
     prefix  = @prefix@
     # Pathname of directory to install the binary
     BINDEST = @prefix@/bin
      
    -# when including files from ns, we need to take care STL_NAMESPACE
     CC = @CXX@
     INCLUDE = -I. -I../../.. @V_INCLUDES@
    -CFLAGS = @V_CCOPT@ -DSTL_NAMESPACE=@STL_NAMESPACE@
    +CFLAGS = @V_CCOPT@ -DCPP_NAMESPACE=@CPP_NAMESPACE@
     LDFLAGS = @V_STATIC@
     LIBS = @V_LIB_TCL@ @V_LIB@ @LIBS@
     INSTALL = @INSTALL@
    --- indep-utils/webtrace-conv/dec/Makefile.in   8 Oct 2002 07:11:33 -0000       1.4
    +++ indep-utils/webtrace-conv/dec/Makefile.in   18 May 2004 15:10:41 -0000      1.6
    @@ -28,17 +28,16 @@
     #
     # Taken from Alex Rousskov's originial code.
     #
    -# $Header: /nfs/jade/vint/CVSROOT/www/ns/ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
    +# $Header: /nfs/jade/vint/CVSROOT/www/ns/ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
      
     # Top level hierarchy
     prefix  = @prefix@
     # Pathname of directory to install the binary
     BINDEST = @prefix@/bin
      
    -# when including files from ns, we need to take care STL_NAMESPACE
     CC = @CXX@
     INCLUDE = -I. @V_INCLUDES@
    -CFLAGS = @V_CCOPT@ -DSTL_NAMESPACE=@STL_NAMESPACE@
    +CFLAGS = @V_CCOPT@ -DCPP_NAMESPACE=@CPP_NAMESPACE@
     LDFLAGS = @V_STATIC@
     LIBS = @V_LIB_TCL@ @V_LIB@ @LIBS@
     INSTALL = @INSTALL@
           

ns-2.26

  • (no bugs listed here)

ns-2.1b9

  • Problem: Broadcasting in AODV is broken. AODV sends route request for brdcast address and on not finding any route to the IP_BROADCAST address would drop the pkt.

    Solution: This bug and the following fix was provided by Parag Dadhania && John Novatnack.

    Please apply the following patch to fix the problem:
    --- aodv.cc	Thu Mar 21 14:17:08 2002
    +++ aodv.cc	Wed Oct 30 11:13:30 2002
    @@ -570,8 +570,10 @@
       * Add the IP Header
       */
        ch->size() += IP_HDR_LEN;
    -   ih->ttl_ = NETWORK_DIAMETER;
    - }
    +   // Added by Parag Dadhania && John Novatnack to handle broadcasting
    +   if ( (u_int32_t)ih->daddr() != IP_BROADCAST)
    +     ih->ttl_ = NETWORK_DIAMETER;
    +}
      /*
       *  I received a packet that I sent.  Probably
       *  a routing loop.
    @@ -592,9 +594,11 @@
          return;
        }
      }
    -
    - rt_resolve(p);
    -
    +// Added by Parag Dadhania && John Novatnack to handle broadcasting
    + if ( (u_int32_t)ih->daddr() != IP_BROADCAST)
    +   rt_resolve(p);
    + else
    +   forward((aodv_rt_entry*) 0, p, NO_DELAY);
     }
    

  • Problem: ns does not compile when using gcc-3.2/Redhat 8.0.

    Solution: ns has been patched to compile using GCC-3.2/Redhat8.0 on October 10 2002. Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone.

  • Problem: I get segmentation fault while trying to simulate using DSR in dbugged version of ns-2.1b9 (ns-dbug-dsr-072202.tar.gz).

    Solution: The dbugged version of DSR expects CMUPriQueue instead of "Queue/DropTail/PriQueue". Hence change the older queue type in yr DSR simulation script to CMUPriQueue.

  • Problem: The newer version of DSR code in ns-2.1b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-2.1b8.
    Solution: The higher no of TTL drops seen were due to forwarded packets that were looping between the DSRagent and the LL layer. This happened becoz direction in pkt-hdrs was not correctly set to DOWN when DSRagent handed the pkt to the LL to be fwd'ed to the next node.Another change made to the DSR code is that DSR now uses a CMU version of PriorityQueue in place of the older version in ns. This can found under ~ns/queue/dsrqueue.{cc,h}.Download ns-dbug-dsr-072202.tar.gz for the debugged version of the src code.
    Note that since DSR now uses CMUPriQueue, all dsr scripts previously using "Queue/DropTail/PriQueue" should be replaced with "CMUPriQueue". See dsr test scripts under tcl/test for examples.

  • Problem: When trying to run a simulation of 1 wired node, 1 base station and 31 mobile nodes (33 nodes in total), the simulator segmentation faulted. This is because in simulator.cc the size of nodelist_ which is an array of all wired nodes (since next_hop info is generated based on the "wired connectivity" ) is not updated with value of nn_ which is the total no of nodes in the topology. This bug was reported and suggested fix was provided by Donghua Xu
    Solution:Apply the following patch to file ~ns/common/simulator.cc
    Index: simulator.cc
    ===================================================================
    
    137a138,141
    > 
    > 	// Updating nodelist_ (total no of connected nodes)
    > 	// size since size_ maybe smaller than nn_ (total no of nodes)
    > 	check(nn_);    
    165a170,171
    > 	// update the size of nodelist with nn_
    > 	check(nn_);
    

ns-2.1b8

  • Problem: When compiling under Solaris 8 (Sun OS 5.8) I get the following error:
    In file included from aodv/aodv_logs.cc:6:
    aodv/aodv.h:231: redefinition of `struct bcache'
    /usr/include/sys/stream.h:335: previous definition here
    *** Error code 1
    make: Fatal error: Command failed for target `aodv/aodv_logs.o'
    

    Solution: bcache only appears twice in aodv.h and nowhere else. So you can fix it by renaming bcache to something else (perhaps aodv_bcache) on those two lines in aodv.h.

  • Problem:I try to build ns-2.1b8 under windows but the compiler bails out with errors like:
    wireless_phy.h(75): error C2555: 'wirelessPhy::node': overriding virtual function
    differs from 'Phy::node' only by return type or calling convention 
    phy.h(71): see declaration of 'Phy'
    NMAKE: fatal error U1077: 'C:\PROGRA~1\MICROS~3\VC98\BIN\cl.exe': return code
    '0x2' 
    Stop.
    

    Solution: There is a patched version of ns-src-2.1b8a-win.tar.gz available that should build under windows. Also please visit this page for other info about building under windows.

  • Problem: How do we use NS emulation on ns2.1b8 ?
    Solution: NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines. Till then you can use emulation on ns2.1b7

  • Problem: I had a problem compiling tcl8.3.2 in ns-allinone-2.1b8a. The problem I had was that when compiling tcl, the Makefile tried to generate tclStubInit.c which is already in tcl8.3.2/generic/. In order to generate tclStubInit.c you need tclsh, which is what I was trying to compile, so it didn't work. Reported by Michele C. Weigle.
    Solution:Contributed by Lloyd Lim. Tcl will try to regenerate tclStubInit.c if it thinks its timestamp is earlier than that of tcl.decls and/or tclInt.decls. To fix the timestamps, just "touch tclStubInit.c" and everything should compile normally.

  • Problem:Everytime you run ns, 2 files ftpfilesize.tr and ftpdly.tr are created.
    Solution:This bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~ns/baytcp/{ftps.cc,ftpc.cc}.
    Pl apply the following patch:
    Index: ftp.h
    ===================================================================
    73c73
    < 	static FILE* fp_;
    ---
    > 	//static FILE* fp_;
    
    Index: ftpc.cc
    ===================================================================
    52c52,53
    < FILE* FtpClientAgent::fp_ = fopen("ftpdly.tr", "w");
    ---
    > 
    > //FILE* FtpClientAgent::fp_ = fopen("ftpdly.tr", "w");
    
    Index: ftps.cc
    ===================================================================
    26c26
    <       static FILE* fp_;
    ---
    > 	//static FILE* fp_;
    29c29
    < FILE* FtpSrvrAgent::fp_ = fopen("ftpfilesize.tr", "w");
    ---
    > //FILE* FtpSrvrAgent::fp_ = fopen("ftpfilesize.tr", "w");
    
    

  • Problem:Ns builds fine but trying to do a make install gives error.
    Solution:Please apply the following patch (contributed by Hyok Kim) to Makefile.in
    370c370
    <       for i in $(SUBDIRS); do ( cd $$i; $(MAKE) install; ) done
    ---
    >       for i in $(SUBDIRS); do cd $$i; $(MAKE) install; done
    
    

ns-2.1b7

  • Problem:Memory leak in computeRoute routine in linkstate routing code
    Solution:Please apply the following patch (contributed by Ming Feng) to ~ns/linkstate/ls.h:
    --- ls.h	2000/09/01 17:38:56	1.3
    +++ ls.h	2001/05/24 18:32:49
    @@ -553,7 +553,9 @@
     
     	bool init(LsNode* nodePtr);
     	void computeRoutes() {
    -		routingTablePtr_ = _computeRoutes();
    +	        if (routingTablePtr_ != NULL)
    +	                delete routingTablePtr_;
    +		routingTablePtr_ = _computeRoutes();
     	}
     	LsEqualPaths* lookup(int destId) {
     		return (routingTablePtr_ == NULL) ? 
    
    

  • Problem:Snoop is broken (has been fixed in the 2.1b8 release).
    Solution:Snoop has been broken for quite sometime.It has been fixed as of 04.06.01, thanks to Benyuan Liu. The patch is available at Snoop.patch.

  • Problem:Segmentation fault while running wireless simulations due to uninitialised variable ant_.
    Solution:Apply this patch (courtesy of Lars Christensen):
    --- wireless-phy.cc     2001/02/28 14:36:26     1.1.1.1
    +++ wireless-phy.cc     2001/03/08 15:20:58     1.2
    @@ -102,6 +102,7 @@
            lambda_ = SPEED_OF_LIGHT / freq_;
     
            node_ = 0;
    +       ant_ = 0;
            propagation_ = 0;
            modulation_ = 0;
    

  • Problem:Class vector used in god{.cc,.h} clashes with vector in the standard template library.
    Solution:Apply the following patch courtesy of Lars Christensen.

  • Problem:nse does not compile on freebsd nor linux. It complains about recvfrom() in net-ip.cc (and ether_aton() in arp.cc for linux)
    Solution:Get fixed net-ip.cc and arp.cc from daily snapshot, or from ns web cvs repository. Reported by Ian G. Clark.

  • Problem: PacketData does not set size correctly.
    Solution: Apply this patch (courtesy of Lars Christensen):
    --- packet.h    2000/09/28 20:19:06 1.80
    +++ packet.h    2000/11/09 01:53:50 1.81
    @@ -260,7 +260,7 @@
            }
            unsigned char* data() { return data_; }
     
    -       virtual int size() { return datalen_; }
    +       virtual int size() const { return datalen_; }
            virtual AppData* copy() { return new PacketData(*this); }
     private:
            unsigned char* data_;
    

  • Problem: gen-map does not work
    Solution: Apply this patch:
    --- ns-trace.tcl~       2000/07/24 19:48:10
    +++ ns-trace.tcl        2000/10/19 18:02:42
    @@ -162,6 +162,7 @@
                            #incr i
                            continue
                    }
    +               set n $Node_($i)
                    puts "Node [$n tn]"
                    foreach nc [$n info vars] {
                            switch $nc {
    
    (This problem is fixed in ns-2.1b7a)

  • Problem:Priority queue bug in handling routing packets.
    Solution:Apply the changes provided by Robin Poss. (It will go into snapshot after Oct 19, 2000).

ns-2.1b6

  • Problem: Some ns-2.1b6 test suites don't pass (test-all-monitor, etc.) when ns is built with tcl-8.3.

    Solution: Two choices: (1) get tcl-8.0.3. (2) update to a snapshot of ns-2 and tclcl after 17 August 2000. For additional details see this message to ns-users.

  • Problem: ns crashes (segfaults) with Tcl_ParseCommand() at the top of the traceback, or test-all-vc or test-all-monitor fail.

    One cause for this is that Tcl_Eval was called on a read-only string. (Tcl_ParseCommand changes strings in-place in tcltk-8.3.) This is a problem in some systems where the C compiler makes string constants read-only.

    Here's the top of the traceback from test-all-monitor:

           	#0  0x4012f1d7 in Tcl_ParseCommand () from /usr/lib/libtcl8.3.so
    	#1  0x40130228 in Tcl_EvalEx () from /usr/lib/libtcl8.3.so
    	#2  0x4012ff5e in Tcl_EvalTokens () from /usr/lib/libtcl8.3.so
    	#3  0x401302a2 in Tcl_EvalEx () from /usr/lib/libtcl8.3.so
    	#4  0x40130541 in Tcl_Eval () from /usr/lib/libtcl8.3.so
    	#5  0x400fa063 in Tcl_GlobalEval () from /usr/lib/libtcl8.3.so
    	#6  0x8114c97 in Tcl::eval () at gen/ptypes.cc:297
    	#7  0x805eb87 in Agent::trace (this=0x83df338, v=0x83df57c)
    	    at agent.cc:282
    	#8  0x8063f90 in TcpAgent::trace (this=0x83df338, v=0x83df57c)
    	    at tcp.cc:320
    	#9  0x81161e9 in TclObject::handle_TracedVar () at gen/ptypes.cc:297
    	#10 0x811671f in TclObject::delay_bind () at gen/ptypes.cc:297
    	#11 0x8063412 in TcpAgent::delay_bind_dispatch (this=0x83df338, 
    	    varName=0x83dd4c8 "cwnd_", localName=0x83dd4c8 "cwnd_", 
    	    tracer=0x83df338) at tcp.cc:231
    

    This problem has been observed on Linux systems running RedHat 7.0 (i.e., tclcl-8.3 and gcc 2.96). Probably it appeared there because either tclcl-8.3 changed Tcl_ParseCommand or gcc 2.96 changed string constants to be read-only by default.

    Solution: Update to a tclcl snapshot after 17 August 2000 (or the 1.0b10 release, whenever that happens).

    Other work-arounds: change your compiler to make string constants writable (in gcc, add "-fwritable-strings" to CFLAGS and LDFLAGS).

  • Problem: Configure of otcl, tcl or ns fails with the message "cannot run test program while cross-compiling".
    telesto{ddutta}8: ./install 
    creating cache ./config.cache
    checking for ranlib... ranlib
    checking whether cross-compiling... yes
    checking for getcwd... no
    checking for opendir... no
    ...
    checking for -linet... no
    checking for net/errno.h... yes
    checking whether char is unsigned... configure: error: can not run test
    program while cross compiling
    tcl8.0.4 configuration failed! Exiting ...
    	      

    Solution: This error happens on Solaris systems where gcc is installed and Sun's C compiler is not installed, but configure decides to use Sun's compiler anyway.

    As a work-around, set the environment variable "CC" to "gcc" and "CXX" to "g++" (setenv CC gcc; setenv CXX g++;) before configuring ns.

    In the next release of ns it will prefer gcc to cc when both ar available, hopefully fixing this problem.

  • Problem: invalid command name "Mac/Csma/Cd"

    Solution: use the Mac/802_3 agent which implements CSMA/CD to replace Mac/Csma/Cd

  • Problem: Running validation on RedHat Linux 6.0 with egcs-2.91.66 reports the following test suites as broken:
    	 ./test-all-cbq ./test-all-cbq-v1 ./test-all-webcache ./test-all-wireless-lan 
    	 ./test-all-wireless-gridkeeper ./test-all-wireless-lan-newnode ./test-all-wireless-lan-tora
    	 

    Solution: Remove -O2 optimization from the makefile and recompile everything. Alternatively, you can configure everything with debugging enabled, which doesn't pass -O2 option to the compiler. Just do:

    	 make clean
    	 ./configure --enable-debug
    	 make
    	 

  • Problem: When running a simultation, I get the error
    ns: scheduler going backwards in time from X to Y.

    Solution: Have you modified anything in NS code? I've had this problem becouse of incorrect calls to Scheduler::schedule. If something schedule an event with a time already gone (less than current time of the scheduler), the Scheduler::dispatch will generate that message. I've solved my problems debugging with a breakpoint in scheduler.cc line 99 ( fprintf(stderr, "ns: scheduler going backwards in time from %f to %f.\n", clock_, t); ), and than with backtrace to find the incorrect scheduling. [Contributed by Massimo Pegorer]

    Here is also a relevant excerpt from a message appeared on the ns-users list:

    > > There were a lot of discussions on "scheduler going backwards" problem
    > > in this list. I wonder what is the final solution?
    > 
    > I think I can summarize it as follows:
    > 
    > 1.  If you see this warning, the first thing you should do is to make
    >     sure you're using the latest version of scheduler.cc.  If necessary,
    >     get the latest version from 
    >     http://www.isi.edu/cgi-bin/nsnam/cvsweb/ns-2/scheduler.cc
    >     Don't forget to recompile.  If after that you still see this error
    >     message, please report this to the list.
    > 
    > 2.  If the previous didn't work for you, use Heap scheduler instead of
    >     default Calendar (see Simulator instproc use-scheduler command and
    >     nsdoc). Heap scheduler, although a little less effective than
    >     Calendar, doesn't have a numeric stability problem and should not
    >     give you this error.  Again, if it does, please report this to the
    >     list.
    

  • Problem: Validate does not run under Windows 95/98/NT.
    Solution: See ns-build.html for instructions on how to run it.
  • Problem: When you run scripts it tells you something like "slot not found".

    Solution:This may be due to many reasons, but if this is your first time running 2.1b6 release and you immediately see this problem, then try getting classifier-port.cc and classifier-port.h from cvs repository http://www.isi.edu/cgi-bin/nsnam/cvsweb/ns-2.

  • Problem:When I use DV routing I don't get any traffic.

    Solution:This is fixed in the snapshot of 14 February 2000.
    You could also apply the patches in: http://www.isi.edu/nsnam/archive/ns-users/webarch/2000/msg00635.html.

  • Problem:Configure on some platforms fail with this error message:
    checking for tk.h... configure: error: NONE is not a directory 
    

    Solution:Apply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia) :

    --- configure.old       Tue Feb 22 14:25:15 2000
    +++ configure   Mon Mar  6 12:45:35 2000
    @@ -2021,7 +2021,7 @@
       withval="$with_tk"
       d=$withval
     else
    -  d=$prefix
    +  d=""
     fi
    

  • Problem:tcl/ex/web-traffic.tcl aborts with message:
    done pages 10 != all pages 9
    

    Solution:Apply the following patch to webcache/webtraf.cc.

  • Problem: Validation fails with the on test-all-aimd with the following messages:
    ./test-all-aimd QUIET
    Tests: tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno tcp_newreno tcpA_newreno
    ../../ns test-suite-aimd.tcl tcp QUIET
    Test output agrees with reference output
    ../../ns test-suite-aimd.tcl tcpA QUIET
    Test output agrees with reference output
    ../../ns test-suite-aimd.tcl tcpB QUIET
    Test output agrees with reference output
    ../../ns test-suite-aimd.tcl tcp_tahoe QUIET
    saving output for future validation
    ../../ns test-suite-aimd.tcl tcpA_tahoe QUIET
    saving output for future validation
    ../../ns test-suite-aimd.tcl tcp_reno QUIET
    saving output for future validation
    ../../ns test-suite-aimd.tcl tcpA_reno QUIET
    saving output for future validation
    ../../ns test-suite-aimd.tcl tcp_newreno QUIET
    saving output for future validation
    ../../ns test-suite-aimd.tcl tcpA_newreno QUIET
    saving output for future validation
    ./test-all-template1: unknown: not found
    Some test failed.
    
    Solution: Download test-output-aimd.tar.gz and untar it at your ns-2.1b6 direcotry.
  • Problem: Configuration script still lists tclcl version 1.0b8 as and otcl version 1.0a5 the required versions.

    Solution: Download ns-2.1b6-configure.patch and apply it to ns-2.1b6/configure.

  • Problem: Some satellite examples do not exist in the release.

    Solution: Download satellite-examples.tar.gz and untar it at your ns-2.1b6 directory.


ns-allinone-2.28

  • Problem: When installing ns-allinone-2.28 using gcc3.4, nam fails to build.

    Solution:Try replacing the "NULL" in line 73 of file agent.h in nam-1.11 with "0". Bug reported and fix supplied by Qihe Wang.

  • Problem: When installing ns-allinone-2.28 in solaris, there may be build problems.

    Solution: Apply the following patch. Reported and fixed by Qihe Wang.

ns-allinone-2.26

  • Problem: When installing ns-allinone-2.26 on Mac OS X, nam fails to link against zlib (there are undefined symbol errors for _gzclose_gzopen_gzread, etc.)

    Solution: The "configure" script for nam has a typo. Edit the file nam-1.9/configure and find the line which says ZLIB_VERS=1.1.3 and change it to say ZLIB_VERS=1.1.4

  • Problem: ns-allinone-2.26 does not compile cleanly in cygwin.

    Solution: All the Cygwin patches have been included in the base distribution, but for some reason, an old file crept its way into the release. You will need to download nam-1.9.configure, available here.

ns-allinone-2.1b9

  • Problem: ns-allinone does not compile when using gcc-3.2/Redhat 8.0.

    Solution: ns has been patched to compile using GCC-3.2/Redhat8.0 on October 10 2002. Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone.

ns-allinone-2.1b8

  • Problem:The tcl8.3.2 distribution included in ns-allinone-2.1b8a tarfile, has same timestamps for stubfiles like tclStubInit.c and stub-generator files like tcl.decls included under its subdir called generic. As a result, while trying to build tcl, it tries to regenerate the stubfiles, which in turn requires a working tclsh, which ofcource is not built as yet. And if there are no other previous installed tclsh present, it bails out with the foll error msg during make:
    ./tclsh ./../tools/genStubs.tcl ./../generic \
    	./../generic/tcl.decls ./../generic/tclInt.decls
    make: ./tclsh: Command not found
    make: *** [../generic/tclStubInit.c] Error 127
    

    Solution:Touch ~tcl8.3.2/generic/tclStubInit.c file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file.

All problems here are discussed in the ns-2.1b7 section.

ns-allinone-2.1b7

  • Problem:ns-allinone-2.1b7 install cannot find tcl/tk libraries.
    Solution: (This problem is fixed in ns-2.1b7a.) Apply the following patch (contributed by George Riley):
    --- install~    Wed Oct 18 14:41:56 2000
    +++ install     Mon Oct 30 09:49:21 2000
    @@ -104,7 +104,7 @@
     
     blame='Please check http://www.isi.edu/nsnam/ns/ns-problems.html
     for common problems and bug fixes.'
    -./configure || die "otcl-1.0a6 configuration failed! Exiting ..."
    +./configure --with-tcl=../tclbox --with-tk=../tkbox || die "otcl-1.0a6 configuration failed
    ! Exiting ..."
     
     if make 
     then
    @@ -122,7 +122,7 @@
     
     cd ./tclcl-1.0b10
     
    -./configure || die "tclcl-1.0b10 configuration failed! Exiting ..."
    +./configure --with-tcl=../tclbox --with-tk=../tkbox --with-otcl=../otcl-1.0a6 || die "tclcl-1.0b10 configuration fail
    ed! Exiting ..."
     
     if make
     then
    @@ -234,16 +234,15 @@
         echo "sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing.."
     fi
     
    -#compile and install ns
    +# Compile and install ns. Since ns searches for tclsh in $PATH, the following is needed.
     PATH=$CUR_PATH/tclbox/bin:$CUR_PATH/tkbox/bin:$PATH
     export PATH
    -#echo $PATH
     
     # John's hack
     test -f ./otcl-1.0a6/libotcl.a && rm ./otcl-1.0a6/libotcl.so
     
     cd ./ns-2.1b7
    -./configure || die "Ns configuration failed! Exiting ..."
    +./configure --with-tcl=../tclbox --with-tk=../tkbox --with-otcl=../otcl-1.0a6 --with-tclcl=../tclcl-1.0b10 || die "Ns configuration failed! Exitin
    g ..."
     
     if make
     then
    @@ -279,7 +278,7 @@
     
     cd ./nam-1.0a9
     
    -./configure || die "Nam configuration failed! Exiting ..."
    +./configure --with-tcl=../tclbox --with-tk=../tkbox --with-otcl=../otcl-1.0a6 --with-tclcl=
    ../tclcl-1.0b10 || die "Nam configuration failed! Exiti
    ng ..."
     
     if make
     then 
    @@ -356,7 +355,8 @@
     
     echo "-----------------------------------------------------"
     echo "Please put $CUR_PATH/bin into your PATH environment."
    -echo "You many need to put $CUR_PATH/otcl-1.0a6, $CUR_PATH/tclbox/lib, $CUR_PATH/tkbox/lib"
    +echo ""
    +echo "You MUST put $CUR_PATH/otcl-1.0a6, $CUR_PATH/tclbox/lib, $CUR_PATH/tkbox/lib"
     echo "into your LD_LIBRARY_PATH environment variable. If it complains about X libraries,"
     echo "add path to your X libraries into LD_LIBRARY_PATH."
     echo ""
    

  • Problem: sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is obsolete. (Note this is a problem of ns-allinone-2.1b7). Reported by Ann Monico.
    Solution: Download a new version of sgb2ns.

  • Problem: Scheduler::run() may lose an event when the simulator halts then resumes.
    Solution: Apply this patch by Thomas Kaemer
    --- scheduler.cc~       2000/09/29 23:40:12     
    +++ scheduler.cc        2000/10/20 01:45:24    
    @@ -98,7 +98,12 @@
     {
            instance_ = this;
            Event *p;
    -       while ((p = deque()) && !halted_) {
    +       /*
    +        * The order is significant: if halted_ is checked later,
    +        * event p could be lost when the simulator resumes.
    +        * Patch by Thomas Kaemer .
    +        */
    +       while (!halted_ && (p = deque())) {
                    dispatch(p);
            }
     }
    

ns-allinone-2.1b6a

All problems here are discussed in the ns-2.1b6 section.

ns-allinone-2.1b6

  • Problem: nam crashes when running the wireless examples in Marc Greis's tutorial

    Solution:there was a bug in hierarchical routing for wireless , it's fixed in the snapshot after 1/25/2000 .

ns-2.1b5

  • Problem: Compiler errors on htonl (occur on DEC Unix, Debian Linux (but not RedHat), etc.).

    Solution: Change the

     #if defined(hpux) || defined(sun)
    defined in traffictrace.cc (around line 35) to be
    #if 1
    (always). Eventually autoconf should figure this out.
  • Problem: On win95/98/NT, ns compiles but does not run. Doing a "Simulator info instprocs" shows nothing.

    Solution: Comment out line "source ns-autoconf.tcl" in tcl/lib/ns-lib.tcl. Because that file does not exist under win32 platforms, the process that embedding tcl scripts into ns is aborted. (Reported by David Lalla.)
    This can also be solved by the following patch to bin/tcl-expand.tcl:

    --- tcl-expand.tcl~     1998/05/27 19:46:46     
    +++ tcl-expand.tcl      1999/08/20 16:55:04     
    @@ -40,6 +40,10 @@
     
     proc expand_file name {
            puts "### tcl-expand.tcl: begin expanding $name"
    +       if {[file exists $name] == 0} {
    +               puts "### tcl-expand.tcl: cannot find $name"
    +               return 
    +       }
            set f [open $name r]
            while 1 {
                    if { [gets $f line] < 0 } {
    

  • Problem: Linker reports an error:
       Undefined   first referenced
        symbol         in file
        _RENAMED                            ...
    

    Solution: Upgrade your TclCl.

  • Problem:Compiling programs under indep-utils/webcache-conv on platforms other than FreeBSD or BSD4.4 systems will raise unresolved symbols heapsort and strsep.

    Solution: Apply the patch to webcache-conv/. Or download ns snapshots after July 9th, 1999.

  • Problem: If you run with assertion on (w/o flag -DNDEBUG at compile),some assertions fail.

    Solution: Apply the following patch to phy.cc:

    --- phy.cc      1999/03/13 03:52:59     1.4
    +++ phy.cc      1999/03/23 01:38:22     1.5
    @@ -78,6 +78,7 @@
                    if (strcmp(argv[1], "channel") == 0) {
                             assert(channel_ == 0);
                            channel_ = (Channel*) obj;
    +                       downtarget_ = (NsObject*) obj;
                            // LIST_INSERT_HEAD() is done by Channel
                            return TCL_OK;
                    }
    
    

  • Problem: The wireless example script ~ns/tcl/ex/wireless.tcl when run with the DSR or DSDV routing option, raises errors and then bails out with messages like :
           dfu: ran off the end of a source route (for DSR) or,
           dfu: invalid UID    etc.
    

    Solution: Go to ns-build page for a special ns snaphot having the debugged version of CMU's wireless module in ns.

ns-allinone-2.1b5

  • Problem: When installing ns-allinone or ns, I get an error message that includes
    configure: error: can not run test program while cross compiling
    .

    For example:

    loading cache ./config.cache
    checking for ranlib... ranlib
    checking whether cross-compiling... yes
    ...
    checking for BSDgettimeofday... no
    checking for gettimeofday... no
    checking for gettimeofday declaration... missing
    checking for -linet... no
    checking for net/errno.h... yes
    checking whether char is unsigned... configure: error: can not run test program while cross compiling
    tcl8.0.4 configuration failed! Exiting ...
    

    Solution: You most likely have a gcc installation problem on your computer. Please check gcc and try again. (Also, this is an error in tcl, not in ns. For other errors in tcl, you may find help from Scriptics.)

  • Problem: When I went to install the ns-allinone-2.1b5 on Redhat 6.0 with Linux kernel 2.2.5-15, I got an error during compilation for tcl8.0.4
      ./../generic/tclPosixStr.c: In function `Tcl_ErrnoId'
      ./../generic/tclPosixStr.c:340: duplicate case value
      ./../generic/tclPosixStr.c:328: this is the first entry for that value 
    
      ./../generic/tclPosixStr.c: In function `Tcl_ErrnoMsg'
      ./../generic/tclPosixStr.c:787: duplicate case value
      ./../generic/tclPosixStr.c:775: this is the first entry for that value 
    
      make: *** [tclPosixStr.o] Error 1
      tcl8.0.4 make failed! Exiting ...
    
    

    Solution: the compiler was complaining that the #defined ENOTSUP and EOPNOTSUPP values in different case statements had the same value. These statements are not defined the same in the ns-allinone package, but if you look in /usr/include/bits/errno.h you will find the following statement

       # define ENOTSUP EOPNOTSUPP
    
    so ENOTSUP is defined to the same value as EOPNOTSUPP in Linux. Note this may not be true with different Linux kernel versions. The solution to work around this is to
        /*
        #ifdef ENOTSUP
               case ENOTSUP: return "ENOTSUP";
        #endif
        */
         
        /*
        #ifdef ENOTSUP
               case ENOTSUP: return "operation not supported";
        #endif
        */
    
    comment out both of the above statements in tclPosixStr.c. They should be around lines 328 and 775, respectively.

  • Problem: ns-allinone fails to detect the correct version of tclsh, i.e. tclsh8.0. As a result, the installation script fails or, worse, finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future.

    Solution:

    1. Download this patch and place it at your allinone directory.
    2. Apply the patch by typing "patch -p < ns-allinone-2.1b5.patch"
    3. Remove config.cache from your OTcl, TclCl, ns, and nam directories
    4. Re-install

ns-allinone-2.1b4

  • Problem: ns-allinone exits with the foll. error message:
    cc -g -c cweave.c
    cc -g -o cweave cweave.o common.o
    ./install: test: ] missing
    Reported Wed Nov 18 Sundeep Singatwaria (sundeep@cadence.com)
    or exits while trying to build cweb/sgb.

    Solution: Download the newer version ns-allinone-2.1b4a now available from ns-build page.

ns-2.1b4

  • Problem: Ns doesn't generate nam traces for user-installed error modules. Reported by Sarah Liu.

    Solution: Add the following patches to tcl/lib/ns-lib.tcl and tcl/lib/ns-link.tcl. Note that these patches are against the current snapshot (ns-lib version 1.139 and ns-link version 1.40). If you failed to apply them, try download the current snapshot, or use the context to apply these patches manually.
    Previously, there are two major OTcl methods to install a loss module in a simple link: Simulator::lossmodel and SimpleLink::errormodule. These two methods insert an error module BEFORE the queue module in a link. Simulator::lossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops. SimpleLink::errormodule is able to produce ns and nam traces, however, the nam trace can only be visualized using nam snapshots after March 3rd, 1999. After these patches, both methods have identical effects, but a new nam is still required.
    In addition, two new OTcl methods are added: Simulator::link-lossmodel and SimpleLink::insert-linkloss. These two methods insert an error module AFTER the queue module. Their traces can be visualized by both the old nam and the new one.
    Patch for ns-lib.tcl:

    --- ns-lib.tcl  1999/02/26 23:06:34     1.139
    +++ ns-lib.tcl  1999/03/04 00:12:34
    @@ -1049,11 +1049,13 @@
     ### to insert loss module to regular links in detailed Simulator
     Simulator instproc lossmodel {lossobj from to} {
            set link [$self link $from $to]
    -       set head [$link head]
    -       # puts "[[$head target] info class]"
    -       $lossobj target [$head target]
    -       $head target $lossobj
    -       # puts "[[$head target] info class]"
    +       $link errormodule $lossobj
    +}
    +
    +# This function generates losses that can be visualized by nam.
    +Simulator instproc link-lossmodel {lossobj from to} {
    +       set link [$self link $from $to]
    +       $link insert-linkloss $lossobj
     }
     
     Simulator instproc bw_parse { bspec } {
    
    Patch for ns-link.tcl:
    --- ns-link.tcl 1998/10/28 19:26:49     1.40
    +++ ns-link.tcl 1999/03/04 00:09:18
    @@ -461,7 +461,7 @@
     }
     
     #
    -# insert an "error module" after the queue
    +# insert an "error module" BEFORE the queue
     # point the em's drop-target to the drophead
     #
     SimpleLink instproc errormodule args {
    @@ -477,3 +477,35 @@
     
            $em drop-target $drophead_
     }
    +
    +#
    +# Insert a loss module AFTER the queue. 
    +#
    +# Must be inserted *RIGHT AFTER* the deqT_ (if present) or queue_, because
    +# nam can only visualize a packet drop if and only if it is on the link or 
    +# in the queue
    +#
    +SimpleLink instproc insert-linkloss args { 
    +       $self instvar link_errmodule_ queue_ drophead_ deqT_ 
    +       if { $args == "" } {
    +               return $link_errmodule_
    +       }
    +
    +       set em [lindex $args 0]
    +       if [info exists link_errmodule_] {
    +               delete link_errmodule_
    +       }
    +       set link_errmodule_ $em
    +
    +        if [info exists deqT_] {
    +                $em target [$deqT_ target]
    +                $deqT_ target $em
    +        } else {
    +                $em target [$queue_ target]
    +                $queue_ target $em
    +        }
    +
    +       $em drop-target $drophead_
    +}
    +
    +
    

  • Problem: Static link color configuration for nam doesn't work (must use $ns at ... to change link color).

    Solution: Add the following patch to tcl/lib/ns-namsupp.tcl (note this is the version in ns-2.1b4):

    --- ns-namsupp.tcl~     1998/10/06 01:26:24    
    +++ ns-namsupp.tcl      1999/02/16 22:48:38     
    @@ -143,7 +148,7 @@
            set delay [$link_ set delay_]
     
            $ns puts-nam-config \
    -               "l -t * -s [$fromNode_ id] -d [$toNode_ id] -S UP -r $bw -D $delay -o $attr_(ORIENTATION)"
    +               "l -t * -s [$fromNode_ id] -d [$toNode_ id] -S UP -r $bw -D $delay -c $attr_(COLOR) -o $attr_(ORIENTATION)"
     }
     
     Link instproc dump-nam-queueconfig {} {
    

  • Problem: On HP-UX 10.20 with gcc 2.7.2.2, make failed with messages like:
    In file included from random.h:41,
                     from random.cc:40:
    config.h:60: conflicting types for `typedef signed char int8_t'
    /usr/include/sys/_inttypes.h:48: previous declaration as `typedef char int8_t'
    In file included from random.h:41,
                     from random.cc:40:
    config.h:92: declaration of C function `int gethostid()' conflicts with
    /usr/include/sys/unistd.h:350: previous declaration `long int gethostid()' here
    config.h:94: declaration of C function `void srandom(int)' conflicts with
    /usr/local/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.7.2.2/include/stdlib.h:265:
    previous declaration `void srandom(unsigned int)' here
    *** Error exit code 1
    
    Stop.
    

    Solution: Add the following patch into config.h:

    --- config.h~    1998/12/10 18:58:09     
    +++ config.h     1999/01/18 23:42:04
    @@ -49,7 +49,7 @@
     /* typedef signed char int8_t breaks under Solaris 2.6.  Shouldn't */
     /* autoconf handle stuff like this?  Shouldn't autoconf generate   */
     /* config.h?  Who knows autoconf well enough to fix this?  --AMC   */
    -#if defined(sun)
    +#if defined(sun) || defined(__hpux)
     #include 
     typedef unsigned char u_char;
     typedef unsigned short u_short;
    @@ -95,8 +95,10 @@
     #include 
     int strcasecmp(const char *, const char *);
     clock_t clock(void);
    +#if !defined(__hpux)
     int gethostid(void);
    -#if !defined(_AIX41) && !defined(sun)
    +#endif
    +#if !defined(_AIX41) && !defined(sun) && !defined(__hpux)
     void srandom(int);
     #endif
     long random(void);
    

  • Problem: On some systems ns's configure finds tclsh but compilation fails with a message like:
       tclsh8.0 bin/string2c.tcl  version_string < VERSION >  gen/version.c
    
       sh: tclsh8.0: not found
    
       *** Error code 1
    
       make: Fatal error: Command failed for target 'gen/version.c'
         

    Reported 16 Dec 1998 by Raed Sunna.

    Solution: There is a bug in ns-2.1b4's configure; it only remembers that it finds tclsh8.0, not the complete path to it. This will be fixed in tonight's ns and nam snapshots; for now the work-around is to manually edit the Makefile and specify the path to tclsh on the line that begins "TCLSH =".

  • Problem: On Windows 98, ns compiles fine but on trying to run ns.exe it outputs the contents of the gen/ns_tcl.cc file and exits.
    Reported 27 Oct 1998 by Brett Vickers.

    Solution: The Makefile.vc in ns-2.1b4 release is not updated. Apply the win98.patch provided by Brett Vickers to remove the problem.

    The win98.patch is as follows:

    Index: makefile.vc
    ======================================================================
    --- makefile.vc Wed Sep  2 19:15:29 1998
    +++ makefile.vc Wed Oct 28 12:07:32 1998
    @@ -98,7 +98,7 @@
            scheduler.o object.o \
            packet.o ip.o route.o connector.o ttl.o \
            trace.o trace-ip.o \
    -       classifier.o classifier-addr.o classifier-hash.o \
    +       classifier.o classifier-addr.o classifier-hash.o classifier-virtual.o \
            classifier-mcast.o classifier-mpath.o replicator.o \
            classifier-mac.o \
            app.o telnet.o tcplib-telnet.o \
    @@ -122,7 +122,7 @@
            delay.o ll.o snoop.o \
            channel.o mac.o mac-csma.o mac-802_11.o mac-multihop.o \
            dynalink.o rtProtoDV.o net-interface.o \
    -       ctrMcast.o prune.o srm.o \
    +       ctrMcast.o mcast_ctrl.o srm.o \
            sessionhelper.o delaymodel.o srm-ssm.o \
            srm-topo.o \
            alloc-address.o address.o \
    @@ -130,7 +130,7 @@
            $(LIB_DIR)dmalloc_support.o \
            webcache/http.o webcache/tcp-simple.o webcache/pagepool.o \
            webcache/inval-agent.o webcache/tcpapp.o webcache/http-aux.o \
    -       lanRouter.o
    +       lanRouter.o tfcc.o filter.o
     
     # what was here before is now in emulate/
     OBJ_C =
    
    
    Index: filter.h
    ======================================================================
    --- filter.h    Tue Oct  6 14:39:34 1998
    +++ filter.h    Wed Oct 28 12:07:36 1998
    @@ -29,11 +29,11 @@
     public:
            Filter();
            inline NsObject* filter_target() { return filter_target_; }
    +       enum filter_e { DROP, PASS, FILTER, DUPLIC };
     protected:
    -       enum filter_e { DROP, PASS, FILTER, DUPLICATE };
            virtual filter_e filter(Packet* p);
     
    -       int command(int argc, const char*const* argv);
    +       int command(int argc, const char* const* argv);
            void recv(Packet*, Handler* h= 0);
            NsObject* filter_target_; // target for the matching packets
     };
    
    
    Index: filter.cc
    ======================================================================
    --- filter.cc   Wed Oct 28 13:58:50 1998
    +++ filter.cc   Wed Oct 28 13:58:42 1998
    @@ -48,7 +48,7 @@
                    if (h) h->handle(p);
                    drop(p);
                    break;
    -       case DUPLICATE :
    +       case DUPLIC :
                    if (filter_target_)
                            filter_target_->recv(p->copy(), h);
                    /* fallthrough */
    
    

ns-2.1b3

  • Problem: I can't compile embedded-tcl.cc (for example, I get the message CC:embedded-tcl.cc: line 1: compiler limit exceeded: lexical token too long. on HP-UX 10.20).

    embedded-tcl.cc contains tcl code as one long string. Some compilers (like yours) can't handle strings that are so long.

    Solution: (choose one or the other)

    • install gcc OR
    • rebuild tcl2c++ with TCL2C_INT defined, then regenerate embedded-tcl.cc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

      Here's the patch for HP-UX:

      Index: tcl2c++.c
      --- tcl2c++.c   1998/10/08 18:12:55     1.8
      +++ tcl2c++.c   1998/10/12 16:40:27
      @@ -30,7 +30,10 @@
       #define strcasecmp _stricmp
       #endif
       
      -#if defined(WIN32) || defined(__alpha__)
      +/*
      + * Define TCL2C_INT if your compiler has problems with long strings.
      + */
      +#if defined(WIN32) || defined(__alpha__) || defined(__hpux)
       #define TCL2C_INT
       #endif
      

  • Problem: NS breaks on trying to use single level of hierarchy for hierarchical routing.

    Solution: Apply patchfile hier.patch to remove the above bug.

  • Problem: mem-trace.h doesn't compile or ns fails to link because of errors about getrusage.

    Solution: Ns-2.1b4 and snapshots after 15-Sep-98 should autodetect getrusage. Upgrade to those versions. Work-around: Comment out lines in mem-trace.h which reference getrusage and/or sbrk until things compile. (This will disable memory monitoring but basic ns will still work.)

  • Problem: Static library of tcl-debug v1.7 on FreeBSD still contains symbols required by the dynamic libraries (crt0.o). This is caused by compiling .o files using -fpic, and using those .o files to build static library.

    Solution: Apply the following patch to Makefile.in of tcl-debug v1.7:

    37,38c37
    < CFLAGS = @DBG_CFLAGS@ 
    < SHCFLAGS = @DBG_CFLAGS@ @DBG_SHLIB_CFLAGS@
    ---
    > CFLAGS = @DBG_CFLAGS@ @DBG_SHLIB_CFLAGS@
    85,87d83
    < SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS)
    < 
    < .SUFFIXES: .so
    91,92d86
    < .c.so:
    < 	$(CC) -c $(SHCFLAGS_INT) $(HDEFS) $<
    96d89
    < SOFILES = Dbg.so Dbg_cmd.so
    114c107
    < $(DBG_SHARED_LIB_FILE): $(SOFILES)
    ---
    > $(DBG_SHARED_LIB_FILE): $(OFILES)
    116c109
    < 	@TCL_SHLIB_LD@ -o $(DBG_SHARED_LIB_FILE) $(SOFILES)
    ---
    > 	@TCL_SHLIB_LD@ -o $(DBG_SHARED_LIB_FILE) $(OFILES)
        
    Then do make distclean and re-configure and make.

  • Problem: Nam can not understand "V -t * -v 1.0a5". We added version infomation into nam trace file, but all nam older than version 1.0a5 can not process it. A sample error message:
    nam: unknown event at offset 21 in `out.nam'
    nam: `V -t * -v 1.0a5 -a 0
    '
           

    Solutions:

        1. Download nam-snapshot from ns website.
        or,
        2. Delete the line from your nam tracefile.
        

    (If you've done these and the problem persists, check for old versions of nam in your path.)

  • Problem: namtrace-all causes segmentation fault on Linux and Solaris 2.6. It's caused by sprintf's inability to handle null pointers in those systems.

    Solution: Apply the following patch to ~ns-2/trace.cc:

    --- trace.cc~    1998/07/17 22:37:25     
    +++ trace.cc     1998/07/20 18:07:53
    @@ -185,7 +185,7 @@
            hdr_rtp *rh = (hdr_rtp*)p->access(off_rtp_);
     
            hdr_srm *sh = (hdr_srm*)p->access(off_srm_); 
    -       const char* sname = 0;
    +       const char* sname = "null";
     
            int t = th->ptype();
            const char* name = pt_names[t];
    @@ -413,7 +413,7 @@
                    hdr_cmn *th = (hdr_cmn*)p->access(off_cmn_);
                    hdr_ip *iph = (hdr_ip*)p->access(off_ip_);
                    hdr_srm *sh = (hdr_srm*)p->access(off_srm_);
    -               const char* sname = 0;   
    +               const char* sname = "null";   
     
                    int t = th->ptype();
                    const char* name = pt_names[t];
    
  • Problem: When compiling ns-2.1b3 you get errors like:
    object.cc: In method `void NsObject::delay_bind_init_all()':
    object.cc:60: warning: implicit declaration of function `int
    delay_bind_init_one(...)'
    object.cc: In method `int NsObject::delay_bind_dispatch(const char *,
    const char *)':
    object.cc:67: warning: implicit declaration of function `int
    DELAY_BIND_DISPATCH(...)'
    object.cc:67: `delay_bind' undeclared (first use this function)
           

    Solution: This error suggests you upgraded ns without upgrading tclcl. The recent ns release *requires* the current releases of otcl and tclcl.

  • Problem:The script tcl/ex/test-suite-intserv.tcl fails, as does anything using the IntServ functionality.
    Solution:This patch to ns-lib.tcl fixes the problem.

  • Problem:Multicast code breaks, because the interfaces were not installed properly, typically with an error message that goes as follows:
    ns: _o3 run-mcast: invalid command name "0"
        while executing
    "[$link set ifacein_] set intf_label_"
        (procedure "_o10" line 3)
        (Node get-oif line 3)
        invoked from within
    "$self get-oif $link"
        (procedure "_o10" line 5)
        (Node init-outLink line 5)
        invoked from within
    "$node init-outLink"
        (procedure "_o3" line 5)
        (Simulator run-mcast line 5)
        invoked from within
    "_o3 run-mcast"
    

    Solution: patch to ns-lib.tcl fixes the problem.
    This is preferably applied after the intserv patch above.

ns-2.1b2

  • Problem: In RedHat Linux 5.1 (and probably on other machines with gcc-2.8.x or egcs-1.0.x) tclcl fails to compile with erros like:
    c++ -c -I. -I../otcl -I../tkbox/include -I../tclbox/include -DNO_TK  -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tcl.o Tcl.cc
    tclcl-mappings.h: In function `static int TclObjectHelper::dispatch_(void *, struct Tcl_Interp *, int, char **)':
    In file included from tclcl.h:47,
    from Tcl.cc:50:
    tclcl-mappings.h:51: parse error before `::'
           

    Solution: Some C++ problems are fixed in the development version and will appear in the next release. Until then, follow Rod van Meter's directions for how to update ns-allinone to work on these systems.

  • Problem: In Debian Linux, ns compilation fails with an error like:
    c++ -c -g -DNO_TK  -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -DHAVE_TCLCL_H
    -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T
    K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H  -I. -I../tclcl-1.0b5
    -I/usr/local/include -I/usr/include/tcl -I/usr/include/tcl  -o random.o rand
    om.cc
    random.cc: In function `int random()':
    random.cc:50: new declaration `int random()'
    /usr/include/stdlib.h:198: ambiguates old declaration `long int random()'
    make: *** [random.o] Error 1
           

    Solution: There seems to be differences in Linux definitions of random. The Right Thing is to have autoconf detect the type of random, but (since I've not done that before) that's low on the priority list right now (code contributions are welcome, of course---it should be easy to do this in autoconf).

    Another approach would be to use an #define which differs between Debian and RedHat. I don't know of such a #define.

    Until it's fixed the Right Way, this patch should work around the problem:

    --- random.cc~	Tue Apr 14 14:07:04 1998
    +++ random.cc	Tue Apr 21 10:50:07 1998
    @@ -41,11 +41,7 @@
     #include 
     #include "random.h"
     
    -#ifdef linux
    -int
    -#else
     long
    -#endif
     random()
     {
     	printf("random() called in ns.\nRandom is not portable, please use Random::uniform() instead.\n");
    
    

    (Problem raised by Jeffrey Austen <jausten@tntech.edu>.)

  • Problem: Typos in the rtglib code and examples
    • Typo in line 208 of ~ns/tcl/rtglib/dynamics.tcl.

      Solution: Change line 208 to

                 set fin [lindex $args 3]
    • The dynamic routing line in ~ns/tcl/ex/simple-rtg.tcl vanished?

      Solution: Add the line

      $ns rtproto DV
      before specifying the rtmodel.
    • The dynamic routing line in ~ns/tcl/ex/simple-dyn.tcl vanished?

      Solution: Add the line

      $ns rtproto DV			;# or use Session
      before specifying the rtmodel.
  • Problem: Ns doesn't write 'v' events into nam trace files in correct format (without '-t'). It occurred in ns-allinone, and has been corrected in daily snapshots.

    Solution: Replace the following line in Simulator::trace-annotate in tcl/lib/ns-trace.tcl:

      $self puts-nam-traceall "v [$self now] ..."
      
    with
      $self puts-nam-traceall "v -t [$self now] ..."
      
  • Problem: Ns doesn't automatically find otcl-1.0b2 or tclcl-1.0b5 when running configure. (Reported by Larry Wood.)

    Solution: As a workaround, configure --with-otcl=path_to_otcl and --with-tclcl=path_to_tclcl. This is a bug which will be fixed in the next ns release.

  • Problem: Cannot find conf subdirectory in the ns-2.1b2 release.

    Solution:The ns/conf directory was inadvertently not added to the distribution list for ns-2.1b2 release. The conf directory contains files consisting mainly of autoconf rules which are used during configuration for ns (looking for tcl, tclcl, otcl, perl etc). Normally these files are believed to of no consequence to the functionalities of ns. However if you want to take a look at these configuration files or play around with them they are available in a tarred format called ns-2.conf.tar.

ns-2.1b1

  • Problem: NS gets compiled fine but give the error ``Simulator not found'' when run.

    (A more specific error message:)

    [rdv@omocha ex]$ ns rc.tcl 
    invalid command name "Simulator"
        while executing
    "Simulator create _o1 "
        invoked from within
    "catch "$className create $o $args" msg"
        (procedure "new" line 3)
        invoked from within
    "new Simulator"
        (file "rc.tcl" line 10)
           

    Solution: Make sure you have tclsh in your path, or change the Makefile to specify where tclsh is, or generate gen/ns_tcl.cc by hand (look at the Makefile for how). This problem often happens when gen/ns_tcl.cc is incorrectly generated and can be deteced by that file being less than 1KB in size (it should be longer than 300KB). This error often occurs on FreeBSD where tclsh is installed as tclsh8.0.

    This problem should be fixed in ns-2.1b2.

  • Problem: Compilation errors on ostream.h.

    Solution: Delete the line ' #include "ostream.h" ' in scheduler.cc

    Reported 12-Nov-97.

  • Problem: Under some circumstances configure does not find tcl7.6, tk4.2 library files.

    Solution: To get around this specify the versions of tcl and tk being used in --with-tcl-ver and --with-tk-ver to configure.

    Reported 12-Nov-97.

ns-2.0

  • Problem:Syntax error in leave-group-source Node method in tcl/mcast/ns-mcast.tcl while calling the leave-group-source method in the mcastproto_ object.

    Solution: Change the line '$mcastproto leave-group-source $group $source' to '$mcastproto_ leave-group-source $group $source'.

    Reported 11-Nov-97. Fixed in ns-2.1b1.

  • Problem:Multicast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set.

    Solution: In file tcl/mcast/ns-mcast.tcl:Classifier/Replicator/Demuxer instproc drop{}, comment out 'set ignore_ 1'.

    Reported 23-Oct-97

  • Problem:Backward compatibility mode did not work correctly for CBQ.
    Solution:Replace the two lines 'set a [lrange $args 2 [expr $arglen - 1]]; CBQClass create $id $a' with 'eval CBQClass create $id [lrange $args 2 [expr $arglen - 1]]' in tcl/lib/ns-compat.tcl. (Thanks to Greg Minshall for this fix.) In addition, add '$self instvar scheduler_; set scheduler_ [new Scheduler/List]' after the first three lines in 'OldSim instproc init' in tcl/lib/ns-compat.tcl.

    Reported 30-Sep-97.

  • The following problems were reported 18-Sept-97:
    • Problem:Sparse Mode multicast simulations (i.e. tcl/ex/newmcast/pim*.tcl) failed.
      Solution: In tcl/lib/ns-node.tcl: Node instproc enable-mcast, after line `$self set mcastproto_ [new McastProtoArbiter ""]' add the following line: `$mcastproto_ set Node $self'.

    • Problem:tcl/ex/newmcast/dense-mode2.tcl fails.
      Solution: In the simulation script itself change `multi-link' to `multi-link-of-interfaces'.

    • Problem:tcl/ex/newmcast/simple-rtp.tcl fails.
      Solution: In the simulation script itself, before the line `$ns duplex-link $n0 $n1 1.5Mb 10ms DropTail', add the following line: `Simulator set NumberInterfaces_ 1'.

    • Problem:tcl/ex/newmcast/session?.tcl scripts fail.
      Solution:In the simulation scripts themselves replace the last line: '$ns run Session' with '$ns rtproto Session; $ns run'.

  • Problem:Dense mode multicast failed to work with network dynamic modules

    Solution: In file tcl/lib/ns-link.tcl:SimpleLink instproc dynamic{}, replace these two lines '$dynamics_ target head_; set head_ $dynamics_' with '$dynamics_ target [$head_ target]; $head_ target $dynamics_'.

    Reported 15-Sep-97

  • Problem: tcl/ex/newmcast/[mcast2,pktintran].tcl failed due to minor API change

    Solution:replace the last line: '$ns run Session' with '$ns rtproto Session; $ns run'

    Reported 11-Sep-97

  • Problem: Session level packet distribution simulations failed due to recent unicast implementation change

    Solution: In file tcl/session/session.tcl:SessionSim instproc run{}, replace the line: 'eval RouteLogic configure $args' with '[$self get-routelogic] configure'

    Reported 11-Sep-97

ns-2.0b17

  • Problem: TCP/Sack sinks may cause ns to run out of memory or fail.

    Solution: apply the ns-src-2.0b17-sack-sink.patch.

    Reported 30-Jul-97. Fixed in ns-2.0.

  • Problem: libTcl gets this compile message:
    c++ -o Tcl.o -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H  -DNO_TK -I/usr/local/include -I/usr/local/include/tcl7.6 -I/usr/local/include/tk4.2 Tcl.cc
    Tcl.cc: In method `TclObject::~TclObject()':
    Tcl.cc:239: conflicting types for `class InstVar * p'
    Tcl.cc:233: previous declaration as `class TracedVar * p'
    Tcl.cc: In method `TracedVarTcl::~TracedVarTcl()':
    Tcl.cc:462: `const *' cannot be deleted
           

    Solution: This is a gcc compiler bug. Get gcc-2.7.x.

    Reported 30-Jul-97.


XGraph

  • Problem: When trying to execute xgraph, one gets the error: cannot open display

    Solution: From the shell set the DISPLAY variable. For example, from bash one can do it with

    export DISPLAY=machine:0.0
    

  • Problem: With RedHat Linux 6.0 or later, xtb.c fails to compile with the error
    xtb.c:50: macro `strcpy' used without args
    .

    Solution: Apply the strcpy patchxgraph_strcpy_macro patch.

  • Problem: Using gcc 2.8.1 on HP-UX 10.20, xgraph failed to compile.

    Solution: Removing "//" from lines 166 and 167 of xgraph.h. (Fixes provided by Fion Lee).

  • Problem: Xgraph fails to build with errors about function mismatches in declarations of sprintf.

    Solution: We have patches to fix three problems with xgraph: more Posix-friendliness (fixes a build problem under Linux and probably elsewhere), disable animation (works around a bug with move/draw commands), typo fix (fixes a typo found by Patrik Fors).


Tclcl-1.0b13

  • Problem: Tclcl doesn't build against gcc-3.4 (as in Fedora Core 3).

    Solution: Fixed in current CVS. Apply this patch:

    --- tclcl.h~	2003-07-29 11:24:50.000000000 -0700
    +++ tclcl.h	2004-12-10 08:55:34.692584936 -0800
    @@ -45,8 +45,8 @@
     }
     
     #include "tclcl-config.h"
    -#include "tclcl-mappings.h"
     #include "tracedvar.h"
    +// tclcl-mappings.h included below, AFTER definition of class Tcl
     
     struct Tk_Window_;
     
    @@ -158,6 +158,8 @@
     	Tcl_HashTable objs_;
     };
     
    +#include "tclcl-mappings.h"
    +
     class InstVar;
     
     class TclObject {
           

Tclcl-1.0b9

  • Problem: When configuring tclcl, it searches for an outdated version of OTcl (1.0a4)

    Solution: Apply this patch to tclcl-1.0b9/configure.

Tclcl-1.0b8

  • Problem: Compiling TclCL 1.0b8 results in a warning or an error about TclObject::enum_tracedVars() does not return a value.

    Solution:Apply the following patch to Tcl.cc:

    --- Tcl.cc~     1999/02/24 19:04:49    
    +++ Tcl.cc      1999/02/24 19:18:07    
    @@ -355,6 +355,7 @@
            for ( ;  var != 0;  var = var->next_) 
                    if (var->tracer()) 
                            var->tracer()->trace(var);
    +       return TCL_OK;
     }
     
     int TclObject::traceVar(const char* varName, TclObject* tracer)
    

Tclcl-1.0b6

  • Problem:Double-free bug in Tclcl-1.0b6: You have random crashes in ns, particularly after you have destroyed objects.

    Solution:Apply the following patch: tclcl-1.0b6.patch



Otcl (general)

  • Problem: I'm building OTcl from source and it complains with an error like:
    gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I. -I/home/vijay/tk8.3.2/generic -Iotcl.c:21:20
    tclInt.h:No such file or directory
    make: *** [libotcl.a] Error1
           

    Solution: OTcl needs the file tclInt.h and tclIntDecls.h from the source code to Tcl. If you're building OTcl on a platform with a binary installation of Tcl/Tk you must get these header files from the matching source code for your version ot Tcl/Tk.

Otcl-1.0a3

  • Problem: The OTcl test suites crash after the line "PASSED objectvariables".

    Solution: None yet. Ns doesn't exercise otcl autoloading so fixing this bug is a very low priority.

  • Problem: OTcl 1.0a3 doesn't compile with tcl 8.0.3 and 8.0.4; it complains about unknown variable 'isArg'.

    Solution: Add the following patch to otcl.c:

    --- otcl.c~     1998/07/23 17:28:03     
    +++ otcl.c      1998/09/07 18:53:43     
    @@ -763,7 +763,11 @@
         Tcl_ResetResult(in);
         while (args != 0) {
     #if TCL_MAJOR_VERSION >= 8
    +#if TCL_RELEASE_SERIAL >= 3
    +           if (TclIsVarArgument(args))
    +#else
                if (args->isArg)
    +#endif
     #endif
                        Tcl_AppendElement(in, args->name);
                args = args->nextPtr;
      
  • Problem: You have error while compiling otcl which bails out with something like the following message:
    cc -c -g -DNDEBUG -DUSE_SHM -I.  -I../tkbox/include
    -I../tclbox/include    -I/include otcl.c
    "otcl.c", line 1102: syntax error before or at: /
    "otcl.c", line 1105: undefined symbol: co
    [snip]
           

    Solution: Apply the following patch as a workaround to otcl.c:

    3c3
    <  *  $Id: ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
    ---
    >  *  $Id: ns-problems.html,v 1.186 2006/04/28 21:03:22 tomh Exp $
    56d55
    < #define compat_Tcl_AddObjErrorInfo(a,b,c) Tcl_AddErrorInfo(a,b)
    59d57
    < #define compat_Tcl_AddObjErrorInfo(a,b,c) Tcl_AddObjErrorInfo(a,b,c)
    432c430,434
    <           compat_Tcl_AddObjErrorInfo(in, msg, -1);
    ---
    > #if TCL_MAJOR_VERSION >= 8
    >           Tcl_AddObjErrorInfo(in, msg, -1);
    > #else
    >           Tcl_AddErrorInfo(in, msg);
    > #endif            
    469c471,475
    <           compat_Tcl_AddObjErrorInfo(in, msg, -1);
    ---
    > #if TCL_MAJOR_VERSION >= 8
    >           Tcl_AddObjErrorInfo(in, msg, -1);
    > #else
    >           Tcl_AddErrorInfo(int, msg);
    > #endif            
    766,768d771
    < #if TCL_RELEASE_SERIAL >= 3
    <           if (TclIsVarArgument(args))
    < #else
    771d773
    < #endif
    1100c1102
    <     /* for version 8 the instprocs are registered, so no need to delete them (?) */
    ---
    >     // for version 8 the instprocs are registered, so no need to delete them (?)
    2025d2026
    < #if TCL_MAJOR_VERSION >= 8
    2027d2027
    < #endif
    2115d2114
    < #if TCL_MAJOR_VERSION >= 8
    2121d2119
    < #endif
           

Otcl-0.96

  • Problem: OTcl-0.96 does not compile with tcl/tk-8.0.
    	otcl.c: In function `ListProcArgs':
    	otcl.c:654: `Arg' undeclared (first use this function)
    	otcl.c:654: (Each undeclared identifier is reported only once
    	otcl.c:654: for each function it appears in.)
    	otcl.c:654: `args' undeclared (first use this function)
    	otcl.c:654: structure has no member named `argPtr'
    	otcl.c:655: parse error before `int'
    	otcl.c:661: `i' undeclared (first use this function)
    	otcl.c: In function `ListProcDefault':
    	otcl.c:684: `Arg' undeclared (first use this function)
    	otcl.c:684: `ap' undeclared (first use this function)
    	...

    Solution: Get otcl-1.0a2 or later from the ns-build web page. . You will need access to the tcl/tk-8.0 sources to configure and compile otcl. Please remember to build OTcl first before proceeding with building TclCL and ns.

Intel Linux systems

  • Problem: Validation tests that pass on machines running FreeBSD and Solaris, but give different results, and therefore do not pass, on Intel Linux machines.

    Solution: Our current understanding is that, because Intel Linux doesn't use IEEE arithmetic, floating point operations can give different results on Intel Linux machines than on other systems that do use IEEE arithmetic. Our fix for this portability problem so far in NS has been to make liberal use of EPSILONs (or, in our case, SMALLFLOAT), for example, to say `if (oldrate_ + EPSILON < rate_)' instead of `if (oldrate_ < rate_)'. This issue is addressed in more detail at the FAQ on Frequently Asked Floating Point Questions. Our assumption is that even with the liberal use of EPSILONs in floating-point arithmetic, we will continue to have portability problems for NS on Intel Linux machines.

  • Problem: When installing Tcl8.0.4 under RedHat 6.0/6.1, the compilation of TclPosixStr.c may fail due to a conflict between ENOTSUP and EPROTONOTSUPP.

    Solution: Change the following lines (339 and 786) in TclPosixStr.c from

    #ifdef EOPNOTSUPP
    
    to
    #if defined (EOPNOTSUPP) && (!defined(ENOTSUP)||(EOPNOTSUPP != ENOTSUP))
    
  • Problem: Installation of ns emulator nse on Linux fails

    Solution: Please download the lastest snapshot of ns.

Comments

Popular posts from this blog

NS2 INSTALLATION IN UBUNTU 21.04

  Hello, this post explains how to install ns2 in Ubuntu 21.04.  1) First you have to download ns2 all-in-one package from following link;    http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download 2) Extract the downloaded zip file 'ns-allinone-2.35.tar.gz file' to home folder. 3)  Now you need to download some essential packages for ns2,these packages can be downloaded by using the following commands :  applications>accessories>terminal or dashhome>terminal   and   then type the below lines one by one on the terminal window sudo apt-get update sudo apt-get dist-upgrade sudo apt-get update 4) Install the basic libraries; sudo apt install build-essential autoconf automake libxmu-dev 5) Install gcc and g++ and for that please do following; open the file using sudo mode sudo nano /etc/apt/sources.list Include the following line in list;  deb http://in.archive.ubuntu.com/ubuntu bionic main universe then open terminal and exec

Link State Routing Protocol

Link state routing is a method in which each router shares its neighborhood’s knowledge with every other router on the internetwork. In this algorithm, each router in the network understands the network topology and then makes a routing table depending on this topology. Each router will share data about its connection to its neighbor, who will, consecutively, reproduce the data to its neighbors, etc. This appears just before all routers have constructed a topology of the network. In LSP, each node transmits its IP address and the MAC to its neighbor with its signature. Neighbors determine the signature and maintain a record of the combining IP address and the MAC. The Neighbor Lookup Protocol (NLP) of LSP derives and maintains the MAC and IP address of every network frame accepted by a node. The extracted data can support the mapping of MACs and IP addresses. The link-state flooding algorithm prevents the general issues of broadcast in the existence of loops by having every node mainta

HP NETWORK SIMULATOR: A COMWARE OS LEARNING TOOL

  Comware v7 is a network operating system that runs on HP high-end network devices. The HP Network Simulator is an ideal Comware v7 learning tool, which allows users to create, configure, and connect simulated networks. Benefits Beginners  – The HP Network Simulator tool is helpful for users who are new to networking and want to learn how to configure network devices (switches, routers), various topologies, or different routing and switching protocols and features. Experienced users  – The HP Network Simulator learning tool is helpful for users who have experience with non-HP networking devices and want to learn the Comware CLI and features. Extra devices  – Users can create devices using the HP Network Simulator and use them with their physical devices to configure and test topologies that aren’t configurable with just the physical devices they have. For example – A user wants to configure OSPF using 3 or more devices but has only 1 physical router. User can create 2 or more routers