limits: Adding ability for GlobalRoutingController to set precise BDP prefix limits using knowledge of RTT for destination
diff --git a/utils/ndn-limits-rate.h b/utils/ndn-limits-rate.h
index 7da0f1a..7f0efef 100644
--- a/utils/ndn-limits-rate.h
+++ b/utils/ndn-limits-rate.h
@@ -56,6 +56,13 @@
virtual void
SetLimits (double rate, double delay);
+ virtual
+ double
+ GetMaxLimit () const
+ {
+ return GetMaxRate ();
+ }
+
/**
* @brief Check if Interest limit is reached (token bucket is not empty)
*/
@@ -89,6 +96,12 @@
return m_bucketLeak;
}
+ virtual double
+ GetCurrentLimitRate () const
+ {
+ return m_bucketLeak;
+ }
+
protected:
// from Node
void
diff --git a/utils/ndn-limits-window.h b/utils/ndn-limits-window.h
index 5b93b6e..655b8ef 100644
--- a/utils/ndn-limits-window.h
+++ b/utils/ndn-limits-window.h
@@ -62,6 +62,13 @@
m_curMaxLimit = GetMaxRate () * GetMaxDelay ();
}
+ virtual
+ double
+ GetMaxLimit () const
+ {
+ return GetMaxRate () * GetMaxDelay ();
+ }
+
virtual void
UpdateCurrentLimit (double limit);
@@ -71,6 +78,12 @@
return m_curMaxLimit;
}
+ virtual double
+ GetCurrentLimitRate () const
+ {
+ return m_curMaxLimit / GetMaxDelay ();
+ }
+
/**
* @brief Check if current interest window (number of pending interests) if less than maximum
*/
diff --git a/utils/ndn-limits.cc b/utils/ndn-limits.cc
index ee4160e..1d7b283 100644
--- a/utils/ndn-limits.cc
+++ b/utils/ndn-limits.cc
@@ -44,6 +44,7 @@
: m_maxRate (-1)
, m_maxDelay (1.0)
, m_handler (MakeNullCallback<void> ())
+ , m_linkDelay (0)
{
}
diff --git a/utils/ndn-limits.h b/utils/ndn-limits.h
index 5fdad53..d1daa10 100644
--- a/utils/ndn-limits.h
+++ b/utils/ndn-limits.h
@@ -83,6 +83,13 @@
}
/**
+ * @brief Get maximum limit (interpretation of the limit depends on realization)
+ */
+ virtual
+ double
+ GetMaxLimit () const = 0;
+
+ /**
* @brief Check whether limits are enabled or not
*/
virtual inline bool
@@ -110,6 +117,15 @@
*/
virtual double
GetCurrentLimit () const = 0;
+
+ /**
+ * @brief Get value of the current limit in terms of maximum rate that needs to be enforced
+ *
+ * Compared to GetCurrentLimit, this method guarantees that the returned value is maximum number of packets
+ * that can be send out within one second (max "rate")
+ */
+ virtual double
+ GetCurrentLimitRate () const = 0;
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
@@ -135,6 +151,26 @@
virtual void
ReturnLimit () = 0;
+ /**
+ * @brief Set link delay (in seconds)
+ *
+ * This is a supplementary information that may or may not be useful for limits
+ */
+ virtual void
+ SetLinkDelay (double delay)
+ {
+ m_linkDelay = delay;
+ }
+
+ /**
+ * @brief Get link delay (in seconds)
+ */
+ virtual double
+ GetLinkDelay () const
+ {
+ return m_linkDelay;
+ }
+
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
@@ -154,6 +190,8 @@
double m_maxDelay;
CallbackHandler m_handler;
+
+ double m_linkDelay;
};