[ndnSIM] How to install multiple prefixes in one producer

Alex Afanasyev alexander.afanasyev at ucla.edu
Sat Apr 11 11:37:55 PDT 2015


> On Apr 10, 2015, at 10:52 PM, Muhammad Hosain Abdollahi Sabet <M.AbdollahiSabet at mail.sbu.ac.ir> wrote:
> 
> Oops. Sorry.
> I meant like this:
> 
> ndn::AppHelper producerHelper("ns3::ndn::Producer");
> producerHelper.SetPrefix("/prefix1");
> producerHelper.Install(nodes.Get(NODENUMBER));
> 
> ndn::AppHelper producerHelper("ns3::ndn::Producer");
> producerHelper.SetPrefix("/prefix2");
> producerHelper.Install(nodes.Get(NODENUMBER));
> 
> ndn::AppHelper producerHelper("ns3::ndn::Producer");
> producerHelper.SetPrefix("/prefix3");
> producerHelper.Install(nodes.Get(NODENUMBER));
> 

Yes. However, this can be simplified a bit (you don’t need to create multiple producerHelpers)

ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetPrefix("/prefix1");
producerHelper.Install(nodes.Get(NODENUMBER));

producerHelper.SetPrefix("/prefix2");
producerHelper.Install(nodes.Get(NODENUMBER));

producerHelper.SetPrefix("/prefix3");
producerHelper.Install(nodes.Get(NODENUMBER));

* * *

Another way to accomplish your goal is to create another Producer application, which would register and respond to multiple prefixes.

—
Alex

> 
> Right?
> 
> Thanks,
> Sabet
> 
> -----Original Message-----
> From: ndnSIM on behalf of Trade
> Sent: Sat 4/11/2015 2:54 AM
> To: Spyridon (Spyros) Mastorakis
> Cc: ndnsim at lists.cs.ucla.edu
> Subject: Re: [ndnSIM] How to install multiple prefixes in one producer
> 
> Thanks.
> Do you mean that multiple producers can be installed at one node?
> 
> On 4/10/15 9:29 AM, Spyridon (Spyros) Mastorakis wrote:
> > Hello,
> >
> > you will need to install more than one producer applications on the node, because each producer application has been assumed to respond only to one prefix.
> >
> > --
> > Spyridon (Spyros) Mastorakis
> > Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
> > Internet Research Laboratory
> > PhD Computer Science
> > UCLA
> >
> >
> >
> >
> >> On Apr 9, 2015, at 5:15 PM, Trade <trade20122012 at gmail.com> wrote:
> >>
> >> I want one producer can have multiple prefixes, but how to implement?
> >> Does this work?  or it only takes the last row ? Thanks
> >>
> >>           ProducerHelper.SetPrefix (prefix1);
> >>           ProducerHelper.SetPrefix (prefix2);
> >>           ProducerHelper.SetPrefix (prefix3);
> >>
> >> Trade
> >> _______________________________________________
> >> ndnSIM mailing list
> >> ndnSIM at lists.cs.ucla.edu
> >> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim <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/20150411/ee1b72c6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150411/ee1b72c6/attachment.bin>


More information about the ndnSIM mailing list