Commit 72fd579b authored by nikaeinn's avatar nikaeinn

* fix issues related to openair traffic gen (OTG) and its statisics


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5281 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent abfde257
......@@ -581,8 +581,8 @@ boolean_t pdcp_data_ind(
(unsigned char*)&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;
src_id = (enb_flagP == ENB_FLAG_NO) ? enb_mod_idP : ue_mod_idP + NB_eNB_INST;
dst_id = (enb_flagP == ENB_FLAG_NO) ? ue_mod_idP + NB_eNB_INST: enb_mod_idP;
ctime = oai_emulation.info.time_ms; // avg current simulation time in ms : we may get the exact time through OCG?
LOG_D(PDCP, "Check received buffer : enb_flag %d rab id %d (src %d, dst %d)\n",
enb_flagP, rb_id, src_id, dst_id);
......@@ -775,15 +775,17 @@ void pdcp_run (
#if defined(USER_MODE) && defined(OAI_EMU)
pdcp_t *pdcp_p = NULL;
// add other rb_ids
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_drb_ue[ue_mod_idP][DTCH-1];
} else {
pdcp_p = &pdcp_array_drb_eNB[enb_mod_idP][ue_mod_idP][DTCH-1];
}
if (pdcp_p->instanciated_instance == TRUE )
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
int drb_id=0 ;
// add other rb_ids
for (drb_id=0; drb_id < DTCH; drb_id++) {
if (enb_flagP == ENB_FLAG_NO) {
pdcp_p = &pdcp_array_drb_ue[ue_mod_idP][drb_id];
} else {
pdcp_p = &pdcp_array_drb_eNB[enb_mod_idP][ue_mod_idP][drb_id];
}
if (pdcp_p->instanciated_instance == TRUE )
pdcp_fifo_read_input_sdus_from_otg(frameP, enb_flagP, ue_mod_idP, enb_mod_idP);
}
#endif
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
......@@ -927,7 +929,7 @@ boolean_t rrc_pdcp_config_asn1_req (
drb_toaddmod_p = drb2add_list_pP->list.array[cnt];
drb_id = drb_toaddmod_p->drb_Identity ;// + drb_id_offset;
drb_id = drb_toaddmod_p->drb_Identity;// + drb_id_offset;
lc_id = drb_id + 2;
......
......@@ -857,7 +857,7 @@ void pdcp_fifo_read_input_sdus_from_otg (frame_t frameP, eNB_flag_t enb_flagP, m
// we need to add conditions to avoid transmitting data when the UE is not RRC connected.
#if defined(USER_MODE) && defined(OAI_EMU)
if (oai_emulation.info.otg_enabled ==1 ){
module_id = (enb_flagP == 1) ? enb_mod_idP : ue_mod_idP;
module_id = (enb_flagP == 1) ? enb_mod_idP : ue_mod_idP+NB_eNB_INST;
//rb_id = (enb_flagP == 1) ? enb_mod_idP * MAX_NUM_RB + DTCH : (NB_eNB_INST + UE_index -1 ) * MAX_NUM_RB + DTCH ;
src_id = module_id;
while ((otg_pkt_info = pkt_list_remove_head(&(otg_pdcp_buffer[module_id]))) != NULL) {
......
......@@ -29,11 +29,11 @@
/*! \file otg_config.h main used structures
* \brief otg structure
* \author A. Hafsaoui
* \author A. Hafsaoui and Navid Nikaein
* \date 2011
* \version 0.1
* \company Eurecom
* \email: openair_tech@eurecom.fr
* \email: navid.nikaein@eurecom.fr
* \note
* \warning
......@@ -56,7 +56,7 @@
#define NUMBER_OF_SERVICE_MAX 2
/*!\brief Define the max number of traffic runing in the same time - using their ID in the customized traffic*/
#define MAX_EMU_TRAFFIC 100
#define MAX_EMU_TRAFFIC 10
#define OTG_FLAG_SIZE 3
#define OTG_FLAG "OTG"
......
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2011 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
*******************************************************************************/
/*! \file otg_config.h main used structures
* \brief otg structure
* \author A. Hafsaoui and Navid Nikaein
* \date 2011
* \version 0.1
* \company Eurecom
* \email: openair_tech@eurecom.fr
* \note
* \warning
*/
#include "otg_form.h"
#include "otg_vars.h"
......@@ -83,8 +123,7 @@ fl_initialize(&tArgc,tArgv,"OTG",0,0);
fl_check_forms();
}
void add_tab_metric(int src, int dst, float owd, float throughput, int ctime){
if (otg_forms_info->init_forms==0){
......
......@@ -29,11 +29,11 @@
/*! \file otg_kpi.c main used funstions to compute KPIs
* \brief define KPIs to compute for performance analysis
* \author A. Hafsaoui
* \author A. Hafsaoui and Navid Nikaein
* \date 2012
* \version 0.1
* \company Eurecom
* \email: openair_tech@eurecom.fr
* \email: navid.nikaein@eurecom.fr
* \note
* \warning
......@@ -251,7 +251,7 @@ fc=fopen("/tmp/otg.log","w");;
rx_loss_rate_pkts(i,j,k);
average_pkt_jitter(i,j,k);
//LOG_I(OTG,"KPI: (src=%d, dst=%d) NB packet TX= %d, NB packet RX= %d\n ",i, j, otg_info->tx_num_pkt[i][j], otg_info->rx_num_pkt[i][j]);
// LOG_I(OTG,"KPI: (src=%d, dst=%d, traffic=%d) NB packet TX= %d, NB packet RX= %d\n ", i, j, k,otg_info->tx_num_pkt[i][j][k], otg_info->rx_num_pkt[i][j][k]);
if (otg_multicast_info->tx_throughput[i][j]>0) {
//multicast
......
......@@ -33,7 +33,7 @@
* \date 2011
* \version 0.1
* \company Eurecom
* \email:
* \email: navid.nikaein@eurecom.fr
* \note
* \warning
*/
......@@ -75,12 +75,15 @@ 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)) &&
(otg_hdr_info_rx->size ==size )){ //data traffic
if (((otg_hdr_info_rx->flag == 0xffff) ||
(otg_hdr_info_rx->flag == 0xbbbb) ||
(otg_hdr_info_rx->flag == 0x1000)) &&
(otg_hdr_info_rx->size == size )){ //data traffic
LOG_I(OTG,"MAX_RX_INFO %d %d \n",NB_eNB_INST, NB_UE_INST);
......@@ -95,15 +98,16 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
LOG_W(OTG,"RX packet: application type out of range %d for the pair of (src %d, dst %d) \n",
otg_hdr_rx->traffic_type, src, dst);
otg_hdr_rx->traffic_type=0;
}
}
/** unicast traffic **/
if (otg_hdr_info_rx->flag == 0xffff){
seq_num_rx=otg_info->seq_num_rx[src][dst][otg_hdr_rx->traffic_type];
if (src<NB_eNB_INST)
nb_loss_pkts=otg_info->nb_loss_pkts_dl[src][dst][otg_hdr_rx->traffic_type];
else
nb_loss_pkts=otg_info->nb_loss_pkts_ul[src][dst][otg_hdr_rx->traffic_type];
}
} /** multicast traffic **/
else if (otg_hdr_info_rx->flag == 0x1000){
seq_num_rx = otg_multicast_info->rx_sn[src][dst][otg_hdr_rx->traffic_type];
nb_loss_pkts = otg_multicast_info->loss_pkts_dl[src][dst][otg_hdr_rx->traffic_type];
......@@ -114,8 +118,7 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
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;
}
} /** background traffic **/
else{
seq_num_rx=otg_info->seq_num_rx_background[src][dst];
if (src<NB_eNB_INST)
......@@ -159,6 +162,7 @@ float owd_const_application_v=owd_const_application()/2;
otg_info->rx_pkt_owd[src][dst]=otg_info->owd_const[src][dst][otg_hdr_rx->flow_id]+ otg_info->radio_access_delay[src][dst];
otg_multicast_info->rx_pkt_owd[src][dst]=otg_multicast_info->radio_access_delay[src][dst];
// compute the jitter by ignoring the packet loss
if (lost_packet == 0){
otg_info->rx_pkt_owd_history[src][dst][1] = otg_info->rx_pkt_owd_history[src][dst][0]; // the previous owd
......@@ -172,14 +176,14 @@ float owd_const_application_v=owd_const_application()/2;
src, dst, ctime, otg_info->rx_pkt_jitter[src][dst],
otg_info->rx_pkt_owd_history[src][dst][0], otg_info->rx_pkt_owd_history[src][dst][1]);
}
if (otg_hdr_info_rx->flag == 0x1000){
LOG_I(OTG,"[SRC%d -> DST %d] Received a multicast packet at time %d with size %d, seq num %d, ran owd %d number loss packet %d\n",
dst, src, ctime,otg_hdr_info_rx->size, otg_hdr_rx->seq_num, ctime - otg_hdr_rx->time, nb_loss_pkts);
LOG_I(OTG,"INFO LATENCY :: [SRC %d][DST %d] radio access %.2f (tx time %d, ctime %d), OWD:%.2f (ms):\n",
src, dst, otg_multicast_info->radio_access_delay[src][dst], otg_hdr_rx->time, ctime , otg_multicast_info->rx_pkt_owd[src][dst]);
if (otg_multicast_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]==0){
otg_multicast_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]=otg_multicast_info->rx_pkt_owd[src][dst];
otg_multicast_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type]=otg_multicast_info->rx_pkt_owd[src][dst];
......@@ -188,12 +192,14 @@ float owd_const_application_v=owd_const_application()/2;
otg_multicast_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]=MAX(otg_multicast_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type],otg_multicast_info->rx_pkt_owd[src][dst] );
otg_multicast_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type]=MIN(otg_multicast_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type],otg_multicast_info->rx_pkt_owd[src][dst] );
}
if (g_otg->curve==1){
if (g_otg->owd_radio_access==0)
add_tab_metric(src, dst, otg_multicast_info->rx_pkt_owd[src][dst], ((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src][dst]*1024 )), otg_hdr_rx->time);
else
add_tab_metric(src, dst, otg_multicast_info->radio_access_delay[src][dst], ((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src][dst]*1024 )), otg_hdr_rx->time);
}
}
otg_multicast_info->rx_total_bytes_dl+=otg_hdr_info_rx->size;
}
else {
......@@ -242,9 +248,10 @@ float owd_const_application_v=owd_const_application()/2;
//LOG_I(OTG,"RX INFO :: RTT MIN(one way) ms: %.2f, RTT MAX(one way) ms: %.2f \n", otg_info->rx_owd_min[src][dst], otg_info->rx_owd_max[src][dst]);
/* xforms part: add metrics */
//printf("payload_size %d, header_size %d \n", otg_hdr_rx->pkts_size, otg_hdr_rx->hdr_type);
LOG_I(OTG,"[RX] OTG packet, PACKET SIZE [SRC %d][DST %d]: Flag (0x%x), time(%d), Seq num (%d), Total size (%d)\n", src, dst, otg_hdr_info_rx->flag, ctime, otg_hdr_rx->seq_num, size);
LOG_I(OTG,"[RX] OTG packet, PACKET SIZE [SRC %d][DST %d]: Flag (0x%x), Traffic %d, time(%d), Seq num (%d), Total size (%d)\n",
src, dst, otg_hdr_info_rx->flag, otg_hdr_rx->traffic_type, ctime, otg_hdr_rx->seq_num, size);
/*LOG_I(OTG,"details::RX [SRC %d][DST %d]: Flag (0x%x), time(%d), Seq num (%d), Total size (%d), header(%d), payload (%d) \n", src, dst, otg_hdr_info_rx->flag, ctime, otg_hdr_rx->seq_num, size, strlen(packet_rx->header), strlen(packet_rx->payload));*/
......
......@@ -253,8 +253,9 @@ Send Packets when:
if (size!=strlen(payload))
LOG_E(OTG,"[%d][%d] [0x %x] The expected packet size does not match the payload size : size %d, strlen %d, seq_num %d packet: |%s|%s| \n", src, dst, flag, size, strlen(payload), seq_num, header, payload);
else
LOG_D(OTG,"[%d][%d] [0x %x] [m2m Aggre %d] [Flow %d]TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d, state=%d : |%s|%s| \n", src, dst, flag, otg_info->m2m_aggregation[src][dst],otg_info->flow_id[src][dst], ctime, size, header_size+strlen(payload), seq_num,state, header, payload);
LOG_D(OTG, "[%d]MY_SEQ %d \n", otg_info->traffic_type[src][dst], otg_info->seq_num[src][dst][otg_info->traffic_type[src][dst]] );
LOG_D(OTG,"[%d][%d] 0x %x][m2m Aggre %d][Flow %d][Type %d] TX INFO pkt at time %d Size= [payload %d] [Total %d] with seq num %d, state=%d : |%s|%s| \n", src, dst, flag, otg_info->m2m_aggregation[src][dst],otg_info->flow_id[src][dst],
otg_info->traffic_type[src][dst], ctime, size, header_size+strlen(payload), seq_num,state, header, payload);
LOG_D(OTG, "[%d]MY_SEQ %d \n", otg_info->traffic_type[src][dst], otg_info->seq_num[src][dst][otg_info->traffic_type[src][dst]] );
}
else {
if ((g_otg->aggregation_level[src][dst][application]*otg_info->size_background[src][dst])<=PAYLOAD_MAX)
......
......@@ -205,7 +205,7 @@ void help(void) {
printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n");
printf ("-S snir_dB set a fixed (average) SNIR, this deactivates the openair channel model generator (OCM)\n");
printf ("-t Gives a fixed UL mcs for eNB scheduler\n");
printf ("-T activate the traffic generator: cbr, mcbr, bcbr, mscbr\n");
printf ("-T activate the traffic generator: cbr, scbr, mcbr, bcbr, mscbr\n");
printf ("-u Set the number of local UE\n");
printf ("-U Set the mobility model for UE, options are: STATIC, RWP, RWALK\n");
printf ("-V [vcd_file] Enable VCD dump into vcd_file\n");
......
......@@ -1055,7 +1055,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) {
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
otg_times += 1;
(otg_pkt->otg_pkt).rb_id = DTCH; // app could be binded to a given DRB
(otg_pkt->otg_pkt).rb_id = DTCH-2; // app could be binded to a given DRB
(otg_pkt->otg_pkt).module_id = enb_module_idP;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 0;
......@@ -1145,7 +1145,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
(otg_pkt->otg_pkt).sdu_buffer = packet_gen(module_instP, dst_id, ctime, &pkt_size);
if (otg_pkt != NULL) {
rb_id = dst_id * NB_RB_MAX + DTCH;
rb_id = DTCH-2;
(otg_pkt->otg_pkt).rb_id = rb_id;
(otg_pkt->otg_pkt).module_id = module_idP;
(otg_pkt->otg_pkt).is_ue = FALSE;
......@@ -1184,7 +1184,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime) {
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, 0, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
(otg_pkt->otg_pkt).rb_id = DTCH;
(otg_pkt->otg_pkt).rb_id = DTCH-2;
(otg_pkt->otg_pkt).module_id = module_id;
(otg_pkt->otg_pkt).dst_id = dst_id;
(otg_pkt->otg_pkt).is_ue = 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