[ndnSIM] Get node id in forwarding strategy

Adhy Satya adhysatya820 at gmail.com
Wed Jun 13 17:33:29 PDT 2018


Hi,

I wrote a custom fw-strategy where I get the node ID like so:

void
BroadcastStrategy::afterReceiveInterest(const Face& inFace, const Interest&
interest,const shared_ptr<pit::Entry>& pitEntry)
{
  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);
  const fib::NextHopList& nexthops = fibEntry.getNextHops();


  ns3::Ptr<ns3::Node> node =
ns3::NodeList::GetNode(ns3::Simulator::GetContext());
  ns3::Ptr<ns3::NetDevice> netDevice;
  ns3::Ptr<ns3::ndn::L3Protocol> ndnl3;
  ndnl3 = node->GetObject<ns3::ndn::L3Protocol>();


The issue is that I'm getting the exact same error as this post from Oct
2017
<http://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-October/004175.html>.
There are several other posts with the same issue, some want to get the
node id in the lru-cache, etc. However, all these posts seem to be
scheduling an event, then getting with Simulator::GetContext().

I can't apply the solution from this posts in my case, since I don't call
Simulator::ScheduleWithContext(). I just want to get the id of the node
that is processing the Interest.

Is there another option to this?

I'm using ndnSIM 2.5

Thank you!
Adhy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180613/ac9f09a4/attachment.html>


More information about the ndnSIM mailing list