[ndnSIM] consumers repetitively request same data from producer
Farzane Zrk
farzane.zrk at gmail.com
Fri Jan 31 12:20:50 PST 2020
Hello everyone,
I have implemented a new structure for nfd::cs and now I want to test my
model. I want a scenario that several consumers request a huge amount of
data (like 10k) from a producer with which they are connected via a central
node. Just this central node has a content store and all the consumers
will request the same 10k packets with different orders.
Searching at this mailing list, I found the code below. However, in this
code, consumers repetitively ask for just 4 packets.
Is it possible that I change it in a way that each consumer sends identical
10k interests?
If there is another way to write that scenario please tell me.
NodeContainer nodes;
nodes.Create (5); // Connecting nodes using two links
PointToPointHelper p2p;
p2p.Install (nodes.Get (0), nodes.Get (4));
p2p.Install (nodes.Get (4), nodes.Get (2));
p2p.Install (nodes.Get (3), nodes.Get (4));
p2p.Install (nodes.Get (1), nodes.Get (4));
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.SetPit ("ns3::ndn::pit::Lru","PitEntryPruningTimout","20");
ndnHelper.SetDefaultRoutes (true);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000000");
ndnHelper.Install(nodes.Get (4));
ndnHelper.SetContentStore("ns3::ndn::cs::Nocache");
ndnHelper.Install(nodes.Get (0));
ndnHelper.Install(nodes.Get (1));
ndnHelper.Install(nodes.Get (2));
ndnHelper.Install(nodes.Get (3));
//*****************4/27
Ptr<UniformRandomVariable> x = CreateObject<UniformRandomVariable> ();
ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerCbr");
ndn::AppHelper producerHelper ("ns3::ndn::Producer");
consumerHelper.SetPrefix ("/prefix");
consumerHelper.SetAttribute ("Frequency", StringValue ("5"));
ApplicationContainer consumer[4][20];
producerHelper.SetPrefix ("/prefix");
producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));
ApplicationContainer producer[4][21];
for ( int i=0;i <10;i++){
int provider=x->GetInteger (0,3);
int user=x->GetInteger (0,3);
while( (provider)==(user)){
user=x->GetInteger (0,3);
}
consumer[user][i]=consumerHelper.Install (nodes.Get (user));
consumer[user][i].Start(Seconds(2*i));
consumer[user][i].Stop(Seconds(2*i+1));
producer[provider][i]=producerHelper.Install (nodes.Get (provider));
producer[provider][i].Start(Seconds(2*i));
producer[provider][i].Stop(Seconds(2*i+2));
std::cout <<"provideris :"<<provider<<"user is "<<user<< std::endl;
}
Thank you in advance,
Regards,
Farzane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20200131/d582f088/attachment.html>
More information about the ndnSIM
mailing list