Guest User

Simple ns-3 scenario for queue investigation

a guest
Dec 11th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1.  
  2.   // Installing applications
  3.  
  4.   // Consumer
  5.   ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerBatches");
  6.   // Consumer will request /prefix/0, /prefix/1, ...
  7.   consumerHelper.SetPrefix ("/prefix");
  8.   consumerHelper.SetAttribute ("Batches", StringValue("1s 1"));
  9.   consumerHelper.Install (nodes.Get (0)); // first node
  10.  
  11.   // Producer
  12.   ndn::AppHelper producerHelper ("ns3::ndn::Producer");
  13.   // Producer will reply to all requests starting with /prefix
  14.   producerHelper.SetPrefix ("/prefix");
  15.   producerHelper.Install (nodes.Get (2)); // last node
  16.  
  17.   Simulator::Stop (Seconds (2.0));
  18.  
  19.   Simulator::Run ();
  20.   Simulator::Destroy ();
  21.  
  22.   return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment