def _demandEstimator(self, flows, hostsList): ''' Estimate flows' demands. ''' estimated_flows = demand_estimation(flows, hostsList) for flow in estimated_flows: if flow['demand'] > 0.1: self._GlobalFirstFit(flow)
def _demandEstimator(self, flows, hostsList): ''' Estimate flows' demands. ''' estimated_flows = demand_estimation(flows, hostsList) for flow in estimated_flows: if flow['demand'] > 0.1: if not Hedera.is_multicast_addr(flow['dst']): self._GlobalFirstFit(flow)
def _demandEstimator(self, flows, hostsList): ''' Estimate flows' demands. ''' estimated_flows = demand_estimation(flows, hostsList) for flow in estimated_flows: if flow['demand'] > 0.1: # Thread(target=self._GlobalFirstFit,args=(flow,)).start() self._GlobalFirstFit(flow)
def _demandEstimator(self): '''estimate the actual flow demands here''' temp = self.flows temp = sorted(temp, key=lambda temp: temp['src']) self.flows = temp self.bwReservation = {} M, estFlows = demand_estimation(self.flows, sorted(self.hostsList)) for flow in estFlows: demand = flow['demand'] if demand >= 0.1: self._GlobalBestFit(flow)
def _demandEstimator(self): '''estimate the actual flow demands here''' temp = self.flows temp = sorted(temp, key=lambda temp: temp['src']) self.flows = temp self.bwReservation = {} M, estFlows = demand_estimation(self.flows, sorted(self.hostsList)) for flow in estFlows: demand = flow['demand'] if demand >= self.ratio: self._HederaSimulatedAnnealing(flow)
def _demandEstimator(self): '''estimate the actual flow demands here''' temp = self.flows temp = sorted(temp, key=lambda temp:temp['src']) self.flows = temp self.bwReservation = {} M, estFlows = demand_estimation(self.flows, sorted(self.hostsList)) for flow in estFlows: demand = flow['demand'] if demand >= 0.1: self._GlobalBestFit(flow)
def link_status(self): """ check load of links """ if self.elephant_number >= 6: self.logger.info(self.elephant_number) self.hostsList = [] self.flows = [] for key in self.elephant_info: speed = self.elephant_info[key][0] if speed > setting.MAX_CAPACITY * 0.1: src_ip = key[0] dst_ip = key[1] flow = self.elephant_info[key] # flow_info = (speed, flow[1], flow[2]) stat = flow[3] priority = flow[2] self.flows.append({ 'src': src_ip, 'dst': dst_ip, 'demand': speed, 'converged': False, 'receiver_limited': False, 'match': stat, 'priority': priority }) if src_ip not in self.hostsList: self.hostsList.append(src_ip) if dst_ip not in self.hostsList: self.hostsList.append(dst_ip) flows = sorted([flow for flow in self.flows], key=lambda flow: (flow['src'], flow['dst'])) hostsList = sorted(self.hostsList) estimated_flows = demand_estimation(flows, hostsList) for flow in estimated_flows: if flow['demand'] > 0.1: src_ip = flow['src'] dst_ip = flow['dst'] flow_info = (round(setting.MAX_CAPACITY * flow['demand'], 2), flow['match']['eth_type'], flow['priority']) self.find_new_path(src_ip, dst_ip, flow_info) self.flow_path_number = self.flow_path_number + 1
def _demandEstimator(self, flows, hostsList): estimated_flows = demand_estimation(flows, hostsList) self._reroute(estimated_flows)
def _demandEstimator(self, flows, hostsList): ''' Estimate flows' demands. ''' estimated_flows = demand_estimation(flows, hostsList)