next up previous contents index
Next: 21.1 Trace Support Up: 3. Support Previous: 20.6 Commands at a

   
21. Trace and Monitoring Support

The procedures and functions described in this chapter can be found in trace.{cc, h}, tcl/lib/ns-trace.tcl, queue-monitor.{cc, h}, tcl/lib/ns-link.tcl, packet.h, flowmon.cc, and classifier-hash.cc.

There are a number of ways of collecting output or trace data on a simulation. Generally, trace data is either displayed directly during execution of the simulation, or (more commonly) stored in a file to be post-processed and analyzed. There are two primary but distinct types of monitoring capabilities currently supported by the simulator. The first, called traces, record each individual packet as it arrives, departs, or is dropped at a link or queue. Trace objects are configured into a simulation as nodes in the network topology, usually with a Tcl ``Channel'' object hooked to them, representing the destination of collected data (typically a trace file in the current directory). The other types of objects, called monitors, record counts of various interesting quantities such as packet and byte arrivals, departures, etc. Monitors can monitor counts associated with all packets, or on a per-flow basis using a flow monitor belowSectionsec:flowmon.

To support traces, there is a special common header included in each packet (this format is defined in packet.h as hdr_cmn). It presently includes a unique identifier on each packet, a packet type field (set by agents when they generate packets), a packet size field (in bytes, used to determine the transmission time for packets), and an interface label (used for computing multicast distribution trees).

Monitors are supported by a separate set of objects that are created and inserted into the network topology around queues. They provide a place where arrival statistics and times are gathered and make use of the Integrator../ns-2/integrator.h (Section 20.3) to compute statistics over time intervals.



 
next up previous contents index
Next: 21.1 Trace Support Up: 3. Support Previous: 20.6 Commands at a

2000-08-24