you can refer to the file mac/wireless-phy.cc, including a function 
--WirelessPhy::sendUp(Packet *p)  in which there are a few lines as follows:
  
 if(propagation_)
  {
  s.stamp((MobileNode*)node(), ant_, 0, lambda_);
  Pr = propagation_->Pr(&p->txinfo_, &s, this);
   
 /******my code*****/
   struct hdr_ip *ih = HDR_IP(p);
  fprintf(fp,"%f %d->%d[%d->%d] %e=====%s\n",Scheduler::instance().clock(),
   p->txinfo_.getNode()->nodeid(),node()->nodeid(),ih->saddr(),ih->daddr(),Pr,
   Pr<CSThresh_ ? "detect fail": ((Pr<RXThresh_ ? "recv error" : "success 
recv")));
 .......
 }
      The receiver calculate the power with which the packet are received  
according to the attenuation algorithm in ns2 simulator, so the @Pr = 
propagation_->Pr(&p->txinfo_, &s, this);@
 maybe help us to judge the sender's signal strength influenced by the sender's 
hardware and software environment.
  
     You could tell me if you had a better resolution.

Reply via email to