[ndnSIM] node names find matching prefix

Josh J joshjdevl at gmail.com
Mon May 12 07:13:04 PDT 2014


Thanks. Do we make patches against

git://github.com/cawka/ns-3-dev-ndnSIM.git


I may implement this in AppHelper and also a zipf for file sizes as well.


Thanks,

Josh



On Sun, May 11, 2014 at 11:03 PM, Alex Afanasyev <
alexander.afanasyev at ucla.edu> wrote:

> Hi Josh,
>
> Unfortunately, as of right now, you have to do a little bit more job than
> that.
>
> You have to iterate over all nodes (NS-3 has a global variable for that)
> and check their names. Something like that:
>
> for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End();
> node++)
>   {
>     if (Names::FindName (*node).compare (0, sizeof("consumer-"),
> "consumer-") == 0)
>       {
>         consumerHelper.Install (*node);
>       }
>   }
>
> If you can spend some time and implement a generic way for doing this in
> AppHelper, I would be happy to merge that code in.
>
> ---
> Alex
>
>
> On May 11, 2014, at 10:27 PM, Josh J <joshjdevl at gmail.com> wrote:
>
> > Hi,
> >
> > I would like to install the consumer helper on all nodes which begin
> with "consumer", so I tried the following though receive a segfault. Is
> there a way I can find and match all nodes beginning with a certain name?
> >
> >   // Consumer
> >   ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerZipfMandelbrot");
> >   // Consumer will request /prefix/0, /prefix/1, ...
> >   consumerHelper.SetPrefix ("/producer1");
> >   consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10
> interests a second
> >   consumerHelper.SetAttribute("Randomize",    StringValue ("uniform"));
> >   consumerHelper.Install (Names::Find<Node>("consumer*"));
> >
> >
> > Thanks,
> > Josh
> > _______________________________________________
> > ndnSIM mailing list
> > ndnSIM at lists.cs.ucla.edu
> > http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20140512/2a7627b9/attachment.html>


More information about the ndnSIM mailing list