<div dir="ltr">Dear HADIBI ABDENNOUR and NDNSIM Team<br><br>in this example the network is very simple, you have one producer and two subtree,  aech of them consist of gateway (border) router and two consumer<br>So to have more than 4 entries in PIT in the same topology you must to increase number of the attacker in the same subtree, also increas the number of the request that attraker must send every second <br><br><br>like this<br>for (int i = 0; i < 4; i++) {<br>  <br>      ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br>  if(i==0||  i==1){<br><br>    consumerHelper.SetAttribute("Frequency", StringValue("585"));<br>    }<br>    else {<br>    <br>    consumerHelper.SetAttribute("Frequency", StringValue("200")); <br>    }<br><br>   <br>    consumerHelper.SetPrefix("/root/" + Names::FindName(consumers[i]));<br>    consumerHelper.Install(consumers[i]);<br>  }<br><br><br>i adjust the number of request to 585 because after that the producer will collapses and becomes unable to respond to requests<br>show the attached photo <br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 24, 2021 at 4:24 PM HADIBI ABDENNOUR via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote></div>