Make sure that PDCP SN is initialized properly in the eNB. UE attaches again when using encription.

master
Pedro Alvarez 5 years ago committed by Andre Puschmann
parent 53d2220aab
commit 5d8dcbe4cb

@ -84,9 +84,9 @@ void pdcp_entity::init(srsue::rlc_interface_pdcp *rlc_,
rx_hfn = 0; rx_hfn = 0;
next_pdcp_rx_sn = 0; next_pdcp_rx_sn = 0;
maximum_pdcp_sn = (1 << cfg.sn_len) - 1; maximum_pdcp_sn = (1 << cfg.sn_len) - 1;
printf("Maximum PDCP SN %d\n", maximum_pdcp_sn);
last_submitted_pdcp_rx_sn = maximum_pdcp_sn; last_submitted_pdcp_rx_sn = maximum_pdcp_sn;
log->info("Init %s with bearer ID: %d\n", rrc->get_rb_name(lcid).c_str(), cfg.bearer_id); log->info("Init %s with bearer ID: %d\n", rrc->get_rb_name(lcid).c_str(), cfg.bearer_id);
log->info("SN len bits: %d, SN len bytes: %d, reordering window: %d, Maximum SN %d\n", cfg.sn_len, sn_len_bytes, reordering_window, maximum_pdcp_sn);
} }
// Reestablishment procedure: 36.323 5.2 // Reestablishment procedure: 36.323 5.2

@ -195,6 +195,7 @@ void rrc::add_user(uint16_t rnti)
srslte::srslte_pdcp_config_t cfg; srslte::srslte_pdcp_config_t cfg;
cfg.is_control = false; cfg.is_control = false;
cfg.is_data = true; cfg.is_data = true;
cfg.sn_len = 12;
cfg.direction = SECURITY_DIRECTION_DOWNLINK; cfg.direction = SECURITY_DIRECTION_DOWNLINK;
uint32_t teid_in = 1; uint32_t teid_in = 1;
@ -1529,6 +1530,8 @@ void rrc::ue::send_connection_setup(bool is_setup)
srslte::srslte_pdcp_config_t pdcp_cnfg; srslte::srslte_pdcp_config_t pdcp_cnfg;
pdcp_cnfg.bearer_id = 1; pdcp_cnfg.bearer_id = 1;
pdcp_cnfg.is_control = true; pdcp_cnfg.is_control = true;
pdcp_cnfg.is_data = false;
pdcp_cnfg.sn_len = 5;
pdcp_cnfg.direction = SECURITY_DIRECTION_DOWNLINK; pdcp_cnfg.direction = SECURITY_DIRECTION_DOWNLINK;
parent->pdcp->add_bearer(rnti, 1, pdcp_cnfg); parent->pdcp->add_bearer(rnti, 1, pdcp_cnfg);
@ -1739,6 +1742,7 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
pdcp_cnfg.direction = SECURITY_DIRECTION_DOWNLINK; pdcp_cnfg.direction = SECURITY_DIRECTION_DOWNLINK;
pdcp_cnfg.is_control = true; pdcp_cnfg.is_control = true;
pdcp_cnfg.is_data = false; pdcp_cnfg.is_data = false;
pdcp_cnfg.sn_len = 5;
parent->pdcp->add_bearer(rnti, 2, pdcp_cnfg); parent->pdcp->add_bearer(rnti, 2, pdcp_cnfg);
parent->pdcp->config_security(rnti, 2, k_rrc_enc, k_rrc_int, k_up_enc, cipher_algo, integ_algo); parent->pdcp->config_security(rnti, 2, k_rrc_enc, k_rrc_int, k_up_enc, cipher_algo, integ_algo);
parent->pdcp->enable_integrity(rnti, 2); parent->pdcp->enable_integrity(rnti, 2);
@ -1750,6 +1754,7 @@ void rrc::ue::send_connection_reconf(srslte::unique_byte_buffer_t pdu)
// Configure DRB1 in PDCP // Configure DRB1 in PDCP
pdcp_cnfg.is_control = false; pdcp_cnfg.is_control = false;
pdcp_cnfg.is_data = true; pdcp_cnfg.is_data = true;
pdcp_cnfg.sn_len = 12;
pdcp_cnfg.bearer_id = 1; // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping pdcp_cnfg.bearer_id = 1; // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping
if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um_present) { if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um_present) {
if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um.pdcp_sn_size.value == if (conn_reconf->rr_cfg_ded.drb_to_add_mod_list[0].pdcp_cfg.rlc_um.pdcp_sn_size.value ==
@ -1812,10 +1817,13 @@ void rrc::ue::send_connection_reconf_new_bearer(LIBLTE_S1AP_E_RABTOBESETUPLISTBE
// Configure DRB in RLC // Configure DRB in RLC
parent->rlc->add_bearer(rnti, lcid, &drb_item.rlc_cfg); parent->rlc->add_bearer(rnti, lcid, &drb_item.rlc_cfg);
// Configure DRB in PDCP // Configure DRB in PDCP
srslte::srslte_pdcp_config_t pdcp_config; srslte::srslte_pdcp_config_t pdcp_config;
pdcp_config.bearer_id = drb_item.drb_id - 1; // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping pdcp_config.bearer_id = drb_item.drb_id - 1; // TODO: Review all ID mapping LCID DRB ERAB EPSBID Mapping
pdcp_config.is_control = false;
pdcp_config.is_data = true; pdcp_config.is_data = true;
pdcp_config.sn_len = 12;
pdcp_config.direction = SECURITY_DIRECTION_DOWNLINK; pdcp_config.direction = SECURITY_DIRECTION_DOWNLINK;
parent->pdcp->add_bearer(rnti, lcid, pdcp_config); parent->pdcp->add_bearer(rnti, lcid, pdcp_config);

Loading…
Cancel
Save