BUG. (need more corrections) Don't remove PIT if interests has not been
propagated (will need to check if we still expecting something)
diff --git a/model/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index 151436a..e8b0fc1 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -540,7 +540,7 @@
const Ptr<const Packet> &packet)
{
- NS_LOG_FUNCTION (incomingFace << header << payload << packet);
+ NS_LOG_FUNCTION (incomingFace << header->GetName () << payload << packet);
m_inData (header, payload, incomingFace);
// 1. Lookup PIT entry
@@ -596,8 +596,13 @@
{
incoming.m_face->Send (packet->Copy ());
m_outData (header, payload, false, incoming.m_face);
+ NS_LOG_DEBUG ("Satisfy " << *incoming.m_face);
}
-
+ else
+ {
+ NS_LOG_DEBUG ("Ignore incoming interests from ourselves (" << *incoming.m_face << ")");
+ }
+
// successfull forwarded data trace
}
// All incoming interests are satisfied. Remove them
@@ -611,6 +616,7 @@
}
catch (CcnxPitEntryNotFound)
{
+ NS_LOG_DEBUG ("Pit entry not found");
if (m_cacheUnsolicitedData)
{
// Optimistically add or update entry in the content store
@@ -646,20 +652,20 @@
m_outNacks (header, incoming.m_face);
}
- }
- // All incoming interests cannot be satisfied. Remove them
- m_pit->modify (m_pit->iterator_to (pitEntry),
- ll::bind (&CcnxPitEntry::ClearIncoming, ll::_1));
+ // All incoming interests cannot be satisfied. Remove them
+ m_pit->modify (m_pit->iterator_to (pitEntry),
+ ll::bind (&CcnxPitEntry::ClearIncoming, ll::_1));
- // Remove also outgoing
- m_pit->modify (m_pit->iterator_to (pitEntry),
- ll::bind (&CcnxPitEntry::ClearOutgoing, ll::_1));
+ // Remove also outgoing
+ m_pit->modify (m_pit->iterator_to (pitEntry),
+ ll::bind (&CcnxPitEntry::ClearOutgoing, ll::_1));
- // Set pruning timout on PIT entry (instead of deleting the record)
- m_pit->modify (m_pit->iterator_to (pitEntry),
- ll::bind (&CcnxPitEntry::SetExpireTime, ll::_1,
- Simulator::Now () + m_pit->GetPitEntryPruningTimeout ()));
+ // Set pruning timout on PIT entry (instead of deleting the record)
+ m_pit->modify (m_pit->iterator_to (pitEntry),
+ ll::bind (&CcnxPitEntry::SetExpireTime, ll::_1,
+ Simulator::Now () + m_pit->GetPitEntryPruningTimeout ()));
+ }
}
} //namespace ns3
diff --git a/model/ccnx-pit-entry.cc b/model/ccnx-pit-entry.cc
index 80135fd..b9cd3f5 100644
--- a/model/ccnx-pit-entry.cc
+++ b/model/ccnx-pit-entry.cc
@@ -47,11 +47,21 @@
}
void
+CcnxPitEntry::SetExpireTime (const Time &expireTime)
+{
+ NS_LOG_FUNCTION (expireTime);
+ m_expireTime = expireTime;
+}
+
+
+void
CcnxPitEntry::UpdateLifetime (const Time &offsetTime)
{
Time newExpireTime = Simulator::Now () + offsetTime;
if (newExpireTime > m_expireTime)
m_expireTime = newExpireTime;
+
+ NS_LOG_DEBUG ("Updated lifetime to " << m_expireTime.ToDouble (Time::S));
}
CcnxPitEntryIncomingFaceContainer::type::iterator
diff --git a/model/ccnx-pit-entry.h b/model/ccnx-pit-entry.h
index de58470..ad865ba 100644
--- a/model/ccnx-pit-entry.h
+++ b/model/ccnx-pit-entry.h
@@ -140,8 +140,7 @@
* @param expireTime absolute simulation time of when the record should expire
*/
void
- SetExpireTime (const Time &expireTime)
- { m_expireTime = expireTime; }
+ SetExpireTime (const Time &expireTime);
/**
* @brief Check if nonce `nonce` for the same prefix has already been seen