Faq Troubleshooting Installation Problems

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/ns- problems.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/ns- lists.html , 4. post a bug report (see below) http://www.isi.edu/cgi- bin/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).

description

ns ns2 faq troubleshoot installation problem

Transcript of Faq Troubleshooting Installation Problems

Page 1: Faq Troubleshooting Installation Problems

The Network Simulator ns-2 Frequently Asked Questions (This FAQ is also on the web at httpwwwisiedunsnamnsns-faqhtml)

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

bull Where do I get ns

From the ns web site at httpwwwisiedunsnamnsnshtml and the download page httpwwwisiedunsnamnsns-testshtml

bull 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 httpwwwisiedunsnamnsns-buildhtmlstart

bull What should I do if I have trouble downloadingextracting ns

This question is answered in detail at httpwwwisiedunsnamnsns-problemshtmldownloading

bull 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

httpwwwisiedunsnamnsns-problemshtml 3 the archives of the ns-users mailing list httpwwwisiedunsnamnsns-

listshtml 4 post a bug report (see below) httpwwwisieducgi-

binnsnamreportbugcgi bull 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

bull Where can I find documentation for ns

All documentation is linked from the main ns web page httpwwwisiedunsnamns Documentation includes a tutorial (originally from Marc Greis) and a reference manual (ns notes and documentation)

bull 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-2tclex and ~ns-2tcltest

bull 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

bull How do I know that ns correctly implements these protocols

Ns has validation tests that cover many protocols see httpwwwisiedunsnamnsns-testshtml 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

bull Are there any contributedadditional protocols not in the main distribution

Yes please see the contributed code web page httpwwwisiedunsnamnsns-contributedhtml The mailing list archives can also be helpful (see below)

bull 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 tclex or tcltest in the distribution) and then start changing things

bull What should I do to compile ns to reflect my changes if Ive modified some cc or h files

go to ns directory and run make or make depend make

bull How do I subscribe to the ns-users mailing list How do I search old list archives I cant take any more---how do I get off this list

To subscribe or unsubscribe see httpwwwisiedunsnamnsns-listshtml The list archive is at httpwwwisiedunsnamnsns-listshtml

bull 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 youre 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 youre subscribed but still cant post) please see httpwwwisiedunsnamnsns-listshtml

bull Did my post appear on the mailing list (Or why didnt my post appear on the mailing list)

See the httpwwwisiedunsnamnsns-listshtml web page for help debugging mailing list problems

bull What if I have a question thats not answered here

If youve checked the installation problems and bug fixes web page (httpwwwisiedunsnamnsns-problemshtml) and theres no answer to your question you may want to file a bug report or post a question to the ns-users mailing list

First you should check the archive of the list at httpwwwisiedunsnamnsns-listshtml Your question may already be answered there

If not you can post a bug report using the web form at httpwwwisieducgi-binnsnamreportbugcgi

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 httpwwwisiedunsnamnsns-listshtml

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 reciepients mailboxes or the public archive after theyre posted

When posting bug reports please always include information including at least (the bug report form includes spaces for these)

o what version of ns youre using o what operating system youre running on (not just Linux or Solaris but

RedHat version 70 or Solaris 24---send us the output of uname -a)

o what specific behavior you see (if ns doesnt compile whats the specific error if TCP does something strange what exactly did it do [send a pointer to a packet trace])

o what behavior you expected to see (if ns doesnt compile this is obvious but if TCP does something strange why is it strange where is the TCP spec violated)

o pointers to your script detailed output files o a statement that yes Ive read the FAQ ns-problems page and manual

and I couldnt find the answer there (or a statement about why you didnt 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 ns-manual 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 usefulmeaningful question in a smart way httpwwwcatborg~esrfaqssmart-questionshtml

This is very good advice since asking the Right Question is very likely to get a goodhelpful answer while asking a question poorly For example think about how you would answer these two questions Ns doesnt work for me it crashes Help as compared to I get a segmentation fault when running test script test-suite-webcache on Mandrake 10 Linux The backtrace is on my web page at wwwsomeuedu~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 Please check the web pages and list archives before posting your question o Please keep the body of your post to simple ASCII not HTML o 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) o 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)

o Please dont post subscribeunsubscribe requests directly to the list use the lists information page (see the web page mentioned above for details)

ns ns-usersisiedu

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]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 2: Faq Troubleshooting Installation Problems

bull 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-2tclex and ~ns-2tcltest

bull 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

bull How do I know that ns correctly implements these protocols

Ns has validation tests that cover many protocols see httpwwwisiedunsnamnsns-testshtml 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

bull Are there any contributedadditional protocols not in the main distribution

Yes please see the contributed code web page httpwwwisiedunsnamnsns-contributedhtml The mailing list archives can also be helpful (see below)

bull 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 tclex or tcltest in the distribution) and then start changing things

bull What should I do to compile ns to reflect my changes if Ive modified some cc or h files

go to ns directory and run make or make depend make

bull How do I subscribe to the ns-users mailing list How do I search old list archives I cant take any more---how do I get off this list

To subscribe or unsubscribe see httpwwwisiedunsnamnsns-listshtml The list archive is at httpwwwisiedunsnamnsns-listshtml

bull 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 youre 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 youre subscribed but still cant post) please see httpwwwisiedunsnamnsns-listshtml

bull Did my post appear on the mailing list (Or why didnt my post appear on the mailing list)

See the httpwwwisiedunsnamnsns-listshtml web page for help debugging mailing list problems

bull What if I have a question thats not answered here

If youve checked the installation problems and bug fixes web page (httpwwwisiedunsnamnsns-problemshtml) and theres no answer to your question you may want to file a bug report or post a question to the ns-users mailing list

First you should check the archive of the list at httpwwwisiedunsnamnsns-listshtml Your question may already be answered there

If not you can post a bug report using the web form at httpwwwisieducgi-binnsnamreportbugcgi

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 httpwwwisiedunsnamnsns-listshtml

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 reciepients mailboxes or the public archive after theyre posted

When posting bug reports please always include information including at least (the bug report form includes spaces for these)

o what version of ns youre using o what operating system youre running on (not just Linux or Solaris but

RedHat version 70 or Solaris 24---send us the output of uname -a)

o what specific behavior you see (if ns doesnt compile whats the specific error if TCP does something strange what exactly did it do [send a pointer to a packet trace])

o what behavior you expected to see (if ns doesnt compile this is obvious but if TCP does something strange why is it strange where is the TCP spec violated)

o pointers to your script detailed output files o a statement that yes Ive read the FAQ ns-problems page and manual

and I couldnt find the answer there (or a statement about why you didnt 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 ns-manual 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 usefulmeaningful question in a smart way httpwwwcatborg~esrfaqssmart-questionshtml

This is very good advice since asking the Right Question is very likely to get a goodhelpful answer while asking a question poorly For example think about how you would answer these two questions Ns doesnt work for me it crashes Help as compared to I get a segmentation fault when running test script test-suite-webcache on Mandrake 10 Linux The backtrace is on my web page at wwwsomeuedu~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 Please check the web pages and list archives before posting your question o Please keep the body of your post to simple ASCII not HTML o 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) o 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)

o Please dont post subscribeunsubscribe requests directly to the list use the lists information page (see the web page mentioned above for details)

ns ns-usersisiedu

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]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 3: Faq Troubleshooting Installation Problems

As of June 2004 the ns-users lists allow posts from subscriber only If youre 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 youre subscribed but still cant post) please see httpwwwisiedunsnamnsns-listshtml

bull Did my post appear on the mailing list (Or why didnt my post appear on the mailing list)

See the httpwwwisiedunsnamnsns-listshtml web page for help debugging mailing list problems

bull What if I have a question thats not answered here

If youve checked the installation problems and bug fixes web page (httpwwwisiedunsnamnsns-problemshtml) and theres no answer to your question you may want to file a bug report or post a question to the ns-users mailing list

First you should check the archive of the list at httpwwwisiedunsnamnsns-listshtml Your question may already be answered there

If not you can post a bug report using the web form at httpwwwisieducgi-binnsnamreportbugcgi

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 httpwwwisiedunsnamnsns-listshtml

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 reciepients mailboxes or the public archive after theyre posted

When posting bug reports please always include information including at least (the bug report form includes spaces for these)

o what version of ns youre using o what operating system youre running on (not just Linux or Solaris but

RedHat version 70 or Solaris 24---send us the output of uname -a)

o what specific behavior you see (if ns doesnt compile whats the specific error if TCP does something strange what exactly did it do [send a pointer to a packet trace])

o what behavior you expected to see (if ns doesnt compile this is obvious but if TCP does something strange why is it strange where is the TCP spec violated)

o pointers to your script detailed output files o a statement that yes Ive read the FAQ ns-problems page and manual

and I couldnt find the answer there (or a statement about why you didnt 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 ns-manual 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 usefulmeaningful question in a smart way httpwwwcatborg~esrfaqssmart-questionshtml

This is very good advice since asking the Right Question is very likely to get a goodhelpful answer while asking a question poorly For example think about how you would answer these two questions Ns doesnt work for me it crashes Help as compared to I get a segmentation fault when running test script test-suite-webcache on Mandrake 10 Linux The backtrace is on my web page at wwwsomeuedu~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 Please check the web pages and list archives before posting your question o Please keep the body of your post to simple ASCII not HTML o 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) o 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)

o Please dont post subscribeunsubscribe requests directly to the list use the lists information page (see the web page mentioned above for details)

ns ns-usersisiedu

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]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 4: Faq Troubleshooting Installation Problems

o what specific behavior you see (if ns doesnt compile whats the specific error if TCP does something strange what exactly did it do [send a pointer to a packet trace])

o what behavior you expected to see (if ns doesnt compile this is obvious but if TCP does something strange why is it strange where is the TCP spec violated)

o pointers to your script detailed output files o a statement that yes Ive read the FAQ ns-problems page and manual

