|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
40 "ProbingModule::DEFAULT_PROBING_INTERVAL must be less than AsfMeasurements::MEASUREMENTS_LIFETIME");
43 : m_probingInterval(DEFAULT_PROBING_INTERVAL)
44 , m_measurements(measurements)
56 if (info ==
nullptr) {
70 FaceInfoFacePairSet rankedFaces;
75 Face& hopFace = hop.getFace();
91 rankedFaces.insert({info, &hopFace});
94 if (rankedFaces.empty()) {
99 return chooseFace(rankedFaces);
111 static std::uniform_int_distribution<> randDist(0, 5000);
132 ProbingModule::chooseFace(
const FaceInfoFacePairSet& rankedFaces)
134 static std::uniform_real_distribution<> randDist;
136 uint64_t rankSum = (rankedFaces.size() + 1) * rankedFaces.size() / 2;
141 for (
const auto& pair : rankedFaces) {
142 double probability = getProbingProbability(rank++, rankSum, rankedFaces.size());
153 if (randomNumber <= offset + probability) {
157 offset += probability;
165 ProbingModule::getProbingProbability(uint64_t rank, uint64_t rankSum, uint64_t nFaces)
170 return static_cast<double>(nFaces + 1 - rank) / rankSum;
177 m_probingInterval = time::milliseconds(probingInterval);
180 NDN_THROW(std::invalid_argument(
"Probing interval must be >= " +
void setIsProbingDue(bool isProbingDue)
Face * getFaceToProbe(const Face &inFace, const Interest &interest, const fib::Entry &fibEntry, const Face &faceUsed)
ProbingModule(AsfMeasurements &measurements)
static const time::nanoseconds RTT_NO_MEASUREMENT
Helper class to retrieve and create strategy measurements.
#define NDN_CXX_UNREACHABLE
static constexpr time::microseconds MEASUREMENTS_LIFETIME
Represents an absolute name.
static constexpr time::milliseconds DEFAULT_PROBING_INTERVAL
Copyright (c) 2011-2015 Regents of the University of California.
static constexpr time::milliseconds MIN_PROBING_INTERVAL
RandomNumberEngine & getRandomNumberEngine()
Returns a reference to a thread-local instance of a properly seeded PRNG.
time::nanoseconds getLastRtt() const
generalization of a network interface
Scheduler & getScheduler()
Returns the global Scheduler instance for the calling thread.
void setIsFirstProbeScheduled(bool isScheduled)
bool isProbingDue() const
bool isFirstProbeScheduled() const
NamespaceInfo & getOrCreateNamespaceInfo(const fib::Entry &fibEntry, const Interest &interest)
const NextHopList & getNextHops() const
FaceInfo * getFaceInfo(const fib::Entry &fibEntry, const Interest &interest, FaceId faceId)
void afterForwardingProbe(const fib::Entry &fibEntry, const Interest &interest)
NamespaceInfo * getNamespaceInfo(const Name &prefix)
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope
Represents an Interest packet.
Strategy information for each face in a namespace.
void scheduleProbe(const fib::Entry &fibEntry, time::milliseconds interval)
void setProbingInterval(size_t probingInterval)
bool isProbingNeeded(const fib::Entry &fibEntry, const Interest &interest)
Stores strategy information about each face in this namespace.
std::string to_string(const T &val)
const Name & getPrefix() const