Hi!

On Sun, 27 Sep 2009, bo zhang wrote:

> Hi.
> I'm simulating multi-hop application in tossim.
> I requested acknowledgement using PacketAcknowledgements for each packet
> sent. I found some strange things happened in the simulation. For some
> packets,
> (1). the sender gets negative ACK even though the packets was successfully
> received;

This is the case when the ACK is lost.

> OR
> (2). the sender gets positive ACK even though the packet was lost.
>

In real life you can get and ACK if there is other 802.15.4 traffic 
because the sequence number is only 8 bits and there are no addresses 
fields. Figure 23 from page 42 from here shows this:
        http://focus.ti.com/lit/ds/symlink/cc2420.pdf

> Then, I found this:
> http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2009-January/037710.html
> which basically said that such false acknowledgement may happen at a chance
> of .1% in TOSSIM.
>
> Can anyone let me know how to ensure correct acknowledgement, since my
> application cannot proceed without reliable acknowledgement. In my code, I
> checked the acknowledgement as follow:
>
>  event void AMSend.sendDone(message_t* bufPtr, error_t err) {
>
>      if(call PacketAcknowledgements.wasAcked(bufPtr)) {
>        // go to next step
>      }
>      else
>       // resend the message at application level
>  }
>

You should probably use application level acks. :-) You can also disable 
the .1% but doing this will make the simulation less real. The code that 
produce the false acks is in tos/lib/CpmModelC.nc and the lines are the 
following:

    341        if (RandomUniform() < 0.001) {
    342          dbg("CpmModelC,SNRLoss", "Packet was technically lost, but 
TOSSIM introduces an ack false positive rate.\n");
    343          if (mine->ack && signal Model.shouldAck(mine->msg)) {
    344            dbg_clear("CpmModelC", " scheduling ack.\n");
    345            sim_gain_schedule_ack(mine->source, sim_time() + 1, mine);
    346          }
    347          else { // Otherwise free the receive_message_t*
    348            free_receive_message(mine);
    349          }

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

Reply via email to