def create_topology_from_adjacency_matrix(self, data_directory): topo_file = data_directory + "/%s" % constants.ADJACENCY_FILE ez_topo = Ez_Topo() # topo = ez_topo.create_rocketfuel_topology(data_directory) topo = ez_topo.create_latency_topology_from_adjacency_matrix( data_directory) global_vars.switch_ids = topo.graph.nodes()
def parse_args(self, args, log): data_directory = "../%s/%s" % (args.data_folder, args.topology) ez_topo = Ez_Topo() if args.topology_type == constants.TOPO_ROCKETFUEL: topo = ez_topo.create_rocketfuel_topology(data_directory) elif args.topology_type == constants.TOPO_ADJACENCY: topo = ez_topo.create_topology_from_adjacency_matrix(data_directory) elif args.topology_type == constants.TOPO_WEIGHTED_ADJACENCY: topo = ez_topo.create_latency_topology_from_adjacency_matrix(data_directory) else: raise Exception("What topology type") flow_folder = utils.get_flow_folder(data_directory, args.topology_type, args.generating_method, str(args.number_of_flows), str(args.failure_rate)) return topo, flow_folder
def create_topology_from_adjacency_matrix(self, data_directory): topo_file = data_directory + "/%s" % constants.ADJACENCY_FILE ez_topo = Ez_Topo() # topo = ez_topo.create_rocketfuel_topology(data_directory) #, self.current_controller_sw) self.log.info("read from {0}".format(data_directory)) topo = ez_topo.create_latency_topology_from_adjacency_matrix( data_directory, -1) global_vars.switch_ids = topo.graph.nodes() self.sending_msgs_queue = { x: deque([]) for x in global_vars.switch_ids } for sw_id in global_vars.switch_ids: c = socket.socket() host = socket.gethostbyname('127.0.0.1') c.connect((host, 6800 + sw_id)) self.sockets[sw_id] = c
def create_topology(self, data_directory): ez_topo_creator = Ez_Topo() self.ez_topo = ez_topo_creator.create_latency_topology_from_adjacency_matrix(data_directory, -1) # self.ez_topo = ez_topo_creator.create_rocketfuel_topology(data_directory) global_vars.switch_ids = self.ez_topo.graph.nodes()
def create_topology(args, data_directory): ez_topo = Ez_Topo() if args.topology_type == constants.TOPO_ROCKETFUEL: return ez_topo.create_rocketfuel_topology(data_directory) elif args.topology_type == constants.TOPO_ADJACENCY: return ez_topo.create_topology_from_adjacency_matrix(data_directory)