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

Lajos lajos1 at gmail.com
Wed Jun 18 13:53:06 PDT 2008


Hi,

I think this code is ok. I haven't read the standard for a while, but
I think what this code is doing is implementing a simplified form of
the energy detect threshold i.e the received signal must be above a
certain power to trigger the start of the packet receipt. It is not
enough to have a good enough SINR, the absolute signal power must also
be above a threshold. In this case I think the authors are just using
the same threshold for energy detect as for carrier sense, this could
in fact be how it was intended, but I'd need to read the standard
carefully.

In the original wireless phy a receive threshold was used I believe,
which is missing here, hence it is only ensured that the rx power is
above the cs-thresh.

Lajos



original message below:
------------------------------


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