[Tinyos Core WG] Issues with getPayload

Philip Levis pal at cs.stanford.edu
Fri Nov 2 18:22:07 PDT 2007


So here's the problem. I have a link estimation layer called LEEP  
with a fixed length header and variable length footer.

[ hdr | payload | footer ... ]

The header has bits which say how long the footer is. When a user  
calls send, this layer sees how much space the payload leaves, and  
fills in a footer to take up that space. No problems there.

The question is whether the size of the header should be respected  
when you call getPayload(). This is an issue when you receive a  
packet and then want to forward it with a larger payload. LEEP is  
going to fill in new footer fields. But when you call getPayload(),  
does it take the size of the received footer into account? If it  
does, then you can't send a larger payload unless there's some way to  
clear the header.

We talked about it on the call, and saw two solutions:

1) getPayload() does not consider the packet's footer size.   
getPayload() is "can I send a payload this big" not "can I get a  
payload this big without blowing away lower layer fields in the  
existing format."

2) getPayload() does consider the footer size. This requires that you  
call clear() before putting in a new payload.

Phil




More information about the Tinyos-2.0wg mailing list