[ndnSIM] Getting PIT & CS Size simultaneously?

Narges Mehran narges.mehran at gmail.com
Fri Feb 13 09:03:11 PST 2015

Hello everyone,

I have a question: why can't I see the PIT and CS Size simultaneously,
It means I can see CS Size in normal way but when I want to see the
PIT size, I have to change the prefix of producer! e.g.,

Names::Add ("consumer1", nodes.Get (0));
Names::Add ("router"   , nodes.Get (1));
Names::Add ("producer1" , nodes.Get (2));

Ptr<Node> consumer1 = Names::Find<Node> ("consumer1");
Ptr<Node> producer1 = Names::Find<Node> ("producer1");

// Install CCNx stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.SetDefaultRoutes (true);
ndnHelper.SetPit ("ns3::ndn::pit::Persistent::AggregateStats");
ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::Flooding");
ndnHelper.SetContentStore ("ns3::ndn::cs::Lru::AggregateStats",
                             "MaxSize", "5"); //Size = 5!
ndnHelper.InstallAll ();

//  Consumer1
ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
//  Consumer will request /prefix/0, /prefix/1, ...
consumerHelper.SetPrefix ("/prefix");
consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10
interests a second
consumerHelper.SetAttribute ("MaxSeq",StringValue("20"));
consumerHelper.Install (consumer1); // first node

// Producer1
ndn::AppHelper producerHelper ("ns3::ndn::Producer");
// Producer will reply to all requests starting with /prefix
producerHelper.SetPrefix ("/prefix123");
producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
producerHelper.Install (producer1);
 /////////////////output in abnormal way\\\\\\\\\\\\\\\\\\\\\\\\
PIT Size         CS Size
 30                  0

/////////////////output in normal way\\\\\\\\\\\\\\\\\\\\\\\\ ----->
producerHelper.SetPrefix ("/prefix");
PIT Size         CS Size
 0                  20

Besides, when the max size of CS is "5", why the output is "20"?

I don' know where my problem is! Any help?

Tnx in advance

More information about the ndnSIM mailing list