[Tinyos-devel] AMSend.cancel command clarification request

Andreas Koepke koepke at tkn.tu-berlin.de
Wed Mar 14 02:02:42 PDT 2007


Hi all,

while writing a counter based flood protocol (CBF) for T2, I stumbled
upon a problem with the cancel command.

I use the cancel command quite frequently in the CBF -- it is so
convenient to forward a message pretty immediatly and cancel it once
enough duplicates were received.

Trouble appeared, when I started to use the AMQueueImplP -- and more
than one sending component: it somehow silently ignored messages that
were put into the queue while a message was currently "in transmission".

This is when I noticed a difference in the interpretation of the
AMSend.cancel command. From the interface description I concluded that a
successful cancel must result in a sendDone(ECANCEL) event. However,
judging from AMQueueImplP a successful call to cancel must prevent a
sendDone event to appear. Actually that is how I interpret the meaning
code, it does not always work this way. The code as it is written will
result in a retransmission of the just canceled message -- and hence a
sendDone(SUCCESS) event, if the canceling client is also the currently
transmitting client. If it is not, the sendDone event is suppressed -
somehow contradicting the documentation of the AMSend.send command.

The two interpretions (AMSend.cancel -> suppression of sendDone,
AMSend.cancel -> sendDone(ECANCEL)) are contradicting, so I think we are
 in trouble here.

I personally prefer the sendDone(ECANCEL) interpretation, as canceling a
message from inside a MAC is easier to do in split phase fashion.

Best regards, Andreas



More information about the Tinyos-devel mailing list