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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Trace/HopTrace/EnqueTrace/DequeTrace/DropTrace/RecvSnoopQueue/InSnoopQueue/OutSnoopQueue/DropSnoopQueue/EDroptrace a “hop” (XXX wh<strong>at</strong> does this mean exactly; it is not really used XXX)a packet arrival (usually <strong>at</strong> a queue)a packet departure (usually <strong>at</strong> a queue)packet drop (packet delivered to drop-target)packet receive event <strong>at</strong> the destin<strong>at</strong>ion node of a linkon input, collect a time/size sample (pass packet on)on output, collect a time/size sample (pass packet on)on drop, collect a time/size sample (pass packet on)on an "early" drop, collect a time/size sample (pass packet on)Objects of the following types are added in the simul<strong>at</strong>ion <strong>and</strong> a referenced by the objects listed above. <strong>The</strong>y are used toaggreg<strong>at</strong>e st<strong>at</strong>istics collected by the SnoopQueue objects:QueueMonitorQueueMonitor/EDQueueMonitor/ED/FlowmonQueueMonitor/ED/FlowQueueMonitor/Comp<strong>at</strong>receive <strong>and</strong> aggreg<strong>at</strong>e collected samples from snoopersqueue-monitor capable of distinguishing between “early” <strong>and</strong> st<strong>and</strong>ard packet dropsper-flow st<strong>at</strong>istics monitor (manager)per-flow st<strong>at</strong>istics containera replacement for a st<strong>and</strong>ard QueueMonitor when <strong>ns</strong> v1 comp<strong>at</strong>ibility is in use26.1.1 OTcl Helper Functio<strong>ns</strong><strong>The</strong> following helper functio<strong>ns</strong> may be used within simul<strong>at</strong>ion scripts to help in <strong>at</strong>taching trace elements (see ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>lib.tcl);they are i<strong>ns</strong>tance procedures of the class Simul<strong>at</strong>or:flush-trace {}cre<strong>at</strong>e-trace { type file src dst }trace-queue { n1 n2 file }trace-callback{ <strong>ns</strong> comm<strong>and</strong> }monitor-queue { n1 n2 }drop-trace { n1 n2 trace }flush buffers for all trace objects in simul<strong>at</strong>ioncre<strong>at</strong>e a trace object of type type between the given src <strong>and</strong> destnodes. If file is non-null, it is interpreted as a Tcl channel <strong>and</strong> is<strong>at</strong>tached to the newly-cre<strong>at</strong>ed trace object. <strong>The</strong> procedure retur<strong>ns</strong>the h<strong>and</strong>le to the newly cre<strong>at</strong>ed trace object.arrange for tracing on the link between nodes n1 <strong>and</strong> n2. This functioncalls cre<strong>at</strong>e-trace, so the same rules apply with respect to the fileargument.arranges to call comm<strong>and</strong> when a line is to be traced. <strong>The</strong> proceduretre<strong>at</strong>s comm<strong>and</strong> as a string <strong>and</strong> evalu<strong>at</strong>es it for every line traced. See~<strong>ns</strong>/tcl/ex/callback_demo.tcl for additional details on usage.this function calls the init-monitor function on the link betweennodes n1 <strong>and</strong> n2.the given trace object is made the drop-target of the queue associ<strong>at</strong>edwith the link between nodes n1 <strong>and</strong> n2.<strong>The</strong> cre<strong>at</strong>e-trace{} procedure is used to cre<strong>at</strong>e a new Trace object of the appropri<strong>at</strong>e kind <strong>and</strong> <strong>at</strong>tach an Tcl I/O channelto it (typically a file h<strong>and</strong>le). <strong>The</strong> src_ <strong>and</strong> dst_ fields are are used by the underlying C++ object for producing the traceoutput file so th<strong>at</strong> trace output can include the node addresses defining the endpoints of the link which is being traced. Noteth<strong>at</strong> they are not used for m<strong>at</strong>ching. Specifically, these values in no way rel<strong>at</strong>e to the packet header src <strong>and</strong> dst fields, whichare also displayed when tracing. See the description of the Trace class below (Section 26.3).<strong>The</strong> trace-queue function enables Enque, Deque, <strong>and</strong> Drop tracing on the link between nodes n1 <strong>and</strong> n2. <strong>The</strong> Linktrace procedure is described below (Section 26.2).231

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

Saved successfully!

Ooh no, something went wrong!