[Tinyos Core WG] storage

Philip Levis pal at cs.stanford.edu
Fri Sep 15 17:25:40 PDT 2006


With the disappearance of mount(), there's no real startup call to  
most storage abstractions. On one hand, this is clean. On the other,  
it can cause some issues. Typically, the way this is handled is the  
first operation does whatever setup that needs to be done. E.g., in  
the at45db implementation of ConfigStorage, the first write after a  
commit (or boot) makes a copy of the storage.

One issue this causes is huge differences in timing that can lead to  
weird bugs. For example, Kannan was running a simple networking test:

for src in range (0, n):
   for dest in range (0, n):
     if (src != dest):
       for i in range (0, 200):
         src.send_packet_to(dest, i)
         log(i, was_acked())

receive(src, i):
   log(src, i)

So nodes send bursts of packets to each other, the source logs  
whether the packet was acked, the dest logs all received packets.

The problem he ran into was this: the first node a node transmitted  
to worked fine; the second (or later) wouldn't log any received  
packets. The reason was pretty simple, but took a while to find out.  
The first call to log() has a very large latency. On the first  
transmission, both nodes share the latency: the source for its log,  
the destination for its log. For the second node, though, the source  
doesn't have the latency (sends packets fast), while the destination  
does (drops them all).

The only solution to this problem is to write a dummy record to the  
log on startup. Should there be a command that lets you prepare the  
log without writing? Should this exist in every storage abstraction?  
Without significant buffering (and in this case, it would be hundreds  
of packets)...

Phil



More information about the Tinyos-2.0wg mailing list