and I couldnt find the answer there (or a statement about why you didnt 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 ns-manual 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 usefulmeaningful question in a smart way httpwwwcatborg~esrfaqssmart-questionshtml

This is very good advice since asking the Right Question is very likely to get a goodhelpful answer while asking a question poorly For example think about how you would answer these two questions Ns doesnt work for me it crashes Help as compared to I get a segmentation fault when running test script test-suite-webcache on Mandrake 10 Linux The backtrace is on my web page at wwwsomeuedu~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 Please check the web pages and list archives before posting your question o Please keep the body of your post to simple ASCII not HTML o 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) o 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)

o Please dont post subscribeunsubscribe requests directly to the list use the lists information page (see the web page mentioned above for details)

ns ns-usersisiedu

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]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 5: Faq Troubleshooting Installation Problems

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]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 6: Faq Troubleshooting Installation Problems

Contents [hide]

bull 1 General problems bull 2 Installation troubleshooting

o 21 ns-allinone package sect 211 Installation of ns-2292 fails on x86_64 platform sect 212 Precompiled NS2-234 binaries for OS X Leopard 105

Snow Leopard 106 sect 213 OS X Leopard 105

o 22 ns-2 sect 221 ns-2 not building with gccg++ 432 sect 222 ns-230ns-231 do not build with gccg++ 41 sect 223 ubuntu sect 224 ns-229 does not compile on Fedora Core 5 (FC5) sect 225 nam-1

sect 2251 nam-112 does not compile on 64-bit platforms bull 3 Post-install troubleshooting

o 31 ns-2 builds but fails some validation tests o 32 unexpected behavior or crash (segfault) after code extension

bull 4 Bug Reporting bull 5 Other tips from users bull 6 when and how to write to the users mailing-list bull 7 Some problems when using ns-2

o 71 C++ sect 711 How to callback to OTcl from C++ code

o 72 OTcl sect 721 How to use procedure in OTcl

bull 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-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 7: Faq Troubleshooting Installation Problems

Installation of ns-2292 fails on x86_64 platform

bull Description otcl-111 compilation fails in the following way

gt usrbinld skipping incompatible usrX11R6liblibXextso when gt searching for -lXext gt usrbinld cannot find -lXext gt collect2 ld returned 1 exit status gt make [otclsh] Error 1 gt otcl-111 make failed Exiting

bull Previous solution Find the path to the 64-bit libraries and modify the makefile (eg usrX11R6lib64)

bull New solution Use the ns-allinone-2293targz package

Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106

You can download my precompiled package of ns2 for Snow Leopard Leopard at the following address

httpaladinodmiunictita=ns2

(11112009) - Support for NAM is now fully enabled

OS X Leopard 105

Lloyd Wood notes

gtIm trying to install octcl 113 on Mac OS X 1052 as part of the ns 232 allinone install

checking for X11 header files checking for X11 library archive checking for XOpenDisplay in -lX11 no cant find X library

Thanks to gier egeland and David Viera for the hints

configure --x-includes=DeveloperSDKsMacOSX104usdkusrX11R6include --x-libraries=DeveloperSDKsMacOSX104usdkusrX11R6lib make

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 8: Faq Troubleshooting Installation Problems

worked for me to successfully configure and make otcl-113 tclcl-119 and ns-232 on Leopard

That also worked for configuring nam-113 but that failed at the linker stage bleating

Undefined symbols __TkCreateXEventSource referenced from _TkpInit in tkUnixInito

so I grabbed nam-1-20080222tar which failed with the same linker error

(I was using the available TclTk in the system but using the allinone compiled TclTk made no difference here)

I expect that the above will work for any Mac OS X 104 or 105 with XCode with the added X11 headers -theres a pkg on Leopard Install disc 1 The parallel MacOSX105sdk tree is pretty empty relying heavily on the base code in 104u (for universal on Intel and PowerPC) On 103 using directories under DeveloperMacOSX1039sdk may well work - that directory exists but the tree under it is mostly empty under Leopard

ns-2

ns-2 not building with gccg++ 432

bull Description the screen is filled with warnings such as

commonpacketh358 warning deprecated conversion from string constant to lsquocharrsquo

bull Solution Add this flag -Wno-write-strings to the CCOPT line in the Makefile eg

CCOPT = -g -Wall -Wno-write-strings

ns-230ns-231 do not build with gccg++ 41

bull Description Linking stage fails with error

usrbinld ns hidden symbol `__stack_chk_fail_local in usrliblibc_nonshareda(stack_chk_fail_localoS) is referenced by DSO usrbinld final link failed Nonrepresentable section on output collect2 ld returned 1 exit status

bull Solution Apply the following patch to configurein in otcl-112 or otcl-113

diff -uNr otcl-112configurein otcl-112-patchedconfigurein --- otcl-112configurein 2006-09-25 010237000000000 -0400

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 9: Faq Troubleshooting Installation Problems

+++ otcl-112-patchedconfigurein 2007-04-12 114509000000000 -0400 -747 +747 Linux) SHLIB_CFLAGS=-fpic - SHLIB_LD=ld -shared + SHLIB_LD=$CC -shared SHLIB_SUFFIX=so DL_LIBS=-ldl SHLD_FLAGS=

then rebuild the OTcl configure script

otcl-113$ 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

bull Alternative To work around the problem install gcc-40 and g++-40 and use them to compile OTcl

otcl-113$ configure CC=gcc-40 CXX=g++-40 --with-tcl=tcl8414 --with-tk=tk8414

You can also use gcc-40 and g++-40 to compile everything This may be simpler than using 40 for just OTcl (as suggested above) Type the following before you start building the programs

export CC=gcc-40 export CXX=g++-40

ubuntu

if previous tips dont work and after the configurein tric do the following (source [1]) It solves the issue on edgy with

gcc version 412 20060928 (prerelease) (Ubuntu 411-13ubuntu5)

bull for otcl use configure then manualy edit Makefile8

- CFLAGS= -g -O2 + CFLAGS= -g -O2 -fno-stack-protector

bull for ns nam use configure then manualy edit Makefile82

- CFLAGS += $(CCOPT) $(DEFINE)

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 10: Faq Troubleshooting Installation Problems

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

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

bull Description ns-229 release does not compile on FC5 bull Old solution This patch contributed by Qihe Wang

httpmailmanisiedupipermailns-users2006-May055811html bull New solution Use the ns-allinone-2293targz package if you just want to use

ns-229 release if you want to use current cvs snapshot apply Qihe Wangs patch to that

nam-1

bull Description Youve installed ns and run an example script and get this error

ns finishcouldnt excute namno such file or directory while excuting exec nam outnam amp (procedure finish line 7) invoked from within finish

bull 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 didnt specify) using the following export $PATH=$PATHpathtonambinary 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-112 does not compile on 64-bit platforms

bull Description nam-112 will not build on 64-bit platforms bull Solution This is an open issue

httpsourceforgenetpmtaskphpfunc=detailtaskampproject_task_id=122153ampgroup_id=149743ampgroup_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 httpwwwisiedunsnamdistdaily

Post-install troubleshooting

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 11: Faq Troubleshooting Installation Problems

ns-2 builds but fails some validation tests

bull Description ns-2 fails some validation tests bull 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 its an absolute necessity for any serious programmer to master it People on the mailing list wont 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 ltpath to scriptgt and either choose a reasonable breakpoint or let ns-2 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 debuggers 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 its 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 nodes (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 bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 12: Faq Troubleshooting Installation Problems

Bug Reporting bull Reporting a bug (replaces deprecated Bug report form) bull Dazhi Chens ns-2 FAQ

Other tips from users bull Pedro Vale Estrelas Beginners Tips httptagusinesc-

idpt~pestrelans2ns2_beginnershtml

bull Complete C++ and oTcl debugging page httptagusinesc-idpt~pestrelans2ns2_debugginghtml

bull two equal UDP CBR flows in droptail queue get different bandwidths Here is an email thread on this topic

bull Bus Error Email thread

bull How to compile NS2 with debugging informationHow to use DDD for debugging NS2 Email thread

when and how to write to the users 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 andor 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 httpwwwcatborg~esrfaqssmart-

questionshtmlbespecific o Dont flag your question as acircVœUrgentacircVV even if it is for you

httpwwwcatborg~esrfaqssmart-questionshtmlurgent

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 13: Faq Troubleshooting Installation Problems

o Follow up with a brief note on the solution httpwwwcatborg~esrfaqssmart-questionshtmlfollowup

o Dont 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 (dont truncate

line numbers) o include part of code which errors relate to

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 Tclinstance()evalf( $object(d) operation d d d d src src des master object) You also can add when to execute this operation Tclinstance()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 [new Simulator] global ns tcp app for set j 0 $j lt 13 incr j set tcp($j) [new AgentTCPSimpleTcp] set app(0) [new ApplicationTcpApp $tcp(0) source 0] for set k 1 $k lt 13 incr k set app($k) [new ApplicationTcpApp $tcp($k) common $k] proc doLETJOIN src des master object global ns tcp app this is essential $ns at [$ns now] $ns connect $tcp($src) $tcp($des) $ns at [$ns now] $tcp($src) listen $ns at [$ns now] $tcp($des) listen $ns at [$ns now] $app($src) connect $app($des) $ns at [$ns now] $$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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 14: Faq Troubleshooting Installation Problems

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

bull ns-229 bull nam-111 bull otcl-111 bull tclcl-117 bull ns-allinone-2292

For troubleshooting older versions of these packages please see the following page httpwwwisiedunsnamnsns-problemshtml

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 15: Faq Troubleshooting Installation Problems

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 weve heard about and possible fixes for them between releases In general these are fixes for nsotcltclcl installation problems

For TclTk-80 installation problems refer to TclTk 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

bull mailing-list-related problems bull general problems bull ns-allinone 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 bull ns 229 228 227 226 21b9 21b8 21b7 21b6 21b5 21b4 21b3 21b2

21b1 20 20b17 bull nam (nam problems have their own page) bull xgraph bull Tclcl 116 10b13 10b9 10b8 10b6 bull Otcl general 10a3 096 bull Intel Linux systems bull 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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 16: Faq Troubleshooting Installation Problems

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

bull Problem I cant download ns from your web site

Work-arounds First many people have successfully downloaded ns (unless youre 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 isnt compressing or uncompressing it for you try Netscape if youre 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 dont help you might also try getting it via FTP (from ftpftpisiedunsnam) instead of HTTP (from httpwwwisiedunsnamdist) If ftping try using a dedicated FTP client instead of a web browser and make sure you transfer in BINARY mode not TEXT

bull Problem I cant subscribe or unsubscribe to the mailing list I get error messages back like

bull gtgtgtgtgt This is a multi-part message in MIME format bull gt Command this not recognized bull gtgtgtgtgt bull gtgtgtgtgt ------=_NextPart_000_0013_01C008417A1B9BA0 bull gtEND OF COMMANDS

Solution Send simple text (ASCII) e-mail to the subscribe address not MIME Majordomo the mailing list management program we use cant handle MIME

bull Problem My posts to the mailing list are rejected Im even subscribed to it

Solution Please see the mailing-list FAQ

bull Problem I was successful in installation but I cant run the example script in in tutorial simpletcl When i tried to run it gives few errors like

bull use-scheduler command not found bull attach-node command not found bull

Solution you need to run the script by issuing command ns simpletcl and you should add ns directory to the environment variable PATH

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 17: Faq Troubleshooting Installation Problems

bull Problem Ok but I still cant run simpletcl under the ~nstclex directory it gives an error saying

bull couldnt execute nam bull no such file or directory while executing exec nam outnam amp

(Also when I try typing the comamnd ns simpletcl 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 youre not sure how it works please consult a local Unix expert or search the web on unix PATH)

bull Problem To fix another problem it says to apply a patch file Whats 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 ftpgnuorg Change into the directory with the source code you want to patch and type patch lt pathtopatch-filepatch See the patch(1) man page for details about what messages youll 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-filecc filecc (This requires that you have saved a copy of the file before you modified it)

bull Problem I tried to apply a patch but it failed For example I got messages like bull [rootsrn04 ns-227] patch lt newfipatch bull patching file Makefilein bull Hunk 1 FAILED at 25 bull 1 out of 1 hunk FAILED -- saving rejects to file bull Makefileinrej bull patching file Makefilein

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 youre patching more or less If youre trying to patch a Makefile and you have no idea what a makefile is its very possible youll make an accidental error that prevents things from working But dont 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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 18: Faq Troubleshooting Installation Problems

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 youre doing you probably dont 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 youre 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 whats described in the patch in X-orig So an alternative to manually applying the patch is to find different original code If you find the same original code the person who made the patch used you should get it to apply cleanly So for example if a patch was generated against ns-226 and it fails when applied to ns-227 you could get rid of your copy of ns-227 and go get ns-226 then apply the patch to that older version (Of course this approach has other problems since you may want other things that are only in ns-227 TANSTAAFL)

bull Problem When I run validate or one of the test suites I get these messages warning using backward compatibility mode and using backward compatible AgentCBR use ApplicationTrafficCBR 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)

bull Problem I got the following error message during building OTcl bull creating cache configcache bull No configure file found in current directory bull Continuing with default options bull checking host system type alpha-dec-osf40 bull checking target system type alpha-dec-osf40 bull checking build system type alpha-dec-osf40 bull checking for gcc gcc bull checking whether the C compiler (gcc ) works yes bull checking whether the C compiler (gcc ) is a cross-compiler

no bull checking whether we are using GNU C yes bull checking whether gcc accepts -g yes bull checking for c++ c++ bull checking whether the C++ compiler (c++ ) works no bull configure error installation or configuration problem C++

compiler bull cannot create executables

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 19: Faq Troubleshooting Installation Problems

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

bull Problem I get linking errors when building ns or nam like bull Undefined first referenced bull symbol in file bull et_tclobject bull spaceoptns-allinone-21b6tclcl-10b9libtclcla(Tclo) bull ld fatal Symbol referencing errors No output written to ns bull collect2 ld returned 1 exit status bull Error code 1 bull make Fatal error Command failed for target `ns

