Vous êtes sur la page 1sur 61

The Network Simulator ns-2: Frequently Asked Questions

(This FAQ is also on the web at http://www.isi.edu/nsnam/ns/ns-faq.html.) The mailing is is now subscriber only---please see the FAQ entry on "How do I post to the mailing list? Why was my post rejected?" for details.

Where do I get ns? From the ns web site at http://www.isi.edu/nsnam/ns/ns.html and the download page http://www.isi.edu/nsnam/ns/ns-tests.html.

What platforms does ns run on and what kind of hardware do I need? Please see "where to start" on the building ns web page: http://www.isi.edu/nsnam/ns/ns-build.html#start.

What should I do if I have trouble downloading/extracting ns? This question is answered in detail at http://www.isi.edu/nsnam/ns/nsproblems.html#downloading.

What should I do if I encounter problems building ns? Check: 1. the README that comes in the distribution (very brief), 2. the "installation problems, bug fixes and help" web page http://www.isi.edu/nsnam/ns/ns-problems.html, 3. the archives of the ns-users mailing list http://www.isi.edu/nsnam/ns/nslists.html, 4. post a bug report (see below) http://www.isi.edu/cgibin/nsnam/reportbug.cgi. What do I do after I successfully build ns? o Put the path to your ns executable into your PATH environment o Put the path to your otcl into your LD_LIBRARY_PATH environment o Put the path to your tcl library into your TCL_LIBRARY environment Where can I find documentation for ns? All documentation is linked from the main ns web page http://www.isi.edu/nsnam/ns/. Documentation includes a tutorial (originally from Marc Greis) and a reference manual (ns notes and documentation).

Words, words, words... that documentation is nice, but where are some sample scripts I can start from? Many sample scripts can be found in the ns distribution in ~ns-2/tcl/ex and ~ns2/tcl/test.

What protocols does ns support? A lot! Almost all variants of TCP, several forms of multicast, wired networking, several ad hoc routing protocols and propagation models (but not cellular phones), data diffusion, satellite, and other stuff. See the documentation (described above) for details, or download ns and look.

How do I know that ns correctly implements these protocols? Ns has validation tests that cover many protocols, see http://www.isi.edu/nsnam/ns/ns-tests.html. However, ultimately users are responsible for verifying that ns is accurate for their purposes---since we cannot foresee all the ways ns may be used, we cannot test all cases with all inputs.

Are there any contributed/additional protocols not in the main distribution? Yes, please see the contributed code web page http://www.isi.edu/nsnam/ns/nscontributed.html. The mailing list archives can also be helpful (see below).

How should I get started doing something (like implementing a new protocol or trying an experiment)? We recommend that you look through the tutorial (see documentation, above), then start with an example program that is most similar to yours (in the tutorial, or in tcl/ex or tcl/test in the distribution), and then start changing things.

What should I do to compile ns to reflect my changes if I've modified some .cc or .h files? go to ns directory and run "make" or "make depend; make"

How do I subscribe to the ns-users mailing list? How do I search old list archives? I can't take any more---how do I get off this list? To subscribe or unsubscribe, see http://www.isi.edu/nsnam/ns/ns-lists.html. The list archive is at http://www.isi.edu/nsnam/ns/ns-lists.html.

How do I post to the mailing list? Why was my post rejected?

As of June 2004 the ns-users lists allow posts from subscriber only. If you're not a subscriber, your posts to the list will be rejected. (This is unfortunately necessary to dispose efficiently of spam; manual filtering is too expensive.) We realize that the list is high traffic, so if you wish to post to the list without receiving messages on it, please subscribe and select the no-mail option for your subscription. For details about the mailing list including mailing-list specific FAQ (for example, what if you're subscribed but still can't post), please see http://www.isi.edu/nsnam/ns/ns-lists.html.

Did my post appear on the mailing list? (Or, why didn't my post appear on the mailing list?) See the http://www.isi.edu/nsnam/ns/ns-lists.html web page for help debugging mailing list problems.

What if I have a question that's not answered here? If you've checked the installation problems and bug fixes web page (http://www.isi.edu/nsnam/ns/ns-problems.html) and there's no answer to your question, you may want to file a bug report or post a question to the ns-user's mailing list. First, you should check the archive of the list at http://www.isi.edu/nsnam/ns/nslists.html. Your question may already be answered there. If not, you can post a bug report using the web form at http://www.isi.edu/cgibin/nsnam/reportbug.cgi. If your question is NOT about ns implementation bugs, you may wish to post to the list. First you should subscribe. Subscription instructions are at http://www.isi.edu/nsnam/ns/ns-lists.html. Please note that mail sent to the list is publicly distributed and archived. If you have concerns about your message being made public (spam harvesting of your address), please consider that before posting. We cannot remove messages from reciepient's mailboxes or the public archive after they're posted. When posting bug reports, please always include information including at least (the bug report form includes spaces for these):
o o

what version of ns you're using, what operating system you're running on (not just Linux or Solaris, but RedHat version 7.0 or Solaris 2.4---send us the output of "uname -a"),

o o

what specific behavior you see (if ns doesn't compile, what's the specific error; if TCP does something strange, what exactly did it do [send a pointer to a packet trace]), what behavior you expected to see (if ns doesn't compile this is obvious, but if TCP does something strange, why is it strange, where is the TCP spec violated?), pointers to your script detailed output files, a statement that "yes, I've read the FAQ, ns-problems page, and manual and I couldn't find the answer there" (or a statement about why you didn't do that yet :-)

Soo-Hyun Choi observed from posts to the list: Sometimes, I see this list is filled with the questions with: 1) asked many times before 2) hardly understandable what this guy is asking 3) too easy to find an answer over a few clicks over the Internet 4) soliciting to do their homework in a simple way by asking in this list 5) easily seekable an answer by contributing a couple of hours of reading the nsmanual 6) etc, etc. As many of us in this list are doing an advanced degree, it would be suggested to read the following article in order to raise a useful/meaningful question in a smart way. http://www.catb.org/~esr/faqs/smart-questions.html This is very good advice, since asking the Right Question is very likely to get a good/helpful answer, while asking a question poorly. For example, think about how you would answer these two questions: "Ns doesn't work for me, it crashes. Help." as compared to "I get a segmentation fault when running test script testsuite-webcache on Mandrake 10 Linux. The backtrace is on my web page at www.someu.edu/~someone. It looks like it passes in the on-line test suites, but it fails for me. Am I doing something wrong? A reminder about mailing list etiquette:
o o o o

