[net2-wg] Proposal for dissemination structure and interfaces
Philip Levis
pal at cs.stanford.edu
Mon Dec 19 09:19:04 PST 2005
On Dec 18, 2005, at 11:55 PM, henri dubois-ferriere wrote:
> i'm not sure that future platforms are "10k and up". I think some may
> be 10k and down - there are quite a few MCUs (MSP430 included) which
> have low-RAM versions (512b, 1k, 2k) that are significantly cheaper.
> If/when any platform is ever produced at large scale, those MCUs (or
> single-chip solutions) are not unlikely to make a comeback.
>
> On 19/12/05, Kyle Jamieson <jamieson at mit.edu> wrote:
>>>> How about simplifying this down to
>>>>
>>>> interface DisseminationValue <t> {
>>>> event void changed(const t*);
>>>> }
>>>
>>> The one issue here is that it requires the component above to store
>>> the pointer in its frame. So let's say there's some configuration
>>> parameter. Every component that wants to be able to access the
>>> configuration parameter needs to store a pointer to it, which wastes
>>> RAM.
>>
>> So therefore this design choice would cost 1 byte per component. I'd
>> argue that with current and future low-end mote designs at 10 Kbytes
>> of RAM and up, we should be preferring simplicity over optimizing
>> every
>> ounce of RAM space?
I think that, ultimately, Kyle is right: motes will have more RAM.
But that's not going to happen anytime soon. The MSP430 F1611 has the
most RAM of any microcontroller (10K), and motes represent 40% of
their sales, which in TI's books is peanuts. As far as I understand
it, in the near-medium term (e.g., 2 years), there's currently no
significant market pressure for MCU manufacturers to include more RAM.
Pointers are 2 bytes. The cost isn't two bytes per component. It's
two bytes per reference to the value. E.g., if six components all
want to know when value X changes, that will cost twelve bytes. While
I'll agree that one event is simpler than one command and one event,
I'm not convinced that the user of the interface is any simpler:
module ModuleP {
uint8_t* maxRetries;
uint8_t currentRetry;
event void MaxRetry.changed(uint8_t* newVal) {maxRetries = newVal;}
event void AMSend.sendDone(message_t* msg, error_t err) {
currentRetry++;
if (!call PacketAcknowledgments.wasAcked(msg)) {
if (currentRetry <= *maxRetries) {
// put back on queue
}
else {
// signal failure
}
}
}
}
versus:
module ModuleP {
uint8_t currentRetry;
event void MaxRetry.changed(uint8_t* newVal) {}
event void AMSend.sendDone(message_t* msg, error_t err) {
currentRetry++;
if (!call PacketAcknowledgments.wasAcked(msg)) {
if (currentRetry <= *(call MaxRetry.get())) {
// put back on queue
}
else {
// signal failure
}
}
}
}
The basic difference is whether you dereference maxRetries or
dereference a call to MaxRetry.get().
Phil
-------
"We shall not cease from exploration
And the end of all our exploring
Will be to arrive where we started
And know the place for the first time."
- T. S. Eliot, 'Little Gidding'
More information about the net2-wg
mailing list