* Add relay node types and its eNB/UE procedures

* update the L2 interface
* update eMBMS MAC/PHY to support more than one MBSFN sync area
* update OTG to support different multicast traffic for eMBMS
* pre-ci test passed (100%)
 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4170 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Navid Nikaein
2013-09-27 22:53:57 +00:00
parent 51bdba7756
commit 5861085339
42 changed files with 1482 additions and 783 deletions
+2 -2
View File
@@ -559,7 +559,7 @@ static void *eNB_thread(void *arg)
if (fs4_test==0)
{
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[0], 0, 0,NULL);
#ifndef IFFT_FPGA
slot_offset_F = (next_slot)*
(PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size)*
@@ -781,7 +781,7 @@ static void *UE_thread(void *arg)
*/
in = rt_get_time_ns();
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode,0);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[0], 0, 0,mode,0,NULL);
out = rt_get_time_ns();
diff = out-in;
@@ -0,0 +1,70 @@
<OAI_EMULATION>
-
<ENVIRONMENT_SYSTEM_CONFIG>
<FADING>
<LARGE_SCALE>urban</LARGE_SCALE>
<FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-111</PATHLOSS_0_dB>
</FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>Rayleigh1</SMALL_SCALE>
</FADING>
<SYSTEM_BANDWIDTH_MB>7.68</SYSTEM_BANDWIDTH_MB>
<SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz>
<TRANSMISSION_MODE>1</TRANSMISSION_MODE>
<ANTENNA>
<eNB_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
<NUMBER_OF_SECTORS>1</NUMBER_OF_SECTORS>
<BEAM_WIDTH_dB>0</BEAM_WIDTH_dB>
<ANTENNA_GAIN_dBi>0</ANTENNA_GAIN_dBi>
<TX_POWER_dBm>15</TX_POWER_dBm>
</eNB_ANTENNA>
<UE_ANTENNA>
<RX_NOISE_LEVEL_dB>0</RX_NOISE_LEVEL_dB>
<ANTENNA_GAIN_dBi>0</ANTENNA_GAIN_dBi>
<TX_POWER_dBm>20</TX_POWER_dBm>
</UE_ANTENNA>
</ANTENNA>
</ENVIRONMENT_SYSTEM_CONFIG>
<TOPOLOGY_CONFIG>
<AREA>
<X_m>800</X_m>
<Y_m>800</Y_m>
</AREA>
<MOBILITY>
<UE_MOBILITY>
<UE_INITIAL_DISTRIBUTION>random</UE_INITIAL_DISTRIBUTION>
<RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>1</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>TRACE</UE_MOBILITY_TYPE>
<TRACE_MOBILITY_FILE>static_1ue.tr</TRACE_MOBILITY_FILE>
</UE_MOBILITY>
<eNB_MOBILITY>
<eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION>
<RANDOM_eNB_DISTRIBUTION>
<NUMBER_OF_CELLS>1</NUMBER_OF_CELLS>
</RANDOM_eNB_DISTRIBUTION>
<eNB_MOBILITY_TYPE>STATIC</eNB_MOBILITY_TYPE>
</eNB_MOBILITY>
</MOBILITY>
</TOPOLOGY_CONFIG>
<EMULATION_CONFIG>
<EMULATION_TIME_ms>1200</EMULATION_TIME_ms>
<CURVE>disable</CURVE>
<LOG> <!-- set the global log level -->
<LEVEL>info</LEVEL>
<VERBOSITY>low</VERBOSITY> <!-- low, medium, high, full -->
<INTERVAL>1</INTERVAL>
</LOG>
<SEED_VALUE>69</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
</EMULATION_CONFIG>
<PROFILE>eMBMS_OMG_REF_1</PROFILE>
</OAI_EMULATION>
+2 -2
View File
@@ -59,7 +59,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
if (is_pmch_subframe(frame,next_slot>>1,frame_parms)) {
if ((next_slot%2)==0) {
printf("MBSFN eNB sim: Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset);
LOG_D(OCM,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset);
PHY_ofdm_mod(&txdataF[aa][slot_offset_F], // input
&txdata[aa][slot_offset], // output
frame_parms->log2_symbol_size, // log2_fft_size
@@ -79,7 +79,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, uint32_t frame,u16 next_slot
frame_parms->rev, // bit-reversal permutation
CYCLIC_PREFIX);
else {
printf("MBSFN eNB sim: Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1);
LOG_D(OCM,"Frame %d, subframe %d: Doing PDCCH modulation\n",frame,next_slot>>1);
normal_prefix_mod(&txdataF[aa][slot_offset_F],
&txdata[aa][slot_offset],
2,
+34 -8
View File
@@ -59,9 +59,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
exit(-1);
}
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0);
// this is the transmission mode for the signalling channels
// this is the transmission mode for the signalling channels
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
PHY_vars_eNB->transmission_mode[i] = transmission_mode;
@@ -78,7 +76,10 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI);
PHY_vars_eNB->dlsch_eNB_ra = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag);
LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra);
PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH);
PHY_vars_eNB->rx_total_gain_eNB_dB=140;
for(i=0;i<NUMBER_OF_UE_MAX;i++)
@@ -138,7 +139,26 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
return (PHY_vars_UE);
}
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
u8 RN_id,
u8 eMBMS_active_state) {
int i;
PHY_VARS_RN* PHY_vars_RN = malloc(sizeof(PHY_VARS_RN));
memset(PHY_vars_RN,0,sizeof(PHY_VARS_RN));
PHY_vars_RN->Mod_id=RN_id;
if (eMBMS_active_state == multicast_relay) {
for (i=0; i < 10 ; i++){ // num SF in a frame
PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]);
}
} else {
PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]);
}
return (PHY_vars_RN);
}
void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 frame_type,
u8 tdd_config,
@@ -147,9 +167,9 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 N_RB_DL,
u16 Nid_cell,
u8 cooperation_flag,u8 transmission_mode,u8 abstraction_flag,
int nb_antennas_rx) {
int nb_antennas_rx, u8 eMBMS_active_state) {
u8 eNB_id,UE_id;
u8 eNB_id,UE_id,RN_id;
mac_xface = malloc(sizeof(MAC_xface));
@@ -192,9 +212,15 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
(*frame_parms)->nb_antennas_rx = nb_antennas_rx;
PHY_vars_UE_g = malloc(NB_UE_INST*sizeof(PHY_VARS_UE*));
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){ // begin navid
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){
PHY_vars_UE_g[UE_id] = init_lte_UE(*frame_parms, UE_id,abstraction_flag,transmission_mode);
}
if (NB_RN_INST > 0) {
PHY_vars_RN_g = malloc(NB_RN_INST*sizeof(PHY_VARS_RN*));
for (RN_id=0; RN_id<NB_RN_INST;RN_id++){
PHY_vars_RN_g[RN_id] = init_lte_RN(*frame_parms,RN_id,eMBMS_active_state);
}
}
}
+5 -1
View File
@@ -13,6 +13,9 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
u8 abstraction_flag,
u8 transmission_mode);
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
u8 RN_id,
u8 eMBMS_active_state);
void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 frame_type,
@@ -24,4 +27,5 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
u8 cooperation_flag,
u8 transmission_mode,
u8 abstraction_flag,
int nb_antennas_rx);
int nb_antennas_rx,
u8 eMBMS_active_state);
+34 -57
View File
@@ -329,7 +329,7 @@ int omv_write (int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_F
}
}
}
LOG_E(OMG,"pfd %d \n", pfd);
if( write( pfd, &omv_data, sizeof(struct Data_Flow_Unit) ) == -1 )
perror( "write omv failed" );
return 1;
@@ -343,16 +343,16 @@ void omv_end (int pfd, Data_Flow_Unit omv_data) {
#endif
Packet_OTG_List *otg_pdcp_buffer;
#ifdef OPENAIR2
int pfd[2]; // fd for omv : fixme: this could be a local var
#endif
int main (int argc, char **argv) {
int
main (int argc, char **argv)
{
s32 i;
// pointers signal buffers (s = transmit, r,r0 = receive)
clock_t t;
// Framing variables
s32 slot, last_slot, next_slot;
@@ -373,9 +373,7 @@ int
lte_subframe_t direction;
#ifdef OPENAIR2
int pfd[2]; // fd for omv : fixme: this could be a local var
#endif
char fname[64],vname[64];
// u8 awgn_flag = 0;
@@ -420,8 +418,8 @@ int
//Default values if not changed by the user in get_simulation_options();
pdcp_period = 1;
omg_period = 10;
// start thread for log gen
omg_period = 1;
// start thread for log gen
log_thread_init();
init_oai_emulation(); // to initialize everything !!!
@@ -448,14 +446,20 @@ int
// configure oaisim with OCG
oaisim_config(); // config OMG and OCG, OPT, OTG, OLG
if (ue_connection_test == 1) {
snr_direction = -snr_step;
snr_dB=20;
sinr_dB=-20;
}
#ifdef OPENAIR2
init_omv();
#endif
#endif
//Before this call, NB_UE_INST and NB_eNB_INST are not set correctly
check_and_adjust_params();
init_otg_pdcp_buffer();
#ifdef PRINT_STATS
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
sprintf(UE_stats_filename,"UE_stats%d.txt",UE_id);
@@ -487,31 +491,11 @@ int
#endif
#endif
if (NB_RN_INST > 0 ) {
LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
NB_UE_INST, NB_UE_INST+NB_RN_INST);
NB_eNB_INST+=NB_RN_INST;
NB_UE_INST+=NB_RN_INST;
}
LOG_I(EMU,"Total number of UE %d (local %d, remote %d, relay %d) mobility %s \n",
NB_UE_INST,oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n",
oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
set_seed = oai_emulation.emulation_config.seed.value;
init_otg_pdcp_buffer();
init_seed(set_seed);
init_openair1();
@@ -551,23 +535,13 @@ int
init_time();
LOG_I(EMU,">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
LOG_I (EMU,"after init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
LOG_I(EMU,"after init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0]->lte_frame_parms.tdd_config);
if (ue_connection_test == 1) {
snr_direction = -snr_step;
snr_dB=20;
sinr_dB=-20;
}
init_slot_isr();
t = clock();
LOG_N(EMU,"\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
for (frame=0; frame<oai_emulation.info.n_frames; frame++) {
/*
// Handling the cooperation Flag
@@ -658,7 +632,8 @@ int
pdcp_run(frame, 1, 0, eNB_id);//PHY_vars_eNB_g[eNB_id]->Mod_id
// PHY_vars_eNB_g[eNB_id]->frame = frame;
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, no_relay);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag,
no_relay,NULL);
#ifdef PRINT_STATS
if(last_slot==9 && frame%10==0)
@@ -704,7 +679,8 @@ int
//Access layer
pdcp_run(frame, 0, UE_id, 0);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, no_relay);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx,
no_relay,NULL);
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm;
}
}
@@ -759,6 +735,7 @@ int
LOG_E(EMU,"Not supported eMBMS option when relaying is enabled %d\n", r_type);
exit(-1);
}
PHY_vars_RN_g[RN_id]->frame = frame;
if ( oai_emulation.info.frame_type == 0) {
// RN == UE
if (frame>0) {
@@ -766,17 +743,17 @@ int
LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, UE_id, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_id]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx, r_type);
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_id], 0, abstraction_flag,normal_txrx,
r_type, PHY_vars_RN_g[RN_id]);
} else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_id],normal_txrx);
}
}
// RN == eNB
LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, eNB_id, frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag, r_type);
phy_procedures_eNB_lte (last_slot, next_slot, PHY_vars_eNB_g[eNB_id], abstraction_flag,
r_type, PHY_vars_RN_g[RN_id]);
}
else{
LOG_E(EMU,"TDD is not supported for multicast relaying %d\n", r_type);
+19 -11
View File
@@ -50,6 +50,12 @@ mapping omg_model_names[] =
mapping otg_multicast_app_type_names[] = {
{"no_predefined_multicast_traffic", 0},
{"mscbr", 1},
{"mmcbr", 2},
{"mbcbr", 3},
{"msvbr", 4},
{"mmvbr", 5},
{"mbvbr", 6},
{"mvideo_vbr_4mbps", 7},
{NULL, -1}
} ;
@@ -150,8 +156,8 @@ void init_oai_emulation() {
int i;
oai_emulation.environment_system_config.fading.large_scale.selected_option = "free_space";
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_exponent = 2.0;
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_0_dB = -50;
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_exponent = 3.00;
oai_emulation.environment_system_config.fading.free_space_model_parameters.pathloss_0_dB = -100;
oai_emulation.environment_system_config.fading.small_scale.selected_option = "AWGN";
oai_emulation.environment_system_config.fading.ricean_8tap.rice_factor_dB = 0;
oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m = 0;
@@ -163,14 +169,14 @@ void init_oai_emulation() {
oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[2] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.alpha_rad[3] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_gain_dBi = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.tx_power_dBm = 43;
oai_emulation.environment_system_config.antenna.eNB_antenna.tx_power_dBm = 15;
oai_emulation.environment_system_config.antenna.eNB_antenna.rx_noise_level_dB = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[1] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[2] = 0;
oai_emulation.environment_system_config.antenna.eNB_antenna.antenna_orientation_degree[3] = 0;
oai_emulation.environment_system_config.antenna.UE_antenna.antenna_gain_dBi = 0;
oai_emulation.environment_system_config.antenna.UE_antenna.tx_power_dBm = 20;
oai_emulation.environment_system_config.antenna.UE_antenna.rx_noise_level_dB = 0;
oai_emulation.environment_system_config.antenna.UE_antenna.rx_noise_level_dB = 0; // noise figure
oai_emulation.environment_system_config.wall_penetration_loss_dB = 5;
oai_emulation.environment_system_config.system_bandwidth_MB = 7.68;
oai_emulation.environment_system_config.system_frequency_GHz = 1.9;
@@ -320,9 +326,9 @@ void init_oai_emulation() {
oai_emulation.info.cba_group_active=0;
oai_emulation.info.eMBMS_active_state=0;
oai_emulation.info.omg_model_enb=STATIC; //default to static mobility model
oai_emulation.info.omg_model_rn=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue=STATIC; //default to static mobility model
oai_emulation.info.omg_model_ue_current=STATIC; //default to static mobility model
oai_emulation.info.otg_enabled=0;// T flag with arg
oai_emulation.info.otg_bg_traffic_enabled = 0; // G flag
oai_emulation.info.frame = 0; // frame counter of emulation
oai_emulation.info.time_s = 0; // time of emulation
@@ -490,7 +496,7 @@ int ocg_config_topo() {
// init OMG for eNBs
if ((oai_emulation.info.omg_model_enb = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option))== -1)
oai_emulation.info.omg_model_ue = STATIC;
oai_emulation.info.omg_model_enb = STATIC;
LOG_I(OMG,"eNB mobility model is (%s, %d)\n",
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option,
oai_emulation.info.omg_model_enb);
@@ -506,14 +512,15 @@ int ocg_config_topo() {
}
omg_param_list.mobility_type = oai_emulation.info.omg_model_enb;
omg_param_list.nodes_type = eNB; //eNB
omg_param_list.nodes = oai_emulation.info.nb_enb_local;
omg_param_list.nodes_type = eNB; //eNB or eNB + RN
omg_param_list.nodes = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local;
omg_param_list.seed = oai_emulation.info.seed; // specific seed for enb and ue to avoid node overlapping
// at this moment, we use the above moving dynamics for mobile eNB
if (omg_param_list.nodes >0 )
init_mobility_generator(omg_param_list);
// init OMG for UE
// input of OMG: STATIC: 0, RWP: 1, RWALK 2, or TRACE 3, or SUMO
if ((oai_emulation.info.omg_model_ue = map_str_to_int(omg_model_names, oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option))== -1)
@@ -523,7 +530,7 @@ int ocg_config_topo() {
oai_emulation.info.omg_model_ue);
omg_param_list.mobility_type = oai_emulation.info.omg_model_ue;
omg_param_list.nodes_type = UE;//UE
omg_param_list.nodes = oai_emulation.info.nb_ue_local;
omg_param_list.nodes = oai_emulation.info.nb_ue_local+ oai_emulation.info.nb_rn_local;
omg_param_list.seed = oai_emulation.info.seed + oai_emulation.info.nb_ue_local; //fixme: specific seed for enb and ue to avoid node overlapping
omg_param_list.min_speed = (oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps == 0) ? 0.1 : oai_emulation.topology_config.mobility.UE_mobility.UE_moving_dynamics.min_speed_mps;
@@ -955,7 +962,8 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
}
}
} else { // OCG not used, but -T option is used, so config here
}
if ( oai_emulation.info.otg_enabled==1){ // OCG not used, but -T option is used, so config here
LOG_I(OTG,"configure OTG through options %s\n", oai_emulation.info.otg_traffic);
for (i=0; i<g_otg->num_nodes; i++){
for (j=0; j<g_otg->num_nodes; j++){
@@ -978,7 +986,7 @@ g_otg->application_idx[source_id_index][destination_id_index]+=1;
}
}
init_predef_multicast_traffic();
LOG_I(OTG,"initilizae multicast traffic \n");
LOG_I(OTG,"initilizae multicast traffic %s\n",oai_emulation.info.otg_traffic);
}
return 1;
+73 -39
View File
@@ -74,7 +74,7 @@ int td, td_avg, sleep_time_us;
// omv related info
//pid_t omv_pid;
char full_name[200];
int pfd[2]; // fd for omv : fixme: this could be a local var
extern int pfd[2]; // fd for omv : fixme: this could be a local var
char fdstr[10];
char frames[10];
char num_enb[10];
@@ -110,7 +110,7 @@ void get_simulation_options(int argc, char *argv[]) {
{NULL, 0, NULL, 0}
};
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:IJ:k:L:l:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) {
while ((c = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hi:IJ:j:k:L:l:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vVx:y:w:W:X:z:Z:", long_options, &option_index)) != -1) {
switch (c) {
case 0:
if (! strcmp(long_options[option_index].name, "pdcp_period")) {
@@ -376,13 +376,13 @@ void check_and_adjust_params() {
s32 ret;
int i,j;
if (oai_emulation.info.nb_ue_local > NUMBER_OF_UE_MAX) {
LOG_E(EMU,"Enter fewer than %d UEs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_UE_MAX);
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > NUMBER_OF_UE_MAX) {
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_UE_MAX);
exit(EXIT_FAILURE);
}
if (oai_emulation.info.nb_enb_local > NUMBER_OF_eNB_MAX) {
LOG_E(EMU,"Enter fewer than %d eNBs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_eNB_MAX);
if (oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local > NUMBER_OF_eNB_MAX) {
LOG_E(EMU,"Enter fewer than %d eNBs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_eNB_MAX);
exit(EXIT_FAILURE);
}
@@ -405,11 +405,12 @@ void check_and_adjust_params() {
if (ret < 0)
LOG_E(EMU,"[INIT] Netlink not available, careful ...\n");
if (ethernet_flag == 1) {
oai_emulation.info.master[oai_emulation.info.master_id].nb_ue = oai_emulation.info.nb_ue_local;
oai_emulation.info.master[oai_emulation.info.master_id].nb_enb = oai_emulation.info.nb_enb_local;
oai_emulation.info.master[oai_emulation.info.master_id].nb_ue = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local;
oai_emulation.info.master[oai_emulation.info.master_id].nb_enb = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local;
if (oai_emulation.info.nb_rn_local>0)
LOG_N(EMU,"Ethernet emulation is not yet tested with the relay nodes\n");
if (!oai_emulation.info.master_id)
oai_emulation.info.is_primary_master = 1;
j = 1;
@@ -428,11 +429,30 @@ void check_and_adjust_params() {
}
} // ethernet flag
//
NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote;
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
if (NB_RN_INST > 0 ) {
LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote, oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
NB_UE_INST, NB_UE_INST+NB_RN_INST);
NB_eNB_INST+=NB_RN_INST;
NB_UE_INST+=NB_RN_INST;
}
LOG_I(EMU,"Total number of UE %d (local %d, remote %d, relay %d) mobility %s \n",
NB_UE_INST,oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
}
void init_omv() {
@@ -448,9 +468,9 @@ void init_omv() {
case -1 :
perror("fork failed \n");
break;
case 0 : /* child is going to be the omv, it is the reader */
if(close(pfd[1]) == -1 ) /* we close the write desc. */
perror("close on write\n" );
case 0 : // child is going to be the omv, it is the reader
if(close(pfd[1]) == -1 ) // we close the write desc.
perror("close on write\n" );
sprintf(fdstr, "%d", pfd[0] );
sprintf(num_enb, "%d", NB_eNB_INST);
sprintf(num_ue, "%d", NB_UE_INST);
@@ -461,12 +481,12 @@ void init_omv() {
sprintf(nb_antenna, "%d", 4);
sprintf(frame_type, "%s", (oai_emulation.info.frame_type == 0) ? "FDD" : "TDD");
sprintf(tdd_config, "%d", oai_emulation.info.tdd_config);
/* execl is used to launch the visualisor */
// execl is used to launch the visualisor
execl(full_name,"OMV", fdstr, frames, num_enb, num_ue, x_area, y_area, z_area, nb_antenna, frame_type, tdd_config,NULL );
perror( "error in execl the OMV" );
}
//parent
if(close( pfd[0] ) == -1 ) /* we close the write desc. */
if(close( pfd[0] ) == -1 ) // we close the write desc.
perror("close on read\n" );
}
}
@@ -488,7 +508,7 @@ void init_openair1() {
s32 UE_id, eNB_id;
// change the nb_connected_eNB
init_lte_vars (&frame_parms, oai_emulation.info.frame_type, oai_emulation.info.tdd_config, oai_emulation.info.tdd_config_S,oai_emulation.info.extended_prefix_flag,oai_emulation.info.N_RB_DL, Nid_cell, cooperation_flag, oai_emulation.info.transmission_mode, abstraction_flag,nb_antennas_rx);
init_lte_vars (&frame_parms, oai_emulation.info.frame_type, oai_emulation.info.tdd_config, oai_emulation.info.tdd_config_S,oai_emulation.info.extended_prefix_flag,oai_emulation.info.N_RB_DL, Nid_cell, cooperation_flag, oai_emulation.info.transmission_mode, abstraction_flag,nb_antennas_rx, oai_emulation.info.eMBMS_active_state);
for (eNB_id=0; eNB_id<NB_eNB_INST;eNB_id++){
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){
@@ -566,7 +586,9 @@ void init_openair2() {
void init_ocm() {
s32 UE_id, eNB_id;
/* Added for PHY abstraction */
if (abstraction_flag) {
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n", oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
if (abstraction_flag) {
get_beta_map();
#ifdef PHY_ABSTRACTION_UL
@@ -706,16 +728,21 @@ void update_ocm() {
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
//LOG_D(OMG," extracting position of eNb...\n");
extract_position(enb_node_list, enb_data, NB_eNB_INST);
//extract_position_fixed_enb(enb_data, NB_eNB_INST,frame);
//LOG_D(OMG," extracting position of UE...\n");
// if (oai_emulation.info.omg_model_ue == TRACE)
extract_position(ue_node_list, ue_data, NB_UE_INST);
/* if (frame % 50 == 0)
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
*/
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,ShaF);
//calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,0);
UE2eNB[UE_id][eNB_id]->path_loss_dB = eNB2UE[eNB_id][UE_id]->path_loss_dB;
LOG_I(OCM,"Path loss between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
// if (frame % 50 == 0)
LOG_I(OCM,"Path loss between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
eNB2UE[eNB_id][UE_id]->path_loss_dB, eNB2UE[eNB_id][UE_id]->aoa);
}
@@ -735,7 +762,7 @@ void update_ocm() {
eNB2UE[eNB_id][UE_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
}
LOG_I(OCM,"Path loss from eNB %d to UE %d => %f dB (eNB TX %d)\n",eNB_id,UE_id,eNB2UE[eNB_id][UE_id]->path_loss_dB,
LOG_I(OCM,"Path loss from eNB %d to UE %d => %f dB (eNB TX %d)\n",eNB_id,UE_id,eNB2UE[eNB_id][UE_id]->path_loss_dB,
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
// printf("[SIM] Path loss from UE %d to eNB %d => %f dB\n",UE_id,eNB_id,UE2eNB[UE_id][eNB_id]->path_loss_dB);
}
@@ -767,6 +794,7 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
(otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH; // app could be binded to a given DRB
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 0;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
//Adding the packet to the OTG-PDCP buffer
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
@@ -787,7 +815,7 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
#ifdef Rel10
int service_id, session_id, rb_id;
// MBSM multicast traffic
// if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
// if (frame >= 50) {// only generate when UE can receive MTCH (need to control this value)
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
// LOG_I(OTG,"DUY:frame %d, pdcp_mbms_array[module_id][rb_id].instanciated_instance is %d\n",frame,pdcp_mbms_array[module_id][service_id*maxSessionPerPMCH + session_id].instanciated_instance);
@@ -801,10 +829,12 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = session_id;
(otg_pkt->otg_pkt).is_ue = 0;
//Adding the packet to the OTG-PDCP buffer
(otg_pkt->otg_pkt).mode = PDCP_TM;
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
LOG_I(EMU, "[eNB %d] ADD packet multicast to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
LOG_I(EMU, "[eNB %d] ADD packet (%p) multicast to OTG buffer for dst %d on rb_id %d\n",
(otg_pkt->otg_pkt).module_id, otg_pkt, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
} else {
//LOG_I(EMU, "OTG returns null \n");
free(otg_pkt);
@@ -861,7 +891,8 @@ void update_otg_eNB(int module_id, unsigned int ctime) {
rb_id = dst_id * NB_RB_MAX + DTCH;
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
(otg_pkt->otg_pkt).is_ue = 0;
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
//Adding the packet to the OTG-PDCP buffer
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
LOG_I(EMU, "[eNB %d] ADD pkt to OTG buffer for dst %d on rb_id %d\n", (otg_pkt->otg_pkt).module_id, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
@@ -891,24 +922,27 @@ void update_otg_UE(int UE_id, unsigned int ctime) {
src_id = module_id;
for (dst_id=0;dst_id<NUMBER_OF_eNB_MAX;dst_id++) {
if (mac_get_rrc_status(UE_id, 0/*eNB_flag*/, dst_id ) > 2 /*RRC_CONNECTED*/) {
Packet_otg_elt *otg_pkt = malloc (sizeof(Packet_otg_elt));
// Manage to add this packet to the tail of your list
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(src_id, dst_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if (mac_get_rrc_status(UE_id, 0/*eNB_flag*/, dst_id ) > 2 /*RRC_CONNECTED*/) {
Packet_otg_elt *otg_pkt = malloc (sizeof(Packet_otg_elt));
// Manage to add this packet to the tail of your list
(otg_pkt->otg_pkt).sdu_buffer = (u8*) packet_gen(src_id, dst_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id;
//Adding the packet to the OTG-PDCP buffer
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
} else {
free(otg_pkt);
otg_pkt=NULL;
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = dst_id * NB_RB_MAX + DTCH;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 1;
//Adding the packet to the OTG-PDCP buffer
(otg_pkt->otg_pkt).mode = PDCP_DATA_PDU;
pkt_list_add_tail_eurecom(otg_pkt, &(otg_pdcp_buffer[module_id]));
LOG_I(EMU, "[UE %d] ADD pkt to OTG buffer with size %d for dst %d on rb_id %d \n",
(otg_pkt->otg_pkt).module_id, otg_pkt->otg_pkt.sdu_buffer_size, (otg_pkt->otg_pkt).dst_id,(otg_pkt->otg_pkt).rb_id);
} else {
free(otg_pkt);
otg_pkt=NULL;
}
}
}
}
}
#endif
}
+30 -12
View File
@@ -69,21 +69,39 @@ void extract_position (Node_list input_node_list, node_desc_t **node_data, int n
}
}
}
void extract_position_fixed_enb (node_desc_t **node_data, int nb_nodes, u32 frame){
int i;
for (i=0;i<nb_nodes;i++) {
if (i==0) {
node_data[i]->x = 0;
node_data[i]->y = 500;
}
else if (i == 1 ){
node_data[i]->x = 866;//
node_data[i]->y = 1000;
}
else if (i == 2 ){
node_data[i]->x = 866;
node_data[i]->y = 0;
}
}
}
void extract_position_fixed_ue (node_desc_t **node_data, int nb_nodes, u32 frame){
int i;
if(frame<50)
for (i=0;i<nb_nodes;i++) {
if (i==0) {
node_data[i]->x = 2050;
node_data[i]->y = 1500;
}
else {
node_data[i]->x = 2150;
node_data[i]->y = 1500;
}
}
else
for (i=0;i<nb_nodes;i++) {
if (i==0) {
node_data[i]->x = 2050;
node_data[i]->y = 1500;
}
else {
node_data[i]->x = 2150;
node_data[i]->y = 1500;
}
}
else
{
for (i=0;i<nb_nodes;i++) {
if (i==0) {
@@ -200,7 +218,7 @@ void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_dat
//for (aarx=0; aarx<eNB2UE->nb_rx; aarx++)
*N0 = thermal_noise + ue_data->rx_noise_level;//? all the element have the same noise level?????
LOG_D(OCM,"Path loss %lf, noise %lf, signal %lf, snr %lf\n",
LOG_D(OCM,"Path loss %lf, noise (N0) %lf, signal %lf, snr %lf\n",
eNB2UE->path_loss_dB,
thermal_noise + ue_data->rx_noise_level,
enb_data->tx_power_dBm + eNB2UE->path_loss_dB,
+2
View File
@@ -109,6 +109,8 @@ def execute(oai, user, pw, logfile):
else :
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim ;')
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
time.sleep(1)
oai.send_nowait('echo '+pw+ ' | sudo -S pkill oaisim.rel8.nas;')
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile)
+10
View File
@@ -154,3 +154,13 @@ def execute(oai, user, pw, logfile):
else:
log.ok(case, test, name, conf, 'Note: check the packet loss from the OTG stats', logfile)
# try:
# test = '08'
# name = 'Run oai.rel10.phy.eMBMS.Relay.OTG.fdd'
# diag = 'eMBMS multicast/broadcast DF relaying is not working properly in fdd mode, make sure that the SIB13/MCCH/MTCH have been correclty received by UEs'
# conf = '-c43 -F -T mbvbr -Q4 -j1 -n120'
# oai.send_expect('./oaisim.rel10 ' + conf, ' MTCH for sync area 1', 100)
# except log.err, e:
# log.fail(case, test, name, conf, e.value, diag, logfile)
# else:
# log.ok(case, test, name, conf, 'Note: check the packet loss from the OTG stats', logfile)