Please check the web pages and list archives before posting your question. Please keep the body of your post to simple ASCII, not HTML. Please do not send large attachments (if what you have is bigger than a few kilobytes, put it on a web page and send a URL) Before posting a question like "did people see my post" or "the list seems down", please check the archives (you can answer this question more accurately by checking yourself rather than asking). Please don't post subscribe/unsubscribe requests directly to the list, use the lists' information page. (see the web page mentioned above for details).

ns ns-users@isi.edu

Troubleshooting
From Nsnam
Jump to: navigation, search Main Page - Roadmap - User Information - Developer Information - Projects Contributing - Links The ns-2 set of software packages (ns-2, nam-1, OTcl, TclCL) is a lightly supported open source project. For help with ns-2, the best way to get help is to first search the Internet, and old ns-users postings for the answer to your question before posting to the ns-users mailing list. Please see below for information about the mailing lists, and how to report bugs. You are also encouraged to help by contributing to this wiki.

Contents
[hide]

1 General problems 2 Installation troubleshooting o 2.1 ns-allinone package 2.1.1 Installation of ns-2.29.2 fails on x86_64 platform 2.1.2 Precompiled NS2-2.34 binaries for OS X Leopard 10.5 / Snow Leopard 10.6 2.1.3 OS X Leopard 10.5 o 2.2 ns-2 2.2.1 ns-2 not building with gcc/g++ 4.3.2 2.2.2 ns-2.30/ns-2.31 do not build with gcc/g++ 4.1 2.2.3 ubuntu: 2.2.4 ns-2.29 does not compile on Fedora Core 5 (FC5) 2.2.5 nam-1 2.2.5.1 nam-1.12 does not compile on 64-bit platforms 3 Post-install troubleshooting o 3.1 ns-2 builds but fails some validation tests o 3.2 unexpected behavior or crash (segfault) after code extension 4 Bug Reporting 5 Other tips from users 6 when and how to write to the user's mailing-list 7 Some problems when using ns-2 o 7.1 C++ 7.1.1 How to callback to OTcl from C++ code o 7.2 OTcl 7.2.1 How to use procedure in OTcl 8 Older versions of ns-2, nam-1, tclcl, and otcl

