[ndnSIM] change consumer and producer randomly

Spyridon (Spyros) Mastorakis mastorakis at CS.UCLA.EDU
Thu Apr 28 14:26:48 PDT 2016


Hi,

in your simulation scenario, every time that you call the install method for an application, this call returns a container of the applications installed. In this way, you can collect all the application instances and then generate a random number and decide which application instance to start first using the StartApplication method and a specified time point.

You can schedule any actions that you would like your application to take as NS3 events in the code of your application.

Hope that this helps.

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/ <http://cs.ucla.edu/~mastorakis/>
Internet Research Laboratory
Computer Science Department
UCLA


> On Apr 27, 2016, at 7:49 PM, Zeinab Rezaiefar <z.rezaiefar at yahoo.com> wrote:
> 
> Hello every one,
> I would like to know how I can change consumer and producer randomly during simulation time. let consider we have 5 nodes and node 1 to node 4 all connect to the node 5  and then select two nodes among node 1 to node 4  as consumer and producer. I would like to know how I should schedule them that after every 1 second, the producer and consumer change while all of the users request the same content. moreover, for example user 1 sends request for the specific packet at second one and later at second 8 again this user may send request for this packet. 
> any help will be appreciate
> thanks in advance
> regards
> Zeinab  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20160428/41cfec73/attachment.html>


More information about the ndnSIM mailing list