Commit 4cfa87b6 authored by shahab SHARIATBAGHERI's avatar shahab SHARIATBAGHERI

downlink throughput enhancement

parent a77082c1
......@@ -820,6 +820,7 @@ include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS")
include_directories("${OPENAIR2_DIR}/ENB_APP")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC")
include_directories("${OPENAIR2_DIR}/UTIL/OSA")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
......@@ -905,8 +906,11 @@ if (FLEXRAN_AGENT_SB_IF)
add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_timer.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c
......
......@@ -37,50 +37,10 @@
#include "flexran_agent_common.h"
#include "flexran_agent_extern.h"
/* These types will be used to give
instructions for the type of stats reports
we need to create */
typedef struct {
uint16_t ue_rnti;
uint32_t ue_report_flags; /* Indicates the report elements
required for this UE id. See
FlexRAN specification 1.2.4.2 */
} ue_report_type_t;
typedef struct {
uint16_t cc_id;
uint32_t cc_report_flags; /* Indicates the report elements
required for this CC index. See
FlexRAN specification 1.2.4.3 */
} cc_report_type_t;
typedef struct {
int nr_ue;
ue_report_type_t *ue_report_type;
int nr_cc;
cc_report_type_t *cc_report_type;
} report_config_t;
typedef struct stats_request_config_s{
uint8_t report_type;
uint8_t report_frequency;
uint16_t period; /*In number of subframes*/
report_config_t *config;
} stats_request_config_t;
/* Initialization function for the agent structures etc */
void flexran_agent_init_mac_agent(mid_t mod_id);
int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/* Statistics request protocol message constructor and destructor */
int flexran_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
/* Scheduling request information protocol message constructor and estructor */
int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
......@@ -89,6 +49,10 @@ int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_mac_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */
int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
......
......@@ -180,10 +180,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport *
}
}
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) {
copy->has_phr = original->has_phr;
copy->phr = original->phr;
}
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PHR) {
copy->has_phr = original->has_phr;
copy->phr = original->phr;
}
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) {
copy->n_rlc_report = original->n_rlc_report;
......
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file flexran_agent_rrc.h
* \brief FlexRAN agent Control Module RRC header
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
#ifndef FLEXRAN_AGENT_RRC_H_
#define FLEXRAN_AGENT_RRC_H_
#include "header.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
#include "MeasResults.h"
#include "flexran_agent_common.h"
#include "flexran_agent_rrc_defs.h"
/* Initialization function for the agent structures etc */
void flexran_agent_init_rrc_agent(mid_t mod_id);
/* UE state change message constructor and destructor */
int flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
/**********************************
* FlexRAN agent - technology RRC API
**********************************/
/* Send to the controller all the rrc stat updates that occured during this subframe*/
// void flexran_agent_send_update_rrc_stats(mid_t mod_id);
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
int flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t *);
/*Register technology specific interface callbacks*/
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface*xface);
#endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2016 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file flexran_agent_rrc_defs.h
* \brief FlexRAN agent - RRC interface primitives
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
* \mail
*/
#ifndef __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
#define __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
#include "flexran_agent_defs.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#define RINGBUFFER_SIZE 100
/* FLEXRAN AGENT-RRC Interface */
typedef struct {
/// Inform the controller about the scheduling requests received during the subframe
//void (*flexran_agent_send_update_rrc_stats)(mid_t mod_id);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint32_t state_change);
void (*flexran_trigger_rrc_measurements)(mid_t mod_id, MeasResults_t* measResults)
} AGENT_RRC_xface;
#endif
......@@ -28,6 +28,7 @@ message flexran_message {
flex_ue_state_change ue_state_change_msg = 15;
flex_control_delegation control_delegation_msg = 16;
flex_agent_reconfiguration agent_reconfiguration_msg = 17;
flex_rrc_triggering rrc_triggering = 18;
}
}
......@@ -163,6 +164,13 @@ message flex_dl_mac_config {
repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
}
message flex_rrc_triggering {
optional flex_header header = 1;
optional string rrc_trigger = 2;
}
//
// UE state change message
//
......
......@@ -39,5 +39,7 @@ enum flex_type {
// Control delegation messages
FLPT_DELEGATE_CONTROL = 15;
FLPT_RECONFIGURE_AGENT = 16;
FLPT_RRC_TRIGGERING = 17;
}
......@@ -181,3 +181,63 @@ message flex_noise_interference_report {
optional int32 p0_nominal_pucch = 4;
}
//
// RRC Primitives
//
message flex_rrc_measurements {
// Measurement identifier.
optional int32 measid = 1;
// Primary Cell Reference Signal Received Power (RSRP).
optional int32 pcell_rsrp = 2;
// Primary Cell Reference Signal Received Quality (RSRQ).
optional int32 pcell_rsrq = 3;
// Neighboring cells measurements performed by UE.
optional flex_neigh_cells_measurements neigh_meas = 4;
}
message flex_neigh_cells_measurements {
// Neighboring EUTRA cells measurements.
repeated flex_eutra_measurements eutra_meas = 1;
}
message flex_eutra_measurements {
// Physical Cell identifier.
optional int32 phys_cell_id = 1;
// EUTRA Cell Global Identity (CGI) measurement.
optional flex_eutra_cgi_measurements cgi_meas = 2;
// EUTRA nearby cell reference signal measurement.
optional flex_eutra_ref_signal_meas meas_result = 3;
}
message flex_eutra_cgi_measurements {
// EUTRA Cell Global Identity (CGI).
optional flex_cell_global_eutra_id cgi = 1;
// Tracking area code of the neighbor cell.
optional uint32 tracking_area_code = 2;
// Public land mobile network identifiers of neighbor cell.
repeated flex_plmn_identity plmn_id = 3;
}
message flex_cell_global_eutra_id {
// Public land mobile network identifier of neighbor cell.
optional flex_plmn_identity plmn_id = 1;
// Cell identifier of neighbor cell.
optional uint32 cell_id = 2;
}
message flex_plmn_identity {
// Mobile Network Code (MNC).
repeated uint32 mnc = 1;
// Mobile Country Code (MCC).
repeated uint32 mcc = 2;
// tracking area code
repeated uint32 tac = 3;
}
message flex_eutra_ref_signal_meas {
// Neighboring Cell Reference Signal Received Power (RSRP).
optional int32 rsrp = 1;
// Neighboring Cell Reference Signal Received Quality (RSRQ).
optional int32 rsrq = 2;
}
......@@ -46,6 +46,7 @@ message flex_ue_stats_report {
optional flex_dl_cqi_report dl_cqi_report = 7;
optional flex_paging_buffer_report pbr = 8;
optional flex_ul_cqi_report ul_cqi_report = 9;
optional flex_rrc_measurements rrc_measurements = 10;
}
//
......@@ -76,11 +77,12 @@ enum flex_cell_stats_type {
// Flags for UE-related statistics
enum flex_ue_stats_type {
FLUST_BSR = 1;
FLUST_PRH = 2;
FLUST_PHR = 2;
FLUST_RLC_BS = 4;
FLUST_MAC_CE_BS = 8;
FLUST_DL_CQI = 16;
FLUST_PBS = 32;
FLUST_UL_CQI = 64;
// To be extended with more types of stats
}
\ No newline at end of file
FLUST_RRC_MEASUREMENTS = 65536;
}
......@@ -98,6 +98,8 @@
#define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band"
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define ENB_CONFIG_STRING_RRC_REPORT_CONFIG_AMOUNT "report_amount"
#define ENB_CONFIG_STRING_RRC_REPORT_CONFIG_INTERVAL "report_interval"
#define ENB_CONFIG_STRING_NID_CELL "Nid_cell"
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
......@@ -165,7 +167,7 @@
#define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310"
#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311"
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
#define ENB_CONFIG_STRING_RRC_CONFIG "rrc_config"
#define ENB_CONFIG_STRING_SRB1 "srb1_parameters"
#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit"
#define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering"
......@@ -456,6 +458,10 @@ void enb_config_display(void)
printf( "\tue_TransmissionMode for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TransmissionMode[j]);
printf( "\n\tRRC Report Config: \n");
printf( "\n\t Report interval \t%ld: ", enb_properties.properties[i]->rrc_report_interval);
printf( "\n\t Report amount \t%ld: \n", enb_properties.properties[i]->rrc_report_amount);
}
for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) {
......@@ -545,6 +551,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
config_setting_t *setting_enb = NULL;
config_setting_t *setting_otg = NULL;
config_setting_t *subsetting_otg = NULL;
config_setting_t *setting_rrc = NULL;
int parse_errors = 0;
int num_enb_properties = 0;
int enb_properties_index = 0;
......@@ -651,7 +658,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int srb1_max_retx_threshold = 0;
libconfig_int my_int;
const char* rrc_report_amount = NULL;
const char* rrc_report_interval = NULL;
char* if_name = NULL;
char* ipv4 = NULL;
......@@ -1968,6 +1976,75 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
}
setting_rrc = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRC_CONFIG);
if (setting_rrc != NULL) {
if (!(config_setting_lookup_string(setting_rrc, ENB_CONFIG_STRING_RRC_REPORT_CONFIG_AMOUNT, &rrc_report_amount)
&& config_setting_lookup_string(setting_rrc, ENB_CONFIG_STRING_RRC_REPORT_CONFIG_INTERVAL, &rrc_report_interval)))
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d, rrc_report_amount and rrc_reporyt_interval !\n",
lib_config_file_name_pP, i);
if (strcmp(rrc_report_amount, "r1") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r1;
} else if (strcmp(rrc_report_amount, "r2") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r2;
}else if (strcmp(rrc_report_amount, "r4") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r4;
}else if (strcmp(rrc_report_amount, "r8") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r8;
}else if (strcmp(rrc_report_amount, "r16") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r16;
}else if (strcmp(rrc_report_amount, "r32") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r32;
}else if (strcmp(rrc_report_amount, "r64") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r64;
}else if (strcmp(rrc_report_amount, "infinity") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_infinity;
}else{
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for report_amount choice: r1, r2, r4, r8, r16, r32, r64, infinity !\n",
lib_config_file_name_pP, i,rrc_report_amount);
}
if (strcmp(rrc_report_interval, "120ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms120;
} else if (strcmp(rrc_report_interval, "240ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms240;
}else if (strcmp(rrc_report_interval, "480ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms480;
}else if (strcmp(rrc_report_interval, "640ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms640;
}else if (strcmp(rrc_report_interval, "1024ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms1024;
}else if (strcmp(rrc_report_interval, "2048ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms2048;
}else if (strcmp(rrc_report_interval, "5120ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms5120;
}else if (strcmp(rrc_report_interval, "10240ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms10240;
}else if (strcmp(rrc_report_interval, "1min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min1;
}else if (strcmp(rrc_report_interval, "6min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min6;
}else if (strcmp(rrc_report_interval, "12min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min12;
}else if (strcmp(rrc_report_interval, "30min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min30;
} else if (strcmp(rrc_report_interval, "60min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min60;
} else {
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for report_interval choice: 120ms, 240ms, 480ms, 640ms, 1024ms, 2048ms, 5120ms, 10240ms, 1min, 6min, 12",
lib_config_file_name_pP, i,rrc_report_interval);
}
} else {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms120;
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r1;
}
setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1);
if (setting_srb1 != NULL) {
......
......@@ -214,6 +214,10 @@ typedef struct Enb_properties_s {
long srb1_poll_pdu;
long srb1_poll_byte;
long srb1_max_retx_threshold;
long rrc_report_amount;
long rrc_report_interval;
/* Nb of MME to connect to */
uint8_t nb_mme;
/* List of MME to connect to */
......
......@@ -21,27 +21,16 @@
/*! \file flexran_agent.h
* \brief top level flexran agent receive thread and itti task
* \author Xenofon Foukas and Navid Nikaein
* \date 2016
* \author Xenofon Foukas and Navid Nikaein and shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
#include "flexran_agent_common.h"
#include "log.h"
#include "flexran_agent.h"
#include "flexran_agent_mac_defs.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_extern.h"
#include "assertions.h"
#include "flexran_agent_net_comm.h"
#include "flexran_agent_async.h"
#include <arpa/inet.h>
//#define TEST_TIMER
flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
......@@ -264,8 +253,8 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
*flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC);
*/
/*Initialize the continuous MAC stats update mechanism*/
flexran_agent_init_cont_mac_stats_update(mod_id);
/*Initialize the continuous stats update mechanism*/
flexran_agent_init_cont_stats_update(mod_id);
new_thread(receive_thread, &flexran_agent[mod_id]);
......@@ -275,6 +264,9 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface));
flexran_agent_register_mac_xface(mod_id, mac_agent_xface);
AGENT_RRC_xface *rrc_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface));
flexran_agent_register_rrc_xface(mod_id, rrc_agent_xface);
/*
* initilize a timer
*/
......
......@@ -22,15 +22,23 @@
/*! \file flexran_agent.h
* \brief top level flexran agent
* \author Navid Nikaein and Xenofon Foukas
* \date 2016
* \date 2017
* \version 0.1
*/
#ifndef FLEXRAN_AGENT_H_
#define FLEXRAN_AGENT_H_
#include "enb_config.h" // for enb properties
#include "flexran_agent_common.h"
#include "flexran_agent_async.h"
#include "flexran_agent_extern.h"
#include "flexran_agent_timer.h"
#include "flexran_agent_defs.h"
#include "log.h"
#include "assertions.h"
#include "enb_config.h" // for enb properties
/* Initiation and termination of the eNodeB agent */
......
This diff is collapsed.
This diff is collapsed.
......@@ -21,8 +21,8 @@
/*! \file flexran_agent_defs.h
* \brief FlexRAN agent common definitions
* \author Navid Nikaein and Xenofon Foukas
* \date 2016
* \author Navid Nikaein and Xenofon Foukas and shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
#ifndef FLEXRAN_AGENT_DEFS_H_
......@@ -102,6 +102,38 @@ typedef uint8_t lcid_t;
typedef int32_t err_code_t;
/*---------Timer Enums --------- */
typedef enum {
/* oneshot timer: */
FLEXRAN_AGENT_TIMER_TYPE_ONESHOT = 0,
/* periodic timer */
FLEXRAN_AGENT_TIMER_TYPE_PERIODIC = 1,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_TYPE_EVENT_DRIVEN = 2,
/* Max number of states available */
FLEXRAN_AGENT_TIMER_TYPE_MAX,
} flexran_agent_timer_type_t;
typedef enum {
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_INACTIVE = 0x0,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_ACTIVE = 0x1,
/* Inactive state: initial state for any timer. */
FLEXRAN_AGENT_TIMER_STATE_STOPPED = 0x2,
/* Max number of states available */
FLEXRAN_AGENT_TIMER_STATE_MAX,
} flexran_agent_timer_state_t;
typedef struct {
/* general info */
......@@ -116,6 +148,53 @@ typedef struct {
} flexran_agent_info_t;
/*
rrc triggering
*/
typedef struct {
char * trigger_policy;
uint32_t report_interval;
uint32_t report_amount;
} agent_reconf_rrc;
/* These structs will be used to give
instructions for the type of stats reports
we need to create */
typedef struct {
uint16_t ue_rnti;
uint32_t ue_report_flags; /* Indicates the report elements
required for this UE id. See
FlexRAN specification 1.2.4.2 */
} ue_report_type_t;
typedef struct {
uint16_t cc_id;
uint32_t cc_report_flags; /* Indicates the report elements
required for this CC index. See
FlexRAN specification 1.2.4.3 */
} cc_report_type_t;
typedef struct {
int nr_ue;
ue_report_type_t *ue_report_type;
int nr_cc;
cc_report_type_t *cc_report_type;
} report_config_t;
typedef struct stats_request_config_s{
uint8_t report_type;
uint8_t report_frequency;
uint16_t period; /*In number of subframes*/
report_config_t *config;
} stats_request_config_t;
typedef struct {
mid_t enb_id;
flexran_agent_info_t agent_info;
......
......@@ -20,9 +20,9 @@
*/
/*! \file ENB_APP/extern.h
* \brief FlexRAN agent - mac interface primitives
* \author Xenofon Foukas
* \date 2016
* \brief FlexRAN agent - Extern VSF xfaces
* \author Xenofon Foukas and shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
* \mail x.foukas@sms.ed.ac.uk
*/
......@@ -30,9 +30,9 @@
#ifndef __FLEXRAN_AGENT_EXTERN_H__
#define __FLEXRAN_AGENT_EXTERN_H__
#include "flexran_agent_defs.h"
// #include "flexran_agent_defs.h"
#include "flexran_agent_mac_defs.h"
#include "flexran_agent_rrc_defs.h"
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
......@@ -45,6 +45,12 @@ extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
/* Flag indicating whether the VSFs for the MAC control module have been registered */
extern unsigned int mac_agent_registered[NUM_MAX_ENB];
/* Control module interface for the communication of the RRC Control Module with the agent */
extern AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
/* Flag indicating whether the VSFs for the RRC control module have been registered */
extern unsigned int rrc_agent_registered[NUM_MAX_ENB];
/* Requried to know which UEs had a harq updated over some subframe */
extern int harq_pid_updated[NUMBER_OF_UE_MAX][8];
extern int harq_pid_round[NUMBER_OF_UE_MAX][8];
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file flexran_agent_timer.c
* \brief FlexRAN Timer
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
/*
* timer primitives
*/
#include "flexran_agent_timer.h"
//struct flexran_agent_map agent_map;
flexran_agent_timer_instance_t timer_instance;
int agent_timer_init = 0;
err_code_t flexran_agent_init_timer(void){
LOG_I(FLEXRAN_AGENT, "init RB tree\n");
if (!agent_timer_init) {
RB_INIT(&timer_instance.flexran_agent_head);
agent_timer_init = 1;
}
return PROTOCOL__FLEXRAN_ERR__NO_ERR;
}
RB_GENERATE(flexran_agent_map, flexran_agent_timer_element_s, entry, flexran_agent_compare_timer);
/* The timer_id might not be the best choice for the comparison */
int flexran_agent_compare_timer(struct flexran_agent_timer_element_s *a, struct flexran_agent_timer_element_s *b){
if (a->timer_id < b->timer_id) return -1;
if (a->timer_id > b->timer_id) return 1;
// equal timers
return 0;
}
err_code_t flexran_agent_create_timer(uint32_t interval_sec,
uint32_t interval_usec,
agent_id_t agent_id,
instance_t instance,
uint32_t timer_type,
xid_t xid,
flexran_agent_timer_callback_t cb,
void* timer_args,
long *timer_id){
struct flexran_agent_timer_element_s *e = calloc(1, sizeof(*e));
DevAssert(e != NULL);
//uint32_t timer_id;
int ret=-1;
if ((interval_sec == 0) && (interval_usec == 0 ))
return TIMER_NULL;
if (timer_type >= FLEXRAN_AGENT_TIMER_TYPE_MAX)
return TIMER_TYPE_INVALIDE;
if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_ONESHOT){
ret = timer_setup(interval_sec,
interval_usec,
TASK_FLEXRAN_AGENT,
instance,
TIMER_ONE_SHOT,
timer_args,
timer_id);
e->type = TIMER_ONE_SHOT;
}
else if (timer_type == FLEXRAN_AGENT_TIMER_TYPE_PERIODIC ){
ret = timer_setup(interval_sec,
interval_usec,
TASK_FLEXRAN_AGENT,
instance,
TIMER_PERIODIC,
timer_args,
timer_id);
e->type = TIMER_PERIODIC;
}
if (ret < 0 ) {
return TIMER_SETUP_FAILED;
}
e->agent_id = agent_id;
e->instance = instance;
e->state = FLEXRAN_AGENT_TIMER_STATE_ACTIVE;
e->timer_id = *timer_id;
e->xid = xid;
e->timer_args = timer_args;
e->cb = cb;
/*element should be a real pointer*/
RB_INSERT(flexran_agent_map, &timer_instance.flexran_agent_head, e);
LOG_I(FLEXRAN_AGENT,"Created a new timer with id 0x%lx for agent %d, instance %d \n",
e->timer_id, e->agent_id, e->instance);
return 0;
}
err_code_t flexran_agent_destroy_timer(long timer_id){
struct flexran_agent_timer_element_s *e = get_timer_entry(timer_id);
if (e != NULL ) {
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
}
if (timer_remove(timer_id) < 0 )
goto error;
return 0;
error:
LOG_E(FLEXRAN_AGENT, "timer can't be removed\n");
return TIMER_REMOVED_FAILED ;
}
err_code_t flexran_agent_destroy_timer_by_task_id(xid_t xid) {
struct flexran_agent_timer_element_s *e = NULL;
long timer_id;
RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) {
if (e->xid == xid) {
timer_id = e->timer_id;
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
if (timer_remove(timer_id) < 0 ) {
goto error;
}
}
}
return 0;
error:
LOG_E(FLEXRAN_AGENT, "timer can't be removed\n");
return TIMER_REMOVED_FAILED ;
}
err_code_t flexran_agent_destroy_timers(void){
struct flexran_agent_timer_element_s *e = NULL;
RB_FOREACH(e, flexran_agent_map, &timer_instance.flexran_agent_head) {
RB_REMOVE(flexran_agent_map, &timer_instance.flexran_agent_head, e);
timer_remove(e->timer_id);
flexran_agent_destroy_flexran_message(e->timer_args->msg);
free(e);
}
return 0;
}
void flexran_agent_sleep_until(struct timespec *ts, int delay) {
ts->tv_nsec += delay;
if(ts->tv_nsec >= 1000*1000*1000){
ts->tv_nsec -= 1000*1000*1000;
ts->tv_sec++;
}
clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, ts, NULL);
}
err_code_t flexran_agent_stop_timer(long timer_id){
struct flexran_agent_timer_element_s *e=NULL;
struct flexran_agent_timer_element_s search;
memset(&search, 0, sizeof(struct flexran_agent_timer_element_s));
search.timer_id = timer_id;
e = RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search);
if (e != NULL ) {
e->state = FLEXRAN_AGENT_TIMER_STATE_STOPPED;
}
timer_remove(timer_id);
return 0;
}
struct flexran_agent_timer_element_s * get_timer_entry(long timer_id) {
struct flexran_agent_timer_element_s search;
memset(&search, 0, sizeof(struct flexran_agent_timer_element_s));
search.timer_id = timer_id;
return RB_FIND(flexran_agent_map, &timer_instance.flexran_agent_head, &search);
}
This diff is collapsed.
......@@ -158,8 +158,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//mac_remove_ue(module_idP, i, frameP, subframeP);
//Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
#if defined(FLEXRAN_AGENT_SB_IF)
if (mac_agent_registered[module_idP]) {
agent_mac_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
if (rrc_agent_registered[module_idP]) {
agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
}
......@@ -1082,15 +1082,15 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
allocate_CCEs(module_idP,CC_id,subframeP,0);
#if defined(FLEXRAN_AGENT_SB_IF)
#ifndef DISABLE_CONT_STATS
// #if defined(FLEXRAN_AGENT_SB_IF)
// #ifndef DISABLE_CONT_STATS
//Send subframe trigger to the controller
if (mac_agent_registered[module_idP]) {
agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP);
}
#endif
#endif
// if (mac_agent_registered[module_idP]) {
// agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP);
// }
// #endif
// #endif
flexran_agent_send_update_stats(module_idP);
/*
int dummy=0;
for (i=0;
......
......@@ -180,6 +180,10 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){
}
*/
int UE_BSR (uint8_t mod_id, uint8_t ue_id, uint8_t lcid) {
return eNB_mac_inst[mod_id].UE_list.UE_template[UE_PCCID(mod_id,ue_id)][ue_id].bsr_info[lcid];
}
// get aggregation (L) form phy for a give UE
unsigned char get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt)
......@@ -304,6 +308,12 @@ printf("MAC: cannot add new UE for rnti %x\n", rntiP);
return(-1);
}
int CC_id_rnti_downlink (uint8_t mod_id, int CC_index, uint16_t ue_rnti) {
return eNB_mac_inst[mod_id].UE_list.ordered_CCids[CC_index][ue_rnti];
}
//------------------------------------------------------------------------------
int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
//------------------------------------------------------------------------------
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment