2010/3/11 Islam Hegazy <[email protected]>:
> Hi all,
>
> 1) Regarding the snoop function in CtpForwardingEngineP.nc
>
>
> message_t* SubSnoop.Receive(message_t* msg, void *payload, uint8_t len)
>
> {
>
> am_addr_t proximalSrc = call AMPacket.source(msg);
>
>
>
> // Check for the pull bit (P) [TEP123] and act accordingly. This
>
> // check is made for all packets, not just ones addressed to us.
>
> if (call CtpPacket.option(msg, CTP_OPT_PULL))
>
> call CtpInfo.triggerRouteUpdate();
>
>
>
> call CtpInfo.setNeighborCongested(proximalSrc, call
> CtpPacket.option(msg, CTP_OPT_ECN));
>
> return signal Snoop.receive[call CtpPacket.getType(msg)](msg, payload +
> sizeof(ctp_data_header_t), len - sizeof(ctp_data_header_t));
>
> }
>
>
> I don't understand the logic of this function and why does set the
> congestion bit when it overhears a message?
It should not. The current implementation only sets it, does not use
ECN bit, which is why this was not a problem in terms of protocol
performance or correctness.
> 2) Regarding the Intercept function in CtpForwardingEngineP.nc
>
> In the function SubReceive.receive() when a message is received it is
> checked to see if it reached the root or reached a node on the routing path.
> But the following code in the function is confusing me:
>
> if (duplicate)
>
> {
>
> call CollectionDebug.logEvent(NET_C_FE_DUPLICATE_QUEUE);
>
> return msg;
>
> }
>
> // If I'm the root, signal receive.
>
> else if (call RootControl.isRoot())
>
> return signal Receive.receive[collectid](msg, call
> Packet.getPayload(msg, call Packet.payloadLength(msg)), call
> Packet.payloadLength(msg));
>
> // I'm on the routing path and Intercept indicates that I should not
> forward the packet.
>
> else if (!signal Intercept.forward[collectid](msg, call
> Packet.getPayload(msg, call Packet.payloadLength(msg)), call
> Packet.payloadLength(msg)))
>
> return msg;
>
> else
>
> {
>
> dbg("Route", "Forwarding packet from %hu.\n",
> getHeader(msg)->origin);
>
> return forward(msg);
>
> }
>
>
> What does the third if statement mean? Intercept forward does nothing except
> returning true.
>
>
> default event bool Intercept.forward[collection_id_t collectid](message_t*
> msg, void* payload, uint8_t len)
>
> {
>
> return TRUE;
>
> }
>
>
> Basically, I understand that snoop and intercept in CTP do not modify any
> entries in the tables. Am I right?
That is the default implementation of Intercept. It can be redefined
by a collection application that wants to modify the packets that are
being forwarded in which case the user-defined Intercept.forward
function will decide to return TRUE or FALSE.
Snoop.receive allows an applications to receive packets that were
being forwarded on paths not traversing the current node.
To use Intercept or Snoop, you need to wire these interfaces to your
application. CollectionC exports these interfaces.
- om_p
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help