[Ns-developers] NS-3 GUI (visualization again)

Gustavo Carneiro gjcarneiro at gmail.com
Tue Jul 29 11:13:57 PDT 2008


  I need to start thinking seriously about visualization in NS-3.  Mathieu
thinks I should share my thoughts, in case anyone has some suggestion, so
here it is :-)

  My wish list is this:

   1- Show a canvas with a representation of nodes moving;

   2- The GUI should attach to a "live" simulation, not a postmortem trace
file (for reasons to be explained below);

   3- Should allow me to pause or slow down simulation;

   4- Must allow me to programmatically decorate nodes according to custom
criteria, preferably in Python (e.g. change color of mobile nodes according
to wifi PoA they are associated with);

   5- Allow clicking on a node and live inspecting of some information (e.g.
routing table);

   6- Allow exporting topology snapshot in a vector format of choice (pdf,
svg, ...);

   7- Preferably done in some environment I am (personally) comfortable
with, i.e. PyGtk, PyGooCanvas.

  I did try to look at the latest iNSpect snapshot, but it does not even
compile.  Moreover it does not seem to fulfill most of my requirements.

  So I guess I'll try to do my thing, again.  I am thinking about:

   1- Take ns-3-viz as starting point (http://code.nsnam.org/gjc/ns-3-viz/)

   2- Most GUI would be written in Python now, PyGtk, PyGooCanvas;

   3- Instead of the simulation thread feeding the main thread with events
(push model), the main GUI thread just keeps into the current ns-3
simulation state (pull model);

   4- Because of thread safety, we need a "simulator mutex", to keep the GUI
from looking into ns-3 at the wrong time:
       a) The simulation thread normally holds the mutex locked;
       b) The GUI periodically tries to acquire the mutex in order to peek
into the simulation state, then releases it again;
       c) The simulation thread periodically releases the mutex and
reacquires it again, just to give the GUI a chance to acquire it (same
technique used by gtk+ for threading).

  In the interest of transparency, these are my thoughts, good or bad ;-)

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list