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

Ashlesh Gawande (agawande) agawande at memphis.edu
Tue Mar 7 11:10:49 PST 2017


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<mailto: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<mailto: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<mailto: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<mailto: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/nlsr/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<mailto:ndnSIM at lists.cs.ucla.edu>
http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim


_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu<mailto: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/20170307/ea33e5f3/attachment.html>


More information about the ndnSIM mailing list