<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Amin,<div><br></div><div>First thing (SRtt) is "average" value of RTT and the other (RttVar) is variance of RTT measurements.  The implementation is similar to TCP RTT measurements.</div><div><br></div><div>Since it was not really used anywhere, the value of RTT was updated only when PIT entry is satisfied.  And you're absolutely right saying that when PIT entry is timed out, there should be some action.  I'm not sure about infinity, but it should somehow impact the measurement, but we need to find out what is the best way.</div><div><br></div><div>I'm not quite sure what do you mean by "changed to string variable to be printable".  You can directly print out either RTT variation or smoothed RTT on std::cout.  You can do it as simple as:</div><div><br></div><div>std::cout << fibEntry->GetRttVar() << std::endl;</div><div><br></div><div>or a little bit more complicated</div><div><br></div><div>std::cout << fibEntry->GetRttVar().ToDouble(Time::S) << std::endl;</div><div><br></div><div>---</div><div>Alex</div><div><br></div><div><div><div>On Nov 17, 2013, at 2:16 PM, Amin Karami <<a href="mailto:amin@ac.upc.edu">amin@ac.upc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Alex,<br>
      What is the different between implementation of these two outputs:
      'GetSRtt' (<span style="color: rgb(85, 85, 85); font-family:
        'Lucida Grande', Verdana, Geneva, Arial, sans-serif; font-size:
        13px; font-style: normal; font-variant: normal; font-weight:
        normal; letter-spacing: normal; line-height: 16px; orphans:
        auto; text-align: start; text-indent: 0px; text-transform: none;
        white-space: normal; widows: auto; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgb(250, 250,
        250); display: inline !important; float: none;">Get current
        estimate for smoothed RTT value<span class="Apple-converted-space">)</span></span> and 'GetRttVar'
      (<span style="color: rgb(85, 85, 85); font-family: 'Lucida
        Grande', Verdana, Geneva, Arial, sans-serif; font-size: 13px;
        font-style: normal; font-variant: normal; font-weight: normal;
        letter-spacing: normal; line-height: 16px; orphans: auto;
        text-align: start; text-indent: 0px; text-transform: none;
        white-space: normal; widows: auto; word-spacing: 0px;
        -webkit-text-stroke-width: 0px; background-color: rgb(250, 250,
        250); display: inline !important; float: none;">Get current
        estimate for the RTT variation</span>)? For those PIT entries
      which are reached to their timeout, what is the output? infinity?<br>
      <br>
      I also faced with an error in printing "metric->GetRttVar". I
      changed it to string variable to be printable in std::cout. But
      gives me error in the type of "metric->GetRttVar" and cannot
      change it to string value to be printable. What it is the
      solution?<br>
      <br>
      <br>
      /Amin<br>
      <br>
      <br>
      On 11/17/2013 09:05 ب.ظ, Alex Afanasyev wrote:<br>
    </div>
    <blockquote cite="mid:5E8E9877-B35A-4A78-B2F6-8B418495A057@ucla.edu" type="cite">
      <pre wrap="">Hi Amin,

Are you trying to print out PIT of FIB contents?  If PIT, then you first need to decide what kind of face information you want to print out.  There are three different things that you can access:

1. Incoming faces
2. Outgoing faces
3. Faces that are associated with the FIB entry

Your code looks like you want to print out faces that are associated FIB entry.  For this, you need to do a small modification:  add GetFibEntry() call on the PIT entry:

   for (FaceMetricContainer::type::index<i_nth>::type::iterator metric = entry->GetFibEntry()->m_faces.get<i_nth> ().begin();
        metric != entry->GetFibEntry()->m_faces.get<i_nth> ().end(); metric++)
     {
         os << metric->GetSRtt () << ", " << metric->GetRttVar << "\t";
     }

---
Alex

On Nov 17, 2013, at 7:52 AM, Amin Karami <a class="moz-txt-link-rfc2396E" href="mailto:amin@ac.upc.edu"><amin@ac.upc.edu></a> wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">Hi Alex,
I wrote a function as follows based on your guidance to print out PIT contents:
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/ndnSIM-module.h"
#include "ns3/ndn-fib-entry.h"
#include "ns3/ndn-fib.h"

using namespace ns3;
using namespace ndn;
using namespace fib;

