[Ns-developers] NS3 Animation Interface and stand-alone animation tool

Tom Henderson tomh at tomh.org
Sun Jan 25 22:28:39 PST 2009


George, below are a few initial comments.

George Riley wrote:
> Hi All,
> I (with Raj's help :) uploaded a new ns3 repo called ns-3-netanim in 
> user riley.
> 
> The modifications to the base ns3 code are nearly trivial; aside from some
> minor tweaks to some containers (for consistency with other containers, 
> and for
> some small conveniences), the only change of substance is a new trace event
> in the point to point net device, notifying when a packet has been 
> transmitted.
> THis trace callback provides some needed information regarding the source
> and destination of the packet, and the time of transmission and arrival.

I agree that the device changes seem minor in nature.  There is an open 
bug 443 (in Craig's work queue) that is aimed at looking at the trace 
hooks we have and trying to apply some consistency and fill some gaps; 
maybe this patch overlaps with that effort (which is scheduled for 
February).

One minor point I observed is that we probably don't need to code the 
use case ("Anim") into the trace hook name.

> 
> Also checked in is a dumbbell.cc and dumbbell.h, that simply construct
> a dumbbell topology of specified size (left and right leaf counts) and 
> provide
> several methods to query the various nodes and devices in the topology.

we probably ought to have consistency in the topology objects that are 
geared towards point-to-point-- the "star" topology is part of 
PointToPointHelper but Dumbbell is outside of that helper class.

> 
> Also checked in is a new example "testdb.cc" that illustrates the use of 
> the dumbbell
> object and the animation-interface object (described next)
> 
> Finally, checked in are animation-interface.h and animation-interface.cc.
> These are NOT the animator, but rather just provide a simple method for
> an ns-3 simulation to provide outputs to an external animator.  Raj and I
> discussed, and came up with four potential use cases (actually just three
> since two of the cases are nearly identical).
> 
> 1) THe ns3 simulation writes a file, that is later used as input to the 
> animator.
> This is identical to the approach of the existing ns2 NAM.
> 2) The ns3 simulation writes to a tcp socket.  In this case, the 
> animator can:
>     a) Run on the same host as ns3, connecting to "localhost"
>     b) Run on any other host, connecting to the ns3 host system remotely.
>  From the point of view of the ns3 process, (a) and (b) are identical.
> 3) The animation is built in the ns-3 simulation and runs as part of the
> ns3 simulation.
> 
> The animation-interface.cc/h checked in support the first two use cases,
> but not the last. To get the animation built in to ns3 would require some
> waf help to locate the qt4 includes and libraries, and some "ifdefs" to
> compile without those (and or course without animation).
> 
> Attached is the tar.gz source code for the stand-alone animator, which also
> supports use cases (1) and (2).  Raj and I discussed where it should go,
> and decided on "contrib", but I did not yet check it in there, due to waf
> issues for compiling with qt4.  This animator knows nothing about ns3
> and does not include any ns3 includes.

Probably this could exist in parallel with the other standalone packages 
  in ns-3-allinone directory, but outside of ns-3-dev, and be 
conditionally downloaded/compiled by the new scripts in ns-3-allinone.


> The animator only (for now) supports wired, point to point links.  I would
> hope to get wireless animation support soon, but it's a bit more complex.
> I would also want to (if possible) leverage Gustavo's mobility visualizer,
> but am not familiar with how he did that.  There are of course quite a few
> enhancemnts I can imagine; setting node and packet colors, setting
> graphic files to be used for node objects (voip phones, routers, etc).
> 
> 
> Please comment. I am not recommending inclusion in the upcoming release
> or hold it up in any way, but the changes to basic ns3 are indeed minimal.

It would be nice to try to get a big picture view of where animation 
support is headed; we've heard from several people now who are working 
on this feature.  Any comments from others on what you are planning, and 
how this animator might be related?

One possible path forward would be to include the new trace points, 
dumbbell object, and animation helper in src/contrib  (instead of 
src/helper) for this release or the next one.  That would be similar to 
what we've done with experimental features such as the config store. 
And then, do not try to integrate the animator into ns-3-allinone build 
system just yet, but suggest that people give it a try over the coming 
months.

- Tom


More information about the Ns-developers mailing list