Example #1
0
    def datapath_connect(self, discovered_up_port_nums):
        """Handle Ryu datapath connection event and provision pipeline.

        Args:
            discovered_up_port_nums (list): datapath ports that are up as ints.
        Returns:
            list: OpenFlow messages to send to datapath.
        """
        self.logger.info('Cold start configuring DP')
        self._notify({'DP_CHANGE': {'reason': 'cold_start'}})
        ofmsgs = []
        ofmsgs.append(valve_of.faucet_config())
        ofmsgs.append(
            valve_of.faucet_async(
                notify_flow_removed=self.dp.use_idle_timeout))
        ofmsgs.extend(self._add_default_flows())
        ofmsgs.extend(self._add_ports_and_vlans(discovered_up_port_nums))
        ofmsgs.extend(self._add_controller_learn_flow())
        self.dp.dyn_last_coldstart_time = time.time()
        self.dp.running = True
        self.metrics.of_dp_connections.labels(  # pylint: disable=no-member
            **self.base_prom_labels).inc()
        self.metrics.dp_status.labels(  # pylint: disable=no-member
            **self.base_prom_labels).set(1)
        return ofmsgs
Example #2
0
    def _datapath_connect(self, ryu_event):
        """Handle DP up.

        Args:
            ryu_event (ryu.controller.event.EventReplyBase): DP event.
        """
        watchers, ryu_dp, _ = self._get_watchers(ryu_event)
        if watchers is None:
            return
        self.logger.info('%s up', dpid_log(ryu_dp.id))
        ryu_dp.send_msg(valve_of.faucet_config(datapath=ryu_dp))
        ryu_dp.send_msg(valve_of.faucet_async(datapath=ryu_dp, packet_in=False))
        self._start_watchers(ryu_dp, watchers, time.time())
Example #3
0
    def _datapath_connect(self, ryu_event):
        """Handle DP up.

        Args:
            ryu_event (ryu.controller.event.EventReplyBase): DP event.
        """
        watchers, ryu_dp, _ = self._get_watchers(ryu_event)
        if watchers is None:
            return
        self.logger.info('%s up', dpid_log(ryu_dp.id))
        ryu_dp.send_msg(valve_of.faucet_config(datapath=ryu_dp))
        ryu_dp.send_msg(valve_of.faucet_async(datapath=ryu_dp, packet_in=False))
        self._start_watchers(ryu_dp, watchers, time.time())
Example #4
0
    def datapath_connect(self, discovered_up_port_nums):
        """Handle Ryu datapath connection event and provision pipeline.

        Args:
            discovered_up_port_nums (list): datapath ports that are up as ints.
        Returns:
            list: OpenFlow messages to send to datapath.
        """
        self.logger.info('Cold start configuring DP')
        self._notify({'DP_CHANGE': {'reason': 'cold_start'}})
        ofmsgs = []
        ofmsgs.append(valve_of.faucet_config())
        ofmsgs.append(valve_of.faucet_async())
        ofmsgs.extend(self._add_default_flows())
        ofmsgs.extend(self._add_ports_and_vlans(discovered_up_port_nums))
        ofmsgs.extend(self._add_controller_learn_flow())
        self.dp.running = True
        return ofmsgs