Hi!

On Tue, 18 Aug 2009, Rémi Villé wrote:

...

I was looking at "event void Model.sendDone(message_t* msg, error_t
result){...}" in  the tos/lib/tossim/TossimActiveMessageC.nc file, and I
observed that the ack field was never set to TRUE for the sink (so no ack
properly received).

I'm a little confused. What do you mean by "looking"? The .sendDone from tos/lib/tossim/TossimActiveMessageC.nc looks like this:

    95    event void Model.sendDone(message_t* msg, error_t result) {
    96      signal AMSend.sendDone[call AMPacket.type(msg)](msg, result);
    97    }

As you can see this is a pass through. The operations on the ack field are don in CpmModelC.

I've just test in AMSend.send and ack field always at FALSE for the sink, so
it's like if in TOSSIM no acks are simulated for the sink, at this layer.

How about on the non-sink nodes? :D

Anyway, I understand that acks are only simulated on the sender side.

So the situation we have is this:

    S --- data + ack request ---> R
    S <---------- ack ----------- R

As you can see in the sim_gain_ack_handle you know if R wanted to ack the packet but there was too much noise on the S that the ack did not make it.

So the best I can do now to count the number of transmissions of one node
with TOSSIM is to increment a counter when .sendDone is signaled. Always in
.sendDone, if ack field is TRUE, I can increment an other counter of "number
of ack sent by other motes", if it's FALSE I can increment on other counter
of "number of ack didn't received because the initial message didn't reach
the receiver or the ack didn't reach the initial sender". Maybe I miss
someting, but the latter counter is not very accurate to count the total
number of transmissions.

You mentioned 3 counter so 'latter' is a little confusing. :P The 3 counters are:

 c1 = number of data packets sent
 c2 = number of received acks
 c3 = number of acks not received

The number of packets that were in the air is bigger than c1 + c2. If all the data packets request for acks then c3 = c1 - c2. The proper way to increment it on the else of the if from lines 184-186 from CpmModelC.nc:

  ...
  184        if (shouldAckReceive(snr)) {
  185          signal Model.acked(outgoing);
  186        }
  187      }
  188      free_receive_message((receive_message_t*)evt->data);
  189    }

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

Reply via email to