<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Ok I implemented this quick fix into the code does it matter if I run it with visualizer or a debugger?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Justin Rodrigues<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Prajjwal Singh <csb17053@tezu.ac.in><br>
<b>Sent:</b> Tuesday, July 27, 2021 4:19 PM<br>
<b>To:</b> Justin Rodrigues <justin99@student.fdu.edu><br>
<b>Cc:</b> ndnsim@lists.cs.ucla.edu <ndnsim@lists.cs.ucla.edu><br>
<b>Subject:</b> [External]Re: [ndnSIM] No Cache Hits or Misses via ndnSim Example or anything else</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hello Justin,</div>
<div>Just as a quick fix to check which node had which interest Name prefix hit, here is what I would do.</div>
<div><br>
</div>
<div>open NFD/daemon/table/cs.hpp and tweak the find () function as the one below<br>
.</div>
<div>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC79" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-k">template</span><<span class="x_gmail-pl-k">typename</span> HitCallback,
<span class="x_gmail-pl-k">typename</span> MissCallback></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC80" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-k">void</span></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC81" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-en">find</span>(<span class="x_gmail-pl-k">const</span> Interest& interest, HitCallback&& hit, MissCallback&& miss)
<span class="x_gmail-pl-k">const</span></td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC82" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
{</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC83" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-k">auto</span> match = <span class="x_gmail-pl-c1">findImpl</span>(interest);</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC84" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
  <span class="x_gmail-pl-k"><br>
if</span> (match == m_table.<span class="x_gmail-pl-c1">end</span>()) {</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC85" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-c1">miss</span>(interest);</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC86" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-k">return</span>;</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC87" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
}<br>
<span class="x_gmail-pl-k">int node = ns3::Simulator::GetContext();</span> <br>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC85" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
std::cout<<"Node:"<<node<<"  HIT"<<"  for Name:"<<interest.getName()<<std::endl;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
<table class="x_gmail-highlight x_gmail-tab-size x_gmail-js-file-line-container">
<tbody>
<tr>
<td id="x_gmail-LC88" class="x_gmail-blob-code x_gmail-blob-code-inner x_gmail-js-file-line">
<span class="x_gmail-pl-c1">hit</span>(interest, match-><span class="x_gmail-pl-c1">getData</span>());</td>
</tr>
<tr>
</tr>
</tbody>
</table>
} <br>
</div>
<div><br>
</div>
<div>// instead of stdout you can output to a file.<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Wed, 28 Jul 2021, 01:34 Justin Rodrigues via ndnSIM, <<a href="mailto:ndnsim@lists.cs.ucla.edu" target="_blank">ndnsim@lists.cs.ucla.edu</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hello Everyone,<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
So right now I am running  a scenario where I have one consumer running four client requests. Based on the ndn-simple-with-content-freshness example:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
<div>/**</div>
<div> * Copyright (c) 2011-2015  Regents of the University of California.</div>
<div> *</div>
<div> * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and</div>
<div> * contributors.</div>
<div> *</div>
<div> * ndnSIM is free software: you can redistribute it and/or modify it under the terms</div>
<div> * of the GNU General Public License as published by the Free Software Foundation,</div>
<div> * either version 3 of the License, or (at your option) any later version.</div>
<div> *</div>
<div> * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;</div>
<div> * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR</div>
<div> * PURPOSE.  See the GNU General Public License for more details.</div>
<div> *</div>
<div> * You should have received a copy of the GNU General Public License along with</div>
<div> * ndnSIM, e.g., in COPYING.md file.  If not, see <<a href="https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.gnu.org%2Flicenses%2F&data=04%7C01%7Cjustin99%40student.fdu.edu%7Cbf457fb0b49c4e7fcf9708d9513be61e%7C3224fad94bcc4d47ae9886ea3c6b3b13%7C1%7C0%7C637630139984347941%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qHYKc5qSumZWEcpuAJRohs6BdbIHsJYBj7rj8DzEu5I%3D&reserved=0" originalsrc="http://www.gnu.org/licenses/" shash="FTpF8KLyhe4fs6Oy5dS/u6WClVDNujxDwX+wtR9/rVz1I39DciNVLP5W4F1FB1+5UO936ZENLW4CyDWOdYSuliAw8/ReWNDg93q94RJNS5FzNYYH7UzzwtSIU0lOWQiyUKXMpp/qfivBf9mtnzUWTxPCmlkQMaPzjMppVN3j148=" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>>.</div>
<div> **/</div>
<div><br>
</div>
<div>// ndn-simple-with-content-freshness.cpp</div>
<div><br>
</div>
<div>#include "ns3/core-module.h"</div>
<div>#include "ns3/network-module.h"</div>
<div>#include "ns3/point-to-point-module.h"</div>
<div>#include "ns3/ndnSIM-module.h"</div>
<div><br>
</div>
<div>namespace ns3 {</div>
<div><br>
</div>
<div>/**</div>
<div> * This scenario simulates a very simple network topology:</div>
<div> *</div>
<div> *</div>
<div> *      +----------+     1Mbps      +--------+     1Mbps      +----------+</div>
<div> *      | consumer | <------------> | router | <------------> | producer |</div>
<div> *      +----------+         10ms   +--------+          10ms  +----------+</div>
<div> *</div>
<div> * This scenario demonstrates how to use content store that responds to Freshness parameter set in</div>
<div> * data packets.  In other words, if the producer set FreshnessPeriod field to 2 seconds, the</div>
<div> * corresponding data packet will not be considered fresh for more than 2 seconds (can be cached</div>
<div> * for a shorter time, if entry is evicted earlier)</div>
<div> *</div>
<div> *     NS_LOG=OneInterestRequester ./waf --run ndn-simple-with-content-freshness</div>
<div> */</div>
<div><br>
</div>
<div>int</div>
<div>main(int argc, char* argv[])</div>
<div>{</div>
<div>  // setting default parameters for PointToPoint links and channels</div>
<div>  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));</div>
<div>  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));</div>
<div>  Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));</div>
<div><br>
</div>
<div>  // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize</div>
<div>  CommandLine cmd;</div>
<div>  cmd.Parse(argc, argv);</div>
<div><br>
</div>
<div>  // Creating nodes</div>
<div>  NodeContainer nodes;</div>
<div>  nodes.Create(3);</div>
<div><br>
</div>
<div>  // Connecting nodes using two links</div>
<div>  PointToPointHelper p2p;</div>
<div>  p2p.Install(nodes.Get(0), nodes.Get(1));</div>
<div>  p2p.Install(nodes.Get(1), nodes.Get(2));</div>
<div><br>
</div>
<div>  // Install Ndn stack on all nodes</div>
<div>  ndn::StackHelper ndnHelper;</div>
<div>  ndnHelper.SetDefaultRoutes(true);</div>
<div>  ndnHelper.setCsSize(2); // allow just 2 entries to be cached</div>
<div>  ndnHelper.setPolicy("nfd::cs::lru");</div>
<div>  ndnHelper.InstallAll();</div>
<div><br>
</div>
<div>  // Installing applications</div>
<div><br>
</div>
<div>  // Consumer</div>
<div>  ndn::AppHelper consumerHelper("OneInterestRequester");</div>
<div><br>
</div>
<div>  // /*</div>
<div>  //   1) at time 1 second requests Data from a producer that does not specify freshness Client 1<br>
</div>
<div>  //   <span style="background-color:rgb(255,255,0)">2</span>) at time 10 seconds requests the same Data packet as client 1</div>
<div><br>
</div>
<div>  //   3) at time 2 seconds requests Data from a producer that specifies freshness set to 2 seconds</div>
<div>  //   4) at time 12 seconds requests the same Data packet as client 3</div>
<div><br>
</div>
<div>  //   Expectation:</div>
<div>  //   Interests from 1, 3 and 4 will reach producers</div>
<div>  //   <span style="background-color:rgb(255,255,0)">Interset from 2 will be served from cache</span></div>
<div>  //  */</div>
<div><br>
</div>
<div>  consumerHelper.SetPrefix("/no-freshness");</div>
<div>  consumerHelper.Install(nodes.Get(0)).Start(Seconds(1));</div>
<div>  //nfd::cs::insert("/no-freshness",true);</div>
<div>  consumerHelper.Install(nodes.Get(0)).Start(Seconds(10));</div>
<div><br>
</div>
<div>  consumerHelper.SetPrefix("/with-freshness");</div>
<div>  consumerHelper.Install(nodes.Get(0)).Start(Seconds(2));</div>
<div>  consumerHelper.Install(nodes.Get(0)).Start(Seconds(12));</div>
<div><br>
</div>
<div><br>
</div>
<div>  </div>
<div>  // Producer</div>
<div>  ndn::AppHelper producerHelper("ns3::ndn::Producer");</div>
<div>  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));</div>
<div><br>
</div>
<div>  producerHelper.SetAttribute("Freshness", TimeValue(Years(100))); // freshness long enough</div>
<div>  producerHelper.SetPrefix("/no-freshness");</div>
<div>  producerHelper.Install(nodes.Get(2)); // last node</div>
<div><br>
</div>
<div>  producerHelper.SetAttribute("Freshness", TimeValue(Seconds(2.0))); // freshness 2 seconds (!!!</div>
<div>                                                                     // freshness granularity is 1</div>
<div>                                                                     // seconds !!!)</div>
<div>  producerHelper.SetPrefix("/with-freshness");</div>
<div>  producerHelper.Install(nodes.Get(2)); // last node</div>
<div><br>
</div>
<div>  </div>
<div>  ndn::L3RateTracer::InstallAll("../traces/rate-trace.txt", Seconds(1.0));</div>
<div>  L2RateTracer::InstallAll("../traces/drop-trace.txt", Seconds(1.0));</div>
<div>  ndn::AppDelayTracer::InstallAll("../traces/app-delays-trace.txt" );</div>
<div>  ndn::CsTracer::InstallAll("../traces/cs-trace.txt", Seconds(1.0));</div>
<div><br>
</div>
<div>  </div>
<div><br>
</div>
<div>  Simulator::Stop(Seconds(30.0));</div>
<div><br>
</div>
<div>  Simulator::Run();</div>
<div>  Simulator::Destroy();</div>
<div><br>
</div>
<div>  return 0;</div>
<div>}</div>
<div>} // namespace ns3</div>
<div><br>
</div>
<div>int</div>
<div>main(int argc, char* argv[])</div>
<div>{</div>
<div>  return ns3::main(argc, argv);</div>
}<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
That's the current code I am working with.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I want to prove without a shadow of a doubt that the 2nd Client is retrieving data from a cache hit basically. I can show it in visualizer but I was requested to also have this information in some trace file. I thought cs-tracer would work but all I get are
 0s in Cache hits and Misses even though I know that the information is being retrieved from the cache. Then I would use the app-delays trace file to show how the Round trip time of this client would be much shorter than the other 3 clients due to the fact
 that this client retrieved the data from the content store of the router as opposed to the interest being forwarded to the producer and then back to the router and then consumer.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Thanks,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Justin Rodrigues<br>
