<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;" class="">Hello everyone,<div class="">I have run below scenario, but i received zero for cache hit ( in <span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class="">cs-simple2-trace.txt file) </span>. is there any one that knows what is the reason.</div><div class="">any help will be appreciate</div><div class="">thanks</div><div class="">best regards</div><div class="">zeinab</div><div class=""><br class=""></div><div class="">scenario</div><div class="">—————————</div><div class=""><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(120, 73, 42);">#include </span>"ns3/core-module.h"</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(120, 73, 42);">#include </span>"ns3/network-module.h"</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(120, 73, 42);">#include </span>"ns3/point-to-point-module.h"</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(120, 73, 42);">#include </span>"ns3/ndnSIM-module.h"</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);">using<span class="" style="color: rgb(0, 0, 0);"> </span>namespace<span class="" style="color: rgb(0, 0, 0);"> ns3;</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">//for trace</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);">class</span> PcapWriter {</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);">public<span class="" style="color: rgb(0, 0, 0);">:</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  PcapWriter(<span class="" style="color: rgb(187, 44, 162);">const</span> std::string& file)</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  {</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    PcapHelper helper;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    m_pcap = helper.CreateFile(file, std::ios::out, PcapHelper::DLT_PPP);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  }</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);">  </span>void</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  TracePacket(Ptr<<span class="" style="color: rgb(187, 44, 162);">const</span> Packet> packet)</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  {</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span class="" style="color: rgb(187, 44, 162);">static</span> PppHeader pppHeader;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    pppHeader.SetProtocol(<span class="" style="color: rgb(39, 42, 216);">0x0077</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    m_pcap->Write(Simulator::Now(), pppHeader, packet);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  }</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);">private<span class="" style="color: rgb(0, 0, 0);">:</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Ptr<PcapFileWrapper> m_pcap;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">};</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(187, 44, 162);">int</span> </div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">main (<span class="" style="color: rgb(187, 44, 162);">int</span> argc, <span class="" style="color: rgb(187, 44, 162);">char</span> *argv[])</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">{</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// setting default parameters for PointToPoint links and channels</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(0, 0, 0);">  Config::SetDefault (</span>"ns3::PointToPointNetDevice::DataRate"<span class="" style="color: rgb(0, 0, 0);">, StringValue (</span>"1Mbps"<span class="" style="color: rgb(0, 0, 0);">));</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Config::SetDefault (<span class="" style="color: rgb(209, 47, 27);">"ns3::PointToPointChannel::Delay"</span>, StringValue (<span class="" style="color: rgb(209, 47, 27);">"10ms"</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Config::SetDefault (<span class="" style="color: rgb(209, 47, 27);">"ns3::DropTailQueue::MaxPackets"</span>, StringValue (<span class="" style="color: rgb(209, 47, 27);">"20"</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  CommandLine cmd;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  cmd.Parse (argc, argv);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Creating nodes</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>// NodeContainer nodes;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//nodes.Create (3);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  NodeContainer routerNodes;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  <span class="Apple-tab-span" style="white-space: pre;">       </span>NodeContainer producerNodes;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  <span class="Apple-tab-span" style="white-space: pre;">    </span>NodeContainer consumerNodes;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">   </span>routerNodes.Create(<span class="" style="color: rgb(39, 42, 216);">9</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">               </span>producerNodes.Create(<span class="" style="color: rgb(39, 42, 216);">3</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">             </span>consumerNodes.Create(<span class="" style="color: rgb(39, 42, 216);">6</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Connecting nodes using two links</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>// PointToPointHelper p2p;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//p2p.Install (nodes.Get (0), nodes.Get (1));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//p2p.Install (nodes.Get (1), nodes.Get (2));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">               </span>PointToPointHelper p2p;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                      </span>    </span>//Router 0</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">3</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">6</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    </span>//Router 1</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">4</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">7</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    </span>//Router 2</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">5</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                    </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">8</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    </span>//Router 3</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                     </span>    </span>//Router 4</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                     </span>    </span>//Router 5</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                     </span>    </span>//Router 6</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                     </span>    </span>//Router 7</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                     </span>    </span>//Router 8</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                        </span>    </span>//Producers</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                 </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">3</span>), producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">4</span>), producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">5</span>), producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"><span class="Apple-tab-span" style="white-space: pre;">                        </span>    </span>//Consumers</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                 </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">6</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">7</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">8</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">3</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">3</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">4</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">4</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"><span class="Apple-tab-span" style="white-space: pre;">                  </span>    p2p.Install(consumerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">5</span>), routerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">5</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Install NDN stack on all nodes</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ndn::StackHelper ccnxHelper;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ccnxHelper.SetContentStore(<span class="" style="color: rgb(209, 47, 27);">"ns3::ndn::cs::Lru"</span>, <span class="" style="color: rgb(209, 47, 27);">"MaxSize"</span>, <span class="" style="color: rgb(209, 47, 27);">"10000"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">//set the life time for satisfied interest message </div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(0, 0, 0);">ccnxHelper.SetPit (</span>"ns3::ndn::pit::Lru"<span class="" style="color: rgb(0, 0, 0);">,</span>"PitEntryPruningTimout"<span class="" style="color: rgb(0, 0, 0);">,</span>"20"<span class="" style="color: rgb(0, 0, 0);">); </span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>/*ccnxHelper.Install(routerNodes);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">  ccnxHelper.SetContentStore("ns3::ndn::cs::Nocache");</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">  ccnxHelper.Install(producerNodes);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">  ccnxHelper.Install(consumerNodes);*/</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>//ccnxHelper.InstallAll ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>// ccnxHelper.SetDefaultRoutes (true);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//ccnxHelper.InstallAll ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Install NDN stack on all nodes</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// ndn::StackHelper ndnHelper;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ccnxHelper.SetForwardingStrategy (<span class="" style="color: rgb(209, 47, 27);">"ns3::ndn::fw::BestRoute"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ccnxHelper.InstallAll ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">    </span>// Installing global routing interface on all nodes</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">      ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">      ndnGlobalRoutingHelper.InstallAll ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Installing applications</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Consumer</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    <span class="" style="color: rgb(187, 44, 162);">for</span> ( <span class="" style="color: rgb(187, 44, 162);">int</span> i=<span class="" style="color: rgb(39, 42, 216);">0</span>; i<<span class="" style="color: rgb(39, 42, 216);">6</span>; i++)</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    {  ndn::AppHelper consumerHelper (<span class="" style="color: rgb(209, 47, 27);">"ns3::ndn::ConsumerCbr"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Consumer will request /prefix/0, /prefix/1, ...</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  consumerHelper.SetPrefix (<span class="" style="color: rgb(209, 47, 27);">"/prefix"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  consumerHelper.SetAttribute (<span class="" style="color: rgb(209, 47, 27);">"Frequency"</span>, StringValue (<span class="" style="color: rgb(209, 47, 27);">"10"</span>)); <span class="" style="color: rgb(0, 132, 0);">// 10 interests a second</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">//for interest life time</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;"> consumerHelper.SetAttribute (<span class="" style="color: rgb(209, 47, 27);">"LifeTime"</span>, StringValue (<span class="" style="color: rgb(209, 47, 27);">"20s"</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//consumerHelper.Install (nodes.Get (0)); // first node</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ApplicationContainer consumer = consumerHelper.Install(consumerNodes.Get(i));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">        consumer.Start(Seconds(<span class="" style="color: rgb(39, 42, 216);">0.01</span> * i));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>// consumer.Start(Seconds(2));     // start consumers at 0s, 1s, 2s, 3s</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">       </span>// consumer.Stop(Seconds(19.0));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    }</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Producer</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ndn::AppHelper producerHelper (<span class="" style="color: rgb(209, 47, 27);">"ns3::ndn::Producer"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ApplicationContainer producers;</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Producer will reply to all requests starting with /prefix</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>/* producerHelper.SetPrefix ("/prefix");</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);">  producerHelper.Install (nodes.Get (2)); // last node*/</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  <span class="" style="color: rgb(187, 44, 162);">for</span> (<span class="" style="color: rgb(187, 44, 162);">unsigned</span> i=<span class="" style="color: rgb(39, 42, 216);">0</span>; i<producerNodes.GetN(); i++) {</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">    </span>// Producer will reply to all requests starting with /prefix</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    producerHelper.SetPrefix(<span class="" style="color: rgb(209, 47, 27);">"/prefix"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    producerHelper.SetAttribute(<span class="" style="color: rgb(209, 47, 27);">"PayloadSize"</span>, StringValue(<span class="" style="color: rgb(209, 47, 27);">"1024"</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  producers = producerHelper.Install(producerNodes.Get(i));}</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>// Add /prefix origins to ndn::GlobalRouter</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">   ndnGlobalRoutingHelper.AddOrigins(<span class="" style="color: rgb(209, 47, 27);">"/prefix"</span>, producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">0</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">   ndnGlobalRoutingHelper.AddOrigins(<span class="" style="color: rgb(209, 47, 27);">"/prefix"</span>, producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">1</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">   ndnGlobalRoutingHelper.AddOrigins(<span class="" style="color: rgb(209, 47, 27);">"/prefix"</span>, producerNodes.Get(<span class="" style="color: rgb(39, 42, 216);">2</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);"> </span>// Calculate and install FIBs</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  ndn::GlobalRoutingHelper::CalculateRoutes();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 132, 0);"><span class="" style="color: rgb(0, 0, 0);">  </span>//for trace</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    PcapWriter trace(<span class="" style="color: rgb(209, 47, 27);">"ndn-simple-trace.pcap"</span>);</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="color: rgb(0, 0, 0);">    Config::ConnectWithoutContext(</span>"/NodeList/*/DeviceList/*/$ns3::PointToPointNetDevice/MacTx"<span class="" style="color: rgb(0, 0, 0);">,</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">                                  MakeCallback(&PcapWriter::TracePacket, &trace));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Simulator::Stop (Seconds (<span class="" style="color: rgb(39, 42, 216);">20.0</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">    ndn::CsTracer::InstallAll(<span class="" style="color: rgb(209, 47, 27);">"cs-simple2-trace.txt"</span>, Seconds(<span class="" style="color: rgb(39, 42, 216);">1</span>));</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Simulator::Run ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">  Simulator::Destroy ();</div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br class=""></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(187, 44, 162);"><span class="" style="color: rgb(0, 0, 0);">  </span>return<span class="" style="color: rgb(0, 0, 0);"> </span><span class="" style="color: rgb(39, 42, 216);">0</span><span class="" style="color: rgb(0, 0, 0);">;</span></div><div class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">}</div></div></body></html>