typedef nx_struct cc2420_header_t {
  nxle_uint8_t length;
  nxle_uint16_t fcf;
  nxle_uint8_t dsn;
  nxle_uint16_t destpan;
  nxle_uint16_t dest;
  nxle_uint16_t src;

  /** I-Frame 6LowPAN interoperability byte */
#ifdef CC2420_IFRAME_TYPE
  nxle_uint8_t network;
#endif

#ifndef TINYOS_IP
  nxle_uint8_t type;
#endif
} cc2420_header_t;

802.15.4 Frame Format:
PPDU = SHR(4B preamble + 1B SFD) + PHR (1B len) + PSDU
PSDU = MPDU = MHR(9B) + MSDU + FCS(2B)
MHR = FCF(2B) + DSN(1B) + PANID(2B) + DST(2B) + SRC(2B) (PANID(2B) + DST(2B)
+ SRC(2B) belongs to address info under 802.15.4 Standard)

nxle_uint8_t length = PHR
  nxle_uint16_t fcf; = MHR.FCF
  nxle_uint8_t dsn; = MHR.DSN
  nxle_uint16_t destpan; = MHR.PANID
  nxle_uint16_t dest; = MHR.DST
  nxle_uint16_t src;   = MHR.SRC

nxle_uint8_t network; = TEP125 6lowpan
nxle_uint8_t type; = TEP125 AM Type

>>As for 802.15.4 Standard, nxle_uint8_t length is PHR. So the MAC Layer
header is >>11bytes(including nxle_uint8_t network and type)
>Could you please give me some reference on why this is true?

I guess the length field should be equal to PHR field in PHY Layer. Because
cc2420_header_t is 12bytes, so MAC Layer header should be 12-1=11bytes.

>>The maxium MAC Layer frame is 127bytes.
>Where can I find this? I notice it is said to be 128 bytes in one of the 
>archived
email<https://www.millennium.berkeley.edu/pipermail/tinyos-help/2007-July/026346.html>
s.
PHR is 1byte, but 1bit is reserved.
You can refer to 802.15.4 Standard Page 45(I use 802.15.4-2006.pdf):
The Frame Length field is 7 bits in length and specifies the total number of
octets contained in the PSDU (i.e., PHY payload). It is a value between 0
and aMaxPHYPacketSize (see 6.4).
aMaxPHYPacketSize - The maximum PSDU size (in octets) the PHY shall be able
to receive. - 127

Regards,
Lizhao

2009/5/10 Xiaohui Liu <[email protected]>

