Commit 30b4c553 authored by nguyennd's avatar nguyennd

LGAUTHIER, Duy, OK for e-MBMS, may be one remaining problem with stats

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5121 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 42f7ca06
......@@ -26,10 +26,10 @@ ________________________________________________________________*/
#endif
//#include "rrm_config_structs.h"
//#include "platform_types.h"
/** @defgroup _mac_rrc_primitives_ MAC Layer Primitives for Communications with RRC
/** @defgroup _mac_rrc_primitives_ MAC Layer Primitives for Communications with RRC
* @ingroup _openair_mac_layer_specs_
* @{
This subclause describes the primitives for communications between the RRC and MAC sub-layers.
This subclause describes the primitives for communications between the RRC and MAC sub-layers.
This subclause describes the primitives for communications between the RRC and MAC sub-layers.
......@@ -39,7 +39,7 @@ The primitives responsible for relaying of radio and traffic measurements to the
RRC signaling are :
-# MAC_MEAS_REQ: enables RRC to request a measurement process in the MAC (one-shot, periodic or event-driven). This configures
a measurement process in the MAC.
-# MAC_MEAS_IND: indicates to RRC that a (periodic) measurement request is available.
-# MAC_MEAS_IND: indicates to RRC that a (periodic) measurement request is available.
-# MAC_MEAS_CONFIRM: enables RRC to acknowledge a MAC-MEAS-Ind.
These associate a set of measurements (described by the MAC_MEAS_t structure) to a particular logical channel. Each measurement has
......@@ -48,30 +48,30 @@ instantaneous measurement reports. The latter is typically used to signal events
negotiated QoS values. These consequently trigger reconfiguration of services by the network. The averaging parameters used by the
MAC measurement process is described by the structure MAC_AVG_t. Note that it is the responsibility
of the MAC-layer to relay PHY measurements which are directly available to the scheduling entity in the MAC-layer.
RRC does not directly act on the PHY measurement sub-system.
RRC does not directly act on the PHY measurement sub-system.
The primitives responsible for logical channel MAC configuration by the radio resource manager via RRC signaling are
-# MAC_CONFIG_REQ: enables RRC to configure a new logical channel description at the MAC layer. The associated QoS
descriptor (MAC_LCHAN_DESC contains the parameters defining the logical channel resource scheduling.
descriptor (MAC_LCHAN_DESC contains the parameters defining the logical channel resource scheduling.
-# MAC_CONFIG_CONFIRM: indicates to RRC that a given logical channel has or has not been configured.
The primitives responsible for indicating data synchronization (or loss of) to RRC are
-# MAC_SYNC : indicates to RRC that a physical link for a newly established logical channel has been used (reception) with
success. The parameter passed indicates the logical channel id. This represents the event of successfully decoding a particular logical
channel for the first time. In the event that several logical channels share the same physical resources (e.g. BCCH and CCCH), it
channel for the first time. In the event that several logical channels share the same physical resources (e.g. BCCH and CCCH), it
shall only be sent for the logical channel with the lowest id.
-# MAC_OUT_OF_SYNC : UE primitive indicating to RRC that a physical link for a particular Node-B has been lossed. The parameter
passed indicates the id of the Node-B. This represents the event of detecting an unacceptable error rate on the CHBCH of the Node-B in question.
and can be used in the case of handover between Node-B's. Note that this message is redundant since an equivalent way of obtaining the same
and can be used in the case of handover between Node-B's. Note that this message is redundant since an equivalent way of obtaining the same
result could be based on an event-driven measurement report.
*/
# define NB_SIG_CNX_CH 1
# define NB_CNX_CH MAX_MOBILES_PER_RG
# define NB_CNX_CH MAX_MOBILES_PER_ENB
# define NB_SIG_CNX_UE 2 //MAX_MANAGED_RG_PER_MOBILE
# define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
# define NB_CNX_UE 2//MAX_MANAGED_RG_PER_MOBILE
#define NUMBER_OF_MEASUREMENT_SUBBANDS 16
......@@ -151,7 +151,7 @@ typedef struct {
typedef struct {
//LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
//unsigned short Process_id; /*!< \brief Id of new MAC measurement process*/
char Meas_status; /*!< \brief Status (0-positive, 1-negative)*/
char Meas_status; /*!< \brief Status (0-positive, 1-negative)*/
}__attribute__ ((__packed__)) MAC_MEAS_CONFIRM;
/*!\brief This primitive parametrizes a MAC measurement process
......@@ -221,7 +221,7 @@ typedef struct {
uint8_t Lchan_t; /*!< \brief Logical Channel Type (BCCH,CCCH,DCCH,DTCH_B,DTCH,MRBCH)*/
}__attribute__ ((__packed__)) LCHAN_DESC;
#define LCHAN_DESC_SIZE sizeof(LCHAN_DESC)
#define LCHAN_DESC_SIZE sizeof(LCHAN_DESC)
/*!\brief This primitive indicates to RRC that a particular logical channel has been established and that successful transmission has
been received. The parameter passed is the logical channel id.
......@@ -240,7 +240,7 @@ typedef struct MAC_OUT_OF_SYNC {
/*!\brief This primitive enables RRC to configure a new logical channel description at the MAC layer.
*/
typedef struct{
typedef struct{
LCHAN_ID Lchan_id; /*!< \brief Logical Channel ID*/
// unsigned short UE_eNB_index; //ID of CH who configued the LC (Need this to identify LC in the UE side)
uint8_t Lchan_type; // DCCH_LCHAN, DTCH_LCHAN
......@@ -250,7 +250,7 @@ typedef struct{
//#ifndef CELLULAR
unsigned short UE_eNB_index;
//#endif
}__attribute__ ((__packed__)) MAC_CONFIG_REQ;
}__attribute__ ((__packed__)) MAC_CONFIG_REQ;
#define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ)
......@@ -279,7 +279,7 @@ typedef struct {
uint8_t Forg_fact;
unsigned short Rep_interval;
uint8_t Status;
unsigned int Last_report_frame;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
uint8_t Active;
}__attribute__ ((__packed__)) DEFAULT_UE_MEAS;
......@@ -307,7 +307,7 @@ typedef struct {
uint8_t Forg_fact;
unsigned short Rep_interval;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
unsigned int Next_check_frame;
uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
uint8_t Active;
}__attribute__ ((__packed__)) DEFAULT_CH_MEAS;
......@@ -329,7 +329,7 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
#endif
void (*openair_rrc_top_init)(void);
void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(uint8_t );
char (*openair_rrc_UE_init)(uint8_t, uint8_t);
RRC_status_t (*rrc_rx_tx)(uint8_t,uint32_t,uint8_t,uint8_t);
......@@ -354,7 +354,7 @@ typedef struct{
void (*mac_out_of_sync_ind)(uint8_t,uint32_t,unsigned short);
//RLC_INTERFACE_FUNCTIONS
void (*pdcp_run)(void);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
void (*pdcp_data_req)(module_id_t, rb_id_t, sdu_size_t, char*);
signed int (*rrc_rlc_config_req)(unsigned int, unsigned int, unsigned int, unsigned int, rlc_info_t );
int (*rrc_mac_config_req)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t UE_id,uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
......@@ -362,7 +362,7 @@ typedef struct{
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
uint8_t *SIwindowsize,
uint16_t *SIperiod
......@@ -398,7 +398,7 @@ typedef struct{
#define MEAS_OK 5
#define MEAS_TRIGGER 6
#define RRC_MEAS_REPORT_REQ 7
#define MEAS_REPORT 8
#define MEAS_REPORT 8
#define RAB_MEAS_IND 0
#define DEF_MEAS_IND 1
......
......@@ -33,9 +33,9 @@
#else
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
/* SR: When using ethernet network driver the packet size is 1512 :
* 1500 bytes IP packet + 12 bytes ethernet header
* 1500 bytes IP packet + 14 bytes ethernet header
*/
# define MAX_IP_PACKET_SIZE 1512
# define MAX_IP_PACKET_SIZE 1514
# else
# define MAX_IP_PACKET_SIZE 1500 // 3000
# endif
......@@ -45,17 +45,24 @@
# define MAX_MODULES NB_MODULES_MAX
#ifdef LARGE_SCALE
# define MAX_MOBILES_PER_RG 128
# define MAX_RG 2
# define MAX_MOBILES_PER_ENB 128
//# define MAX_RG 2
#else
# define MAX_MOBILES_PER_RG 16
# define MAX_RG 2
# define MAX_MOBILES_PER_ENB 16
//# define MAX_RG 2
#endif
#define MAX_MANAGED_RG_PER_MOBILE 2
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define DEFAULT_RAB_ID 3
#define NB_RB_MAX (maxDRB + 3) /* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#if defined(Rel10)
#define NB_RB_MBMS_MAX (maxSessionPerPMCH*maxServiceCount)
#else
// Do not allocate unused memory
#define NB_RB_MBMS_MAX 1
#endif
#define NB_RAB_MAX maxDRB /* was 8, now 11 */
#define RAB_SHIFT1 9
#define RAB_SHIFT2 3
......
......@@ -382,7 +382,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, unsigned char gr
}
return(nb_ue_in_pusch);
}
#endif
#endif
int8_t add_new_ue(module_id_t enb_mod_idP, rnti_t rntiP) {
module_id_t ue_mod_id;
int j;
......@@ -530,7 +530,7 @@ void rx_sdu(module_id_t enb_mod_idP,frame_t frameP,rnti_t rntiP,uint8_t *sdu, ui
module_id_t ue_mod_id = find_UE_id(enb_mod_idP,rntiP);
int ii,j;
start_meas(&eNB_mac_inst[enb_mod_idP].rx_ulsch_sdu);
for(ii=0; ii<NB_RB_MAX; ii++) rx_lengths[ii] = 0;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_SDU,1);
......@@ -989,7 +989,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
void schedule_SI(module_id_t module_idP,frame_t frameP, unsigned char *nprb,unsigned int *nCCE) {
start_meas(&eNB_mac_inst[module_idP].schedule_si);
unsigned char bcch_sdu_length;
int mcs = -1;
void *BCCH_alloc_pdu=(void*)&eNB_mac_inst[module_idP].BCCH_alloc_pdu;
......@@ -1451,6 +1451,19 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
else { // only MTCH in this subframeP
TBS = mac_xface->get_TBS(eNB_mac_inst[module_idP].pmch_Config[0]->dataMCS_r9, mac_xface->lte_frame_parms->N_RB_DL);
}
// get MTCH data from RLC (like for DTCH)
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: Schedule MTCH (area %d, sfAlloc %d)\n",Mod_id,frame,subframe,i,j);
header_len_mtch = 3;
LOG_D(MAC,"[eNB %d], Frame %d, MTCH->MCH, Checking RLC status (rab %d, tbs %d, len %d)\n",
Mod_id,frame,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(Mod_id,frame,1,RLC_MBMS_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
printf("frame %d, subframe %d, rlc_status.bytes_in_buffer is %d\n",frame,subframe, rlc_status.bytes_in_buffer);
*/
// get MTCH data from RLC (like for DTCH)
......@@ -1461,16 +1474,22 @@ int schedule_MBMS(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
module_idP,frameP,MTCH,TBS,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH+ (maxDRB + 3) * MAX_MOBILES_PER_RG,
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
//printf("frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",frameP,subframeP, rlc_status.bytes_in_buffer);
LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer >0) {
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE], Frame %d, MTCH->MCH, Requesting %d bytes from RLC (header len mtch %d)\n",
module_idP,frameP,TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch,header_len_mtch);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, 0, frameP, ENB_FLAG_YES, MBMS_FLAG_YES,
MTCH + (maxDRB + 3) * MAX_MOBILES_PER_RG,
sdu_lengths[num_sdus] = mac_rlc_data_req(
module_idP,
0,
frameP,
ENB_FLAG_YES,
MBMS_FLAG_YES,
MTCH,
(char*)&mch_buffer[sdu_length_total]);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] Got %d bytes for MTCH %d\n",module_idP,sdu_lengths[num_sdus],MTCH);
......@@ -2024,7 +2043,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
#ifdef CBA
if ((eNB_mac_inst[module_idP].num_active_cba_groups > 0) && (*nCCE == 0))
schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, granted_UEs, nCCE, &nCCE_available, &first_rb);
#endif
#endif
stop_meas(&eNB_mac_inst[module_idP].schedule_ulsch);
}
......@@ -2224,7 +2243,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
#else
if (round==0)
#endif
#endif
{
LOG_D(MAC,"[eNB %d][PUSCH %x] Frame %d subframeP %d Scheduling UE %d (SR %d)\n",
module_idP,rnti,frameP,subframeP,ue_mod_id,
......@@ -2238,7 +2257,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
status = mac_get_rrc_status(module_idP,1,next_ue);
#ifndef EXMIMO_IOT
#ifndef EXMIMO_IOT
if (status < RRC_CONNECTED)
cqi_req = 0;
else
......@@ -2669,7 +2688,7 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc) {
void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,uint32_t RBalloc,uint8_t RA_scheduled,int mbsfn_flag) {
// loop over all allocated UEs and compute frequency allocations for PDSCH
module_id_t ue_mod_id = -1;
uint8_t first_rb,nb_rb=3;
......@@ -2689,9 +2708,9 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
if (mbsfn_flag>0)
return;
start_meas(&eNB_mac_inst[module_idP].fill_DLSCH_dci);
// clear vrb_map
memset(vrb_map,0,100);
......@@ -3454,10 +3473,10 @@ void schedule_ue_spec(module_id_t module_idP,
int mcs;
uint16_t min_rb_unit;
short ta_update = 0;
if (mbsfn_flag>0)
return;
reset_meas(&eNB_mac_inst[module_idP].schedule_dlsch);
switch (mac_xface->lte_frame_parms->N_RB_DL) {
......@@ -3519,7 +3538,7 @@ void schedule_ue_spec(module_id_t module_idP,
/// CALLING Pre_Processor for downlink scheduling (Returns estimation of RBs required by each UE and the allocation on sub-band)
start_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
start_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
dlsch_scheduler_pre_processor(module_idP,
frameP,
subframeP,
......@@ -3527,7 +3546,7 @@ void schedule_ue_spec(module_id_t module_idP,
pre_nb_available_rbs,
mac_xface->lte_frame_parms->N_RBGS,
rballoc_sub_UE);
stop_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
stop_meas(&eNB_mac_inst[module_idP].schedule_dlsch_preprocessor);
for (ue_mod_id=0;ue_mod_id<granted_UEs;ue_mod_id++) {
......@@ -3615,9 +3634,9 @@ void schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]];
LOG_T(MAC,"CQI %d\n",eNB_UE_stats->DL_cqi[0]);
}
else
else
eNB_UE_stats->dlsch_mcs1 = openair_daq_vars.target_ue_dl_mcs;
if(eNB_UE_stats->dlsch_mcs1>22)
eNB_UE_stats->dlsch_mcs1=22;
......@@ -4306,7 +4325,7 @@ void schedule_ue_spec(module_id_t module_idP,
}
void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP) {//, int calibration_flag) {
start_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
unsigned char nprb=0;
unsigned int nCCE=0;
......@@ -4391,7 +4410,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
eNB_mac_inst[module_idP].subframe = subframeP;
//if (subframeP%5 == 0)
#ifdef EXMIMO
#ifdef EXMIMO
pdcp_run(frameP, 1, 0, module_idP);
/*
ret = pthread_mutex_trylock (&pdcp_mutex);
......@@ -4709,5 +4728,5 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,0);
stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
}
This diff is collapsed.
This diff is collapsed.
......@@ -372,7 +372,7 @@ int pdcp_fifo_read_input_sdus_remaining_bytes (frame_t frameP, eNB_flag_t enb_fl
RLC_SDU_CONFIRM_NO,
pdcp_input_header.data_size,
pdcp_input_sdu_buffer,
PDCP_TRANSMISSION_MODE_DATA); //PDCP_TRANSMISSION_MODE_TRANSPARENT);
PDCP_TRANSMISSION_MODE_TRANSPARENT);
AssertFatal (result == TRUE, "PDCP data request failed!\n");
}
......@@ -504,7 +504,7 @@ int pdcp_fifo_read_input_sdus (frame_t frameP, eNB_flag_t enb_flagP, module_id_t
(data->pdcp_read_header.traffic_type == TRAFFIC_IPV4_TYPE_MULTICAST) /*TRAFFIC_IPV4_TYPE_MULTICAST */ ||
(data->pdcp_read_header.traffic_type == TRAFFIC_IPV4_TYPE_BROADCAST) /*TRAFFIC_IPV4_TYPE_BROADCAST */ ) {
#if defined (Rel10)
pdcp_mode = PDCP_TRANSMISSION_MODE_DATA; //PDCP_TRANSMISSION_MODE_TRANSPARENT;
PDCP_TRANSMISSION_MODE_TRANSPARENT;
#else
pdcp_mode= PDCP_TRANSMISSION_MODE_DATA;
#endif
......@@ -515,9 +515,9 @@ int pdcp_fifo_read_input_sdus (frame_t frameP, eNB_flag_t enb_flagP, module_id_t
pdcp_mode= PDCP_TRANSMISSION_MODE_DATA;
LOG_W(PDCP,"unknown IP traffic type \n");
}
#else // NASMESH driver does not curreenlty support multicast traffic
#else // NASMESH driver does not curreenlty support multicast traffic
pdcp_mode = PDCP_TRANSMISSION_MODE_DATA;
#endif
#endif
pdcp_data_req(enb_mod_idP,
ue_mod_idP,
frameP,
......@@ -829,6 +829,10 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
pkt_size = (otg_pkt_info->otg_pkt).sdu_buffer_size;
if (otg_pkt != NULL) {
if (is_ue == 0 ) {
rlc_util_print_hex_octets(PDCP,
(unsigned char*)otg_pkt,
pkt_size);
//rb_id = (/*NB_eNB_INST +*/ dst_id -1 ) * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d for pdcp mode %d\n",
enb_mod_idP, frameP, pkt_cnt++, module_id, rb_id, module_id, dst_id, pkt_size, pdcp_mode);
......@@ -837,6 +841,8 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
}
else {
//rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] sending packet from module %d on rab id %d (src %d, dst %d) pkt size %d\n",
ue_mod_idP, src_id, rb_id, src_id, dst_id, pkt_size);
result = pdcp_data_req( enb_mod_idP,
......
......@@ -406,7 +406,7 @@ rlc_um_mac_status_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP
uint16_t sdu_remaining_size = 0;
int32_t diff_time=0;
rlc_um_entity_t *rlc_p = NULL;
status_resp.buffer_occupancy_in_pdus = 0;
status_resp.buffer_occupancy_in_bytes = 0;
status_resp.head_sdu_remaining_size_to_send = 0;
......@@ -422,25 +422,25 @@ rlc_um_mac_status_indication (void *rlc_pP, frame_t frameP, eNB_flag_t eNB_flagP
status_resp.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (rlc_p);
if (status_resp.buffer_occupancy_in_bytes > 0) {
status_resp.buffer_occupancy_in_bytes += rlc_p->tx_header_min_length_in_bytes;
status_resp.buffer_occupancy_in_pdus = rlc_p->nb_sdu;
diff_time = frameP - ((struct rlc_um_tx_sdu_management *) (rlc_p->input_sdus[rlc_p->current_sdu_index])->data)->sdu_creation_time;
status_resp.head_sdu_creation_time = (diff_time > 0 ) ? (uint32_t) diff_time : (uint32_t)(0xffffffff - diff_time + frameP) ;
//msg("rlc_p status for frameP %d diff time %d resp %d\n", frameP, diff_time,status_resp.head_sdu_creation_time) ;
sdu_size = ((struct rlc_um_tx_sdu_management *) (rlc_p->input_sdus[rlc_p->current_sdu_index])->data)->sdu_size;
sdu_remaining_size = ((struct rlc_um_tx_sdu_management *) (rlc_p->input_sdus[rlc_p->current_sdu_index])->data)->sdu_remaining_size;
status_resp.head_sdu_remaining_size_to_send = sdu_remaining_size;
status_resp.head_sdu_remaining_size_to_send = sdu_remaining_size;
if (sdu_size == sdu_remaining_size) {
status_resp.head_sdu_is_segmented = 0;
}
else {
status_resp.head_sdu_is_segmented = 1;
}
} else {
}
//msg("[FRAME %05d][%s][RLC_UM][MOD %02u/%02u][RB %02d] MAC_STATUS_INDICATION BO = %d\n", ((rlc_um_entity_t *) rlc_pP)->module_id, ((rlc_um_entity_t *) rlc_pP)->rb_id, status_resp.buffer_occupancy_in_bytes);
......@@ -627,6 +627,10 @@ rlc_um_data_req (void *rlc_pP, frame_t frameP, mem_block_t *sdu_pP)
rlc_p->nb_sdu,
rlc_p->current_sdu_index,
rlc_p->next_sdu_index);
rlc_util_print_hex_octets(
RLC,
(uint8_t*)&sdu_pP->data[sizeof (struct rlc_um_data_req_alloc)],
((struct rlc_um_data_req *) (sdu_pP->data))->data_size);
/*#ifndef USER_MODE
rlc_um_time_us = (unsigned long int)(rt_get_time_ns ()/(RTIME)1000);
......
......@@ -100,12 +100,24 @@ void config_req_rlc_um_asn1 (frame_t frameP,
uint32_t dl_sn_FieldLength = 0;
uint32_t t_Reordering;
rlc_um_entity_t *rlc_p = NULL;
#if defined(rel10)
#if defined(Rel10)
if (mbms_flagP) {
if (eNB_flagP) {
rlc_p = &rlc_mbms_array_eNB[enb_module_idP][mbms_service_idP][mbms_session_idP].um;
LOG_D(RLC,"eNB config_req_rlc_um_asn1 rlc_um_p : %p RB %u service %u session %u",
rlc_p,
rb_idP,
mbms_service_idP,
mbms_session_idP
);
} else {
rlc_p = &rlc_mbms_array_ue[ue_module_idP][mbms_service_idP][mbms_session_idP].um;
LOG_D(RLC,"UE config_req_rlc_um_asn1 rlc_um_p : %p RB %u service %u session %u",
rlc_p,
rb_idP,
mbms_service_idP,
mbms_session_idP
);
}
}
else
......@@ -122,12 +134,12 @@ void config_req_rlc_um_asn1 (frame_t frameP,
LOG_D(RLC, "[FRAME %05d][%s][RRC][MOD %u/%u][][--- CONFIG_REQ timer_reordering=%dms sn_field_length= --->][RLC_UM][MOD %u/%u][RB %u] \n",
frameP,
(eNB_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
(dl_rlc_pP->t_Reordering<31)?t_Reordering_tab[dl_rlc_pP->t_Reordering]:-1,
enb_module_idP,
ue_module_idP,
rb_idP);
enb_module_idP,
ue_module_idP,
(dl_rlc_pP->t_Reordering<31)?t_Reordering_tab[dl_rlc_pP->t_Reordering]:-1,
enb_module_idP,
ue_module_idP,
rb_idP);
rlc_um_init(rlc_p);
if (rlc_um_fsm_notify_event (rlc_p, RLC_UM_RECEIVE_CRLC_CONFIG_REQ_ENTER_DATA_TRANSFER_READY_STATE_EVENT)) {
......@@ -150,7 +162,7 @@ void config_req_rlc_um_asn1 (frame_t frameP,
ul_rlc_pP->sn_FieldLength);
return;
}
}
}
if (dl_rlc_pP != NULL) {
switch (dl_rlc_pP->sn_FieldLength) {
......@@ -198,6 +210,9 @@ void config_req_rlc_um_asn1 (frame_t frameP,
ul_sn_FieldLength,
mbms_flagP);
}
if (mbms_flagP == MBMS_FLAG_YES) {
rlc_p->allocation = TRUE;
}
}
}
//-----------------------------------------------------------------------------
......@@ -379,17 +394,16 @@ void rlc_um_set_debug_infos(rlc_um_entity_t *rlc_pP,
{
LOG_D(RLC, "[FRAME %05d][%s][RLC_UM][SET DEBUG INFOS] enb_module_id %u ue_module_id %u rb_id %d rb_type %d\n",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
eNB_flagP,
enb_module_idP,
ue_module_idP,
rb_idP,
rb_typeP);
(eNB_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
rb_idP,
rb_typeP);
rlc_pP->enb_module_id = enb_module_idP;
rlc_pP->ue_module_id = ue_module_idP;
rlc_pP->rb_id = rb_idP;
if (rb_typeP != SIGNALLING_RADIO_BEARER) {
rlc_pP->rb_id = rb_idP;
if (rb_typeP == RADIO_ACCESS_BEARER) {
rlc_pP->is_data_plane = 1;
} else {
rlc_pP->is_data_plane = 0;
......
......@@ -89,7 +89,12 @@ rlc_um_segment_10 (rlc_um_entity_t *rlc_pP,frame_t frameP)
return;
}
#if defined(TRACE_RLC_UM_SEGMENT)
LOG_D(RLC, "[FRAME %05u][%s][RLC_UM][MOD %u/%u][RB %u] SEGMENT10\n", rlc_pP->module_id, rlc_pP->rb_id, frameP);
LOG_D(RLC, "[FRAME %05u][%s][RLC_UM][MOD %u/%u][RB %u] SEGMENT10\n",
frameP,
(rlc_pP->is_enb) ? "eNB" : "UE",
rlc_pP->enb_module_id,
rlc_pP->ue_module_id,
rlc_pP->rb_id);
#endif
list_init (&pdus, NULL); // param string identifying the list is NULL
pdu_mem_p = NULL;
......@@ -766,8 +771,8 @@ rlc_um_segment_5 (rlc_um_entity_t *rlc_pP,frame_t frameP)
rlc_pP->ue_module_id,
rlc_pP->rb_id,
pdu_remaining_size);
memcpy(data, data_sdu_p, pdu_remaining_size);
#endif
memcpy(data, data_sdu_p, pdu_remaining_size);
// free SDU
rlc_pP->buffer_occupancy -= sdu_mngt_p->sdu_remaining_size;
free_mem_block (rlc_pP->input_sdus[rlc_pP->current_sdu_index]);
......
This diff is collapsed.
......@@ -102,6 +102,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
# define public_rlc(x) extern x
# endif
//-----------------------------------------------------------------------------
#define RLC_OP_STATUS_OK 1
#define RLC_OP_STATUS_BAD_PARAMETER 22
......@@ -111,6 +112,7 @@ Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis
#define RLC_MUI_UNDEFINED (mui_t)0
#define RLC_RB_UNALLOCATED (rb_id_t)0
#define RLC_LC_UNALLOCATED (logical_chan_id_t)0
//-----------------------------------------------------------------------------
// PUBLIC RLC CONSTANTS
......@@ -216,8 +218,26 @@ public_rlc(rlc_mbms_t rlc_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxService
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_ue[NUMBER_OF_UE_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rlc_mbms_id_t rlc_mbms_lcid2service_session_id_eNB[NUMBER_OF_eNB_MAX][RLC_MAX_MBMS_LC];) // some constants from openair2/RRC/LITE/MESSAGES/asn1_constants.h
public_rlc(rb_id_t lcid2rbid_ue[NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(rb_id_t lcid2rbid_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
#define rlc_mbms_enb_get_lcid_by_rb_id(Enb_mOD,rB_iD) rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD - (NB_RB_MAX*MAX_MOBILES_PER_ENB)]
#define rlc_mbms_enb_set_lcid_by_rb_id(Enb_mOD,rB_iD,lOG_cH_iD) do { \
AssertFatal(rB_iD>=(NB_RB_MAX*MAX_MOBILES_PER_ENB), "INVALID RB ID %u", rB_iD); \
rlc_mbms_rbid2lcid_eNB[Enb_mOD][rB_iD - (NB_RB_MAX*MAX_MOBILES_PER_ENB)] = lOG_cH_iD; \
} while (0);
#define rlc_mbms_ue_get_lcid_by_rb_id(uE_mOD,rB_iD) rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX]
#define rlc_mbms_ue_set_lcid_by_rb_id(uE_mOD,rB_iD,lOG_cH_iD) do { \
AssertFatal(rB_iD>=NB_RB_MAX, "INVALID RB ID %u", rB_iD); \
rlc_mbms_rbid2lcid_ue[uE_mOD][rB_iD - NB_RB_MAX] = lOG_cH_iD; \
} while (0);
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_ue [NUMBER_OF_UE_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(logical_chan_id_t rlc_mbms_rbid2lcid_eNB[NUMBER_OF_eNB_MAX][NB_RB_MBMS_MAX];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(rb_id_t lcid2rbid_ue [NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
public_rlc(rb_id_t lcid2rbid_eNB[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][RLC_MAX_LC];) /*!< \brief Pairing logical channel identifier with radio bearer identifer. */
/*! \var rlc_t rlc_array_ue[NUMBER_OF_UE_MAX][NB_RB_MAX]
\brief Global var for RLC layer, allocate memory for RLC UE protocol instances.
*/
......
......@@ -139,8 +139,9 @@ tbs_size_t mac_rlc_data_req(
if (enb_flagP) {
if (MBMS_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][channel_idP];
rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rlc_mode = RLC_MODE_UM;
AssertFatal (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"enB MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
} else {
......@@ -295,10 +296,12 @@ void mac_rlc_data_ind (
} else {
if (MBMS_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][channel_idP];
rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rlc_mode = RLC_MODE_UM;
AssertFatal (rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"UE MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
"UE MBMS RLC UM not configured rb id %u lcid %u service_id %u session_id %u module %u!\n",
rb_id, channel_idP,mbms_id_p->service_id, mbms_id_p->session_id, ue_mod_idP);
} else {
rb_id = lcid2rbid_ue[ue_mod_idP][channel_idP];
AssertFatal (rb_id < NB_RB_MAX, "UE RB id is too high (%u/%d) lcid %u enb module %u ue module id %u!\n", rb_id, NB_RB_MAX, channel_idP, enb_mod_idP, ue_mod_idP);
......@@ -417,10 +420,14 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
if (enb_flagP) {
if (MBMS_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][channel_idP];
rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
AssertFatal (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"enB MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
rb_id = rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rlc_mode = RLC_MODE_UM;
if (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == FALSE) {
return mac_rlc_status_resp;
}
//AssertFatal (rlc_mbms_array_eNB[enb_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
// "enB MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, enb_mod_idP);
} else {
rb_id = lcid2rbid_eNB[enb_mod_idP][ue_mod_idP][channel_idP];
if (rb_id >= NB_RB_MAX) {
......@@ -454,8 +461,9 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
} else {
if (MBMS_flagP) {
mbms_id_p = &rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][channel_idP];
rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rb_id = rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].rb_id;
rlc_p = (void*)&rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um;
rlc_mode = RLC_MODE_UM;
AssertFatal (rlc_mbms_array_ue[ue_mod_idP][mbms_id_p->service_id][mbms_id_p->session_id].um.allocation == TRUE ,
"UE MBMS RLC UM not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_mod_idP);
} else {
......
......@@ -56,7 +56,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
mbms_service_id_t mch_id, mbms_service_id;
DL_UM_RLC_t dl_um_rlc;
#endif
LOG_D(RLC, "[FRAME %5u][%s][RLC_RRC][MOD %u/%u] CONFIG REQ ASN1 \n",
frameP,
(enb_flagP) ? "eNB" : "UE",
......@@ -112,12 +112,12 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
if (rlc_mode == RLC_MODE_NONE) {
if (rrc_rlc_add_rlc (enb_mod_idP, ue_mod_idP, frameP, enb_flagP, rb_id, rb_id, RLC_MODE_AM) == RLC_OP_STATUS_OK) {
config_req_rlc_am_asn1 (
frameP,
frameP,
enb_flagP,
enb_mod_idP,
ue_mod_idP,
&srb_toaddmod_p->rlc_Config->choice.explicitValue.choice.am,
rb_id,
rb_id,
SIGNALLING_RADIO_BEARER);
} else {
LOG_E(RLC, "[FRAME %5u][%s][RLC_RRC][MOD %u/%u] ERROR IN ALLOCATING SRB %d \n",
......@@ -281,7 +281,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
rlc_mode = rlc_array_ue[ue_mod_idP][drb_id].mode;
}
LOG_D(RLC, "Adding DRB %d, rb_id %d\n",*drb_toaddmod_p->logicalChannelIdentity,drb_id);
if (drb_toaddmod_p->rlc_Config) {
......@@ -414,14 +414,30 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
// can set the mch_id = i
if (enb_flagP) {
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id; // 1
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].session_id = mbms_session_id;
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id + (maxDRB + 3) * MAX_MOBILES_PER_ENB; // 1
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_eNB[enb_mod_idP][lc_id].session_id = mbms_session_id;
rlc_mbms_array_eNB[enb_mod_idP][mbms_service_id][mbms_session_id].rb_id = rb_id;
rlc_mbms_array_eNB[enb_mod_idP][mbms_service_id][mbms_session_id].instanciated_instance = TRUE;
rlc_mbms_enb_set_lcid_by_rb_id(enb_mod_idP,rb_id,lc_id);
} else {
rb_id = (mbms_service_id * maxSessionPerPMCH ) + mbms_session_id + (maxDRB + 3); // 15
rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_eNB[ue_mod_idP][lc_id].session_id = mbms_session_id;
rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lc_id].service_id = mbms_service_id;
rlc_mbms_lcid2service_session_id_ue[ue_mod_idP][lc_id].session_id = mbms_session_id;
rlc_mbms_array_ue[ue_mod_idP][mbms_service_id][mbms_session_id].rb_id = rb_id;
rlc_mbms_array_ue[ue_mod_idP][mbms_service_id][mbms_session_id].instanciated_instance = TRUE;
rlc_mbms_ue_set_lcid_by_rb_id(ue_mod_idP,rb_id,lc_id);
}
LOG_D(RLC, "[FRAME %5u][%s][RLC_RRC][MOD %u/%u] CONFIG REQ MBMS ASN1 LC ID %u RB ID %u SESSION ID %u SERVICE ID %u\n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
lc_id,
rb_id,
mbms_session_id,
mbms_service_id
);
dl_um_rlc.sn_FieldLength = SN_FieldLength_size5;
dl_um_rlc.t_Reordering = T_Reordering_ms0;
......@@ -441,7 +457,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (module_id_t enb_mod_idP,
}
}
#endif
LOG_D(RLC, "[FRAME %5u][%s][RLC_RRC][MOD %u/%u] CONFIG REQ ASN1 END \n",
frameP,
(enb_flagP) ? "eNB" : "UE",
......@@ -621,7 +637,7 @@ rlc_op_status_t rrc_rlc_add_rlc (module_id_t enb_mod_idP, module_id_t ue_mod_i
//-----------------------------------------------------------------------------
rlc_mode_t rlc_mode = RLC_MODE_NONE;
unsigned int allocation;
#ifdef OAI_EMU
if (enb_flagP) {
AssertFatal ((enb_mod_idP >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0),
......
......@@ -2034,7 +2034,7 @@ uint8_t do_MBSFNAreaConfig(uint8_t Mod_id,
memset((void*)pmch_Info_1,0,sizeof(PMCH_Info_r9_t));
pmch_Info_1->pmch_Config_r9.sf_AllocEnd_r9= 3;//take the value of last mbsfn subframe in this CSA period because there is only one PMCH in this mbsfn area
pmch_Info_1->pmch_Config_r9.dataMCS_r9= 17;
pmch_Info_1->pmch_Config_r9.dataMCS_r9= 7;
pmch_Info_1->pmch_Config_r9.mch_SchedulingPeriod_r9= PMCH_Config_r9__mch_SchedulingPeriod_r9_rf16;
// MBMSs-SessionInfoList-r9
......
......@@ -43,7 +43,7 @@ public_mem_block(void check_mem_area (void);)
private_mem_block(void check_free_mem_block (mem_block_t * leP);)
# endif
#ifdef USER_MODE
# define MEM_SCALE /*MAX_RG */ MAX_MOBILES_PER_RG
# define MEM_SCALE /*MAX_RG */ MAX_MOBILES_PER_ENB
#else
# ifdef NODE_RG
# define MEM_SCALE 2
......
This diff is collapsed.
......@@ -6,10 +6,14 @@ declare -x EMULATION_DEV_INTERFACE="eth0"
declare -x IP_DRIVER_NAME="oai_nw_drv"
declare -x LTEIF="oai0"
declare -x ENB_IPv4="10.0.1.1"
declare -x UE_IPv4="10.0.1.11"
declare -x ENB_IPv6="9998::1"
declare -x UE_IPv6="9998::11"
declare -x ENB_IPv6_CIDR=$ENB_IPv6"/64"
declare -x ENB_IPv4_CIDR=$ENB_IPv4"/24"
declare -a NAS_IMEI=( 3 9 1 8 3 6 6 2 0 0 0 0 0 0 )
declare -x DEFAULT_RB_ID=3
declare -x MBMS_RB_ID=225
#------------------------------------------------
LOG_FILE="/tmp/oai_sim_enb.log"
......@@ -72,33 +76,35 @@ fgrep lte /etc/iproute2/rt_tables > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "200 lte " >> /etc/iproute2/rt_tables
fi
ip rule add fwmark 3 table lte
ip route add default dev $LTEIF table lte
ip rule add fwmark $DEFAULT_RB_ID table lte
ip rule add fwmark $MBMS_RB_ID table lte
ip route add default dev $LTEIF table lte
ip route add 239.0.0.160/28 dev $EMULATION_DEV_INTERFACE
/sbin/ebtables -t nat -A POSTROUTING -p arp -j mark --mark-set 3
/sbin/ebtables -t nat -A POSTROUTING -p arp -j mark --mark-set $DEFAULT_RB_ID
/sbin/ip6tables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark 3
/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type broadcast -j MARK --set-mark 3
/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark 3
#/sbin/ip6tables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type broadcast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark $DEFAULT_RB_ID
/sbin/ip6tables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark 3
/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type broadcast -j MARK --set-mark 3
/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark 3
#/sbin/ip6tables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type broadcast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type multicast -j MARK --set-mark $DEFAULT_RB_ID
#All other traffic is sent on the RAB you want (mark = RAB ID)
/sbin/ip6tables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark 3
/sbin/ip6tables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark 3
/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark 3
/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark 3
/sbin/ip6tables -A POSTROUTING -t mangle -o oai0 -j MARK --set-mark $MBMS_RB_ID
#/sbin/ip6tables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/ip6tables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A POSTROUTING -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark $DEFAULT_RB_ID
#/sbin/iptables -A OUTPUT -t mangle -o oai0 -m pkttype --pkt-type unicast -j MARK --set-mark $DEFAULT_RB_ID
NOW=$(date +"%Y-%m-%d.%Hh_%Mm_%Ss")
rotate_log_file $LOG_FILE
#xterm -hold -e gdb --args
#$OPENAIR_TARGETS/SIMU/USER/oaisim -a -Q3 -s15 -K $LOG_FILE -l9 -u0 -b1 -M0 -p2 -g1 -D $EMULATION_DEV_INTERFACE -O $THIS_SCRIPT_PATH/enb.conf &
#$OPENAIR_TARGETS/SIMU/USER/oaisim -a -l3 -u0 -b1 -M0 -p2 -g1 -D $EMULATION_DEV_INTERFACE -O $THIS_SCRIPT_PATH/enb.conf &
$OPENAIR_TARGETS/SIMU/USER/oaisim -a -l3 -u0 -b1 -M0 -p2 -g1 -D 192.168.55.51 -O $THIS_SCRIPT_PATH/enb.conf &
$OPENAIR_TARGETS/SIMU/USER/oaisim -a -Q3 -l7 -u0 -b1 -M0 -p2 -g1 -D 192.168.55.51 -O $THIS_SCRIPT_PATH/enb.conf | grep "PDCP\|RLC\|RRC" &
wait_process_started oaisim
......
......@@ -460,26 +460,26 @@ int olg_config() {
oai_emulation.info.g_log_verbosity,
oai_emulation.emulation_config.log_emu.interval );
/*
// if perf eval then reset the otg log level
set_comp_log(PHY, LOG_EMERG, 0x15,1);
set_comp_log(EMU, LOG_EMERG, 0x15,1);
set_comp_log(OCG, LOG_EMERG, 0x15,1);
set_comp_log(OCM, LOG_EMERG, 0x15,1);
set_comp_log(OTG, LOG_EMERG, 0x15,1);
set_comp_log(MAC, LOG_DEBUG, 0x15,1);
set_comp_log(MAC, LOG_EMERG, 0x15,1);
set_comp_log(OMG, LOG_EMERG, 0x15,1);
set_comp_log(OPT, LOG_EMERG, 0x15,1);
set_comp_log(PDCP, LOG_TRACE, LOG_MED,1);
set_comp_log(RLC, LOG_TRACE, LOG_MED,1);
set_comp_log(RRC, LOG_TRACE, LOG_MED,1);
set_comp_log(PDCP, LOG_DEBUG, LOG_MED,1);
set_comp_log(RLC, LOG_DEBUG, LOG_MED,1);
set_comp_log(RRC, LOG_DEBUG, LOG_MED,1);
#if defined(ENABLE_RAL)
set_comp_log(RAL_ENB, LOG_TRACE, LOG_MED,1);
set_comp_log(RAL_UE, LOG_TRACE, LOG_MED,1);
set_log(RAL_ENB, LOG_DEBUG, 1);
set_log(RAL_UE, LOG_DEBUG, 1);
#endif
/*
//set_log(OCG, LOG_DEBUG, 1);
//set_log(EMU, LOG_INFO, 20);
set_log(MAC, LOG_DEBUG, 1);
......
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