[ndnSIM] node names find matching prefix

Alex Afanasyev alexander.afanasyev at ucla.edu
Mon May 12 09:06:43 PDT 2014


Hi Josh,

Not exactly.  The changes you're talking are NDN-specific, so you would need to submit either patches or pull requests against https://github.com/NDN-Routing/ndnSIM

---
Alex

On May 12, 2014, at 7:13 AM, Josh J <joshjdevl at gmail.com> wrote:

> 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
> 
> 
> _______________________________________________
> 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/1232abf8/attachment.html>


More information about the ndnSIM mailing list