def draw_SCION_topology(topology_dict, n_labels, e_labels):
"""
Draws the Scion topology from a topology dictionary
returned by parse_gen_folder.
:param dictionary topology_dict: dictionary returned by parse_gen_folder,
boolean ip_addresses: indicates if node labels are drawn,
boolean edge_labels: indicates if edge labels are drawn
:return Dot graph: graph of the SCION topology
"""
isd_graphs = {}
dot = Graph(name='topology',filename='topology.gv',comment='SCION-net')
ISDs = topology_dict["ISD"]
# draw each ISD graph
for ISD in ISDs:
isd_graphs[ISD] = draw_isd_graph(ISD, ISDs[ISD]["AS"], e_labels, n_labels)
# put all isd graphs into the same graph
for ISD in isd_graphs:
dot.subgraph(isd_graphs[ISD])
# add edges between ISDs
dot = draw_inter_ISD_edges(dot, ISDs, e_labels)
return dot
评论列表
文章目录