def connection_lost(self, reason):
        """Stops all timers and notifies peer that connection is lost.
        """

        if self._peer:
            state = self._peer.state.bgp_state
            if self._is_bound or state == BGP_FSM_OPEN_SENT:
                self._peer.connection_lost(reason)

            self._peer = None

        if reason:
            LOG.info(reason)
        else:
            LOG.info('Connection to peer closed for unknown reasons.')