Add option to enable/disable NACKs to notify about queue drops
diff --git a/model/fw/per-fib-limits.cc b/model/fw/per-fib-limits.cc
index ba9e81a..95fa65a 100644
--- a/model/fw/per-fib-limits.cc
+++ b/model/fw/per-fib-limits.cc
@@ -58,6 +58,11 @@
BooleanValue (false),
MakeBooleanAccessor (&PerFibLimits::m_announceLimits),
MakeBooleanChecker ())
+
+ .AddAttribute ("QueueDropNotifications", "Enable explicit notifications (using nacks) that packet was dropped from queue",
+ BooleanValue (true),
+ MakeBooleanAccessor (&PerFibLimits::m_queueDropNotifications),
+ MakeBooleanChecker ())
;
return tid;
}
@@ -192,27 +197,30 @@
if (pitEntry->GetOutgoing ().size () == 0)
{
super::DidReceiveValidNack (0, 0, pitEntry); // semi safe
-
- Ptr<InterestHeader> nackHeader = Create<InterestHeader> (*pitEntry->GetInterest ());
-
- NS_ASSERT (pitEntry->GetFwTag<PitQueueTag> () != boost::shared_ptr<PitQueueTag> ());
- if (pitEntry->GetFwTag<PitQueueTag> ()->IsLastOneInQueues ())
+
+ if (m_queueDropNotifications)
{
- nackHeader->SetNack (100);
- }
- else
- {
- nackHeader->SetNack (101);
- }
+ 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);
+ }
- 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 ());
+ }
}
}
else
diff --git a/model/fw/per-fib-limits.h b/model/fw/per-fib-limits.h
index b00173a..b377004 100644
--- a/model/fw/per-fib-limits.h
+++ b/model/fw/per-fib-limits.h
@@ -101,6 +101,7 @@
PitQueueMap m_pitQueues; // per-outgoing face pit queue
bool m_announceLimits;
+ bool m_queueDropNotifications;
EventId m_announceEvent;
};