</div>
<div id="x_gmail-m_-9067590247663847625m_-4354069079694589600appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_gmail-m_-9067590247663847625m_-4354069079694589600divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Justin Rodrigues<br>
<b>Sent:</b> Monday, July 26, 2021 2:50 PM<br>
<b>To:</b> <a href="mailto:ndnsim@lists.cs.ucla.edu" rel="noreferrer" target="_blank">
ndnsim@lists.cs.ucla.edu</a> <<a href="mailto:ndnsim@lists.cs.ucla.edu" rel="noreferrer" target="_blank">ndnsim@lists.cs.ucla.edu</a>><br>
<b>Subject:</b> No Cache Hits or Misses via ndnSim Example or anything else </font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hello Everyone,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I hope you are doing well.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I am not sure why but when I run the example for cs-trace called ndn-tree-cs-tracers.cpp I get 0 cache hits and 0 misses is this normal in the cs-trace file? I need to understand how the hits or misses are accounted for I think something is wrong.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<pre><span>// ndn-tree-cs-tracers.cpp</span>

<span>#include</span> <span>"ns3/core-module.h"</span><span></span>
<span>#include</span> <span>"ns3/network-module.h"</span><span></span>
<span>#include</span> <span>"ns3/ndnSIM-module.h"</span><span></span>

