Commit 8154c8fb authored by Navid Nikaein's avatar Navid Nikaein

fix OTG issues in oaisim without s1

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7526 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ebd95c5b
...@@ -754,7 +754,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP) ...@@ -754,7 +754,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
ctxt_pP->subframe, ctxt_pP->subframe,
src_id); src_id);
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", LOG_D(OTG,"[eNB %d] Frame %d sending packet %d from module %d on rab id %d (src %d, dst %d/%x) pkt size %d for pdcp mode %d\n",
ctxt.module_id, ctxt.module_id,
ctxt.frame, ctxt.frame,
pkt_cnt_enb++, pkt_cnt_enb++,
...@@ -762,6 +762,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP) ...@@ -762,6 +762,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
rb_id, rb_id,
src_id, src_id,
dst_id, dst_id,
oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id][dst_id],
pkt_size, pkt_size,
pdcp_mode); pdcp_mode);
result = pdcp_data_req(&ctxt, result = pdcp_data_req(&ctxt,
...@@ -779,20 +780,21 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP) ...@@ -779,20 +780,21 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t* const ctxt_pP)
//rb_id= eNB_index * MAX_NUM_RB + DTCH; //rb_id= eNB_index * MAX_NUM_RB + DTCH;
LOG_D(OTG,"[UE %d] Frame %d: sending packet %d from module %d on rab id %d (src %d, dst %d) pkt size %d\n", LOG_D(OTG,"[UE %d] Frame %d: sending packet %d from module %d on rab id %d (src %d/%x, dst %d) pkt size %d\n",
ctxt_pP->module_id, ctxt_pP->module_id,
ctxt_pP->frame, ctxt_pP->frame,
pkt_cnt_ue++, pkt_cnt_ue++,
ctxt_pP->module_id, ctxt_pP->module_id,
rb_id, rb_id,
ctxt_pP->module_id, src_id,
pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id], // [src_id]
dst_id, dst_id,
pkt_size); pkt_size);
PROTOCOL_CTXT_SET_BY_MODULE_ID( PROTOCOL_CTXT_SET_BY_MODULE_ID(
&ctxt, &ctxt,
src_id, ctxt_pP->module_id, //src_id,
ENB_FLAG_NO, ENB_FLAG_NO,
pdcp_UE_UE_module_id_to_rnti[src_id], pdcp_UE_UE_module_id_to_rnti[ctxt_pP->module_id],// [src_id]
ctxt_pP->frame, ctxt_pP->frame,
ctxt_pP->subframe, ctxt_pP->subframe,
dst_id); dst_id);
......
...@@ -54,9 +54,20 @@ extern unsigned char NB_UE_INST; ...@@ -54,9 +54,20 @@ extern unsigned char NB_UE_INST;
void tx_throughput(int src, int dst, int application) void tx_throughput(int src, int dst, int application)
{ {
if (otg_info->tx_num_bytes[src][dst][application]>0) if (otg_info->tx_num_bytes[src][dst][application]>0) {
otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ (get_ctime()*1024); // unit Kbit/sec, if ctime in ms // otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ (get_ctime()*1024); // unit Kbit/sec, if ctime in ms
if ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][application]) < get_ctime() )
otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][application])*1024); // unit Kbit/sec, if ctime in ms
else if (g_otg->flow_start[src][dst][application] < get_ctime() )
otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
else
LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
src, dst, application,
g_otg->flow_start[src][dst][application],
g_otg->flow_duration[src][dst][application],
get_ctime());
}
if (otg_info->tx_num_bytes_background[src][dst]>0) if (otg_info->tx_num_bytes_background[src][dst]>0)
otg_info->tx_throughput_background[src][dst]=((double)otg_info->tx_num_bytes_background[src][dst]*1000*8)/ (get_ctime()*1024); // unit Kbit/sec, if ctime in ms otg_info->tx_throughput_background[src][dst]=((double)otg_info->tx_num_bytes_background[src][dst]*1000*8)/ (get_ctime()*1024); // unit Kbit/sec, if ctime in ms
...@@ -76,8 +87,19 @@ void tx_throughput(int src, int dst, int application) ...@@ -76,8 +87,19 @@ void tx_throughput(int src, int dst, int application)
void rx_goodput(int src, int dst, int application) void rx_goodput(int src, int dst, int application)
{ {
if (otg_info->rx_num_bytes[src][dst][application]>0) if (otg_info->rx_num_bytes[src][dst][application]>0) {
otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application]*1000*8)/(get_ctime()*1024); // unit kB/sec, if ctime in ms // otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application]*1000*8)/(get_ctime()*1024); // unit kB/sec, if ctime in ms
if ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][application]) < get_ctime() )
otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application] *1000*8)/ ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][application])*1024); // unit Kbit/sec, if ctime in ms
else if (g_otg->flow_start[src][dst][application] < get_ctime() )
otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
else
LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
src, dst, application,
g_otg->flow_start[src][dst][application],
g_otg->flow_duration[src][dst][application],
get_ctime());
}
if (otg_info->rx_num_bytes_background[src][dst]>0) if (otg_info->rx_num_bytes_background[src][dst]>0)
otg_info->rx_goodput_background[src][dst]=((double)otg_info->rx_num_bytes_background[src][dst] *1000*8)/(get_ctime()*1024); // unit kB/sec, if ctime in ms otg_info->rx_goodput_background[src][dst]=((double)otg_info->rx_num_bytes_background[src][dst] *1000*8)/(get_ctime()*1024); // unit kB/sec, if ctime in ms
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<FADING> <FADING>
<LARGE_SCALE>urban</LARGE_SCALE> <LARGE_SCALE>urban</LARGE_SCALE>
<FREE_SPACE_MODEL_PARAMETERS> <FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT> <PATHLOSS_EXPONENT>2.67</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-128</PATHLOSS_0_dB><!--pathloss at 1km --> <PATHLOSS_0_dB>-100</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS> </FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>AWGN</SMALL_SCALE> <SMALL_SCALE>AWGN</SMALL_SCALE>
</FADING> </FADING>
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
<TOPOLOGY_CONFIG> <TOPOLOGY_CONFIG>
<AREA> <AREA>
<X_m>500</X_m> <X_m>1000</X_m>
<Y_m>500</Y_m> <Y_m>1000</Y_m>
</AREA> </AREA>
<MOBILITY> <MOBILITY>
<UE_MOBILITY> <UE_MOBILITY>
...@@ -38,14 +38,12 @@ ...@@ -38,14 +38,12 @@
<RANDOM_UE_DISTRIBUTION> <RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>2</NUMBER_OF_NODES> <NUMBER_OF_NODES>2</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION> </RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>STATIC</UE_MOBILITY_TYPE> <UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE>
<UE_MOVING_DYNAMICS> <UE_MOVING_DYNAMICS>
<MIN_SPEED_mps>1</MIN_SPEED_mps> <MIN_SPEED_mps>1</MIN_SPEED_mps>
<MAX_SPEED_mps>200</MAX_SPEED_mps> <MAX_SPEED_mps>2</MAX_SPEED_mps>
<MIN_SLEEP_ms>0.1</MIN_SLEEP_ms> <MIN_SLEEP_ms>0.1</MIN_SLEEP_ms>
<MAX_SLEEP_ms>5.0</MAX_SLEEP_ms> <MAX_SLEEP_ms>15.0</MAX_SLEEP_ms>
<MIN_JOURNEY_TIME_ms>0.1</MIN_JOURNEY_TIME_ms>
<MAX_JOURNEY_TIME_ms>10</MAX_JOURNEY_TIME_ms>
</UE_MOVING_DYNAMICS> </UE_MOVING_DYNAMICS>
</UE_MOBILITY> </UE_MOBILITY>
<eNB_MOBILITY> <eNB_MOBILITY>
...@@ -61,32 +59,46 @@ ...@@ -61,32 +59,46 @@
<APPLICATION_CONFIG> <APPLICATION_CONFIG>
<PREDEFINED_TRAFFIC> <PREDEFINED_TRAFFIC>
<SOURCE_ID>0</SOURCE_ID> <!-- valid formats are: --> <SOURCE_ID>0</SOURCE_ID>
<APPLICATION_TYPE>scbr</APPLICATION_TYPE> <!-- OPTIONS: scbr,mcbr,bcbr, gaming_OA, gaming_TF, m2m_AP, m2m_BR, , random, ,full_buffer --> <APPLICATION_TYPE>mcbr</APPLICATION_TYPE>
<DESTINATION_ID>1:2</DESTINATION_ID> <!-- valid formats are: --> <DESTINATION_ID>1:2</DESTINATION_ID>
</PREDEFINED_TRAFFIC> <FLOW_START_ms>100</FLOW_START_ms>
<PREDEFINED_TRAFFIC> <FLOW_DURATION_ms>6000</FLOW_DURATION_ms>
<SOURCE_ID>1:2</SOURCE_ID> <!-- valid formats are: -->
<APPLICATION_TYPE>scbr</APPLICATION_TYPE> <!-- OPTIONS: scbr,mcbr,bcbr, gaming_OA, gaming_TF, m2m_AP, m2m_BR, , random, ,full_buffer -->
<DESTINATION_ID>0</DESTINATION_ID> <!-- valid formats are: -->
</PREDEFINED_TRAFFIC> </PREDEFINED_TRAFFIC>
<CUSTOMIZED_TRAFFIC>
<SOURCE_ID>1:2</SOURCE_ID>
<TRANSPORT_PROTOCOL>udp</TRANSPORT_PROTOCOL>
<FLOW_START_ms>100</FLOW_START_ms>
<FLOW_DURATION_ms>6000</FLOW_DURATION_ms>
<IP_VERSION>ipv4</IP_VERSION>
<DESTINATION_ID>0</DESTINATION_ID>
<IDT_DIST>uniform</IDT_DIST>
<IDT_MIN_ms>10</IDT_MIN_ms>
<IDT_MAX_ms>100</IDT_MAX_ms>
<SIZE_DIST>uniform</SIZE_DIST>
<SIZE_MIN_byte>64</SIZE_MIN_byte>
<SIZE_MAX_byte>1024</SIZE_MAX_byte>
</CUSTOMIZED_TRAFFIC>
</APPLICATION_CONFIG> </APPLICATION_CONFIG>
<EMULATION_CONFIG> <EMULATION_CONFIG>
<EMULATION_TIME_ms>10000</EMULATION_TIME_ms> <!--set to infinity--> <EMULATION_TIME_ms>10000</EMULATION_TIME_ms> <!--set to infinity-->
<CURVE>disable</CURVE>
<PERFORMANCE_METRICS> <PERFORMANCE_METRICS>
<THROUGHPUT>1</THROUGHPUT> <THROUGHPUT>enable</THROUGHPUT>
<LATENCY>enable</LATENCY>
<LOSS_RATE>enable</LOSS_RATE>
</PERFORMANCE_METRICS> </PERFORMANCE_METRICS>
<LOG> <!-- set the global log level --> <LOG> <!-- set the global log level -->
<LEVEL>debug</LEVEL> <LEVEL>info</LEVEL>
<VERBOSITY>medium</VERBOSITY> <!-- low, medium, high, full --> <VERBOSITY>low</VERBOSITY>
<INTERVAL>1</INTERVAL> </LOG>
</LOG>
<SEED_VALUE>0</SEED_VALUE> <!-- value 0 means randomly generated by OAI --> <SEED_VALUE>0</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
</EMULATION_CONFIG> </EMULATION_CONFIG>
<PROFILE>OCM_OMG</PROFILE> <PROFILE>OCM_OMG_OTG</PROFILE>
</OAI_EMULATION> </OAI_EMULATION>
...@@ -1198,10 +1198,7 @@ l2l1_task (void *args_p) ...@@ -1198,10 +1198,7 @@ l2l1_task (void *args_p)
//end of frame //end of frame
stop_meas (&oaisim_stats); stop_meas (&oaisim_stats);
oai_shutdown ();
#if defined(ENABLE_ITTI)
itti_terminate_tasks(TASK_L2L1);
#endif
#ifdef PRINT_STATS #ifdef PRINT_STATS
...@@ -1226,6 +1223,10 @@ l2l1_task (void *args_p) ...@@ -1226,6 +1223,10 @@ l2l1_task (void *args_p)
#endif #endif
#if defined(ENABLE_ITTI)
itti_terminate_tasks(TASK_L2L1);
#endif
return NULL; return NULL;
} }
...@@ -1364,7 +1365,7 @@ main (int argc, char **argv) ...@@ -1364,7 +1365,7 @@ main (int argc, char **argv)
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
raise (SIGINT); raise (SIGINT);
oai_shutdown (); // oai_shutdown ();
return (0); return (0);
} }
...@@ -1808,9 +1809,10 @@ oai_shutdown (void) ...@@ -1808,9 +1809,10 @@ oai_shutdown (void)
#endif #endif
//Perform KPI measurements //Perform KPI measurements
if (oai_emulation.info.otg_enabled == 1) if (oai_emulation.info.otg_enabled == 1){
LOG_N(EMU,"calling OTG kpi gen .... \n");
kpi_gen (); kpi_gen ();
}
if (oai_emulation.info.opp_enabled == 1) if (oai_emulation.info.opp_enabled == 1)
print_opp_meas (); print_opp_meas ();
......
...@@ -450,14 +450,14 @@ int olg_config(void) ...@@ -450,14 +450,14 @@ int olg_config(void)
//set_log(OCM, LOG_INFO, 20); //set_log(OCM, LOG_INFO, 20);
//set_log(OTG, LOG_INFO, 1); //set_log(OTG, LOG_INFO, 1);
set_comp_log(OCG, LOG_ERR, 0x15,1); set_comp_log(OCG, LOG_ERR, 0x15,1);
set_comp_log(EMU, LOG_ERR, 0x15,20); set_comp_log(EMU, LOG_DEBUG, 0x15,20);
set_comp_log(MAC, LOG_TRACE, 0x15,1); set_comp_log(MAC, LOG_TRACE, 0x15,1);
set_comp_log(RLC, LOG_TRACE, 0x15,1); set_comp_log(RLC, LOG_TRACE, 0x15,1);
set_comp_log(PHY, LOG_TRACE, 0x15, 1); set_comp_log(PHY, LOG_TRACE, 0x15, 1);
set_comp_log(PDCP, LOG_DEBUG, 0x15,1); set_comp_log(PDCP, LOG_DEBUG, 0x15,1);
set_comp_log(RRC, LOG_DEBUG, 0x15,1); set_comp_log(RRC, LOG_DEBUG, 0x15,1);
set_comp_log(OCM, LOG_ERR, 0x15,20); set_comp_log(OCM, LOG_ERR, 0x15,20);
set_comp_log(OTG, LOG_INFO, 0x15,1); set_comp_log(OTG, LOG_DEBUG, 0x15,1);
set_comp_log(OMG, LOG_INFO, 0x15,1); set_comp_log(OMG, LOG_INFO, 0x15,1);
set_comp_log(OPT, LOG_ERR, 0x15,1); set_comp_log(OPT, LOG_ERR, 0x15,1);
......
...@@ -1268,6 +1268,8 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) ...@@ -1268,6 +1268,8 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
{ {
#if defined(USER_MODE) && defined(OAI_EMU) #if defined(USER_MODE) && defined(OAI_EMU)
int rrc_state=0;
if (oai_emulation.info.otg_enabled ==1 ) { if (oai_emulation.info.otg_enabled ==1 ) {
int dst_id, app_id; int dst_id, app_id;
...@@ -1277,9 +1279,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) ...@@ -1277,9 +1279,11 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
for_times += 1; for_times += 1;
// generate traffic if the ue is rrc reconfigured state // generate traffic if the ue is rrc reconfigured state
if (mac_eNB_get_rrc_status(enb_module_idP, dst_id) > 2 /*RRC_CONNECTED*/ ) { //if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) {
if_times += 1; if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
if_times += 1;
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) { for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t)); otg_pkt = malloc (sizeof(Packet_otg_elt_t));
......
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