(or other symbols that begin with et_)

Solution Build everything with gcc dont mix gccg++ and ccld (Insure that if you build any C++ code with g++ that you link with g++ and that theyre 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)

bull Problem I get errors like this when building ns-allinone bull [rootlocalhost unix] make bull gcc -pipe -c -O2 -Wall -Wno-implicit-int -fno-strict-aliasing -

fPIC -IhomevahidDesktopTemptk847unix -IhomevahidDesktopTemptk847unixgeneric -IhomevahidDesktopTemptk847unixbitmaps -IhomevahidDesktopTemptcl847generic -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 homevahidDesktopTemptk847unixgenerictk3dc

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh9629 X11Xlibh No such file or directory

bull In file included from homevahidDesktopTemptk847generictkInth21

bull from homevahidDesktopTemptk847generictk3dh18

bull from homevahidDesktopTemptk847generictk3dc16

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 20: Faq Troubleshooting Installation Problems

bull homevahidDesktopTemptk847generictkh573 parse error before Window

bull

Solution You dont have the development libraries for X11 installed on your system (see X11Xlibh 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)

bull Problem Validation under Windows does not work

Solution As of ns 226 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 112 which provides GNU binary utilities for the Windows platforms You may also want to download pre-compiled Perl for Windows After youve got all these tools apply the following patch to ~nstcltesttest-all-template1 to get around the rn problem

test-all-template1orig Wed Jan 5 010100 2000 --- test-all-template1 Thu Jun 22 160410 2000 117123 cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else --- 117123 ---- cp $datafilebk $datafile mv $datafileZ $directory$tZ else gzip -dc $directory$tZ | perl -ne print $_ |cmp -s - $datafile if [ $ = 0 ] then echo Test output agrees with reference output else

NOTE Some of the test suites will fail on win32 platform As of Feburary 26 1999 snapshot of ns the following test suites fail

test-all-simple test-all-tcp test-all-red test-all-sack

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 21: Faq Troubleshooting Installation Problems

test-all-schedule test-all-red-v1 test-all-sack-v1 test-all-v1 test-all-vegas-v1 test-all-ecn test-all-manual-routing test-all-intserv test-all-webcache test-all-srm

However all of them failed because of floating point rounding differences on win32 and on unix We will test current ns snapshots and update the results here Thanks to Christian Joensson for his enthusiasm in keeping providing the information and patches for many ns releases

IMPORTANT NOTE The cygwin release 132 currently available (as of 072001) which we installed in win2000 doesnt 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 stdinstdout correctly So we were unable to validate the windows version (ns21b8a) in this platform We welcome any suggestion from windows users to help solve this problem

bull Problem The test suites and validation fail with errors like bull ns _o3 cleanup file5 sackB4 Syntax error in file

