[ndnSIM] ndnSIM: hijacker doesn't work and empty PIT
fabrizio saponaro
fab.batta at gmail.com
Sun Nov 24 13:42:49 PST 2013
I'm working on a simple tree topology. I want that one specific node
(a router) works like an hijacker, so I tried to set this node to
Hijacker but this node works like a normal node and forward everything
to the correct destination.
Furthermore I can't fill the PITs of every node of the topology, if I
try to simulate the application, every PIT is empty, but with the
visualizer I can see that every packet pass toward every node.
This is my code:
// Install CCNx stack on all nodes
ndn::StackHelper ccnxHelper;
ccnxHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
ccnxHelper.SetPit ("ns3::ndn::pit::SerializedSize", "MaxSize", "100");
ccnxHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "1");
// Content Store OFF
ccnxHelper.InstallAll ();
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
ccnxGlobalRoutingHelper.InstallAll ();
// Getting containers for the consumer/producer
Ptr<Node> consumer1 = Names::Find<Node> ("leaf-1");
Ptr<Node> consumer2 = Names::Find<Node> ("leaf-2");
Ptr<Node> consumer4 = Names::Find<Node> ("leaf-4");
Ptr<Node> producer = Names::Find<Node> ("leaf-3");
Ptr<Node> router3 = Names::Find<Node> ("rtr-3");
Ptr<Node> router2 = Names::Find<Node> ("rtr-2");
Ptr<Node> router1 = Names::Find<Node> ("rtr-1");
//consumerswindow
ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerWindow");
consumerHelper.SetAttribute ("Window", UintegerValue (100));
consumerHelper.SetAttribute ("Size", StringValue("0.1"));
consumerHelper.SetPrefix ("/rtr-3/leaf-3");
consumerHelper.Install (consumer1);
consumerHelper.SetPrefix ("/rtr-3/leaf-3");
consumerHelper.Install (consumer2);
//hijaker router1
ndn::AppHelper hijackerHelper ("Hijacker");
hijackerHelper.Install (router1);
//attacker consumercbr
ndn::AppHelper consumerHelper_attack ("ns3::ndn::ConsumerCbr");
consumerHelper_attack.SetAttribute ("Frequency", StringValue ("1"));
consumerHelper_attack.SetPrefix ("/rtr-3/leaf-3");
consumerHelper_attack.Install (consumer4);
//producer leaf-3
ndn::AppHelper producerHelper ("ns3::ndn::Producer");
producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
ccnxGlobalRoutingHelper.AddOrigins ("/rtr-3", producer);
producerHelper.SetPrefix ("/rtr-3");
producerHelper.Install (producer);
// Calculate and install FIBs
ccnxGlobalRoutingHelper.CalculateRoutes ();
Simulator::Schedule (Seconds (1.0), printPitStats, router1);
//print statistics about PIT
Simulator::Stop (Seconds (5.0));
Simulator::Run ();
Simulator::Destroy ();
Where am I wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20131124/69dccf07/attachment.html>
More information about the ndnSIM
mailing list