* fix few bugs in oaisim and UL scheduling
* update the CBA operation (non standard feature) * update OTG * add a set of templates for different combination of packet sizes and inter-departure time git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6351 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
|
||||
|
||||
#ifdef JUMBO_FRAME
|
||||
# define MAX_IP_PACKET_SIZE 9000
|
||||
# define MAX_IP_PACKET_SIZE 10000 // 9000
|
||||
#else
|
||||
# if defined(OAI_NW_DRIVER_TYPE_ETHERNET)
|
||||
/* SR: When using ethernet network driver the packet size is 1512 :
|
||||
|
||||
@@ -118,7 +118,7 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
|
||||
#endif
|
||||
) {
|
||||
|
||||
int i,CC_id;
|
||||
int i,CC_id=0;
|
||||
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
|
||||
|
||||
@@ -442,22 +442,22 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
|
||||
UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti;
|
||||
LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
|
||||
Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
|
||||
}
|
||||
}else {
|
||||
if (cba_rnti) {
|
||||
LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE %d (total active cba groups %d)\n",
|
||||
Mod_id, UE_id, num_active_cba_groups);
|
||||
eNB_mac_inst[Mod_id].num_active_cba_groups=num_active_cba_groups;
|
||||
eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
|
||||
for (i=0; i < num_active_cba_groups; i ++){
|
||||
if (eNB_mac_inst[Mod_id].cba_rnti[i] != cba_rnti + i)
|
||||
eNB_mac_inst[Mod_id].cba_rnti[i] = cba_rnti + i;
|
||||
if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i)
|
||||
eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
|
||||
//only configure UE ids up to num_active_cba_groups
|
||||
//we use them as candidates for the transmission of dci format0)
|
||||
if (UE_id%num_active_cba_groups == i){
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
|
||||
LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE %d (total active cba groups %d)\n",
|
||||
Mod_id, i, eNB_mac_inst[Mod_id].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
Mod_id, i, eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i],UE_id, num_active_cba_groups);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+53
-27
@@ -335,6 +335,15 @@ typedef enum {
|
||||
S_DL_NUM_STATUS
|
||||
} UE_DLSCH_STATUS;
|
||||
|
||||
typedef enum {
|
||||
CBA_ES=0, // equal share of RB among groups w
|
||||
CBA_ES_S, // equal share of RB among groups with small allocation
|
||||
CBA_PF, // proportional fair (kind of)
|
||||
CBA_PF_S, // proportional fair (kind of) with small RB allocation
|
||||
CBA_RS // random allocation
|
||||
} CBA_POLICY;
|
||||
|
||||
|
||||
// temp struct for sched
|
||||
typedef struct {
|
||||
|
||||
@@ -419,6 +428,11 @@ typedef struct{
|
||||
// total rb used for retransmission
|
||||
uint32_t total_rbs_used_retx;
|
||||
|
||||
/// preassigned mcs after rate adaptation
|
||||
uint8_t ulsch_mcs1;
|
||||
/// adjusted mcs
|
||||
uint8_t ulsch_mcs2;
|
||||
|
||||
|
||||
/// TX
|
||||
/// Num pkt
|
||||
@@ -452,6 +466,14 @@ typedef struct{
|
||||
// uint32_t avg_pdu_size;
|
||||
|
||||
/// RX
|
||||
/// estimated average pdu inter-departure time
|
||||
uint32_t avg_pdu_idt;
|
||||
/// estimated average pdu size
|
||||
uint32_t avg_pdu_ps;
|
||||
///
|
||||
uint32_t aggregated_pdu_size;
|
||||
uint32_t aggregated_pdu_arrival;
|
||||
|
||||
/// num rx pdu
|
||||
uint32_t num_pdu_rx[NB_RB_MAX];
|
||||
/// num bytes rx
|
||||
@@ -512,9 +534,12 @@ typedef struct{
|
||||
/// total allocated RBs
|
||||
int8_t total_allocated_rbs;
|
||||
|
||||
/// assigned MCS by the ulsch preprocessor
|
||||
/// pre-assigned MCS by the ulsch preprocessor
|
||||
uint8_t pre_assigned_mcs_ul;
|
||||
|
||||
|
||||
/// assigned MCS by the ulsch scheduler
|
||||
uint8_t assigned_mcs_ul;
|
||||
|
||||
/// DCI buffer for ULSCH
|
||||
uint8_t ULSCH_DCI[8][(MAX_DCI_SIZE_BITS>>3)+1];
|
||||
|
||||
@@ -576,31 +601,31 @@ typedef struct{
|
||||
} UE_TEMPLATE;
|
||||
|
||||
typedef struct{
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t ul_bandwidth[MAX_NUM_LCID];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
//To do GBR bearer
|
||||
uint8_t min_ul_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
uint8_t min_dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateDL;
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateUL;
|
||||
//CQI scheduling interval in subframes.
|
||||
uint16_t cqiSchedInterval;
|
||||
//Contention resolution timer used during random access
|
||||
uint8_t mac_ContentionResolutionTimer;
|
||||
|
||||
uint16_t max_allowed_rbs[MAX_NUM_LCID];
|
||||
|
||||
uint8_t max_mcs[MAX_NUM_LCID];
|
||||
|
||||
uint16_t priority[MAX_NUM_LCID];
|
||||
|
||||
//UL transmission bandwidth in RBs
|
||||
uint8_t ul_bandwidth[MAX_NUM_LCID];
|
||||
//DL transmission bandwidth in RBs
|
||||
uint8_t dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
//To do GBR bearer
|
||||
uint8_t min_ul_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
uint8_t min_dl_bandwidth[MAX_NUM_LCID];
|
||||
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateDL;
|
||||
//aggregated bit rate of non-gbr bearer per UE
|
||||
uint64_t ue_AggregatedMaximumBitrateUL;
|
||||
//CQI scheduling interval in subframes.
|
||||
uint16_t cqiSchedInterval;
|
||||
//Contention resolution timer used during random access
|
||||
uint8_t mac_ContentionResolutionTimer;
|
||||
|
||||
uint16_t max_allowed_rbs[MAX_NUM_LCID];
|
||||
|
||||
uint8_t max_mcs[MAX_NUM_LCID];
|
||||
|
||||
uint16_t priority[MAX_NUM_LCID];
|
||||
|
||||
} UE_sched_ctrl;
|
||||
|
||||
typedef struct {
|
||||
@@ -725,6 +750,7 @@ typedef struct{
|
||||
#ifdef CBA
|
||||
uint8_t num_active_cba_groups;
|
||||
uint16_t cba_rnti[NUM_MAX_CBA_GROUP];
|
||||
uint8_t group_mcs[NUM_MAX_CBA_GROUP];
|
||||
#endif
|
||||
}COMMON_channels_t;
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
}
|
||||
// refresh UE list based on UEs dropped by PHY in previous subframe
|
||||
for (i=UE_list->head;i>0;i=UE_list->next[i]) {
|
||||
LOG_I(MAC,"UE %d: rnti %x (%p)\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
|
||||
LOG_T(MAC,"UE %d: rnti %x (%p)\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
|
||||
if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL)
|
||||
mac_remove_ue(module_idP,i,frameP);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
i=UE_list->head;
|
||||
while (i>=0) {
|
||||
next_i = UE_list->next[i];
|
||||
LOG_D(MAC,"UE %d : rnti %x, stats %p\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
|
||||
LOG_T(MAC,"UE %d : rnti %x, stats %p\n",i,UE_RNTI(module_idP,i),mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i)));
|
||||
if (mac_xface->get_eNB_UE_stats(module_idP,0,UE_RNTI(module_idP,i))==NULL) {
|
||||
mac_remove_ue(module_idP,i,frameP);
|
||||
}
|
||||
@@ -260,7 +260,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
else { //FDD
|
||||
schedule_ulsch(module_idP,frameP,cooperation_flag,1,5,nCCE);
|
||||
// schedule_ue_spec(module_idP,subframeP,nprb,nCCE,mbsfn_status);
|
||||
// fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
|
||||
//fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -291,9 +291,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
}
|
||||
}
|
||||
else { //FDD
|
||||
// schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE);
|
||||
// schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE);
|
||||
// schedule_ue_spec(module_idP,subframeP,0,0,mbsfn_status);
|
||||
// fill_DLSCH_dci(module_idP,subframeP,RBalloc,0,mbsfn_status);
|
||||
//fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -1885,7 +1885,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
|
||||
|
||||
// UE specific DCIs
|
||||
for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
|
||||
LOG_D(MAC,"CC_id %d, UE_id: %d => status %d\n",CC_id,UE_id,eNB_dlsch_info[module_idP][CC_id][UE_id].status);
|
||||
LOG_T(MAC,"CC_id %d, UE_id: %d => status %d\n",CC_id,UE_id,eNB_dlsch_info[module_idP][CC_id][UE_id].status);
|
||||
if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == S_DL_SCHEDULED) {
|
||||
|
||||
// clear scheduling flag
|
||||
|
||||
@@ -169,6 +169,7 @@ unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP) {
|
||||
return aggregation;
|
||||
}
|
||||
#ifdef CBA
|
||||
/*
|
||||
uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, int CC_id,unsigned char group_id){
|
||||
|
||||
module_id_t UE_id;
|
||||
@@ -176,7 +177,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, int CC_id,unsign
|
||||
unsigned char nb_ue_in_pusch=0;
|
||||
LTE_eNB_UE_stats* eNB_UE_stats;
|
||||
|
||||
for (UE_id=group_id;UE_id<NUMBER_OF_UE_MAX;UE_id+=eNB_mac_inst[module_idP][CC_id].num_active_cba_groups) {
|
||||
for (UE_id=group_id;UE_id<NUMBER_OF_UE_MAX;UE_id+=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups) {
|
||||
|
||||
if (((rnti=eNB_mac_inst[module_idP][CC_id].UE_template[UE_id].rnti) !=0) &&
|
||||
(eNB_mac_inst[module_idP][CC_id].UE_template[UE_id].ul_active==TRUE) &&
|
||||
@@ -192,6 +193,7 @@ uint8_t find_num_active_UEs_in_cbagroup(module_id_t module_idP, int CC_id,unsign
|
||||
}
|
||||
return(nb_ue_in_pusch);
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
void dump_ue_list(UE_list_t *listP, int ul_flag) {
|
||||
@@ -220,7 +222,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) {
|
||||
UE_id = UE_list->avail;
|
||||
UE_list->avail = UE_list->next[UE_list->avail];
|
||||
UE_list->next[UE_id] = UE_list->head;
|
||||
UE_list->next_ul[UE_id] = UE_list->head;
|
||||
UE_list->next_ul[UE_id] = UE_list->head_ul;
|
||||
UE_list->head = UE_id;
|
||||
UE_list->head_ul = UE_id;
|
||||
UE_list->UE_template[cc_idP][UE_id].rnti = rntiP;
|
||||
@@ -612,7 +614,7 @@ void add_common_dci(DCI_PDU *DCI_pdu,
|
||||
|
||||
|
||||
DCI_pdu->Num_common_dci++;
|
||||
LOG_D(MAC,"add common dci format %d for rnti %d \n",dci_fmt,rnti);
|
||||
LOG_D(MAC,"add common dci format %d for rnti %x \n",dci_fmt,rnti);
|
||||
}
|
||||
|
||||
void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt,uint8_t ra_flag) {
|
||||
@@ -626,7 +628,7 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
|
||||
|
||||
DCI_pdu->Num_ue_spec_dci++;
|
||||
|
||||
LOG_D(MAC,"add ue specific dci format %d for rnti %d \n",dci_fmt,rnti);
|
||||
LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
|
||||
// This table holds the allowable PRB sizes for ULSCH transmissions
|
||||
@@ -226,8 +226,8 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8
|
||||
|
||||
// This check is just to make sure we didn't get a bogus SDU length, to be removed ...
|
||||
if (rx_lengths[i]<CCCH_PAYLOAD_SIZE_MAX) {
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d(%d) \n",
|
||||
enb_mod_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i], rx_lcids[i]);
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
|
||||
enb_mod_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
|
||||
|
||||
mac_rlc_data_ind(enb_mod_idP,UE_id, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
@@ -251,8 +251,8 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8
|
||||
LOG_T(MAC,"\n");
|
||||
#endif
|
||||
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d (%d)\n",
|
||||
enb_mod_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],rx_lcids[i]);
|
||||
LOG_D(MAC,"[eNB %d] Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d\n",
|
||||
enb_mod_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]);
|
||||
|
||||
if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) && (rx_lengths[i] > 0) ) { // MAX SIZE OF transport block
|
||||
mac_rlc_data_ind(enb_mod_idP,UE_id, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,
|
||||
@@ -263,7 +263,6 @@ void rx_sdu(module_id_t enb_mod_idP,int CC_idP,frame_t frameP,rnti_t rntiP,uint8
|
||||
NULL);//(unsigned int*)crc_status);
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
|
||||
UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
|
||||
|
||||
}
|
||||
// }
|
||||
break;
|
||||
@@ -535,7 +534,7 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
|
||||
schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb);
|
||||
|
||||
#ifdef CBA
|
||||
schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, granted_UEs, nCCE, nCCE_available, first_rb);
|
||||
schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -613,7 +612,7 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
|
||||
}
|
||||
if (nCCE_available[CC_id] < (1<<aggregation)){
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,CC_id);
|
||||
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: not enough nCCE (%d)\n", module_idP,frameP,subframeP,UE_id,CC_id,nCCE_available[CC_id]);
|
||||
continue; // break;
|
||||
}
|
||||
|
||||
@@ -630,13 +629,13 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
//should we continue or set harq_pid to 0?
|
||||
continue;
|
||||
}else
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (nCCE %d, rnti %x,mode %s)\n",
|
||||
LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d round %d (nCCE %d, rnti %x,mode %s)\n",
|
||||
module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,nCCE[CC_id],rnti,mode_string[eNB_UE_stats->mode]);
|
||||
|
||||
|
||||
|
||||
#ifndef EXMIMO_IOT
|
||||
if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0) || ((frameP%10)==0))
|
||||
if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0))
|
||||
// if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
|
||||
#else
|
||||
if (round==0)
|
||||
@@ -679,12 +678,14 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
ndi = 1-UE_template->oldNDI_UL[harq_pid];
|
||||
UE_template->oldNDI_UL[harq_pid]=ndi;
|
||||
//mcs = 10;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=UE_template->pre_assigned_mcs_ul;
|
||||
mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
|
||||
if (UE_template->pre_allocated_rb_table_index_ul >=0)
|
||||
rb_table_index=UE_template->pre_allocated_rb_table_index_ul;
|
||||
else {// NN-->RK: check this condition
|
||||
else {
|
||||
mcs=10;rb_table_index=5; // for PHR
|
||||
}
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
|
||||
buffer_occupancy = UE_template->ul_total_buffer;
|
||||
|
||||
while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) &&
|
||||
@@ -701,8 +702,8 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
//store for possible retransmission
|
||||
UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index];
|
||||
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] Frame %d subframeP %d Scheduled UE (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,frameP,subframeP,mcs,
|
||||
LOG_D(MAC,"[eNB %d][PUSCH %d/%x] Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
|
||||
module_idP,harq_pid,rnti,frameP,subframeP,UE_id,mcs,
|
||||
first_rb[CC_id],rb_table[rb_table_index],
|
||||
rb_table_index,TBS,harq_pid);
|
||||
// Adjust BSR entries for LCGIDs
|
||||
@@ -956,47 +957,129 @@ void schedule_ulsch_rnti(module_id_t module_idP,
|
||||
}
|
||||
|
||||
#ifdef CBA
|
||||
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, uint8_t granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb){
|
||||
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb){
|
||||
|
||||
DCI0_5MHz_TDD_1_6_t *ULSCH_dci_tdd16;
|
||||
DCI0_5MHz_FDD_t *ULSCH_dci_fdd;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
UE_list_t *UE_list=&eNB->UE_list;
|
||||
//UE_TEMPLATE *UE_template;
|
||||
void *ULSCH_dci = NULL;
|
||||
DCI_PDU *DCI_pdu;
|
||||
uint8_t CC_id=0;
|
||||
uint8_t rb_table_index=0, aggregation=2;
|
||||
uint32_t rballoc;
|
||||
uint8_t cba_group, cba_resources;
|
||||
uint8_t required_rbs[NUM_MAX_CBA_GROUP], weight[NUM_MAX_CBA_GROUP], num_cba_resources[NUM_MAX_CBA_GROUP];
|
||||
uint8_t available_rbs= ceil(mac_xface->lte_frame_parms->N_RB_UL-1-first_rb[CC_id]);
|
||||
uint8_t remaining_rbs= available_rbs;
|
||||
uint8_t allocated_rbs;
|
||||
uint8_t required_rbs[NUM_MAX_CBA_GROUP];
|
||||
int8_t num_cba_resources[NUM_MAX_CBA_GROUP];// , weight[NUM_MAX_CBA_GROUP]
|
||||
// the following vars should become a vector [MAX_NUM_CCs]
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
int8_t available_rbs=0;
|
||||
uint8_t remaining_rbs=0;
|
||||
uint8_t allocated_rbs=0;
|
||||
uint8_t total_UEs=UE_list->num_UEs;
|
||||
uint8_t active_UEs[NUM_MAX_CBA_GROUP];
|
||||
uint8_t total_groups=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups;
|
||||
int min_rb_unit=2;
|
||||
uint8_t cba_policy=CBA_ES;
|
||||
int UE_id;
|
||||
uint8_t mcs[NUM_MAX_CBA_GROUP];
|
||||
uint32_t total_cba_resources=0;
|
||||
uint32_t total_rbs=0;
|
||||
// We compute the weight of each group and initialize some variables
|
||||
|
||||
|
||||
// loop over all active UEs
|
||||
// for (UE_id=UE_list->head_ul;UE_id>=0;UE_id=UE_list->next_ul[UE_id]) {
|
||||
|
||||
for (cba_group=0;cba_group<eNB_mac_inst[module_idP][CC_id].num_active_cba_groups;cba_group++) {
|
||||
for (cba_group=0;cba_group<total_groups;cba_group++) {
|
||||
// UEs in PUSCH with traffic
|
||||
weight[cba_group] = find_num_active_UEs_in_cbagroup(module_idP, cba_group);
|
||||
// weight[cba_group] = 0;
|
||||
required_rbs[cba_group] = 0;
|
||||
num_cba_resources[cba_group]=0;
|
||||
active_UEs[cba_group]=0;
|
||||
mcs[cba_group]=openair_daq_vars.target_ue_ul_mcs;
|
||||
}
|
||||
//LOG_D(MAC, "[eNB ] CBA granted ues are %d\n",granted_UEs );
|
||||
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
|
||||
frame_parms=mac_xface->get_lte_frame_parms(module_idP,CC_id);
|
||||
available_rbs=frame_parms->N_RB_DL-1-first_rb[CC_id];
|
||||
remaining_rbs=available_rbs;
|
||||
total_groups=eNB_mac_inst[module_idP].common_channels[CC_id].num_active_cba_groups;
|
||||
min_rb_unit=get_min_rb_unit(module_idP,CC_id);
|
||||
|
||||
if (available_rbs < min_rb_unit )
|
||||
continue;
|
||||
|
||||
// remove this condition later
|
||||
// cba group template uses the exisitng UE template, and thus if a UE
|
||||
// is scheduled, the correspodning group can't be used for CBA
|
||||
// this can be fixed later
|
||||
if ((total_groups > 0) && (nCCE[CC_id] == 0)) {
|
||||
DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
|
||||
|
||||
if ((eNB_mac_inst[module_idP][CC_id].num_active_cba_groups > 0) && (nCCE[CC_id] == 0)) {
|
||||
DCI_pdu = &eNB_mac_inst[module_idP][CC_id].DCI_pdu;
|
||||
|
||||
for (cba_group=0;cba_group<eNB_mac_inst[module_idP][CC_id].num_active_cba_groups && (nCCE_available[CC_id] > (1<<aggregation));cba_group++) {
|
||||
if (remaining_rbs <= 0 )
|
||||
for (cba_group=0;
|
||||
(cba_group<total_groups) && (nCCE_available[CC_id]* (total_cba_resources+1) > (1<<aggregation));
|
||||
cba_group++) {
|
||||
// equal weight
|
||||
//weight[cba_group] = floor(total_UEs/active_groups);//find_num_active_UEs_in_cbagroup(module_idP, cba_group);
|
||||
|
||||
for (UE_id=UE_list->head_ul;UE_id>=0;UE_id=UE_list->next_ul[UE_id]) {
|
||||
if (UE_RNTI(module_idP,UE_id)==0)
|
||||
continue;
|
||||
// simple UE identity based grouping
|
||||
if ((UE_id % total_groups) == cba_group){ // this could be simplifed to active_UEs[UE_id % total_groups]++;
|
||||
if ((mac_get_rrc_status(module_idP,1,UE_id) > RRC_CONNECTED) &&
|
||||
(UE_is_to_be_scheduled(module_idP,CC_id,UE_id) == 0))
|
||||
active_UEs[cba_group]++;
|
||||
}
|
||||
if (UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul <= 2)
|
||||
mcs[cba_group]= 8; // apply fixed scheduling
|
||||
else if ((UE_id % total_groups) == cba_group)
|
||||
mcs[cba_group]= cmin(mcs[cba_group],UE_list->UE_template[CC_id][UE_id].pre_assigned_mcs_ul);
|
||||
}
|
||||
mcs[cba_group]= cmin(mcs[cba_group],openair_daq_vars.target_ue_ul_mcs);
|
||||
|
||||
if (available_rbs < min_rb_unit )
|
||||
break;
|
||||
// If the group needs some resource
|
||||
if ((weight[cba_group] > 0) && eNB_mac_inst[module_idP][CC_id].cba_rnti[cba_group] != 0){
|
||||
// to be refined in case of : granted_UEs >> weight[cba_group]*available_rbs
|
||||
required_rbs[cba_group] = (uint8_t)ceil((weight[cba_group]*available_rbs)/granted_UEs);
|
||||
|
||||
while (remaining_rbs < required_rbs[cba_group] )
|
||||
// determine the total number of allocations (one or multiple DCIs): to be refined
|
||||
if ((active_UEs[cba_group] > 0) && (eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group] != 0)){
|
||||
// to be refined in case of : total_UEs >> weight[cba_group]*available_rbs
|
||||
|
||||
switch(cba_policy) {
|
||||
case CBA_ES:
|
||||
required_rbs[cba_group] = (uint8_t)floor(available_rbs/total_groups); // allocate equally among groups
|
||||
num_cba_resources[cba_group]=1;
|
||||
break;
|
||||
// can't have more than one allocation for the same group/UE
|
||||
/* case CBA_ES_S:
|
||||
required_rbs[cba_group] = (uint8_t)floor(available_rbs/total_groups); // allocate equally among groups
|
||||
if (required_rbs[cba_group] > min_rb_unit)
|
||||
num_cba_resources[cba_group]=(uint8_t)(required_rbs[cba_group]/ min_rb_unit);
|
||||
break;*/
|
||||
case CBA_PF:
|
||||
required_rbs[cba_group] = (uint8_t)floor((active_UEs[cba_group]*available_rbs)/total_UEs);
|
||||
num_cba_resources[cba_group]=1;
|
||||
break;
|
||||
/* case CBA_PF_S:
|
||||
required_rbs[cba_group] = (uint8_t)ceil((active_UEs[cba_group]*available_rbs)/total_UEs);
|
||||
if (required_rbs[cba_group] > min_rb_unit)
|
||||
num_cba_resources[cba_group]=(uint8_t) floor(required_rbs[cba_group] / min_rb_unit);
|
||||
break;*/
|
||||
|
||||
default:
|
||||
LOG_W(MAC,"unknown CBA policy\n");
|
||||
break;
|
||||
}
|
||||
total_cba_resources+=num_cba_resources[cba_group];
|
||||
total_rbs+=required_rbs[cba_group];
|
||||
|
||||
/* while ((remaining_rbs < required_rbs[cba_group]) &&
|
||||
(required_rbs[cba_group] > 0) &&
|
||||
(required_rbs[cba_group] < min_rb_unit ))
|
||||
required_rbs[cba_group]--;
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
while (rb_table[rb_table_index] < required_rbs[cba_group])
|
||||
rb_table_index++;
|
||||
@@ -1007,26 +1090,39 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
remaining_rbs-=rb_table[rb_table_index];
|
||||
required_rbs[cba_group]=rb_table[rb_table_index];
|
||||
*/
|
||||
// to be refined
|
||||
if (weight[cba_group] < required_rbs[cba_group])
|
||||
num_cba_resources[cba_group]=(uint8_t)ceil(weight[cba_group]/2.0);
|
||||
else
|
||||
num_cba_resources[cba_group]=(uint8_t)ceil(required_rbs[cba_group]/2.0);
|
||||
|
||||
while (nCCE[CC_id] + (1<<aggregation) * num_cba_resources[cba_group] > nCCE_available[CC_id])
|
||||
num_cba_resources[cba_group]--;
|
||||
|
||||
LOG_N(MAC,"[eNB %d] Frame %d, subframeP %d: cba group %d weight/granted_ues %d/%d available/required rb (%d/%d), num resources %d->1 (*scaled down*) \n",
|
||||
module_idP, frameP, subframeP, cba_group,
|
||||
weight[cba_group], granted_UEs, available_rbs,required_rbs[cba_group],
|
||||
num_cba_resources[cba_group]);
|
||||
|
||||
num_cba_resources[cba_group]=1;
|
||||
// num_cba_resources[cba_group]=1;
|
||||
|
||||
}
|
||||
}
|
||||
// phase 2
|
||||
for (cba_group=0;cba_group<eNB_mac_inst[module_idP][CC_id].num_active_cba_groups;cba_group++) {
|
||||
// phase 2 reduce the number of cba allocations among the groups
|
||||
cba_group=0;
|
||||
while (nCCE[CC_id] + (1<<aggregation) * total_cba_resources >= nCCE_available[CC_id]){
|
||||
num_cba_resources[cba_group%total_groups]--;
|
||||
total_cba_resources--;
|
||||
// LOG_N(MAC,"reducing num cba resources to %d for group %d \n", num_cba_resources[cba_group%total_groups], cba_group%total_groups );
|
||||
cba_group++;
|
||||
}
|
||||
|
||||
if (total_cba_resources <= 0)
|
||||
return;
|
||||
|
||||
// increase rb if any left: to be done
|
||||
cba_group=0;
|
||||
while (total_rbs < available_rbs - 1 ){
|
||||
required_rbs[cba_group%total_groups]++;
|
||||
total_rbs++;
|
||||
cba_group++;
|
||||
}
|
||||
|
||||
// phase 3:
|
||||
for (cba_group=0;cba_group<total_groups;cba_group++) {
|
||||
|
||||
LOG_N(MAC,"[eNB %d] Frame %d, subframe %d: cba group %d active_ues %d total groups %d mcs %d, available/required rb (%d/%d), num resources %d, ncce (%d/%d required %d \n",
|
||||
module_idP, frameP, subframeP, cba_group,active_UEs[cba_group],total_groups,
|
||||
mcs[cba_group], available_rbs,required_rbs[cba_group],
|
||||
num_cba_resources[cba_group],
|
||||
nCCE[CC_id],nCCE_available[CC_id],(1<<aggregation) * num_cba_resources[cba_group]);
|
||||
|
||||
for (cba_resources=0; cba_resources < num_cba_resources[cba_group]; cba_resources++){
|
||||
rb_table_index =0;
|
||||
// check if there was an allocation for this group in the 1st phase
|
||||
@@ -1047,58 +1143,118 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
|
||||
rb_table[rb_table_index]);
|
||||
|
||||
first_rb[CC_id]+=rb_table[rb_table_index];
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, subframeP %d: CBA %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), rballoc %d, nCCE (%d/%d)\n",
|
||||
module_idP, frameP, subframeP, cba_group,eNB_mac_inst[module_idP][CC_id].cba_rnti[cba_group],
|
||||
available_rbs, required_rbs[cba_group], allocated_rbs, remaining_rbs,rballoc,
|
||||
nCCE_available[CC_id],nCCE[CC_id]);
|
||||
LOG_N(MAC,"[eNB %d] Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d, nCCE (%d/%d)\n",
|
||||
module_idP, frameP, subframeP, cba_group,eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
available_rbs, required_rbs[cba_group], allocated_rbs, remaining_rbs,
|
||||
mcs[cba_group],rballoc,nCCE_available[CC_id],nCCE[CC_id]);
|
||||
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
case 6:
|
||||
mac_xface->macphy_exit("[MAC][eNB] CBA RB=6 not supported \n");
|
||||
break;
|
||||
case 25:
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
ULSCH_dci = UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs[cba_group];
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi = 1;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC = 1;//tpc;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cba_group;
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_list->UE_template[CC_id][cba_group].DAI_ul[sched_subframe];
|
||||
((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = 1;
|
||||
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
}
|
||||
else {
|
||||
ULSCH_dci = UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
if (mac_xface->lte_frame_parms->frame_type == TDD) {
|
||||
ULSCH_dci_tdd16 = (DCI0_5MHz_TDD_1_6_t *)UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
ULSCH_dci_tdd16->type = 0;
|
||||
ULSCH_dci_tdd16->hopping = 0;
|
||||
ULSCH_dci_tdd16->rballoc = rballoc;
|
||||
ULSCH_dci_tdd16->mcs = 2;
|
||||
ULSCH_dci_tdd16->ndi = 1;
|
||||
ULSCH_dci_tdd16->TPC = tpc;
|
||||
ULSCH_dci_tdd16->cshift = cba_group;
|
||||
ULSCH_dci_tdd16->dai = UE_list->UE_template[CC_id][cba_group].DAI_ul[sched_subframe];
|
||||
ULSCH_dci_tdd16->cqi_req = 1;
|
||||
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs = mcs[cba_group];
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi = 1;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC = 1;//tpc;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift = cba_group;
|
||||
((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req = 1;
|
||||
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci_tdd16,
|
||||
eNB_mac_inst[module_idP][CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_5MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
}
|
||||
else {
|
||||
ULSCH_dci_fdd = (DCI0_5MHz_FDD_t *)UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
ULSCH_dci_fdd->type = 0;
|
||||
ULSCH_dci_fdd->hopping = 0;
|
||||
ULSCH_dci_fdd->rballoc = rballoc;
|
||||
ULSCH_dci_fdd->mcs = 2;
|
||||
ULSCH_dci_fdd->ndi = 1;
|
||||
ULSCH_dci_fdd->TPC = tpc;
|
||||
ULSCH_dci_fdd->cshift = 0;
|
||||
ULSCH_dci_fdd->cqi_req = 1;
|
||||
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci_fdd,
|
||||
eNB_mac_inst[module_idP][CC_id].cba_rnti[cba_group],
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_5MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_5MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
}
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, subframeP %d: Generated ULSCH DCI for CBA group %d, RB 25 format 0\n", module_idP,frameP,subframeP,cba_group);
|
||||
break;
|
||||
case 50:
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
ULSCH_dci = UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs = mcs[cba_group];
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi = 1;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC = 1;//tpc;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift = cba_group;
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai = UE_list->UE_template[CC_id][cba_group].DAI_ul[sched_subframe];
|
||||
((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req = 1;
|
||||
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_10MHz_TDD_1_6_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_TDD_1_6_t,
|
||||
format0,
|
||||
0);
|
||||
}
|
||||
else {
|
||||
ULSCH_dci = UE_list->UE_template[CC_id][cba_group].ULSCH_DCI[0];
|
||||
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->type = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping = 0;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc = rballoc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs = mcs[cba_group];
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi = 1;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC = 1;//tpc;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift = cba_group;
|
||||
((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req = 1;
|
||||
|
||||
//add_ue_spec_dci
|
||||
add_common_dci(DCI_pdu,
|
||||
ULSCH_dci,
|
||||
eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
|
||||
sizeof(DCI0_10MHz_FDD_t),
|
||||
aggregation,
|
||||
sizeof_DCI0_10MHz_FDD_t,
|
||||
format0,
|
||||
0);
|
||||
}
|
||||
LOG_D(MAC,"[eNB %d] Frame %d, subframeP %d: Generated ULSCH DCI for CBA group %d, RB 50 format 0\n", module_idP,frameP,subframeP,cba_group);
|
||||
break;
|
||||
case 100:
|
||||
mac_xface->macphy_exit("[MAC][eNB] CBA RB=100 not supported \n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation) * num_cba_resources[cba_group];
|
||||
nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation) ;
|
||||
nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id];
|
||||
// break;// for the moment only schedule one
|
||||
}
|
||||
|
||||
@@ -474,14 +474,15 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
else // rb required based only on the buffer - rb allloctaed in the 1st round + extra reaming rb form the 1st round
|
||||
nb_rbs_required_remaining[CC_id][i] = nb_rbs_required[CC_id][i]-nb_rbs_required_remaining_1[CC_id][i]+nb_rbs_required_remaining[CC_id][i];
|
||||
|
||||
LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n",
|
||||
r1, CC_id, i,
|
||||
nb_rbs_required_remaining[CC_id][i],
|
||||
nb_rbs_required_remaining_1[CC_id][i],
|
||||
nb_rbs_required[CC_id][i],
|
||||
pre_nb_available_rbs[CC_id][i],
|
||||
N_RBG[CC_id],
|
||||
min_rb_unit[CC_id]);
|
||||
if (nb_rbs_required[CC_id][i]> 0 )
|
||||
LOG_D(MAC,"round %d : nb_rbs_required_remaining[%d][%d]= %d (remaining_1 %d, required %d, pre_nb_available_rbs %d, N_RBG %d, rb_unit %d)\n",
|
||||
r1, CC_id, i,
|
||||
nb_rbs_required_remaining[CC_id][i],
|
||||
nb_rbs_required_remaining_1[CC_id][i],
|
||||
nb_rbs_required[CC_id][i],
|
||||
pre_nb_available_rbs[CC_id][i],
|
||||
N_RBG[CC_id],
|
||||
min_rb_unit[CC_id]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -630,15 +631,18 @@ void dlsch_scheduler_pre_processor (module_id_t Mod_id,
|
||||
for (ii=0;ii<UE_num_active_CC(UE_list,UE_id);ii++) {
|
||||
CC_id = UE_list->ordered_CCids[ii][UE_id];
|
||||
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].dl_pow_off = dl_pow_off[UE_id];
|
||||
LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id);
|
||||
LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,dl_pow_off[CC_id][UE_id]);
|
||||
LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id);
|
||||
for(j=0;j<N_RBG[CC_id];j++){
|
||||
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i];
|
||||
LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,rballoc_sub_UE[CC_id][UE_id][j]);
|
||||
|
||||
if (pre_nb_available_rbs[CC_id][UE_id] > 0 ){
|
||||
LOG_D(MAC,"******************DL Scheduling Information for UE%d ************************\n",UE_id);
|
||||
LOG_D(MAC,"dl power offset UE%d = %d \n",UE_id,dl_pow_off[CC_id][UE_id]);
|
||||
LOG_D(MAC,"***********RB Alloc for every subband for UE%d ***********\n",UE_id);
|
||||
for(j=0;j<N_RBG[CC_id];j++){
|
||||
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].rballoc_sub[i] = rballoc_sub_UE[CC_id][UE_id][i];
|
||||
LOG_D(MAC,"RB Alloc for UE%d and Subband%d = %d\n",UE_id,j,rballoc_sub_UE[CC_id][UE_id][j]);
|
||||
}
|
||||
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id];
|
||||
LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,pre_nb_available_rbs[CC_id][UE_id]);
|
||||
}
|
||||
//PHY_vars_eNB_g[Mod_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = pre_nb_available_rbs[CC_id][UE_id];
|
||||
LOG_D(MAC,"Total RBs allocated for UE%d = %d\n",UE_id,pre_nb_available_rbs[CC_id][UE_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -807,7 +811,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: total ue %d, max num ue to be scheduled %d\n",
|
||||
LOG_D(MAC,"[eNB %d] Frame %d subframe %d: total ue to be scheduled %d/%d\n",
|
||||
module_idP, frameP, subframeP,total_ue_count, max_num_ue_to_be_scheduled);
|
||||
|
||||
//LOG_D(MAC,"step3\n");
|
||||
@@ -885,11 +889,14 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe
|
||||
|
||||
for (UE_id=UE_list->head_ul;UE_id>=0;UE_id=UE_list->next_ul[UE_id]) {
|
||||
|
||||
|
||||
UE_template = &UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id];
|
||||
//LOG_I(MAC,"[UE %d next %d] SR is %d\n",UE_id, UE_list->next_ul[UE_id], UE_template->ul_SR);
|
||||
|
||||
UE_template->ul_total_buffer=0;
|
||||
for (lcgid=0; lcgid<MAX_NUM_LCGID; lcgid++){
|
||||
UE_template->ul_buffer_info[lcgid]=BSR_TABLE[UE_template->bsr_info[lcgid]];
|
||||
UE_template->ul_total_buffer+= UE_template->ul_buffer_info[lcgid];
|
||||
UE_template->ul_total_buffer+= UE_template->ul_buffer_info[lcgid]; // apply traffic aggregtaion if packets are small
|
||||
// UE_template->ul_buffer_creation_time_max=cmax(UE_template->ul_buffer_creation_time_max, frame_cycle*1024 + frameP-UE_template->ul_buffer_creation_time[lcgid]));
|
||||
}
|
||||
if ( UE_template->ul_total_buffer >0)
|
||||
@@ -920,7 +927,9 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
|
||||
rnti_t rnti = -1;
|
||||
int mcs=cmin(16,openair_daq_vars.target_ue_ul_mcs);
|
||||
int rb_table_index=0,tbs,tx_power;
|
||||
UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
|
||||
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
|
||||
UE_list_t *UE_list = &eNB->UE_list;
|
||||
|
||||
UE_TEMPLATE *UE_template;
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are
|
||||
*/
|
||||
void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe,unsigned int *nCCE);
|
||||
|
||||
/** \brief ULSCH Scheduling per RNTI TDD config (config 1-6).
|
||||
/** \brief ULSCH Scheduling per RNTI
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param frame Frame index
|
||||
@param subframe Subframe number on which to act
|
||||
@@ -103,14 +103,14 @@ void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperat
|
||||
*/
|
||||
void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb);
|
||||
|
||||
/** \brief ULSCH Scheduling for CBA RNTI TDD config (config 1-6).
|
||||
/** \brief ULSCH Scheduling for CBA RNTI
|
||||
@param Mod_id Instance ID of eNB
|
||||
@param frame Frame index
|
||||
@param subframe Subframe number on which to act
|
||||
@param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
|
||||
@param nCCE Pointer to current nCCE count
|
||||
*/
|
||||
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint8_t granted_UEs, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb);
|
||||
void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE, unsigned int *nCCE_available, uint16_t *first_rb);
|
||||
|
||||
/** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called. This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY. It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation. It assumes localized allocation of type 0 (DCI.rah=0). The allocation is done for tranmission modes 1,2,4.
|
||||
@param Mod_id Instance of eNB
|
||||
@@ -500,7 +500,7 @@ void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_templat
|
||||
*/
|
||||
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index,int CC_id);
|
||||
|
||||
/*! \fn int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index);
|
||||
/*! \fn int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen);
|
||||
\brief determine whether to use cba resource to transmit or not
|
||||
\param[in] Mod_id instance of the UE
|
||||
\param[in] frame the frame number
|
||||
@@ -508,7 +508,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
|
||||
\param[in] eNB_index instance of eNB
|
||||
\param[out] access(1) or postpone (0)
|
||||
*/
|
||||
int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index);
|
||||
int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen);
|
||||
|
||||
/*! \fn int get_bsr_lcgid (module_id_t module_idP);
|
||||
\brief determine the lcgid for the bsr
|
||||
|
||||
@@ -127,6 +127,10 @@ void ue_init_mac(module_id_t module_idP){
|
||||
UE_mac_inst[module_idP].scheduling_info.LCGID[i]=1;
|
||||
UE_mac_inst[module_idP].scheduling_info.LCID_status[i]=0;
|
||||
}
|
||||
#ifdef CBA
|
||||
for (i=0; i <NUM_MAX_CBA_GROUP;i++)
|
||||
UE_mac_inst[module_idP].cba_last_access[i]= round(uniform_rngen(1,30));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +260,7 @@ uint32_t ue_get_SR(module_id_t module_idP,int CC_id,frame_t frameP,uint8_t eNB_i
|
||||
UE_mac_inst[module_idP].scheduling_info.sr_ProhibitTimer_Running=1;
|
||||
} else
|
||||
UE_mac_inst[module_idP].scheduling_info.sr_ProhibitTimer_Running=0;
|
||||
LOG_D(MAC,"[UE %d][SR %x] Frame %d subframe %d send SR_indication (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
|
||||
LOG_D(MAC,"[UE %d][SR %x] Frame %d subframe %d send SR indication (SR_COUNTER/dsr_TransMax %d/%d), SR_pending %d\n",
|
||||
module_idP,rnti,frameP,subframe,
|
||||
UE_mac_inst[module_idP].scheduling_info.SR_COUNTER,
|
||||
(1<<(2+UE_mac_inst[module_idP].physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax)),
|
||||
@@ -1074,12 +1078,12 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
LOG_D(MAC,"[UE %d] frameP %d subframe %d try CBA transmission\n",
|
||||
module_idP, frameP, subframe);
|
||||
//if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DTCH] == LCID_EMPTY)
|
||||
if (use_cba_access(module_idP,frameP,subframe,eNB_index)==0){
|
||||
if (cba_access(module_idP,frameP,subframe,eNB_index,buflen)==0){
|
||||
*access_mode=POSTPONED_ACCESS;
|
||||
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GET_SDU, VCD_FUNCTION_OUT);
|
||||
return;
|
||||
}
|
||||
LOG_D(MAC,"[UE %d] frameP %d subframe %d CBA transmission oppurtunity, tbs %d\n",
|
||||
LOG_I(MAC,"[UE %d] frameP %d subframe %d CBA transmission oppurtunity, tbs %d\n",
|
||||
module_idP, frameP, subframe,buflen);
|
||||
}
|
||||
#endif
|
||||
@@ -1117,7 +1121,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
|
||||
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH] == LCID_NOT_EMPTY) {
|
||||
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DCCH,
|
||||
(buflen-dcch_header_len-bsr_len-phr_len));
|
||||
LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RRC message has %d bytes to "
|
||||
@@ -1143,7 +1147,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
// DCCH1
|
||||
if (UE_mac_inst[module_idP].scheduling_info.LCID_status[DCCH1] == LCID_NOT_EMPTY) {
|
||||
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DCCH1,
|
||||
(buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-sdu_length_total));
|
||||
|
||||
@@ -1177,7 +1181,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
else
|
||||
dtch_header_len = 2;//sizeof(SCH_SUBHEADER_SHORT);
|
||||
*/
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
buflen-bsr_len-phr_len-dcch_header_len-dcch1_header_len-dtch_header_len-sdu_length_total);
|
||||
|
||||
@@ -1185,7 +1189,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
|
||||
module_idP,frameP, rlc_status.bytes_in_buffer,buflen,dtch_header_len,
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR_bytes[DTCH]);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(0, module_idP,frameP, ENB_FLAG_NO, MBMS_FLAG_NO,
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(0, module_idP,frameP, ENB_FLAG_NO, MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
(char *)&ulsch_buff[sdu_length_total]);
|
||||
|
||||
@@ -1527,13 +1531,19 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
|
||||
|
||||
// to be improved
|
||||
#ifdef CBA
|
||||
extern int cba_backoff;
|
||||
double uniform_rngen(int min, int max) {
|
||||
double random = (double)taus()/((double)0xffffffff);
|
||||
return (max - min) * random + min;
|
||||
}
|
||||
|
||||
int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index){
|
||||
int cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint16_t buflen){
|
||||
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
int header_offset=4;
|
||||
int rv =0;
|
||||
|
||||
/*
|
||||
if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]<64)) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]<64)) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]<64)) )
|
||||
@@ -1542,11 +1552,11 @@ int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, u
|
||||
// LOG_D(MAC,"[UE %d] Frame %d Subframe %d: the current CBA backoff is %d \n", module_idP, frameP, subframe,
|
||||
// UE_mac_inst[module_idP].cba_last_access[0] );
|
||||
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,10));
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,40));
|
||||
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
|
||||
return 1;
|
||||
rv=1;
|
||||
} else if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]> 0 )) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]> 0 )) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]> 0 )) )
|
||||
@@ -1558,15 +1568,113 @@ int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, u
|
||||
module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
|
||||
} /*else if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1] == 0 )) &&
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2] == 0 )) &&
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3] == 0 )) )
|
||||
&& (UE_mac_inst[module_idP].cba_last_access[0]> 0) ){
|
||||
} else if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1] == 0 )) &&
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2] == 0 )) &&
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3] == 0 )) )
|
||||
&& (UE_mac_inst[module_idP].cba_last_access[0]> 0) ){
|
||||
UE_mac_inst[module_idP].cba_last_access[0]-=1;
|
||||
}*/
|
||||
|
||||
return 0;
|
||||
if ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID0]<64) )
|
||||
return 0;
|
||||
|
||||
if ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1] <= 0 ) &&
|
||||
(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2] <= 0 ) &&
|
||||
(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3] <= 0 ) )
|
||||
return 0;
|
||||
|
||||
if (cba_backoff == 0 ){ // apply probablisitc method
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= uniform_rngen(0,1);
|
||||
if (uniform_rngen(0,1) > 0.6 ){
|
||||
LOG_I(MAC,"[UE %d] Frame %d Subframe %d: CBA probability-based backoff (%d), UL active state %d \n", module_idP, frameP, subframe,
|
||||
cba_backoff,UE_mac_inst[module_idP].ul_active);
|
||||
|
||||
rv=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (UE_mac_inst[module_idP].cba_last_access[0] <= 0) {
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,cba_backoff));
|
||||
|
||||
LOG_I(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d/%d UL active state %d \n", module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], cba_backoff,UE_mac_inst[module_idP].ul_active);
|
||||
|
||||
rv = 1;
|
||||
/*
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
0);
|
||||
|
||||
if ((
|
||||
// (rlc_status.pdus_in_buffer > 0 ) &&
|
||||
// (UE_mac_inst[module_idP].ul_active == 0) && // check if the ul is acrtive
|
||||
(rlc_status.head_sdu_is_segmented == 0 ) &&
|
||||
((rlc_status.head_sdu_remaining_size_to_send + header_offset ) <= buflen )
|
||||
)){
|
||||
rv = 1;
|
||||
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,30));
|
||||
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
*/
|
||||
} else {
|
||||
UE_mac_inst[module_idP].cba_last_access[0]-=1;
|
||||
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: wait for backoff to expire (%d) CBA UL active state %d \n",
|
||||
module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
/*
|
||||
if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]<64)) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]<64)) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]>0)&&(UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]<64)) )
|
||||
// && (UE_mac_inst[module_idP].ul_active == 0) // check if the ul is acrtive
|
||||
&& (UE_mac_inst[module_idP].cba_last_access[0] <= 0) ) {
|
||||
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,cba_backoff));
|
||||
|
||||
LOG_I(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d/%d UL active state %d \n", module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], cba_backoff,UE_mac_inst[module_idP].ul_active);
|
||||
|
||||
rv = 1;
|
||||
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO, // eNB_index
|
||||
DTCH,
|
||||
0);
|
||||
|
||||
if ((
|
||||
// (rlc_status.pdus_in_buffer > 0 ) &&
|
||||
// (UE_mac_inst[module_idP].ul_active == 0) && // check if the ul is acrtive
|
||||
(rlc_status.head_sdu_is_segmented == 0 ) &&
|
||||
((rlc_status.head_sdu_remaining_size_to_send + header_offset ) <= buflen )
|
||||
)){
|
||||
rv = 1;
|
||||
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,30));
|
||||
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: start a new CBA backoff %d UL active state %d \n", module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
} else
|
||||
UE_mac_inst[module_idP].cba_last_access[0]= round(uniform_rngen(1,5));
|
||||
|
||||
|
||||
} else if (( ((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID1]> 0 )) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID2]> 0 )) ||
|
||||
((UE_mac_inst[module_idP].scheduling_info.BSR[LCGID3]> 0 )) )
|
||||
// && (UE_mac_inst[module_idP].ul_active == 0) // check if the ul is acrtive
|
||||
&& (UE_mac_inst[module_idP].cba_last_access[0]> 0) )
|
||||
{
|
||||
|
||||
UE_mac_inst[module_idP].cba_last_access[0]-=1;
|
||||
LOG_D(MAC,"[UE %d] Frame %d Subframe %d: wait for backoff to expire (%d) CBA UL active state %d \n",
|
||||
module_idP, frameP, subframe,
|
||||
UE_mac_inst[module_idP].cba_last_access[0], UE_mac_inst[module_idP].ul_active);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1631,15 +1739,15 @@ boolean_t update_bsr(module_id_t module_idP, frame_t frameP, uint8_t lcid, uint
|
||||
// for (lcid =0 ; lcid < MAX_NUM_LCID; lcid++) {
|
||||
if (UE_mac_inst[module_idP].scheduling_info.LCGID[lcid] == lcg_id) {
|
||||
rlc_status = mac_rlc_status_ind(0, module_idP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
|
||||
lcid,
|
||||
0);
|
||||
lcid,
|
||||
0);
|
||||
if (rlc_status.bytes_in_buffer > 0 ) {
|
||||
sr_pending = TRUE;
|
||||
UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_NOT_EMPTY;
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id] += locate (BSR_TABLE,BSR_TABLE_SIZE, rlc_status.bytes_in_buffer);
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id] += rlc_status.bytes_in_buffer;
|
||||
// UE_mac_inst[module_idP].scheduling_info.BSR_short_lcid = lcid; // only applicable to short bsr
|
||||
LOG_D(MAC,"[UE %d] BSR level %d (LCGID %d, rlc buffer %d byte)\n",
|
||||
sr_pending = TRUE;
|
||||
UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_NOT_EMPTY;
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id] += locate (BSR_TABLE,BSR_TABLE_SIZE, rlc_status.bytes_in_buffer);
|
||||
UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id] += rlc_status.bytes_in_buffer;
|
||||
// UE_mac_inst[module_idP].scheduling_info.BSR_short_lcid = lcid; // only applicable to short bsr
|
||||
LOG_D(MAC,"[UE %d] BSR level %d (LCGID %d, rlc buffer %d byte)\n",
|
||||
module_idP, UE_mac_inst[module_idP].scheduling_info.BSR[lcg_id],lcg_id, UE_mac_inst[module_idP].scheduling_info.BSR_bytes[lcg_id]);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -127,12 +127,11 @@ typedef struct
|
||||
|
||||
#ifdef Rel10
|
||||
/// Get MCH sdu and corresponding MCS for particular MBSFN subframe
|
||||
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, uint8_t CC_id, frame_t frameP,sub_frame_t subframe);
|
||||
MCH_PDU* (*get_mch_sdu)(module_id_t Mod_id, int CC_id, frame_t frameP,sub_frame_t subframe);
|
||||
#endif
|
||||
// configure the cba rnti at the physical layer
|
||||
void (*phy_config_cba_rnti)(module_id_t Mod_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
|
||||
void (*phy_config_cba_rnti)(module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, uint16_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
|
||||
/// get delta mcs for fast UL AMC
|
||||
// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
|
||||
int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
|
||||
|
||||
|
||||
|
||||
@@ -92,6 +92,29 @@
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib10
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib11
|
||||
#endif
|
||||
/*
|
||||
#ifdef Rel10
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib12_v920 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib12_v920
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib13_v920 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib13_v920
|
||||
#endif
|
||||
*/
|
||||
/*
|
||||
// This corrects something generated by asn1c which is different between Rel8 and Rel10
|
||||
#ifndef Rel10
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member SystemInformation_r8_IEs_sib_TypeAndInfo_Member
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib2
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib3
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib4
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib5
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib6 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib6
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib7 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib7
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib8 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib8
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib9 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib9
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib10 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib10
|
||||
#define SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib11 SystemInformation_r8_IEs_sib_TypeAndInfo_Member_PR_sib11
|
||||
#endif
|
||||
|
||||
*/
|
||||
|
||||
//#include "L3_rrc_defs.h"
|
||||
#ifndef NO_RRM
|
||||
|
||||
@@ -842,7 +842,11 @@ static void rrc_eNB_generate_defaultRRCConnectionReconfiguration(
|
||||
DRB_rlc_config->present = RLC_Config_PR_um_Bi_Directional;
|
||||
DRB_rlc_config->choice.um_Bi_Directional.ul_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
|
||||
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
|
||||
#ifdef CBA
|
||||
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = T_Reordering_ms5;//T_Reordering_ms25;
|
||||
#else
|
||||
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = T_Reordering_ms25;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
DRB_pdcp_config = CALLOC(1, sizeof(*DRB_pdcp_config));
|
||||
|
||||
@@ -235,7 +235,7 @@ int logInit (void)
|
||||
g_log->log_component[OTG_GP].interval = 1;
|
||||
g_log->log_component[OTG_GP].fd = 0;
|
||||
g_log->log_component[OTG_GP].filelog = 0;
|
||||
g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_GP.dat";
|
||||
g_log->log_component[OTG_GP].filelog_name = "/tmp/otg_goodput.dat";
|
||||
|
||||
g_log->log_component[OTG_GP_BG].name = "OTG_GP_BG";
|
||||
g_log->log_component[OTG_GP_BG].level = LOG_EMERG;
|
||||
@@ -243,7 +243,7 @@ int logInit (void)
|
||||
g_log->log_component[OTG_GP_BG].interval = 1;
|
||||
g_log->log_component[OTG_GP_BG].fd = 0;
|
||||
g_log->log_component[OTG_GP_BG].filelog = 0;
|
||||
g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_GP_bg.dat";
|
||||
g_log->log_component[OTG_GP_BG].filelog_name = "/tmp/otg_goodput_bg.dat";
|
||||
|
||||
g_log->log_component[OTG_JITTER].name = "OTG_JITTER";
|
||||
g_log->log_component[OTG_JITTER].level = LOG_EMERG;
|
||||
|
||||
@@ -73,7 +73,8 @@ return random;
|
||||
double uniform_dist(int min, int max) {
|
||||
double uniform_rn;
|
||||
uniform_rn = (max - min) * uniform_rng() + min;
|
||||
LOG_T(OTG,"Uniform Random Nb = %lf, (min %d, max %d)\n", uniform_rn, min, max);
|
||||
// LOG_T(OTG,"Uniform Random Nb = %lf, (min %d, max %d)\n", uniform_rn, min, max);
|
||||
//printf("Uniform Random Nb = %lf, (min %d, max %d)\n", uniform_rn, min, max);
|
||||
return uniform_rn;
|
||||
}
|
||||
|
||||
|
||||
@@ -706,6 +706,7 @@ The following diagram is based on graphviz (http://www.graphviz.org/), you need
|
||||
char *vcd_file;
|
||||
unsigned char eMBMS_active_state;
|
||||
unsigned char cba_group_active;
|
||||
unsigned char cba_backoff;
|
||||
unsigned char handover_active;
|
||||
char * otg_traffic;
|
||||
unsigned char otg_bg_traffic_enabled;
|
||||
|
||||
@@ -52,7 +52,7 @@ temp=split(strrep(inputf,"\\","/"),"/");
|
||||
outputf=split(deblank(temp(size(temp,1),:)),".");
|
||||
ylbl=outputf(1,:);
|
||||
|
||||
ylbl(1,1)=toupper(ylbl(1,1));
|
||||
#ylbl(1,1)=toupper(ylbl(1,1));
|
||||
ylabel(ylbl);
|
||||
xlabel("Time (ms)");
|
||||
|
||||
|
||||
+17
-13
@@ -239,7 +239,7 @@ void kpi_gen() {
|
||||
int num_active_source=0;
|
||||
|
||||
|
||||
int dl_ok=0,ul_ok=0;
|
||||
int dl_ok=1,ul_ok=1;
|
||||
|
||||
char traffic_type[12];
|
||||
char traffic[30];
|
||||
@@ -637,9 +637,11 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
|
||||
LOG_I(OTG,"[DATA] Estimated E2E JITTER AVG ms= %lf \n", otg_info->average_jitter_dl_e2e/(float)num_active_source );
|
||||
LOG_I(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_dl*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_I(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_dl*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_I(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_dl - rx_total_pkts_dl );
|
||||
if (tx_total_pkts_dl - rx_total_pkts_dl < (int) (tx_total_pkts_dl / 10) ) // below 10% of loss
|
||||
dl_ok=1;
|
||||
LOG_I(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_dl - rx_total_pkts_dl);
|
||||
if ( (tx_total_pkts_dl > 0) &&
|
||||
((10*(tx_total_pkts_dl - rx_total_pkts_dl)) > tx_total_pkts_dl)) // below 10% of loss
|
||||
dl_ok=0;
|
||||
|
||||
if ((g_otg->background_stats==1)&&(tx_total_pkts_dl_background>0)){
|
||||
LOG_I(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_dl_background);
|
||||
LOG_I(OTG,"[BACKGROUND] Total bytes(TX)= %d \n", tx_total_bytes_dl_background);
|
||||
@@ -708,8 +710,9 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
|
||||
LOG_I(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_I(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_I(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_ul - rx_total_pkts_ul );
|
||||
if ((tx_total_pkts_ul - rx_total_pkts_ul) < (int)(tx_total_pkts_ul / 10) )
|
||||
ul_ok=1;
|
||||
if ( (tx_total_pkts_ul > 0 ) &&
|
||||
((10*(tx_total_pkts_ul - rx_total_pkts_ul)) > tx_total_pkts_ul))
|
||||
ul_ok=0;
|
||||
|
||||
if ((g_otg->background_stats==1)&&(tx_total_pkts_ul_background>0)){
|
||||
LOG_I(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_ul_background);
|
||||
@@ -720,7 +723,7 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
|
||||
LOG_I(OTG,"[BACKGROUND] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_ul_background*1000*8)/(otg_info->ctime*1024));
|
||||
|
||||
}
|
||||
LOG_F(OTG,"**************** TOTAL UL RESULTS ******************\n");
|
||||
LOG_F(OTG,"**************** TOTAL UL RESULTS ******************\n");
|
||||
LOG_F(OTG,"Total Time (ms)= %d \n", otg_info->ctime+1);
|
||||
LOG_F(OTG,"[DATA] Total packets(TX)= %d \n", tx_total_pkts_ul);
|
||||
LOG_F(OTG,"[DATA] Total packets(RX)= %d \n", rx_total_pkts_ul);
|
||||
@@ -735,6 +738,7 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
|
||||
LOG_F(OTG,"[DATA] TX throughput = %.7f(Kbit/s) \n", ((double)tx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_F(OTG,"[DATA] RX throughput = %.7f(Kbit/s) \n", ((double)rx_total_bytes_ul*1000*8)/(otg_info->ctime*1024));
|
||||
LOG_F(OTG,"[DATA] NB lost packet = %d \n", tx_total_pkts_ul - rx_total_pkts_ul );
|
||||
|
||||
if ((g_otg->background_stats==1)&&(tx_total_pkts_ul_background>0)){
|
||||
LOG_F(OTG,"[BACKGROUND] Total packets(TX)= %d \n", tx_total_pkts_ul_background);
|
||||
LOG_F(OTG,"[BACKGROUND] Total bytes(TX)= %d \n", tx_total_bytes_ul_background);
|
||||
@@ -748,7 +752,7 @@ if ((g_otg->background_stats==1)&&(otg_info->tx_num_bytes_background[i][j]>0)){
|
||||
if ((dl_ok == 1 ) && (ul_ok ==1))
|
||||
LOG_I(OTG,"************ DL and UL loss rate below 10 *************\n");
|
||||
else
|
||||
LOG_I(OTG,"************ DL and UL loss rate above 10 *************\n");
|
||||
LOG_I(OTG,"************ DL(%d) and UL(%d) loss rate above 10 *************\n",dl_ok,ul_ok);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -781,7 +785,7 @@ void add_log_metric(int src, int dst, int ctime, double metric, unsigned int lab
|
||||
LOG_E(OTG, "File label unknown %d \n", label);
|
||||
}
|
||||
|
||||
LOG_F(label,"%d ", ctime);
|
||||
LOG_F(label,"%d ", ctime);
|
||||
for (i=0; i<=(NB_eNB_INST + NB_UE_INST); i++){
|
||||
for (j=0; j<=(NB_eNB_INST + NB_UE_INST); j++){
|
||||
node_actif=0;
|
||||
@@ -789,9 +793,9 @@ void add_log_metric(int src, int dst, int ctime, double metric, unsigned int lab
|
||||
node_actif=1;
|
||||
|
||||
if ((node_actif>0) && ((i==src) && (j==dst)))
|
||||
LOG_F(label," %f ", metric);
|
||||
LOG_F(label,"%f ", metric);
|
||||
if ((node_actif>0) && ((i!=src) || (j!=dst)))
|
||||
LOG_F(label," %d ", 0);
|
||||
LOG_F(label,"%d ", 0);
|
||||
}
|
||||
}
|
||||
LOG_F(label,"%f\n", metric);
|
||||
@@ -806,14 +810,14 @@ void add_log_label(unsigned int label, unsigned int * start_log_metric){
|
||||
|
||||
if (*start_log_metric==0){
|
||||
*start_log_metric=1;
|
||||
LOG_F(label,"Time ");
|
||||
LOG_F(label,"Time ");
|
||||
for (i=0; i<=(NB_eNB_INST + NB_UE_INST); i++){
|
||||
for (j=0; j<=(NB_eNB_INST + NB_UE_INST); j++){
|
||||
node_actif=0;
|
||||
if (g_otg->idt_dist[i][j][0][PE_STATE]>0 )
|
||||
node_actif++;
|
||||
if (node_actif>0)
|
||||
LOG_F(label,"%d->%d ", i, j);
|
||||
LOG_F(label,"%d->%d ", i, j);
|
||||
}
|
||||
}
|
||||
LOG_F(label,"Aggregated\n");
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include "otg_rx.h"
|
||||
#include "otg_externs.h"
|
||||
#include "../UTIL/MATH/oml.h"
|
||||
#include "UTIL/MATH/oml.h"
|
||||
#include <math.h>
|
||||
#include "otg_form.h"
|
||||
#include "otg_kpi.h"
|
||||
@@ -70,8 +70,7 @@ int otg_rx_pkt( int src, int dst, int ctime, char *buffer_tx, unsigned int size)
|
||||
unsigned int seq_num_rx;
|
||||
unsigned int nb_loss_pkts;
|
||||
unsigned int lost_packet=0;
|
||||
//int header_size;
|
||||
|
||||
|
||||
if (buffer_tx!=NULL) {
|
||||
otg_hdr_info_rx = (otg_hdr_info_t *) (&buffer_tx[bytes_read]);
|
||||
bytes_read += sizeof (otg_hdr_info_t);
|
||||
@@ -299,9 +298,10 @@ float owd_const_application_v=owd_const_application()/2;
|
||||
/*measurements are done for the data and background traffic */
|
||||
|
||||
if (g_otg->latency_metric) {
|
||||
if (g_otg->owd_radio_access==0)
|
||||
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);
|
||||
else {
|
||||
add_log_metric(src, dst, otg_hdr_rx->time, otg_info->rx_pkt_jitter_e2e[src][dst], 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);
|
||||
}
|
||||
|
||||
@@ -413,14 +413,14 @@ int check_data_transmit(int src,int dst, int app, int ctime){
|
||||
//g_ otg->flow_start_flag[src][dst][app]=1;
|
||||
LOG_T(OTG,"Flow start time not reached : do not generate packet for this pair of src=%d, dst =%d, start %d < ctime %d \n",
|
||||
src, dst,g_otg->flow_start[src][dst][app], ctime);
|
||||
size+=0;
|
||||
size=0;
|
||||
}else if (g_otg->flow_duration[src][dst][app] + g_otg->flow_start[src][dst][app] < ctime ){
|
||||
LOG_T(OTG,"Flow duration reached: do not generate packet for this pair of src=%d, dst =%d, duration %d < ctime %d + start %d\n",
|
||||
src, dst,g_otg->flow_duration[src][dst][app], ctime, g_otg->flow_start[src][dst][app]);
|
||||
size+=0;
|
||||
size=0;
|
||||
}else if ((g_otg->application_type[src][dst][app]==0)&&(g_otg->idt_dist[src][dst][app][PE_STATE]==0)){
|
||||
LOG_T(OTG,"Do not generate packet for this pair of src=%d, dst =%d, IDT zero and app %d not specificed\n", src, dst, app);
|
||||
size+=0;
|
||||
size=0;
|
||||
}
|
||||
|
||||
else if ((g_otg->application_type[src][dst][app] >0) || (g_otg->idt_dist[src][dst][app][PE_STATE] > 0)) {
|
||||
|
||||
Reference in New Issue
Block a user