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.

46.1.7 Agent TracingAgent trace events are used to visualize protocol st<strong>at</strong>e. <strong>The</strong>y are always associ<strong>at</strong>ed with nodes. An agent event has a name,which is a unique identifier of the agent. An agent is shown as a square with its name i<strong>ns</strong>ide, <strong>and</strong> a line link the square to itsassoci<strong>at</strong>ed nodeAgent events are co<strong>ns</strong>tructed using the following form<strong>at</strong>:a -t -n -s Because in <strong>ns</strong>, agents may be detached from nodes, an agent may be deleted in nam with:a -t -n -s -XFor example, the following nam trace line cre<strong>at</strong>es an agent named srm(5) associ<strong>at</strong>ed with node 5 <strong>at</strong> time 0:a -t 0.00000000000000000 -s 5 -n srm(5)46.1.8 Variable TracingTo visualize st<strong>at</strong>e variables associ<strong>at</strong>ed with a protocol agent, we use fe<strong>at</strong>ure trace events. Currently we allow a fe<strong>at</strong>ure todisplay a simple variable, i.e., a variable with a single value. Notice th<strong>at</strong> the value is simple tre<strong>at</strong>ed as a string (without whitespace). Every fe<strong>at</strong>ure is required to be associ<strong>at</strong>ed with an agent. <strong>The</strong>n, it can be added or modified <strong>at</strong> any time after its agentis cre<strong>at</strong>ed. <strong>The</strong> trace line to cre<strong>at</strong>e a fe<strong>at</strong>ure is:f -t -s -a -T -n -v -o Flag isv for a simple variablel for a lists for a stopped timeru for an up-counting timerd for a down-counting timer.However, only v is implemented in <strong>ns</strong>. Flag -v gives the new value of the variable. Variable values are simpleASCII strings obeying the TCL string quoting conventio<strong>ns</strong>. List values obey the TCL list conventio<strong>ns</strong>. Timer values areASCII numeric. Flag -o gives the previous value of the variable. This is used in backward anim<strong>at</strong>ion.Here is an example of a simple fe<strong>at</strong>ure event:f -t 0.00000000000000000 -s 1 -n C1_ -a srm(1) -v 2.25000 -T vFe<strong>at</strong>ures may be deleted using:f -t -a -n -o -X46.1.9 Executing Tcl Procedures <strong>and</strong> External Code from within Nam<strong>The</strong>re is a special event th<strong>at</strong> can be put in a nam tracefile which allows us to run different tcl procedures. This event isrepresented by event type v.v -t -e 400

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

Saved successfully!

Ooh no, something went wrong!