branch LG_PRE_RELEASE_0.3 reintegration
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7117 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -25,18 +25,18 @@
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file otg_defs.h main used structures
|
||||
* \brief otg structure
|
||||
* \author N. Nikaein and A. Hafsaoui
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
* \brief otg structure
|
||||
* \author N. Nikaein and A. Hafsaoui
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __OTG_DEFS_H__
|
||||
# define __OTG_DEFS_H__
|
||||
@@ -52,12 +52,12 @@
|
||||
#include "otg_config.h"
|
||||
|
||||
/**
|
||||
* \enum Application
|
||||
* \brief OTG applications type
|
||||
*
|
||||
*
|
||||
* Application describes the class of traffic supported and can be pre-configured bu otg_tx
|
||||
*/
|
||||
* \enum Application
|
||||
* \brief OTG applications type
|
||||
*
|
||||
*
|
||||
* Application describes the class of traffic supported and can be pre-configured bu otg_tx
|
||||
*/
|
||||
typedef enum {
|
||||
NO_PREDEFINED_MULTICAST_TRAFFIC =0,
|
||||
MSCBR,
|
||||
@@ -70,12 +70,12 @@ typedef enum {
|
||||
} Multicast_Application;
|
||||
|
||||
/**
|
||||
* \enum Application
|
||||
* \brief OTG applications type
|
||||
*
|
||||
*
|
||||
* Application describes the class of traffic supported and can be pre-configured bu otg_tx
|
||||
*/
|
||||
* \enum Application
|
||||
* \brief OTG applications type
|
||||
*
|
||||
*
|
||||
* Application describes the class of traffic supported and can be pre-configured bu otg_tx
|
||||
*/
|
||||
typedef enum {
|
||||
NO_PREDEFINED_TRAFFIC =0,
|
||||
M2M, // 1
|
||||
@@ -118,12 +118,12 @@ typedef enum {
|
||||
|
||||
|
||||
/**
|
||||
* \enum dist_type
|
||||
* \brief OTG implemented distribution for packet and inter departure time computation
|
||||
*
|
||||
*
|
||||
* dist_type presents the used distribition to generate inter departure time and packet size
|
||||
*/
|
||||
* \enum dist_type
|
||||
* \brief OTG implemented distribution for packet and inter departure time computation
|
||||
*
|
||||
*
|
||||
* dist_type presents the used distribition to generate inter departure time and packet size
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
NO_TRAFFIC=0,
|
||||
@@ -144,12 +144,12 @@ typedef enum {
|
||||
|
||||
|
||||
/**
|
||||
* \enum trans_proto
|
||||
*
|
||||
* \brief trans_proto enmerates used transport protocol
|
||||
*
|
||||
*
|
||||
*/
|
||||
* \enum trans_proto
|
||||
*
|
||||
* \brief trans_proto enmerates used transport protocol
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
NO_PROTO=0,
|
||||
@@ -159,11 +159,11 @@ typedef enum {
|
||||
|
||||
|
||||
/**
|
||||
* \enum ip_v
|
||||
*
|
||||
*\brief ip_v presents the used IP version to generate the packet
|
||||
*
|
||||
*/
|
||||
* \enum ip_v
|
||||
*
|
||||
*\brief ip_v presents the used IP version to generate the packet
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
NO_IP=0,
|
||||
IPV4=1,
|
||||
@@ -171,11 +171,11 @@ typedef enum {
|
||||
} ip_v;
|
||||
|
||||
/**
|
||||
* \enum ip_v
|
||||
*
|
||||
*\brief ip_v presents the used IP version to generate the packet
|
||||
*
|
||||
*/
|
||||
* \enum ip_v
|
||||
*
|
||||
*\brief ip_v presents the used IP version to generate the packet
|
||||
*
|
||||
*/
|
||||
/*
|
||||
typedef enum {
|
||||
OFF_STATE=0,
|
||||
@@ -183,7 +183,7 @@ typedef enum {
|
||||
ACTIVE_STATE,
|
||||
MAX_NUM_STATE,
|
||||
}TRAFFIC_STATE;
|
||||
*/
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
OFF_STATE=0,
|
||||
@@ -198,11 +198,11 @@ typedef enum {
|
||||
} VOIP_STATE;
|
||||
|
||||
/**
|
||||
* \enum ALPHABET
|
||||
*
|
||||
*\brief ALPHABET Alphabet type to generate random string
|
||||
*
|
||||
*/
|
||||
* \enum ALPHABET
|
||||
*
|
||||
*\brief ALPHABET Alphabet type to generate random string
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
REPEAT_STRING=0, // repeat the same set of characters
|
||||
SUBSTRACT_STRING, // substract the string from the know character string
|
||||
@@ -217,11 +217,11 @@ typedef enum {
|
||||
|
||||
|
||||
/**
|
||||
* \enum HEADER_TYPE
|
||||
*
|
||||
* \brief HEADER_TYPE alows to identify the transport protocol and IP version
|
||||
*
|
||||
*/
|
||||
* \enum HEADER_TYPE
|
||||
*
|
||||
* \brief HEADER_TYPE alows to identify the transport protocol and IP version
|
||||
*
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
NO_HEADER=0,
|
||||
@@ -232,18 +232,18 @@ typedef enum {
|
||||
} HEADER_TYPE;
|
||||
|
||||
/**
|
||||
* \enum TRAFFIC_TYPE
|
||||
*
|
||||
* \brief HEADER_TYPE alows to identify the traffic type no specific type, m2m,etc.
|
||||
*
|
||||
*/
|
||||
* \enum TRAFFIC_TYPE
|
||||
*
|
||||
* \brief HEADER_TYPE alows to identify the traffic type no specific type, m2m,etc.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
typedef enum {
|
||||
NO_TYPE=0,
|
||||
M2M_TYPE,
|
||||
}TRAFFIC_TYPE;
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@@ -339,11 +339,11 @@ typedef struct {
|
||||
|
||||
|
||||
/**
|
||||
* \struct otg_t
|
||||
*
|
||||
*\brief otg_t define the traffic generator global parameters, it include a matrix of nodes (source, destination and state) parameters
|
||||
*
|
||||
*/
|
||||
* \struct otg_t
|
||||
*
|
||||
*\brief otg_t define the traffic generator global parameters, it include a matrix of nodes (source, destination and state) parameters
|
||||
*
|
||||
*/
|
||||
typedef struct {
|
||||
int max_nb_frames; /*!< \brief Max Number of frames*/
|
||||
int application_type[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_NUM_APPLICATION]; /*!\brief It identify the application of the simulated traffic, could be cbr, m2m, gaming,etc*/
|
||||
@@ -425,14 +425,16 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
|
||||
unsigned char flow_id; /*!< \brief It identify the flow ID (we can have source and destination with several flows) */
|
||||
unsigned int time; /*!< \brief simulation time at the tx, this is ctime */
|
||||
unsigned int seq_num; /*!< \brief Sequence Number, counter of data packets between tx and rx */
|
||||
unsigned char state; /*!< \brief state of node : on, off, or active */
|
||||
unsigned char hdr_type; /*!< \brief Header type: tcp/udp vs ipv4/ipv6 */
|
||||
unsigned char flow_id; /*!< \brief It identify the flow ID (we can have source and destination with several flows) */
|
||||
unsigned int time; /*!< \brief simulation time at the tx, this is ctime */
|
||||
unsigned int seq_num; /*!< \brief Sequence Number, counter of data packets between tx and rx */
|
||||
unsigned char state; /*!< \brief state of node : on, off, or active */
|
||||
unsigned char hdr_type; /*!< \brief Header type: tcp/udp vs ipv4/ipv6 */
|
||||
unsigned char src_instance; /*!< \brief traffic source instance */
|
||||
unsigned char dst_instance; /*!< \brief traffic destination instance */
|
||||
unsigned short pkts_size; /*!< \brief the size of payload + header */
|
||||
unsigned short aggregation_level; /*!< \brief packet aggregation level */
|
||||
unsigned int traffic_type; /*!< \brief to specify if it corresponds to an m2m traffic */
|
||||
unsigned short aggregation_level;/*!< \brief packet aggregation level */
|
||||
unsigned int traffic_type; /*!< \brief to specify if it corresponds to an m2m traffic */
|
||||
//int payload_size; /*!< \brief the size of the payload to transmit */
|
||||
//int header_size; /*!< \brief Header type: tcp/udp vs ipv4/ipv6 */
|
||||
} __attribute__((__packed__)) otg_hdr_t;
|
||||
@@ -444,12 +446,12 @@ typedef struct {
|
||||
|
||||
|
||||
/**
|
||||
* \struct packet_t
|
||||
*
|
||||
* \brief packet_t corresponds to the global structure of the generated packet
|
||||
*
|
||||
*
|
||||
*/
|
||||
* \struct packet_t
|
||||
*
|
||||
* \brief packet_t corresponds to the global structure of the generated packet
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -500,11 +502,11 @@ typedef struct {
|
||||
|
||||
|
||||
/**
|
||||
* \struct packet_t
|
||||
*
|
||||
* \brief The OTG information and KPI of the simulation structure
|
||||
*
|
||||
*/
|
||||
* \struct packet_t
|
||||
*
|
||||
* \brief The OTG information and KPI of the simulation structure
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/*!< \brief info part: */
|
||||
@@ -536,9 +538,9 @@ typedef struct {
|
||||
float rx_owd_min_e2e[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay min*/
|
||||
float rx_owd_max_e2e[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay max*/
|
||||
float rx_pkt_owd_history[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][2]; /*!< \brief One way delay histoy used for jitter calculation: rx_ctime - tx_ctime, [2] to keep the owd for the current and previous pkt */
|
||||
float rx_pkt_owd_history_e2e[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][2]; /*!< \brief One way delay histoy used for jitter calculation: rx_ctime - tx_ctime, [2] to keep the owd for the current and previous pkt */
|
||||
float rx_pkt_owd_history_e2e[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][2]; /*!< \brief One way delay histoy used for jitter calculation: rx_ctime - tx_ctime, [2] to keep the owd for the current and previous pkt */
|
||||
float rx_pkt_jitter[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; /*!< \brief One way delay: rx_ctime - tx_ctime */
|
||||
float rx_jitter_min[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay min*/
|
||||
float rx_jitter_min[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay min*/
|
||||
float rx_jitter_max[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay max*/
|
||||
float rx_jitter_avg[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][MAX_EMU_TRAFFIC]; /*!< \brief One way delay max*/
|
||||
float rx_pkt_jitter_e2e[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX]; /*!< \brief One way delay: rx_ctime - tx_ctime */
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "otg_models.h"
|
||||
#include "UTIL/LOG/log.h"
|
||||
|
||||
double backgroundRateRnd(void);
|
||||
|
||||
|
||||
/*all the TARMA stuff:
|
||||
|
||||
+247
-139
@@ -25,18 +25,18 @@
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
*******************************************************************************/
|
||||
|
||||
/*! \file otg_rx.c
|
||||
* \brief function containing the OTG traffic generation functions
|
||||
* \author Navid Nikaein and A. Hafsaoui
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
* \brief function containing the OTG traffic generation functions
|
||||
* \author Navid Nikaein and A. Hafsaoui
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "otg_rx.h"
|
||||
#include "otg_externs.h"
|
||||
@@ -61,23 +61,28 @@ extern unsigned char NB_UE_INST;
|
||||
|
||||
|
||||
// Check if the packet is well received or not and extract data
|
||||
int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buffer_tx, const unsigned int size)
|
||||
{
|
||||
|
||||
int bytes_read=0;
|
||||
int bytes_read = 0;
|
||||
otg_hdr_info_t * otg_hdr_info_rx;
|
||||
otg_hdr_t * otg_hdr_rx;
|
||||
int is_size_ok=0;
|
||||
unsigned int seq_num_rx;
|
||||
unsigned int nb_loss_pkts;
|
||||
unsigned int lost_packet=0;
|
||||
otg_hdr_t * otg_hdr_rx;
|
||||
int is_size_ok = 0;
|
||||
unsigned int seq_num_rx;
|
||||
unsigned int nb_loss_pkts;
|
||||
unsigned int lost_packet = 0;
|
||||
unsigned int src_instance;
|
||||
unsigned int dst_instance;
|
||||
|
||||
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);
|
||||
LOG_D(OTG,"otg_rx_pkt functions: destination %d, size %d, otg_hdr_info_rx->flag %.4x, otg_hdr_info_rx->size %d \n",
|
||||
dst_instanceP,
|
||||
size,
|
||||
otg_hdr_info_rx->flag,
|
||||
otg_hdr_info_rx->size);
|
||||
|
||||
|
||||
if (((otg_hdr_info_rx->flag == 0xffff) ||
|
||||
@@ -91,55 +96,79 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
if (( otg_hdr_info_rx->size ) == size ) {*/
|
||||
is_size_ok= 1;
|
||||
otg_hdr_rx = (otg_hdr_t *) (&buffer_tx[bytes_read]);
|
||||
LOG_I(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) \n", src, dst,otg_hdr_rx->flow_id,
|
||||
otg_hdr_rx->traffic_type, ctime, otg_hdr_info_rx->flag, otg_hdr_rx->seq_num, otg_hdr_rx->time, otg_hdr_info_rx->size, size);
|
||||
LOG_I(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) \n",
|
||||
otg_hdr_rx->src_instance,
|
||||
otg_hdr_rx->dst_instance,
|
||||
otg_hdr_rx->flow_id,
|
||||
otg_hdr_rx->traffic_type,
|
||||
ctime,
|
||||
otg_hdr_info_rx->flag,
|
||||
otg_hdr_rx->seq_num,
|
||||
otg_hdr_rx->time,
|
||||
otg_hdr_info_rx->size, size);
|
||||
|
||||
bytes_read += sizeof (otg_hdr_t);
|
||||
|
||||
src_instance = otg_hdr_rx->src_instance;
|
||||
dst_instance = otg_hdr_rx->dst_instance;
|
||||
|
||||
if (dst_instance != dst_instanceP) {
|
||||
#warning "LG: TODO think about multicast traffic"
|
||||
LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d) not for dest instance %u\n",
|
||||
dst_instanceP);
|
||||
}
|
||||
|
||||
if(otg_hdr_rx->traffic_type > MAX_NUM_APPLICATION) {
|
||||
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, src_instance, dst_instance);
|
||||
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];
|
||||
seq_num_rx=otg_info->seq_num_rx[src_instance][dst_instance][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];
|
||||
if (src_instance<NB_eNB_INST)
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_dl[src_instance][dst_instance][otg_hdr_rx->traffic_type];
|
||||
else
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_ul[src][dst][otg_hdr_rx->traffic_type];
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_ul[src_instance][dst_instance][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];
|
||||
// otg_multicast_info->ran_owd[src][dst][otg_hdr_rx->traffic_type] = ctime- otg_hdr_rx->time;
|
||||
// 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;
|
||||
seq_num_rx = otg_multicast_info->rx_sn[src_instance][dst_instance][otg_hdr_rx->traffic_type];
|
||||
nb_loss_pkts = otg_multicast_info->loss_pkts_dl[src_instance][dst_instance][otg_hdr_rx->traffic_type];
|
||||
// otg_multicast_info->ran_owd[src_instance][dst_instance][otg_hdr_rx->traffic_type] = ctime- otg_hdr_rx->time;
|
||||
// rx_check_loss(src_instance, dst_instance, otg_hdr_info_rx->flag, otg_hdr_rx->seq_num, &seq_num_rx, &nb_loss_pkts);
|
||||
// otg_multicast_info->loss_rate[src_instance][dst_instance][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
//otg_multicast_info->rx_sn[src_instance][dst_instance][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);
|
||||
//return 0;
|
||||
} /** background traffic **/
|
||||
else {
|
||||
seq_num_rx=otg_info->seq_num_rx_background[src][dst];
|
||||
seq_num_rx=otg_info->seq_num_rx_background[src_instance][dst_instance];
|
||||
|
||||
if (src<NB_eNB_INST)
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_background_dl[src][dst];
|
||||
if (src_instance<NB_eNB_INST)
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_background_dl[src_instance][dst_instance];
|
||||
else
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_background_ul[src][dst];
|
||||
nb_loss_pkts=otg_info->nb_loss_pkts_background_ul[src_instance][dst_instance];
|
||||
}
|
||||
|
||||
|
||||
LOG_D(OTG,"[%d][%d] AGGREGATION LEVEL (RX) %d \n", src, dst, otg_hdr_rx->aggregation_level);
|
||||
otg_info->aggregation_level[src][dst]=otg_hdr_rx->aggregation_level;
|
||||
LOG_D(OTG,"[%d][%d] AGGREGATION LEVEL (RX) %d \n", src_instance, dst_instance, otg_hdr_rx->aggregation_level);
|
||||
otg_info->aggregation_level[src_instance][dst_instance]=otg_hdr_rx->aggregation_level;
|
||||
|
||||
/* Loss and out of sequence data management */
|
||||
lost_packet= rx_check_loss(src, dst, otg_hdr_info_rx->flag, otg_hdr_rx->seq_num, &seq_num_rx, &nb_loss_pkts);
|
||||
lost_packet= rx_check_loss(
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_hdr_info_rx->flag,
|
||||
otg_hdr_rx->seq_num,
|
||||
&seq_num_rx,
|
||||
&nb_loss_pkts);
|
||||
|
||||
|
||||
if (otg_info->owd_const[src][dst][otg_hdr_rx->flow_id]==0)
|
||||
owd_const_gen(src,dst,otg_hdr_rx->flow_id, otg_hdr_rx->traffic_type);
|
||||
if (otg_info->owd_const[src_instance][dst_instance][otg_hdr_rx->flow_id]==0)
|
||||
owd_const_gen(src_instance,dst_instance,otg_hdr_rx->flow_id, otg_hdr_rx->traffic_type);
|
||||
|
||||
|
||||
/******/
|
||||
@@ -149,128 +178,185 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
float owd_const_IP_backbone_v=owd_const_IP_backbone()/2;
|
||||
float owd_const_application_v=owd_const_application()/2;
|
||||
|
||||
FILE *file;
|
||||
file = fopen("/tmp/log_latency_m2m.txt", "a");
|
||||
fprintf(file," %d %d [%d] [%d] %.2f %.2f %.2f %.2f %.2f %.2f\n", otg_hdr_rx->time, otg_hdr_info_rx->size, src, dst, owd_const_capillary_v,otg_info->radio_access_delay[src][dst],owd_const_mobile_core_v, owd_const_IP_backbone_v, owd_const_application_v, owd_const_capillary_v + otg_info->radio_access_delay[src][dst]+owd_const_mobile_core_v + owd_const_IP_backbone_v+ owd_const_application_v);
|
||||
fclose(file);
|
||||
*/
|
||||
FILE *file;
|
||||
file = fopen("/tmp/log_latency_m2m.txt", "a");
|
||||
fprintf(file," %d %d [%d] [%d] %.2f %.2f %.2f %.2f %.2f %.2f\n", otg_hdr_rx->time, otg_hdr_info_rx->size, src, dst, owd_const_capillary_v,otg_info->radio_access_delay[src][dst],owd_const_mobile_core_v, owd_const_IP_backbone_v, owd_const_application_v, owd_const_capillary_v + otg_info->radio_access_delay[src][dst]+owd_const_mobile_core_v + owd_const_IP_backbone_v+ owd_const_application_v);
|
||||
fclose(file);
|
||||
*/
|
||||
/******/
|
||||
// }
|
||||
|
||||
if (otg_hdr_rx->time<=ctime) {
|
||||
otg_info->radio_access_delay[src][dst]=(float) (ctime- otg_hdr_rx->time);
|
||||
otg_multicast_info->radio_access_delay[src][dst]=(float) (ctime- otg_hdr_rx->time);
|
||||
otg_info->radio_access_delay[src_instance][dst_instance]=(float) (ctime- otg_hdr_rx->time);
|
||||
otg_multicast_info->radio_access_delay[src_instance][dst_instance]=(float) (ctime- otg_hdr_rx->time);
|
||||
} else {
|
||||
LOG_N(OTG,"received packet has tx time %d greater than the current time %d\n",otg_hdr_rx->time,ctime );
|
||||
otg_info->radio_access_delay[src][dst] = 0;
|
||||
otg_multicast_info->radio_access_delay[src][dst]=0;
|
||||
otg_info->radio_access_delay[src_instance][dst_instance] = 0;
|
||||
otg_multicast_info->radio_access_delay[src_instance][dst_instance]=0;
|
||||
}
|
||||
|
||||
/* actual radio OWD*/
|
||||
otg_info->rx_pkt_owd[src][dst]=otg_info->radio_access_delay[src][dst];
|
||||
otg_info->rx_pkt_owd[src_instance][dst_instance]=otg_info->radio_access_delay[src_instance][dst_instance];
|
||||
/* estimated E2E OWD based on the emulated delays for the other part of the network */
|
||||
otg_info->rx_pkt_owd_e2e[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];
|
||||
otg_info->rx_pkt_owd_e2e[src_instance][dst_instance]=
|
||||
otg_info->owd_const[src_instance][dst_instance][otg_hdr_rx->flow_id] + otg_info->radio_access_delay[src_instance][dst_instance];
|
||||
otg_multicast_info->rx_pkt_owd[src_instance][dst_instance]=otg_multicast_info->radio_access_delay[src_instance][dst_instance];
|
||||
|
||||
LOG_D(OTG, "[src %d][dst %d] ctime %d tx time %d: OWD %lf E2E OWD %lf \n", src, dst, ctime, otg_hdr_rx->time, otg_info->rx_pkt_owd[src][dst], otg_info->rx_pkt_owd_e2e[src][dst] );
|
||||
LOG_D(OTG, "[src %d][dst %d] ctime %d tx time %d: OWD %lf E2E OWD %lf \n",
|
||||
src_instance,
|
||||
dst_instance,
|
||||
ctime,
|
||||
otg_hdr_rx->time,
|
||||
otg_info->rx_pkt_owd[src_instance][dst_instance],
|
||||
otg_info->rx_pkt_owd_e2e[src_instance][dst_instance] );
|
||||
|
||||
// compute the jitter by ignoring the packet loss
|
||||
if (lost_packet == 0) {
|
||||
// radio access
|
||||
otg_info->rx_pkt_owd_history[src][dst][1] = otg_info->rx_pkt_owd_history[src][dst][0]; // the previous owd
|
||||
otg_info->rx_pkt_owd_history[src][dst][0] = otg_info->rx_pkt_owd[src][dst]; // the current owd
|
||||
otg_info->rx_pkt_owd_history[src_instance][dst_instance][1] = otg_info->rx_pkt_owd_history[src_instance][dst_instance][0]; // the previous owd
|
||||
otg_info->rx_pkt_owd_history[src_instance][dst_instance][0] = otg_info->rx_pkt_owd[src_instance][dst_instance]; // the current owd
|
||||
|
||||
if (otg_info->rx_pkt_owd_history[src][dst][1] == 0) // first packet
|
||||
otg_info->rx_pkt_jitter[src][dst]=0;
|
||||
if (otg_info->rx_pkt_owd_history[src_instance][dst_instance][1] == 0) // first packet
|
||||
otg_info->rx_pkt_jitter[src_instance][dst_instance]=0;
|
||||
else // for the consecutive packets
|
||||
otg_info->rx_pkt_jitter[src][dst] = fabsf(otg_info->rx_pkt_owd_history[src][dst][0] - otg_info->rx_pkt_owd_history[src][dst][1]);
|
||||
otg_info->rx_pkt_jitter[src_instance][dst_instance]=
|
||||
abs(otg_info->rx_pkt_owd_history[src_instance][dst_instance][0] - otg_info->rx_pkt_owd_history[src_instance][dst_instance][1]);
|
||||
|
||||
LOG_D(OTG,"The packet jitter for the pair (src %d, dst %d)) at %d is %lf (current %lf, previous %lf) \n",
|
||||
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]);
|
||||
src_instance, dst_instance, ctime, otg_info->rx_pkt_jitter[src_instance][dst_instance],
|
||||
otg_info->rx_pkt_owd_history[src_instance][dst_instance][0], otg_info->rx_pkt_owd_history[src_instance][dst_instance][1]);
|
||||
// e2e
|
||||
otg_info->rx_pkt_owd_history_e2e[src][dst][1] = otg_info->rx_pkt_owd_history_e2e[src][dst][0]; // the previous owd
|
||||
otg_info->rx_pkt_owd_history_e2e[src][dst][0] = otg_info->rx_pkt_owd_e2e[src][dst]; // the current owd
|
||||
otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][1] = otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][0]; // the previous owd
|
||||
otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][0] = otg_info->rx_pkt_owd_e2e[src_instance][dst_instance]; // the current owd
|
||||
|
||||
if (otg_info->rx_pkt_owd_history_e2e[src][dst][1] == 0) // first packet
|
||||
otg_info->rx_pkt_jitter_e2e[src][dst]=0;
|
||||
if (otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][1] == 0) // first packet
|
||||
otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance]=0;
|
||||
else // for the consecutive packets
|
||||
otg_info->rx_pkt_jitter_e2e[src][dst]= fabsf(otg_info->rx_pkt_owd_history_e2e[src][dst][0] - otg_info->rx_pkt_owd_history_e2e[src][dst][1]);
|
||||
otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance]=
|
||||
abs(otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][0] - otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][1]);
|
||||
|
||||
LOG_D(OTG,"The packet jitter for the pair (src %d, dst %d)) at %d is %lf (current %lf, previous %lf) \n",
|
||||
src, dst, ctime, otg_info->rx_pkt_jitter_e2e[src][dst],
|
||||
otg_info->rx_pkt_owd_history_e2e[src][dst][0], otg_info->rx_pkt_owd_history_e2e[src][dst][1]);
|
||||
src_instance,
|
||||
dst_instance,
|
||||
ctime,
|
||||
otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance],
|
||||
otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][0],
|
||||
otg_info->rx_pkt_owd_history_e2e[src_instance][dst_instance][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);
|
||||
src_instance,
|
||||
dst_instance,
|
||||
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]);
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_multicast_info->radio_access_delay[src_instance][dst_instance],
|
||||
otg_hdr_rx->time, ctime ,
|
||||
otg_multicast_info->rx_pkt_owd[src_instance][dst_instance]);
|
||||
|
||||
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];
|
||||
if (otg_multicast_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]==0) {
|
||||
otg_multicast_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_multicast_info->rx_pkt_owd[src_instance][dst_instance];
|
||||
otg_multicast_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_multicast_info->rx_pkt_owd[src_instance][dst_instance];
|
||||
} else {
|
||||
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] );
|
||||
otg_multicast_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MAX(
|
||||
otg_multicast_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_multicast_info->rx_pkt_owd[src_instance][dst_instance] );
|
||||
otg_multicast_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MIN(
|
||||
otg_multicast_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_multicast_info->rx_pkt_owd[src_instance][dst_instance] );
|
||||
}
|
||||
|
||||
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);
|
||||
add_tab_metric(
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_multicast_info->rx_pkt_owd[src_instance][dst_instance],
|
||||
((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src_instance][dst_instance]*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);
|
||||
add_tab_metric(src_instance,
|
||||
dst_instance,
|
||||
otg_multicast_info->radio_access_delay[src_instance][dst_instance],
|
||||
((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src_instance][dst_instance]*1024 )),
|
||||
otg_hdr_rx->time);
|
||||
}
|
||||
|
||||
otg_multicast_info->rx_total_bytes_dl+=otg_hdr_info_rx->size;
|
||||
} else {
|
||||
|
||||
LOG_I(OTG,"[SRC %d][DST %d] Stats :: radio access latency %.2f (tx time %d, ctime %d) jitter %.2f, Estimated E2E OWD:%.2f (ms):\n",
|
||||
src, dst, otg_info->radio_access_delay[src][dst], otg_hdr_rx->time, ctime , otg_info->rx_pkt_jitter[src][dst], otg_info->rx_pkt_owd_e2e[src][dst]);
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_info->radio_access_delay[src_instance][dst_instance],
|
||||
otg_hdr_rx->time, ctime ,
|
||||
otg_info->rx_pkt_jitter[src_instance][dst_instance],
|
||||
otg_info->rx_pkt_owd_e2e[src_instance][dst_instance]);
|
||||
|
||||
if (otg_hdr_info_rx->flag == 0xffff) {
|
||||
|
||||
if (otg_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]==0) {
|
||||
otg_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd[src][dst];
|
||||
otg_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd[src][dst];
|
||||
otg_info->rx_owd_max_e2e[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd_e2e[src][dst];
|
||||
otg_info->rx_owd_min_e2e[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd_e2e[src][dst];
|
||||
if (otg_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]==0) {
|
||||
otg_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd[src_instance][dst_instance];
|
||||
otg_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd[src_instance][dst_instance];
|
||||
otg_info->rx_owd_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd_e2e[src_instance][dst_instance];
|
||||
otg_info->rx_owd_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_owd_e2e[src_instance][dst_instance];
|
||||
} else {
|
||||
otg_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_owd_max[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_owd[src][dst] );
|
||||
otg_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_owd_min[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_owd[src][dst] );
|
||||
otg_info->rx_owd_max_e2e[src][dst][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_owd_max_e2e[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_owd_e2e[src][dst] );
|
||||
otg_info->rx_owd_min_e2e[src][dst][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_owd_min_e2e[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_owd_e2e[src][dst] );
|
||||
otg_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_owd_max[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_owd[src_instance][dst_instance] );
|
||||
otg_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_owd_min[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_owd[src_instance][dst_instance] );
|
||||
otg_info->rx_owd_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_owd_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_owd_e2e[src_instance][dst_instance] );
|
||||
otg_info->rx_owd_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_owd_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_owd_e2e[src_instance][dst_instance] );
|
||||
}
|
||||
|
||||
if (otg_info->rx_jitter_max[src][dst][otg_hdr_rx->traffic_type]==0) {
|
||||
otg_info->rx_jitter_max[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter[src][dst];
|
||||
otg_info->rx_jitter_min[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter[src][dst];
|
||||
otg_info->rx_jitter_max_e2e[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter_e2e[src][dst];
|
||||
otg_info->rx_jitter_min_e2e[src][dst][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter_e2e[src][dst];
|
||||
if (otg_info->rx_jitter_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]==0) {
|
||||
otg_info->rx_jitter_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter[src_instance][dst_instance];
|
||||
otg_info->rx_jitter_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter[src_instance][dst_instance];
|
||||
otg_info->rx_jitter_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance];
|
||||
otg_info->rx_jitter_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance];
|
||||
} else if (lost_packet==0) {
|
||||
otg_info->rx_jitter_max[src][dst][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_jitter_max[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_jitter[src][dst] );
|
||||
otg_info->rx_jitter_min[src][dst][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_jitter_min[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_jitter[src][dst] );
|
||||
otg_info->rx_jitter_max_e2e[src][dst][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_jitter_max_e2e[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_jitter_e2e[src][dst] );
|
||||
otg_info->rx_jitter_min_e2e[src][dst][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_jitter_min_e2e[src][dst][otg_hdr_rx->traffic_type],otg_info->rx_pkt_jitter_e2e[src][dst] );
|
||||
otg_info->rx_jitter_max[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_jitter_max[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_jitter[src_instance][dst_instance] );
|
||||
otg_info->rx_jitter_min[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_jitter_min[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_jitter[src_instance][dst_instance] );
|
||||
otg_info->rx_jitter_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MAX(otg_info->rx_jitter_max_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance] );
|
||||
otg_info->rx_jitter_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type]=MIN(otg_info->rx_jitter_min_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type],
|
||||
otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance] );
|
||||
// avg jitter
|
||||
otg_info->rx_jitter_avg[src][dst][otg_hdr_rx->traffic_type] += otg_info->rx_pkt_jitter[src][dst];
|
||||
otg_info->rx_jitter_avg_e2e[src][dst][otg_hdr_rx->traffic_type] += otg_info->rx_pkt_jitter_e2e[src][dst];
|
||||
otg_info->rx_jitter_sample[src][dst][otg_hdr_rx->traffic_type] +=1;
|
||||
otg_info->rx_jitter_avg[src_instance][dst_instance][otg_hdr_rx->traffic_type] += otg_info->rx_pkt_jitter[src_instance][dst_instance];
|
||||
otg_info->rx_jitter_avg_e2e[src_instance][dst_instance][otg_hdr_rx->traffic_type] += otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance];
|
||||
otg_info->rx_jitter_sample[src_instance][dst_instance][otg_hdr_rx->traffic_type] +=1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (g_otg->curve==1) {
|
||||
if (g_otg->owd_radio_access==0)
|
||||
add_tab_metric(src, dst, otg_info->rx_pkt_owd[src][dst], ((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src][dst]*1024 )), otg_hdr_rx->time);
|
||||
add_tab_metric(
|
||||
src_instance,
|
||||
dst_instance,
|
||||
otg_info->rx_pkt_owd[src_instance][dst_instance],
|
||||
((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src_instance][dst_instance]*1024 )),
|
||||
otg_hdr_rx->time);
|
||||
else
|
||||
add_tab_metric(src, dst, otg_info->radio_access_delay[src][dst], ((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src][dst]*1024 )), otg_hdr_rx->time);
|
||||
add_tab_metric(
|
||||
src_instance,
|
||||
dst_instance, otg_info->radio_access_delay[src_instance][dst_instance],
|
||||
((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src_instance][dst_instance]*1024 )),
|
||||
otg_hdr_rx->time);
|
||||
}
|
||||
|
||||
if (src<NB_eNB_INST)
|
||||
if (src_instance<NB_eNB_INST)
|
||||
otg_info->rx_total_bytes_dl+=otg_hdr_info_rx->size;
|
||||
else
|
||||
otg_info->rx_total_bytes_ul+=otg_hdr_info_rx->size;
|
||||
@@ -283,85 +369,97 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
|
||||
//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), 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);
|
||||
src_instance,
|
||||
dst_instance,
|
||||
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));*/
|
||||
|
||||
|
||||
if (otg_hdr_info_rx->flag == 0xffff) {
|
||||
otg_info->rx_num_pkt[src][dst][otg_hdr_rx->traffic_type]+=1;
|
||||
otg_info->rx_num_bytes[src][dst][otg_hdr_rx->traffic_type]+=otg_hdr_info_rx->size;
|
||||
otg_info->seq_num_rx[src][dst][otg_hdr_rx->traffic_type]=seq_num_rx;
|
||||
otg_info->rx_num_pkt[src_instance][dst_instance][otg_hdr_rx->traffic_type]+=1;
|
||||
otg_info->rx_num_bytes[src_instance][dst_instance][otg_hdr_rx->traffic_type]+=otg_hdr_info_rx->size;
|
||||
otg_info->seq_num_rx[src_instance][dst_instance][otg_hdr_rx->traffic_type]=seq_num_rx;
|
||||
|
||||
if (src<NB_eNB_INST)
|
||||
otg_info->nb_loss_pkts_dl[src][dst][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
if (src_instance<NB_eNB_INST)
|
||||
otg_info->nb_loss_pkts_dl[src_instance][dst_instance][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
else
|
||||
otg_info->nb_loss_pkts_ul[src][dst][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
otg_info->nb_loss_pkts_ul[src_instance][dst_instance][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
|
||||
/*Plots of latency and goodput are only plotted for the data traffic*/
|
||||
/*measurements are done for the data and background traffic */
|
||||
|
||||
if (g_otg->latency_metric) {
|
||||
if (g_otg->owd_radio_access==0) {
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->rx_pkt_owd[src][dst], OTG_LATENCY);
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->rx_pkt_jitter_e2e[src][dst], OTG_JITTER);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->rx_pkt_owd[src_instance][dst_instance], OTG_LATENCY);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->rx_pkt_jitter_e2e[src_instance][dst_instance], OTG_JITTER);
|
||||
} else {
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->radio_access_delay[src][dst], OTG_LATENCY);
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->rx_pkt_jitter[src][dst], OTG_JITTER);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->radio_access_delay[src_instance][dst_instance], OTG_LATENCY);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->rx_pkt_jitter[src_instance][dst_instance], OTG_JITTER);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_otg->throughput_metric)
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, ((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src][dst]*1024 )), OTG_GP); /* compute the throughput in Kbit/s */
|
||||
add_log_metric(src_instance,
|
||||
dst_instance,
|
||||
otg_hdr_rx->time,
|
||||
((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src_instance][dst_instance]*1024 )),
|
||||
OTG_GP); /* compute the throughput in Kbit/s */
|
||||
|
||||
} else if (otg_hdr_info_rx->flag == 0x1000) {
|
||||
otg_multicast_info->rx_num_pkt[src][dst][otg_hdr_rx->traffic_type]+=1;
|
||||
otg_multicast_info->rx_num_bytes[src][dst][otg_hdr_rx->traffic_type]+=otg_hdr_info_rx->size;
|
||||
otg_multicast_info->rx_num_pkt[src_instance][dst_instance][otg_hdr_rx->traffic_type]+=1;
|
||||
otg_multicast_info->rx_num_bytes[src_instance][dst_instance][otg_hdr_rx->traffic_type]+=otg_hdr_info_rx->size;
|
||||
// LOG_D(OTG,"DUY: otg_multicast_info->rx_num_bytes[%d][%d][%d] is %d \nn",src,dst,otg_hdr_rx->traffic_type,otg_multicast_info->rx_num_bytes[src][dst][otg_hdr_rx->traffic_type]);
|
||||
otg_multicast_info->rx_sn[src][dst][otg_hdr_rx->traffic_type]=seq_num_rx;
|
||||
otg_multicast_info->loss_pkts_dl[src][dst][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
otg_multicast_info->rx_sn[src_instance][dst_instance][otg_hdr_rx->traffic_type]=seq_num_rx;
|
||||
otg_multicast_info->loss_pkts_dl[src_instance][dst_instance][otg_hdr_rx->traffic_type]=nb_loss_pkts;
|
||||
|
||||
/*Plots of latency and goodput are only plotted for the data traffic*/
|
||||
/*measurements are done for the data and background traffic */
|
||||
|
||||
if (g_otg->latency_metric) {
|
||||
if (g_otg->owd_radio_access==0)
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_multicast_info->rx_pkt_owd[src][dst], OTG_LATENCY);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_multicast_info->rx_pkt_owd[src_instance][dst_instance], OTG_LATENCY);
|
||||
else
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_multicast_info->radio_access_delay[src][dst], OTG_LATENCY);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_multicast_info->radio_access_delay[src_instance][dst_instance], OTG_LATENCY);
|
||||
}
|
||||
|
||||
if (g_otg->throughput_metric)
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, ((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src][dst]*1024 )), OTG_GP); /* compute the throughput in Kbit/s */
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, ((otg_hdr_info_rx->size*1000*8)/(otg_multicast_info->rx_pkt_owd[src_instance][dst_instance]*1024 )),
|
||||
OTG_GP); /* compute the throughput in Kbit/s */
|
||||
} else {
|
||||
otg_info->rx_num_pkt_background[src][dst]+=1;
|
||||
otg_info->rx_num_bytes_background[src][dst]+=otg_hdr_info_rx->size;
|
||||
otg_info->seq_num_rx_background[src][dst]=seq_num_rx;
|
||||
otg_info->rx_num_pkt_background[src_instance][dst_instance]+=1;
|
||||
otg_info->rx_num_bytes_background[src_instance][dst_instance]+=otg_hdr_info_rx->size;
|
||||
otg_info->seq_num_rx_background[src_instance][dst_instance]=seq_num_rx;
|
||||
|
||||
if (src<NB_eNB_INST)
|
||||
otg_info->nb_loss_pkts_background_dl[src][dst]=nb_loss_pkts;
|
||||
if (src_instance<NB_eNB_INST)
|
||||
otg_info->nb_loss_pkts_background_dl[src_instance][dst_instance]=nb_loss_pkts;
|
||||
else
|
||||
otg_info->nb_loss_pkts_background_ul[src][dst]=nb_loss_pkts;
|
||||
otg_info->nb_loss_pkts_background_ul[src_instance][dst_instance]=nb_loss_pkts;
|
||||
|
||||
if (g_otg->latency_metric) {
|
||||
if (g_otg->owd_radio_access==0)
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->rx_pkt_owd[src][dst], OTG_LATENCY_BG);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->rx_pkt_owd[src_instance][dst_instance], OTG_LATENCY_BG);
|
||||
else
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->radio_access_delay[src][dst], OTG_LATENCY_BG);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, otg_info->radio_access_delay[src_instance][dst_instance], OTG_LATENCY_BG);
|
||||
}
|
||||
|
||||
if (g_otg->throughput_metric)
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, ((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src][dst]*1024 )), OTG_GP_BG);
|
||||
add_log_metric(src_instance, dst_instance, otg_hdr_rx->time, ((otg_hdr_info_rx->size*1000*8)/(otg_info->rx_pkt_owd[src_instance][dst_instance]*1024 )), OTG_GP_BG);
|
||||
}
|
||||
|
||||
if (is_size_ok == 0) {
|
||||
otg_hdr_rx = (otg_hdr_t *) (&buffer_tx[bytes_read]);
|
||||
LOG_W(OTG,"[SRC %d][DST %d] RX pkt: seq number %d size mis-matche (hdr %d, pdcp %d) \n", src, dst, otg_hdr_rx->seq_num, otg_hdr_info_rx->size, size);
|
||||
otg_info->nb_loss_pkts_otg[src][dst]++;
|
||||
LOG_W(OTG,"[SRC %d][DST %d] RX pkt: seq number %d size mis-matche (hdr %d, pdcp %d) \n",
|
||||
src_instance, dst_instance, otg_hdr_rx->seq_num, otg_hdr_info_rx->size, size);
|
||||
otg_info->nb_loss_pkts_otg[src_instance][dst_instance]++;
|
||||
}
|
||||
|
||||
return(0);
|
||||
} else {
|
||||
LOG_W(OTG,"RX: Not an OTG pkt, forward to upper layer (flag %x, size %d, pdcp_size %d) FIX ME \n", otg_hdr_info_rx->flag, otg_hdr_info_rx->size, size);
|
||||
LOG_W(OTG,"RX: Not an OTG pkt, forward to upper layer (flag %x, size %d, pdcp_size %d) FIX ME \n",
|
||||
otg_hdr_info_rx->flag, otg_hdr_info_rx->size, size);
|
||||
return(0); //to be fixed on the real case to one
|
||||
}
|
||||
|
||||
@@ -373,7 +471,13 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
|
||||
|
||||
|
||||
int rx_check_loss(int src, int dst, unsigned int flag, int seq_num, unsigned int *seq_num_rx, unsigned int *nb_loss_pkts)
|
||||
int rx_check_loss(
|
||||
const int src,
|
||||
const int dst,
|
||||
const unsigned int flag,
|
||||
const int seq_num,
|
||||
unsigned int * const seq_num_rx,
|
||||
unsigned int * const nb_loss_pkts)
|
||||
{
|
||||
|
||||
/* Loss and out of sequence data management, we have 3 case : */
|
||||
@@ -406,7 +510,11 @@ int rx_check_loss(int src, int dst, unsigned int flag, int seq_num, unsigned int
|
||||
|
||||
|
||||
|
||||
void owd_const_gen(int src, int dst, int flow_id, unsigned int flag)
|
||||
void owd_const_gen(
|
||||
const int src,
|
||||
const int dst,
|
||||
const int flow_id,
|
||||
const unsigned int flag)
|
||||
{
|
||||
otg_info->owd_const[src][dst][flow_id]=(owd_const_mobile_core()+owd_const_IP_backbone()+owd_const_application())/2;
|
||||
|
||||
@@ -423,9 +531,9 @@ void owd_const_gen(int src, int dst, int flow_id, unsigned int flag)
|
||||
float owd_const_capillary(void)
|
||||
{
|
||||
/*return (uniform_dist(MIN_APPLICATION_PROCESSING_GATEWAY_DELAY, MAX_APPLICATION_PROCESSING_GATEWAY_DELAY) +
|
||||
uniform_dist(MIN_FORMATING_TRANSFERRING_DELAY, MAX_FORMATING_TRANSFERRING_DELAY) +
|
||||
uniform_dist(MIN_ACCESS_DELAY, MAX_ACCESS_DELAY) +
|
||||
TERMINAL_ACCESS_DELAY);*/
|
||||
uniform_dist(MIN_FORMATING_TRANSFERRING_DELAY, MAX_FORMATING_TRANSFERRING_DELAY) +
|
||||
uniform_dist(MIN_ACCESS_DELAY, MAX_ACCESS_DELAY) +
|
||||
TERMINAL_ACCESS_DELAY);*/
|
||||
return ((double)MIN_APPLICATION_PROCESSING_GATEWAY_DELAY+ (double)MAX_APPLICATION_PROCESSING_GATEWAY_DELAY + (double)MIN_FORMATING_TRANSFERRING_DELAY+ (double)MAX_FORMATING_TRANSFERRING_DELAY+
|
||||
(double)MIN_ACCESS_DELAY+(double)MAX_ACCESS_DELAY) /2 + (double)TERMINAL_ACCESS_DELAY;
|
||||
}
|
||||
@@ -442,7 +550,7 @@ float owd_const_mobile_core(void)
|
||||
// in this case, according to the fit in the paper,
|
||||
// the delay is generalized pareto: GP(k=0.75,s=0.55,t=1.2)
|
||||
// using inverse cdf method we have CDF(x)=1-(k(x-t)/s+1)^(-1/k),
|
||||
// x=CDF^(-1)(u)=t+s/k*((1-u)^(-k)-1) , hence when u~uniform, than x~GP(k,s,t)
|
||||
// x=CDF^(-1)(u)=t+s/k*((1-u)^(-k)-1) , hence when u~uniform, than x~GP(k,s,t)
|
||||
|
||||
double k,s,t,u;
|
||||
k=0.75;
|
||||
|
||||
@@ -53,16 +53,17 @@
|
||||
|
||||
|
||||
|
||||
/*! \fn char *check_packet(int src, int dst, int ctime);
|
||||
/*! \fn int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buffer_tx, const unsigned int size);
|
||||
* \brief check if the packet is well received and do measurements: one way delay, throughput,etc.
|
||||
* \param[in] the source
|
||||
* \param[in] the destination
|
||||
* \param[in] time of the emulation
|
||||
* \param[in] The packet
|
||||
* \param[in] Size of the packet
|
||||
* \param[out] return NULL is the packet is well received, else the packet to forward
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
int otg_rx_pkt(int src, int dst, int ctime, char *packet, unsigned int size);
|
||||
int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buffer_tx, const unsigned int size);
|
||||
|
||||
|
||||
/*! \fn void owd_const_gen(int src,int dst);
|
||||
@@ -73,7 +74,7 @@ int otg_rx_pkt(int src, int dst, int ctime, char *packet, unsigned int size);
|
||||
*\note
|
||||
*@ingroup _otg
|
||||
*/
|
||||
void owd_const_gen(int src,int dst, int flow_id, unsigned int flag);
|
||||
void owd_const_gen(const int src, const int dst, const int flow_id, const unsigned int flag);
|
||||
|
||||
/*! \fn float owd_const_capillary();
|
||||
*\brief compute the one way delay introduced in LTE/LTE-A network REF PAPER: "Latency for Real-Time Machine-to-Machine Communication in LTE-Based System Architecture"
|
||||
@@ -108,7 +109,7 @@ float owd_const_IP_backbone(void);
|
||||
float owd_const_application(void);
|
||||
|
||||
|
||||
/*! \fn void rx_check_loss(int src, int dst, unsigned int flag, int seq_num, unsigned int *seq_num_rx, unsigned int *nb_loss_pkts);
|
||||
/*! \fn void rx_check_loss(const int src, const int dst, const unsigned int flag, const int seq_num, unsigned int * const seq_num_rx, unsigned int * const nb_loss_pkts);
|
||||
*\brief check the number of loss packet/out of sequence
|
||||
*\param[in] src
|
||||
*\param[in] dst
|
||||
@@ -120,6 +121,12 @@ float owd_const_application(void);
|
||||
*\note
|
||||
*@ingroup _otg
|
||||
*/
|
||||
int rx_check_loss(int src, int dst, unsigned int flag, int seq_num, unsigned int *seq_num_rx, unsigned int *nb_loss_pkts);
|
||||
int rx_check_loss(
|
||||
const int src,
|
||||
const int dst,
|
||||
const unsigned int flag,
|
||||
const int seq_num,
|
||||
unsigned int * const seq_num_rx,
|
||||
unsigned int * const nb_loss_pkts);
|
||||
|
||||
#endif
|
||||
|
||||
+621
-427
File diff suppressed because it is too large
Load Diff
+61
-32
@@ -54,25 +54,33 @@
|
||||
//#include "COMMON/platform_constants.h"
|
||||
|
||||
|
||||
/*! \fn int time_dist(int src, int dst, int state)
|
||||
/*! \fn int time_dist(const int src, const int dst, const int state)
|
||||
* \brief compute Inter Departure Time, in ms
|
||||
* \param[in] Source, destination, state
|
||||
* \param[out] Inter Departure Time
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
int time_dist(int src, int dst, int application, int state);
|
||||
int time_dist(
|
||||
const int src_instance,
|
||||
const int dst_instance,
|
||||
const int application,
|
||||
const int state);
|
||||
|
||||
/*! \fn int size_dist(int src, int dst, int state)
|
||||
/*! \fn int size_dist(const int src, const int dst, const int state)
|
||||
* \brief compute the payload size, in bytes
|
||||
* \param[in] Source, node_dst, state
|
||||
* \param[out] size of the payload, in bytes
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
int size_dist(int src, int dst, int application, int state);
|
||||
int size_dist(
|
||||
const int src_instance,
|
||||
const int dst_instance,
|
||||
const int application,
|
||||
const int state);
|
||||
|
||||
/*! \fn char *random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type);
|
||||
/*! \fn char *random_string(const int size, const ALPHABET_GEN mode, const ALPHABET_TYPE data_type);
|
||||
* \brief return a random string[size]
|
||||
* \param[in] size of the string to generate,
|
||||
* \param[in] ALPHABET_GEN : static or random string
|
||||
@@ -81,10 +89,9 @@ int size_dist(int src, int dst, int application, int state);
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
char * random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type);
|
||||
//char *random_string(int size, ALPHABET data_type, char *data_string);
|
||||
char * random_string(const int size, const ALPHABET_GEN mode, const ALPHABET_TYPE data_type);
|
||||
|
||||
/*! \fn int packet_gen(int src, int dst, int state, int ctime)
|
||||
/*! \fn int packet_gen(const int src, const int dst, const int state, const int ctime)
|
||||
* \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
|
||||
@@ -94,41 +101,49 @@ char * random_string(int size, ALPHABET_GEN mode, ALPHABET_TYPE data_type);
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
unsigned char *packet_gen(int src, int dst, int app, int ctime, unsigned int *pkt_size);
|
||||
unsigned char *packet_gen(
|
||||
const int src_instance,
|
||||
const int dst_instance,
|
||||
const int app,
|
||||
const int ctime,
|
||||
unsigned int * const pkt_size);
|
||||
|
||||
/*! \fn int packet_gen(int src, int dst, int state, int ctime)
|
||||
/*! \fn unsigned char * packet_gen_multicast(const int src, const int dst, const int ctime, unsigned int * const pkt_size)
|
||||
* \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[in] ctime
|
||||
* \param[out] final packet size
|
||||
* \param[out] packet_t: the generated packet: otg_header + header + payload
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
unsigned char *packet_gen_multicast(int src, int dst, int ctime, unsigned int * pkt_size);
|
||||
unsigned char *packet_gen_multicast(
|
||||
const int src_instance,
|
||||
const int dst_instance,
|
||||
const int ctime,
|
||||
unsigned int * const pkt_size);
|
||||
|
||||
/*! \fn char *header_gen(int hdr_size);
|
||||
/*! \fn char *header_gen(const int hdr_size);
|
||||
* \brief generate IP (v4/v6) + transport header(TCP/UDP)
|
||||
* \param[in] int : size
|
||||
* \param[out] the payload corresponding to ip version and transport protocol
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
unsigned char *header_gen(int hdr_size);
|
||||
unsigned char *header_gen(const int hdr_size);
|
||||
|
||||
/*! \fn char *payload_pkts(int payload_size);
|
||||
/*! \fn char *payload_pkts(const int payload_size);
|
||||
* \brief generate the payload
|
||||
* \param[in] int : payload size
|
||||
* \param[out] char * payload
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
unsigned char *payload_pkts(int payload_size);
|
||||
unsigned char *payload_pkts(const int payload_size);
|
||||
|
||||
|
||||
/*! \fn
|
||||
char * serialize_buffer(char* header, char* payload, unsigned int buffer_size, int flag, int flow_id, int ctime, int seq_num, int hdr_type, int state)
|
||||
char * serialize_buffer(char* const header, char* const payload, const unsigned int buffer_size, const int flag, const int flow_id, const int ctime, const int seq_num, const int hdr_type, const int state)
|
||||
* \brief serilize the packet and add otg control information
|
||||
* \param[in] char* header pointer to the header
|
||||
* \param[in] char* payload pointer to the payload
|
||||
@@ -144,8 +159,20 @@ flow id, simulation time, , sequence number, header type (to know the transport/
|
||||
* @ingroup _otg
|
||||
*/
|
||||
|
||||
unsigned char * serialize_buffer(char* header, char* payload, unsigned int buffer_size, unsigned int traffic_type, int flag, int flow_id, int ctime, int seq_num, int hdr_type, int state,
|
||||
unsigned int aggregation_level);
|
||||
unsigned char * serialize_buffer(
|
||||
char* const header,
|
||||
char* const payload,
|
||||
const unsigned int buffer_size,
|
||||
const unsigned int traffic_type,
|
||||
const int flag,
|
||||
const int flow_id,
|
||||
const int ctime,
|
||||
const int seq_num,
|
||||
const int hdr_type,
|
||||
const int state,
|
||||
const unsigned int aggregation_level,
|
||||
const int src_instance,
|
||||
const int dst_instance);
|
||||
|
||||
|
||||
/*! \fn int adjust_size(int size);
|
||||
@@ -165,7 +192,7 @@ int adjust_size(int size);
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
void header_size_gen(int src, int dst, int application);
|
||||
void header_size_gen(const int src, const int dst, const int application);
|
||||
|
||||
void init_predef_multicast_traffic(void);
|
||||
|
||||
@@ -176,9 +203,9 @@ void init_predef_multicast_traffic(void);
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
void init_predef_traffic(unsigned char nb_ue_local, unsigned char nb_enb_local);
|
||||
void init_predef_traffic(const unsigned char nb_ue_local, const unsigned char nb_enb_local);
|
||||
|
||||
/*! \fn int background_gen(int src, int dst, int ctime);
|
||||
/*! \fn int background_gen(const int src, const int dst, const int ctime);
|
||||
* \brief manage idt and packet size for the backgrounf traffic.
|
||||
* \param[in] src
|
||||
* \param[in] dst
|
||||
@@ -187,22 +214,24 @@ void init_predef_traffic(unsigned char nb_ue_local, unsigned char nb_enb_local);
|
||||
* \note
|
||||
* @ingroup _otg
|
||||
*/
|
||||
int background_gen(int src, int dst, int ctime);
|
||||
int background_gen(const int src, const int dst, const int ctime);
|
||||
|
||||
int header_size_gen_background(int src, int dst);
|
||||
int header_size_gen_background(const int src, const int dst);
|
||||
|
||||
void state_management(int src, int dst,int application, int ctime);
|
||||
void state_management(const int src, const int dst,const int application, const int ctime);
|
||||
|
||||
void voip_traffic(int src, int dst, int application, int ctime);
|
||||
void voip_traffic(const int src, const int dst, const int application, const int ctime);
|
||||
|
||||
int otg_hdr_size(int src, int dst);
|
||||
int otg_hdr_size(
|
||||
const int src_instance,
|
||||
const int dst_instance);
|
||||
|
||||
void init_packet_gen(int src, int dst, int ctime);
|
||||
void init_packet_gen(const int src_instance, const int dst_instance, const int ctime);
|
||||
|
||||
int check_data_transmit(int src,int dst, int app, int ctime);
|
||||
int check_data_transmit(const int src,const int dst, const int app, const int ctime);
|
||||
|
||||
unsigned int get_application_state(int src, int dst, int application, int ctime);
|
||||
unsigned int get_application_state(const int src, const int dst, const int application, const int ctime);
|
||||
|
||||
void check_ctime(int ctime);
|
||||
void check_ctime(const int ctime);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user