Hi

I was simulating and found this weird behavior while using Tossim. I am sending 
AM packets from node 1 to node 0, which is requested for acks, and checking 
whether the ack is returned. When there is bidirectional connection between the 
nodes, acks are received. If there is no connection between the nodes, acks are 
not received. However, if there is a link 1->0, but not 0->1, acks are still 
received. (See code output below)

I assumed that the ack messages sent by 0 to 1 would be lost and no ack 
received. Is this a bug, is it likely I've done something wrong or 
misunderstanding tinyos's/tossim ack behavior?

Code:   
                components ActiveMessageC;
        DataSendP.PacketAcknowledgements -> ActiveMessageC;
        DataSendP.Packet -> AMSenderC;

        sendDone(...) { 
        if (call PacketAcknowledgements.wasAcked(msg)) 
                dbg("DATAACK", "Message was acked\n");
                else dbg("DATAACK", "Message was NOT acked\n")
        }
        
        AMSend.send(…) {
        call Packet.clear(msg);
        if(call PacketAcknowledgements.requestAck(msg) !=SUCCESS) {
                dbg("DATAACK", "Could not set ack bit in msg\n");
        }

When both links are active acks are received like intended:
DEBUG (1): AM: Sending packet (id=132, len=18) to 0
DEBUG (0): Received active message (0x10f78367b) of type 132 and length 18 for 
me @ 0:5:0.336532667.
...
DEBUG (1): Message was acked

When removing both links, no ack is received:
radio.remove(1,0)
radio.remove(0,1)
DEBUG (1): AM: Sending packet (id=132, len=18) to 0
DEBUG (1): Message was NOT acked

However, when removing the link from node 0 to node 1 I assumed no ack would be 
returned
radio.remove(0,1)
DEBUG (1): AM: Sending packet (id=132, len=18) to 0
DEBUG (0): Received active message (0x1046d567b) of type 132 and length 18 for 
me @ 0:5:0.336532667.
...
DEBUG (1): Message was acked

Regards
Jan Egil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to