[ndnSIM] question about faceIterator in CustomStrategy

yao hu huyao0107 at gmail.com
Mon Apr 1 17:25:35 PDT 2013


Hi Alex,

Thanks for your reply.
I saw the following explanation about face id used by AddRoute. So I am a
little confused by the inconsistency from the one returned by GetId. For
example, router A is connected with router B and also with router C. How do
I know which face (0? 1?) should I pass into AddRoute when I want to set up
a route for A--B or A--C?
http://www.lists.cs.ucla.edu/pipermail/ndnsim/2013-March/000159.html

Regards,
huyao




2013/4/2 Alex Afanasyev <alexander.afanasyev at ucla.edu>

> Hi huyao,
>
> First of all, if you have a pointer to Face object, you don't need to get
> ID for AddRoute, as supplying Ptr<Face> is the most efficient way.
>
> As for ids, they are the same for both used by AddRoute and returned by
> GetId.  There could be some inconsistencies in documentation that should be
> corrected, but I couldn't find where you read about "based on device id on
> the node"?  Can you point to the documentation page/source code?
>
> Thanks,
> Alex
>
> On Apr 1, 2013, at 8:59 AM, Smallcat <huyao0107 at gmail.com> wrote:
>
> Hi Alex,
>
> I see. Thanks.
>
> Just now I read your past reply to face Id. I am a little confused by the
> difference between the one in AddRoute() and method Face::GetId(). The
> former face Id is specified by face number which is based on device id on
> the Node (0, 1,2...). The latter face 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) as you said before.
> Then they are the same one or different? Which one should I use to identify
> the unique one face for a ndn router?
>
> Thanks a lot!
>
> Regards,
> huyao
> *
> *
>
> 在 2013-4-1,3:20,Alex Afanasyev <alexander.afanasyev at ucla.edu> 写道:
>
> 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()<http://ndnsim.net/doxygen/classns3_1_1ndn_1_1_stack_helper.html#a12b1c8f16bad953ac3b9bb4a6ab1fcab> 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
>
>
> _______________________________________________
> 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/20130402/e3a8125d/attachment.html>


More information about the ndnSIM mailing list