[ndnSIM] Question about updating name prefix list of the routers

Muhammad Hosain Abdollahi Sabet mhasabet at gmail.com
Wed Mar 22 00:23:25 PDT 2017


Ashlesh,

I have installed a simple app on one router node just for expressing the
advertise command interest as follows:

    auto advertiseCommand = make_shared<Interest>();
    Name command = Name("/localhost/nlsr/prefix-update/advertise");
    ndn::nfd::ControlParameters parameters;
    parameters.setName(Name("updated-prefix"));
    advertiseCommand->setName(command.append(parameters.wireEncode()));
    m_transmittedInterests(advertiseCommand,this,m_face);
    m_appLink->onReceiveInterest(*advertiseCommand);

The last 2 lines are for ndnSIM applications. They basically send packet on
wire.

For this I have:

6s 2 nfd.Forwarder:onIncomingInterest(): [DEBUG] onIncomingInterest
> face=261 interest=/localhost/nlsr/prefix-update/advertise/h%12%
> 07%10%08%0Eupdated-prefix
> 6s 2 nfd.Forwarder:onContentStoreMiss(): [DEBUG] onContentStoreMiss
> interest=/localhost/nlsr/prefix-update/advertise/h%12%
> 07%10%08%0Eupdated-prefix
> 6s 2 nfd.Forwarder:onContentStoreMiss(): [LOGIC] onContentStoreMiss
> noLinkObject
> 6s 2 nfd.Forwarder:onOutgoingInterest(): [DEBUG] onOutgoingInterest
> face=260 interest=/localhost/nlsr/prefix-update/advertise/h%12%
> 07%10%08%0Eupdated-prefix
>

6s 2 nfd.Forwarder:onIncomingData(): [DEBUG] onIncomingData face=260
> data=/localhost/nlsr/prefix-update/advertise/h%12%07%10%
> 08%0Eupdated-prefix
> 6s 2 nfd.Forwarder:onIncomingData(): [DEBUG] onIncomingData
> matching=/localhost/nlsr/prefix-update/advertise/h%12%
> 07%10%08%0Eupdated-prefix
> 6s 2 nfd.Forwarder:onOutgoingData(): [DEBUG] onOutgoingData face=261
> data=/localhost/nlsr/prefix-update/advertise/h%12%07%10%
> 08%0Eupdated-prefix
>

But just after that:

>  terminate called after throwing an instance of 'boost::exception_detail::
> clone_impl<boost::exception_detail::error_info_injector<ndn::name::Component::Error>
> >'
>   what():  Name component does not have the requested marker or the value
> is not a nonNegativeInteger
>
And it seems it has nothing to do with encoding. I have tried without
encoding, but the error is the same. Also tried with ndn::name instead of
controlparameters, but again the same error comes up.
There is no other application on node 2 but nlsr;

I appreciate your help.

Thanks,
Sabet


On Wed, Mar 22, 2017 at 3:55 AM, Ashlesh Gawande (agawande) <
agawande at memphis.edu> wrote:

