add the relay node for a dual stack operation for eMBMS (experimental)

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4146 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Navid Nikaein
2013-09-11 14:59:47 +00:00
parent 20a4013bac
commit 2f889b422b
28 changed files with 341 additions and 218 deletions
+1
View File
@@ -48,6 +48,7 @@ extern unsigned char NB_INST;
#endif
extern unsigned char NB_eNB_INST;
extern unsigned char NB_UE_INST;
extern unsigned char NB_RN_INST;
extern unsigned short NODE_ID[1];
extern void* bigphys_malloc(int);
#else
+4 -4
View File
@@ -330,7 +330,7 @@ int mac_top_init(int eMBMS_active, u8 cba_group_active){
int mac_init_global_param(void){
/***********************************************************************/
Is_rrc_registered=0;
Mac_rlc_xface = NULL;
LOG_I(MAC,"[MAIN] CALLING RLC_MODULE_INIT...\n");
@@ -376,7 +376,7 @@ int mac_init_global_param(void){
LOG_I(MAC,"[MAIN] RLC interface setup and init\n");
rrc_init_global_param();
Is_rrc_registered=1;
#ifdef USER_MODE
pdcp_layer_init ();
#else
@@ -410,9 +410,9 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, u8 cba_group_activ
// NB_NODE=2;
// NB_INST=2;
Is_rrc_registered=0;
mac_init_global_param();
Is_rrc_registered=1;
mac_xface->macphy_init = mac_top_init;
#ifndef USER_MODE
+18 -14
View File
@@ -247,7 +247,7 @@ u32 ue_get_SR(u8 Mod_id,u32 frame,u8 eNB_id,u16 rnti, u8 subframe) {
(1<<(2+UE_mac_inst[Mod_id].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)),
UE_mac_inst[Mod_id].scheduling_info.SR_pending);
UE_mac_inst[Mod_id].ul_active =1;
//UE_mac_inst[Mod_id].ul_active =1;
return(1); //instruct phy to signal SR
}
@@ -1393,31 +1393,35 @@ int use_cba_access(u8 Mod_id,u32 frame,u8 subframe, u8 eNB_index){
if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]>0)&&(UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]<64)) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]>0)&&(UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]<64)) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]>0)&&(UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]<64)) )
// && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive
&& (UE_mac_inst[Mod_id].cba_last_access[0] <= 0) ) { // backoff
// && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive
&& (UE_mac_inst[Mod_id].cba_last_access[0] <= 0) ) { // backoff
// LOG_D(MAC,"[UE %d] Frame %d Subframe %d: the current CBA backoff is %d \n", Mod_id, frame, subframe,
// UE_mac_inst[Mod_id].cba_last_access[0] );
UE_mac_inst[Mod_id].cba_last_access[0]= round(uniform_rngen(1,30));
UE_mac_inst[Mod_id].cba_last_access[0]= round(uniform_rngen(1,10));
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", Mod_id, frame, subframe,
UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active);
return 1;
} else {
if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]> 0 )) )
// && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive
&& (UE_mac_inst[Mod_id].cba_last_access[0]> 0) ){
} else if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2]> 0 )) ||
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3]> 0 )) )
// && (UE_mac_inst[Mod_id].ul_active == 0) // check if the ul is acrtive
&& (UE_mac_inst[Mod_id].cba_last_access[0]> 0) ){
UE_mac_inst[Mod_id].cba_last_access[0]-=1;
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: CBA backoff is decreased by one to %d UL active state %d \n",
Mod_id, frame, subframe,
UE_mac_inst[Mod_id].cba_last_access[0], UE_mac_inst[Mod_id].ul_active);
}
return 0;
}
} /*else if (( ((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID1] == 0 )) &&
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID2] == 0 )) &&
((UE_mac_inst[Mod_id].scheduling_info.BSR[LCGID3] == 0 )) )
&& (UE_mac_inst[Mod_id].cba_last_access[0]> 0) ){
UE_mac_inst[Mod_id].cba_last_access[0]-=1;
}*/
return 0;
}
#endif
+1
View File
@@ -78,6 +78,7 @@ u8 Is_rrc_registered;
#ifdef OPENAIR2
unsigned char NB_eNB_INST=0;
unsigned char NB_UE_INST=0;
unsigned char NB_RN_INST=0;
unsigned char NB_INST=0;
#endif
+2
View File
@@ -274,7 +274,9 @@ typedef struct{
SystemInformationBlockType9_t *sib9[NB_CNX_UE];
SystemInformationBlockType10_t *sib10[NB_CNX_UE];
SystemInformationBlockType11_t *sib11[NB_CNX_UE];
#ifdef Rel10
uint8_t MBMS_flag;
u8 *MCCH_MESSAGE[NB_CNX_UE];
u8 sizeof_MCCH_MESSAGE[NB_CNX_UE];
u8 MCCH_MESSAGEStatus[NB_CNX_UE];
+5 -2
View File
@@ -156,7 +156,7 @@ void rrc_ue_generate_RRCConnectionRequest(u8 Mod_id, u32 frame, u8 eNB_index){
/*------------------------------------------------------------------------------*/
u8 i=0,rv[6];
if(UE_rrc_inst[Mod_id].Srb0[eNB_index].Tx_buffer.payload_size ==0){
// Get RRCConnectionRequest, fill random for now
@@ -1468,7 +1468,10 @@ int decode_SI(u8 Mod_id,u32 frame,u8 eNB_index,u8 si_window) {
);
UE_rrc_inst[Mod_id].Info[eNB_index].SIStatus = 1;
// After SI is received, prepare RRCConnectionRequest
rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index);
#ifdef Rel10
if (UE_rrc_inst[Mod_id].MBMS_flag < 3) // see -Q option
#endif
rrc_ue_generate_RRCConnectionRequest(Mod_id,frame,eNB_index);
if (UE_rrc_inst[Mod_id].Info[eNB_index].State == RRC_IDLE) {
LOG_I(RRC,"[UE %d] Received SIB1/SIB2/SIB3 Switching to RRC_SI_RECEIVED\n",Mod_id);
+13 -2
View File
@@ -232,6 +232,12 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){
dummy_buffer,
0,
0);*/
#ifdef Rel10
LOG_I(RRC,"[UE] eMBMS active state is %d \n", eMBMS_active);
for (i=0;i<NB_eNB_INST;i++) {
UE_rrc_inst[i].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif
} else
UE_rrc_inst=NULL;
@@ -240,10 +246,15 @@ void openair_rrc_top_init(int eMBMS_active, u8 cba_group_active){
eNB_rrc_inst = (eNB_RRC_INST*)malloc16(NB_eNB_INST*sizeof(eNB_RRC_INST));
memset(eNB_rrc_inst,0,NB_eNB_INST*sizeof(eNB_RRC_INST));
#ifdef Rel10
eNB_rrc_inst->MBMS_flag = (uint8_t)eMBMS_active;
LOG_I(RRC,"[eNB] eMBMS active state is %d \n", eMBMS_active);
for (i=0;i<NB_eNB_INST;i++) {
eNB_rrc_inst[i].MBMS_flag = (uint8_t)eMBMS_active;
}
#endif
#ifdef CBA
eNB_rrc_inst->num_active_cba_groups = cba_group_active;
for (i=0;i<NB_eNB_INST;i++) {
eNB_rrc_inst[i].num_active_cba_groups = cba_group_active;
}
#endif
LOG_D(RRC,"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n",(unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)),eNB_rrc_inst);
}else
+4
View File
@@ -636,7 +636,10 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char nb_ue_remote;
unsigned char nb_enb_local;
unsigned char nb_enb_remote;
unsigned char nb_rn_local;
unsigned char nb_rn_remote;
unsigned char first_enb_local;
unsigned char first_rn_local;
unsigned char first_ue_local;
unsigned short master_id;
unsigned char nb_master;
@@ -655,6 +658,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
unsigned char otg_enabled;
unsigned char omv_enabled;
unsigned char vcd_enabled;
unsigned char eMBMS_active_state;
unsigned char cba_group_active;
char * otg_traffic;
unsigned char otg_bg_traffic_enabled;
+2 -2
View File
@@ -111,14 +111,14 @@ char *str_sub (const char *s, unsigned int start, unsigned int end) {
// set the simulation time
void set_ctime(int ctime){
otg_info->ctime=ctime;
otg_info->ctime=ctime;
}
// get the simulation time
int get_ctime(void){
return otg_info->ctime;
return otg_info->ctime;
}
+41 -36
View File
@@ -200,7 +200,7 @@ int adjust_size(int size){
unsigned char *packet_gen(int src, int dst, int ctime, int * pkt_size){ // when pdcp, ctime = frame cnt
unsigned char *packet_gen(int src, int dst, int app, int ctime, int * pkt_size){ // when pdcp, ctime = frame cnt
//unsigned char *packet=NULL;
unsigned int size=0;
@@ -213,12 +213,16 @@ unsigned char *packet_gen(int src, int dst, int ctime, int * pkt_size){ // when
char *header=NULL;
int header_size;
LOG_T(OTG,"[src %d] [dst %d ]MY_CTIME %d, MAX_FRAME %d\n",src, dst, ctime, g_otg->max_nb_frames);
// check if the app is configured
if (app >= g_otg->application_idx[src][dst]){
return NULL;
}
LOG_T(OTG,"[src %d] [dst %d ][APP %d] current time %d\n",src, dst, app, ctime);
*pkt_size=0;
init_packet_gen(src, dst,ctime);
size=check_data_transmit(src,dst,ctime);
size=check_data_transmit(src,dst,app,ctime);
/*
Send Packets when:
@@ -303,7 +307,8 @@ unsigned char *packet_gen_multicast(int src, int dst, int ctime, int * pkt_size)
unsigned int flag;
int app,seq_num=0;
int otg_hdr_size= + sizeof(otg_hdr_info_t) + sizeof(otg_hdr_t);
set_ctime(ctime); // fixme: this should be done separetly from packet_gen and packet_gen_multicast
//for (app=0; app<MAX_NUM_APPLICATION; app++){
for (app=0; app<1; app++){
if ( (g_otg_multicast->idt_dist[src][dst][app]> 0) &&
@@ -374,56 +379,56 @@ void init_packet_gen(int src, int dst,int ctime){
}
void check_ctime(int ctime){
if (ptime>ctime)
LOG_W(OTG, "ERROR ctime: current time [%d] less than previous time [%d] \n",ctime,ptime);
ptime=ctime;
if (ptime>ctime)
LOG_W(OTG, "ERROR ctime: current time [%d] less than previous time [%d] \n",ctime,ptime);
ptime=ctime;
}
int check_data_transmit(int src,int dst, int ctime){
int check_data_transmit(int src,int dst, int app, int ctime){
unsigned int size=0;
for (application=0; application<g_otg->application_idx[src][dst]; application++){
// for (application=0; application<g_otg->application_idx[src][dst]; application++){
otg_info->gen_pkts=0;
LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %d [M2M %d ]\n", src, dst, application , g_otg->application_type[src][dst][application],g_otg->application_idx[src][dst], g_otg->m2m[src][dst][application]);
LOG_T(OTG,"FLOW_INFO [src %d][dst %d] [IDX %d] [APPLICATION TYPE %d] MAX %d [M2M %d ]\n", src, dst, app, g_otg->application_type[src][dst][app],g_otg->application_idx[src][dst], g_otg->m2m[src][dst][app]);
// do not generate packet for this pair of src, dst : no app type and/or no idt are defined
if (g_otg->duration[src][dst][application] > ctime){
LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d \n", src, dst,g_otg->duration[src][dst][application], ctime);
if (g_otg->duration[src][dst][app] > ctime){
LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d \n", src, dst,g_otg->duration[src][dst][app], ctime);
size+=0;
}else if ((g_otg->application_type[src][dst][application]==0)&&(g_otg->idt_dist[src][dst][application][PE_STATE]==0)){
LOG_D(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app not specificed\n", src, dst);
}else if ((g_otg->application_type[src][dst][app]==0)&&(g_otg->idt_dist[src][dst][app][PE_STATE]==0)){
LOG_D(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app %d not specificed\n", src, dst, app);
size+=0;
}
else if ((g_otg->application_type[src][dst][application] >0) || (g_otg->idt_dist[src][dst][application][PE_STATE] > 0)) {
state = get_application_state(src, dst, application, ctime);
else if ((g_otg->application_type[src][dst][app] >0) || (g_otg->idt_dist[src][dst][app][PE_STATE] > 0)) {
state = get_application_state(src, dst, app, ctime);
#ifdef STANDALONE
//pre-config for the standalone
if (ctime<otg_info->ptime[src][dst][application]) //it happends when the emulation was finished
otg_info->ptime[src][dst][application]=ctime;
if (ctime<otg_info->ptime[src][dst][app]) //it happends when the emulation was finished
otg_info->ptime[src][dst][app]=ctime;
if (ctime==0)
otg_info->idt[src][dst][application]=0; //for the standalone mode: the emulation is run several times, we need to initialise the idt to 0 when ctime=0
otg_info->idt[src][dst][app]=0; //for the standalone mode: the emulation is run several times, we need to initialise the idt to 0 when ctime=0
//end pre-config
#endif
//LOG_D(OTG,"MY_STATE %d \n", state);
if (state!=OFF_STATE) {
if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src][dst][application]==0) || (( (ctime-otg_info->ptime[src][dst][application]) >= otg_info->idt[src][dst][application] ) )) {
if (((state==PU_STATE)||(state==ED_STATE))|| (otg_info->idt[src][dst][app]==0) || (( (ctime-otg_info->ptime[src][dst][app]) >= otg_info->idt[src][dst][app] ) )) {
LOG_D(OTG,"[TX] OTG packet: Time To Transmit::OK (Source= %d, Destination= %d, Application %d, State= %d) , (IDT= %d ,ctime= %d, ptime= %d) \n",
src, dst ,application, state, otg_info->idt[src][dst][application], ctime, otg_info->ptime[src][dst][application]);
otg_info->ptime[src][dst][application]=ctime;
src, dst ,app, state, otg_info->idt[src][dst][app], ctime, otg_info->ptime[src][dst][app]);
otg_info->ptime[src][dst][app]=ctime;
if (state==PE_STATE) //compute the IDT only for PE STATE
tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][application]);
otg_info->idt[src][dst][application]=time_dist(src, dst, application,state);
tarmaUpdateInputSample(otg_info->tarma_stream[src][dst][app]);
otg_info->idt[src][dst][app]=time_dist(src, dst, app,state);
otg_info->gen_pkts=1;
header_size_gen(src,dst, application);
header_size_gen(src,dst, app);
//for(i=1;i<=g_otg->aggregation_level[src][dst][application];i++)
/* if (g_otg->m2m[src][dst][application]==M2M){ //TO FIX FOR M2M
size+=size_dist(src, dst, application,state);
@@ -436,10 +441,10 @@ int check_data_transmit(int src,int dst, int ctime){
else{ */
/* For the case of non M2M traffic: when more than one flows transmit data in the same time
--> the second flow transmit (because of non data aggragation) */
size=size_dist(src, dst, application,state);
otg_info->header_size[src][dst]=otg_info->header_size_app[src][dst][application];
otg_info->flow_id[src][dst]=application;
otg_info->traffic_type[src][dst]=g_otg->application_type[src][dst][application];
size=size_dist(src, dst, app,state);
otg_info->header_size[src][dst]=otg_info->header_size_app[src][dst][app];
otg_info->flow_id[src][dst]=app;
otg_info->traffic_type[src][dst]=g_otg->application_type[src][dst][app];
/*} */
@@ -450,18 +455,18 @@ int check_data_transmit(int src,int dst, int ctime){
}
} //check if there is background traffic to generate
else if ((otg_info->gen_pkts==0) && (g_otg->background[src][dst][application]==1)&&(background_gen(src, dst, ctime)!=0)){ // the gen_pkts condition could be relaxed here
else if ((otg_info->gen_pkts==0) && (g_otg->background[src][dst][app]==1)&&(background_gen(src, dst, ctime)!=0)){ // the gen_pkts condition could be relaxed here
otg_info->traffic_type_background[src][dst]=1;
if (g_otg->m2m[src][dst][application]==M2M)
if (g_otg->m2m[src][dst][app]==M2M)
otg_info->traffic_type[src][dst]=M2M;
LOG_D(OTG,"[BACKGROUND=%d] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src][dst], src, dst, application);
LOG_D(OTG,"[BACKGROUND=%d] Time To Transmit [SRC %d][DST %d][APPLI %d] \n", otg_info->traffic_type_background[src][dst], src, dst, app);
}
}
}
}
// }
return size;
}
@@ -1275,7 +1280,7 @@ break;
case BACKGROUND_USERS:
g_otg->trans_proto[i][j][k] = TCP;
g_otg->ip_v[i][j][k] = IPV4;
g_otg->idt_dist[i][j][k][PE_STATE] = UNIFORM;
g_otg->idt_dist[i][j][k][PE_STATE] = UNIFORM;
g_otg->idt_lambda[i][j][k][PE_STATE] = 1/40;
g_otg->idt_min[i][j][k][PE_STATE] = 40;
g_otg->idt_max[i][j][k][PE_STATE] = 80;
+4 -2
View File
@@ -89,11 +89,13 @@ char * random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type);
* \brief return int= 1 if the packet is generated: OTG header + header + payload, else 0
* \param[in] src source identity
* \param[in] dst destination id
* \param[in] application id that might generate the packet
* \param[out] final packet size
* \param[out] packet_t: the generated packet: otg_header + header + payload
* \note
* @ingroup _otg
*/
unsigned char *packet_gen(int src, int dst, int ctime, int *pkt_size);
unsigned char *packet_gen(int src, int dst, int app, int ctime, int *pkt_size);
/*! \fn char *header_gen(int hdr_size);
@@ -185,7 +187,7 @@ int otg_hdr_size(int src, int dst);
void init_packet_gen(int src, int dst, int ctime);
int check_data_transmit(int src,int dst, int ctime);
int check_data_transmit(int src,int dst, int app, int ctime);
unsigned int get_application_state(int src, int dst, int application, int ctime);