Up: Overview of simulation tools
Previous: p2pns.tools.Simulator
As the previous example hints, it is very easy to specify
additional metrics to be collected, additional exporters, network
topologies, simulation files, as well as various configurations of
the OMNI overlay itself. We will review them in turn.
- Metric(s) - In order to include specific overlay metrics to
be collected in a simulation, they have to be specified in the
simulation configuration file. Each individual metric, as depicted
in Figure 4 has to be specified as a bean
with a metrics class name and the bean itself has to be included
in a metrics property of a simulation bean. For the list of
available metrics we refer the reader to the p2pns.metrics
package. Additional metrics can be added by extending
p2pns.AbstractMetric class and implementing its abstract methods.
Figure 4:
Simulation configuration file for OMNI overlay - metrics
 |
- Network topology - The network topology, as depicted in
Figure 5, has to be specified using a
p2pns.Graph bean and an import property of that bean has to be set
to a file containing a BRITE top-down two-level topology.
Figure 5:
Simulation configuration file for OMNI overlay - network
topology
 |
- Tree-first overlay - A tree-first overlay instance has to be
configured as a bean by specifying the desired class that
implements a certain overlay algorithm. In the example depicted in
in Figure 6, a p2pns.omni.OmniOverlay bean
is created with specified properties. Various overlay algorithms
are likely to have their own specific properties. However, the
minimum properties that need to be specified for every overlay
are: the physical network graph and the source node. In order to
simulate additional tree-first overlay algorithms one would have
to extend p2pns.AbstractOverlay class and implement its abstract
methods.
Figure 6:
Simulation configuration file for OMNI overlay -
tree-first overlay
 |
- Metric exporter(s) - Exporters that will collect the
simulation results have to be declared as beans. Exporters
specified as a metricExporter property of a simulation bean will
actually be used during simulation. In the example depicted in
Figure 7, only XMLExporter is used.
However, the simulator can use multiple exporters simultaneously.
The available exporters are located in the p2pns.exporters
package. Additional exporters can be specified by implementing
p2pns.MetricExporter interface.
Figure 7:
Simulation configuration file for OMNI overlay -
exporters
 |
- Simulation file - A previously generated simulation file is
specified as a property of a simulation bean as well. See
Figure 8 for details.
Figure 8:
Simulation configuration file for OMNI overlay -
simulation file
 |
After all the simulation parameters have been specified, a
simulation is started using the p2pns.tools.Simulator class and
passing the simulation file as a parameter. For example, the OMNI
simulation could be started by passing an overlay simulation
configuration file depicted in
Figure 3 to p2pns.tools.Simulator.
Up: Overview of simulation tools
Previous: p2pns.tools.Simulator