On 7/6/06, Philip Levis <[EMAIL PROTECTED]> wrote:

On Jul 5, 2006, at 8:08 PM, Liu Haibin wrote:

> Hi,
>
> I'm confused with the following code from enqueue_receive_event
> from UscGainInterfaerenceModelC.nc. The condition at label 1 is
> understandable. It checks if the power is large enough against the
> destination noise plus all the other transmissions to the
> destination. What I don't understand is the condition label 2. Why
> does it need to compare the power with the max destination noise?
> What is the variable "receiving" used for?
>
> I have very limited knowledge in the area of radio transmission. I
> guess I missed some very basic concepts here. Could someone help me
> out with it?
>
>
> Regards,
> Haibin
>
>
>     // If I'm off, I never receive the packet, but I need to keep
> track of
>     // it in case I turn on and someone else starts sending me a
> weaker
>     // packet. So I don't set receiving to 1, but I keep track of
>     // the signal strength.
>     if (!sim_mote_is_on(sim_node())) {
>       dbg("Gain", "Lost packet from %i due to %i being off\n",
> source, sim_node());
>       rcv->lost = 1;
>     }
>     else {
> 1    if ((sigStr + sim_gain_sensitivity()) >= power) {
>          dbg("Gain", "Lost packet from %i due to power being too
> low (%f >= %f)\n", source, sigStr, power);
>          rcv->lost = 1;
>       }
>       else if (receiving) {
>          dbg("Gain", "Lost packet from %i due to being in the midst
> of a reception.\n", source);
>          rcv->lost = 1;
>       }
> 2    if (power >= sim_gain_noise_mean(sim_node()) +
> sim_gain_noise_range(sim_node())) {
>          receiving = 1;
>       }
>     }
>

The receiving variable keeps track of whether the node thinks it is
receiving a packet or whether it is searching for packet preambles.
You can only start receiving a packet if you are in the latter state
(unless you can recover preambles during packets, which no existing
radio stack besides Kamin's prototype mica2 stack can do).

The second case is for when the packet is strong enough to hear. If
the signal strength is not above noise, then you do not detect the
preamble.

Actually, this looks like a very optimistic approach. The logic
should be more like:

if (signal is below noise + threshold) {
   lose packet
}
else if (already receiving) {
   lose packet
}
else {
   receive packet;
}

Note that the current approach resamples the noise but does not
consider the signal threshold. In the end, the difference between the
two is pretty small (the number of preambles you detect of packets
that might be lost), but still, I should look at it carefully.

Phil


In a real situation, the mote can capture a stronger transmission while it's detecting the preamble of a weaker transmission (when it passes the preamble and starts to receive the weaker transmission, it cannot capture the stronger one. But Kamin's prototype can).

But I went through the Tossim 2.x UscGainInterferenceModelC.nc. I found that even during the detection of a preamble of a weaker transmission, a stronger transmission cannot be accepted. Because the weaker transmission will set the "receiving = 1" even during its detection of preamble. However, the stronger will still corrupt the weaker transmission so in the end, neither of the two transmissions passes through.

Am I right on it? Or did I miss something?



Regards,
Haibin 


_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to