[ns] Help: Received Power Level of a Packet at MAC Layer in MANETs

Ahmad R Shahid arshahid@yahoo.com
Mon Apr 15 13:45:02 2002


well the power level (or energy level) is that of the
node and not of the packet.

yet the easiest way to get the energy level is to add
the following code:

double myEnergy_;
Node *thisNode;

thisNode =
Node::get_node_by_address((nsaddr_t)myaddr_);

if(thisNode->energy_model()){
    myEnergy_ = thisNode->energy_model()->energy();
}

Thanks,

Ahmad
--- Ankit Agarwal <ankit_agarwal@yahoo.com> wrote:
> 
> Hi All,
> 
> I am new to NS2 and am currently running simulations
> of wireless mobile ad hoc networks (MANETs) based on
> the 802.11 MAC protocol.
> 
> I would like to get a trace of the received power
> level of every packet at the MAC layer (802.11) of
> each node.
> 
> I tried turning the MAC layer tracing on but that
> doesn't trace the received power level.
> 
> Can someone suggest some way for me to get this
> trace?
> I looked at the code and I can see that the 802.11
> layer is aware of the received power level of a
> packet
> but I can't think of a way to trace the value.
> 
> Any help or suggestions would be appreciated.
> 
> Thanks,
> Ankit.
> 
> 
> =====
> "Tough times do not last, only tough people do."
> "A ship in the harbor is safe...but thats not what
> ships were made for."
> "Do, or do not. There is no try." (Yoda)
> Ankit Agarwal
> 5000 Oak Street, #815, Kansas City, MO 64112.
> Telephone: (816) 531-4186. Email:
> ankit_agarwal@yahoo.com
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/