[ndnSIM] How to make NDN node choose another path that aren't affect by the hijacker

Prasetyo Adi Wibowo prasetyoadiwibowo92 at gmail.com
Sun Jan 24 01:39:51 PST 2016


Hi,

It's my first time using NDNsim and I tried to create a hijacker scenario.
Everytime I run the program, packet interest that's been sent always pass
through the nodes that affected by hijack(R3-H), although in the topology
that I made there are other path that aren't affected by hijack(R2). Could
you tell me how to make the packet interest choose another path that aren't
affect by the hijacker(change to R2 when first attempt was hijacked by
R3-H)? Is it possible to do that?

This is my topology
#                                /----\
#                             +=>| R2 |<=+
#                            /   \----/   \
#                           /              \
#                          /                \
#   /---\         /----\<=+                  +=>/----\         /---\
#   | C |<------->| R1 |                        | R4 |<------->| P |
#   \---/         \----/<=+                  +=>\----/         \---/
#                          \                /
#                           \              /
#                            \   /----\   /
#                             +=>| R3 |<=+
#                                \----/

#-------y code : ------#
  AnnotatedTopologyReader topologyReader("", 100);

topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-custom-hijack.txt");
  topologyReader.Read();

  // Install NDN stack on all nodes
  ndn::StackHelper ndnHelper;
  ndnHelper.SetDefaultRoutes (false);

  // Getting containers for the consumer/producer
  Ptr<Node> producer = Names::Find<Node>("P");
  Ptr<Node> h1 = Names::Find<Node>("R3");
  Ptr<Node> consumer=Names::Find<Node>("C");

  ndnHelper.InstallAll();

  // Installing global routing interface on all nodes
  ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
  ndnGlobalRoutingHelper.InstallAll();

  // Install NDN applications
  std::string prefix = "/prefix/sub";

  ndn::StrategyChoiceHelper::InstallAll("/prefix/sub",
"ndn:/localhost/nfd/strategy/best-route");

  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
  consumerHelper.SetPrefix(prefix);
  consumerHelper.SetAttribute("Frequency", StringValue("1")); // 100
interests a second
  consumerHelper.Install(consumer);

  ndn::AppHelper producerHelper("ns3::ndn::Producer");
  producerHelper.SetPrefix(prefix);
  producerHelper.Install(producer);

  ndn::AppHelper Hijackers("Hijacker");
  Hijackers.Install(h1);

  // Add /prefix origins to ndn::GlobalRouter
  ndnGlobalRoutingHelper.AddOrigins(prefix, producer);

  // Calculate and install FIBs
  ndn::GlobalRoutingHelper::CalculateRoutes();

  Simulator::Stop(Seconds(30.0));
  Simulator::Run();
  Simulator::Destroy();


Thank you

Kind Regards,

Prasetyo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160124/bc8cce0b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: code.rar
Type: application/rar
Size: 7623 bytes
Desc: not available
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160124/bc8cce0b/attachment.bin>


More information about the ndnSIM mailing list