[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Correlating wall-clock time w/ NS time





Dear all,

We are trying to set up some simulations scenarios where it is
essential that  procedures take place asynchronously in NS
time. For example, when computing routing tables in a link-state
protocol, the receipt of a link state update triggers a re-route
computation. To test the impact of different parameters, it is
esential that this route computation doesn't take place
"automagically" (in 0 NS time) but asynchronously, depending on the
simulation scenario. The method of mapping the wall-clock time to NS
time being done using some ZEN correlation factor. 


So far the only work-around we could find was to profile the relevant
pieces of code, cache the result, and then "post" a re-call in future
e.g.

$ns at [expr $now + $interval] "Do my stuff _again_" 

This will be just a fake re-call that will actually return the result
cached in the previous call path. Of course, there is a pre-defined
overall behaviour when "computation is pending" (e.g. drop all
incoming packets while computing the routing tables). 


Needless to say this is a major PITA and has serious drawbacks
i.e. you can use the same call path only once, code on all affected
call paths must be butchered accordingly, etc. 


I wondwer if anybody succeeded in achieving the same functionality
(maybe i should say "mimicking" it ?)  i.e. succeeded in performing
asynchronous calls in NS time.


Regards,

Florian