tests.networkx

This MC provides a complex example of how to convert a NetworkX graph into a FIREWHEEL experiment. Specifically, it leverages the networkx.random_internet_as_graph() topology which creates a random undirected graph resembling the Internet AS network. In this graph, each node models an autonomous system, with an attribute type specifying its kind; tier-1 (T), mid-level (M), customer (C) or content-provider (CP). The associated plugin.py converts each AS (i.e. T and M) into a BGP router and each customer (i.e., C and CP) into a Ubuntu server. This topology takes users though how to decorate the nodes, add the appropriate BGP information, and insert Switches between links so that it will function correctly. Users can specify the number of nodes in the topology and can also choose to remove the NxEdges to better visualize the graph with the misc.print_graph Model Component.

Attribute Depends:
  • graph

Attribute Provides:
  • topology

Model Component Dependencies:

Plugin

class tests.networkx_plugin.Plugin(graph, log)[source]

Bases: AbstractPlugin

This plugin provides an example of how to convert a NetworkX based graph into a FIREWHEEL experiment. Specifically, it leverages the nx.random_internet_as_graph() topology which creates a random undirected graph resembling the Internet AS network.

__annotations__ = {}
run(num_nodes='100', del_edges='False')[source]

Run method documentation which takes the NetworkX graph and converts it to FIREWHEEL.

Parameters:
  • num_nodes (str) – Signifies the number of nodes in the network. This should be convertible to an int.

  • del_edges (str) – Whether to delete any Edges that are decorated with NxEdge. This is particularly useful for visualizing the graph structure. This should be convertible to an bool.

Raises:

RuntimeError – If the input parameters are improperly formatted.