def multipath_computation(self):
edges = []
self.mp_config = {}
for dpid, switch in self.dpid_to_switch.iteritems():
# Updating the capacity_maxflow variable which will be
# modified by the algorithm with the realtime monitored capacity
for port_no, port in switch.ports.iteritems():
port.capacity_maxflow = port.capacity
# Adding the edge switches to a list
if switch.edge_port:
edges.append(switch)
# Calculate forwarding paths between all edges couples
logger.info('%s', self.dpid_to_switch)
for edge_couple in itertools.permutations(edges, 2):
self.calculate_multipath(edge_couple[0], edge_couple[1])
self.create_flow_rules(edge_couple[0], edge_couple[1])
logger.info('-' * 20)
network_topology.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录