[Tinyos-help] DTOSH_DATA_LENGTH
Nahr Elk
nahrelk at gmail.com
Tue May 19 13:41:04 PDT 2009
Interesting answers,
Thanks for All.
Best regards,
Nahr Elk
2009/5/19 Michael Schippling <schip at santafe.edu>
> I don't know who will toss cookies if you try to send a message
> that is larger the the defined size. The sender may behave rationally
> and reject the premise, or the receiver could overrun it's buffer
> and crash. YMMV.
> MS
>
>
> Alban Hessler wrote:
>
>> Most of the radio chips have a 128 bytes buffer, which means that the
>> whole packet cannot be bigger than 128 bytes, overhead included.
>>
>> So, if you want to send a large packet, you need a transport layer
>> which will fragment it before sending it over the air. AFAIK, there is
>> no core tinyos library doing that, but there have been contributions
>> from universities doing that. So your 256 bytes datagram would
>> actually be 3 or more packets over the air.
>>
>> Also, the DATA_LENGTH cannot be 128, but has to be less, because of
>> the overhead of the layers below your app, look on the mailing list
>> for the maximum value.
>>
>> Remember that you will experience larger packet loss if you increase
>> the payload size, and there is a point where it's better to send two
>> small packets than one big.
>>
>> HTH,
>>
>> Alban
>>
>> 2009/5/19 Nahr Elk <nahrelk at gmail.com>:
>>
>>> Hi!
>>> Ok, so the best solution in my case (the worst case for RAM) is by
>>> compiling
>>> my app with the largest DATA_LENGTH (128) and then it will change the
>>> data
>>> payload size if necessary.
>>>
>>> But, please just a clarification:
>>>
>>> Suppose that I kept DATA_LENGTH to the default value and the payload size
>>> will not exceed this value
>>> However at the Send command level I do something like that :
>>> send(0, MyMsg, 256);
>>>
>>> Could this be done??
>>>
>>>
>>> Thank you!
>>>
>>> Best regards,
>>> Nahr Elk
>>>
>>> 2009/5/19 Razvan Musaloiu-E. <razvanm at cs.jhu.edu>
>>>
>>>> Hi!
>>>>
>>>> On Mon, 18 May 2009, Michael Schippling wrote:
>>>>
>>>> Unless Things Have Changed(TM) in T2, only the length number of bytes
>>>>> is transmitted -- at least over the radio -- so you're not losing
>>>>> bandwidth with a larger DATA_LENGTH. You do waste RAM because buffers
>>>>> are allocated for the max size, which is one reason it's a compile
>>>>> time setting, but that may not matter in your system.
>>>>>
>>>>> Thinks haven't changed so what Michael said is correct. The only
>>>> penalty
>>>> is in RAM. The packets in the air have variable length based on the
>>>> length
>>>> specified in AMSend.send:
>>>>
>>>> command error_t send(am_addr_t addr, message_t* msg, uint8_t
>>>> len);
>>>>
>>>> --
>>>> Razvan ME
>>>>
>>>> Nahr Elk wrote:
>>>>>
>>>>>> Hi,
>>>>>> Thank you Razvan,
>>>>>> I would like to change the data payload size dynamically according to
>>>>>> my
>>>>>> application exigences.
>>>>>> And I am not so convinced that setPayloadLength(message_t* msg,
>>>>>> uint8_t
>>>>>> len) is the right solution
>>>>>>
>>>>>> Best regards,
>>>>>> Nahr Elk
>>>>>>
>>>>>> 2009/5/18 Razvan Musaloiu-E. <razvanm at cs.jhu.edu>
>>>>>>
>>>>>> Hi!
>>>>>>
>>>>>>
>>>>>> On Sun, 17 May 2009, Nahr Elk wrote:
>>>>>>
>>>>>> Hi
>>>>>> Is there any way to change DTOSH_DATA_LENGTH at run time instead
>>>>>> of at
>>>>>> compile time ? :)
>>>>>>
>>>>>>
>>>>>> No. TOSH_DATA_LENGTH is used to allocate the size of the data field
>>>>>> from message_t (types/message.h) so you cannot alter it at during
>>>>>> runtime. May I ask why do you want to do this?
>>>>>>
>>>>>> --
>>>>>> Razvan ME
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> Tinyos-help at millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>>
>> _______________________________________________
>> Tinyos-help mailing list
>> Tinyos-help at millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090519/8c2081d0/attachment.htm
More information about the Tinyos-help
mailing list