[Ns-developers] Application & Protocol Visualization
Joseph Kopena
tjkopena at cs.drexel.edu
Thu Mar 26 15:36:53 PDT 2009
Hi folks,
I've pushed up some code that may be useful or of interest to others,
providing a very simple visualization tool for ns-3 simulations.
There are two parts:
- The logging API [1]
- The (Gtk) playback program [2]
A few usage notes are below. Some differences with previously posted
ns-3 visualization tools include:
- It's based around playback, rather than live display. Simulations
produce an event log which is then run through a viewer program.
- It supports mobility; more to the point, it's required---the display
is entirely based around having coordinates for the nodes.
- It's based around generic states that may be attributed to nodes and
"links", which are then styled by the viewer. Those states are not
tied to any particular meaning, layer, etc; the representation is
based entirely on what states the simulation reports and how they
have been styled. Links in particular have no intrinsic meaning,
they're just a device the simulation can use to report information.
For example, suppose I have a simulation running some neighbor
discovery process and forwarding some data via aggregation nodes. I
could log that information by:
+ Reporting links for discovered neighbors.
+ Using one link state for bidirectional links.
+ Using another link state for unidirectional links.
+ Attributing one state to nodes that are aggregation nodes.
+ Attributing one state to nodes that have received the data.
In the style files I could then make bidirectional links bigger or a
different color. Aggregation nodes could be square, and nodes that
have received the data double bordered.
As another example, MAC transmissions could be visualized by binding
a function to a start TX tracepoint that sets a state on the node.
Another function bound to a finish TX tracepoint or timeout could
remove the state. Those states could then be associated with double
bordering or coloring the node, etc.
The main goal here is to support annotating and visualizing
application and protocol events, rather than necessarily focusing on
network traffic display.
Other notes:
- In general, tracepoints are the mechanism by which to visualize
internals and/or to develop modules that can be visualized but
should not be directly tied into the visualizer.
- I expect at some point to add a "fade" style command to
automatically remove states after a period of time, allowing them to
be used more as event notifications than states.
- There is support in the basic code for pausing, rewinding, etc;
expect that to be connected up to the GUI sometime soon.
This code is very much of a prototype nature. In particular, the
parsing, style file formats, etc, are pretty trivial and quickly
concocted. However, we're using this a bit here (Penn/Drexel), so
it's under active development and I'll be happy to answer questions or
try to fix problems. I also expect to add some small features here
and there in the coming weeks, and would be happy to hear what people
might find useful.
Thx!
[1] http://code.nsnam.org/tjkopena/ns-3-decorator3-api/
[2] http://code.nsnam.org/tjkopena/ns-3-decorator3/
----------------------------------------------------------------
[ Logging ]
- Download or clone the repository at [2]. It should build as usual.
You should be able to simply pull the repository into your existing
work repositories. There are no changes to the core code, just some
additional files and slight additions to the wscript files.
- The repository includes the (trivial) logging API, and an example
program. API is in src/contrib/decorator-frontend.(cc|h). Example
is in examples/decorator-adhoc.cc. The example creates some mobile
nodes and then flips nodes and links back and forth between
different states, with no connection to network or app events.
- Once compiled, use the following to run the example program:
./waf --run "decorator-adhoc -nodes=16 -duration=120"
It will produce a file 'decorator.log' which is the input to the
visualization program.
[ Visualization ]
- Download or clone the visualizer from [1]. You will need the gtkmm
development libraries to build the program (using make).
- Run the following as a sample demonstration:
./bin/test-gui-playback -nodestyles tests/node-styles010 \
-linkstyles tests/link-styles010 \
tests/decorator.log
The program has two optional parameters:
-nodestyles <file> tells the program to apply the given
style file to node states.
-linkstyles <file> tells the program to apply the given
style file to link states.
The final command line parameter must be the log file to use.
Details of the style files are commented on in the example files.
----------------------------------------------------------------
--
- joe kopena
right here and now
More information about the Ns-developers
mailing list