12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 46Nam TraceNam is a Tcl/Tk based anim<strong>at</strong>ion tool th<strong>at</strong> is used to visualize the <strong>ns</strong> simul<strong>at</strong>io<strong>ns</strong> <strong>and</strong> real world packet trace d<strong>at</strong>a. <strong>The</strong> firststep to use nam is to produce a nam trace file. <strong>The</strong> nam trace file should contain topology inform<strong>at</strong>ion like nodes, links,queues, node connectivity etc as well as packet trace inform<strong>at</strong>ion. In this chapter we shall describe the nam trace form<strong>at</strong> <strong>and</strong>simple <strong>ns</strong> comm<strong>and</strong>s/APIs th<strong>at</strong> can be used to produce topology configur<strong>at</strong>io<strong>ns</strong> <strong>and</strong> control anim<strong>at</strong>ion in nam.<strong>The</strong> underlying design co<strong>ns</strong>traints for nam were th<strong>at</strong> it is able to h<strong>and</strong>le large amounts of trace d<strong>at</strong>a <strong>and</strong> th<strong>at</strong> its anim<strong>at</strong>ionprimitives be adaptable so th<strong>at</strong> it may be used in different types of network visualiz<strong>at</strong>ion. As a result, internally nam readsinform<strong>at</strong>ion from a file <strong>and</strong> keeps only a minimum amount of anim<strong>at</strong>ion event inform<strong>at</strong>ion in memory. Its anim<strong>at</strong>ion eventhas a fairly simple <strong>and</strong> co<strong>ns</strong>istent structure so th<strong>at</strong> it can many different visualiz<strong>at</strong>ion situ<strong>at</strong>io<strong>ns</strong>.46.1 Nam Trace Form<strong>at</strong><strong>The</strong> C++ class Trace used for <strong>ns</strong> tracing is used for nam tracing as well. Description of this class may be found under section26.3. <strong>The</strong> method Trace::form<strong>at</strong>() defines nam form<strong>at</strong> used in nam trace files which are used by nam for visualiz<strong>at</strong>ion of <strong>ns</strong>simul<strong>at</strong>io<strong>ns</strong>. Trace class method Trace::form<strong>at</strong>() is described in section 26.4 of chapter 26. If the macro NAM_TRACE hasbeen defined (by default it is defined in trace.h), then the following code is executed as part of the Trace::form<strong>at</strong>() function:if (namChan_ != 0)sprintf(nwrk_,"%c -t "TIME_FORMAT" -s %d -d %d -p %s -e %d -c %d-i %d -a %d -x %s.%s %s.%s %d %s %s",tt,Scheduler::i<strong>ns</strong>tance().clock(),s,d,name,th->size(),iph->flowid(),th->uid(),iph->flowid(),src_nodeaddr,src_portaddr,dst_nodeaddr,395

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!