[ndnSIM] How to get Node Id?

Mudasir Qazi mudasirqazi00 at gmail.com
Thu Mar 15 10:06:15 PDT 2018


I am looking for the ID of a node in the network. I want to know which node
has sent interest or data etc.

I have found following way to get it in *ndn-app-link-service.cpp *class,
and it works fine because this class has *m_node* private member.

uint32_t nodeId = m_node->GetId(); //works fine in

But, the problem is, I also need to get Node ID in *forwarder.cpp *as well
as on several other places in whole ndnSIM. I have tried following method
to get it in *forwarder.cpp* but it does not work.

//does not work in forwarder.cpp
ns3::Ptr<ns3::Application> app = ns3::Ptr<ns3::Application>();
ns3::Ptr<ns3::Node> node = app->GetNode();
uint32_t nodeId = node->GetId();

Please guide me how can I get it in *forwarder.cpp* as well as give me a
general method to get it wherever it is needed in whole ndnSIM for future

Mudasir Qazi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180315/49d319a1/attachment.html>

More information about the ndnSIM mailing list