[Tinyos-help] Message Formats for Basestation
Philip Levis
pal at cs.stanford.edu
Mon Jan 1 17:57:31 PST 2007
On Jan 1, 2007, at 4:15 PM, Mr. Jonathan A. Gomez wrote:
> (Sorry for sending it to you again, and not to the list. I wasn't
> attending to the return
> address!)
>
> Thank you for the prompt response!
>
> I'd like to make sure I understood properly, and I have some
> further questions.
>
>
>> There are two separate forms of dispatch at play here, which is
>> probably the source of the confusion. AM ids specify the format of
>> the AM packet payload, while serial ids specify the format of the
>> AM packet.
>
>
> Suppose this were the packet being sent over serial:
>
> 7e 44 01 00 ff ff 04 22 06 00 00 01 00 95 91 7e
>
> Then the 44 is the serial protocol type, indicating a request for
> acknowledgment,
Yes.
> the leftmost
> instance of 00 is the id of the format of the AM packet,
Yes. 00 is the platform independent serial format.
> and the 06 is the am_id_t payload
> format identifier?
Yes.
> This payload format identifier is also the "AM packet type" you
> mention
> below?
Yes. But don't confuse format identifier with am_id_t; that's
generally what it means, but it doesn't always. The active message
type or AM packet type is the AM id. This specifies a protocol.
Different protocols can have different packet formats, but do not
always do so.
>
>> Applications define AM handlers. That is, they define which AM
>> packet types they receive and send by wiring to particular AM ids.
>> The AM id therefore specifies what the format of the AM payload is.
>
> Makes sense. I'd like to know more about how BaseStation does
> this, since that is the
> application in which I vest a particular interest?
>
> Does BaseStation ever filter out packets based on am_id_t, that is,
> the payload format, or does
> it merely pass them all on, no matter which ids are employed? This
> latter seems to make the
> most intuitive sense.
It doesn't filter; that would defeat its purpose. I'd suggest reading
the code.
>
> Also, I'm looking into the code, but I'd like to ask too, if I
> may: Does the
> SerialActiveMessage mechanism always send platform independent
> messages? And it is always
> capable of receiving them?
>
Yes. I'm not sure what "always capable of receiving them" means. If
you instantiate a SerialAMReceiverC, then it will be signaled when
the node receives AM packets that:
1) follow the framing and format of the serial layer
2) follow the serial AM packet format
3) have the right AM id
> [SNIP]
>
>> This additional layer of dispatch exists to remove the TinyOS 1.x
>> problem of having platform-specific serial packet formats. The
>> default packet format, which is platform independent, is a basic AM
>> packet. But if you want to send/receive platform-specific packets
>> (e.g., see all the fields of a CC2420-specific AM packet), you can
>> still do so.
>
> Hmmm... Depending again on the apps, or is it more transparent?
If you wanted to send/receive packet formats besides the platform
independent serial one, then you need to write components which do
so. You would instantiate different sender/receiver components. I
think there's some degree of support for 802.15.4, but as far as I
know no-one has ever used it, so it might not work very well.
Phil
More information about the Tinyos-help
mailing list