model+helper: Adding new variable (realDelay) which is currently set by the global routing controller.
This variable can be used to analyze behavior of RTT estimation or some
other analysis tasks.
diff --git a/helper/ndn-global-routing-helper.cc b/helper/ndn-global-routing-helper.cc
index cda977a..1eb9d1f 100644
--- a/helper/ndn-global-routing-helper.cc
+++ b/helper/ndn-global-routing-helper.cc
@@ -283,6 +283,8 @@
<< " with delay " << i->second.get<2> ());
Ptr<fib::Entry> entry = fib->Add (prefix, i->second.get<0> (), i->second.get<1> ());
+ entry->SetRealDelayToProducer (i->second.get<0> (), Seconds (i->second.get<2> ()));
+
Ptr<Limits> faceLimits = i->second.get<0> ()->GetObject<Limits> ();
Ptr<Limits> fibLimits = entry->GetObject<Limits> ();
diff --git a/model/fib/ndn-fib-entry.cc b/model/fib/ndn-fib-entry.cc
index 750f9da..c04e43b 100644
--- a/model/fib/ndn-fib-entry.cc
+++ b/model/fib/ndn-fib-entry.cc
@@ -132,6 +132,21 @@
}
void
+Entry::SetRealDelayToProducer (Ptr<Face> face, Time delay)
+{
+ NS_LOG_FUNCTION (this);
+ NS_ASSERT_MSG (face != NULL, "Trying to Update NULL face");
+
+ FaceMetricByFace::type::iterator record = m_faces.get<i_face> ().find (face);
+ if (record != m_faces.get<i_face> ().end ())
+ {
+ m_faces.modify (record,
+ (&ll::_1)->*&FaceMetric::m_realDelay = delay);
+ }
+}
+
+
+void
Entry::Invalidate ()
{
for (FaceMetricByFace::type::iterator face = m_faces.begin ();
diff --git a/model/fib/ndn-fib-entry.h b/model/fib/ndn-fib-entry.h
index 272d801..a98dc66 100644
--- a/model/fib/ndn-fib-entry.h
+++ b/model/fib/ndn-fib-entry.h
@@ -69,6 +69,7 @@
, m_routingCost (cost)
, m_sRtt (Seconds (0))
, m_rttVar (Seconds (0))
+ , m_realDelay (Seconds (0))
{ }
/**
@@ -110,6 +111,8 @@
Time m_sRtt; ///< \brief smoothed round-trip time
Time m_rttVar; ///< \brief round-trip time variation
+
+ Time m_realDelay; ///< \brief real propagation delay to the producer, calculated based on NS-3 p2p link delays
};
/// @cond include_hidden
@@ -194,6 +197,12 @@
void AddOrUpdateRoutingMetric (Ptr<Face> face, int32_t metric);
/**
+ * \brief Set real delay to the producer
+ */
+ void
+ SetRealDelayToProducer (Ptr<Face> face, Time delay);
+
+ /**
* @brief Invalidate face
*
* Set routing metric on all faces to max and status to RED