You are on page 1of 5

The Network Simulator ns-2: Installation Problems and Help https://www.isi.edu/nsnam/ns/ns-problems.

html

The Network Simulator ns-2: Installation Problems, Bug Fixes, and Help
This page has moved and can now be found here. The below page will be maintained for reference to older versions.

INSTALLATION PROBLEMS
This section will hold installation problems we've heard about and possible fixes for them between releases. In general, these are fixes for ns/otcl/tclcl installation problems.

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

IMPORTANT: 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:

mailing-list-related problems
general problems
ns-allinone 2.28 2.27 2.26, 2.1b9, 2.1b8, 2.1b7, 2.1b6, 2.1b5, 2.1b4
ns 2.29, 2.28, 2.27, 2.26, 2.1b9, 2.1b8, 2.1b7, 2.1b6, 2.1b5, 2.1b4, 2.1b3, 2.1b2, 2.1b1, 2.0, 2.0b17
nam (nam problems have their own page)
xgraph
Tclcl 1.16, 1.0b13, 1.0b9, 1.0b8, 1.0b6.
Otcl general, 1.0a3, 0.96
Intel Linux systems
Other problems

If a problem is not listed here, you may also want to search the ns-users mailing list archives (how to subscribe to the list, the 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.)

Mailing-list-related Problems
For mailing-list-related problems, including subscribing, unsubscribing, and problems posting to the list, please see the mailing-list web page.

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

1 of 5 07/04/2018 17:13
The Network Simulator ns-2: Installation Problems and Help https://www.isi.edu/nsnam/ns/ns-problems.html

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 @@
#

2 of 5 07/04/2018 17:13
The Network Simulator ns-2: Installation Problems and Help https://www.isi.edu/nsnam/ns/ns-problems.html

# 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

3 of 5 07/04/2018 17:13
The Network Simulator ns-2: Installation Problems and Help https://www.isi.edu/nsnam/ns/ns-problems.html

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.

4 of 5 07/04/2018 17:13
The Network Simulator ns-2: Installation Problems and Help https://www.isi.edu/nsnam/ns/ns-problems.html

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

5 of 5 07/04/2018 17:13

You might also like