> I am not familiar with ndnSIM.
>
> But sounds like you install NLSR app on every node (or rather ndnSIM-NLSR
> does).
>
> Why not install an nlsrc like app (separate from NLSR) only on the nodes
> where you want to advertise prefixes?
>
>
> Ashlesh
>
> ------------------------------
> *From:* Mahsa Aghajani <mahsa.aghajani at gmail.com>
> *Sent:* Tuesday, March 21, 2017 5:33:08 PM
> *To:* Muhammad Hosain Abdollahi Sabet
> *Cc:* Ashlesh Gawande (agawande); Alex Afanasyev; ndnsim
>
> *Subject:* Re: [ndnSIM] Question about updating name prefix list of the
> routers
>
> I also tried to call onCommandValidated function, which is called in the
> onInterest function,
> as below and everything went well :
>
> void
>> NlsrExec::advertise()
>> {
>>
>       std::cout<< "I was called"<<std::endl;
>
>>   m_nlsr.getPrefixUpdateProcessor().enable();
>>
>>   ndn::nfd::ControlParameters parameters;
>>   parameters.setName("/prefix/to/advertise/");
>>
>>   ndn::Name advertiseCommand("/localhost/nlsr/prefix-update/advertise");
>>   advertiseCommand.append(parameters.wireEncode());
>>
>>   std::shared_ptr<ndn::Interest> advertiseInterest =
>> std::make_shared<ndn::Interest>(advertiseCommand);
>>
>>    m_nlsr.getPrefixUpdateProcessor().onCommandValidated(advert
>> iseInterest);
>> }
>
>
> But this is useful for calling advertise from within nlsr application, so
> it will be called
> for all of the nodes that nlsr app is installed on them, which is not
> exactly what I need.
>
> Actually I need to call this function, advertise I mean, for some of the
> nodes, so I should be able to
> access the app on those nodes and then call advertise functions for those
> specifics nodes :
>
> Simulator::Schedule(Seconds(35.0), advertise, nodes.Get(3))
>>
>> void
>> advertise(Ptr<Node> node)
>> {
>>   Ptr<ndn::NlsrApp> mynlsrApp = (*(node)).GetApplication(0)->G
>> etObject<ndn::NlsrApp>();
>>   mynlsrApp->Advertise();
>> }
>
>
> Unfortunatly this codes gives the error :
>
> I was called
>> assert failed. cond="n < m_nodes.size ()", msg="Node index 4294967295 is
>> out of range (only have 7 nodes).", file=../src/network/model/node-list.cc,
>> line=209
>> terminate called without an active exception
>
>
>
> I really appreciate helping me get informed why this error rises.
>
> On Tue, Mar 21, 2017 at 2:06 AM, Mahsa Aghajani <mahsa.aghajani at gmail.com>
> wrote:
>
>> Dear Ashlesh
>>
>> As you said, I directly called the onInterest() function in my code :
>>
>> void
>>> NlsrExec::advertise()
>>> {
>>>   std::cout<< "I was called"<<std::endl;
>>>   m_nlsr.getPrefixUpdateProcessor().enable();
>>>   ndn::nfd::ControlParameters parameters;
>>>   parameters.setName("/prefix/to/advertise/");
>>>   ndn::Name advertiseCommand("/localhost/nlsr/prefix-update/advertise");
>>>   advertiseCommand.append(parameters.wireEncode());
>>>   const ndn::Interest advertiseInterest(advertiseCommand);
>>>
>>>  m_nlsr.getPrefixUpdateProcessor().onInterest(advertiseInterest);
>>> }
>>
>>
>> but still there exists an error which shows the app calls advertise
>> function once and then something goes wrong :
>>
>>>
>>> 'build' finished successfully (1m8.006s)
>>> I was called
>>> terminate called after throwing an instance of 'std::bad_weak_ptr'
>>>   what():  bad_weak_ptr
>>
>>
>>
>> On Tue, Mar 21, 2017 at 1:09 AM, Muhammad Hosain Abdollahi Sabet <
>> mhasabet at gmail.com> wrote:
>>
>>> Ok. So for now that we have turned off the security, other sites should
>>> be able to use advertise/withdraw commands, right?
>>>
>>> Suppose the simplest topology like:
>>> NodeA<------>Router
>>> Whether or not NodeA is a router(has nlsr up and running), if NodeA
>>> sends advertise/withdraw command interests Router will take appropriate
>>> action. But the question is under what prefix NodeA should send its
>>> interests? ndn:/nlsr? Or ndn:RouterName/nlsr? If latter, RouterName is name
>>> of an application running on Router node, right?
>>>
>>> Thanks,
>>> Sabet
>>>
>>>
>>> خندان باشید
>>> با تشکر
>>>
>>> On Tue, Mar 21, 2017 at 12:35 AM, Ashlesh Gawande (agawande) <
>>> agawande at memphis.edu> wrote:
>>>
>>>> Oh okay, you mean why only /localhost?
>>>>
>>>> Thats because this interest has to be signed by the operator and
>>>> operators of other sites should not be able to advertise/withdraw prefixes
>>>> on other routers which they don't have (ssh/machine) access to.
>>>>
>>>>
>>>> I don't know how ndnSIM works but advertise/withdraw would have to be
>>>> done on a per node level.
>>>>
>>>>
>>>> Ashlesh
>>>> ------------------------------
>>>> *From:* Muhammad Hosain Abdollahi Sabet <mhasabet at gmail.com>
>>>> *Sent:* Monday, March 20, 2017 3:54:20 PM
>>>> *To:* Ashlesh Gawande (agawande)
>>>> *Cc:* Alex Afanasyev; ndnsim; Mahsa Aghajani
>>>>
>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list of
>>>> the routers
>>>>
>>>> Ashlesh,
>>>>
>>>>
>>>> External application is supposed to send an interest like nlsrc.
>>>>
>>>>
>>>> If advertise/withdraw commands are only accepted in local scope, then
>>>> how external applications are allowed to express to-be-accepted command
>>>> interests?
>>>> https://redmine.named-data.net/projects/nlsr/wiki/NLSR_Management
>>>>
>>>> Why do you want to use NlsrExec (which is basically NLSR) to send an
>>>>> advertise/withdraw interest to itself?
>>>>
>>>> Mahsa may answer that better since it is her code. But I think it has
>>>> something to do with complying with local scope, and maybe avoiding c++
>>>> complexities.
>>>>
>>>> Thanks,
>>>> Sabet
>>>>
>>>>
>>>>
>>>>
>>>> On 20 Mar 2017 10:51 pm, "Ashlesh Gawande (agawande)" <
>>>> agawande at memphis.edu> wrote:
>>>>
>>>> nlsrc is separate application than NLSR - has its own face:
>>>>
>>>> https://github.com/named-data/NLSR/blob/master/tools/nlsrc.cpp#L368
>>>>
>>>>
>>>> External application is supposed to send an interest like nlsrc.
>>>>
>>>> Why do you want to use NlsrExec (which is basically NLSR) to send an
>>>> advertise/withdraw interest to itself?
>>>>
>>>>
>>>> Ashlesh
>>>> ------------------------------
>>>> *From:* Muhammad Hosain Abdollahi Sabet <mhasabet at gmail.com>
>>>> *Sent:* Monday, March 20, 2017 1:53:26 PM
>>>>
>>>> *To:* Ashlesh Gawande (agawande)
>>>> *Cc:* ndnsim; Alex Afanasyev; Mahsa Aghajani
>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list of
>>>> the routers
>>>>
>>>> Ashlesh,
>>>>
>>>> If the face is the problem, so how nlsrc is working?
>>>> Nlsrc::sendNamePrefixUpdate uses another face for expressing interest?
>>>>
>>>> Secondly, if these commands only work in local scope, then no external
>>>> application may use them for advertising and withdrawing prefixes, right?
>>>>
>>>> Thanks,
>>>> Sabet
>>>>
>>>> On 20 Mar 2017 9:31 pm, "Ashlesh Gawande (agawande)" <
>>>> agawande at memphis.edu> wrote:
>>>>
>>>>> So NLSR is listening for advertise and withdraw interests (on its face
>>>>> to NFD, ex: face 260).
>>>>>
>>>>> An application sends an interest to NFD (on its face to NFD, ex:
>>>>> face 265).
>>>>>
>>>>> NFD forwards the interest from the application to NLSR.
>>>>>
>>>>>
>>>>> There should not be any specific face.
>>>>>
>>>>>
>>>>> You can also try to call https://github.com/nam
>>>>> ed-data/NLSR/blob/feae5574b8b62ca2dff9991d8bacab48e4737b6a/s
>>>>> rc/update/prefix-update-processor.cpp#L68
>>>>>
>>>>> directly instead of trying to send an interest - if you want to do it
>>>>> from within NLSR instead (i.e. from NlsrExec). Might have to expose the
>>>>> function.
>>>>>
>>>>>
>>>>> Ashlesh
>>>>> ------------------------------
>>>>> *From:* Mahsa Aghajani <mahsa.aghajani at gmail.com>
>>>>> *Sent:* Monday, March 20, 2017 12:41:51 PM
>>>>> *To:* Ashlesh Gawande (agawande)
>>>>> *Cc:* Alex Afanasyev; ndnsim; Muhammad Hosain Abdollahi Sabet
>>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list of
>>>>> the routers
>>>>>
>>>>> Yes m_face is the face which is passed to NLSR, if the interest for
>>>>> advertise and withdraw commands should be sent from another face, how
>>>>> should it be related to NLSR? I mean is there a specific face for these
>>>>> kind of interest packets?
>>>>>
>>>>> On Mar 20, 2017 18:02, "Ashlesh Gawande (agawande)" <
>>>>> agawande at memphis.edu> wrote:
>>>>>
>>>>>> Security is off by default in nlsrSIM (https://github.com/3rd-ndn-ha
>>>>>> ckathon/ndnSIM-NLSR/blob/master/examples/ndn-nlsr-confgen.cpp#L405), so
>>>>>> that should not be a problem.
>>>>>>
>>>>>> So this m_face, is it the same face that is passed to NLSR?
>>>>>>
>>>>>> That may be a problem. Since you are sending the interest out of that
>>>>>> face and NLSR is listening for request on the same face, NFD would not
>>>>>> forward the interest back to the same face. Hence interest reject message
>>>>>> from NFD.
>>>>>>
>>>>>>
>>>>>> Ashlesh
>>>>>> ------------------------------
>>>>>> *From:* Muhammad Hosain Abdollahi Sabet <mhasabet at gmail.com>
>>>>>> *Sent:* Saturday, March 18, 2017 7:08:47 AM
>>>>>> *To:* Ashlesh Gawande (agawande)
>>>>>> *Cc:* ndnsim; Alex Afanasyev; Mahsa Aghajani
>>>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list of
>>>>>> the routers
>>>>>>
>>>>>>
>>>>>> I executed the following code but still after simulation the desired prefix is not in FIB,
>>>>>>
>>>>>> according to log, the interest gets rejected.
>>>>>>
>>>>>>
>>>>>>
>>>>>> void
>>>>>>> NlsrExec::advertise()
>>>>>>> {
>>>>>>> //siteIdentity = ndn::Name(site).appendVersion();
>>>>>>> //opIdentity = ndn::Name(siteIdentity).append
>>>>>>> (ndn::Name(operator)).appendVersion();
>>>>>>> std::cout<< "I was called"<<std::endl;
>>>>>>> m_nlsr.getPrefixUpdateProcessor().enable();
>>>>>>> ndn::nfd::ControlParameters parameters;
>>>>>>> parameters.setName("/prefix/to/advertise/");
>>>>>>> ndn::Name advertiseCommand("/localhost/nlsr/prefix-update/advertise"
>>>>>>> );
>>>>>>> advertiseCommand.append(parameters.wireEncode());
>>>>>>> ndn::Interest advertiseInterest(advertiseCommand);
>>>>>>> advertiseInterest.setMustBeFresh(true);
>>>>>>> m_keyChain.sign(advertiseInterest);
>>>>>>> m_face.expressInterest(advertiseInterest,
>>>>>>> std::bind([] { }),
>>>>>>> std::bind([] { }));
>>>>>>> }
>>>>>>
>>>>>>
>>>>>>
>>>>>> The log corresponding to node 5 :
>>>>>>
>>>>>> 31s 5 nfd.Forwarder:onIncomingInterest(): [DEBUG] onIncomingInterest
>>>>>>> face=260 interest=/localhost/nlsr/prefi
>>>>>>> x-update/advertise/h%19%07%17%08%06prefix%08%02to%08%09adver
>>>>>>> tise/y%18/%AB%DD%9E%8EO%EAQ%27/%164%1B%01%01%1C%2F%07-%08%05
>>>>>>> dummy%08%03key%08%03KEY%08%11ksk-1418600391050%08%07ID-CERT/
>>>>>>> %17%FD%01%00%93%15%09Iy%9E%B7%9C%D3%C1%BFa%89%D5%D9%CA%F2%B0
>>>>>>> %14%AEr%7C%1F%8F%F5%B1p%D6%9B%8F%F8%D7-%BC%92o%7Dw%96F%EA%D4
>>>>>>> %7D%90%BCz%EB%E2%03%93%B1%D2b%EC%9D%FF%9C%9C%2A%14%7D%23%CA%
>>>>>>> 29%3D%15%1A%40B%2CY3%8A%F7%C0k%C4%9C%F3%C4%99%A4%1A%60%F5%28
>>>>>>> %7DL%EFC%7D%BD%7D%00Q%EEA%F5%25%80%CE%E6dOuT%F3%B2%99%9A%0F%
>>>>>>> 93%9A%28%1D%FE%12%8A%E0%C1%02%EB%A45R%88%ACD%1AD%82%97O_%A8%
>>>>>>> D8%9Fg8%A8d%B6b%99%BD%96%3C%F5%86%09%5C%97k%8F%AE%E0%60%E7%
>>>>>>> 23%98j%EE%C1%B0%14%BEF%2C%FB%A7%27s%E4%F3%263%BA%99%D4%018%A
>>>>>>> 8%F2%9E%87%E0q%0B%25D%075%88%ABg%27V%0E%B5%B5%E8%27%B4I%DC%B
>>>>>>> 8H1%FF%99H%AB%11%B4%A0%DF%8Am%FFCi2%A7%BCc%9D%0F%E0%9546%
>>>>>>> 25K%3E6%BD%81%91%0B%91%9F%3A%04%A2D%28%19%A18%21O%25Y%8AH%C2
>>>>>>> 31s 5 nfd.Forwarder:onContentStoreMiss(): [DEBUG]
>>>>>>> onContentStoreMiss interest=/localhost/nlsr/prefi
>>>>>>> x-update/advertise/h%19%07%17%08%06prefix%08%02to%08%09adver
>>>>>>> tise/y%18/%AB%DD%9E%8EO%EAQ%27/%164%1B%01%01%1C%2F%07-%08%05
>>>>>>> dummy%08%03key%08%03KEY%08%11ksk-1418600391050%08%07ID-CERT/
>>>>>>> %17%FD%01%00%93%15%09Iy%9E%B7%9C%D3%C1%BFa%89%D5%D9%CA%F2%B0
>>>>>>> %14%AEr%7C%1F%8F%F5%B1p%D6%9B%8F%F8%D7-%BC%92o%7Dw%96F%EA%D4
>>>>>>> %7D%90%BCz%EB%E2%03%93%B1%D2b%EC%9D%FF%9C%9C%2A%14%7D%23%CA%
>>>>>>> 29%3D%15%1A%40B%2CY3%8A%F7%C0k%C4%9C%F3%C4%99%A4%1A%60%F5%28
>>>>>>> %7DL%EFC%7D%BD%7D%00Q%EEA%F5%25%80%CE%E6dOuT%F3%B2%99%9A%0F%
>>>>>>> 93%9A%28%1D%FE%12%8A%E0%C1%02%EB%A45R%88%ACD%1AD%82%97O_%A8%
>>>>>>> D8%9Fg8%A8d%B6b%99%BD%96%3C%F5%86%09%5C%97k%8F%AE%E0%60%E7%
>>>>>>> 23%98j%EE%C1%B0%14%BEF%2C%FB%A7%27s%E4%F3%263%BA%99%D4%018%A
>>>>>>> 8%F2%9E%87%E0q%0B%25D%075%88%ABg%27V%0E%B5%B5%E8%27%B4I%DC%B
>>>>>>> 8H1%FF%99H%AB%11%B4%A0%DF%8Am%FFCi2%A7%BCc%9D%0F%E0%9546%
>>>>>>> 25K%3E6%BD%81%91%0B%91%9F%3A%04%A2D%28%19%A18%21O%25Y%8AH%C2
>>>>>>> 31s 5 nfd.Forwarder:onContentStoreMiss(): [LOGIC]
>>>>>>> onContentStoreMiss noLinkObject
>>>>>>> 31s 5 nfd.Forwarder:onInterestReject(): [DEBUG] onInterestReject
>>>>>>> interest=/localhost/nlsr/prefix-update/advertise/h%19%07%17%
>>>>>>> 08%06prefix%08%02to%08%09advertise/y%18/%AB%DD%9E%8EO%EAQ%27
>>>>>>> /%164%1B%01%01%1C%2F%07-%08%05dummy%08%03key%08%03KEY%08%11k
>>>>>>> sk-1418600391050%08%07ID-CERT/%17%FD%01%00%93%15%09Iy%9E%B7%
>>>>>>> 9C%D3%C1%BFa%89%D5%D9%CA%F2%B0%14%AEr%7C%1F%8F%F5%B1p%D6%9B%
>>>>>>> 8F%F8%D7-%BC%92o%7Dw%96F%EA%D4%7D%90%BCz%EB%E2%03%93%B1%D2b%
>>>>>>> EC%9D%FF%9C%9C%2A%14%7D%23%CA%29%3D%15%1A%40B%2CY3%8A%F7%C0k
>>>>>>> %C4%9C%F3%C4%99%A4%1A%60%F5%28%7DL%EFC%7D%BD%7D%00Q%EEA%F5%2
>>>>>>> 5%80%CE%E6dOuT%F3%B2%99%9A%0F%93%9A%28%1D%FE%12%8A%E0%C1%02%
>>>>>>> EB%A45R%88%ACD%1AD%82%97O_%A8%D8%9Fg8%A8d%B6b%99%BD%96%3C%F5
>>>>>>> %86%09%5C%97k%8F%AE%E0%60%E7%23%98j%EE%C1%B0%14%BEF%2C%FB%A
>>>>>>> 7%27s%E4%F3%263%BA%99%D4%018%A8%F2%9E%87%E0q%0B%25D%075%88%A
>>>>>>> Bg%27V%0E%B5%B5%E8%27%B4I%DC%B8H1%FF%99H%AB%11%B4%A0%DF%8Am%
>>>>>>> FFCi2%A7%BCc%9D%0F%E0%9546%25K%3E6%BD%81%91%0B%91%9F%3A%0
>>>>>>> 4%A2D%28%19%A18%21O%25Y%8AH%C2
>>>>>>> 31.1s 5 nfd.Forwarder:onInterestFinalize(): [DEBUG]
>>>>>>> onInterestFinalize interest=/localhost/nlsr/prefi
>>>>>>> x-update/advertise/h%19%07%17%08%06prefix%08%02to%08%09adver
>>>>>>> tise/y%18/%AB%DD%9E%8EO%EAQ%27/%164%1B%01%01%1C%2F%07-%08%05
>>>>>>> dummy%08%03key%08%03KEY%08%11ksk-1418600391050%08%07ID-CERT/
>>>>>>> %17%FD%01%00%93%15%09Iy%9E%B7%9C%D3%C1%BFa%89%D5%D9%CA%F2%B0
>>>>>>> %14%AEr%7C%1F%8F%F5%B1p%D6%9B%8F%F8%D7-%BC%92o%7Dw%96F%EA%D4
>>>>>>> %7D%90%BCz%EB%E2%03%93%B1%D2b%EC%9D%FF%9C%9C%2A%14%7D%23%CA%
>>>>>>> 29%3D%15%1A%40B%2CY3%8A%F7%C0k%C4%9C%F3%C4%99%A4%1A%60%F5%28
>>>>>>> %7DL%EFC%7D%BD%7D%00Q%EEA%F5%25%80%CE%E6dOuT%F3%B2%99%9A%0F%
>>>>>>> 93%9A%28%1D%FE%12%8A%E0%C1%02%EB%A45R%88%ACD%1AD%82%97O_%A8%
>>>>>>> D8%9Fg8%A8d%B6b%99%BD%96%3C%F5%86%09%5C%97k%8F%AE%E0%60%E7%
>>>>>>> 23%98j%EE%C1%B0%14%BEF%2C%FB%A7%27s%E4%F3%263%BA%99%D4%018%A
>>>>>>> 8%F2%9E%87%E0q%0B%25D%075%88%ABg%27V%0E%B5%B5%E8%27%B4I%DC%B
>>>>>>> 8H1%FF%99H%AB%11%B4%A0%DF%8Am%FFCi2%A7%BCc%9D%0F%E0%9546%
>>>>>>> 25K%3E6%BD%81%91%0B%91%9F%3A%04%A2D%28%19%A18%21O%25Y%8AH%C2
>>>>>>> unsatisfied
>>>>>>
>>>>>>
>>>>>> Why is that so? Is it because of the signiture or something?
>>>>>>
>>>>>> Thanks,
>>>>>> Sabet
>>>>>>
>>>>>>
>>>>>> On Tue, Mar 7, 2017 at 10:40 PM, Ashlesh Gawande (agawande) <
>>>>>> agawande at memphis.edu> wrote:
>>>>>>
>>>>>>> Yes, receive is just a dummy written for unit testing (
>>>>>>> https://github.com/named-data/ndn-cxx/blob/master/src/util/
>>>>>>> dummy-client-face.hpp).
>>>>>>>
>>>>>>>
>>>>>>> You would use expressInterest to send an advertise/withdraw request.
>>>>>>>
>>>>>>> (https://github.com/named-data/NLSR/blob/master/tools/nlsrc.cpp#L158
>>>>>>> )
>>>>>>>
>>>>>>>
>>>>>>> The advertise/withdraw commands are only accepted on localhost (
>>>>>>> https://redmine.named-data.net/projects/nlsr/wiki/NLSR_Management).
>>>>>>>
>>>>>>> For example, nlsrc issues an advertise interest to NFD, which gives
>>>>>>> it to NLSR (since NLSR is listening for it).
>>>>>>> Then NLSR can respond appropriately.
>>>>>>>
>>>>>>> Ashlesh
>>>>>>> ------------------------------
>>>>>>> *From:* Muhammad Hosain Abdollahi Sabet <mhasabet at gmail.com>
>>>>>>> *Sent:* Tuesday, March 7, 2017 1:04:04 PM
>>>>>>> *To:* Ashlesh Gawande (agawande)
>>>>>>> *Cc:* ndnsim; Alex Afanasyev; Mahsa Aghajani
>>>>>>>
>>>>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list of
>>>>>>> the routers
>>>>>>>
>>>>>>>
>>>>>>> Ashlesh,
>>>>>>>
>>>>>>> How about using expressInterest? Does nlsr respond to interest of
>>>>>>> local scope like nfd? If so, there is no need to have a receive, right?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Sabet
>>>>>>> On Mar 6, 2017 10:48 PM, "Ashlesh Gawande (agawande)" <
>>>>>>> agawande at memphis.edu> wrote:
>>>>>>>
>>>>>>>> face->receive is for the unit tests (written for testing purpose).
>>>>>>>> Remove it.
>>>>>>>>
>>>>>>>> After that call whatever the equivalent of face->processEvents is
>>>>>>>> in ndnSIM (I am not familiar with ndnSIM).
>>>>>>>>
>>>>>>>>
>>>>>>>> Also look at nlsrc tools - which is a real application to send
>>>>>>>> advertise/withdraw command and would be closer to what you want than the
>>>>>>>> test (however, one thing missing in nlsrc is that it will sign the interest
>>>>>>>> with default identity - so you have to make sure that default identity is
>>>>>>>> set to operator to do the advertise/withdraw request This should not matter
>>>>>>>> if security is turned off in nlsr.conf file - iirc ndnSIM-NLSR has it
>>>>>>>> turned off).
>>>>>>>>
>>>>>>>> (https://github.com/named-data/NLSR/tree/master/tools)
>>>>>>>>
>>>>>>>> But yes, to advertise/withdraw prefix this is the functionality you
>>>>>>>> would use.
>>>>>>>>
>>>>>>>>
>>>>>>>> Ashlesh
>>>>>>>> ------------------------------
>>>>>>>> *From:* Mahsa Aghajani <mahsa.aghajani at gmail.com>
>>>>>>>> *Sent:* Monday, March 6, 2017 12:47:00 PM
>>>>>>>> *To:* Alex Afanasyev
>>>>>>>> *Cc:* Ashlesh Gawande (agawande); ndnsim; Anil Jangam
>>>>>>>> *Subject:* Re: [ndnSIM] Question about updating name prefix list
>>>>>>>> of the routers
>>>>>>>>
>>>>>>>> The error I got is that face class does not have a member
>>>>>>>> receive().
>>>>>>>> I do not know exactly how to send the cammand advertise/withdraw.
>>>>>>>> Thank you a lot dear Alex for your attention.
>>>>>>>>
>>>>>>>> On Mar 6, 2017 22:11, "Alex Afanasyev" <aa at cs.ucla.edu> wrote:
>>>>>>>>
>>>>>>>>> Dear Mahsa,
>>>>>>>>>
>>>>>>>>> Can you give a bit more details on what errors you're getting?
>>>>>>>>> What exactly is not working when you trying to send the command?
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Alex
>>>>>>>>>
>>>>>>>>> On Mar 5, 2017, at 5:53 AM, Mahsa Aghajani <
>>>>>>>>> mahsa.aghajani at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> Dear ndnSIM users
>>>>>>>>>
>>>>>>>>> I want to update name prefix lists of routers during a simulation
>>>>>>>>> including adding/removing some name  prefixes to/from a router. Should I
>>>>>>>>> use advertise or withdraw functions of NLSR for doing this?
>>>>>>>>> If so, how can I use these functions in ndnSIM-NLSR? I have
>>>>>>>>> written this code in
>>>>>>>>> ndn-nlsr-exec.cpp file, but I got some errors relating to sending
>>>>>>>>> interest from face :
>>>>>>>>>
>>>>>>>>> void
>>>>>>>>> Nlsr::withdraw()
>>>>>>>>> {
>>>>>>>>>   m_nlsr.getPrefixUpdateProcessor().updateProcessor.enable();
>>>>>>>>>
>>>>>>>>>   ndn::nfd::ControlParameters parameters;
>>>>>>>>>   parameters.setName("/prefix/to/advertise/");
>>>>>>>>>
>>>>>>>>>   ndn::Name withdrawCommand("/localhost/nl
>>>>>>>>> sr/prefix-update/withdraw");
>>>>>>>>>   withdrawCommand.append(parameters.wireEncode());
>>>>>>>>>
>>>>>>>>>   shared_ptr<Interest> withdrawInterest =
>>>>>>>>> make_shared<Interest>(withdrawCommand);
>>>>>>>>>   keyChain.signByIdentity(*withdrawInterest, opIdentity);
>>>>>>>>>
>>>>>>>>>   face->receive(*withdrawInterest);
>>>>>>>>>   face->processEvents(ndn::time::milliseconds(1));
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Thanks and regards.
>>>>>>>>>
>>>>>>>>> Mahsa Aghajani
>>>>>>>>> M.Sc. Student
>>>>>>>>> Department of Computer Engineering
>>>>>>>>> Sharif University of Technology
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> 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
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>>>
>>
>>
>> --
>>
>> Mahsa Aghajani
>> M.Sc. Student
>> Department of Computer Engineering
>> Sharif University of Technology
>>
>>
>
>
> --
>
> Mahsa Aghajani
> M.Sc. Student
> Department of Computer Engineering
> Sharif University of Technology
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170322/5414111f/attachment-0001.html>


More information about the ndnSIM mailing list