[Ns-developers] ns-3 realtime multithreaded simulator

craigdo@ee.washington.edu craigdo at ee.washington.edu
Thu Aug 14 11:47:48 PDT 2008


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

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