Beispiel #1
0
    def send_rrc_meas_reconfig_request(self, params, xid):

        rrc_meas_reconfig_req = progran_pb2.progran_message()
        meas_config_msg = rrc_meas_reconfig_req.ue_rrc_measurements_config_msg
        meas_config_msg.rnti = xid  # rnti value is passed to xid
        config = meas_config_msg.config

        self.create_header(xid, self.enb_id,
                           header_pb2.PRPT_SEND_RRC_MEASUREMENTS_CONFIG,
                           meas_config_msg.header)
        rrc_meas_reconfig_req.msg_dir = progran_pb2.INITIATING_MESSAGE

        meas_config = params["rrc_measurements_request"]

        if "reportInterval" in meas_config:
            config.report_interval = REPORT_INTERVAL[
                meas_config["reportInterval"]]

        if "reporting_carrier_frequency" in meas_config:
            config.report_carrier_freq = int(
                meas_config["reporting_carrier_frequency"])

        LOG.info(
            "Sending RRC Measurement reconfiguration request message to VBSP %s",
            self.vbsp.addr)
        self.stream_send(rrc_meas_reconfig_req)

        return 0
    def send_echo_request(self, enb_id):

        echo_request = progran_pb2.progran_message()

        self.create_header(self.xid, enb_id, header_pb2.PRPT_ECHO_REQUEST, echo_request.echo_request_msg.header)
        echo_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        LOG.info("Sending echo request message to VBSP %f", self.vbsp.addr)
        self.stream_send(echo_request)
    def send_enb_config_request(self, enb_id):

        enb_config_request = progran_pb2.progran_message()

        self.create_header(self.xid, enb_id, header_pb2.PRPT_GET_ENB_CONFIG_REQUEST, enb_config_request.enb_config_request_msg.header)
        enb_config_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        LOG.info("Sending ENB config request message to VBSP %s", self.vbsp.addr)
        self.stream_send(enb_config_request)
Beispiel #4
0
    def send_echo_request(self, enb_id):

        echo_request = progran_pb2.progran_message()

        self.create_header(self.xid, enb_id, header_pb2.PRPT_ECHO_REQUEST,
                           echo_request.echo_request_msg.header)
        echo_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        LOG.info("Sending echo request message to VBSP %f", self.vbsp.addr)
        self.stream_send(echo_request)
Beispiel #5
0
    def deserialize_message(self, serialized_data):

        if not serialized_data:
            LOG.error("Received serialized data is None")
            return None

        msg = progran_pb2.progran_message()
        msg.ParseFromString(serialized_data)

        return msg
    def deserialize_message(self, serialized_data):

        if not serialized_data:
            LOG.error("Received serialized data is None")
            return None

        msg = progran_pb2.progran_message()
        msg.ParseFromString(serialized_data)

        return msg
Beispiel #7
0
    def send_enb_config_request(self, enb_id):

        enb_config_request = progran_pb2.progran_message()

        self.create_header(self.xid, enb_id,
                           header_pb2.PRPT_GET_ENB_CONFIG_REQUEST,
                           enb_config_request.enb_config_request_msg.header)
        enb_config_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        LOG.info("Sending ENB config request message to VBSP %s",
                 self.vbsp.addr)
        self.stream_send(enb_config_request)
Beispiel #8
0
    def _handle_echo_request(self, enb_id, echo_request):

        if echo_request is None:
            LOG.error("Echo request message is null")

        xid = echo_request.echo_request_msg.header.xid

        echo_reply = progran_pb2.progran_message()
        err_code = progran_pb2.NO_ERR

        self.create_header(xid, enb_id, header_pb2.PRPT_ECHO_REPLY,
                           echo_reply.echo_reply_msg.header)

        echo_reply.msg_dir = progran_pb2.SUCCESSFUL_OUTCOME

        LOG.info("Sending echo reply message to VBSP %f", self.vbsp.addr)
        self.stream_send(echo_reply)
    def _handle_echo_request(self, enb_id, echo_request):

        if echo_request is None:
            LOG.error("Echo request message is null")

        xid = echo_request.echo_request_msg.header.xid

        echo_reply = progran_pb2.progran_message()
        err_code = progran_pb2.NO_ERR

        self.create_header(xid, enb_id, header_pb2.PRPT_ECHO_REPLY,
                           echo_reply.echo_reply_msg.header)

        echo_reply.msg_dir = progran_pb2.SUCCESSFUL_OUTCOME

        LOG.info("Sending echo reply message to VBSP %f", self.vbsp.addr)
        self.stream_send(echo_reply)
    def send_rrc_meas_reconfig_request(self, params, xid):

        rrc_meas_reconfig_req = progran_pb2.progran_message()
        meas_config_msg = rrc_meas_reconfig_req.ue_rrc_measurements_config_msg
        meas_config_msg.rnti = xid # rnti value is passed to xid
        config = meas_config_msg.config
        
        self.create_header(xid, self.enb_id, header_pb2.PRPT_SEND_RRC_MEASUREMENTS_CONFIG, meas_config_msg.header)
        rrc_meas_reconfig_req.msg_dir = progran_pb2.INITIATING_MESSAGE

        meas_config = params["rrc_measurements_request"]

        if "reportInterval" in meas_config:
            config.report_interval = REPORT_INTERVAL[meas_config["reportInterval"]]

        if "reporting_carrier_frequency" in meas_config:
            config.report_carrier_freq = int(meas_config["reporting_carrier_frequency"])

        LOG.info("Sending RRC Measurement reconfiguration request message to VBSP %s", self.vbsp.addr)
        self.stream_send(rrc_meas_reconfig_req)

        return 0
