From b6c7909d03f740a2b390cf2bc6c7c8af62bda476 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas <x.foukas@sms.ed.ac.uk> Date: Mon, 24 Oct 2016 19:14:07 +0300 Subject: [PATCH] Fixed bugs related to MAC padding and RLC requests in AM mode --- .../MAC/eNB_agent_scheduler_dataplane.c | 29 ++- .../LAYER2/MAC/eNB_agent_scheduler_dlsch_ue.c | 12 +- .../LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- .../enb.band7.flexran.50PRB.usrpb210.conf | 182 ++++++++++++++++++ 4 files changed, 209 insertions(+), 16 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf diff --git a/openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c index b75b0467b1..a4d4d79250 100644 --- a/openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/eNB_agent_scheduler_dataplane.c @@ -126,6 +126,8 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id, static int32_t tpc_accumulated=0; UE_sched_ctrl *ue_sched_ctl; + int last_sdu_header_len = 0; + int i; Protocol__FlexDlData *dl_data; @@ -161,18 +163,21 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id, if (dl_data->n_ce_bitmap > 0) { //Check if there is TA command and set the length appropriately - ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 2 : 0; + ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 1 : 0; } + + num_sdus = 0; + sdu_length_total = 0; if (ta_len > 0) { // Reset the measurement ue_sched_ctl->ta_timer = 20; eNB_UE_stats->timing_advance_update = 0; + header_len = ta_len; + last_sdu_header_len = ta_len; } - + n_lc = dl_data->n_rlc_pdu; - num_sdus = 0; - sdu_length_total = 0; // Go through each one of the channel commands and create SDUs for (i = 0; i < n_lc; i++) { lcid = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->logical_channel_id; @@ -192,6 +197,10 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id, if (rlc_status.bytes_in_buffer > 0) { + if (rlc_size <= 2) { + rlc_size = 3; + } + rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, @@ -223,12 +232,13 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id, UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1; UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[i]; - if (sdu_lengths[i] < 128) { + if (sdu_lengths[i] <= 128) { header_len += 2; + last_sdu_header_len = 2; } else { header_len += 3; + last_sdu_header_len = 3; } - num_sdus++; } } @@ -238,13 +248,14 @@ void apply_ue_spec_scheduling_decisions(mid_t mod_id, if (((sdu_length_total + header_len) > 0)) { - header_len_tmp = header_len; + // header_len_tmp = header_len; // If we have only a single SDU, header length becomes 1 - if (header_len == 2 || header_len == 3) { + if ((num_sdus + ta_len) == 1) { + //if (header_len == 2 || header_len == 3) { header_len = 1; } else { - header_len--; + header_len = (header_len - last_sdu_header_len) + 1; } // there is a payload diff --git a/openair2/LAYER2/MAC/eNB_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/eNB_agent_scheduler_dlsch_ue.c index 90d5ad5f1b..4572e73def 100644 --- a/openair2/LAYER2/MAC/eNB_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/eNB_agent_scheduler_dlsch_ue.c @@ -371,7 +371,7 @@ schedule_ue_spec_default( // Need to see if we have space for data from this channel if (dci_tbs - ta_len - header_len > 0) { - LOG_D(MAC, "[TEST]Requested %d bytes from RLC buffer if channel %d during first call\n", dci_tbs-ta_len-header_len); + LOG_D(MAC, "[TEST]Requested %d bytes from RLC buffer on channel %d during first call\n", dci_tbs-ta_len-header_len); //If we have space, we need to see how much data we can request at most (if any available) rlc_status = mac_rlc_status_ind(mod_id, rnti, @@ -390,10 +390,10 @@ schedule_ue_spec_default( if (data_to_request < 128) { //The header will be one byte less header_len--; } - if (j == 1 || j == 2) { - data_to_request++; //It is not correct but fixes some RLC bug for DCCH - } - LOG_D(MAC, "[TEST]Will request %d from DCCH\n", data_to_request); + /* if (j == 1 || j == 2) { */ + /* data_to_request+=0; + /* } */ + LOG_D(MAC, "[TEST]Will request %d from channel %d\n", data_to_request, j); rlc_pdus[channels_added] = (Protocol__FlexRlcPdu *) malloc(sizeof(Protocol__FlexRlcPdu)); protocol__flex_rlc_pdu__init(rlc_pdus[channels_added]); rlc_pdus[channels_added]->n_rlc_pdu_tb = 2; @@ -523,7 +523,7 @@ schedule_ue_spec_default( if (frame_parms[CC_id]->frame_type == TDD) { UE_list->UE_template[CC_id][UE_id].DAI++; // printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI); -#warning only for 5MHz channel + //#warning only for 5MHz channel update_ul_dci(mod_id, CC_id, rnti, UE_list->UE_template[CC_id][UE_id].DAI); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 7946fdf663..a5c1e90147 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -146,7 +146,7 @@ rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP) return (rnti); } - LOG_E(MAC,"[eNB %d] Couldn't find RNTI for UE %d\n",mod_idP,ue_idP); + LOG_D(MAC,"[eNB %d] Couldn't find RNTI for UE %d\n",mod_idP,ue_idP); //display_backtrace(); return(NOT_A_RNTI); } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf new file mode 100644 index 0000000000..f73a78b3b0 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.flexran.50PRB.usrpb210.conf @@ -0,0 +1,182 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "95"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -100; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.100.101"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.100.106/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.100.106/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + NETWORK_CONTROLLER : + { + ENB_AGENT_INTERFACE_NAME = "eth1"; + ENB_AGENT_IPV4_ADDRESS = "10.0.2.5/30"; + ENB_AGENT_PORT = 2210; + ENB_AGENT_CACHE = "/mnt/oai_agent_cache"; + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); -- GitLab