[Ns-developers] ns-3 realtime multithreaded simulator

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Fri Aug 15 12:25:51 PDT 2008


On Thu, 2008-08-14 at 11:47 -0700, craigdo at ee.washington.edu wrote:
> Hi all,
> 
> Many of you know that I've been working on a multithreaded and real-time
> version of the ns-3 simulator implementation.  It's been running for quite
> some time with no problems, so I'd like to push it into ns-3-dev in
> preparation for the ns-3.2 release.
> 
> You can find the code in code.nsnam.org/craigdo/ns-3-emu in the
> src/simulator directory.  What I'm talking about is adding the simulator:
> 
>   realtime-simulator-impl.h
>   realtime-simulator-impl.cc

Would you mind add the virtual keywords on methods inherited from the
base class in realtime-simulator-impl.h ? I know that it is redundant,
that it is impossible to check that you got all of them right, that it
is hard to maintain but, it makes starting in the codebase much easier
for newcomers and we have been doing that for a good while in the rest
of the codebase.

Other than that, looks good to me.

> 
> and a synchronizer (that synchronizes the simulation to real time) base
> class and implementation:
> 
>   synchronizer.h
>   syncrhonizer.cc
>   wall-clock-synchronizer.h
>   wall-clock-synchronizer.cc
> 
> 
> This won't have any effect on existing code and is completely dormant by
> default.  If you want to run a simulation in real-time mode, you have to
> enable the new implementation:
> 
>   GlobalValue::Bind ("SimulatorImplementationType",
>     StringValue ("ns3::RealtimeSimulatorImpl"));
> 
> This swaps in the real-time simulator implementation and suddenly your
> simulations will consume real time.
> 
> There is one more piece to the ns-3-emu puzzle that is working fine that you
> can expect soon -- a net device to run ns-3 stacks over real networks
> (testbeds).  If you are interested in checking that out, you can find it in
> src/devices/emulated.  It uses MAC spoofing and promiscuous mode together
> with packet sockets to take over a real interface in a host and transmit and
> receive ns-3 generated traffic.  It's a good demo to show how you can use
> multithreading to work with the new simulator implementation.
> 
> Comments are welcome.  If there is not, "a great wailing and gnashing of
> teeth," I'll check in the simulator pieces early next week.  :-)
> 
> Regards,
> 
> -- Craig
> 
> 



More information about the Ns-developers mailing list