next up previous contents index
Next: 21.2 Library support and Up: 21.1 Trace Support Previous: 21.1 Trace Support

   
21.1.1 OTcl Helper Functions

The following helper functions may be used within simulation scripts to help in attaching trace elements (see tcl/lib/ns-lib.tcl); they are instance procedures of the class Simulator:



The []create-trace procedure is used to create a new Trace object of the appropriate kind and attach an Tcl I/O channel to it (typically a file handle). The src
_
and dst
_
fields are are used by the underlying C++ object for producing the trace output file so that trace output can include the node addresses defining the endpoints of the link which is being traced. Note that they are not used for matching. Specifically, these values in no way relate to the packet header src and dst fields, which are also displayed when tracing. See the description of the Trace class belowSectionsec:tracemoncplus.

The trace-queue function enables Enque, Deque, and Drop tracing on the link between nodes n1 and n2. The Link trace procedure is described belowSectionsec:libexam.

The monitor-queue function is constructed similarly to trace-queue. By calling the link's init-monitor procedure, it arranges for the creation of objects (SnoopQueue and QueueMonitor objects) which can, in turn, be used to ascertain time-aggregated queue statistics.

The drop-trace function provides a way to specify a Queue's drop target without having a direct handle of the queue.


next up previous contents index
Next: 21.2 Library support and Up: 21.1 Trace Support Previous: 21.1 Trace Support

2000-08-24