Now there is a semi success with nacks disabled and huge problem with nacks enabled
diff --git a/model/fw/per-fib-limits.cc b/model/fw/per-fib-limits.cc
index 4536783..ed41eeb 100644
--- a/model/fw/per-fib-limits.cc
+++ b/model/fw/per-fib-limits.cc
@@ -167,30 +167,30 @@
NS_LOG_FUNCTION (this << pitEntry->GetPrefix ());
super::WillEraseTimedOutPendingInterest (pitEntry);
- if (pitEntry->GetOutgoing ().size () == 0)
- {
- Ptr<InterestHeader> nackHeader = Create<InterestHeader> (*pitEntry->GetInterest ());
+ // if (pitEntry->GetOutgoing ().size () == 0)
+ // {
+ // Ptr<InterestHeader> nackHeader = Create<InterestHeader> (*pitEntry->GetInterest ());
- NS_ASSERT (pitEntry->GetFwTag<PitQueueTag> () != boost::shared_ptr<PitQueueTag> ());
- if (pitEntry->GetFwTag<PitQueueTag> ()->IsLastOneInQueues ())
- {
- nackHeader->SetNack (100);
- }
- else
- {
- nackHeader->SetNack (101);
- }
+ // NS_ASSERT (pitEntry->GetFwTag<PitQueueTag> () != boost::shared_ptr<PitQueueTag> ());
+ // if (pitEntry->GetFwTag<PitQueueTag> ()->IsLastOneInQueues ())
+ // {
+ // nackHeader->SetNack (100);
+ // }
+ // else
+ // {
+ // nackHeader->SetNack (101);
+ // }
- Ptr<Packet> pkt = Create<Packet> ();
- pkt->AddHeader (*nackHeader);
+ // Ptr<Packet> pkt = Create<Packet> ();
+ // pkt->AddHeader (*nackHeader);
- for (pit::Entry::in_container::iterator face = pitEntry->GetIncoming ().begin ();
- face != pitEntry->GetIncoming ().end ();
- face ++)
- {
- face->m_face->Send (pkt->Copy ());
- }
- }
+ // for (pit::Entry::in_container::iterator face = pitEntry->GetIncoming ().begin ();
+ // face != pitEntry->GetIncoming ().end ();
+ // face ++)
+ // {
+ // face->m_face->Send (pkt->Copy ());
+ // }
+ // }
PitQueue::Remove (pitEntry);
diff --git a/utils/ndn-pit-queue.cc b/utils/ndn-pit-queue.cc
index 3423775..0c7349f 100644
--- a/utils/ndn-pit-queue.cc
+++ b/utils/ndn-pit-queue.cc
@@ -23,6 +23,7 @@
#include "ns3/ndn-face.h"
#include "ns3/ndn-pit-entry.h"
#include "ns3/log.h"
+#include "ns3/simulator.h"
#include "ns3/assert.h"
@@ -99,11 +100,11 @@
{
PerInFaceQueue::iterator queue = m_lastQueue;
- // if (queue != m_queues.end () &&
- // true)
- // {
- // queue ++; // actually implement round robin...
- // }
+ if (queue != m_queues.end () &&
+ true)
+ {
+ queue ++; // actually implement round robin...
+ }
while (queue != m_queues.end () && queue->second->get<0> ().size () == 0) // advance iterator
{
@@ -126,6 +127,18 @@
if (queue == m_queues.end ()) // e.g., begin () == end ()
return 0;
+ // if (Simulator::GetContext () == 7)
+ // {
+ // for (PerInFaceQueue::const_iterator somequeue = m_queues.begin ();
+ // somequeue != m_queues.end ();
+ // somequeue ++)
+ // {
+ // if (somequeue == queue) cout << "*";
+ // cout << somequeue->second->get<0> ().size () << " ";
+ // }
+ // cout << endl;
+ // }
+
NS_ASSERT_MSG (queue->second->get<0> ().size () != 0, "Logic error");
Ptr<pit::Entry> entry = *queue->second->get<0> ().begin ();