<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi huyao,</div><div><br></div><div>Sure, go ahead and add the counter.  I will let you know when I generalize forwarding-strategy-specific storage in FIBs.</div><div><br></div><div>To get a unique face ID of the face, you can use GetId () method of Face class (<a href="http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_face.html#af65b04aa5f75e24c9e73e0d60bf397a2">http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_face.html#af65b04aa5f75e24c9e73e0d60bf397a2</a>).  Just in case, this ID is just a unique numerical ID of the face on the specific node and doesn't imply anything else (e.g., face with ID 2 doesn't mean there are 3 faces on the node).</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Mar 16, 2013, at 4:42 AM, yao hu <<a href="mailto:huyao0107@gmail.com">huyao0107@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Alex,<div><br><div>Thanks for your advice. I think I would like to store the counter into <span style="background-color:rgb(252,252,252);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap">fib:Entry, is that ok? Another question is how to get </span><span class="o" style="font-family:arial,helvetica,sans-serif;line-height:14px">numerical </span><span style="background-color:rgb(252,252,252);font-family:monospace,fixed;line-height:13px;white-space:pre-wrap">face information (</span><span style="font-family:arial,helvetica,sans-serif;line-height:14px">0, 1, 2...</span><span class="o" style="font-family:arial,helvetica,sans-serif;line-height:14px"> </span><span style="font-family:arial,helvetica,sans-serif;line-height:14px">which is convenient for storage</span><span style="font-family:arial,helvetica,sans-serif;line-height:14px">) from </span><span class="n" style="font-family:arial,helvetica,sans-serif;line-height:14px">Ptr</span><span class="o" style="font-family:arial,helvetica,sans-serif;line-height:14px"><</span><span class="n" style="font-family:arial,helvetica,sans-serif;line-height:14px">Face</span><span class="o" style="font-family:arial,helvetica,sans-serif;line-height:14px">> type</span><span style="font-family:arial,helvetica,sans-serif;line-height:14px">?</span></div>
<div><span class="o" style="line-height:14px"><font face="arial, helvetica, sans-serif"><br></font></span></div><div><span class="o" style="line-height:14px"><font face="arial, helvetica, sans-serif">Regards,</font></span></div>
<div><span class="o" style="line-height:14px"><font face="arial, helvetica, sans-serif">huyao</font></span></div><div><br><br><div class="gmail_quote">2013/3/16 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi huyao,<div><br></div><div>You should not need to have multiple face entries, if you just want to record number of times you want to forward interest on a specific face.  Ideally, this information should be stored somewhere in FaceMetric (model/fib/ndn-fib-entry.h/cc).  Unfortunately, there is no "extensible" way to add new parameter to FaceMetric, but it is on my list of future modifications (the implementation plan is to have some sort of "tags" with any custom info that you can attach to a FIB entry or specific Face in FIB entry).   </div>
<div><br></div><div>For now, you can directly add the counter to FaceMetric class and add appropriate accessor methods.  And then use this methods to track either number of times a face was "added" to FIB.</div>
<div><br></div><div>---</div><div>Alex</div><div><div class="h5"><br><div><div>On Mar 15, 2013, at 12:20 PM, yao hu <<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>> wrote:</div><br>
<blockquote type="cite">Hi Alex,<div><br></div><div>Yes, that is the usual thing for fib entry. What I think is If I use Add or AddRoute call once to add one ndn route, the face will be recorded once. If I use the same call twice, the face will be recorded twice... Then I would like I could modify or adjust the the current forwarding strategy to forward the related interests from the specific face according to the `times` this face appears in the fib entry. Is there any possibility to do such a thing in the current ndnsim?</div>

<div><br></div><div>Thanks very much!</div><div><br></div><div>Regards,</div><div>huyao</div><div>   </div><div><br><div class="gmail_quote">
2013/3/16 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div style="word-wrap:break-word"><div>Hi huyao,</div><div><br></div><div>PIT also has a limited API to lookup (only using Interests and ContentObjects).  So, probably this part is also should be extended, but just pure prefix-based lookup should be used cautiously.</div>


<div><br></div><div>For your second question.  What is your intended need for the same face associated with the FIB entry more than once?  Can you give a specific example?  For me it is fundamental that FIB entry has only one reference to a specific face (AddRoute call "adding" the same face will "rerrange" this face based on the specified metric).  The forwarding strategy can "re-use" the same face many times, if it feels that is appropriate. </div>


<div><br></div><div>---</div><div>Alex</div><div><br><div><div>On Mar 15, 2013, at 10:48 AM, yao hu <<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>> wrote:</div><br><blockquote type="cite">


Hi Alex,<div><br></div><div>Thanks for your clarification. I have understood what you said. It was my misunderstanding.</div><div><br></div><div>Yes. I looked into the ndnsim API and felt a little curious that why FIB does not have a lookup functionality like PIT. I really appreciate if you can provide this functionality. Thanks very much!</div>



<div><br></div><div>Besides, regarding the fib structure, I have one more question. In the default fib structure, one specific face (like face 1) in one fib entry appears just once. If I use Add() or AddRoute() to add a same ndn route twice or more, face 1 in this fib entry is still only one. My question is, is there a possibility or a way to record the `twice` or more? A very direct thought is could I store one specific face twice or more in one fib entry? Or are there any other ways to do such a behavior?</div>



<div><br></div><div>Thanks for your answer in advance!</div><div><br></div><div>Regards,</div><div>huyao</div><div> <br><br><div class="gmail_quote">2013/3/16 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi huyao,</div><div><br></div>fib::Entry object associated with exactly one prefix, so RemoveFace method on fib::Entry will not have impact on any other entries.<div>



<br></div><div>Let me show an example:</div><div><br></div><div># step one: find a FIB entry for the prefix associated with Interest</div><div>Ptr<fib::Entry> entry = fib->LongestPrefixMatch (interest);</div><div>



<br></div><div># remove a specific face</div><div>entry->RemoveFace (face_to_remove);</div><div><br></div><div>---</div><div><br></div><div>This will not impact any other FIB entries.</div><div><br></div><div>I just realized that the current FIB interface doesn't provide direct way to do lookup just using Name (=NameComponents).  But it would be trivial to add this functionality, as underlying data structures fully support that.  Let me know if you need it. (Alternatively, you can also enumerate all FIB entries using Begin/End/Next methods and find the one you need, but it can be too inefficient.)</div>



<div><br></div><div>---</div><div>Alex</div><div><div><br></div><div><div><div>On Mar 15, 2013, at 1:33 AM, yao hu <<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>> wrote:</div>
<br><blockquote type="cite">Hi Alex,<div><br></div><div>Thanks for your explanation!</div><div><br></div><div>I am sorry I still have the perplexity. I saw that <span style="white-space:pre-wrap">fib::Entry-></span><span style="white-space:pre-wrap">RemoveFace call just has one parameter (</span><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)">const Ptr< </span><a href="http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_face.html" style="color:rgb(104,104,104);font-weight:bold;text-decoration:none;font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px" target="_blank">Face</a><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)"> > &face) without relation to some specific prefix, so I guess if I want to delete one specific face from one specific prefix, it will have the same impact to other prefixes which also have the face. </span></div>




