[ndnSIM] How to access node from forwarder

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


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
// see
std::shared_ptr<nfd::pit::Entry> sharedEntry = m_pit.insert(entry->
this->setExpiryTimer(sharedEntry, 0_ms);
std::cout << "Dropping PIT entry " << sharedEntry->getInterest().getName().
getPrefix(1) << std::endl;

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?

-------------- 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