> What is the relationship between a Tinyos message_t type message,
> particularly CC2420 message, and 802.15.4 MAC Layer frame? (TinyOS
> 802.15.4 Frames specification can be found 
> here<http://www.tinyos.net/tinyos-2.x/doc/html/tep125.html>
> .)
>
> As for 802.15.4 Standard, nxle_uint8_t length is PHR. So the MAC Layer
> header is 11bytes(including nxle_uint8_t network and type)
> Could you please give me some reference on why this is true?
>
> The maxium MAC Layer frame is 127bytes.
> Where can I find this? I notice it is said to be 128 bytes in one of the 
> archived
> email<https://www.millennium.berkeley.edu/pipermail/tinyos-help/2007-July/026346.html>
> s.
>
>
> Thanks for your patience.
>
> -Xiaohui
>
>
>
>
> On Sat, May 9, 2009 at 8:01 AM, Lizhao You <[email protected]>wrote:
>
>> I think the maxium TOSH_DATA_LENGTH should be 114bytes(including 114).
>>
>> For Telosb, the header_t definition:
>> platfom_message.h
>> typedef union message_header {
>>   cc2420_header_t cc2420;
>>   serial_header_t serial;
>> } message_header_t;
>>
>> CC2420.h
>> typedef nx_struct cc2420_header_t {
>>   nxle_uint8_t length;
>>   nxle_uint16_t fcf;
>>   nxle_uint8_t dsn;
>>   nxle_uint16_t destpan;
>>   nxle_uint16_t dest;
>>   nxle_uint16_t src;
>>
>>   /** I-Frame 6LowPAN interoperability byte */
>> #ifdef CC2420_IFRAME_TYPE
>>   nxle_uint8_t network;
>> #endif
>>
>> #ifndef TINYOS_IP
>>   nxle_uint8_t type;
>> #endif
>>
>> } cc2420_header_t;
>>
>> cc2420_header_t is 12byte. As for 802.15.4 Standard, nxle_uint8_t length
>> is PHR. So the MAC Layer header is 11bytes(including nxle_uint8_t network
>> and type) , then FCS is 2bytes. The maxium MAC Layer frame is 127bytes. So
>> TOSH_DATA_LENGTH should not exceed 127-11-2=114byte.
>>
>> I had tested the maxium TOSH_DATA_LENGTH, and remembered that it is
>> 114bytes, although in Makefile we can set TOSH_DATA_LENGTH more than 114. I
>> run BlinkToRadio and changed BlinkToRadio.h payload, then run BaseStation to
>> see whether it works.
>>
>> Regards,
>> Lizhao
>>
>> 2009/5/9 Eric Decker <[email protected]>
>>
>> The maximum that TOSH_DATA_LENGTH can be set do is determined by the
>>> CC2420 h/w.
>>>
>>> eric
>>>
>>>
>>> On Fri, May 8, 2009 at 9:09 PM, Xiaohui Liu <[email protected]> wrote:
>>>
>>>> Hi Eric,
>>>>
>>>> Thanks for your help. The same is found in 
>>>> TOSROOT\tos\chips\cc2420\CC2420.h.
>>>> However, neither of them talks about the max value that can be set. Any
>>>> thought?
>>>> -Xiaohui
>>>>
>>>> On Fri, May 8, 2009 at 11:32 PM, Eric Decker <[email protected]> wrote:
>>>>
>>>>> You have to start the search from the top level of the T2 tree.
>>>>>
>>>>> I get the following as well as others:
>>>>>
>>>>> ./tos/types/message.h:6:#ifndef TOSH_DATA_LENGTH
>>>>> ./tos/types/message.h:7:#define TOSH_DATA_LENGTH 28
>>>>>
>>>>>
>>>>> eric
>>>>>
>>>>>
>>>>>
>>>>> On Fri, May 8, 2009 at 8:07 PM, Xiaohui Liu <[email protected]> wrote:
>>>>>
>>>>>> I appreciate your help and I find TOSH_DATA_LENGTH in 
>>>>>> TOSROOT\tos\chips\cc2420\CC2420.h,
>>>>>> but it contains no info on the maximum of TOSH_DATA_LENGTH. Any other
>>>>>> idea? Thanks.
>>>>>> -Xiaohui
>>>>>>
>>>>>> On Fri, May 8, 2009 at 7:05 PM, Eric Decker <[email protected]>wrote:
>>>>>>
>>>>>>> The best way is to look in the source code.
>>>>>>> I use something like
>>>>>>>
>>>>>>> find . -exec grep -nHi tosh_data_length \{\} \;
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, May 8, 2009 at 3:42 PM, Xiaohui Liu <[email protected]>wrote:
>>>>>>>
>>>>>>>> Hi all,
>>>>>>>> What is the max value of TOSH_DATA_LENGTH I can set in TinyOS 2.x?
>>>>>>>> I find some previous discussions on this, but it seems to me no 
>>>>>>>> conclusion
>>>>>>>> has been reached. Also do I find it in TEP 111, which does not clarify 
>>>>>>>> this
>>>>>>>> neither. Thanks for your availability.
>>>>>>>>
>>>>>>>> -Xiaohui
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Tinyos-help mailing list
>>>>>>>> [email protected]
>>>>>>>>
>>>>>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Eric B. Decker
>>>>>>> Senior (over 50 :-) Researcher
>>>>>>> Autonomous Systems Lab
>>>>>>> Jack Baskin School of Engineering
>>>>>>> UCSC
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Eric B. Decker
>>>>> Senior (over 50 :-) Researcher
>>>>> Autonomous Systems Lab
>>>>> Jack Baskin School of Engineering
>>>>> UCSC
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Eric B. Decker
>>> Senior (over 50 :-) Researcher
>>> Autonomous Systems Lab
>>> Jack Baskin School of Engineering
>>> UCSC
>>>
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>>
>> --
>> Lizhao You
>> Undergraduate Student of GPS Group
>> Department of Computer Science and Technology, Nanjing University
>> Nanjing, Jiangsu, 210093 China PR.
>>
>
>


-- 
Lizhao You
Undergraduate Student of GPS Group
Department of Computer Science and Technology, Nanjing University
Nanjing, Jiangsu, 210093 China PR.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to