<span>namespace</span> <span>ns3</span> <span>{</span>

<span>int</span>
<span>main</span><span>(</span><span>int</span> <span>argc</span><span>,</span> <span>char</span><span>*</span> <span>argv</span><span>[])</span>
<span>{</span>
  <span>CommandLine</span> <span>cmd</span><span>;</span>
  <span>cmd</span><span>.</span><span>Parse</span><span>(</span><span>argc</span><span>,</span> <span>argv</span><span>);</span>

  <span>AnnotatedTopologyReader</span> <span>topologyReader</span><span>(</span><span>""</span><span>,</span> <span>1</span><span>);</span>
  <span>topologyReader</span><span>.</span><span>SetFileName</span><span>(</span><span>"src/ndnSIM/examples/topologies/topo-tree.txt"</span><span>);</span>
  <span>topologyReader</span><span>.</span><span>Read</span><span>();</span>

  <span>// Install NDN stack on all nodes</span>
  <span>ndn</span><span>::</span><span>StackHelper</span> <span>ndnHelper</span><span>;</span>
  <span>ndnHelper</span><span>.</span><span>setPolicy</span><span>(</span><span>"nfd::cs::lru"</span><span>);</span>
  <span>ndnHelper</span><span>.</span><span>setCsSize</span><span>(</span><span>100</span><span>);</span>
  <span>ndnHelper</span><span>.</span><span>InstallAll</span><span>();</span>

  <span>// Choosing forwarding strategy</span>
  <span>ndn</span><span>::</span><span>StrategyChoiceHelper</span><span>::</span><span>InstallAll</span><span>(</span><span>"/prefix"</span><span>,</span> <span>"/localhost/nfd/strategy/best-route"</span><span>);</span>

  <span>// Installing global routing interface on all nodes</span>
  <span>ndn</span><span>::</span><span>GlobalRoutingHelper</span> <span>ndnGlobalRoutingHelper</span><span>;</span>
  <span>ndnGlobalRoutingHelper</span><span>.</span><span>InstallAll</span><span>();</span>

  <span>// Getting containers for the consumer/producer</span>
  <span>Ptr</span><span><</span><span>Node</span><span>></span> <span>consumers</span><span>[</span><span>4</span><span>]</span> <span>=</span> <span>{</span><span>Names</span><span>::</span><span>Find</span><span><</span><span>Node</span><span>></span><span>(</span><span>"leaf-1"</span><span>),</span> <span>Names</span><span>::</span><span>Find</span><span><</span><span>Node</span><span>></span><span>(</span><span>"leaf-2"</span><span>),</span>
                            <span>Names</span><span>::</span><span>Find</span><span><</span><span>Node</span><span>></span><span>(</span><span>"leaf-3"</span><span>),</span> <span>Names</span><span>::</span><span>Find</span><span><</span><span>Node</span><span>></span><span>(</span><span>"leaf-4"</span><span>)};</span>
  <span>Ptr</span><span><</span><span>Node</span><span>></span> <span>producer</span> <span>=</span> <span>Names</span><span>::</span><span>Find</span><span><</span><span>Node</span><span>></span><span>(</span><span>"root"</span><span>);</span>

  <span>for</span> <span>(</span><span>int</span> <span>i</span> <span>=</span> <span>0</span><span>;</span> <span>i</span> <span><</span> <span>4</span><span>;</span> <span>i</span><span>++</span><span>)</span> <span>{</span>
    <span>ndn</span><span>::</span><span>AppHelper</span> <span>consumerHelper</span><span>(</span><span>"ns3::ndn::ConsumerCbr"</span><span>);</span>
    <span>consumerHelper</span><span>.</span><span>SetAttribute</span><span>(</span><span>"Frequency"</span><span>,</span> <span>StringValue</span><span>(</span><span>"10"</span><span>));</span> <span>// 100 interests a second</span>

    <span>// Each consumer will express the same data /root/<seq-no></span>
    <span>consumerHelper</span><span>.</span><span>SetPrefix</span><span>(</span><span>"/root"</span><span>);</span>
    <span>ApplicationContainer</span> <span>app</span> <span>=</span> <span>consumerHelper</span><span>.</span><span>Install</span><span>(</span><span>consumers</span><span>[</span><span>i</span><span>]);</span>
    <span>app</span><span>.</span><span>Start</span><span>(</span><span>Seconds</span><span>(</span><span>0.01</span> <span>*</span> <span>i</span><span>));</span>
  <span>}</span>

  <span>ndn</span><span>::</span><span>AppHelper</span> <span>producerHelper</span><span>(</span><span>"ns3::ndn::Producer"</span><span>);</span>
  <span>producerHelper</span><span>.</span><span>SetAttribute</span><span>(</span><span>"PayloadSize"</span><span>,</span> <span>StringValue</span><span>(</span><span>"1024"</span><span>));</span>

  <span>// Register /root prefix with global routing controller and</span>
  <span>// install producer that will satisfy Interests in /root namespace</span>
  <span>ndnGlobalRoutingHelper</span><span>.</span><span>AddOrigins</span><span>(</span><span>"/root"</span><span>,</span> <span>producer</span><span>);</span>
  <span>producerHelper</span><span>.</span><span>SetPrefix</span><span>(</span><span>"/root"</span><span>);</span>
  <span>producerHelper</span><span>.</span><span>Install</span><span>(</span><span>producer</span><span>);</span>

  <span>// Calculate and install FIBs</span>
  <span>ndn</span><span>::</span><span>GlobalRoutingHelper</span><span>::</span><span>CalculateRoutes</span><span>();</span>

  <span>Simulator</span><span>::</span><span>Stop</span><span>(</span><span>Seconds</span><span>(</span><span>20.0</span><span>));</span>

<span>  <span>ndn</span><span>::</span><span>CsTracer</span><span>::</span><span>InstallAll</span><span>(</span><span>"cs-trace.txt"</span><span>,</span> <span>Seconds</span><span>(</span><span>1</span><span>));</span>
</span>
  <span>Simulator</span><span>::</span><span>Run</span><span>();</span>
  <span>Simulator</span><span>::</span><span>Destroy</span><span>();</span>

  <span>return</span> <span>0</span><span>;</span>
<span>}</span>

<span>}</span> <span>// namespace ns3</span>

