[ns] How to add a new parameter to the trace class (trace support for a new variable)

Carlos Alberto Quiroz-Perez cquiroz at engr.uvic.ca
Mon Sep 15 16:46:45 PDT 2008


Hello NS-2 users,

I need your kindly help in extending the ns-2 tracing support for a new
variable, the antenna power (Pt_), in the trace format output file.

I created a new protocol to control the antenna power of my node. So,
the variable that is changing is Pt_. This protocol is a cross layer
protocol that is implemented in the MAC and PHY layers. Now then, to show
and plot the variations of Pt_ (antenna power), I need to extract Pt_
values from PHY and graph it. The problem is, I'm finding difficulties in
extracting Pt_ from PHY.

An option could be to add Pt_ as a new field variable in either the old
ns-2 trace formatting, or the new cmu trace formatting.

How can I do that?, What might be the steps to approach that solution?,
and what better idea could be in this case?

Lately I had problems in a possible solution, in extracting the Pt_
values directly from the PHY layer by creating a new file to record the
Pt_ output, but it didn't work out.

I appreciate your help towards my matter!


                    Carlos Q.






More information about the Ns-users mailing list