<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I think what you're describing is not RTT, but something like propagation delay from the producer/cache.</div><div><br></div><div>To access tags, you can always use PeekPacketTag to get a copy of the tag, or RemovePacketTag to get tag and remove it (i.e., you want to use this if you want to update the tag/value of the tag).</div><div><br></div><div>As for OnData.   I think the best place is to put it after the line 256 in fw/ndn-forwarding-strategy.cc, just add the condition on `cached' variable, which indicate whether Data was cached or not, as determined by your policy/implementation.</div><div><br></div><div>---</div><div>Alex</div><div><br></div><div><div>On Sep 4, 2013, at 6:57 PM, 陈胜蓝 <<a href="mailto:blindeafer@163.com">blindeafer@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; ">I am sorry for my expression,I make an example:<div>(A)- - - - - -(B)- - - - - -(C)- - - - - -(D) </div><div>there are four nodes, A is consumer, D is producer,B and C are routers.If A send out an interest to request a content M,and D satisfies the interest.M will pass C and B to A.The tag is created and initialized to 0 at producer.</div><div>If node C decide to cache M and store it successfully,it will update the value of tag with the RTT of M.And node B will<span style="line-height: 1.7;"> consult the value to decide whether to cache M.If node B cache M successfully, the value of tag will be update with the RTT at node B.</span><span style="line-height: 1.7;">So the value of the tag always record the latest RTT the lastest time content is cached. </span></div><div><span style="line-height: 1.7;">In my cache policy, node will consult the value of tag to decide whether to cache the content incoming, and will update the value if the content is successfully cached at this node.</span></div><div><span style="line-height: 1.7;">So I wuold like to know how to get the value of the tag in OnData() function and how to insert the value updated into packet before it is send to downstream node to satisfy interests. </span></div><div><span style="line-height: 1.7;"><br></span></div><div><span style="line-height: 1.7;">Thank you.</span></div><div><br><br><br><div></div><div id="divNeteaseMailCard"></div><br>At 2013-09-05 04:05:40,"Alex Afanasyev" <<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>> wrote:<br> <blockquote id="isReplyContent" style="padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid; position: static; z-index: auto; "><div>I'm really sorry, but I'm still confused.  Did you check how FwHopCount tag is implemented?  Is it something similar to what you want, but just different metric?</div><div><br></div><div>Also, why do you want to put RTT metric into the packet, as you client (who generated interest) can always know when it send out Interest packet and after Data packet is received it can calculate RTT for the Interest/Data pair.  Actually, there is already implementation and TraceHelper for that functionality: <a href="http://ndnsim.net/metric.html#application-level-trace-helper">http://ndnsim.net/metric.html#application-level-trace-helper</a></div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Sep 2, 2013, at 6:17 PM, 陈胜蓝 <<a href="mailto:blindeafer@163.com">blindeafer@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; ">I add the RTT tag to data packet,it is created and initialized to 0 at producer.cc.<div>1.When a data packet arrive at a node,I can get the interval R from the time the coresponding interest was send.If the node decide to cache the data packet,and before the data packet was send to satisfy interests in PIT, the node will update the tag with the inteval R.</div><div><br></div><div>2.when a node get a data packet, it will get the value of the RTT tag.</div><div><br></div><div>I don't know how to get the value from data packet and how to add the updated tag  to data packet before it is send to satisfy interests.<br><br><br><br><br><div></div><div></div><br>At 2013-09-03 01:06:16,"Alex Afanasyev" <<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>> wrote:<br> <blockquote id="isReplyContent" style="padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid; position: static; z-index: auto; ">Can you clarify a little bit more on what is your exact problem... I'm a little bit confused.<div><br></div><div>--</div><div>Alex</div><div><br><div><div>On Sep 2, 2013, at 8:10 AM, 陈胜蓝 <<a href="mailto:blindeafer@163.com">blindeafer@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="line-height: 1.7; font-size: 14px; font-family: arial; ">Hi Alex,<div>I create a new tag to record RTT and add it to content packet.It is initialized to 0 by producer. If the node cache the content, it will update the value of the tag with RTT(Simulator::Now() - sendtime),the sendtime = pitEntry->GetOutgoing ().find (inFace)->m_sendTime.</div><div>I create the tag class with Update() function and Get() function to get the value. How to add the tag to origPacket after it is updated before SatisfyPendingInterest (inFace, header, payload, origPacket, pitEntry) in OnData(),and get the value from origPacket in the OnData(),could you give me some hint?</div><div><br></div><div>Regards.</div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span><span><Ondata().txt></span><span><rtt-tag.txt></span></blockquote></div></div></blockquote></div></div></blockquote></div></blockquote></div></div></blockquote></div><br></body></html>