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

Jens Mittag jens.mittag at kit.edu
Mon Jan 26 02:41:18 PST 2009

Hi George!

I was reading your description with great interest since we are planning
to do something similar. However, I don't know whether you have the same
objective as we have.

>From what I understand, you basically want to visualize/animate what's
going on in the simulation, right? Down to which degree are you planning
to do so? And what is your objective of the animation?

>From our perspective (University of Karlsruhe), which is development of
distributed network or mac protocols, it would be very helpful to have a
time- and spatial visualization of a network, with the possibility to
control what information is shown (e.g. history of past state changes at
a certain layer, e.g. MAC or PHY) and which is not.

What we have in mind is a framework that

   1) visualizes the layout of the network (i.e. the nodes location)
   2) allows to add/remove visualized information w.r.t. the user's
needs (e.g. by having a layered visualization in which you can hide/show
   3) allows the investigation of state changes of e.g. the MAC or PHY
layer of one or several specific node(s).
   4) is easily extensible to add new information aspects

In some sense, such a framework would help a lot to verify code and
protocol implementations and understand why a protocol behaves as it
does (e.g. it can support the analysis of complex routing or forwarding


George Riley schrieb:
> 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.
> 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.
> 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.
> Also attached is a short movie showing the output of the animator; this is
> a bit misleading, since the movie only shows the display window without
> the controls (stop, play, backup, etc).  I will try to make a better movie
> showing the controls as well.
> 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.
> George
> --------------------------------------------------
> George Riley
> Associate Professor
> Georgia Tech
> Electrical and Computer Engineering
> riley at ece.gatech.edu
> 404-894-4767
> Klaus Advanced Computing Building
> Room 3360
> 266 Ferst Drive
> Atlanta, Georgia 30332-0765
> ECE4110 Web page:
> http://users.ece.gatech.edu/~riley/ece4110/
> ECE4112 Web page:
> http://users.ece.gatech.edu/~riley/ece4112/

Dipl.-Inform. Jens Mittag
University of Karlsruhe
Institute of Telematics
Decentralized Systems and Network Services Research Group

Engesserstr. 2, 76131 Karlsruhe, Germany
Building 20.50, Room 112

Phone: +49 (721) 608 5768
Fax:   +49 (721) 608 6789


More information about the Ns-developers mailing list