[Ns-developers] [ns-2.33] bug in WirelessPhyExt::sendUp()

antoine.trux@nokia.com antoine.trux at nokia.com
Thu Jun 5 03:54:31 PDT 2008


Hi,

My colleagues and I have found a weird behaviour in wireless-phyExt.cc.

Lines 219 to 233 of that file (function WirelessPhyExt::sendUp()) read:

		case SEARCHING:
			if ((Pr >= CSThresh_) && (powerMonitor->SINR(Pr)
					>=
modulation_table[BasicModulationScheme_].SINR_ratio)) {
				power_RX = Pr;
				pkt_RX=p->copy();
				setState(PreRXing);
				preRX_Timer.sched(HeaderDuration_); //
preamble and PCLP header
				break;
			} else {
				//case 1
				//pkt_recvd =discard(p,Pr,"");
				pkt_recvd =discard(p, Pr, "SXB");
				setState(SEARCHING);
				break;
			}

Why are received packets discarded if `Pr' is smaller than `CSThresh_'?
That is, why does this code not read instead:

		case SEARCHING:
			if (powerMonitor->SINR(Pr) >=
modulation_table[BasicModulationScheme_].SINR_ratio) {
		[otherwise same as above]

?

As far as we know, the carrier-sense threshold is used when sending (the
medium should be idle before a node can transmit a frame), not for
deciding the success or failure of the reception of a frame.

Also, I am not sure why the state is set to `SEARCHING' in the else
branch of the above code, since the state is already `SEARCHING'.

Antoine Trux
Nokia Research Center



More information about the Ns-developers mailing list