Hi Philip,
 
Thanks for your comments. Regarding the problems:
 
1. Yes, currently node 0 sends an ACK directly to the source. I am now working on a multihop propagation for ACK. But, if DRIP has this functionality, then it makes things easier for me.
 
2. I noticed that you are returning FAIL when you call SendMsg.send() in the Send.send() command too. So, dont you have the same problem here? Could you explain what would exactly happen if it returns FAIL?
 
3. Yes, I was thinking about this problem too. So, instead of calling SendMsg.send() in the receive handler, I can probably call it in mForward() with a if (TOS_LOCAL_ADDRESS == 0) condition.
 
If DRIP address all these issues, then I would be glad to use DRIP. Do you have a documentation on it and where can I obtain the files for DRIP. I have installed tinyos-1.x in my Linux machine. So, do I have to upgrade or can I just copy those files?
 
Thanks,
Yogesh.


Philip Levis <[EMAIL PROTECTED]> wrote:

On Jan 4, 2005, at 11:30 PM, Yogesh Iyer wrote:

> Hi,
>  
> I was able to implement end-to-end acknowledgements in TOSSIM by
> making the following changes in the ReceiveMsg.receive() function of
> the MultiHopEngineM.nc routing module. Guess I wont be needing BCast
> or Drip now. Thanks for your time and suggestions.
>  
> if (pMsg->addr == TOS_LOCAL_ADDRESS) { // Addressed to all nodes
>     if ((signal
> Intercept.intercept[id](pMsg,&pMHMsg->data[0],PayloadLen)) == SUCCESS)
> {
>          if ((TOS_LOCAL_ADDRESS != 0) && (pMHMsg->sourceaddr != 0)) {
> // All nodes except node 0 forward packets and only when the source
> address is not node 0
>                pMsg = mForward(pMsg,id);
>          }
>          else if (TOS_LOCAL_ADDRESS == 0) { // If packet is
> received by node 0, it will call the SendMsg.send() function with the
> source node as the destination address
>                pMHMsg->sourceaddr = TOS_LOCAL_ADDRESS;
>                if (call SendMsg.send[id](pMHMsg->originaddr,
> pMsg->length,pMsg) !=SUCCESS) {
>                      return FAIL;
>                }
>          }
>     }
> }
>

This ! may seem to work in simple cases, but is very fragile and buggy.
Drip is a much better approach. Three problems:

1) Calling SendMsg.send assumes that the node you wish to send the ACK
to is a single hop away (SendMsg is a single-hop AM send). Therefore,
while it's technically end-to-end, it's only so when you're talking
about a single hop path.

2) Returning FAIL when the signaler expects a TOS_MsgPtr is a recipe
for disaster. You're passing a null pointer. The first time the
SendMsg.send fails, bad things will happen.

3) More generally, calling SendMsg.send in a receive handler is an
insidious bug. The issue is that the buffer you're passing to send is
also the buffer you're returning to the radio stack to receive the next
packet in. This means that if the node receives a new packet before it
sends (e.g., the channel was busy with the next packet so the MAC
backed off), then the reception will overwrite the buffer you ! want to
send. You'll send what you just received, rather than what you want to
send.

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'


Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
_______________________________________________
Tinyos-users mailing list
[email protected]
http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users

Reply via email to