示例#1
0
 def _handle_ConnectionUp(self, event):
     """
 Esta funcion es llamada cada vez que un nuevo switch establece conexion
 Se encarga de crear un nuevo switch controller para manejar los eventos de cada switch
 """
     log.info("Switch %s has come up.", dpid_to_str(event.dpid))
     if (event.connection not in self.connections):
         self.connections.add(event.connection)
         sw = SwitchController(event.dpid, event.connection)
         self.switches.append(sw)
示例#2
0
    def _handle_ConnectionUp(self, event):
        """
        Esta funcion es llamada cada vez que un nuevo switch establece conexion
        """
        log.info("Switch %s has come up.", dpid_to_str(event.dpid))
        self.graph.add_node(dpid_to_str(event.dpid))

        if event.connection not in self.connections:
            self.connections.add(event.connection)
            sw = SwitchController(event.dpid, event.connection, self)
            self.switches[dpid_to_str(event.dpid)] = sw
    def _handle_ConnectionUp(self, event):
        # Esta funcion es llamada cada vez que un
        # nuevo switch establece conexion
        # Se encarga de crear un nuevo switch controller
        # para manejar los eventos de cada switch
        if event.connection not in self.connections:
            log.info("Switch %s has come up.", dpid_to_str(event.dpid))

            self.connections.add(event.connection)
            sc = SwitchController(event.dpid, event.connection, self.topology,
                                  table_hard_timeout)
            self.topology.add_switch(sc)
示例#4
0
 def _handle_ConnectionUp(self, event):
     """
     Esta funcion es llamada cada vez que un nuevo switch establece conexion
     Se encarga de crear un nuevo switch controller para manejar los eventos de cada switch
     """
     if (event.dpid not in self.connections):
         log.info("Switch %s has come up.", dpid_to_str(event.dpid))
         self.connections.add(event.dpid)
         self.topology[event.dpid] = set()
         sw = SwitchController(event.dpid, event.connection, self)
         self.switches.append(sw)
         self.has_updated_ecmp = False
         self.clean_switches_table()
    def _handle_ConnectionUp(self, event):
        """
        Esta funcion es llamada cada vez que un nuevo switch establece conexion
        Se encarga de crear un nuevo switch controller para manejar los eventos de cada switch
        """
        log.info("Switch %s has come up.", dpid_to_str(event.dpid))
        
        if event.connection not in self.connections:

            nombre = event.connection.features.ports[0].name
            switch = Switch(nombre, event.connection, event.dpid)
            self.fat_tree.agregar_switch(switch)
            print("switch agregado", switch)

            self.connections.add(event.connection)
            sw = SwitchController(event.dpid, event.connection, self.fat_tree, nombre)
            self.switches.append(sw)