[ndnSIM] Manually Rerouting after Link Failure using ndnSIM

Harold Kumar shohanmk at yahoo.com
Sun Sep 16 23:25:35 PDT 2018


Greetings Everyone,

Is it possible to achieve rerouting between ndn nodes while there is a link failure? 
As far as I know, ndnSIM uses best-route stretegy, but if there is a link failure between two nodes; Simulator does not choose alternative path and data transaction stops. I want to implemet a stretegy so that while there is a link failure, simulator may choose alternative best-route.

Firstly, I have used "Best-route" forwarding stretegy, which allows Consumer to send Interest towards Producer through [Consumer----> Router1---> Router3---> Router4--->Producer]
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
Afterwards, I have created a manual link failure between Consumer1 and Router1 so that ndnSIM can do re-routing through another path. [Consumer----> Router2---> Router3---> Router4--->Producer]
Simulator::Schedule (Seconds (5.0), ndn::LinkControlHelper::FailLink, consumer1, router1);

For now, I have added manual route which do seem to do the job for a few seconds but after 3-4 seconds consumer stops sending packet. I am not sure what may have gone wrong or is there any alternative method.
My partial code looks like this:


                 +----------+                 +----------+                                                             
                 | Router 2 | --------------- | Router 5 |                                                             
                /+----------+                 +-----|----\                                                             
               /             \                  /   |     \                                                            
              /               \                /    |      \                                                           
             /                 \              /     |       \                                                          
            /                   \            /      |        ------------+                                             
+----------/                     \----------/       |        |  Producer |                                             
| Consumer |---------------------| Router 3 |       |        +-----------+                                             
+-----------                     /----------\       |        /                                                         
            \                   /            \      |       /                                                          
             \                 /              \     |      /                                                           
              \               /                \    |     /                                                            
               \             /                  \   |    /                                                             
                \+----------+                  +----------+                                                            
                 | Router 1 |                  | Router 4 |                                                            
                 +----------+                  +----------+                                                            
                                                                              
  // Install NDN stack on all nodes
  ndn::StackHelper ndnHelper;
  ndnHelper.SetDefaultRoutes(true);
  ndnHelper.SetOldContentStore("ns3::ndn::cs::Lru", "MaxSize", "100"); //!Attention!If set to 0, then MaxSize is infinite
  ndnHelper.InstallAll();

  // Choosing forwarding strategy {Available Strategy: best-route, multicast}
  ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
 
  // Installing global routing interface on all nodes
  ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
  ndnGlobalRoutingHelper.InstallAll();

  // Getting containers for the consumer/producer/router
  Ptr<Node> consumer1 = Names::Find<Node>("C1");
  Ptr<Node> producer1 = Names::Find<Node>("P1");
  Ptr<Node> router1 = Names::Find<Node> ("R1");
  Ptr<Node> router2 = Names::Find<Node> ("R2");
  Ptr<Node> router3 = Names::Find<Node> ("R3");
  Ptr<Node> router4 = Names::Find<Node> ("R4");
  Ptr<Node> router5 = Names::Find<Node> ("R5");


  // Installing applications for the consumer
  ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
  //consumer node install a Consumer application that will express interests in /data namespace
  consumerHelper.SetPrefix("/data");
  consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
  consumerHelper.Install(consumer1);


  // The failure of the link from a given time {FailLink,UpLink}
  Simulator::Schedule (Seconds (5.0), ndn::LinkControlHelper::FailLink, consumer1, router1);
  Simulator::Schedule (Seconds (15.0), ndn::LinkControlHelper::UpLink, consumer1, router1);


  // Installing applications for the producer
  ndn::AppHelper producerHelper("ns3::ndn::Producer");
  // Producer will reply to all requests starting with /prefix
  producerHelper.SetPrefix("/data");
  producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
  producerHelper.Install(producer1);
  // Register /dst1 prefix with global routing controller and
  ndnGlobalRoutingHelper.AddOrigins("/data", producer1);

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

  // Manually configure FIB routes
  ndn::FibHelper::AddRoute("C1", "/data", "R1", 1); 
  ndn::FibHelper::AddRoute("C1", "/data", "R2", 1);
 
  ndn::FibHelper::AddRoute("R2", "/data", "R3", 1);
  ndn::FibHelper::AddRoute("R3", "/data", "R4", 1);
  ndn::FibHelper::AddRoute("R4", "/data", "P1", 1);

                                                                                                                                                                                                                                

Sincerely,Kamrul Morshed,MS Student,                                                                                                                       Xi'an Jiaotong Univerity,Xian, Shaanxi,China.                                                                                                                              
                                                                                                                                                                                                             
                                                                                                                -
                                                                                                                 
                                                                                                                                                                                                                                
                                                                                                                 
                                                                                                                 
                                                                                                                               
                                                                                                                 
                                                                                                                 
                                                                                          
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20180917/3d9f93b9/attachment.html>


More information about the ndnSIM mailing list