Beispiel #11
0
    def send_mac_stats_request(self, enb_id, params, xid):

        stats_request = progran_pb2.progran_message()

        self.create_header(xid, enb_id, header_pb2.PRPT_GET_ENB_CONFIG_REQUEST,
                           stats_request.stats_request_msg.header)
        stats_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        stats_request_config = params["stats_request_config"]
        stats_request_msg = stats_request.stats_request_msg
        stats_request_msg.type = MAC_STATS_TYPE[
            stats_request_config["report_type"]]

        if stats_request_msg.type == stats_messages_pb2.PRST_COMPLETE_STATS:

            complete_stats = stats_request_msg.complete_stats_request
            complete_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                stats_request_config["report_frequency"]]
            complete_stats.sf = stats_request_config["periodicity"]

            cc_report_flag = 0
            ue_report_flag = 0

            if stats_request_config["report_frequency"] != "off":
                for flag in stats_request_config["report_config"][
                        "cell_report_type"]["cell_report_flags"]:
                    cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

                for flag in stats_request_config["report_config"][
                        "ue_report_type"]["ue_report_flags"]:
                    ue_report_flag |= MAC_UE_STATS_TYPES[flag]

            complete_stats.ue_report_flags = ue_report_flag
            complete_stats.cell_report_flags = cc_report_flag

        elif stats_request_msg.type == stats_messages_pb2.PRST_CELL_STATS:
            cell_stats = stats_request_msg.cell_stats_request
            cell_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                stats_request_config["report_frequency"]]
            cell_stats.sf = stats_request_config["periodicity"]

            cc_report_flag = 0

            for flag in stats_request_config["report_config"][
                    "cell_report_type"]["cell_report_flags"]:
                cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

            for cc in stats_request_config["report_config"][
                    "cell_report_type"]["cc_id"]:
                cell_stats.cell.append(cc)

            cell_stats.flags = cc_report_flag

        elif stats_request_msg.type == stats_messages_pb2.PRST_UE_STATS:
            # Periodic reporting not supported here yet
            ue_stats = stats_request_msg.ue_stats_request
            ue_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                stats_request_config["report_frequency"]]
            ue_stats.sf = stats_request_config["periodicity"]

            ue_report_flag = 0

            for flag in stats_request_config["report_config"][
                    "ue_report_type"]["ue_report_flags"]:
                ue_report_flag |= MAC_UE_STATS_TYPES[flag]

            for rnti in stats_request_config["report_config"][
                    "ue_report_type"]["ue_rnti"]:
                ue_stats.rnti.append(rnti)

            ue_stats.flags = ue_report_flag

        LOG.info("Sending ENB mac stats request message to VBSP %s",
                 self.vbsp.addr)
        self.stream_send(stats_request)

        return 0
    def run_once(self):
        """ Send out mac stats request. """

        if self.tenant_id not in RUNTIME.tenants:
            return

        vbsps = RUNTIME.tenants[self.tenant_id].vbsps

        if self.vbsp not in vbsps:
            return

        vbsp = vbsps[self.vbsp]

        if not vbsp.connection:
            return

        stats_request = progran_pb2.progran_message()

        try:
            stats_request_config = self.mac_stats_req["stats_request_config"]
            stats_request_msg = stats_request.stats_request_msg
            stats_request_msg.type = MAC_STATS_TYPE[stats_request_config["report_type"]]

            connection = vbsp.connection

            if stats_request_config["report_frequency"] == "off":
                connection.create_header(stats_request_config["timer_xid"], connection.enb_id, header_pb2.PRPT_GET_ENB_CONFIG_REQUEST, stats_request.stats_request_msg.header)
            else:
                connection.create_header(self.module_id, connection.enb_id, header_pb2.PRPT_GET_ENB_CONFIG_REQUEST, stats_request.stats_request_msg.header)
            
            stats_request.msg_dir = progran_pb2.INITIATING_MESSAGE

            if stats_request_config["report_frequency"] == "periodical":
                TIMER_IDS.append(self.module_id)

            if stats_request_msg.type == stats_messages_pb2.PRST_COMPLETE_STATS:

                complete_stats = stats_request_msg.complete_stats_request
                complete_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
                complete_stats.sf = stats_request_config["periodicity"]

                cc_report_flag = 0
                ue_report_flag = 0

                if stats_request_config["report_frequency"] != "off":
                    for flag in stats_request_config["report_config"]["cell_report_type"]["cell_report_flags"]:
                        cc_report_flag |= MAC_CELL_STATS_TYPES[flag]            

                    for flag in stats_request_config["report_config"]["ue_report_type"]["ue_report_flags"]:
                        ue_report_flag |= MAC_UE_STATS_TYPES[flag]

                complete_stats.ue_report_flags = ue_report_flag
                complete_stats.cell_report_flags = cc_report_flag

            elif stats_request_msg.type == stats_messages_pb2.PRST_CELL_STATS:
                cell_stats = stats_request_msg.cell_stats_request
                cell_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
                cell_stats.sf = stats_request_config["periodicity"]

                cc_report_flag = 0

                for flag in stats_request_config["report_config"]["cell_report_type"]["cell_report_flags"]:
                    cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

                for cc in stats_request_config["report_config"]["cell_report_type"]["cc_id"]:
                    cell_stats.cell.append(cc)

                cell_stats.flags = cc_report_flag

            elif stats_request_msg.type == stats_messages_pb2.PRST_UE_STATS:
                ue_stats = stats_request_msg.ue_stats_request
                ue_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
                ue_stats.sf = stats_request_config["periodicity"]

                ue_report_flag = 0                

                for flag in stats_request_config["report_config"]["ue_report_type"]["ue_report_flags"]:
                    ue_report_flag |= MAC_UE_STATS_TYPES[flag]

                for rnti in stats_request_config["report_config"]["ue_report_type"]["ue_rnti"]:
                    ue_stats.rnti.append(rnti)

                ue_stats.flags = ue_report_flag

        except KeyError:
            return
        except ValueError:
            return

        LOG.info("Sending mac stats request to %s (id=%u)", vbsp.addr, self.module_id)

        vbsp.connection.stream_send(stats_request)

        if stats_request_config["report_frequency"] == "off":
            self.worker.remove_module(stats_request_config["timer_xid"])
    def send_mac_stats_request(self, enb_id, params, xid):

        stats_request = progran_pb2.progran_message()

        self.create_header(xid, enb_id, header_pb2.PRPT_GET_ENB_CONFIG_REQUEST, stats_request.stats_request_msg.header)
        stats_request.msg_dir = progran_pb2.INITIATING_MESSAGE

        stats_request_config = params["stats_request_config"]
        stats_request_msg = stats_request.stats_request_msg
        stats_request_msg.type = MAC_STATS_TYPE[stats_request_config["report_type"]]

        if stats_request_msg.type == stats_messages_pb2.PRST_COMPLETE_STATS:

            complete_stats = stats_request_msg.complete_stats_request
            complete_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
            complete_stats.sf = stats_request_config["periodicity"]

            cc_report_flag = 0
            ue_report_flag = 0

            if stats_request_config["report_frequency"] != "off":
                for flag in stats_request_config["report_config"]["cell_report_type"]["cell_report_flags"]:
                    cc_report_flag |= MAC_CELL_STATS_TYPES[flag]            

                for flag in stats_request_config["report_config"]["ue_report_type"]["ue_report_flags"]:
                    ue_report_flag |= MAC_UE_STATS_TYPES[flag]

            complete_stats.ue_report_flags = ue_report_flag
            complete_stats.cell_report_flags = cc_report_flag

        elif stats_request_msg.type == stats_messages_pb2.PRST_CELL_STATS:
            cell_stats = stats_request_msg.cell_stats_request
            cell_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
            cell_stats.sf = stats_request_config["periodicity"]

            cc_report_flag = 0

            for flag in stats_request_config["report_config"]["cell_report_type"]["cell_report_flags"]:
                cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

            for cc in stats_request_config["report_config"]["cell_report_type"]["cc_id"]:
                cell_stats.cell.append(cc)

            cell_stats.flags = cc_report_flag

        elif stats_request_msg.type == stats_messages_pb2.PRST_UE_STATS:
            # Periodic reporting not supported here yet
            ue_stats = stats_request_msg.ue_stats_request
            ue_stats.report_frequency = MAC_STATS_REPORT_FREQ[stats_request_config["report_frequency"]]
            ue_stats.sf = stats_request_config["periodicity"]

            ue_report_flag = 0                

            for flag in stats_request_config["report_config"]["ue_report_type"]["ue_report_flags"]:
                ue_report_flag |= MAC_UE_STATS_TYPES[flag]

            for rnti in stats_request_config["report_config"]["ue_report_type"]["ue_rnti"]:
                ue_stats.rnti.append(rnti)

            ue_stats.flags = ue_report_flag

        LOG.info("Sending ENB mac stats request message to VBSP %s", self.vbsp.addr)
        self.stream_send(stats_request)

        return 0
