On May 9, 2007, at 1:39 AM, Muhammad Azhar wrote:

Hi,

Thanks for the explanation. I have another question wrt CTP. I would like to send the node id of the parent as part of the message structure (mviz_msg) of the MViz application. However, CTP doesn't seem to provide a command where I can get the am_addr_t of the direct parent, based on my understanding of CtpForwardingEngineP. Would calling UnicastNameFreeRouting.nextHop() return the same value as that in CtpForwardingEngineP if I were to call this in the MViz application itself, since I'd like to get the node id of the direct parent? If it doesn't, what would I have to do to get the node id of the parent?

You want to put the parent as an end-to-end field (set by the packet originator, passes unmodified to the root) or as a single-hop field?

If the latter, it's the destination address of the packet. If the former, your intuition is correct. Take a look at sendTask() in CtpForwardingEngineP:

    else {
      error_t subsendResult;
      fe_queue_entry_t* qe = call SendQueue.head();
      uint8_t payloadLen = call SubPacket.payloadLength(qe->msg);
      am_addr_t dest = call UnicastNameFreeRouting.nextHop();
      uint16_t gradient;


The one issue is that if you set the field when MViz calls Send.send (), then it is possible that it changes between this call and the packet actually being sent. I.e., there might be other packets in the queue which are sent first. So this could happen:

Set next hop in packet P to UnicastNameFreeRouting.nextHop() to N1
forward packet A
forward packet B
try to forward packet C, not acknowledged
try to forward packet C, not acknowledged
try to forward packet C, not acknowledged
try to forward packet C, not acknowledged
try to forward packet C, not acknowledged
CTP changes next hop to N2
forward packet C
send packet P to N2, but its field says the next hop is N1

So if you want a general sense of the network topology, then your approach will work fine; CTP doesn't churn much. If you want a perfectly accurate picture of the topology for a packet, then you need to set the field in the same place that you set the next hop address (in sendTask() in CtpForwardingEngineP).

Phil


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

Reply via email to