def __init__(self):
        core.openflow.addListeners(self)

        def startup():
            core.openflow.addListeners(self, priority=0)
            core.openflow_discovery.addListeners(self)

        core.call_when_ready(startup, ('openflow', 'openflow_discovery'))

        self.event = None
        self.dpid = None
        self.in_port = None
        self.packet = None
        self.dst_dpid = None
        self.out_port = None
        self.table = ECMPTable()
        self.eth_packet = None
        self.ip_packet = None
        self.arp_packet = None
        self.icmp_packet = None
        self.tcp_packet = None
        self.udp_packet = None
        self.net_packet = None
        self.protocol_packet = None
        self.protocol = None
        self.arp_table = {}
        self.is_ip = True
        self.adjacency = {}
        self.host_tracker = host_tracker()
        log.info("controller ready")
Exemplo n.º 2
0
    def __init__(self):
        self.graph = nx.Graph()
        self.ht = host_tracker.host_tracker()

        core.openflow_discovery.addListeners(self)
        self.listenTo(self.ht)
        core.addListeners(self)
Exemplo n.º 3
0
    def __init__(self):
        """
        Initialise topology module.
        """
        self.graph = nx.Graph()
        self.ht = host_tracker.host_tracker()

        core.openflow_discovery.addListeners(self)
        self.listenTo(self.ht)
        core.addListeners(self)
Exemplo n.º 4
0
    def __init__(self):
        self.connections = set()
        self.switches = []
        self.topology = nx.Graph()
        self.ports = {}
        self.host_tracker = host_tracker()
        self.firewall = FireWall()
        self.firewall.start()
        self.ecmp_table = ECMPTable()

        # Esperando que los modulos openflow y openflow_discovery esten listos
        core.call_when_ready(self.startup, ('openflow', 'openflow_discovery'))
Exemplo n.º 5
0
  def __init__ (self):
    self.connections = set()
    self.switches = []
    self.topology = {}
    self.links_counter = 0
    self.host_tracker = host_tracker()
    self.hosts_by_switch = {}
    self.ecmp_util = ECMPUtil()
    self.has_updated_ecmp = False

    # Esperando que los modulos openflow y openflow_discovery esten listos
    core.call_when_ready(self.startup, ('openflow', 'openflow_discovery'))
Exemplo n.º 6
0
    def __init__(self, dpid, connection, topology, table_hard_timeout):
        log.info("New switch has come up, table_hard_timeout: %s",
                 table_hard_timeout)
        self.connection = connection

        # El SwitchController se agrega como
        # handler de los eventos del switch
        self.connection.addListeners(self)

        # El host_tracker sirve para obtener las direcciones MAC
        # de los hosts de la red
        self.host_tracker = host_tracker()

        # repo de jemplo donde se explica el funcionamiento del host_tracker
        # https://github.com/kbmorris/sdn/blob/master/pox/misc/gephi_topo.py

        self.topology = topology
        self.dpid = dpid
        self.table_hard_timeout = table_hard_timeout