Beispiel #14
0
    def run_once(self):
        """ Send out mac stats request. """

        if self.tenant_id not in RUNTIME.tenants:
            return

        vbsps = RUNTIME.tenants[self.tenant_id].vbsps

        if self.vbsp not in vbsps:
            return

        vbsp = vbsps[self.vbsp]

        if not vbsp.connection:
            return

        stats_request = progran_pb2.progran_message()

        try:
            stats_request_config = self.mac_stats_req["stats_request_config"]
            stats_request_msg = stats_request.stats_request_msg
            stats_request_msg.type = MAC_STATS_TYPE[
                stats_request_config["report_type"]]

            connection = vbsp.connection

            if stats_request_config["report_frequency"] == "off":
                connection.create_header(
                    stats_request_config["timer_xid"], connection.enb_id,
                    header_pb2.PRPT_GET_ENB_CONFIG_REQUEST,
                    stats_request.stats_request_msg.header)
            else:
                connection.create_header(
                    self.module_id, connection.enb_id,
                    header_pb2.PRPT_GET_ENB_CONFIG_REQUEST,
                    stats_request.stats_request_msg.header)

            stats_request.msg_dir = progran_pb2.INITIATING_MESSAGE

            if stats_request_config["report_frequency"] == "periodical":
                TIMER_IDS.append(self.module_id)

            if stats_request_msg.type == stats_messages_pb2.PRST_COMPLETE_STATS:

                complete_stats = stats_request_msg.complete_stats_request
                complete_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                    stats_request_config["report_frequency"]]
                complete_stats.sf = stats_request_config["periodicity"]

                cc_report_flag = 0
                ue_report_flag = 0

                if stats_request_config["report_frequency"] != "off":
                    for flag in stats_request_config["report_config"][
                            "cell_report_type"]["cell_report_flags"]:
                        cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

                    for flag in stats_request_config["report_config"][
                            "ue_report_type"]["ue_report_flags"]:
                        ue_report_flag |= MAC_UE_STATS_TYPES[flag]

                complete_stats.ue_report_flags = ue_report_flag
                complete_stats.cell_report_flags = cc_report_flag

            elif stats_request_msg.type == stats_messages_pb2.PRST_CELL_STATS:
                cell_stats = stats_request_msg.cell_stats_request
                cell_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                    stats_request_config["report_frequency"]]
                cell_stats.sf = stats_request_config["periodicity"]

                cc_report_flag = 0

                for flag in stats_request_config["report_config"][
                        "cell_report_type"]["cell_report_flags"]:
                    cc_report_flag |= MAC_CELL_STATS_TYPES[flag]

                for cc in stats_request_config["report_config"][
                        "cell_report_type"]["cc_id"]:
                    cell_stats.cell.append(cc)

                cell_stats.flags = cc_report_flag

            elif stats_request_msg.type == stats_messages_pb2.PRST_UE_STATS:
                ue_stats = stats_request_msg.ue_stats_request
                ue_stats.report_frequency = MAC_STATS_REPORT_FREQ[
                    stats_request_config["report_frequency"]]
                ue_stats.sf = stats_request_config["periodicity"]

                ue_report_flag = 0

                for flag in stats_request_config["report_config"][
                        "ue_report_type"]["ue_report_flags"]:
                    ue_report_flag |= MAC_UE_STATS_TYPES[flag]

                for rnti in stats_request_config["report_config"][
                        "ue_report_type"]["ue_rnti"]:
                    ue_stats.rnti.append(rnti)

                ue_stats.flags = ue_report_flag

        except KeyError:
            return
        except ValueError:
            return

        LOG.info("Sending mac stats request to %s (id=%u)", vbsp.addr,
                 self.module_id)

        vbsp.connection.stream_send(stats_request)

        if stats_request_config["report_frequency"] == "off":
            self.worker.remove_module(stats_request_config["timer_xid"])