Fast Network Simulation Setup (FNSS)¶
This is the documentation of the FNSS core library. It is a Python library providing a set of features allowing to simplify the setup of a network experiment. These features include the ability to:
- Parse a topology from a dataset, a topology generator or generate it according to a number of synthetic models
- Apply link capacity, link weights, link delays and buffer sizes
- Deploy application stacks
- Generate traffic matrices
- Generate event schedules
The core library in addition to the features listed above, contains adapters to export generated scenarios to a the following network simulators or emulators: ns-2, Mininet, Omnet++, jFed and Autonetkit. Generated experiment scenarios (i.e. topologies, event schedules and traffic matrices) can be saved into XML files and then imported by libraries written in other languages. Currently, FNSS provides generic Java and C++ libraries as well as a C++ library specific for the ns-3 simulator. These libraries can be downloaded from the FNSS website.
The FNSS core library is released under the terms of the BSD license.
If you use FNSS for your paper, please cite the following publication:
Lorenzo Saino, Cosmin Cocora and George Pavlou, A Toolchain for Symplifying Network Simulation Setup, in Proceedings of the 6th International ICST Conference on Simulation Tools and Techniques (SIMUTOOLS ‘13), Cannes, France, March 2013
The BibTeX entry is:
@inproceedings{fnss,
author = {Saino, Lorenzo and Cocora, Cosmin and Pavlou, George},
title = {A Toolchain for Simplifying Network Simulation Setup},
booktitle = {Proceedings of the 6th International ICST Conference on Simulation Tools and Techniques},
series = {SIMUTOOLS '13},
year = {2013},
location = {Cannes, France},
numpages = {10},
publisher = {ICST (Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering)},
address = {ICST, Brussels, Belgium, Belgium},
}
Contents¶
Architecture¶
The Python core library is designed following a modular approach.
- All functionalities are splitted in four main packages:
- adapters: contains functions for exporting FNSS objects to target simulators or emulators. Currently, this package includes functions for exporting FNSS objects to Mininet, ns-2, Omnet++, jFed <http://jfed.iminds.be/>_ and AutoNetKit.
- topologies: contains all functions and classes for parsing or synthetically generating a network topology. It also contains functions to read and write topology objects from/to an XML file. The conversion of such objects to XML files is needed to make topology available for the Java and C++ API and the ns-3 adapter.
- netconfig: contains all functions for configuring a network topology. Such configuration include setting link capacities, delays and weights, set buffer sizes and deploy protocol stacks and applications on nodes.
- traffic: contains all functions and classes for synthetically generating event schedules and traffic matrices.
- In addition, the library also comprises a set of classes to model specific entities. These classes are:
- Topology: a base undirected topology. Comprises methods for adding, editing and removing nodes and links. This class inherits from NetworkX Graph class. As a result, all graph algorithms and visualization tools provided by NetworkX can be used on Topology objects as well.
- DirectedTopology: a base directed topology. It shares most of the code of the Topology class but in this class links are directed. Similarly to the Topology class, this class inherits from NetworkX DiGraph class.
- DatacenterTopology: a datacenter topology. It inherits from the Topology class and comprises additional methods relevant only for datacenter topologies.
- TrafficMatrix: a traffic matrix, capturing the average traffic on a network at a specific point in time.
- TrafficMatrixSequence: a sequence of traffic matrices, capturing the evolution of traffic on a network over a period of time.
- EventSchedule: a schedule of events to be simulated.
In order to make the simulation setup information created with FNSS core library (topology, traffic, events) available to the desired target simulator, FNSS provides the capability to export such information to XML files. These XML files can then be read by the Java, C++ or ns-3 libraries. More specifically, the following objects can be saved to XML files:
- Topology, DirectedTopology, DatacenterTopology and any potential subclasses can be written to XML files with the function
write_topology
.- TrafficMatrix, TrafficMatrixSequence and any potential subclasses can be written to XML files with the function
write_traffic_matrix
.- EventSchedule and any potential subclasses can be written to XML files with the function
write_event_schedule
.
Install¶
Quick install¶
Ubuntu (version 12.04+)¶
If you use Ubuntu, you can install the FNSS core library along with the Python interpreter and all required dependencies by running the following script:
$ curl -L https://github.com/fnss/fnss/raw/master/core/ubuntu_install.sh | sh
You need superuser privileges to run this script.
Other operating systems¶
The easiest way to install the core Python library is to download it and install it from the Python Package Index. To do so, you must have Python (version >= 2.7) installed on your machine and either pip or easy_install.
To install the FNSS core library using easy_install open a command shell and type:
$ easy_install fnss
If you use pip, type instead:
$ pip fnss
Depending on the configuration of your machine you may need to run pip or easy_install as superuser. Whether you use pip or easy_install, the commands reported above will download the latest version of the FNSS core library and install it on your machine together with all required dependencies.
Installing from source¶
You can install from source by downloading a source archive file (tar.gz or zip) from the FNSS website or by checking out the source files from the GitHub repository.
Source archive file¶
Download the source (tar.gz or zip file) from http://fnss.github.io
Unpack, open a command shell and move to the main directory of the core library (it should have the file setup.py).
Run this instruction to build and install:
$ python setup.py install
Git repository¶
Clone the FNSS repostitory:
$ git clone https://github.com/fnss/fnss.gitChange directory to fnss/core:
$ cd fnss/coreRun:
$ python setup.py install
If you don’t have permission to install software on your system, you can install into another directory using the –user, –prefix, or –home flags to setup.py.
For example:
$ python setup.py install --prefix=/home/username/python
or:
$ python setup.py install --home=~
or:
$ python setup.py install --user
If you didn’t install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. See http://docs.python.org/inst/search-path.html for further details.
Requirements¶
Python¶
To use FNSS you need Python version 2.7 or later. FNSS fully supports Python 3
Required packages¶
The following packages are needed by FNSS to provide core functions.
NetworkX (version >= 1.6)¶
NetworkX is a Python package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks.
- Download: http://networkx.github.io
NumPy (version >= 1.4)¶
Provides matrix representation of graphs and is used in some graph algorithms for high-performance matrix computations.
- Download: http://scipy.org/Download
API Reference¶
Classes¶
Topology¶
-
class
Topology
(data=None, name='', **kwargs)[source]¶ Base class for undirected topology
Attributes: - name
Methods
add_cycle
(nodes, **attr)Add a cycle. add_edge
(u, v[, attr_dict])Add an edge between u and v. add_edges_from
(ebunch[, attr_dict])Add all the edges in ebunch. add_node
(n[, attr_dict])Add a single node n and update node attributes. add_nodes_from
(nodes, **attr)Add multiple nodes. add_path
(nodes, **attr)Add a path. add_star
(nodes, **attr)Add a star. add_weighted_edges_from
(ebunch[, weight])Add all the edges in ebunch as weighted edges with specified weights. adjacency_iter
()Return an iterator of (node, adjacency dict) tuples for all nodes. adjacency_list
()Return an adjacency list representation of the graph. adjlist_dict_factory
alias of __builtin__.dict
applications
()Return a dictionary of all applications deployed, keyed by node buffers
()Return a dictionary of all buffer sizes, keyed by interface capacities
()Return a dictionary of all link capacities, keyed by link clear
()Remove all nodes and edges from the graph. copy
()Return a copy of the topology. degree
([nbunch, weight])Return the degree of a node or nodes. degree_iter
([nbunch, weight])Return an iterator for (node, degree). delays
()Return a dictionary of all link delays, keyed by link edge_attr_dict_factory
alias of __builtin__.dict
edges
([nbunch, data, default])Return a list of edges. edges_iter
([nbunch, data, default])Return an iterator over the edges. get_edge_data
(u, v[, default])Return the attribute dictionary associated with edge (u,v). has_edge
(u, v)Return True if the edge (u,v) is in the graph. has_node
(n)Return True if the graph contains the node n. is_directed
()Return True if graph is directed, False otherwise. is_multigraph
()Return True if graph is a multigraph, False otherwise. nbunch_iter
([nbunch])Return an iterator of nodes contained in nbunch that are also in the graph. neighbors
(n)Return a list of the nodes connected to the node n. neighbors_iter
(n)Return an iterator over all neighbors of node n. node_dict_factory
alias of __builtin__.dict
nodes
([data])Return a list of the nodes in the graph. nodes_iter
([data])Return an iterator over the nodes. nodes_with_selfloops
()Return a list of nodes with self loops. number_of_edges
([u, v])Return the number of edges between two nodes. number_of_nodes
()Return the number of nodes in the graph. number_of_selfloops
()Return the number of selfloop edges. order
()Return the number of nodes in the graph. remove_edge
(u, v)Remove the edge between u and v. remove_edges_from
(ebunch)Remove all edges specified in ebunch. remove_node
(n)Remove node n. remove_nodes_from
(nodes)Remove multiple nodes. selfloop_edges
([data, default])Return a list of selfloop edges. size
([weight])Return the number of edges. stacks
()Return a dictionary of all node stacks, keyed by node subgraph
(nbunch)Return the subgraph induced on nodes in nbunch. to_directed
()Return a directed representation of the topology. to_undirected
()Return an undirected copy of the topology. weights
()Return a dictionary of all link weights, keyed by link
DirectedTopology¶
-
class
DirectedTopology
(data=None, name='', **kwargs)[source]¶ Base class for directed topology
Attributes: - name
Methods
add_cycle
(nodes, **attr)Add a cycle. add_edge
(u, v[, attr_dict])Add an edge between u and v. add_edges_from
(ebunch[, attr_dict])Add all the edges in ebunch. add_node
(n[, attr_dict])Add a single node n and update node attributes. add_nodes_from
(nodes, **attr)Add multiple nodes. add_path
(nodes, **attr)Add a path. add_star
(nodes, **attr)Add a star. add_weighted_edges_from
(ebunch[, weight])Add all the edges in ebunch as weighted edges with specified weights. adjacency_iter
()Return an iterator of (node, adjacency dict) tuples for all nodes. adjacency_list
()Return an adjacency list representation of the graph. adjlist_dict_factory
alias of __builtin__.dict
applications
()Return a dictionary of all applications deployed, keyed by node buffers
()Return a dictionary of all buffer sizes, keyed by interface capacities
()Return a dictionary of all link capacities, keyed by link clear
()Remove all nodes and edges from the graph. copy
()Return a copy of the topology. degree
([nbunch, weight])Return the degree of a node or nodes. degree_iter
([nbunch, weight])Return an iterator for (node, degree). delays
()Return a dictionary of all link delays, keyed by link edge_attr_dict_factory
alias of __builtin__.dict
edges
([nbunch, data, default])Return a list of edges. edges_iter
([nbunch, data, default])Return an iterator over the edges. get_edge_data
(u, v[, default])Return the attribute dictionary associated with edge (u,v). has_edge
(u, v)Return True if the edge (u,v) is in the graph. has_node
(n)Return True if the graph contains the node n. has_predecessor
(u, v)Return True if node u has predecessor v. has_successor
(u, v)Return True if node u has successor v. in_degree
([nbunch, weight])Return the in-degree of a node or nodes. in_degree_iter
([nbunch, weight])Return an iterator for (node, in-degree). in_edges
([nbunch, data])Return a list of the incoming edges. in_edges_iter
([nbunch, data])Return an iterator over the incoming edges. is_directed
()Return True if graph is directed, False otherwise. is_multigraph
()Return True if graph is a multigraph, False otherwise. nbunch_iter
([nbunch])Return an iterator of nodes contained in nbunch that are also in the graph. neighbors
(n)Return a list of successor nodes of n. neighbors_iter
(n)Return an iterator over successor nodes of n. node_dict_factory
alias of __builtin__.dict
nodes
([data])Return a list of the nodes in the graph. nodes_iter
([data])Return an iterator over the nodes. nodes_with_selfloops
()Return a list of nodes with self loops. number_of_edges
([u, v])Return the number of edges between two nodes. number_of_nodes
()Return the number of nodes in the graph. number_of_selfloops
()Return the number of selfloop edges. order
()Return the number of nodes in the graph. out_degree
([nbunch, weight])Return the out-degree of a node or nodes. out_degree_iter
([nbunch, weight])Return an iterator for (node, out-degree). out_edges
([nbunch, data, default])Return a list of edges. out_edges_iter
([nbunch, data, default])Return an iterator over the edges. predecessors
(n)Return a list of predecessor nodes of n. predecessors_iter
(n)Return an iterator over predecessor nodes of n. remove_edge
(u, v)Remove the edge between u and v. remove_edges_from
(ebunch)Remove all edges specified in ebunch. remove_node
(n)Remove node n. remove_nodes_from
(nbunch)Remove multiple nodes. reverse
([copy])Return the reverse of the graph. selfloop_edges
([data, default])Return a list of selfloop edges. size
([weight])Return the number of edges. stacks
()Return a dictionary of all node stacks, keyed by node subgraph
(nbunch)Return the subgraph induced on nodes in nbunch. successors
(n)Return a list of successor nodes of n. successors_iter
(n)Return an iterator over successor nodes of n. to_directed
()Return a directed representation of the topology. to_undirected
()Return an undirected copy of the topology. weights
()Return a dictionary of all link weights, keyed by link
DatacenterTopology¶
-
class
DatacenterTopology
(data=None, name='', **kwargs)[source]¶ Represent a datacenter topology
Attributes: - name
Methods
add_cycle
(nodes, **attr)Add a cycle. add_edge
(u, v[, attr_dict])Add an edge between u and v. add_edges_from
(ebunch[, attr_dict])Add all the edges in ebunch. add_node
(n[, attr_dict])Add a single node n and update node attributes. add_nodes_from
(nodes, **attr)Add multiple nodes. add_path
(nodes, **attr)Add a path. add_star
(nodes, **attr)Add a star. add_weighted_edges_from
(ebunch[, weight])Add all the edges in ebunch as weighted edges with specified weights. adjacency_iter
()Return an iterator of (node, adjacency dict) tuples for all nodes. adjacency_list
()Return an adjacency list representation of the graph. adjlist_dict_factory
alias of __builtin__.dict
applications
()Return a dictionary of all applications deployed, keyed by node buffers
()Return a dictionary of all buffer sizes, keyed by interface capacities
()Return a dictionary of all link capacities, keyed by link clear
()Remove all nodes and edges from the graph. copy
()Return a copy of the topology. degree
([nbunch, weight])Return the degree of a node or nodes. degree_iter
([nbunch, weight])Return an iterator for (node, degree). delays
()Return a dictionary of all link delays, keyed by link edge_attr_dict_factory
alias of __builtin__.dict
edges
([nbunch, data, default])Return a list of edges. edges_iter
([nbunch, data, default])Return an iterator over the edges. get_edge_data
(u, v[, default])Return the attribute dictionary associated with edge (u,v). has_edge
(u, v)Return True if the edge (u,v) is in the graph. has_node
(n)Return True if the graph contains the node n. hosts
()Return the list of host nodes in the topology is_directed
()Return True if graph is directed, False otherwise. is_multigraph
()Return True if graph is a multigraph, False otherwise. nbunch_iter
([nbunch])Return an iterator of nodes contained in nbunch that are also in the graph. neighbors
(n)Return a list of the nodes connected to the node n. neighbors_iter
(n)Return an iterator over all neighbors of node n. node_dict_factory
alias of __builtin__.dict
nodes
([data])Return a list of the nodes in the graph. nodes_iter
([data])Return an iterator over the nodes. nodes_with_selfloops
()Return a list of nodes with self loops. number_of_edges
([u, v])Return the number of edges between two nodes. number_of_hosts
()Return the number of hosts in the topology number_of_nodes
()Return the number of nodes in the graph. number_of_selfloops
()Return the number of selfloop edges. number_of_switches
()Return the number of switches in the topology order
()Return the number of nodes in the graph. remove_edge
(u, v)Remove the edge between u and v. remove_edges_from
(ebunch)Remove all edges specified in ebunch. remove_node
(n)Remove node n. remove_nodes_from
(nodes)Remove multiple nodes. selfloop_edges
([data, default])Return a list of selfloop edges. size
([weight])Return the number of edges. stacks
()Return a dictionary of all node stacks, keyed by node subgraph
(nbunch)Return the subgraph induced on nodes in nbunch. switches
()Return the list of switch nodes in the topology to_directed
()Return a directed representation of the topology. to_undirected
()Return an undirected copy of the topology. weights
()Return a dictionary of all link weights, keyed by link
TrafficMatrix¶
-
class
TrafficMatrix
(volume_unit='Mbps', flows=None)[source]¶ Class representing a single traffic matrix.
It simply contains a set of traffic volumes being exchanged between origin-destination pairs
Parameters: - volume_unit : str
The unit in which traffic volumes are expressed
- flows : dict, optional
The traffic volumes or the matrix, keyed by origin-destination pair. The origin-destination pair is a tuple whose two elements are respectively the identifier of the origin and destination nodes and volumes are all expressed in the same unit
Methods
add_flow
(origin, destination, volume)Add a flow to the traffic matrix flows
()Return the flows of the traffic matrix od_pairs
()Return all OD pairs of the traffic matrix pop_flow
(origin, destination)Pop a flow from the traffic matrix and return the volume of the flow removed.
TrafficMatrixSequence¶
-
class
TrafficMatrixSequence
(interval=None, t_unit='min')[source]¶ Class representing a sequence of traffic matrices.
Parameters: - interval : float or int, optional
The time interval elapsed between subsequent traffic matrices of the sequence
- t_unit : str, optional
The unit of the interval value (e.g. ‘sec’ or ‘min’)
Methods
append
(tm)Append a traffic matrix at the end of the sequence get
(i)Return a specific traffic matrix in a specific position of the sequence insert
(i, tm)Insert a traffic matrix in the sequence at a specified position pop
(i)Removes the traffic matrix in a specific position of the sequence
EventSchedule¶
-
class
EventSchedule
(t_start=0, t_unit='ms')[source]¶ Class representing an event schedule. This class is simply a wrapper for a list of events.
Methods
add
(time, event[, absolute_time])Adds an event to the schedule. add_schedule
(event_schedule)Merge with another event schedule. events_between
(t_start, t_end)Return an event schedule comprising all events scheduled between a start time (included) and an end time (excluded). number_of_events
()Return the number of events in the schedule pop
(i)Remove from the schedule the event in a specific position
Functions¶
netconfig
package¶
buffers
module¶
Function to assign and manipulate buffer sizes of network interfaces.
clear_buffer_sizes (topology) |
Remove all buffer sizes from the topology. |
get_buffer_sizes (topology) |
Returns all the buffer sizes. |
set_buffer_sizes_bw_delay_prod (topology[, …]) |
Assign a buffer sizes proportionally to the product of link bandwidth and average network RTT. |
set_buffer_sizes_constant (topology, buffer_size) |
Assign a constant buffer size to all selected interfaces |
set_buffer_sizes_link_bandwidth (topology[, …]) |
Assign a buffer sizes proportionally to the bandwidth of the interface on which the flush. |
capacities
module¶
Functions to assign and manipulate link capacities of a topology.
Link capacities can be assigned either deterministically or randomly, according to various models.
clear_capacities (topology) |
Remove all capacities from the topology. |
get_capacities (topology) |
Returns a dictionary with all link capacities. |
set_capacities_betweenness_gravity (topology, …) |
Set link capacities proportionally to the product of the betweenness centralities of the two end-points of the link |
set_capacities_communicability_gravity (…) |
Set link capacities proportionally to the product of the communicability centralities of the two end-points of the link |
set_capacities_constant (topology, capacity) |
Set constant link capacities |
set_capacities_degree_gravity (topology, …) |
Set link capacities proportionally to the product of the degrees of the two end-points of the link |
set_capacities_edge_betweenness (topology, …) |
Set link capacities proportionally to edge betweenness centrality of the link. |
set_capacities_edge_communicability (…[, …]) |
Set link capacities proportionally to edge communicability centrality of the link. |
set_capacities_eigenvector_gravity (topology, …) |
Set link capacities proportionally to the product of the eigenvector centralities of the two end-points of the link |
set_capacities_pagerank_gravity (topology, …) |
Set link capacities proportionally to the product of the Pagerank centralities of the two end-points of the link |
set_capacities_random (topology, capacity_pdf) |
Set random link capacities according to a given probability density function |
set_capacities_random_power_law (topology, …) |
Set random link capacities according to a power-law probability density function. |
set_capacities_random_uniform (topology, …) |
Set random link capacities according to a uniform probability density function. |
set_capacities_random_zipf (topology, capacities) |
Set random link capacities according to a Zipf probability density function. |
set_capacities_random_zipf_mandelbrot (…[, …]) |
Set random link capacities according to a Zipf-Mandelbrot probability density function. |
delays
module¶
Functions to assign and manipulate link delays.
clear_delays (topology) |
Remove all delays from the topology. |
get_delays (topology) |
Returns all the delays. |
set_delays_constant (topology[, delay, …]) |
Assign a constant delay to all selected links |
set_delays_geo_distance (topology, specific_delay) |
Assign a delay to all selected links equal to the product of link length and specific delay. |
nodeconfig
module¶
Functions to deploy and configure protocol stacks and applications on network nodes
add_application (topology, node, name[, …]) |
Add an application to a node |
add_stack (topology, node, name[, properties]) |
Set stack on a node. |
clear_applications (topology) |
Remove all applications from all nodes of the topology |
clear_stacks (topology) |
Remove all stacks from all nodes of the topology |
get_application_names (topology, node) |
Return a list of names of applications deployed on a node |
get_application_properties (topology, node, name) |
Return a dictionary containing all the properties of an application deployed on a node |
get_stack (topology, node[, data]) |
Return the stack of a node, if any |
remove_application (topology, node[, name]) |
Remove an application from a node |
remove_stack (topology, node) |
Remove stack from a node |
weights
module¶
Functions to assign and manipulate link weights to a network topology.
clear_weights (topology) |
Remove all weights from the topology. |
get_weights (topology) |
Returns all the weights. |
set_weights_constant (topology[, weight, links]) |
Assign a constant weight to all selected links |
set_weights_delays (topology) |
Assign link weights to links proportionally their delay. |
set_weights_inverse_capacity (topology) |
Assign link weights to links proportionally to the inverse of their capacity. |
traffic
package¶
eventscheduling
module¶
Functions and classes for creating and manipulating event schedules.
An event schedule is simply a list of events each labelled with a time and a number of properties.
An event schedule can be read and written from/to an XML files with provided functions.
deterministic_process_event_schedule (…) |
Return a schedule of events separated by a fixed time interval |
poisson_process_event_schedule (avg_interval, …) |
Return a schedule of Poisson-distributed events |
read_event_schedule (path) |
Read event schedule from an XML file |
write_event_schedule (event_schedule, path[, …]) |
Write an event schedule object to an XML file. |
trafficmatrices
module¶
Functions and classes for creating and manipulating traffic matrices.
The functions of this class allow users to synthetically generate traffic matrices with given statistical properties according to models proposed in literature.
The output of this generation is either a TrafficMatrix or a TrafficMatrixSequence object.
A traffic matrix or a sequence of matrices can be read and written from/to an XML files with provided functions.
link_loads (topology, traffic_matrix[, …]) |
Calculate link utilization given a traffic matrix. |
read_traffic_matrix (path[, encoding]) |
Parses a traffic matrix from a traffic matrix XML file. |
sin_cyclostationary_traffic_matrix (topology, …) |
Return a cyclostationary sequence of traffic matrices, where traffic volumes evolve over time as sin waves. |
static_traffic_matrix (topology, mean, stddev) |
Return a TrafficMatrix object, i.e. |
stationary_traffic_matrix (topology, mean, …) |
Return a stationary sequence of traffic matrices. |
validate_traffic_matrix (topology, traffic_matrix) |
Validate whether a given traffic matrix and given topology are compatible. |
write_traffic_matrix (traffic_matrix, path[, …]) |
Write a TrafficMatrix or a TrafficMatrixSequence object to an XML file. |
topologies
package¶
datacenter
module¶
Functions to generate commonly adopted datacenter topologies.
Each topology generation function returns an instance of DatacenterTopology
bcube_topology (n, k) |
Return a Bcube datacenter topology, as described in [R48460de4c968-1]: |
fat_tree_topology (k) |
Return a fat tree datacenter topology, as described in [Rdaad0f90b4be-1] |
three_tier_topology (n_core, n_aggregation, …) |
Return a three-tier data center topology. |
two_tier_topology (n_core, n_edge, n_hosts) |
Return a two-tier datacenter topology. |
parsers
module¶
Functions to parse topologies from datasets or from other generators.
parse_abilene (topology_path[, links_path]) |
Parse the Abilene topology. |
parse_ashiip (path) |
Parse a topology from an output file generated by the aShiip topology generator |
parse_brite (path[, capacity_unit, …]) |
Parse a topology from an output file generated by the BRITE topology generator |
parse_caida_as_relationships (path) |
Parse a topology from the CAIDA AS relationships dataset |
parse_inet (path) |
Parse a topology from an output file generated by the Inet topology generator |
parse_rocketfuel_isp_map (path) |
Parse a network topology from RocketFuel ISP map file. |
parse_rocketfuel_isp_latency (latencies_path) |
Parse a network topology from RocketFuel ISP topology file (latency.intra) with inferred link latencies and optionally annotate the topology with inferred weights (weights.infra). |
parse_topology_zoo (path) |
Parse a topology from the Topology Zoo dataset. |
randmodels
module¶
Functions to generate random topologies according to a number of models.
The generated topologies are either Topology or DirectedTopology objects.
barabasi_albert_topology (n, m, m0[, seed]) |
Return a random topology using Barabasi-Albert preferential attachment model. |
erdos_renyi_topology (n, p[, seed, fast]) |
Return a random graph ![]() |
extended_barabasi_albert_topology (n, m, m0, p, q) |
Return a random topology using the extended Barabasi-Albert preferential attachment model. |
glp_topology (n, m, m0, p, beta[, seed]) |
Return a random topology using the Generalized Linear Preference (GLP) preferential attachment model. |
waxman_1_topology (n[, alpha, beta, L, …]) |
Return a Waxman-1 random topology. |
waxman_2_topology (n[, alpha, beta, domain, …]) |
Return a Waxman-2 random topology. |
simplemodels
module¶
Generate canonical deterministic topologies
chord_topology (m[, r]) |
Return a Chord topology, as described in [R409142fb3296-1]: |
dumbbell_topology (m1, m2) |
Return a dumbbell topology consisting of two star topologies connected by a path. |
full_mesh_topology (n) |
Return a fully connected mesh topology of n nodes |
k_ary_tree_topology (k, h) |
Return a balanced k-ary tree topology of with depth h |
line_topology (n) |
Return a line topology of n nodes |
ring_topology (n) |
Return a ring topology of n nodes |
star_topology (n) |
Return a star (a.k.a hub-and-spoke) topology of ![]() |
topology
module¶
Basic functions and classes for operating on network topologies.
fan_in_out_capacities (topology) |
Calculate fan-in and fan-out capacities for all nodes of the topology. |
od_pairs_from_topology (topology) |
Calculate all possible origin-destination pairs of the topology. |
rename_edge_attribute (topology, old_attr, …) |
Rename all edges attributes with a specific name to a new name |
rename_node_attribute (topology, old_attr, …) |
Rename all nodes attributes with a specific name to a new name |
read_topology (path[, encoding]) |
Read a topology from an XML file and returns either a Topology or a DirectedTopology object |
write_topology (topology, path[, encoding, …]) |
Write a topology object on an XML file |
adapters
package¶
autonetkit
module¶
Adapter for AutoNetkit.
This module contains function for converting FNSS Topology objects into NetworkX graph objects compatible with AutoNetKit and viceversa.
from_autonetkit (topology) |
Convert an AutoNetKit graph into an FNSS Topology object. |
to_autonetkit (topology) |
Convert an FNSS topology into a NetworkX graph object compatible for AutoNetKit. |
jfed
module¶
Adapter for jFed
Provides function to convert an FNSS Topology object into a jFed rspec file and viceversa.
jFed <http://jfed.iminds.be/>_ is a Java-based framework to support the integration of federated testbed, developed by iMinds <http://www.iminds.be/>_ in the contex of the Fed4FIRE <http://www.fed4fire.eu/>_ project funded by the Framework Programme 7 (FP7) of the European Union.
from_jfed (path) |
Read a jFed RSPEC file and returns an FNSS topology modelling the network topology of the jFed experiment specification. |
to_jfed (topology, path[, testbed, encoding, …]) |
Convert a topology object into an RSPEC file for jFed |
mn
module¶
Adapter for Mininet.
This module contains function to convert FNSS topologies into Mininet topologies and viceversa.
from_mininet (topology) |
Convert a Mininet topology to an FNSS one. |
to_mininet (topology[, switches, hosts, …]) |
Convert an FNSS topology to Mininet Topo object that can be used to deploy a Mininet network. |
ns2
module¶
Adapter for ns-2.
This module contains the code for converting an FNSS topology object into a Tcl script to deploy such topology into ns-2.
to_ns2 (topology, path[, stacks]) |
Convert topology object into an ns-2 Tcl script that deploys that topology into ns-2. |
validate_ns2_stacks (topology) |
Validate whether the stacks and applications of a topology are valid for ns-2 deployment |
omnetpp
module¶
Omnet++ adapter
This module contains the code for converting an FNSS topology object into a NED script to deploy such topology into Omnet++.
to_omnetpp (topology[, path]) |
Convert an FNSS topology into an Omnet++ NED script. |
Scripts¶
mn-fnss¶
Usage:
mn-fnss [mn-options] [--no-relabel] <topology-file>
mn-fnss (--help | -h)
mn-fnss (--version | -v)
Options:
mn-options Mininet mn options.
--no-relabel Do not relabel topology nodes to Mininet conventions.
-h --help Show help.
-v --version Show version.
Launch Mininet console with an FNSS topology.
This script parses an FNSS topology XML file and launches the Mininet console passing this topology.
This script accepts all the options of Mininet mn script, except for the custom and topo options which are overwritten by this script.
In addition, if the user specifies the mn link option, then all potential link attributes of the topology (e.g. capacity, delay and max queue size) are discarded and values provided with the link attributes are used instead.
Unless the option –no-relabel is provided, this script relabels all nodes of the FNSS topology to match Mininet’s conventions, i.e. each host label starts with h (e.g. h1, h2, h3…) and each switch label starts with s (e.g. s1, s2, s3…).
Unless used to print this help message or version information, this script must be run as superuser.
Example usage:
$ python
>>> import fnss
>>> topo = fnss.two_tier_topology(1, 2, 2)
>>> fnss.write_topology(topo, 'fnss-topo.xml')
$ sudo mn-fnss fnss-topo.xml
fnss-troubleshoot¶
Usage:
fnss-troubleshoot [--help | -h]
This script prints debugging information about FNSS dependencies currently installed.
The main purpose of this script is to help users to communicate effectively with developers when reporting an issue.