<div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)"><br></span></div><div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)">My intention is to delete one specific face from a specific prefix, while any other prefix still retains the face if  it has. Is it feasible in the current ndnsim? If not, how do I do to implement such a functionality? Or my understanding for this issue has some error?</span></div>




<div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)"><br></span></div><div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)">Regards,</span></div>




<div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)">huyao</span></div><div><span style="font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;line-height:15px;background-color:rgb(250,250,250)"><br>




</span></div><div><br><div class="gmail_quote">2013/3/15 Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>My small correction :). I meant that it is forwarding strategy job to pick a particular face from FIB entry.<br>





<br>---<div>Alex</div></div><div><div><br>On Mar 14, 2013, at 7:55 PM, Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>> wrote:<br><br></div>
<blockquote type="cite"><div><div>Hi huyao,</div><div><br></div><div>You are right, for the single prefix there will be only one FIB entry created and it is forwarding strategy job to pick a particular one to forward an Interest in this prefix.</div>





<div><br></div><div>There is an interface in fib::Entry to remove a specific face from s specific FIB entry.  You can also check recent conversation <span style="font-family:'.HelveticaNeueUI';font-size:15px;line-height:19px;white-space:nowrap"><a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000242.html" target="_blank">http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000242.html</a> with more details about that.</span></div>





<div><span style="font-family:'.HelveticaNeueUI';font-size:15px;line-height:19px;white-space:nowrap"><br></span></div><div><br></div><div>---<div>Alex</div></div><div><br>On Mar 14, 2013, at 7:28 PM, yao hu <<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>> wrote:<br>





<br></div><blockquote type="cite">a supplement.. If so, is there a way to delete just some face like face 0 from the fib entry with the prefix /data without deleting face 1?<div><br></div><div>Thanks for your reply!</div>





<div><br></div><div><br><div class="gmail_quote">
2013/3/15 yao hu <span dir="ltr"><<a href="mailto:huyao0107@gmail.com" target="_blank">huyao0107@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






Dear ndnsimers,<div><br></div><div>Assume that there is an existing fib entry with the prefix /data, face 0 in some specific node. Now by using the function Add() or AddRoute(), a new fib entry will be added with the same prefix /data, but with the different face 1. So I wonder in ndnsim, they are counted as two fib entries in FIB or just seemed as one. For my understanding, the answer is the latter. Here, in Fib class, <font face="arial, helvetica, sans-serif"><a href="http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_fib.html#a93a184d9fdc1ace4ea82647c5834ff9c" style="font-weight:bold;text-decoration:none;line-height:15px" target="_blank">GetSize</a><span style="line-height:15px;background-color:rgb(250,250,250)"> () still equals to 1. Am I right?</span> </font></div>







<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Regards,</font></div><div><font face="arial, helvetica, sans-serif">huyao</font></div>
</blockquote></div><br></div>
</blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>ndnSIM mailing list</span><br><span><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a></span><br>





<span><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></span></div><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">
</a></blockquote></div><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">
</a></blockquote></div></div></blockquote></div></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>



</blockquote></div><br></div></div></div></blockquote></div><br></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>


</blockquote></div><br></div></div></blockquote></div><br></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote></div><br></div></div></div></blockquote></div><br></div></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></body></html>