<span>int</span>
<span>main</span><span>(</span><span>int</span> <span>argc</span><span>,</span> <span>char</span><span>*</span> <span>argv</span><span>[])</span>
<span>{</span>
  <span>return</span> <span>ns3</span><span>::</span><span>main</span><span>(</span><span>argc</span><span>,</span> <span>argv</span><span>);</span>
<span>}</span></pre>
Above is the source file that I am creating the trace file from which can be found via this link:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fndnsim.net%2Fcurrent%2Fmetric.html%3Fhighlight%3Dobtaining%2520metrics&data=04%7C01%7Cjustin99%40student.fdu.edu%7Cbf457fb0b49c4e7fcf9708d9513be61e%7C3224fad94bcc4d47ae9886ea3c6b3b13%7C1%7C0%7C637630139984347941%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hCIsSbyNNej8LOhhOPouHa3MPP8r%2F9tn3E5YF5aYofI%3D&reserved=0" originalsrc="https://ndnsim.net/current/metric.html?highlight=obtaining%20metrics" shash="XrOD9eV5/UR5trPTAav41SkJQqrdndGbJMd+KjFY/b+XD//Pwewynb/Nj/Eydq+36ULHs+DV0dHrw/Fwj/SYiRmfIV7JtkQwl+0x/d0csZ0QJQz6JiDD5veFlNdeuU+m3KBSHmkM/cKj3SoIh24cKonyUwzu52nptyZqoiv9vqg=" id="x_gmail-m_-9067590247663847625m_-4354069079694589600LPlnk672623" rel="noreferrer" target="_blank">https://ndnsim.net/current/metric.html?highlight=obtaining%20metrics</a></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Thanks,<br>
<br>
Justin Rodrigues<br>
</div>
</div>
</div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" rel="noreferrer" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.lists.cs.ucla.edu%2Fmailman%2Flistinfo%2Fndnsim&data=04%7C01%7Cjustin99%40student.fdu.edu%7Cbf457fb0b49c4e7fcf9708d9513be61e%7C3224fad94bcc4d47ae9886ea3c6b3b13%7C1%7C0%7C637630139984357933%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ubiwr7y9sMAqJaMk5EYrVqYSn%2BMKjcNg6pHLYoHC0l4%3D&reserved=0" originalsrc="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" shash="L2G0yfJBGYvifbZcn0MPHLaFODmwMIEBCCMDpjUBs3Y2LbGl52YD6IXInFu1g7pNw77CXoya0dkP3Bv7yVnW1dpuaVx1LP/EEHUrgcWICcwx7AWX8t6n2WsMEM4MvtuGxGvbC1vCsa02zFGnzRqPltRn38c9ZCegphMMFz62yjI=" rel="noreferrer noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote>
</div>
</div>
</body>
</html>