General problems
See this web page (note, some information is out of date).

Installation troubleshooting
ns-allinone package
Note: you may also want to consider tips under the entries for the individual packages below, to see if your allinone installation problem is found there.

Installation of ns-2.29.2 fails on x86_64 platform


> > > > > >

Description: otcl-1.11 compilation fails in the following way:

/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXext.so when searching for -lXext /usr/bin/ld: cannot find -lXext collect2: ld returned 1 exit status make: *** [otclsh] Error 1 otcl-1.11 make failed! Exiting ...

Previous solution: Find the path to the 64-bit libraries and modify the makefile (e.g., /usr/X11R6/lib64) New solution: Use the ns-allinone-2.29.3.tar.gz package.

Precompiled NS2-2.34 binaries for OS X Leopard 10.5 / Snow Leopard 10.6


You can download my precompiled package of ns2 for Snow Leopard / Leopard at the following address: http://aladino.dmi.unict.it/?a=ns2 (11/11/2009) - Support for NAM is now fully enabled.

OS X Leopard 10.5
Lloyd Wood notes: >I'm trying to install octcl 1.1.3 on Mac OS X 10.5.2, as part of the ns 2.32 allinone install:
checking for checking for checking for can't find X X11 header files X11 library archive XOpenDisplay in -lX11... no library

Thanks to gier egeland and David Viera for the hints.


./configure --xincludes=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include \\ --x-libraries=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib make

worked for me to successfully configure and make otcl-1.13, tclcl-1.19, and ns-2.32 on Leopard. That also worked for configuring nam-1.13, but that failed at the linker stage bleating
Undefined symbols: __TkCreateXEventSource", referenced from: _TkpInit in tkUnixInit.o

so I grabbed nam-1-20080222.tar, which failed with the same linker error. (I was using the available Tcl/Tk in the system, but using the allinone compiled Tcl/Tk made no difference here.) I expect that the above will work for any Mac OS X 10.4 or 10.5 with XCode with the added X11 headers -there's a pkg on Leopard Install disc 1. The parallel MacOSX10.5.sdk/ tree is pretty empty, relying heavily on the base code in 10.4u (for universal: on Intel and PowerPC). On 10.3, using directories under /Developer/MacOSX10.3.9.sdk/ *may* well work - that directory exists, but the tree under it is mostly empty under Leopard.

ns-2 ns-2 not building with gcc/g++ 4.3.2

Description: the screen is filled with warnings such as:

./common/packet.h:358: warning: deprecated conversion from string constant to char*

Solution: Add this flag "-Wno-write-strings" to the CCOPT line in the Makefile; e.g.:
= -g -Wall -Wno-write-strings

CCOPT

ns-2.30/ns-2.31 do not build with gcc/g++ 4.1

Description: Linking stage fails with error:

