[ndnSIM] How to access node from forwarder

Eric Binnendyk eric.binnendyk at student.nmt.edu
Sun Nov 15 17:11:50 PST 2020


Hi,

I modified forwarder.cpp with the following code to delete PIT entries when
the PIT size gets too large (over 500 entries):

if (m_pit.size() > 500) {
int size = m_pit.size();
int rand_entry_num = randomN(size);
int i = 0;
for (auto entry = m_pit.begin(); entry != m_pit.end(); ++entry) {
if (i == rand_entry_num) {
// interest already has PIT entry, but calling insert() obtains the shared
ptr
// see
https://www.lists.cs.ucla.edu/pipermail/ndnsim/2015-December/002279.html
std::shared_ptr<nfd::pit::Entry> sharedEntry = m_pit.insert(entry->
getInterest()).first;
this->setExpiryTimer(sharedEntry, 0_ms);
std::cout << "Dropping PIT entry " << sharedEntry->getInterest().getName().
getPrefix(1) << std::endl;
break;
}
i++;
}


I would like to be able to log which interests get dropped, on a certain
node, in order to determine the distribution of interests stored on that
node's PIT. But I need to find some way to obtain the identity of the node,
which I assume I should do via the Node object.

How do I access the Node object from the Forwarder class? Or is there a
better way to do this logging?

Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20201115/933a773e/attachment.html>


More information about the ndnSIM mailing list