caida.save

Save the current experiment CAIDA network topology to a JSON file. It is important to note that this does not save ALL FIREWHEEL experiment information but focuses particularly on the BGP routing information.

Model Component Dependencies:

Plugin

class caida.save_plugin.Save(graph, log)[source]

Bases: AbstractPlugin

Save the current experiment network topology to a JSON file.

__annotate_func__ = None
__annotations_cache__ = {}
__firstlineno__ = 9
__static_attributes__ = ()
find_router_by_as(bgp_as)[source]

Find a router vertex by its BGP AS number.

Parameters:

bgp_as (int) – The BGP AS number to search for.

Returns:

The router vertex with the specified BGP AS number, or None if not found.

Return type:

Vertex

find_switch(v1, v2)[source]

Find a switch vertex that connects two router vertices. If multiple switches are found, a warning is printed and only one the switches is returned.

Parameters:
  • v1 (Vertex) – The first router vertex.

  • v2 (Vertex) – The second router vertex.

Returns:

The switch vertex that connects the two routers, or None if not found.

Return type:

Vertex

is_jsonable(obj)[source]

Check if an object can be serialized to JSON.

Parameters:

obj (Vertex) – The object to check.

Returns:

True if the object can be serialized to JSON, False otherwise.

Return type:

bool

run(filename)[source]

Save the current experiment network topology to a JSON file. Switches are not included in the output as they can be inferred from base_objects.VMEndpoint interfaces.

Parameters:

filename (str) – The path to the JSON file where the topology data will be saved.

Raises:

TypeError – If the filename is not provided.