[Tinyos-devel] BaseStationP bug

David Moss dmm at rincon.com
Tue Feb 19 12:46:57 PST 2008


Absolutely.  That was the kind of bug-caused-by-bug-fix I was hoping someone
with a keen eye would catch before we commit this to the baseline :)

I've attached an updated version.  As Phil pointed out, that memset() should
probably switch over to Packet.clear(), if/when the desired behavior of
clear() is ready.

Thanks,
-David


-----Original Message-----
From: Chieh-Jan (Mike) Liang [mailto:cliang4 at cs.jhu.edu] 
Sent: Tuesday, February 19, 2008 1:36 PM
To: David Moss
Cc: tinyos-devel at millennium.berkeley.edu
Subject: RE: [Tinyos-devel] BaseStationP bug

Hi David,

Then, should UartAMPacket.setSource(...) comes after memset(...)?

Thank you

Mike

On Tue, 19 Feb 2008, David Moss wrote:

> Hi Mike -
>
> The location where the header is cleared is just after the source address,
> length, and id of that packet are extracted into local variables.  These
> local variables are then used in the next send() command and put back into
> the packet by the communication driver itself.
>
> -David
>
>
>
>
> -----Original Message-----
> From: Chieh-Jan (Mike) Liang [mailto:cliang4 at cs.jhu.edu]
> Sent: Monday, February 18, 2008 5:28 PM
> To: David Moss
> Cc: tinyos-devel at millennium.berkeley.edu
> Subject: Re: [Tinyos-devel] BaseStationP bug
>
> Hi David,
>
> One question about your fix. Before the radio packet is injected to
> serial, you erase the header. If I am not mistaken, after you do this, you
> need to set the packet source address back. This is for the "transparent"
> bridging.
>
> Thank you
>
> Mike
>
> On Fri, 15 Feb 2008, David Moss wrote:
>
>> The BaseStation application moves received packets directly into the send
>> branch of the serial or radio stacks without clearing the header.
> Residual
>> header information is left over from the opposite communication driver,
>> which can cause send/receive problems elsewhere.
>>
>>
>>
>> The case I'm seeing here is a message is received through the serial
> stack,
>> causing the message's header to be filled in like a serial header.  The
>> message is moved directly into the radio stack without clearing the
> header.
>> Some bytes of a radio packet header, like FCF, are not edited by the
radio
>> stack because they are assumed to contain pre-configured settings.  The
> FCF
>> byte is therefore corrupted by the bytes left over from the serial stack.
>> This causes a node receiving the packet with the corrupted FCF byte to
>> filter out and drop the packet.
>>
>>
>>
>> The solution is for the BaseStation application to clear each message_t's
>> header before injecting the message into the send branch of the opposite
>> communication driver.  I have attached my version of BaseStationP, but I
>> would recommend the owner(s) of this application take a look before
>> committing the fixes back to tinyos-2.x/apps/BaseStation.
>>
>>
>>
>> -David
>>
>>
>>
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BaseStationP.nc
Type: application/octet-stream
Size: 7297 bytes
Desc: not available
Url : https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080219/47299a05/BaseStationP.obj


More information about the Tinyos-devel mailing list