[Ns-developers] A doubt about queues

Lalith Suresh suresh.lalith at gmail.com
Fri Mar 30 08:02:14 PDT 2012


On Fri, Mar 30, 2012 at 4:57 PM, Mudit Gupta <mudit.raaj.gupta at gmail.com> wrote:
> Hello Sir,
>
> Thank you for your reply. I might have stated stated the doubt in a wrong
> way.
>
> 1. I have an Internal Buffer : Queue of Events Generated by the model
> 2. External Buffer : Queue of Events Generated by external federates
>
> So, basically I will have two timelines with two sets of events. I want the
> simulator to give preference to events in the external buffer before
> internal buffer. Even if the events are not on the same time, which is a
> rare possibility. I want the simulator to switch queues.
>
> Why?
>
> Basically external queue would have events those will be responsible for
> editing some ns3 modules, those have registered to external buffer.  Like
> an event in the external buffer might change the speed of a moving node.
> External buffer would be filled by another federate's message.
>
> So, is it possible? If yes, then will a new (may be rtiScheduler) be
> responsible for such a task?
>

I'm assuming the external simulator and ns-3 have a common time
reference, in which case you really don't need an external queue; just
get all events to be scheduled on ns-3's scheduler and the semantics
should be preserved (this is what we do with ns-3 and click).

If there is no common time reference, then I think you have a problem. :)

> Best Regards,
>
> Mudit Raj Gupta
>
> On Fri, Mar 30, 2012 at 7:48 PM, Tommaso Pecorella <tpecorella at me.com>wrote:
>
>> Hi,
>>
>> events are associated with a Time. The order of the events happening at
>> the very same time is (and should not be) guaranteed. On the other hand,
>> the probability of having two events at the very same time is more or less
>> zero.
>>
>> Events associated with different times, must be executed at the proper
>> time (i.e., the time is the ordering key)
>>
>> Cheers,
>>
>> T.
>>
>>
>> On 30/mar/2012, at 11:05, Mudit Gupta wrote:
>>
>> Hi,
>>
>> I was working for the proposal on HLA interface for NS-3 and I have a basic
>> doubt:
>>
>> Is it possible to make an external event queue and then give it priority
>> over
>> the events queue generated by the model. I mean since the events in ns-3
>> are generated before time, so if you have an event at time T, I want that
>> the simulator should first check the external queue and if there are any
>> events they should be executed and then the events generated from the
>> model.
>>
>> This external queue will be basically generated from input from other
>> simulators through RTI and these inputs might modify the behavior of some
>> NS-3 modules. It will be like a new module communicating with other
>> simulators (like Repast or other scenario simulators) and getting events in
>> real time that should modify the behavior of other ns-3 modules. For
>> instance the input from a scenario simulator could prompt the change in
>> speed of nodes.
>>
>> All modules which would require updates from this event queue would have
>> subscribed to this event queue and would be able to decode messages/events
>> from the queue.
>>
>> Please let me know if such an implementation is possible
>>
>> Best Regards,
>>
>> Mudit Raj Gupta
>>
>>
>> --------------------------------------------------------------
>>
>> Thinking evolution:
>>  "To be is to do" - Socrates
>>  "To do is to be" - Sartre
>>  "Do Be Do Be Do" - Sinatra
>>  "Scooby Dooby Do" - Scooby Do
>>  "Yaba Daba Doo!" - Fred Flintstone
>>
>> --------------------------------------------------------------
>>
>> Tommaso Pecorella - Ph.D.
>>
>> Assistant professor
>> Dpt. Elettronica e Telecomunicazioni
>> Università di Firenze
>>
>> CNIT - Università di Firenze Unit
>>
>> via di S. Marta 3
>> 50139, Firenze
>> ITALY
>>
>> email: tommaso.pecorella at unifi.it
>>        tommaso.pecorella at cnit.it
>>
>> phone : +39-055-4796412
>> mobile: +39-320-4379803
>> fax   : +39-055-494569
>>
>>
>>
>>
>>



-- 
Lalith Suresh
www.lalith.in




More information about the Ns-developers mailing list