[ndnSIM] A Question on per fib rate limit

加藤尭彦 tk.kt0518 at gmail.com
Tue Dec 1 21:37:43 PST 2015


Dear all,

I'm trying to use per fib limit, limit rate and nack over ndnSIM 1.0, but I
have some problems.
The level "m_bucket" for perFibLimit dose not decrease, so the leaky bucket
becomes full.

The scenario and the topology I used are followings.  I'm very happy if
someone help me.

By the way, my plan is to implement the stateful fowarding.  Does anyone
know there is a program code for it.


// ndn-simple.cpp
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
// for ndn::L3AggregateTracer
#include <ns3/ndnSIM/utils/tracers/ndn-l3-aggregate-tracer.h>
// for ndn::L3RateTracer
#include <ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.h>
using namespace ns3;
int
main(int argc, char* argv[])
{
  // Read optional command-line parameters (e.g., enable visualizer with
./waf --run=<> --visualize
  CommandLine cmd;
  cmd.Parse(argc, argv);
  // Read Topology from file
  AnnotatedTopologyReader reader ;
  reader.SetFileName("scratch/topology.txt");
  reader.Read ();
// Install NDN stack
  ndn::StackHelper ndnHelper;
  ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::BestRoute");
  // Install PerFibLimit
  ndnHelper.SetForwardingStrategy
("ns3::ndn::fw::BestRoute::PerOutFaceLimits::PerFibLimits",
                                   "Limit", "ns3::ndn::Limits::Rate");
  ndnHelper.EnableLimits (true, Seconds(0.1), 0, 1250);
  ndnHelper.SetForwardingStrategy
("ns3::ndn::fw::BestRoute::PerOutFaceLimits::PerFibLimits",
                                   "EnableNACKs", "true");
  ndnHelper.InstallAll ();
  // Installing global routing interface on all nodes
  ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
  ndnGlobalRoutingHelper.InstallAll ();
  // Installing applications
  // Getting containers for consumer/producer
  Ptr<Node> producer1 = Names::Find<Node> ("server1");
  Ptr<Node> producer2 = Names::Find<Node> ("server2");
  Ptr<Node> consumer1 = Names::Find<Node> ("client1");
  Ptr<Node> consumer2 = Names::Find<Node> ("client2");

  // Consumer window
  ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerWindow");
  // Consumer
  std::string prefix1 = "/root";
  consumerHelper.SetPrefix(prefix1);
  consumerHelper.SetAttribute ("Size", StringValue ("2.0"));
  consumerHelper.Install(consumer1);
  std::string prefix2 = "/prefix";
  consumerHelper.SetPrefix(prefix2);
  consumerHelper.SetAttribute ("Size", StringValue ("2.0"));
  consumerHelper.Install(consumer2);
  // Producer
  ndn::AppHelper producerHelper("ns3::ndn::Producer");
  producerHelper.SetPrefix(prefix1);
  producerHelper.SetAttribute("PayloadSize", StringValue("1250"));
  producerHelper.Install(producer1); // last node
  // Producer will reply to all requests starting with /prefix
  producerHelper.SetPrefix(prefix2);
  producerHelper.SetAttribute("PayloadSize", StringValue("1250"));
  producerHelper.Install(producer2);
  // Add prefix origins to ndn::GlobalRouter
  ndnGlobalRoutingHelper.AddOrigins (prefix1, producer1);
  ndnGlobalRoutingHelper.AddOrigins (prefix2, producer2);

  // Calculate and install FIBs
  ndn::GlobalRoutingHelper::CalculateRoutes ();
  Simulator::Stop(Seconds(10.0));
  ndn::L3RateTracer::InstallAll("test.txt", Seconds(0.5));
  Simulator::Run();
  Simulator::Destroy();
  return 0;
}


topology.txt
router
#name   city latitude longitude
client1    unknown 28.8967  135
client2    unknown 35.41  135
server1    unknown 28.8967   140
server2   unknown 35.41    140
clientProvider   unknown 30.1     137
serverProvider   unknown 30.1   139
link
#x y capacity(kbps) OSPF    Delay  MaxPackets
client1 clientProvider 10Mbps 1 50ms  200
client2 clientProvider 10Mbps 1 50ms  200
server1  serverProvider 10Mbps 2 20ms  20
server2  serverProvider 10Mbps 2 20ms  20
clientProvider serverProvider 1Mbps  1   30ms 20
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20151202/fa98e022/attachment.html>


More information about the ndnSIM mailing list