def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.dpid = abs(hash(name)) self.dstmac_cache = {} self.pox_switch = PoxBridgeSoftwareSwitch(self.dpid, name=name, ports=0, miss_send_len=2**16, max_buffers=2**8, features=None) self.pox_switch.set_connection(self) self.pox_switch.set_output_packet_callback(self. send_packet) self.controller_name = kwargs.get('controller', 'controller') self.autoack = bool(eval(kwargs.get('autoack', 'False'))) self.controller_links = {} self.interface_to_port_map = {} self.trace = bool(eval(kwargs.get('trace', 'False'))) self.tracePkt = bool(eval(kwargs.get('tracePkt','False'))) self.ipdests = PyTricia() for prefix in kwargs.get('ipdests','').split(): self.ipdests[prefix] = True # explicitly add a localhost link/interface ipa,ipb = [ ip for ip in next(FsConfigurator.link_subnetter).iterhosts() ] remotemac = default_ip_to_macaddr(ipb) self.add_link(NullLink, ipa, ipb, 'remote', remotemac=remotemac) self.trafgen_ip = str(ipa) self.trafgen_mac = remotemac self.dstmac_cache[self.name] = remotemac
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.dpid = abs(hash(name)) self.dstmac_cache = {} self.pox_switch = PoxBridgeSoftwareSwitch(self.dpid, name=name, ports=0, miss_send_len=2**16, max_buffers=2**8, features=None) self.pox_switch.set_connection(self) self.pox_switch.set_output_packet_callback(self. send_packet) self.controller_name = kwargs.get('controller', 'controller') self.autoack = bool(eval(kwargs.get('autoack', 'False'))) self.controller_links = {} self.interface_to_port_map = {} self.trace = bool(eval(kwargs.get('trace', 'False'))) self.ipdests = PyTricia() for prefix in kwargs.get('ipdests','').split(): self.ipdests[prefix] = True # explicitly add a localhost link/interface ipa,ipb = [ ip for ip in next(FsConfigurator.link_subnetter).iterhosts() ] remotemac = default_ip_to_macaddr(ipb) self.add_link(NullLink, ipa, ipb, 'remote', remotemac=remotemac) self.trafgen_ip = str(ipa) self.trafgen_mac = remotemac self.dstmac_cache[self.name] = remotemac
def start(self): '''Load POX controller components''' Node.start(self) # remove self from networkx graph (topology) fscore().topology.remove_node(self.name) for component in self.components: self.logger.debug("Starting OF Controller Component {}".format(component)) load_pox_component(component)
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.components = kwargs.get("components", "").split() self.conType = kwargs.get("conType") self.conAddr = kwargs.get("conAddr") self.conPort = eval(kwargs.get("conPort")) self.conTimeOut = eval(kwargs.get("conTimeOut")) self.switch_links = {} try: self.socket = socket.create_connection((self.conAddr, self.conPort), timeout=self.conTimeOut) except: raise Exception("Cannot create connection!") self.tracePkt = bool(eval(kwargs.get("tracePkt", "False")))
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) if 'components' in kwargs: self.forwarding = kwargs['components'] if (self.forwarding == 'l2_learning'): self.forwardingSwitch = L2LearningSwitch(self) elif (self.forwarding == 'l2_pairs'): self.forwardingSwitch = L2PairsSwitch(self) elif (self.forwarding == 'hub'): self.forwardingSwitch = Hub(self) elif (self.forwarding == 'l3_learning'): self.forwardingSwitch = L3Learning(self) elif (self.forwarding == 'shortest_paths'): self.forwardingSwitch = L3ShortestPaths(self)
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) if "components" in kwargs: self.forwarding = kwargs["components"] if self.forwarding == "l2_learning": self.forwardingSwitch = L2LearningSwitch(self) elif self.forwarding == "l2_pairs": self.forwardingSwitch = L2PairsSwitch(self) elif self.forwarding == "hub": self.forwardingSwitch = Hub(self) elif self.forwarding == "l3_learning": self.forwardingSwitch = L3Learning(self) elif self.forwarding == "shortest_paths": self.forwardingSwitch = L3ShortestPaths(self)
def start(self): """Load POX controller components""" Node.start(self) # remove self from networkx graph (topology) fscore().topology.remove_node(self.name) # FIXME: Check the type of controller and patch based on that... # Eventhought it works for pox, it will be difficult for ODL if self.conType == "POX" or self.conType == "RYU": self.logger.info("Patching {} integration with fs".format(self.conType)) for component in self.components: self.logger.debug("Starting OF Controller Component {}".format(component)) load_pox_component(component) elif self.conType == "ODL": self.logger.info("Patching ODL integration with fs") for component in self.components: self.logger.debug("Starting OF Controller Component {}".format(component)) load_odl_component(component) else: raise Exception("Other controller types not supported as of now.")
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.flow_table = FsSwitchFlowTable() self.controller = kwargs.get("controller", "controller")
def start(self): Node.start(self) fscore().after(1, "openflow-switch-table-ager" + str(self.name), self.table_ager)
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.components = kwargs.get('components','').split() self.switch_links = {}
def start(self): Node.start(self) fscore().after(0.010, "arp {}".format(self.name), self.send_gratuitous_arps) self.logger.debug("OF Switch Startup: {}".format(dpid_to_str(self.pox_switch.dpid))) for p in self.ports: self.logger.debug("\tSwitch port {}: {}, {}".format(p, self.ports[p], self.pox_switch.ports[p].show()))
def __init__(self, name, measurement_config, **kwargs): Node.__init__(self, name, measurement_config, **kwargs) self.flow_table = FsSwitchFlowTable() self.controller = kwargs.get('controller', 'controller')