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
......@@ -68,7 +68,7 @@ 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
......
......@@ -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
......
......@@ -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);
......
......@@ -525,7 +525,7 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
frameP,
ENB_FLAG_NO,
MBMS_FLAG_YES,
MTCH + (maxDRB + 3),
MTCH, /*+ (maxDRB + 3),*/
(char *)payload_ptr,
rx_lengths[i],
1,
......@@ -533,7 +533,12 @@ void ue_send_mch_sdu(module_id_t module_idP, frame_t frameP, uint8_t *sdu, uint1
}
} else {
LOG_W(MAC,"[UE %d] Frame %d : unknown sdu %d mcch status %d eNB %d \n",module_idP,frameP,rx_lengths[i],
LOG_W(MAC,"[UE %d] Frame %d : unknown sdu %d rx_lcids[%d]=%d mcch status %d eNB %d \n",
module_idP,
frameP,
rx_lengths[i],
i,
rx_lcids[i],
UE_mac_inst[module_idP].mcch_status, eNB_index);
}
......
......@@ -76,8 +76,17 @@ extern int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned in
* this mem_block_t to be dissected for testing purposes. For further details see test
* code at targets/TEST/PDCP/test_pdcp.c:test_pdcp_data_req()
*/
boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t enb_flagP, rb_id_t rb_idP, mui_t muiP, confirm_t confirmP,
sdu_size_t sdu_buffer_sizeP, unsigned char* sdu_buffer_pP, pdcp_transmission_mode_t modeP)
boolean_t pdcp_data_req(
module_id_t enb_mod_idP,
module_id_t ue_mod_idP,
frame_t frameP,
eNB_flag_t enb_flagP,
rb_id_t rb_idP,
mui_t muiP,
confirm_t confirmP,
sdu_size_t sdu_buffer_sizeP,
unsigned char *sdu_buffer_pP,
pdcp_transmission_mode_t modeP)
{
//-----------------------------------------------------------------------------
pdcp_t *pdcp_p = NULL;
......@@ -92,7 +101,11 @@ boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
AssertError (enb_mod_idP < NUMBER_OF_eNB_MAX, return FALSE, "eNB id is too high (%u/%d) %u %u!\n", enb_mod_idP, NUMBER_OF_eNB_MAX, ue_mod_idP, rb_idP);
AssertError (ue_mod_idP < NUMBER_OF_UE_MAX, return FALSE, "UE id is too high (%u/%d) %u %u!\n", ue_mod_idP, NUMBER_OF_UE_MAX, enb_mod_idP, rb_idP);
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ue_mod_idP, enb_mod_idP);
} else {
AssertError (rb_idP < NB_RB_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MAX, ue_mod_idP, enb_mod_idP);
}
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_ue[ue_mod_idP][rb_idP];
......@@ -137,6 +150,10 @@ boolean_t pdcp_data_req(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
pdcp_pdu_p = get_free_mem_block(sdu_buffer_sizeP);
if (pdcp_pdu_p != NULL) {
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
rlc_util_print_hex_octets(PDCP,
(unsigned char*)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP);
rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
......@@ -362,8 +379,20 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
oai_emulation.info.first_ue_local);
}
#endif
DevCheck4(rb_idP < NB_RB_MAX, rb_idP, NB_RB_MAX, enb_mod_idP, ue_mod_idP);
if (MBMS_flagP) {
AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ue_mod_idP, enb_mod_idP);
if (enb_flagP == ENB_FLAG_NO) {
LOG_I(PDCP, "e-MBMS Data indication notification for PDCP entity from eNB %u to UE %u "
"and radio bearer ID %d rlc sdu size %d enb_flagP %d\n",
enb_mod_idP, ue_mod_idP, rb_idP, sdu_buffer_sizeP, enb_flagP);
} else {
LOG_I(PDCP, "Data indication notification for PDCP entity from UE %u to eNB %u "
"and radio bearer ID %d rlc sdu size %d enb_flagP %d eNB_id %d\n",
ue_mod_idP, enb_mod_idP , rb_idP, sdu_buffer_sizeP, enb_flagP, enb_mod_idP);
}
} else {
rb_idP = rb_idP % NB_RB_MAX;
AssertError (rb_idP < NB_RB_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MAX, ue_mod_idP, enb_mod_idP);
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_ue[ue_mod_idP][rb_idP];
......@@ -377,6 +406,8 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
"and radio bearer ID %d rlc sdu size %d enb_flagP %d eNB_id %d\n",
ue_mod_idP, enb_mod_idP , rb_idP, sdu_buffer_sizeP, enb_flagP, enb_mod_idP);
}
}
sdu_list_p = &pdcp_sdu_list;
......@@ -482,6 +513,9 @@ boolean_t pdcp_data_ind(module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t
if (oai_emulation.info.otg_enabled == 1) {
module_id_t src_id, dst_id;
int ctime;
rlc_util_print_hex_octets(PDCP,
&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset);
src_id = (enb_flagP != 0) ? ue_mod_idP : enb_mod_idP;
dst_id = (enb_flagP == ENB_FLAG_NO) ? ue_mod_idP : enb_mod_idP;
......@@ -924,7 +958,7 @@ boolean_t rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
// can set the mch_id = i
if (enb_flagP) {
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id; // 1
rb_id = (mch_id * maxSessionPerPMCH ) + lc_id + (maxDRB + 3)*MAX_MOBILES_PER_ENB; // 1
if (pdcp_mbms_array_eNB[enb_mod_idP][mch_id][lc_id].instanciated_instance == TRUE)
action = CONFIG_ACTION_MBMS_MODIFY;
else
......@@ -939,7 +973,8 @@ boolean_t rrc_pdcp_config_asn1_req (module_id_t enb_mod_idP,
pdcp_config_req_asn1 (NULL, // unused for MBMS
pdcp_config_req_asn1 (
NULL, // unused for MBMS
enb_mod_idP,
ue_mod_idP,
frameP,
......@@ -1110,8 +1145,8 @@ boolean_t pdcp_config_req_asn1 (pdcp_t *pdcp_pP,
pdcp_mbms_array_eNB[enb_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_eNB[enb_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
} else {
pdcp_mbms_array_eNB[ue_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_eNB[ue_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
pdcp_mbms_array_ue[ue_mod_idP][mch_idP][lc_idP].instanciated_instance = TRUE ;
pdcp_mbms_array_ue[ue_mod_idP][mch_idP][lc_idP].rb_id = rb_idP;
}
break;
#endif
......
......@@ -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
......@@ -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,
......
......@@ -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
......@@ -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,8 +394,7 @@ 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_flagP) ? "eNB" : "UE",
enb_module_idP,
ue_module_idP,
rb_idP,
......@@ -389,7 +403,7 @@ void rlc_um_set_debug_infos(rlc_um_entity_t *rlc_pP,
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) {
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,7 +218,25 @@ 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. */
#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.
......
......@@ -141,6 +141,7 @@ tbs_size_t mac_rlc_data_req(
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;
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 {
......@@ -297,8 +298,10 @@ void mac_rlc_data_ind (
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;
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);
......@@ -419,8 +422,12 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
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);
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) {
......@@ -456,6 +463,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
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;
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 {
......
......@@ -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
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;
......
......@@ -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
......
......@@ -75,6 +75,8 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
if (buffer_tx!=NULL) {
otg_hdr_info_rx = (otg_hdr_info_t *) (&buffer_tx[bytes_read]);
bytes_read += sizeof (otg_hdr_info_t);
LOG_D(OTG,"otg_rx_pkt functions: source %d, destination %d, size %d, otg_hdr_info_rx->flag %.4x, otg_hdr_info_rx->size %d \n",
src,dst,size,otg_hdr_info_rx->flag,otg_hdr_info_rx->size);
if (((otg_hdr_info_rx->flag == 0xffff)||(otg_hdr_info_rx->flag == 0xbbbb) || (otg_hdr_info_rx->flag == 0x1000)) &&
......@@ -109,8 +111,8 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
// rx_check_loss(src, dst, otg_hdr_info_rx->flag, otg_hdr_rx->seq_num, &seq_num_rx, &nb_loss_pkts);
// otg_multicast_info->loss_rate[src][dst][otg_hdr_rx->traffic_type]=nb_loss_pkts;
//otg_multicast_info->rx_sn[src][dst][otg_hdr_rx->traffic_type]=seq_num_rx;
// LOG_I(OTG,"received a multicast packet with size %d sn %d ran owd %d loss rate %d\n",
// otg_hdr_info_rx->size, seq_num_rx, ctime- otg_hdr_rx->time, nb_loss_pkts);
LOG_I(OTG,"received a multicast packet with size %d sn %d ran owd %d loss rate %d\n",
otg_hdr_info_rx->size, seq_num_rx, ctime- otg_hdr_rx->time, nb_loss_pkts);
//return 0;
}
......
......@@ -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 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