Hello list,

I'm currently working on a special-purpose derivate of CTP and therefore 
read all the source code to get an overview. One point that is totally 
unclear to me is in CtpForwardingEngineP (most recent CVS release).
It says (line 439):

       // Once we are here, we have decided to send the packet.
       if (call SentCache.lookup(qe->msg)) {
         call CollectionDebug.logEvent(NET_C_FE_DUPLICATE_CACHE_AT_SEND);
         call SendQueue.dequeue();
        if (call MessagePool.put(qe->msg) != SUCCESS)
          call CollectionDebug.logEvent(NET_C_FE_PUT_MSGPOOL_ERR);
        if (call QEntryPool.put(qe) != SUCCESS)
          call CollectionDebug.logEvent(NET_C_FE_PUT_QEPOOL_ERR);
         post sendTask();
         return;
       }

OK, so it should *stop sending* and drop the next packet, in the case 
that this packet (i.e. something very similar...) has already been sent 
before. That's what I think...

Unfortunately, my opinion collides with the comment "Once we are here, 
we have decided to send the packet." and the implementation of the cache 
itself.

As stated in LruCtpMsgCacheP, the result of lookup is: "if key [packet] 
is in cache returns the index (offset by first), otherwise returns count 
[of enqueued packets]".
So... The packet is dropped *everytime*, except that is is the first one 
in the sent cache or the cache is empty? What does this position imply 
for the packet, except that it is the oldest one that I can remember?

I'm very sure that I missed something important, as this implementation 
looks senseless to me ATM. Please help me!

Thank you,
Oliver
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to