next up previous contents index
Next: 22.1.1 Packet Traces Up: 22. Nam Trace Previous: 22. Nam Trace

   
22.1 Nam Trace format

The C++ class Trace used for ns tracing is used for nam tracing as well. Description of this class may be found under section 21.3. The method Trace::format() defines nam format used in nam trace files which are used by nam for visualization of ns simulations. Trace class method Trace::format() is described in section 21.4 of chapter 21. If the macro NAM_TRACE has been defined (by default it is defined in trace.h), then the following code is executed as part of the Trace::format() 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::instance().clock(),
                        s,
                        d,
                        name,
                        th-\>size(),
                        iph-\>flowid(),
                        th-\>uid(),
                        iph-\>flowid(),
                        src_nodeaddr,
                        src_portaddr,
                        dst_nodeaddr,
                        dst_portaddr,
                        seqno,flags,sname);

Every line in a nam trace file follows this format:

<event-type> -t <time> ...
Depending on the event type, there are different flags following the time flag.

In the following we describe nam trace event format in 7 classes: packet, node, node mark, link/queue, agent, feature, and miscellaneous.



 


2000-08-24