[Tinyos Core WG] packet metadata vs. upcall

Philip Levis pal at cs.stanford.edu
Wed May 28 19:22:59 PDT 2008


Vlado raised a problem with the current movement towards SendNotifier.  
Until now, the focus on TinyOS packet operations has been through the  
metadata field; a sender can configure a packet before it calls  
send(). This has the advantage that the radio does not need to make an  
upcall. It has the disadvantage that this state needs to be maintained  
on a per-packet rather than per-stack basis. For the CC2420, for  
example, the metadata is currently 9 bytes, almost 33% the size of the  
payload.

The real problem is trying to do this both ways. Moving half-heartedly  
towards SendNotifier means that you still need to maintain the  
metadata. So the stack has to issue upcalls and also maintain metadata.

The one issue with the purely metadata approach is there isn't a clear  
way to set defaults. There is no easy way for the radio stack to know  
if a sender has called control path commands. Packet.clear()  could  
initialize metadata values to hidden "unset" values, which the stack  
could then interpret to use defaults, but this is problematic if the  
range of the value is the complete data type range. With a callback,  
however, the stack has the ability to configure defaults *before*  
asking the sender to configure them.

Some part of me likes the callback method better as a mechanism, as it  
saves us from metadata bloat.  Commands can be used to set defaults,  
limiting the state to a single set of parameters. That being said, the  
callback is a reversal of the current approach.

What are people's thoughts?

Phil


More information about the Tinyos-2.0wg mailing list