21 #include "smart-flooding.h"
23 #include "ns3/ndn-interest.h"
24 #include "ns3/ndn-pit.h"
25 #include "ns3/ndn-pit-entry.h"
27 #include "ns3/assert.h"
29 #include "ns3/simulator.h"
30 #include "ns3/boolean.h"
32 #include <boost/ref.hpp>
33 #include <boost/foreach.hpp>
34 #include <boost/lambda/lambda.hpp>
35 #include <boost/lambda/bind.hpp>
36 namespace ll = boost::lambda;
42 NS_OBJECT_ENSURE_REGISTERED (SmartFlooding);
53 SmartFlooding::GetTypeId (
void)
55 static TypeId tid = TypeId (
"ns3::ndn::fw::SmartFlooding")
58 .AddConstructor <SmartFlooding> ()
69 Ptr<const Interest> interest,
70 Ptr<pit::Entry> pitEntry)
72 NS_LOG_FUNCTION (
this);
79 int propagatedCount = 0;
81 BOOST_FOREACH (
const fib::FaceMetric &metricFace, pitEntry->GetFibEntry ()->m_faces.get<fib::i_metric> ())
83 NS_LOG_DEBUG (
"Trying " << boost::cref(metricFace));
84 if (metricFace.
GetStatus () == fib::FaceMetric::NDN_FIB_RED)
95 NS_LOG_INFO (
"Propagated to " << propagatedCount <<
" faces");
96 return propagatedCount > 0;
static std::string GetLogName()
Helper function to retrieve logging name for the forwarding strategy.
Ptr< Face > GetFace() const
Return Face associated with FaceMetric.
static std::string GetLogName()
Helper function to retrieve logging name for the forwarding strategy.
Forwarding strategy extensions to track simple link status based on data plane performance.
Structure holding various parameters associated with a (FibEntry, Face) tuple.
virtual bool DoPropagateInterest(Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)
Virtual method to perform Interest propagation according to the forwarding strategy logic...
Status GetStatus() const
Get current status of FIB entry.
virtual bool DoPropagateInterest(Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)
Virtual method to perform Interest propagation according to the forwarding strategy logic...
SmartFlooding()
Default constructor.
virtual bool TrySendOutInterest(Ptr< Face > inFace, Ptr< Face > outFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)
Method implementing actual interest forwarding, taking into account CanSendOutInterest decision...