[ndnSIM] question about faceIterator in CustomStrategy

Alex Afanasyev alexander.afanasyev at ucla.edu
Sun Mar 31 11:20:45 PDT 2013


Hi huyao,

Yes, "/" represents a name with 0 components, so you're right that ...m_prefix->size() will return 0 for such an entry.

---
Alex

On Mar 31, 2013, at 8:36 AM, yao hu <huyao0107 at gmail.com> wrote:

> Hi Alex,
> 
> I understand what you mean. In ndnsim, setting forwarding strategy is meaningless if routes are not configured. Now I have made some progress. I am sorry for bothering you to check the following..
> 
> When setting up default FIB entries using StackHelper::SetDefaultRoutes() call that is to let each node/router have a FIB entry to / prefix, containing all available faces. So for the prefix "/"(class Name), its size() == 0? (pitEntry->GetFibEntry ()->m_prefix->size() == 0?)
> 
> Thanks a lot!
> 
> Regards,
> huyao
> 
> 
> 2013/3/31 Alex Afanasyev <alexander.afanasyev at ucla.edu>
> Looks good.
> 
> Your forwarding strategy has full control on how Interests are forwarded, so you're free to ignore the contents suggested faces in the FIB entry.
> 
> ---
> Alex
> 
> On Mar 30, 2013, at 9:34 PM, yao hu <huyao0107 at gmail.com> wrote:
> 
>> Hi Alex,
>> 
>> Thanks for your reply. That means SetDefaultRoutes(true) does not conflict with my later implementation in ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::CustomStrategy")? That is, before installing stack on nodes, the following codes is ok?
>> 
>>   ndn::StackHelper ccnxHelper;
>>   ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::CustomStrategy");
>>   ccnxHelper.SetDefaultRoutes (true);
>>   ccnxHelper.SetContentStore ("ns3::ndn::cs::Lru",
>>                               "MaxSize", "1"); // ! Attention ! If set to 0, then MaxSize is infinite
>>   ccnxHelper.InstallAll ();
>> 
>> Regards,
>> huyao
>> 
>> 
>> 
>> 2013/3/31 Alex Afanasyev <alexander.afanasyev at ucla.edu>
>> Hi huyao,
>> 
>> You still have to have an entry in FIB that corresponds to forwarded interests.  This entry is part of overall logic to forward interests, data, and record data performance stats for the forwarded data.
>> 
>> In your case, you can have an entry that corresponds to "/" prefix.  The easiest way to do it, is to use ndn::StackHelper::SetDefaultRoutes(true), which will create this entry and fill with all available faces (which you can ignore later).
>> 
>> ---
>> Alex
>> 
>> On Mar 30, 2013, at 8:33 PM, yao hu <huyao0107 at gmail.com> wrote:
>> 
>>> Hi Alex,
>>> 
>>> I see. I forgot about it. Thanks for your explanation. I am sorry I have one question about flooding strategy in ndnsim. 
>>> 
>>> I saw your reply http://www.lists.cs.ucla.edu/pipermail/ndnsim/2012-December/000030.html that mentions how to flood to all available faces not listed in FIB. Now I assume that when ndnsim simulation starts, I do not manually configure FIB routes by AddRoute, that is, FIB on each node is empty, and let each node forward the incoming interest to all available faces and don't want them to add to FIB entries by the following
>>> 
>>>         Ptr<L3Protocol> ndn = this->GetObject<L3Protocol> ();
>>>         for (uint32_t faceNum = 0; faceNum < ndn->GetNFaces (); faceNum++)
>>>         {
>>>            Ptr<Face> outFace = ndn->GetFace (faceNum);
>>>            TrySendOutInterest (inFace, outFace, header, origPacket, pitEntry);
>>>         }
>>> 
>>> However the interest will be not forwarded from any face and it seems no interest packet is produced. What is wrong with it? Thanks a lot. 
>>> 
>>> Regards,
>>> huyao
>>> 
>>> 
>>> 
>>> 2013/3/31 Alex Afanasyev <alexander.afanasyev at ucla.edu>
>>> Hi huyao,
>>> 
>>> The data structure that stores ordered Face instances in FIB behaves like any other STL container:
>>> begin ()  returns iterator to first element in the container
>>> end () returns a special iterator, indicating element just after the last valid element
>>> 
>>> In other words, end () is never an iterator to a valid element in the container, and situations when begin () == end () means that the container has no elements.  If there is at least one element in the container, begin () will return iterator to a valid first element.
>>> 
>>> ---
>>> Alex
>>> 
>>> On Mar 30, 2013, at 8:20 AM, yao hu <huyao0107 at gmail.com> wrote:
>>> 
>>>> Hi Alex,
>>>> 
>>>> Thanks for your reply to the previous question about ndnsim update.
>>>> 
>>>> Now I am looking into the CustomStrategy::DoPropagateInterest. This function is to let Interest be forwarded to first two best-metric faces specified by FIB. However, in the codes, the faceIterator is first pointed to the beginning of faces ordered by metric and then checked whether it is pointed to the end of the faces. Assume that there is only one face existing in the associated faces for the fib entry. For my understanding, this face is located at the beginning of the faces and also should be located at the end of the faces. Then according to the DoPropagateInterest algorithm, the incoming interest will be not sent out though the fact is not like that for sure. So what is wrong with my understanding for the faceIterator? Or what is the internal structure of FacesByMetric &faces especially faces.begin () or faces.end()?
>>>> 
>>>> I am sorry for my confusing expression. Thank you very much!
>>>> 
>>>> Regards,
>>>> huyao
>>>> _______________________________________________
>>>> ndnSIM mailing list
>>>> ndnSIM at lists.cs.ucla.edu
>>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>> 
>>> 
>>> _______________________________________________
>>> ndnSIM mailing list
>>> ndnSIM at lists.cs.ucla.edu
>>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>> 
>> 
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
> 
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20130331/c2f01a6b/attachment.html>


More information about the ndnSIM mailing list