<div dir="ltr">Hi everyone, how to gain access to forwarder in order to record the evolution of the PIT size of an intermediate  router during a simulation, I'm working on ndn-simple.cpp example <div>/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */<br>/**<br> * Copyright (c) 2011-2015  Regents of the University of California.<br> *<br> * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and<br> * contributors.<br> *<br> * ndnSIM is free software: you can redistribute it and/or modify it under the terms<br> * of the GNU General Public License as published by the Free Software Foundation,<br> * either version 3 of the License, or (at your option) any later version.<br> *<br> * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;<br> * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR<br> * PURPOSE.  See the GNU General Public License for more details.<br> *<br> * You should have received a copy of the GNU General Public License along with<br> * ndnSIM, e.g., in COPYING.md file.  If not, see <<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>>.<br> **/<br><br>// ndn-simple.cpp<br><br>#include "ns3/core-module.h"<br>#include "ns3/network-module.h"<br>#include "ns3/point-to-point-module.h"<br>#include "ns3/ndnSIM-module.h"<br><br>namespace ns3 {<br><br>/**<br> * This scenario simulates a very simple network topology:<br> *<br> *<br> *      +----------+     1Mbps      +--------+     1Mbps      +----------+<br> *      | consumer | <------------> | router | <------------> | producer |<br> *      +----------+         10ms   +--------+          10ms  +----------+<br> *<br> *<br> * Consumer requests data from producer with frequency 10 interests per second<br> * (interests contain constantly increasing sequence number).<br> *<br> * For every received interest, producer replies with a data packet, containing<br> * 1024 bytes of virtual payload.<br> *<br> * To run scenario and see what is happening, use the following command:<br> *<br> *     NS_LOG=ndn.Consumer:ndn.Producer ./waf --run=ndn-simple<br> */<br><br>int<br>main(int argc, char* argv[])<br>{<br>  // setting default parameters for PointToPoint links and channels<br>  Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));<br>  Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));<br>  Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));<br><br>  // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize<br>  CommandLine cmd;<br>  cmd.Parse(argc, argv);<br><br>  // Creating nodes<br>  NodeContainer nodes;<br>  nodes.Create(3);<br><br>  // Connecting nodes using two links<br>  PointToPointHelper p2p;<br>  p2p.Install(nodes.Get(0), nodes.Get(1));<br>  p2p.Install(nodes.Get(1), nodes.Get(2));<br><br>  // Install NDN stack on all nodes<br>  ndn::StackHelper ndnHelper;<br>  ndnHelper.SetDefaultRoutes(true);<br>  ndnHelper.InstallAll();<br><br>  // Choosing forwarding strategy<br>  ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/multicast");<br><br>  // Installing applications<br><br>  // Consumer<br>  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br>  // Consumer will request /prefix/0, /prefix/1, ...<br>  consumerHelper.SetPrefix("/prefix");<br>  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second<br>  auto apps = consumerHelper.Install(nodes.Get(0));                        // first node<br>  apps.Stop(Seconds(10.0)); // stop the consumer app at 10 seconds mark<br><br>  // Producer<br>  ndn::AppHelper producerHelper("ns3::ndn::Producer");<br>  // Producer will reply to all requests starting with /prefix<br>  producerHelper.SetPrefix("/prefix");<br>  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));<br>  producerHelper.Install(nodes.Get(2)); // last node<br><br>  Simulator::Stop(Seconds(20.0));<br><br>  Simulator::Run();<br>  Simulator::Destroy();<br><br>  return 0;<br>}<br><br>} // namespace ns3<br><br>int<br>main(int argc, char* argv[])<br>{<br>  return ns3::main(argc, argv);<br>}<br></div></div>