Nam: Network Animator

Installation Problems, Bug Fixes,and Help


This page will hold installation problems we've heard about and possible fixes for them. Please send all questions and problems to the ns-users mailing list.

nam-1.11 (released Feb, 2005)

  • Problem:You may have problem building nam-1.11 with gcc3.4.

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

    nam-1.10 (released Jan, 2004)

    nam-1.9 (released 28 February 2003

    • Problem: When installing nam 1.9 on Mac OS X, nam fails to link against zlib (there are undefined symbol errors for _gzclose, _gzopen, _gzread, etc.)

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

    nam-1.0a6 (released Oct. 1998)

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


          1. Download new nam version (> 1.0a5) from ns website.
          2. Delete the line from your nam tracefile.

    • Problem: Tcl source code dump on various platforms, the end of which complains about unknown event "MouseWheel".

      Solution: This is because in macro LIB in nam's Makefile, -L/usr/lib -lz is placed before -ltcl8.0, etc. Thus if there is an older version of libtcl8.0.a or in /usr/lib, nam is messed up. Edit nam Makefile and put that -lz stuff at the end of the LIB macro.

    • Problem: Compiling on HP-UX 10.20, it complains about conflicting types (int8_t) and conflicting function definitions (gethostid).

      Solution: Applying the following patch to config.h:

      --- config.h    1998/10/08 19:17:22     
      +++ config.h    1999/02/18 02:07:36     
      @@ -30,11 +30,11 @@
        * SUCH DAMAGE.
      - * @(#) $Header: /nfs/jade/vint/CVSROOT/www/nam/nam-problems.html,v 1.17 2005/02/07 20:46:51 haldar Exp $ (LBL)
      + * @(#) $Header: /nfs/jade/vint/CVSROOT/www/nam/nam-problems.html,v 1.17 2005/02/07 20:46:51 haldar Exp $ (LBL)
      -#ifndef ns_config_h
      -#define ns_config_h
      +#ifndef nam_config_h
      +#define nam_config_h
       #if defined(sgi) || defined(__bsdi__) || defined(__FreeBSD__) || defined(linux)
      @@ -44,7 +44,7 @@
       /* typedef signed char int8_t breaks under Solaris 2.6.  Shouldn't */
       /* autoconf handle stuff like this?  Shouldn't autoconf generate   */
       /* config.h?  Who knows autoconf well enough to fix this?  --AMC   */
      -#if defined(sun)
      +#if defined(sun) || defined(__hpux)
       typedef unsigned char u_char;
       typedef unsigned short u_short;
      @@ -83,8 +83,10 @@
       int strcasecmp(const char *, const char *);
       clock_t clock(void);
      +#if !defined(__hpux)
       int gethostid(void);
      -#if !defined(_AIX41) && !defined(sun)
      +#if !defined(_AIX41) && !defined(sun) && !defined(__hpux)
       void srandom(int);
       long random(void);
      @@ -200,5 +202,5 @@
       #endif /* WIN32 */
      +#endif /* nam_config_h */


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

      (this message was from nam, but similar things can happen with ns.) Reported 16 Dec 1998 by Raed Sunna.

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

    • Problem: When compiling NAM under Solaris 2.6 I received the following error.
      xwd.c: In function `xwd_Window_Dump':
      xwd.c:279: `sz_' undeclared (first use in this function)
      xwd.c:279: (Each undeclared identifier is reported only once

      This appears to be the result with a problem with configure. For NAM 1.0a5 make the following changes:

      Add this to the file xwd.c as line 92 #define SIZEOF(x)
      Comment out line 59 of the file config.h. /* typedef signed char
      int8_t; */
      Comment out line 45 in /* extern "C" int
      srandom(...); */

    • Problem: Nam can not understand "V -t * -v 1.0a5". We added version infomation into nam trace file, but all nam older than version 1.0a5 can not process it.


          1. Download nam-snapshot from ns website.
          2. Delete the line from your nam tracefile.
    • Problem: namtrace-all causes segmentation fault on Linux and Solaris 2.6. It's caused by sprintf's inability to handle null pointers in those systems.

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

      ---    1998/07/17 22:37:25     
      +++     1998/07/20 18:07:53
      @@ -185,7 +185,7 @@
              hdr_rtp *rh = (hdr_rtp*)p->access(off_rtp_);
              hdr_srm *sh = (hdr_srm*)p->access(off_srm_); 
      -       const char* sname = 0;
      +       const char* sname = "null";
              int t = th->ptype();
              const char* name = pt_names[t];
      @@ -413,7 +413,7 @@
                      hdr_cmn *th = (hdr_cmn*)p->access(off_cmn_);
                      hdr_ip *iph = (hdr_ip*)p->access(off_ip_);
                      hdr_srm *sh = (hdr_srm*)p->access(off_srm_);
      -               const char* sname = 0;   
      +               const char* sname = "null";   
                      int t = th->ptype();
                      const char* name = pt_names[t];


    • Problem: How to convert a ns trace file to nam format?

      Nam tracefile can be created directly from ns simulation. No post-converting is needed in the nam-1.0a4 and after release. Take a look at scripts under ns-2/tcl/ex/ (especially nam-example.tcl) to see how to use nam trace function. Those ns APIs are documented in the ns man page. The most up-to-date information at ns-2 man page included in the distribution. It's ns-2/ns.1. At least it includes all current nam tracing APIs (Assuming you are using ns v2.0b2).

      Here is an example:

      set outputfile [open w] ;# Ordinary trace file
      $ns trace-all $outputfile
      set namfile [open out.nam w]   ;# Nam trace file
      $ns namtrace-all $namfile

    • Problem: Nam gets link errors when building with references to "dlopen" similar functions beginning with dl. (This problem also occurs with ns.)

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

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


    • Problem: Example trace file ex/simple_mcast.nam is out-of-date. An updated version is available here. (This pointer is obsolete. We strongly recommend you use a up-to-date nam release. - Aug 2000)
      Reported Nov 18, 97 by TAN Cheng Lin.
    • Problem: Dropped packet cannot be monitored.
      Solution: A patch for this as well as previously reported bugs is available at
      Reported Nov 18, 97 by Kedarnath Poduri
    • Problem: nam will dump core for traces of some ns test scripts on Digital Unix 4.0.
      Solution: Change the following line in Trace::Trace() (in
      	mintime_ = nextTime();
      	mintime_ = nextTime();
      	now_ = mintime_;
      Reported Nov 15, 97 by Roger "Woja" Kermode
    • Following were reported Nov 13, 97 by Dan Li
      • Problem: In man page, incomplete description of flag -a <attr> for packet events (+,-,h,r,d).
        Solution: It is the packet attribute, and currently used as color id of the packet.
      • Problem: In man page, incomplete description of flag -r <bw> and -D <delay>. They are used in link creation.
        Solution: The former describes link bandwidth, the latter describes the link delay.
    • Problem: Configuration option --with-tclcl was mistaken by --with-TclCL.
      Solution: Use the former temporarily, the latter will be used in the next release.
      Reported by Satish Kumar

Page Last Updated: Jan 24, 2000
Maintained by: John Mehringer