[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a bug in wireless-phy.cc??



Dear ns developer & users:
    
    earlier today, I sent a message about the wierd energy log in ns 
wireless simulation. I thought I found the reason.
In wireless-phy.cc:
In function 
int 
WirelessPhy::sendUp(Packet *p)    

when Pr < RXThreshold, it still set pkt_recvd =1, so it still decrease 
the receiver's power just as successfully receiving does. but based on 
the comments( also our intuition) in the same file, a node only consume 
Pr_ energy when it successfully received a packet.
"  /*
   * Decrease energy if packet successfully received
   */"

so I suggest to add "goto DONE" in if ( Pr < RXThresh_ ) clause as follows:

if (Pr < RXThresh_) {
      /*
       * We can detect, but not successfully receive
       * this packet.
       */

/* suggested fix: should add the following*/

goto DONE;

}


Did I miss something? any comments?

Thanks!
yan