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?
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?
Regards
Islam
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help