binraw2xg at bull line 43 next 2 tokens my( bull Syntax error in file binraw2xg at line 59 next 2 tokens bull translate_point( bull Syntax error in file binraw2xg at line 94 next 2 tokens bull translate_point( bull Execution of binraw2xg aborted due to compilation errors bull Cant locate 50010000000000003 in INC at bingetrc line

4 bull while executing

(where the key parts are syntax error near my( and cant locate 5001)

Solution Get perl5 andor make sure the programs in ~nsbin are invoking perl5

Nss configure checks for perl5 but apparently this check is not sufficient for many peoples systems Suggestions for improving the check are encouraged (it already works on our systems)

bull Problem Things built OK but dont run because of missing shared libraries (for example you get the message cant load library libotclso or fatal libotclso cant open file errno=2 [from Solaris]) or libotclso 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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 22: Faq Troubleshooting Installation Problems

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 (lets say) you get the above error with otcl shared library (libotclso) you should append the path to your libotclso (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

bull 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 nss Makefile Look in the Makefile for the line LIB= and add your systems library for dynamic linking (typically -ldl)

Solution Unfortunately nss autoconf support for dynamic linking isnt currently very good and we cant test ns on all the platforms on which its used This configuration is done in ~nsconfconfigureindynamic If you can adjust the code there to correctly detect your system well be happy to add your patch to our sources

bull ProblemWhile building ns it gets compiled but bails out with the following error message during linking

bull c++ -static -o ns bull tclAppInito randomo rngo ranvaro misco bull bull bull -lXext -lX11 -lsocket -lnsl -ldl -lm bull ld fatal library -ldl not found bull ld fatal File processing errors No output written to

ns bull Error code 1 bull make Fatal error Command failed for target `ns

SolutionThis 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

o configure with static option explicitly turned off with --disable-static or o edit ns makefile to replace the value static for the macro STATIC with

blank (Dynamic mode is the default option) bull Problem Ns is running out of memory and segfaulting

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 23: Faq Troubleshooting Installation Problems

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

bull Problem I want to simulate ATM networks in ns What should I do

Solution If you just want to treat ATM as a 155Mbs link for IP packets you can get a pretty good approximation by well making a 155Mbs link Or a better approximation by accounting for ATM framing and using a 135Mbs 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

httpfreebsd1lumsedupk~umairNSdocindexhtml (theres a mirror at httpwwweesurreyacukPersonalLWoodnsATM if you cant reach that)

Its for ns version 1 its third-party its unsupported youre on your own

Deriving an ATM node class for ns-2 would actually be one of the few cases where youd 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

bull 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 httpwwwisiedunsnamns andor 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 urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 24: Faq Troubleshooting Installation Problems

Advances in Network Simulation _IEEE Computer_ V 33 (N 5 ) pp 59-67 May 2000 Expanded version available as USC TR 99-702b at urlhttpwwwisiedu johnhPAPERSBajaj99ahtml

bull 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)

bull 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_hostname00 (if you are using cshrc) or export DISPLAY=my_hostname00 (if you are using sh or bash) This solution works for both cygwin and unix

ns-229

bull Problem Some validation tests fail under Windows This is a carry-over from ns-228 (see below)

ns-228

bull Problem Some validation tests fail under Windows

SolutionCurrently on Windows XP SP2 and Cygwin 1512 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 its best to use ns under some kind of Unix

bull Problem When installing ns-allinone-228 in solaris there may be build problems

bull Solution Apply the following patch Reported and fixed by Qihe Wang

ns-227

bull Problem Ns doesnt build with gcc-34 (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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 25: Faq Troubleshooting Installation Problems

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)

bull Problem setdest doesnt compile with an error like bull $ make bull g++ -c -Dstand_alone -DSTL_NAMESPACE=STL_NAMESPACE -o

setdesto bull setdestcc bull In file included from configh54 bull from setdesth5 bull from setdestcc57 bull autoconfh85 error namespace `CPP_NAMESPACE

undeclared bull make [setdesto] Error 1

Solution Apply this patch then re-run configure

--- indep-utilscmu-scen-gensetdestMakefilein 20 Jan 2004 195642 -0000 19 +++ indep-utilscmu-scen-gensetdestMakefilein 18 May 2004 150527 -0000 -368 +368 CC = CC MKDEP = confmkdep - 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-utilswebtrace-convnlanrMakefilein 8 Oct 2002 071133 -0000 15 +++ indep-utilswebtrace-convnlanrMakefilein 18 May 2004 151042 -0000 17 -2517 +2516 Makefile for NLANR web cache trace processing (httpircachenlanrorg) - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 26: Faq Troubleshooting Installation Problems

BINDEST = prefixbin - 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-utilswebtrace-convdecMakefilein 8 Oct 2002 071133 -0000 14 +++ indep-utilswebtrace-convdecMakefilein 18 May 2004 151041 -0000 16 -2817 +2816 Taken from Alex Rousskovs originial code - $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ + $Header nfsjadevintCVSROOTwwwnsns-problemshtmlv 1186 20060428 210322 tomh Exp $ Top level hierarchy prefix = prefix Pathname of directory to install the binary BINDEST = prefixbin - 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-226

bull (no bugs listed here)

ns-21b9

bull 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 ampamp John Novatnack

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 27: Faq Troubleshooting Installation Problems

Please apply the following patch to fix the problem --- aodvcc Thu Mar 21 141708 2002 +++ aodvcc Wed Oct 30 111330 2002 -5708 +57010 Add the IP Header ch-gtsize() += IP_HDR_LEN - ih-gtttl_ = NETWORK_DIAMETER - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + ih-gtttl_ = NETWORK_DIAMETER + I received a packet that I sent Probably a routing loop -5929 +59411 return - - rt_resolve(p) - + Added by Parag Dadhania ampamp John Novatnack to handle broadcasting + if ( (u_int32_t)ih-gtdaddr() = IP_BROADCAST) + rt_resolve(p) + else + forward((aodv_rt_entry) 0 p NO_DELAY)

bull Problem ns does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

bull Problem I get segmentation fault while trying to simulate using DSR in dbugged version of ns-21b9 (ns-dbug-dsr-072202targz)

Solution The dbugged version of DSR expects CMUPriQueue instead of QueueDropTailPriQueue Hence change the older queue type in yr DSR simulation script to CMUPriQueue

bull Problem The newer version of DSR code in ns-21b9 (which has been ported from CMU) incurs a lot of packet drops (especially TTL drops) compared to the older DSR version in ns-21b8 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 fwded to the next nodeAnother 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 ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 28: Faq Troubleshooting Installation Problems

is that DSR now uses a CMU version of PriorityQueue in place of the older version in ns This can found under ~nsqueuedsrqueuecchDownload ns-dbug-dsr-072202targz for the debugged version of the src code Note that since DSR now uses CMUPriQueue all dsr scripts previously using QueueDropTailPriQueue should be replaced with CMUPriQueue See dsr test scripts under tcltest for examples

bull 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 simulatorcc 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 SolutionApply the following patch to file ~nscommonsimulatorcc

bull Index simulatorcc bull ================================================================

=== bull bull 137a138141 bull gt bull gt Updating nodelist_ (total no of connected nodes) bull gt size since size_ maybe smaller than nn_ (total no of

nodes) bull gt check(nn_) bull 165a170171 bull gt update the size of nodelist with nn_ bull gt check(nn_)

ns-21b8

bull Problem When compiling under Solaris 8 (Sun OS 58) I get the following error bull In file included from aodvaodv_logscc6 bull aodvaodvh231 redefinition of `struct bcache bull usrincludesysstreamh335 previous definition here bull Error code 1 bull make Fatal error Command failed for target `aodvaodv_logso

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

bull ProblemI try to build ns-21b8 under windows but the compiler bails out with errors like

bull wireless_phyh(75) error C2555 wirelessPhynode overriding virtual function

bull differs from Phynode only by return type or calling convention

bull phyh(71) see declaration of Phy

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 29: Faq Troubleshooting Installation Problems

bull NMAKE fatal error U1077 CPROGRA~1MICROS~3VC98BINclexe return code

bull 0x2 bull Stop

Solution There is a patched version of ns-src-21b8a-wintargz available that should build under windows Also please visit this page for other info about building under windows

bull Problem How do we use NS emulation on ns21b8 Solution NS emulation currently works on FreeBSD machinesand is being fixed for Linux machines Till then you can use emulation on ns21b7

bull Problem I had a problem compiling tcl832 in ns-allinone-21b8a The problem I had was that when compiling tcl the Makefile tried to generate tclStubInitc which is already in tcl832generic In order to generate tclStubInitc you need tclsh which is what I was trying to compile so it didnt work Reported by Michele C Weigle SolutionContributed by Lloyd Lim Tcl will try to regenerate tclStubInitc if it thinks its timestamp is earlier than that of tcldecls andor tclIntdecls To fix the timestamps just touch tclStubInitc and everything should compile normally

bull ProblemEverytime you run ns 2 files ftpfilesizetr and ftpdlytr are created SolutionThis bug was reported by Brian Lee Bowers and happens due to initialisation of a static file-pointer in ~nsbaytcpftpsccftpccc Pl apply the following patch

bull Index ftph bull ================================================================

=== bull 73c73 bull lt static FILE fp_ bull --- bull gt static FILE fp_ bull bull Index ftpccc bull ================================================================

=== bull 52c5253 bull lt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull --- bull gt bull gt FILE FtpClientAgentfp_ = fopen(ftpdlytr w) bull bull Index ftpscc bull ================================================================

=== bull 26c26 bull lt static FILE fp_ bull --- bull gt static FILE fp_

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 30: Faq Troubleshooting Installation Problems

bull 29c29 bull lt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull --- bull gt FILE FtpSrvrAgentfp_ = fopen(ftpfilesizetr w) bull bull ProblemNs builds fine but trying to do a make install gives error

SolutionPlease apply the following patch (contributed by Hyok Kim) to Makefilein

bull 370c370 bull lt for i in $(SUBDIRS) do ( cd $$i $(MAKE) install )

done bull --- bull gt for i in $(SUBDIRS) do cd $$i $(MAKE) install done bull

ns-21b7

bull ProblemMemory leak in computeRoute routine in linkstate routing code SolutionPlease apply the following patch (contributed by Ming Feng) to ~nslinkstatelsh

bull --- lsh 20000901 173856 13 bull +++ lsh 20010524 183249 bull -5537 +5539 bull bull bool init(LsNode nodePtr) bull void computeRoutes() bull - routingTablePtr_ = _computeRoutes() bull + if (routingTablePtr_ = NULL) bull + delete routingTablePtr_ bull + routingTablePtr_ = _computeRoutes() bull bull LsEqualPaths lookup(int destId) bull return (routingTablePtr_ == NULL) bull bull ProblemSnoop is broken (has been fixed in the 21b8 release)

SolutionSnoop has been broken for quite sometimeIt has been fixed as of 040601 thanks to Benyuan Liu The patch is available at Snooppatch

bull ProblemSegmentation fault while running wireless simulations due to uninitialised variable ant_ SolutionApply this patch (courtesy of Lars Christensen)

bull --- wireless-phycc 20010228 143626 1111 bull +++ wireless-phycc 20010308 152058 12 bull -1026 +1027 bull lambda_ = SPEED_OF_LIGHT freq_ bull bull node_ = 0 bull + ant_ = 0

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 31: Faq Troubleshooting Installation Problems

bull propagation_ = 0 bull modulation_ = 0 bull ProblemClass vector used in godcch clashes with vector in the standard

template library SolutionApply the following patch courtesy of Lars Christensen

bull Problemnse does not compile on freebsd nor linux It complains about recvfrom() in net-ipcc (and ether_aton() in arpcc for linux) SolutionGet fixed net-ipcc and arpcc from daily snapshot or from ns web cvs repository Reported by Ian G Clark

bull Problem PacketData does not set size correctly Solution Apply this patch (courtesy of Lars Christensen)

bull --- packeth 20000928 201906 180 bull +++ packeth 20001109 015350 181 bull -2607 +2607 bull bull unsigned char data() return data_ bull bull - virtual int size() return datalen_ bull + virtual int size() const return datalen_ bull virtual AppData copy() return new PacketData(this)

bull private bull unsigned char data_ bull Problem gen-map does not work

Solution Apply this patch bull --- ns-tracetcl~ 20000724 194810 bull +++ ns-tracetcl 20001019 180242 bull -1626 +1627 bull incr i bull continue bull bull + set n $Node_($i) bull puts Node [$n tn] bull foreach nc [$n info vars] bull switch $nc

(This problem is fixed in ns-21b7a)

bull ProblemPriority queue bug in handling routing packets SolutionApply the changes provided by Robin Poss (It will go into snapshot after Oct 19 2000)

ns-21b6

bull Problem Some ns-21b6 test suites dont pass (test-all-monitor etc) when ns is built with tcl-83

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 32: Faq Troubleshooting Installation Problems

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

bull 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-83) This is a problem in some systems where the C compiler makes string constants read-only

Heres the top of the traceback from test-all-monitor

0 0x4012f1d7 in Tcl_ParseCommand () from usrliblibtcl83so 1 0x40130228 in Tcl_EvalEx () from usrliblibtcl83so 2 0x4012ff5e in Tcl_EvalTokens () from usrliblibtcl83so 3 0x401302a2 in Tcl_EvalEx () from usrliblibtcl83so 4 0x40130541 in Tcl_Eval () from usrliblibtcl83so 5 0x400fa063 in Tcl_GlobalEval () from usrliblibtcl83so 6 0x8114c97 in Tcleval () at genptypescc297 7 0x805eb87 in Agenttrace (this=0x83df338 v=0x83df57c) at agentcc282 8 0x8063f90 in TcpAgenttrace (this=0x83df338 v=0x83df57c) at tcpcc320 9 0x81161e9 in TclObjecthandle_TracedVar () at genptypescc297 10 0x811671f in TclObjectdelay_bind () at genptypescc297 11 0x8063412 in TcpAgentdelay_bind_dispatch (this=0x83df338 varName=0x83dd4c8 cwnd_ localName=0x83dd4c8 cwnd_ tracer=0x83df338) at tcpcc231

This problem has been observed on Linux systems running RedHat 70 (ie tclcl-83 and gcc 296) Probably it appeared there because either tclcl-83 changed Tcl_ParseCommand or gcc 296 changed string constants to be read-only by default

Solution Update to a tclcl snapshot after 17 August 2000 (or the 10b10 release whenever that happens)

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

bull Problem Configure of otcl tcl or ns fails with the message cannot run test program while cross-compiling

bull telestoddutta8 install bull creating cache configcache bull checking for ranlib ranlib bull checking whether cross-compiling yes bull checking for getcwd no bull checking for opendir no

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 33: Faq Troubleshooting Installation Problems

bull bull checking for -linet no bull checking for neterrnoh yes bull checking whether char is unsigned configure error can not

run test bull program while cross compiling bull tcl804 configuration failed Exiting

Solution This error happens on Solaris systems where gcc is installed and Suns C compiler is not installed but configure decides to use Suns 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

bull Problem invalid command name MacCsmaCd

Solution use the Mac802_3 agent which implements CSMACD to replace MacCsmaCd

bull Problem Running validation on RedHat Linux 60 with egcs-29166 reports the following test suites as broken

bull test-all-cbq test-all-cbq-v1 test-all-webcache test-all-wireless-lan

bull test-all-wireless-gridkeeper test-all-wireless-lan-newnode test-all-wireless-lan-tora

Solution Remove -O2 optimization from the makefile and recompile everything Alternatively you can configure everything with debugging enabled which doesnt pass -O2 option to the compiler Just do

make clean configure --enable-debug make

bull 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 Ive had this problem becouse of incorrect calls to Schedulerschedule If something schedule an event with a time already gone (less than current time of the scheduler) the Schedulerdispatch will generate that message Ive solved my problems debugging with a breakpoint in schedulercc line 99 ( fprintf(stderr ns scheduler

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 34: Faq Troubleshooting Installation Problems

going backwards in time from f to fn 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

gt gt There were a lot of discussions on scheduler going backwards problem gt gt in this list I wonder what is the final solution gt gt I think I can summarize it as follows gt gt 1 If you see this warning the first thing you should do is to make gt sure youre using the latest version of schedulercc If necessary gt get the latest version from gt httpwwwisieducgi-binnsnamcvswebns-2schedulercc gt Dont forget to recompile If after that you still see this error gt message please report this to the list gt gt 2 If the previous didnt work for you use Heap scheduler instead of gt default Calendar (see Simulator instproc use-scheduler command and gt nsdoc) Heap scheduler although a little less effective than gt Calendar doesnt have a numeric stability problem and should not gt give you this error Again if it does please report this to the gt list

bull Problem Validate does not run under Windows 9598NT Solution See ns-buildhtml for instructions on how to run it

bull Problem When you run scripts it tells you something like slot not found

SolutionThis may be due to many reasons but if this is your first time running 21b6 release and you immediately see this problem then try getting classifier-portcc and classifier-porth from cvs repository httpwwwisieducgi-binnsnamcvswebns-2

bull ProblemWhen I use DV routing I dont get any traffic

SolutionThis is fixed in the snapshot of 14 February 2000 You could also apply the patches in httpwwwisiedunsnamarchivens-userswebarch2000msg00635html

bull ProblemConfigure on some platforms fail with this error message bull checking for tkh configure error NONE is not a directory

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 35: Faq Troubleshooting Installation Problems

SolutionApply the following patch to configure (thanks to the report and fix by Guillermo Rodriguez Garcia)

--- configureold Tue Feb 22 142515 2000 +++ configure Mon Mar 6 124535 2000 -20217 +20217 withval=$with_tk d=$withval else - d=$prefix + d= fi

bull Problemtclexweb-traffictcl aborts with message bull done pages 10 = all pages 9

SolutionApply the following patch to webcachewebtrafcc

bull Problem Validation fails with the on test-all-aimd with the following messages bull test-all-aimd QUIET bull Tests tcp tcpA tcpB tcp_tahoe tcpA_tahoe tcp_reno tcpA_reno

tcp_newreno tcpA_newreno bull ns test-suite-aimdtcl tcp QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpA QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcpB QUIET bull Test output agrees with reference output bull ns test-suite-aimdtcl tcp_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_tahoe QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_reno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcp_newreno QUIET bull saving output for future validation bull ns test-suite-aimdtcl tcpA_newreno QUIET bull saving output for future validation bull test-all-template1 unknown not found bull Some test failed

Solution Download test-output-aimdtargz and untar it at your ns-21b6 direcotry

bull Problem Configuration script still lists tclcl version 10b8 as and otcl version 10a5 the required versions

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 36: Faq Troubleshooting Installation Problems

Solution Download ns-21b6-configurepatch and apply it to ns-21b6configure

bull Problem Some satellite examples do not exist in the release

Solution Download satellite-examplestargz and untar it at your ns-21b6 directory

ns-allinone-228

bull Problem When installing ns-allinone-228 using gcc34 nam fails to build

SolutionTry replacing the NULL in line 73 of file agenth in nam-111 with 0 Bug reported and fix supplied by Qihe Wang

bull Problem When installing ns-allinone-228 in solaris there may be build problems

Solution Apply the following patch Reported and fixed by Qihe Wang

ns-allinone-226

bull Problem When installing ns-allinone-226 on Mac OS X nam fails to link against zlib (there are undefined symbol errors for _gzclose _gzopen _gzread etc)

Solution The configure script for nam has a typo Edit the file nam-19configure and find the line which says ZLIB_VERS=113 and change it to say ZLIB_VERS=114

bull Problem ns-allinone-226 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-19configure available here

ns-allinone-21b9

bull Problem ns-allinone does not compile when using gcc-32Redhat 80

Solution ns has been patched to compile using GCC-32Redhat80 on October 10 2002 Please download a ns snapshot after Oct 10 to fix the problem or download a fixed ns-allinone

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 37: Faq Troubleshooting Installation Problems

ns-allinone-21b8

bull ProblemThe tcl832 distribution included in ns-allinone-21b8a tarfile has same timestamps for stubfiles like tclStubInitc and stub-generator files like tcldecls 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

bull tclsh toolsgenStubstcl generic bull generictcldecls generictclIntdecls bull make tclsh Command not found bull make [generictclStubInitc] Error 127

SolutionTouch ~tcl832generictclStubInitc file which will solve this problem as the timestamp of the generated file is now more recent than that of the stub-generator file

All problems here are discussed in the ns-21b7 section

ns-allinone-21b7

bull Problemns-allinone-21b7 install cannot find tcltk libraries Solution (This problem is fixed in ns-21b7a) Apply the following patch (contributed by George Riley)

bull --- install~ Wed Oct 18 144156 2000 bull +++ install Mon Oct 30 094921 2000 bull -1047 +1047 bull bull blame=Please check httpwwwisiedunsnamnsns-

problemshtml bull for common problems and bug fixes bull -configure || die otcl-10a6 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox || die

otcl-10a6 configuration failed bull Exiting bull bull if make bull then bull -1227 +1227 bull bull cd tclcl-10b10 bull bull -configure || die tclcl-10b10 configuration failed Exiting

bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 || die tclcl-10b10 configuration fail bull ed Exiting

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 38: Faq Troubleshooting Installation Problems

bull bull if make bull then bull -23416 +23415 bull echo sgb lib not found gt-itm amp sgb2ns could not be

installed Continuing bull fi bull bull -compile and install ns bull + Compile and install ns Since ns searches for tclsh in $PATH

the following is needed bull PATH=$CUR_PATHtclboxbin$CUR_PATHtkboxbin$PATH bull export PATH bull -echo $PATH bull bull Johns hack bull test -f otcl-10a6libotcla ampamp rm otcl-10a6libotclso bull bull cd ns-21b7 bull -configure || die Ns configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl=tclcl-10b10 || die Ns configuration failed Exitin

bull g bull bull if make bull then bull -2797 +2787 bull bull cd nam-10a9 bull bull -configure || die Nam configuration failed Exiting bull +configure --with-tcl=tclbox --with-tk=tkbox --with-

otcl=otcl-10a6 --with-tclcl= bull tclcl-10b10 || die Nam configuration failed Exiti bull ng bull bull if make bull then bull -3567 +3558 bull bull echo ----------------------------------------------------- bull echo Please put $CUR_PATHbin into your PATH environment bull -echo You many need to put $CUR_PATHotcl-10a6

$CUR_PATHtclboxlib $CUR_PATHtkboxlib bull +echo bull +echo You MUST put $CUR_PATHotcl-10a6 $CUR_PATHtclboxlib

$CUR_PATHtkboxlib bull echo into your LD_LIBRARY_PATH environment variable If it

complains about X libraries

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 39: Faq Troubleshooting Installation Problems

bull echo add path to your X libraries into LD_LIBRARY_PATH bull echo bull Problem sgb2ns generated tcl scripts contain duplex-link-of-interfaces which is

obsolete (Note this is a problem of ns-allinone-21b7) Reported by Ann Monico Solution Download a new version of sgb2ns

bull Problem Schedulerrun() may lose an event when the simulator halts then resumes Solution Apply this patch by Thomas Kaemer

bull --- schedulercc~ 20000929 234012 bull +++ schedulercc 20001020 014524 bull -987 +9812 bull bull instance_ = this bull Event p bull - while ((p = deque()) ampamp halted_) bull + bull + The order is significant if halted_ is checked

later bull + event p could be lost when the simulator resumes bull + Patch by Thomas Kaemer bull + bull + while (halted_ ampamp (p = deque())) bull dispatch(p) bull bull

ns-allinone-21b6a All problems here are discussed in the ns-21b6 section

ns-allinone-21b6

bull Problem nam crashes when running the wireless examples in Marc Greiss tutorial

Solutionthere was a bug in hierarchical routing for wireless its fixed in the snapshot after 1252000

ns-21b5

bull 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 traffictracecc (around line 35) to be

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 40: Faq Troubleshooting Installation Problems

if 1

(always) Eventually autoconf should figure this out

bull Problem On win9598NT ns compiles but does not run Doing a Simulator info instprocs shows nothing

Solution Comment out line source ns-autoconftcl in tcllibns-libtcl 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 bintcl-expandtcl

--- tcl-expandtcl~ 19980527 194646 +++ tcl-expandtcl 19990820 165504 -406 +4010 proc expand_file name puts tcl-expandtcl begin expanding $name + if [file exists $name] == 0 + puts tcl-expandtcl cannot find $name + return + set f [open $name r] while 1 if [gets $f line] lt 0

bull Problem Linker reports an error bull Undefined first referenced bull symbol in file bull _RENAMED

Solution Upgrade your TclCl

bull ProblemCompiling programs under indep-utilswebcache-conv on platforms other than FreeBSD or BSD44 systems will raise unresolved symbols heapsort and strsep

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

bull Problem If you run with assertion on (wo flag -DNDEBUG at compile)some assertions fail

Solution Apply the following patch to phycc

--- phycc 19990313 035259 14 +++ phycc 19990323 013822 15 -786 +787 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

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 41: Faq Troubleshooting Installation Problems

channel_ = (Channel) obj + downtarget_ = (NsObject) obj LIST_INSERT_HEAD() is done by Channel return TCL_OK

bull Problem The wireless example script ~nstclexwirelesstcl when run with the DSR or DSDV routing option raises errors and then bails out with messages like

bull dfu ran off the end of a source route (for DSR) or bull dfu invalid UID etc

Solution Go to ns-build page for a special ns snaphot having the debugged version of CMUs wireless module in ns

ns-allinone-21b5

bull 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 configcache 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 neterrnoh yes checking whether char is unsigned configure error can not run test program while cross compiling tcl804 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)

bull Problem When I went to install the ns-allinone-21b5 on Redhat 60 with Linux kernel 225-15 I got an error during compilation for tcl804

bull generictclPosixStrc In function `Tcl_ErrnoId bull generictclPosixStrc340 duplicate case value bull generictclPosixStrc328 this is the first entry for

that value bull bull generictclPosixStrc In function `Tcl_ErrnoMsg

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 42: Faq Troubleshooting Installation Problems

bull generictclPosixStrc787 duplicate case value bull generictclPosixStrc775 this is the first entry for

that value bull bull make [tclPosixStro] Error 1 bull tcl804 make failed Exiting bull

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 usrincludebitserrnoh 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 tclPosixStrc They should be around lines 328 and 775 respectively

bull Problem ns-allinone fails to detect the correct version of tclsh ie tclsh80 As a result the installation script fails or worse finds an out-of-date tclsh in the directory which could cause some malfunctioning in the future

Solution

1 Download this patch and place it at your allinone directory 2 Apply the patch by typing patch -p lt ns-allinone-21b5patch 3 Remove configcache from your OTcl TclCl ns and nam directories 4 Re-install

ns-allinone-21b4

bull Problem ns-allinone exits with the foll error message cc -g -c cweavec

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 43: Faq Troubleshooting Installation Problems

cc -g -o cweave cweaveo commono install test ] missing Reported Wed Nov 18 Sundeep Singatwaria (sundeepcadencecom) or exits while trying to build cwebsgb

Solution Download the newer version ns-allinone-21b4a now available from ns-build page

ns-21b4

bull Problem Ns doesnt generate nam traces for user-installed error modules Reported by Sarah Liu

Solution Add the following patches to tcllibns-libtcl and tcllibns-linktcl Note that these patches are against the current snapshot (ns-lib version 1139 and ns-link version 140) 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 Simulatorlossmodel and SimpleLinkerrormodule These two methods insert an error module BEFORE the queue module in a link Simulatorlossmodel only inserts a loss module and is not capable of producing any traces (neither ns nor nam) for packet drops SimpleLinkerrormodule 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 Simulatorlink-lossmodel and SimpleLinkinsert-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-libtcl

--- ns-libtcl 19990226 230634 1139 +++ ns-libtcl 19990304 001234 -104911 +104913 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-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 44: Faq Troubleshooting Installation Problems

Simulator instproc bw_parse bspec

Patch for ns-linktcl

--- ns-linktcl 19981028 192649 140 +++ ns-linktcl 19990304 000918 -4617 +4617 - insert an error module after the queue + insert an error module BEFORE the queue point the ems drop-target to the drophead SimpleLink instproc errormodule args -4773 +47735 $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_ + + +

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 45: Faq Troubleshooting Installation Problems

bull Problem Static link color configuration for nam doesnt work (must use $ns at to change link color)

Solution Add the following patch to tcllibns-namsupptcl (note this is the version in ns-21b4)

--- ns-namsupptcl~ 19981006 012624 +++ ns-namsupptcl 19990216 224838 -1437 +1487 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

bull Problem On HP-UX 1020 with gcc 2722 make failed with messages like bull In file included from randomh41 bull from randomcc40 bull configh60 conflicting types for `typedef signed char int8_t bull usrincludesys_inttypesh48 previous declaration as

`typedef char int8_t bull In file included from randomh41 bull from randomcc40 bull configh92 declaration of C function `int gethostid()

conflicts with bull usrincludesysunistdh350 previous declaration `long int

gethostid() here bull configh94 declaration of C function `void srandom(int)

conflicts with bull usrlocallibgcc-libhppa11-hp-

hpux10202722includestdlibh265 bull previous declaration `void srandom(unsigned int) here bull Error exit code 1 bull bull Stop

Solution Add the following patch into configh

--- configh~ 19981210 185809 +++ configh 19990118 234204 -497 +497 typedef signed char int8_t breaks under Solaris 26 Shouldnt autoconf handle stuff like this Shouldnt autoconf generate configh 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 -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 46: Faq Troubleshooting Installation Problems

-if defined(sun) +if defined(sun) || defined(__hpux) include typedef unsigned char u_char typedef unsigned short u_short -958 +9510 include int strcasecmp(const char const char ) clock_t clock(void) +if defined(__hpux) int gethostid(void) -if defined(_AIX41) ampamp defined(sun) +endif +if defined(_AIX41) ampamp defined(sun) ampamp defined(__hpux) void srandom(int) endif long random(void)

bull Problem On some systems nss configure finds tclsh but compilation fails with a message like

bull tclsh80 binstring2ctcl version_string lt VERSION gt genversionc

bull bull sh tclsh80 not found bull bull Error code 1 bull bull make Fatal error Command failed for target genversionc

Reported 16 Dec 1998 by Raed Sunna

Solution There is a bug in ns-21b4s configure it only remembers that it finds tclsh80 not the complete path to it This will be fixed in tonights 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 =

bull Problem On Windows 98 ns compiles fine but on trying to run nsexe it outputs the contents of the genns_tclcc file and exits Reported 27 Oct 1998 by Brett Vickers

Solution The Makefilevc in ns-21b4 release is not updated Apply the win98patch provided by Brett Vickers to remove the problem The win98patch is as follows

Index makefilevc ====================================================================== --- makefilevc Wed Sep 2 191529 1998

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 47: Faq Troubleshooting Installation Problems

+++ makefilevc Wed Oct 28 120732 1998 -987 +987 schedulero objecto packeto ipo routeo connectoro ttlo traceo trace-ipo - classifiero classifier-addro classifier-hasho + classifiero classifier-addro classifier-hasho classifier-virtualo classifier-mcasto classifier-mpatho replicatoro classifier-maco appo telneto tcplib-telneto -1227 +1227 delayo llo snoopo channelo maco mac-csmao mac-802_11o mac-multihopo dynalinko rtProtoDVo net-interfaceo - ctrMcasto pruneo srmo + ctrMcasto mcast_ctrlo srmo sessionhelpero delaymodelo srm-ssmo srm-topoo alloc-addresso addresso -1307 +1307 $(LIB_DIR)dmalloc_supporto webcachehttpo webcachetcp-simpleo webcachepagepoolo webcacheinval-agento webcachetcpappo webcachehttp-auxo - lanRoutero + lanRoutero tfcco filtero what was here before is now in emulate OBJ_C = Index filterh ====================================================================== --- filterh Tue Oct 6 143934 1998 +++ filterh Wed Oct 28 120736 1998 -2911 +2911 public Filter() inline NsObject filter_target() return filter_target_ + enum filter_e DROP PASS FILTER DUPLIC protected - enum filter_e DROP PASS FILTER DUPLICATE virtual filter_e filter(Packet p) - int command(int argc const charconst argv) + int command(int argc const char const argv) void recv(Packet Handler h= 0) NsObject filter_target_ target for the matching packets Index filtercc

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 48: Faq Troubleshooting Installation Problems

====================================================================== --- filtercc Wed Oct 28 135850 1998 +++ filtercc Wed Oct 28 135842 1998 -487 +487 if (h) h-gthandle(p) drop(p) break - case DUPLICATE + case DUPLIC if (filter_target_) filter_target_-gtrecv(p-gtcopy() h) fallthrough

ns-21b3

bull Problem I cant compile embedded-tclcc (for example I get the message CCembedded-tclcc line 1 compiler limit exceeded lexical token too long on HP-UX 1020)

embedded-tclcc contains tcl code as one long string Some compilers (like yours) cant handle strings that are so long

Solution (choose one or the other)

o install gcc OR o rebuild tcl2c++ with TCL2C_INT defined then regenerate embedded-

tclcc with the new tcl2c++ (by deleting it and typing make after putting the new tcl2c++ in your path)

Heres the patch for HP-UX

Index tcl2c++c --- tcl2c++c 19981008 181255 18 +++ tcl2c++c 19981012 164027 -307 +3010 define strcasecmp _stricmp endif -if defined(WIN32) || defined(__alpha__) + + Define TCL2C_INT if your compiler has problems with long strings + +if defined(WIN32) || defined(__alpha__) || defined(__hpux) define TCL2C_INT endif

bull Problem NS breaks on trying to use single level of hierarchy for hierarchical routing

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 49: Faq Troubleshooting Installation Problems

Solution Apply patchfile hierpatch to remove the above bug

bull Problem mem-traceh doesnt compile or ns fails to link because of errors about getrusage

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

bull Problem Static library of tcl-debug v17 on FreeBSD still contains symbols required by the dynamic libraries (crt0o) This is caused by compiling o files using -fpic and using those o files to build static library

Solution Apply the following patch to Makefilein of tcl-debug v17

3738c37 lt CFLAGS = DBG_CFLAGS lt SHCFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS --- gt CFLAGS = DBG_CFLAGS DBG_SHLIB_CFLAGS 8587d83 lt SHCFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(SHCFLAGS) lt lt SUFFIXES so 9192d86 lt cso lt $(CC) -c $(SHCFLAGS_INT) $(HDEFS) $lt 96d89 lt SOFILES = Dbgso Dbg_cmdso 114c107 lt $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt $(DBG_SHARED_LIB_FILE) $(OFILES) 116c109 lt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(SOFILES) --- gt TCL_SHLIB_LD -o $(DBG_SHARED_LIB_FILE) $(OFILES)

Then do make distclean and re-configure and make

bull Problem Nam can not understand V -t -v 10a5 We added version infomation into nam trace file but all nam older than version 10a5 can not process it A sample error message

bull nam unknown event at offset 21 in `outnam bull nam `V -t -v 10a5 -a 0 bull

Solutions

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 50: Faq Troubleshooting Installation Problems

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

(If youve done these and the problem persists check for old versions of nam in your path)

bull Problem namtrace-all causes segmentation fault on Linux and Solaris 26 Its caused by sprintfs inability to handle null pointers in those systems

Solution Apply the following patch to ~ns-2tracecc

--- tracecc~ 19980717 223725 +++ tracecc 19980720 180753 -1857 +1857 hdr_rtp rh = (hdr_rtp)p-gtaccess(off_rtp_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t] -4137 +4137 hdr_cmn th = (hdr_cmn)p-gtaccess(off_cmn_) hdr_ip iph = (hdr_ip)p-gtaccess(off_ip_) hdr_srm sh = (hdr_srm)p-gtaccess(off_srm_) - const char sname = 0 + const char sname = null int t = th-gtptype() const char name = pt_names[t]

bull Problem When compiling ns-21b3 you get errors like bull objectcc In method `void NsObjectdelay_bind_init_all() bull objectcc60 warning implicit declaration of function `int bull delay_bind_init_one() bull objectcc In method `int NsObjectdelay_bind_dispatch(const

char bull const char ) bull objectcc67 warning implicit declaration of function `int bull DELAY_BIND_DISPATCH() bull objectcc67 `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

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 51: Faq Troubleshooting Installation Problems

bull ProblemThe script tclextest-suite-intservtcl fails as does anything using the IntServ functionality SolutionThis patch to ns-libtcl fixes the problem

bull ProblemMulticast code breaks because the interfaces were not installed properly typically with an error message that goes as follows

bull ns _o3 run-mcast invalid command name 0 bull while executing bull [$link set ifacein_] set intf_label_ bull (procedure _o10 line 3) bull (Node get-oif line 3) bull invoked from within bull $self get-oif $link bull (procedure _o10 line 5) bull (Node init-outLink line 5) bull invoked from within bull $node init-outLink bull (procedure _o3 line 5) bull (Simulator run-mcast line 5) bull invoked from within bull _o3 run-mcast

Solution patch to ns-libtcl fixes the problem This is preferably applied after the intserv patch above

ns-21b2

bull Problem In RedHat Linux 51 (and probably on other machines with gcc-28x or egcs-10x) tclcl fails to compile with erros like

bull c++ -c -I -Iotcl -Itkboxinclude -Itclboxinclude -DNO_TK -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H -O2 -o Tclo Tclcc

bull tclcl-mappingsh In function `static int TclObjectHelperdispatch_(void struct Tcl_Interp int char )

bull In file included from tclclh47 bull from Tclcc50 bull tclcl-mappingsh51 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 Meters directions for how to update ns-allinone to work on these systems

bull Problem In Debian Linux ns compilation fails with an error like bull c++ -c -g -DNO_TK -DNDEBUG -DUSE_SHM -DHAVE_LIBTCLCL1_0B5 -

DHAVE_TCLCL_H bull -DHAVE_LIBOTCL1_0A2 -DHAVE_OTCL_H -DHAVE_LIBTK4_2 -DHAVE_T bull K_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -I -Itclcl-10b5

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 52: Faq Troubleshooting Installation Problems

bull -Iusrlocalinclude -Iusrincludetcl -Iusrincludetcl -o randomo rand

bull omcc bull randomcc In function `int random() bull randomcc50 new declaration `int random() bull usrincludestdlibh198 ambiguates old declaration `long int

random() bull make [randomo] 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 Ive not done that before) thats 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 dont know of such a define

Until its fixed the Right Way this patch should work around the problem

--- randomcc~ Tue Apr 14 140704 1998 +++ randomcc Tue Apr 21 105007 1998 -4111 +417 include include randomh -ifdef linux -int -else long -endif random() printf(random() called in nsnRandom is not portable please use Randomuniform() insteadn)

(Problem raised by Jeffrey Austen ltjaustentntechedugt)

bull Problem Typos in the rtglib code and examples o Typo in line 208 of ~nstclrtglibdynamicstcl

Solution Change line 208 to

set fin [lindex $args 3]

o The dynamic routing line in ~nstclexsimple-rtgtcl vanished

Solution Add the line

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 53: Faq Troubleshooting Installation Problems

$ns rtproto DV

before specifying the rtmodel

o The dynamic routing line in ~nstclexsimple-dyntcl vanished

Solution Add the line

$ns rtproto DV or use Session

before specifying the rtmodel

bull Problem Ns doesnt 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 Simulatortrace-annotate in tcllibns-tracetcl

$self puts-nam-traceall v [$self now]

with

$self puts-nam-traceall v -t [$self now]

bull Problem Ns doesnt automatically find otcl-10b2 or tclcl-10b5 when running configure (Reported by Larry Wood)

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

bull Problem Cannot find conf subdirectory in the ns-21b2 release

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

ns-21b1

bull Problem NS gets compiled fine but give the error ``Simulator not found when run

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 54: Faq Troubleshooting Installation Problems

(A more specific error message)

[rdvomocha ex]$ ns rctcl 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 rctcl line 10)

Solution Make sure you have tclsh in your path or change the Makefile to specify where tclsh is or generate genns_tclcc by hand (look at the Makefile for how) This problem often happens when genns_tclcc 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 tclsh80

This problem should be fixed in ns-21b2

bull Problem Compilation errors on ostreamh

Solution Delete the line include ostreamh in schedulercc

Reported 12-Nov-97

bull Problem Under some circumstances configure does not find tcl76 tk42 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-20

bull ProblemSyntax error in leave-group-source Node method in tclmcastns-mcasttcl 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-21b1

bull ProblemMulticast Replicators failed to forward subsequent packets when the first packet is dropped and the ignore_ flag is set

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 55: Faq Troubleshooting Installation Problems

Solution In file tclmcastns-mcasttclClassifierReplicatorDemuxer instproc drop comment out set ignore_ 1

Reported 23-Oct-97

bull ProblemBackward compatibility mode did not work correctly for CBQ SolutionReplace 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 tcllibns-compattcl (Thanks to Greg Minshall for this fix) In addition add $self instvar scheduler_ set scheduler_ [new SchedulerList] after the first three lines in OldSim instproc init in tcllibns-compattcl

Reported 30-Sep-97

bull The following problems were reported 18-Sept-97 o ProblemSparse Mode multicast simulations (ie

tclexnewmcastpimtcl) failed Solution In tcllibns-nodetcl Node instproc enable-mcast after line `$self set mcastproto_ [new McastProtoArbiter ] add the following line `$mcastproto_ set Node $self

o Problemtclexnewmcastdense-mode2tcl fails Solution In the simulation script itself change `multi-link to `multi-link-of-interfaces

o Problemtclexnewmcastsimple-rtptcl fails Solution In the simulation script itself before the line `$ns duplex-link $n0 $n1 15Mb 10ms DropTail add the following line `Simulator set NumberInterfaces_ 1

o Problemtclexnewmcastsessiontcl scripts fail SolutionIn the simulation scripts themselves replace the last line $ns run Session with $ns rtproto Session $ns run

bull ProblemDense mode multicast failed to work with network dynamic modules

Solution In file tcllibns-linktclSimpleLink instproc dynamic replace these two lines $dynamics_ target head_ set head_ $dynamics_ with $dynamics_ target [$head_ target] $head_ target $dynamics_

Reported 15-Sep-97

bull Problem tclexnewmcast[mcast2pktintran]tcl failed due to minor API change

Solutionreplace the last line $ns run Session with $ns rtproto Session $ns run

Reported 11-Sep-97

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

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 56: Faq Troubleshooting Installation Problems

Solution In file tclsessionsessiontclSessionSim instproc run replace the line eval RouteLogic configure $args with [$self get-routelogic] configure

Reported 11-Sep-97

ns-20b17

bull Problem TCPSack sinks may cause ns to run out of memory or fail

Solution apply the ns-src-20b17-sack-sinkpatch

Reported 30-Jul-97 Fixed in ns-20

bull Problem libTcl gets this compile message bull c++ -o Tclo -c -O2 -DUSE_SHM -DHAVE_LIBOTCL0_96 -DHAVE_OTCL_H -

DHAVE_LIBTK4_2 -DHAVE_TK_H -DHAVE_LIBTCL7_6 -DHAVE_TCL_H -DNO_TK -Iusrlocalinclude -Iusrlocalincludetcl76 -Iusrlocalincludetk42 Tclcc

bull Tclcc In method `TclObject~TclObject() bull Tclcc239 conflicting types for `class InstVar p bull Tclcc233 previous declaration as `class TracedVar p bull Tclcc In method `TracedVarTcl~TracedVarTcl() bull Tclcc462 `const cannot be deleted

Solution This is a gcc compiler bug Get gcc-27x

Reported 30-Jul-97

XGraph

bull 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=machine00

bull Problem With RedHat Linux 60 or later xtbc fails to compile with the error

xtbc50 macro `strcpy used without args

Solution Apply the strcpy patchxgraph_strcpy_macro patch

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 57: Faq Troubleshooting Installation Problems

bull Problem Using gcc 281 on HP-UX 1020 xgraph failed to compile

Solution Removing from lines 166 and 167 of xgraphh (Fixes provided by Fion Lee)

bull Problem Xgraph fails to build with errors about function mismatches in declarations of sprintf

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

Tclcl-10b13

bull Problem Tclcl doesnt build against gcc-34 (as in Fedora Core 3)

Solution Fixed in current CVS Apply this patch

--- tclclh~ 2003-07-29 112450000000000 -0700 +++ tclclh 2004-12-10 085534692584936 -0800 -458 +458 include tclcl-configh -include tclcl-mappingsh include tracedvarh + tclcl-mappingsh included below AFTER definition of class Tcl struct Tk_Window_ -1586 +1588 Tcl_HashTable objs_ +include tclcl-mappingsh + class InstVar class TclObject

Tclcl-10b9

bull Problem When configuring tclcl it searches for an outdated version of OTcl (10a4)

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 58: Faq Troubleshooting Installation Problems

Solution Apply this patch to tclcl-10b9configure

Tclcl-10b8

bull Problem Compiling TclCL 10b8 results in a warning or an error about TclObjectenum_tracedVars() does not return a value

SolutionApply the following patch to Tclcc

--- Tclcc~ 19990224 190449 +++ Tclcc 19990224 191807 -3556 +3557 for ( var = 0 var = var-gtnext_) if (var-gttracer()) var-gttracer()-gttrace(var) + return TCL_OK int TclObjecttraceVar(const char varName TclObject tracer)

Tclcl-10b6

bull ProblemDouble-free bug in Tclcl-10b6 You have random crashes in ns particularly after you have destroyed objects

SolutionApply the following patch tclcl-10b6patch

Otcl (general)

bull Problem Im building OTcl from source and it complains with an error like bull gcc -c -g -o2 -DNDEBUG -DHAVE_STL -DUSE_SHM -I -

Ihomevijaytk832generic -Iotclc2120 bull tclInthNo such file or directory bull make [libotcla] Error1

Solution OTcl needs the file tclInth and tclIntDeclsh from the source code to Tcl If youre building OTcl on a platform with a binary installation of TclTk you must get these header files from the matching source code for your version ot TclTk

Otcl-10a3

bull Problem The OTcl test suites crash after the line PASSED objectvariables

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 59: Faq Troubleshooting Installation Problems

Solution None yet Ns doesnt exercise otcl autoloading so fixing this bug is a very low priority

bull Problem OTcl 10a3 doesnt compile with tcl 803 and 804 it complains about unknown variable isArg

Solution Add the following patch to otclc

--- otclc~ 19980723 172803 +++ otclc 19980907 185343 -7637 +76311 Tcl_ResetResult(in) while (args = 0) if TCL_MAJOR_VERSION gt= 8 +if TCL_RELEASE_SERIAL gt= 3 + if (TclIsVarArgument(args)) +else if (args-gtisArg) +endif endif Tcl_AppendElement(in args-gtname) args = args-gtnextPtr

bull Problem You have error while compiling otcl which bails out with something like the following message

bull cc -c -g -DNDEBUG -DUSE_SHM -I -Itkboxinclude bull -Itclboxinclude -Iinclude otclc bull otclc line 1102 syntax error before or at bull otclc line 1105 undefined symbol co bull [snip]

Solution Apply the following patch as a workaround to otclc

3c3 lt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ --- gt $Id ns-problemshtmlv 1186 20060428 210322 tomh Exp $ 56d55 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddErrorInfo(ab) 59d57 lt define compat_Tcl_AddObjErrorInfo(abc) Tcl_AddObjErrorInfo(abc) 432c430434 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(in msg)

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 60: Faq Troubleshooting Installation Problems

gt endif 469c471475 lt compat_Tcl_AddObjErrorInfo(in msg -1) --- gt if TCL_MAJOR_VERSION gt= 8 gt Tcl_AddObjErrorInfo(in msg -1) gt else gt Tcl_AddErrorInfo(int msg) gt endif 766768d771 lt if TCL_RELEASE_SERIAL gt= 3 lt if (TclIsVarArgument(args)) lt else 771d773 lt endif 1100c1102 lt for version 8 the instprocs are registered so no need to delete them () --- gt for version 8 the instprocs are registered so no need to delete them () 2025d2026 lt if TCL_MAJOR_VERSION gt= 8 2027d2027 lt endif 2115d2114 lt if TCL_MAJOR_VERSION gt= 8 2121d2119 lt endif

Otcl-096

bull Problem OTcl-096 does not compile with tcltk-80 bull otclc In function `ListProcArgs bull otclc654 `Arg undeclared (first use this function) bull otclc654 (Each undeclared identifier is reported only

once bull otclc654 for each function it appears in) bull otclc654 `args undeclared (first use this function) bull otclc654 structure has no member named `argPtr bull otclc655 parse error before `int bull otclc661 `i undeclared (first use this function) bull otclc In function `ListProcDefault bull otclc684 `Arg undeclared (first use this function) bull otclc684 `ap undeclared (first use this function)

Solution Get otcl-10a2 or later from the ns-build web page You will need access to the tcltk-80 sources to configure and compile otcl Please remember to build OTcl first before proceeding with building TclCL and ns

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems
Page 61: Faq Troubleshooting Installation Problems

Intel Linux systems

bull 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 doesnt 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 lt rate_) instead of `if (oldrate_ lt 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

bull Problem When installing Tcl804 under RedHat 6061 the compilation of TclPosixStrc may fail due to a conflict between ENOTSUP and EPROTONOTSUPP

Solution Change the following lines (339 and 786) in TclPosixStrc from

ifdef EOPNOTSUPP

to

if defined (EOPNOTSUPP) ampamp (defined(ENOTSUP)||(EOPNOTSUPP = ENOTSUP))

bull Problem Installation of ns emulator nse on Linux fails

Solution Please download the lastest snapshot of ns

Other Problems

bull (none right now)

ns ns-usersisiedu

  • Troubleshooting
    • From Nsnam
      • Contents
        • General problems
        • Installation troubleshooting
          • ns-allinone package
            • Installation of ns-2292 fails on x86_64 platform
            • Precompiled NS2-234 binaries for OS X Leopard 105 Snow Leopard 106
            • OS X Leopard 105
              • ns-2
                • ns-2 not building with gccg++ 432
                • ns-230ns-231 do not build with gccg++ 41
                • ubuntu
                • ns-229 does not compile on Fedora Core 5 (FC5)
                  • nam-1
                    • nam-112 does not compile on 64-bit platforms
                      • Post-install troubleshooting
                        • ns-2 builds but fails some validation tests
                        • unexpected behavior or crash (segfault) after code extension
                          • Bug Reporting
                          • Other tips from users
                          • when and how to write to the users mailing-list
                          • Some problems when using ns-2
                            • C++
                              • How to callback to OTcl from C++ code
                                • OTcl
                                  • How to use procedure in OTcl
                                      • Older versions of ns-2 nam-1 tclcl and otcl
                                      • The Network Simulator ns-2 Installation Problems Bug Fixes and Help
                                      • INSTALLATION PROBLEMS
                                        • Mailing-list-related Problems
                                        • General Problems
                                        • ns-229
                                        • ns-228
                                        • ns-227
                                        • ns-226
                                        • ns-21b9
                                        • ns-21b8
                                        • ns-21b7
                                        • ns-21b6
                                        • ns-allinone-228
                                        • ns-allinone-226
                                        • ns-allinone-21b9
                                        • ns-allinone-21b8
                                        • ns-allinone-21b7
                                        • ns-allinone-21b6a
                                        • ns-allinone-21b6
                                        • ns-21b5
                                        • ns-allinone-21b5
                                        • ns-allinone-21b4
                                        • ns-21b4
                                        • ns-21b3
                                        • ns-21b2
                                        • ns-21b1
                                        • ns-20
                                        • ns-20b17
                                        • XGraph
                                        • Tclcl-10b13
                                        • Tclcl-10b9
                                        • Tclcl-10b8
                                        • Tclcl-10b6
                                        • Otcl (general)
                                        • Otcl-10a3
                                        • Otcl-096
                                        • Intel Linux systems
                                        • Other Problems