/usr/bin/ld: ns: hidden symbol `__stack_chk_fail_local' in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: ld returned 1 exit status

Solution: Apply the following patch to configure.in in otcl-1.12 or otcl-1.13:

diff -uNr otcl-1.12/configure.in otcl-1.12-patched/configure.in --- otcl-1.12/configure.in 2006-09-25 01:02:37.000000000 -0400

+++ otcl-1.12-patched/configure.in 0400 @@ -74,7 +74,7 @@ ;; Linux*) SHLIB_CFLAGS="-fpic" SHLIB_LD="ld -shared" + SHLIB_LD="${CC} -shared" SHLIB_SUFFIX=".so" DL_LIBS="-ldl" SHLD_FLAGS=""

2007-04-12 11:45:09.000000000 -

then rebuild the OTcl configure script:


otcl-1.13$ autoconf -f

You should now be able to build OTcl (and everything else) normally. Thanks go to Chia-Yung Su for figuring this out and for providing a reference to a similar problem in a different program.

Alternative: To work around the problem, install gcc-4.0 and g++-4.0 and use them to compile OTcl:

otcl-1.13$ ./configure CC="gcc-4.0" CXX="g++-4.0" --withtcl=../tcl8.4.14 --with-tk=../tk8.4.14

You can also use gcc-4.0 and g++-4.0 to compile everything. This may be simpler than using 4.0 for just OTcl (as suggested above). Type the following before you start building the programs:
export CC="gcc-4.0" export CXX="g++-4.0"

ubuntu:
if previous tips dont work and after the configure.in tric, do the following (source : [1]). It solves the issue on edgy with
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)

for otcl use ./configure then manualy edit Makefile:8


-g -O2 -g -O2 -fno-stack-protector

- CFLAGS= + CFLAGS=

for ns nam use ./configure then manualy edit Makefile:82


+= $(CCOPT) $(DEFINE)

- CFLAGS

+ CFLAGS

+= $(CCOPT) $(DEFINE) -fno-stack-protector

ns-2.29 does not compile on Fedora Core 5 (FC5)


Description: ns-2.29 release does not compile on FC5 Old solution: This patch contributed by Qihe Wang: http://mailman.isi.edu/pipermail/ns-users/2006-May/055811.html New solution: Use the ns-allinone-2.29.3.tar.gz package if you just want to use ns-2.29 release; if you want to use current cvs snapshot, apply Qihe Wang's patch to that.

nam-1

Description: You've installed ns and run an example script, and get this error:

ns: finish:couldn't excute "nam":no such file or directory while excuting "exec nam out.nam &" (procedure "finish" line 7) invoked from within "finish"

Solution: This indicates that you have not installed nam or the nam binary is not being found by the script. Perhaps you need to add the path to the binary. Make sure you have added the path to the nam binary to your shell variable $PATH (I am presuming you are using Linux and bash as you didn't specify) using the following: export $PATH="$PATH:/path/to/nam/binary". Note : this will have to be done every time you start a new terminal as it only lasts as long as that particular session. To make it permanent, you will have to enter this line into either your .bashrc or .bash_profile (or similar). (Thanks to Matthew Jakeman for this note)

nam-1.12 does not compile on 64-bit platforms


Description: nam-1.12 will not build on 64-bit platforms Solution: This is an open issue: http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=122153&gr oup_id=149743&group_project_id=45608

The current cvs directory (as of November 19 or later) contains code that will build on 64-bit machines, but you may need to edit the Makefile (change "lib" to "lib64" directories) since the autoconf code is not working just yet. Here is a link to the daily snapshot of nam-1: http://www.isi.edu/nsnam/dist/daily/

Post-install troubleshooting

ns-2 builds but fails some validation tests


Description: ns-2 fails some validation tests Solution: ns-2 is known to have problems with some validation tests on certain platforms due to 64-bit problems or floating point differences on different platforms. If the particular validation test is not central to your work, the error may be safely ignored. Please consider reporting a bug if you find new validation problems.

unexpected behavior or crash (segfault) after code extension


In order to determine why ns-2 does not work as you expect or or why it crashes, you have to use a debugger like gdb to figure out what happened. If you have never worked with a debugger before, it might look a little bit difficult at first but it's an absolute necessity for any serious programmer to master it. People on the mailing list won't be willing to help you unless you have not tried seriously to fix the problem yourself. To get you started, there are some excellent tutorials on the Internet for both gdb (like [2], [3]) and ddd, a GUI to gdb (PDF slideshow). Install either of them, make sure you have enabled debugging symbols in ns-2 (see the relevant part in the user tips), and re-compile everything. Afterwards, start ns through the debugger, pass your tcl-script as argument using set args <path to script> and either choose a reasonable breakpoint or let ns2 crash and watch the backtrace, depending on whether after adding your code the simulator just does not work appropriately or crashes, respectively. When you managed to narrow down the responsible piece of code, use the debugger's capabilities to investigate even further (print, watchpoints, change variable values, etc.) in order to fix the bug(s). What makes things a little more complicated is the fact that ns-2 not only uses C++ but OTcl as well. When the simulator crashes and leaves you with an OTcl backtrace, try to figure out what happened by watching at that. If that does not suffices and there is no valuable C++ backtrace, take a look at the ns-2 debugging page to learn how to include and use the Tcl debugger. Since it's not as sophisticated as gdb, you might want to consider setting debug 1 at different points within the Tcl simulation script first and see from what point on it crashes. Apart from that, the page tells you how to determine a node's (string) name from C++, jump into Tcl space and use the tcl debugger from there before possibly returning to C++ space. If you require further help on debugging, please consider some of the links under Other tips from users: Pedro Vale Estrela has provided some additional hints and tools, particularly useful with OTcl. You could also check the sections on Debugging ns-2.

Bug Reporting

Reporting a bug (replaces deprecated Bug report form) Dazhi Chen's ns-2 FAQ

Other tips from users

Pedro Vale Estrela's Beginners Tips: http://tagus.inescid.pt/~pestrela/ns2/ns2_beginners.html Complete C++ and oTcl debugging page: http://tagus.inescid.pt/~pestrela/ns2/ns2_debugging.html two equal UDP CBR flows in droptail queue get different bandwidths: Here is an email thread on this topic. Bus Error: Email thread How to compile NS2 with debugging information/How to use DDD for debugging NS2:: Email thread

when and how to write to the user's mailing-list


If you think you need to ask people on the mailing-list, please consider the following prior to submitting: 1. VERY IMPORTANT: in general, have you tried hard enough to solve problems you encounter yourself? This includes (and goes beyond) reading anything possibly related to your problems as covered in the ns-2 manual, this wiki and the ns-2 webpage 2. if ns-2 ceased to work properly after you made some changes, please o read the wiki part about debugging first o get a book on C++/Tcl and/or search the web to solve common progamming language problems 3. search the mailing-list archives exhaustingly (this is mandatory!) 4. consider this very good advice in asking and receiving help: How To Ask Questions The Smart Way, particularly: o Use smart subjects: http://www.catb.org/~esr/faqs/smartquestions.html#bespecific o Don't flag your question as Urgent , even if it is for you: http://www.catb.org/~esr/faqs/smart-questions.html#urgent

Follow up with a brief note on the solution: http://www.catb.org/~esr/faqs/smart-questions.html#followup o Don't re-issue mailing list questions shortly after you asked initially 5. for compiling issues: o include compiler errors in English language using LC_ALL=C make o include complete error messages on the relevant parts (don't truncate line numbers!) o include part of code which errors relate to
o

Some problems when using ns-2


C++
How to callback to OTcl from C++ code
For example, In OTcl, you have the object named: object(i) and simulator object named: ns In C++ you should use as follows: Tcl::instance().evalf( "$object(%d) operation %d %d %d %d", src, src, des, master, object); You also can add when to execute this operation: Tcl::instance().evalf( "$ns [$ns now] $object(%d) operation %d %d %d %d", src, src, des, master, object);

OTcl
How to use procedure in OTcl
set ns global ns [new Simulator] tcp app

for {set j 0} {$j < 13} {incr j} { set tcp($j) [new Agent/TCP/SimpleTcp] } set app(0) [new Application/TcpApp $tcp(0) source 0] for {set k 1} {$k < 13} {incr k} { set app($k) [new Application/TcpApp $tcp($k) common $k] } proc doLETJOIN {src des master object} { global ns tcp app ;# this is essential!!! $ns $ns $ns $ns $ns } at at at at at [$ns [$ns [$ns [$ns [$ns now] now] now] now] now] "$ns connect $tcp($src) $tcp($des)" "$tcp($src) listen" "$tcp($des) listen" "$app($src) connect $app($des)" "$$src letjoin $src $des $master"

proc my_test {} { global ns puts "inside test" doLETJOIN 0 1 0 4 } $ns at "1" "my_test" $ns run

Older versions of ns-2, nam-1, tclcl, and otcl


This wiki page started maintaining troubleshooting information as of the releases of the following packages:

ns-2.29 nam-1.11 otcl-1.11 tclcl-1.17 ns-allinone-2.29.2

For troubleshooting older versions of these packages, please see the following page: http://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 Xorig. 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 ns2.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 ns2.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 ./testall-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.
o o

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 ns2.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 2004 19:56:42 -0000 1.9 +++ indep-utils/cmu-scen-gen/setdest/Makefile.in 2004 15:05:27 -0000@@ -36,8 +36,8 @@ CC = @CC@ MKDEP = ../../../conf/mkdep 20 Jan 18 May

-# 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 nsdbug-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 +++ ls.h 2001/05/24 18:32:49 @@ -553,7 +553,9 @@ 1.3

+ + +

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 +++ wireless-phy.cc 2001/03/08 15:20:58 @@ -102,6 +102,7 @@ lambda_ = SPEED_OF_LIGHT / freq_; node_ = 0; ant_ = 0; 1.1.1.1 1.2

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~ +++ ns-trace.tcl @@ -162,6 +162,7 @@ 2000/07/24 19:48:10 2000/10/19 18:02:42 #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., tclcl8.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-lannewnode ./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 classifierport.cc and classifier-port.h from cvs repository http://www.isi.edu/cgibin/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/nsusers/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 nam1.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 stubgenerator 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/nsproblems.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 --withotcl=../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 --withotcl=../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 --withotcl=../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~ +++ tcl-expand.tcl @@ -40,6 +40,10 @@ 1998/05/27 19:46:46 1999/08/20 16:55:04

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 symbol _RENAMED first referenced in file ...

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. 2. 3. 4. Download this patch and place it at your allinone directory. Apply the patch by typing "patch -p < ns-allinone-2.1b5.patch" Remove config.cache from your OTcl, TclCl, ns, and nam directories 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 nsbuild 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 +++ ns-link.tcl 1999/03/04 00:09:18 @@ -461,7 +461,7 @@ } 1.40

# -# 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-hphpux10.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 gen/version.c sh: tclsh8.0: not found *** Error code 1 make: Fatal error: Command failed for target 'gen/version.c' version_string < VERSION >

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/httpaux.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); + packets }; Index: filter.cc 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

================================================================= ===== --- 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)
o o

install gcc OR rebuild tcl2c++ with TCL2C_INT defined, then regenerate embeddedtcl.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 +++ tcl2c++.c 1998/10/12 16:40:27 @@ -30,7 +30,10 @@ #define strcasecmp _stricmp #endif 1.8

-#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 o Typo in line 208 of ~ns/tcl/rtglib/dynamics.tcl. Solution: Change line 208 to
set fin [lindex $args 3] o

The dynamic routing line in ~ns/tcl/ex/simple-rtg.tcl vanished? Solution: Add the line

$ns rtproto DV

before specifying the rtmodel.


o

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/nstrace.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 --withtclcl=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 ns2.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/nsmcast.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: o 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'. o Problem:tcl/ex/newmcast/dense-mode2.tcl fails. Solution: In the simulation script itself change `multi-link' to `multi-linkof-interfaces'. o 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'. o 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 Posixfriendliness (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.

Other Problems

(none right now)

ns ns-users@isi.edu