From d31552a5273802eb950c8cf20f94bfa2de76d6ea Mon Sep 17 00:00:00 2001 From: John Abraham Date: Sun, 18 Dec 2011 15:13:05 -0500 Subject: [PATCH] NetAnim: Doc changes --- src/netanim/doc/animation.rst | 170 ++++++---------------------------- 1 file changed, 30 insertions(+), 140 deletions(-) diff --git a/src/netanim/doc/animation.rst b/src/netanim/doc/animation.rst index c0f833297..37877b94c 100644 --- a/src/netanim/doc/animation.rst +++ b/src/netanim/doc/animation.rst @@ -4,97 +4,45 @@ Animation --------- Animation is an important tool for network simulation. While |ns3| does not -contain a default graphical animation tool, it does provide an animation -interface for use with stand-alone animators. One such animator called NetAnim, -presently supporting packet flow animation for point-to-point links, has been -developed. Other animators and visualization tools are in development; they may -make use of the existing animation interface or may develop new ones, +contain a default graphical animation tool, we currently have two ways to provide +animation, namely using the PyViz method or the NetAnim method. +The PyViz method is described in http://www.nsnam.org/wiki/index.php/PyViz. +The NetAnim method is described in detail at http://www.nsnam.org/wiki/index.php/NetAnim. +We will describe the NetAnim method briefly here. -Animation interface +AnimationInterface ******************* -The animation interface uses underlying |ns3| trace sources to construct a -timestamped ASCII file that can be read by a standalone animator. The animation -interface in |ns3| currently only supports point-to-point links; however, we -hope to support other link types such as CSMA and wireless in the near future. -A snippet from a sample trace file is shown below.:: +The class "AnimationInterface" under "src/netanim" uses underlying |ns3| trace sources +to construct a timestamped ASCII file in XML format that can be read by a standalone animator +named "NetAnim". - 0.0 N 0 4 5.5 - 0.0 N 1 7 5.5 - 0.0 N 2 2.5 2.90192 +Generating XML trace files for use in NetAnim ++++++++++++++++++++++++++++++++++++++++++++++ +Apply the following statements before the "Simulator::Run ()" statement::: - ... + AnimationInterface anim ("animation.xml") - 0.0 L 0 1 - 0.0 L 0 2 - 0.0 L 0 3 +where "animation.xml" is any arbitrary file name. +It is important to ensure that your wscript includes the "netanim" module. +Example as in: src/netanim/examples/wscript. Also include the header +[#include "ns3/netanim-module.h"] in your test program - ... +The examples under "src/netanim/examples" illustrate this. The sample wscript is at +"src/netanim/examples/wscript". - Running the simulation - 0.668926 P 11 1 0.66936 0.669926 0.67036 - 0.67036 P 1 0 0.670794 0.67136 0.671794 - 0.671794 P 0 6 0.672227 0.672794 0.673227 +Lets take an example: "src/netanim/examples/star-animation.cc". To run the example::: - ... + ./waf --run "star-animation" -The tracefile describes where nodes and links should be placed at the top of the -file. Following this placement, the packet events are shown. The format for node -placement, link placement and packet events is shown below. +This will generate an xml file "star-animation.xml" in the same directory. This XML file +contains the information required by the standalone animator "NetAnim" to produce the required +animation. -* Node placement: