enb,rrc: remove hard-coded SCG bearer config

Use 5QI config when configuring secondary cell group bearer for NSA.
The 5QI used for this needs to match with the QCI used for the initial
LTE DRB.

This allows to use RLC AM over NSA.
master
Andre Puschmann 3 years ago
parent 319a185eba
commit d854bbc22e

@ -30,6 +30,7 @@ class rrc_nr_interface_rrc
public:
struct sgnb_addition_req_params_t {
uint32_t eps_bearer_id;
uint32_t five_qi;
// add configuration check
// E-RAB Parameters, Tunnel address (IP address, TEID)
// QCI, security, etc

@ -101,7 +101,6 @@ private:
asn1::rrc::rrc_conn_recfg_complete_s pending_recfg_complete;
// fixed ENDC variables
const uint32_t eutra_drb_id = 1; // The DRB ID that converted to NR
const uint32_t lcid_drb_nr = 4;
// internal events

@ -310,8 +310,27 @@ void rrc::ue::rrc_endc::start_sgnb_addition()
{
// Start EN-DC activation using EPS bearer of EUTRA DRB1
rrc_nr_interface_rrc::sgnb_addition_req_params_t params = {};
params.eps_bearer_id =
rrc_enb->bearer_manager.get_lcid_bearer(rrc_ue->rnti, drb_to_lcid((lte_drb)eutra_drb_id)).eps_bearer_id;
const auto& drb_list = rrc_ue->bearer_list.get_established_drbs();
if (drb_list.size() > 0) {
// move first establised DRB to NR cell
const auto& drb1 = drb_list[0];
const auto& erab_list = rrc_ue->bearer_list.get_erabs();
auto erab_it = erab_list.find(drb1.eps_bearer_id);
if (erab_it != erab_list.end()) {
params.eps_bearer_id = drb1.eps_bearer_id;
params.five_qi = erab_it->second.qos_params.qci; // use QCI as 5QI
} else {
logger.error("Couldn't find ERAB config for DRB%d. Aborting SgNB addition for E-UTRA rnti=0x%x",
drb1.drb_id,
rrc_ue->rnti);
return;
}
} else {
logger.error("No LTE DRB established. Aborting SgNB addition for E-UTRA rnti=0x%x", rrc_ue->rnti);
return;
}
logger.info("Triggering SgNB addition for E-UTRA rnti=0x%x", rrc_ue->rnti);
rrc_enb->rrc_nr->sgnb_addition_request(rrc_ue->rnti, params);

@ -114,7 +114,6 @@ private:
int pack_rrc_reconfiguration(asn1::dyn_octstring& packed_rrc_reconfig);
int pack_secondary_cell_group_cfg(asn1::dyn_octstring& packed_secondary_cell_config);
int pack_secondary_cell_group_rlc_cfg(asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg_pack);
int pack_secondary_cell_group_mac_cfg(asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg_pack);
int pack_secondary_cell_group_sp_cell_cfg(asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg_pack);
@ -149,7 +148,7 @@ private:
int pack_nr_radio_bearer_config(asn1::dyn_octstring& packed_nr_bearer_config);
int add_drb();
int add_drb(uint32_t five_qi);
bool init_pucch();

@ -163,55 +163,6 @@ int rrc_nr::ue::send_dl_dcch(srsran::nr_srb srb, const asn1::rrc_nr::dl_dcch_msg
return SRSRAN_SUCCESS;
}
int rrc_nr::ue::pack_secondary_cell_group_rlc_cfg(asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg_pack)
{
// RLC for DRB1 (with fixed LCID)
cell_group_cfg_pack.rlc_bearer_to_add_mod_list.resize(1);
auto& rlc_bearer = cell_group_cfg_pack.rlc_bearer_to_add_mod_list[0];
rlc_bearer.lc_ch_id = drb1_lcid;
rlc_bearer.served_radio_bearer_present = true;
rlc_bearer.served_radio_bearer.set_drb_id();
rlc_bearer.served_radio_bearer.drb_id() = 1;
rlc_bearer.rlc_cfg_present = true;
#ifdef USE_RLC_AM_NR
rlc_bearer.rlc_cfg.set_am();
rlc_bearer.rlc_cfg.am().ul_am_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.am().ul_am_rlc.sn_field_len = sn_field_len_am_opts::size12;
rlc_bearer.rlc_cfg.am().dl_am_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.am().dl_am_rlc.sn_field_len = sn_field_len_am_opts::size12;
rlc_bearer.rlc_cfg.am().ul_am_rlc.t_poll_retx = t_poll_retx_opts::ms500;
rlc_bearer.rlc_cfg.am().ul_am_rlc.poll_pdu = poll_pdu_opts::p8;
rlc_bearer.rlc_cfg.am().ul_am_rlc.poll_byte = poll_byte_opts::infinity;
rlc_bearer.rlc_cfg.am().ul_am_rlc.max_retx_thres = ul_am_rlc_s::max_retx_thres_opts::t8;
rlc_bearer.rlc_cfg.am().dl_am_rlc.t_reassembly = t_reassembly_opts::ms50;
rlc_bearer.rlc_cfg.am().dl_am_rlc.t_status_prohibit = t_status_prohibit_opts::ms50;
#else
rlc_bearer.rlc_cfg.set_um_bi_dir();
rlc_bearer.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len = sn_field_len_um_opts::size12;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len = sn_field_len_um_opts::size12;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.t_reassembly = t_reassembly_opts::ms50;
#endif
// MAC logical channel config
rlc_bearer.mac_lc_ch_cfg_present = true;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params_present = true;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.prio = 11;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.prioritised_bit_rate =
asn1::rrc_nr::lc_ch_cfg_s::ul_specific_params_s_::prioritised_bit_rate_opts::kbps0;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.bucket_size_dur =
asn1::rrc_nr::lc_ch_cfg_s::ul_specific_params_s_::bucket_size_dur_opts::ms100;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.lc_ch_group_present = true;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.lc_ch_group = 6;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.sched_request_id_present = true;
rlc_bearer.mac_lc_ch_cfg.ul_specific_params.sched_request_id = 0;
return SRSRAN_SUCCESS;
}
int rrc_nr::ue::pack_secondary_cell_group_mac_cfg(asn1::rrc_nr::cell_group_cfg_s& cell_group_cfg_pack)
{
// mac-CellGroup-Config for BSR and SR
@ -624,7 +575,6 @@ int rrc_nr::ue::pack_secondary_cell_group_cfg(asn1::dyn_octstring& packed_second
{
auto& cell_group_cfg_pack = cell_group_cfg;
pack_secondary_cell_group_rlc_cfg(cell_group_cfg_pack);
pack_secondary_cell_group_mac_cfg(cell_group_cfg_pack);
pack_secondary_cell_group_sp_cell_cfg(cell_group_cfg_pack);
@ -700,7 +650,7 @@ int rrc_nr::ue::pack_nr_radio_bearer_config(asn1::dyn_octstring& packed_nr_beare
int rrc_nr::ue::handle_sgnb_addition_request(uint16_t eutra_rnti_, const sgnb_addition_req_params_t& req_params)
{
// Add DRB1 to RLC and PDCP
if (add_drb() != SRSRAN_SUCCESS) {
if (add_drb(req_params.five_qi) != SRSRAN_SUCCESS) {
parent->logger.error("Failed to configure DRB");
parent->rrc_eutra->sgnb_addition_reject(eutra_rnti_);
return SRSRAN_ERROR;
@ -773,10 +723,16 @@ void rrc_nr::ue::crnti_ce_received()
* The function sets and configures all relavant fields for the DRB configuration (MAC, RLC, PDCP) in the
* cellGroupConfig and also adds the bearer to the local RLC and PDCP entities.
*
* @param int 5QI of the DRB to be added
* @return int SRSRAN_SUCCESS on success
*/
int rrc_nr::ue::add_drb()
int rrc_nr::ue::add_drb(uint32_t five_qi)
{
if (parent->cfg.five_qi_cfg.find(five_qi) == parent->cfg.five_qi_cfg.end()) {
parent->logger.error("No bearer config for 5QI %d present. Aborting DRB addition.", five_qi);
return SRSRAN_ERROR;
}
// RLC for DRB1 (with fixed LCID) inside cell_group_cfg
auto& cell_group_cfg_pack = cell_group_cfg;
@ -787,21 +743,7 @@ int rrc_nr::ue::add_drb()
rlc_bearer.served_radio_bearer.set_drb_id();
rlc_bearer.served_radio_bearer.drb_id() = 1;
rlc_bearer.rlc_cfg_present = true;
#ifdef USE_RLC_AM_NR
rlc_bearer.rlc_cfg.set_am();
rlc_bearer.rlc_cfg.am().ul_am_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.am().ul_am_rlc.sn_field_len = sn_field_len_am_opts::size12;
rlc_bearer.rlc_cfg.am().dl_am_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.am().dl_am_rlc.sn_field_len = sn_field_len_am_opts::size12;
#else
rlc_bearer.rlc_cfg.set_um_bi_dir();
rlc_bearer.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.um_bi_dir().ul_um_rlc.sn_field_len = sn_field_len_um_opts::size12;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len_present = true;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.sn_field_len = sn_field_len_um_opts::size12;
rlc_bearer.rlc_cfg.um_bi_dir().dl_um_rlc.t_reassembly = t_reassembly_opts::ms50;
#endif
rlc_bearer.rlc_cfg = parent->cfg.five_qi_cfg[five_qi].rlc_cfg;
// add RLC bearer
srsran::rlc_config_t rlc_cfg;
@ -838,17 +780,7 @@ int rrc_nr::ue::add_drb()
drb_item.cn_assoc_present = true;
drb_item.cn_assoc.set_eps_bearer_id() = 5;
drb_item.pdcp_cfg_present = true;
drb_item.pdcp_cfg.ciphering_disabled_present = true;
drb_item.pdcp_cfg.drb_present = true;
drb_item.pdcp_cfg.drb.pdcp_sn_size_dl_present = true;
drb_item.pdcp_cfg.drb.pdcp_sn_size_dl = asn1::rrc_nr::pdcp_cfg_s::drb_s_::pdcp_sn_size_dl_opts::len18bits;
drb_item.pdcp_cfg.drb.pdcp_sn_size_ul_present = true;
drb_item.pdcp_cfg.drb.pdcp_sn_size_ul = asn1::rrc_nr::pdcp_cfg_s::drb_s_::pdcp_sn_size_ul_opts::len18bits;
drb_item.pdcp_cfg.drb.discard_timer_present = true;
drb_item.pdcp_cfg.drb.discard_timer = asn1::rrc_nr::pdcp_cfg_s::drb_s_::discard_timer_opts::ms100;
drb_item.pdcp_cfg.drb.hdr_compress.set_not_used();
drb_item.pdcp_cfg.t_reordering_present = true;
drb_item.pdcp_cfg.t_reordering = asn1::rrc_nr::pdcp_cfg_s::t_reordering_opts::ms0;
drb_item.pdcp_cfg = parent->cfg.five_qi_cfg[five_qi].pdcp_cfg;
// Add DRB1 to PDCP
srsran::pdcp_config_t pdcp_cnfg = srsran::make_drb_pdcp_config_t(drb_item.drb_id, false, drb_item.pdcp_cfg);

Loading…
Cancel
Save