[ndnSIM] Can I create multiple PIT entries for one Interest?

DJEMAA Adel a_djemaa at esi.dz
Fri Dec 20 08:18:30 PST 2019


Dear Okuma,
A few days ago, I encountered a similar error while trying to get a copy of
the interest packet in Forwarder.cpp (*onOutgoingInterest* method):
 terminate called after throwing an instance of 'std::bad_weak_ptr'
 what(): bad_weak_ptr
So after several attempts, i changed the instantiation of Interest object
like that:

*shared_ptr<Interest> interestForPIT = make_shared<Interest>(interest);*

According to your code, Before invoking: *m_pit.insert *method; y
should instantiate another Interest object, like that:

  *shared_ptr<Interest> interest2 = interestForPIT;*

 * m_pit.insert(*interest2).first;*

Maybe this is not the optimal or the best method, but that solved my problem.

Hope that would help.


Regards


Le sam. 14 déc. 2019 à 22:41, DJEMAA Adel <a_djemaa at esi.dz> a écrit :

> Dear Okuma,
> A few days ago, I encountered a similar error while trying to get a copy
> of the interest packet in Forwarder.cpp (*onOutgoingInterest* method):
>  terminate called after throwing an instance of 'std::bad_weak_ptr'
>  what(): bad_weak_ptr
> So after several attempts, i changed the instantiation of Interest object
> like that:
>
> *shared_ptr<Interest> interestForPIT = make_shared<Interest>(interest);*
>
> According to your code, Before invoking: *m_pit.insert *method; y should instantiate another Interest object, like that:
>
>   *shared_ptr<Interest> interest2 = interestForPIT;*
>
>  * m_pit.insert(*interest2).first;*
>
> Maybe this is not the optimal or the best method, but that solved my problem.
>
> Hope that would help.
>
>
> Regards
>
>
>
>
>
>
> Le sam. 14 déc. 2019 à 09:36, Hiroya Okuma <okuma at stu.kobe-u.ac.jp> a
> écrit :
>
>> Dear Lixia Zhang
>>
>> As you said, the router does not know the relationship between
>> "/prefix/A" and "/prefix/A+B".  Therefore, I want to add a process to make
>> the router divide Interest Name and create PIT entries for the number of
>> requested files.  (For ease of division, it is assumed that each file names
>> are the same size.)
>>
>> It is only necessary to temporarily create an Interest for creating PIT
>> entries for multiple request file names.
>>
>> Currently, the onIncomingInterest method of the Forwarder class of ndnSIM
>> is being modified.
>> I think there are two ways.
>>
>> 1.Multiple request file names obtained by dividing are stored in an
>> array, and processing for setting each file name in Interest and creating a
>> PIT entry is repeated.
>> → According to your advice, routers cannot set interest names
>>
>> 2.Prepare an instance of Interest class to create PIT entry in
>> onIncomingInterest method (?)
>> Example:
>> void
>> Forwarder::onIncomingInterest(Face& inFace, const Interest& interest)
>> {
>> ...// Divide file name and store in array "nameVec"
>>  for (unsigned int i=0; i<nameVec.size(); i++){
>>    Interest interestForPIT = interest;
>>    interestForPIT.setName(nameVec[i]);
>>    shared_ptr<pit::Entry> pitEntry = m_pit.insert(interestForPIT).first;
>>    ...
>>  }
>> }
>> → error
>> terminate called after throwing an instance of 'std::bad_weak_ptr'
>>  what(): bad_weak_ptr
>>
>> I don't have much experience with ndnSIM, so it may be a rudimentary
>> question.
>>
>> Please let me know if there are any good methods other than the above two
>> methods.
>>
>> Best Wishes,
>>
>> Hiroya Okuma
>>
>> 2019/12/14 12:46、Lixia Zhang <lixia at cs.ucla.edu>のメール:
>>
>> > In the above you developed an interesting scenario.
>> > Here is my view: we need to clarify the assumption here.
>> > Although NDN uses app names to fetch data, one needs to keep in mind
>> that routers/forwarders do not understand the name semantics, they forward
>> interests and data packets by matching the binary strings of the names.
>> >
>> > for example the prefixes /prefix/A, /prefix/B, and /prefix/A+B are
>> independent ones; a router would not know their relations.
>> > So a router wont be able to perform any function based on its semantic
>> understanding of the name "/prefix/A/%FE%00/prefix/A+B/%FE%00"
>> >
>> > I believe you need to write your own application to do that
>>
>>
>>
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>
>
>
> --
> Bien cordialement.
> Mr DJAMA Adel.
> Ecole Nationale Superieure d'Informatique - Oued smar, Alger, Algérie.
>


-- 
Bien cordialement.
Mr DJAMA Adel.
Ecole Nationale Superieure d'Informatique - Oued smar, Alger, Algérie.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20191220/5e454ea6/attachment.html>


More information about the ndnSIM mailing list