<div dir="ltr">Hi everyone,<div>I'm trying to perform an Interest flooding attack by sending a large number of Interest packets to a data producer in order to flood PIT tables of  intermediate router using the code bellow, but the PIT size didnt exceed 4 entries, could please help me on that.</div><div><br></div><div>Best regards</div><div><br></div>// IFA.cpp based on ndn-tree-cs-tracers.cpp <br>// using topo-small-binary-tree.txt Topology<br>//<br>#include "ns3/core-module.h"<br>#include "ns3/network-module.h"<br>#include "ns3/ndnSIM-module.h"<br>//#include "ndn/L3RateTracer.h"<br>namespace ns3 {<br><br>/**<br> * This scenario simulates an Interest flooding attack on a tree topology (using topology reader module)<br> *<br> *    /------\      /------\      /------\      /------\<br> *    |rtr-1|      |rtr-2|      |lrtr-3|      |rtr-4|<br> *    \------/      \------/      \------/      \------/<br> *         ^          ^                ^           ^<br> *         |          |                |           |<br> *          \        /                  \         /<br> *           \      /                    \       /    10Mbps / 1ms<br> *            \    /                      \     /<br> *             |  |                        |   |<br> *             v  v                        v   v<br> *          /-------\                    /-------\<br> *          | rtr-1 |                    | rtr-2 |<br> *          \-------/                    \-------/<br> *                ^                        ^<br> *                |                        |<br> *                 \                      /  10 Mpbs / 1ms<br> *                  +--------+  +--------+<br> *                           |  |<br> *                           v  v<br> *                        /--------\<br> *                        |  root  |<br> *                        \--------/<br> *<br> *<br> * To run scenario and see what is happening, use the following command:<br> *<br> *     ./waf --run=IFA<br> */<br><br>int<br>main(int argc, char* argv[])<br>{<br>  CommandLine cmd;<br>  cmd.Parse(argc, argv);<br><br>  AnnotatedTopologyReader topologyReader("", 1);<br>  topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-small-binary-tree.txt");<br>  topologyReader.Read();<br><br>  // Install NDN stack on all nodes<br>  ndn::StackHelper ndnHelper;<br>  ndnHelper.setPolicy("nfd::cs::lru");<br>  ndnHelper.setCsSize(100);<br>  ndnHelper.InstallAll();<br><br>  // Choosing forwarding strategy<br>  ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");<br><br>  // Installing global routing interface on all nodes<br>  ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;<br>  ndnGlobalRoutingHelper.InstallAll();<br><br>  // Getting containers for the consumer/producer<br>  Ptr<Node> consumers[4] = {Names::Find<Node>("NodeC1"), Names::Find<Node>("NodeC2"),<br>                            Names::Find<Node>("NodeC3"), Names::Find<Node>("NodeC4")};<br>  Ptr<Node> producer = Names::Find<Node>("NodeP1");<br><br>  for (int i = 0; i < 4; i++) {<br>    ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br>       // Each consumer will express the same data /root/<seq-no><br>    if(i==0){<br>      consumerHelper.SetAttribute("Frequency", StringValue("200")); // Attacker sends 200 interests a second <br>      consumerHelper.SetPrefix("/prefix/rand()");<br>    }else{<br>      consumerHelper.SetAttribute("Frequency", StringValue("10")); // each Ligitimate user sends 10 interests a second<br>      consumerHelper.SetPrefix("/prefix");<br>    }<br>    ApplicationContainer app = consumerHelper.Install(consumers[i]);<br>    app.Start(Seconds(0.01 * i));<br>  }<br><br>  ndn::AppHelper producerHelper("ns3::ndn::Producer");<br>  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));<br><br>  // Register /root prefix with global routing controller and<br>  // install producer that will satisfy Interests in /root namespace<br>  ndnGlobalRoutingHelper.AddOrigins("/prefix", producer);<br>  producerHelper.SetPrefix("/prefix");<br>  producerHelper.Install(producer);<br>  // Calculate and install FIBs<br>  ndn::GlobalRoutingHelper::CalculateRoutes();<br><br>  Simulator::Stop(Seconds(20.0));<br>  ndn::L3RateTracer::InstallAll("rate-trace-IFA.txt", Seconds(19.0));<br>  Simulator::Run();<br>  Simulator::Destroy();<br>  return 0;<br>}<br>} // namespace ns3<br>int<br>main(int argc, char* argv[])<br>{  return ns3::main(argc, argv);}<br><div> </div></div>