void PeriodicStatsPrinter (Ptr<Node> node, Time next)
{

Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
for (Ptr<ndn::pit::Entry> entry = pit->Begin (); entry != pit->End (); entry = pit->Next (entry))
 {
   std::cout << "=========" << std::endl;
   std::cout << entry->GetPrefix () << std::endl;

   for (FaceMetricContainer::type::index<i_nth>::type::iterator metric = entry->m_faces.get<i_nth> ().begin();
        metric != entry->m_faces.get<i_nth> ().end(); metric++)
     {
         os << metric->GetSRtt () << ", " << metric->GetRttVar << "\t";
     }

   // Print Prefix name, In Interface, Out Interface, Nonces
   //std::cout << *entry << std::endl;
 }
 Simulator::Schedule (next, PeriodicStatsPrinter, node, next);
}

When I ran the scenario, I faced with an error:
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>: In function ‘void PeriodicStatsPrinter(ns3::Ptr<ns3::Node>, ns3::Time)’:
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:38:82: error: ‘class ns3::ndn::pit::Entry’ has no member named ‘m_faces’
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:38:99: error: expected primary-expression before ‘>’ token
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:38:102: error: expected primary-expression before ‘)’ token
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:39:27: error: ‘class ns3::ndn::pit::Entry’ has no member named ‘m_faces’
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:39:44: error: expected primary-expression before ‘>’ token
../scratch/PIT/<a href="http://PITInfo.cc">PITInfo.cc</a>:39:47: error: expected primary-expression before ‘)’ token


But, i call "ndn-fib-entry.h" and "ndn-fib.h" to declare the variables. Where is the problem?


/Amin


On 09/28/2013 03:43 ق.ظ, Alex Afanasyev wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">Hi Amin,

Since this information belongs to each individual face (FaceMetric instance) inside FIB entry, you need to access individual items like this:

Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
for (Ptr<ndn::pit::Entry> entry = pit->Begin (); entry != pit->End (); entry = pit->Next (entry))
  {
    std::cout << "=========" << std::endl;
    std::cout << entry->GetPrefix () << std::endl;

    for (FaceMetricContainer::type::index<i_nth>::type::iterator metric =
           entry->m_faces.get<i_nth> ().begin ();
         metric != entry->m_faces.get<i_nth> ().end ();
         metric++)
      {
        os << metric->GetSRtt () << ", " << metric->GetRttVar << "\t";
      }
  }

---
Alex

On Sep 27, 2013, at 4:48 AM, Amin Karami <a class="moz-txt-link-rfc2396E" href="mailto:amin@ac.upc.edu"><amin@ac.upc.edu></a> wrote:

</pre>
          <blockquote type="cite">
            <pre wrap="">Hi Alex,
If we want to print some extra information such as, RTT (or incoming time of Interest into PIT and the response time) for each entry, what we should do?
Thanks a lot.

I looking forward to your response.

Best Regards,
Amin


On 09/26/2013 06:25 ق.ظ, Alex Afanasyev wrote:
</pre>
            <blockquote type="cite">
              <pre wrap="">Hi Liu,

You can do something like this:

input: Ptr<Node> node;

Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
for (Ptr<ndn::pit::Entry> entry = pit->Begin (); entry != pit->End (); entry = pit->Next (entry))
  {
    std::cout << *entry << std::endl;
  }

This will print out content of each PIT entry in the default format.  If you want some customizations, you can either directly access elements of PIT entry, or modify Print method of Pit implementation.

---
Alex

On Sep 25, 2013, at 6:41 PM, 刘总真 <a class="moz-txt-link-rfc2396E" href="mailto:liuzongzhen@cstnet.cn"><liuzongzhen@cstnet.cn></a> wrote:

</pre>
              <blockquote type="cite">
                <pre wrap="">Hi Alex,

I want to print out PIT contents, such as the incoming and outgoing interface. But I don’t know which function to use. Any suggestion?Thanks a lot!

Looking forward to your response.

Liu Zongzhen
</pre>
              </blockquote>
              <pre wrap="">_______________________________________________
ndnSIM mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a>
<a class="moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a>
</pre>
            </blockquote>
            <pre wrap="">_______________________________________________
ndnSIM mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a>
<a class="moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a>
</pre>
          </blockquote>
        </blockquote>
        <pre wrap="">_______________________________________________
ndnSIM mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a>
<a class="moz-txt-link-freetext" href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a>
</pre>
      </blockquote>
      <pre wrap=""></pre>
    </blockquote>
  </div>

_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim<br></blockquote></div><br></div></body></html>