Compare commits

...

1 Commits

Author SHA1 Message Date
Maud Tribaudeau
c40cceb4ba reestablishment for LTE 2023-08-10 09:55:46 +00:00
7 changed files with 347 additions and 243 deletions

View File

@@ -148,6 +148,7 @@ pthread_t pdcp_stats_thread_desc;
* \param[in] kRRCenc RRC encryption key
* \param[in] kRRCint RRC integrity key
* \param[in] kUPenc User-Plane encryption key
* \param[in] reestablisment_on_going status to know if reestablisment is on going
* \return A status about the processing, OK or error code.
*/
static bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
@@ -164,7 +165,8 @@ static bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP);
uint8_t *const kUPenc_pP,
bool reestablisment_on_going);
void *pdcp_stats_thread(void *param) {
@@ -1523,17 +1525,17 @@ bool pdcp_remove_UE(const protocol_ctxt_t *const ctxt_pP)
//-----------------------------------------------------------------------------
bool
rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list_pP,
LTE_DRB_ToAddModList_t *const drb2add_list_pP,
LTE_DRB_ToReleaseList_t *const drb2release_list_pP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP,
LTE_PMCH_InfoList_r9_t *const pmch_InfoList_r9_pP,
rb_id_t *const defaultDRB)
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list_pP,
LTE_DRB_ToAddModList_t *const drb2add_list_pP,
LTE_DRB_ToReleaseList_t *const drb2release_list_pP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP,
LTE_PMCH_InfoList_r9_t *const pmch_InfoList_r9_pP,
rb_id_t *const defaultDRB,
const rnti_t previous_rnti_for_reestab)
//-----------------------------------------------------------------------------
{
long int lc_id = 0;
@@ -1551,13 +1553,17 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddMod_t *srb_toaddmod_p = NULL;
LTE_DRB_ToAddMod_t *drb_toaddmod_p = NULL;
pdcp_t *pdcp_p = NULL;
pdcp_t *pdcp_p_previous = NULL;
hash_key_t key = HASHTABLE_NOT_A_KEY_VALUE;
hash_key_t key_previous = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_rc;
hashtable_rc_t h_rc_previous;
hash_key_t key_defaultDRB = HASHTABLE_NOT_A_KEY_VALUE;
hashtable_rc_t h_defaultDRB_rc;
int i,j;
LTE_MBMS_SessionInfoList_r9_t *mbms_SessionInfoList_r9_p = NULL;
LTE_MBMS_SessionInfo_r9_t *MBMS_SessionInfo_p = NULL;
bool reestablishment_ongoing = previous_rnti_for_reestab == NOT_A_RNTI ? false : true;
LOG_T(PDCP, PROTOCOL_CTXT_FMT" %s() SRB2ADD %p DRB2ADD %p DRB2RELEASE %p\n",
PROTOCOL_CTXT_ARGS(ctxt_pP),
__FUNCTION__,
@@ -1610,44 +1616,44 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
break;
default:
pdcp_config_req_asn1 (
ctxt_pP,
pdcp_p,
SRB_FLAG_YES,
rlc_type,
action,
lc_id,
mch_id,
srb_id,
srb_sn,
0, // drb_report
0, // header compression
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP);
pdcp_config_req_asn1(ctxt_pP,
pdcp_p,
SRB_FLAG_YES,
rlc_type,
action,
lc_id,
mch_id,
srb_id,
srb_sn,
0, // drb_report
0, // header compression
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP,
reestablishment_ongoing);
break;
}
break;
case LTE_SRB_ToAddMod__rlc_Config_PR_defaultValue:
pdcp_config_req_asn1 (
ctxt_pP,
pdcp_p,
SRB_FLAG_YES,
rlc_type,
action,
lc_id,
mch_id,
srb_id,
srb_sn,
0, // drb_report
0, // header compression
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP);
pdcp_config_req_asn1(ctxt_pP,
pdcp_p,
SRB_FLAG_YES,
rlc_type,
action,
lc_id,
mch_id,
srb_id,
srb_sn,
0, // drb_report
0, // header compression
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP,
reestablishment_ongoing);
// already the default values
break;
@@ -1729,6 +1735,21 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
drb_report = drb_toaddmod_p->pdcp_Config->rlc_AM->statusReportRequired;
drb_sn = LTE_PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits; // default SN size
rlc_type = RLC_MODE_AM;
if (reestablishment_ongoing) { // we need to keep previous SN numbers for reestablishment in AM mode
key_previous =
PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, previous_rnti_for_reestab, ctxt_pP->enb_flag, drb_id, SRB_FLAG_NO);
h_rc_previous = hashtable_get(pdcp_coll_p, key_previous, (void **)&pdcp_p_previous);
LOG_I(PDCP,
"SEE DRB pdcp_previous->next_pdcp_tx_sn=%d pdcp_previous->next_pdcp_rx_sn=%d\n",
pdcp_p_previous->next_pdcp_tx_sn,
pdcp_p_previous->next_pdcp_rx_sn);
pdcp_p->next_pdcp_tx_sn = pdcp_p_previous->next_pdcp_tx_sn;
pdcp_p->next_pdcp_rx_sn = pdcp_p_previous->next_pdcp_rx_sn;
pdcp_p->tx_hfn = pdcp_p_previous->tx_hfn;
pdcp_p->rx_hfn = pdcp_p_previous->rx_hfn;
pdcp_p->last_submitted_pdcp_rx_sn = pdcp_p_previous->last_submitted_pdcp_rx_sn;
pdcp_p->first_missing_pdu = -1;
}
}
if (drb_toaddmod_p->pdcp_Config->rlc_UM) {
@@ -1777,22 +1798,22 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
break;
}
pdcp_config_req_asn1 (
ctxt_pP,
pdcp_p,
SRB_FLAG_NO,
rlc_type,
action,
lc_id,
mch_id,
drb_id,
drb_sn,
drb_report,
header_compression_profile,
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP);
pdcp_config_req_asn1(ctxt_pP,
pdcp_p,
SRB_FLAG_NO,
rlc_type,
action,
lc_id,
mch_id,
drb_id,
drb_sn,
drb_report,
header_compression_profile,
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP,
reestablishment_ongoing);
}
}
}
@@ -1813,22 +1834,22 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
lc_id = pdcp_p->lcid;
action = CONFIG_ACTION_REMOVE;
pdcp_config_req_asn1 (
ctxt_pP,
pdcp_p,
SRB_FLAG_NO,
rlc_type,
action,
lc_id,
mch_id,
drb_id,
0,
0,
0,
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP);
pdcp_config_req_asn1(ctxt_pP,
pdcp_p,
SRB_FLAG_NO,
rlc_type,
action,
lc_id,
mch_id,
drb_id,
0,
0,
0,
security_modeP,
kRRCenc_pP,
kRRCint_pP,
kUPenc_pP,
reestablishment_ongoing);
h_rc = hashtable_remove(pdcp_coll_p, key);
if ((defaultDRB != NULL) && (*defaultDRB == drb_id)) {
@@ -1888,22 +1909,22 @@ rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
MBMS_SessionInfo_p->tmgi_r9.serviceId_r9.buf[2],
drb_id,
action);
pdcp_config_req_asn1 (
ctxt_pP,
NULL, // unused for MBMS
SRB_FLAG_NO,
RLC_MODE_NONE,
action,
lc_id,
mch_id,
drb_id,
0, // unused for MBMS
0, // unused for MBMS
0, // unused for MBMS
0, // unused for MBMS
NULL, // unused for MBMS
NULL, // unused for MBMS
NULL); // unused for MBMS
pdcp_config_req_asn1(ctxt_pP,
NULL, // unused for MBMS
SRB_FLAG_NO,
RLC_MODE_NONE,
action,
lc_id,
mch_id,
drb_id,
0, // unused for MBMS
0, // unused for MBMS
0, // unused for MBMS
0, // unused for MBMS
NULL, // unused for MBMS
NULL, // unused for MBMS
NULL,
reestablishment_ongoing); // unused for MBMS
}
}
}
@@ -1924,7 +1945,8 @@ static bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
const uint8_t security_modeP,
uint8_t *const kRRCenc_pP,
uint8_t *const kRRCint_pP,
uint8_t *const kUPenc_pP)
uint8_t *const kUPenc_pP,
bool reestablisment_on_going)
//-----------------------------------------------------------------------------
{
@@ -1975,12 +1997,14 @@ static bool pdcp_config_req_asn1(const protocol_ctxt_t *const ctxt_pP,
}
pdcp_pP->rlc_mode = rlc_modeP;
pdcp_pP->next_pdcp_tx_sn = 0;
pdcp_pP->next_pdcp_rx_sn = 0;
pdcp_pP->tx_hfn = 0;
pdcp_pP->rx_hfn = 0;
pdcp_pP->last_submitted_pdcp_rx_sn = 4095;
pdcp_pP->first_missing_pdu = -1;
if (!reestablisment_on_going && rlc_modeP != RLC_MODE_AM) {
pdcp_pP->next_pdcp_tx_sn = 0;
pdcp_pP->next_pdcp_rx_sn = 0;
pdcp_pP->tx_hfn = 0;
pdcp_pP->rx_hfn = 0;
pdcp_pP->last_submitted_pdcp_rx_sn = 4095;
pdcp_pP->first_missing_pdu = -1;
}
LOG_I(PDCP, PROTOCOL_PDCP_CTXT_FMT" Action ADD LCID %d (%s id %ld) "
"configured with SN size %d bits and RLC %s\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),

View File

@@ -297,30 +297,29 @@ void rrc_pdcp_config_req (
const rb_id_t rb_idP,
const uint8_t security_modeP);
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t* drb2add_list, DRB_ToReleaseList_t* drb2release_list)
* \brief Function for RRC to configure a Radio Bearer.
* \param[in] ctxt_pP Running context.
* \param[in] index index of UE or eNB depending on the eNB_flag
* \param[in] srb2add_list SRB configuration list to be created.
* \param[in] drb2add_list DRB configuration list to be created.
* \param[in] drb2release_list DRB configuration list to be released.
* \param[in] security_mode Security algorithm to apply for integrity/ciphering
* \param[in] kRRCenc RRC encryption key
* \param[in] kRRCint RRC integrity key
* \param[in] kUPenc User-Plane encryption key
* \param[in] defaultDRB Default DRB ID
* \return A status about the processing, OK or error code.
*/
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list,
/*! \fn bool rrc_pdcp_config_asn1_req (const protocol_ctxt_t* const , SRB_ToAddModList_t* srb2add_list, DRB_ToAddModList_t*
* drb2add_list, DRB_ToReleaseList_t* drb2release_list) \brief Function for RRC to configure a Radio Bearer. \param[in] ctxt_pP
* Running context. \param[in] index index of UE or eNB depending on the eNB_flag \param[in] srb2add_list SRB
* configuration list to be created. \param[in] drb2add_list DRB configuration list to be created. \param[in] drb2release_list
* DRB configuration list to be released. \param[in] security_mode Security algorithm to apply for integrity/ciphering
* \param[in] kRRCenc RRC encryption key
* \param[in] kRRCint RRC integrity key
* \param[in] kUPenc User-Plane encryption key
* \param[in] defaultDRB Default DRB ID
* \param[in] previous_rnti_for_reestab rnti in case of reestablishment to get previous pdcp context
* \return A status about the processing, OK or error code.
*/
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list,
LTE_DRB_ToReleaseList_t *const drb2release_list,
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kRRCint,
uint8_t *const kUPenc,
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
rb_id_t *const defaultDRB);
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kRRCint,
uint8_t *const kUPenc,
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
rb_id_t *const defaultDRB,
const rnti_t previous_rnti_for_reestab);
/*! \fn void pdcp_add_UE(const protocol_ctxt_t* const ctxt_pP)
* \brief Function (for RRC) to add a new UE in PDCP module

View File

@@ -939,16 +939,17 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
}
/* Dummy function due to dependency from LTE libraries */
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list,
bool rrc_pdcp_config_asn1_req(const protocol_ctxt_t *const ctxt_pP,
LTE_SRB_ToAddModList_t *const srb2add_list,
LTE_DRB_ToAddModList_t *const drb2add_list,
LTE_DRB_ToReleaseList_t *const drb2release_list,
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kRRCint,
uint8_t *const kUPenc,
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
rb_id_t *const defaultDRB)
const uint8_t security_modeP,
uint8_t *const kRRCenc,
uint8_t *const kRRCint,
uint8_t *const kUPenc,
LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9,
rb_id_t *const defaultDRB,
const rnti_t previous_rnti_for_reestab)
{
return 0;
}

View File

@@ -1252,17 +1252,18 @@ rrc_ue_process_radioResourceConfigDedicated(
derive_key_nas(RRC_INT_ALG, UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm, UE_rrc_inst[ctxt_pP->module_id].kenb, kRRCint);
// Refresh SRBs
rrc_pdcp_config_asn1_req(ctxt_pP,
radioResourceConfigDedicated->srb_ToAddModList,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm |
(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4),
kRRCenc,
kRRCint,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL);
rrc_pdcp_config_asn1_req(
ctxt_pP,
radioResourceConfigDedicated->srb_ToAddModList,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | (UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4),
kRRCenc,
kRRCint,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
// Refresh SRBs
rrc_rlc_config_asn1_req(ctxt_pP,
radioResourceConfigDedicated->srb_ToAddModList,
@@ -1400,17 +1401,18 @@ rrc_ue_process_radioResourceConfigDedicated(
derive_key_nas(UP_ENC_ALG, UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm, UE_rrc_inst[ctxt_pP->module_id].kenb, kUPenc);
// Refresh DRBs
rrc_pdcp_config_asn1_req(ctxt_pP,
(LTE_SRB_ToAddModList_t *)NULL,
radioResourceConfigDedicated->drb_ToAddModList,
(LTE_DRB_ToReleaseList_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm |
(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4),
NULL,
NULL,
kUPenc,
(LTE_PMCH_InfoList_r9_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].defaultDRB);
rrc_pdcp_config_asn1_req(
ctxt_pP,
(LTE_SRB_ToAddModList_t *)NULL,
radioResourceConfigDedicated->drb_ToAddModList,
(LTE_DRB_ToReleaseList_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm | (UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4),
NULL,
NULL,
kUPenc,
(LTE_PMCH_InfoList_r9_t *)NULL,
UE_rrc_inst[ctxt_pP->module_id].defaultDRB,
0);
// Refresh DRBs
rrc_rlc_config_asn1_req(ctxt_pP,
(LTE_SRB_ToAddModList_t *)NULL,
@@ -4832,8 +4834,8 @@ void decode_MBSFNAreaConfiguration( module_id_t ue_mod_idP, uint8_t eNB_index, f
NULL, // key rrc integrity
NULL, // key encryption
&(UE_rrc_inst[ue_mod_idP].mcch_message[eNB_index]->pmch_InfoList_r9),
NULL
);
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
NULL,// SRB_ToAddModList
NULL,// DRB_ToAddModList
@@ -5828,12 +5830,16 @@ void *rrc_control_socket_thread_fct(void *arg) {
UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t));
asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]);
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *) NULL,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,
(LTE_DRB_ToReleaseList_t *) NULL,
0xff, NULL, NULL, NULL,
(LTE_PMCH_InfoList_r9_t *) NULL
,NULL);
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,
@@ -6033,11 +6039,16 @@ void *rrc_control_socket_thread_fct(void *arg) {
UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t));
asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]);
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *) NULL,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,
(LTE_DRB_ToReleaseList_t *) NULL,
0xff, NULL, NULL, NULL,
(LTE_PMCH_InfoList_r9_t *) NULL,NULL);
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,
@@ -6187,11 +6198,16 @@ void *rrc_control_socket_thread_fct(void *arg) {
UE->DRB_configList = CALLOC(1,sizeof(LTE_DRB_ToAddModList_t));
asn1cSeqAdd(&UE->DRB_configList->list,UE->DRB_config[0][0]);
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *) NULL,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,
(LTE_DRB_ToReleaseList_t *) NULL,
0xff, NULL, NULL, NULL,
(LTE_PMCH_InfoList_r9_t *) NULL,NULL);
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL,
UE->DRB_configList,

View File

@@ -528,15 +528,17 @@ static void init_MBMS(
LOG_D(RRC, "[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", enb_mod_idP, frameP); //check the lcid
// Configuring PDCP and RLC for MBMS Radio Bearer
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL, // LTE_SRB_ToAddModList
(LTE_DRB_ToAddModList_t *)NULL, // LTE_DRB_ToAddModList
(LTE_SRB_ToAddModList_t *)NULL, // LTE_SRB_ToAddModList
(LTE_DRB_ToAddModList_t *)NULL, // LTE_DRB_ToAddModList
(LTE_DRB_ToReleaseList_t *)NULL,
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
, &(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,NULL);
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
,
&(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9),
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
NULL, // LTE_SRB_ToAddModList
@@ -1195,12 +1197,8 @@ rrc_eNB_generate_RRCConnectionReestablishment(
rrc_eNB_carrier_data_t *carrier = NULL;
eNB_RRC_UE_t *ue_context = NULL;
module_id_t module_id = ctxt_pP->module_id;
uint16_t rnti = ctxt_pP->rntiMaybeUEid;
T(T_ENB_RRC_CONNECTION_REESTABLISHMENT,
T_INT(module_id),
T_INT(ctxt_pP->frame),
T_INT(ctxt_pP->subframe),
T_INT(rnti));
uint16_t new_rnti = ctxt_pP->rntiMaybeUEid;
T(T_ENB_RRC_CONNECTION_REESTABLISHMENT, T_INT(module_id), T_INT(ctxt_pP->frame), T_INT(ctxt_pP->subframe), T_INT(new_rnti));
SRB_configList = &(ue_context_pP->ue_context.SRB_configList);
carrier = &(RC.rrc[ctxt_pP->module_id]->carrier[CC_id]);
ue_context = &(ue_context_pP->ue_context);
@@ -1251,7 +1249,7 @@ rrc_eNB_generate_RRCConnectionReestablishment(
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
ue_context->Srb0.Tx_buffer.payload_size);
UE_id = find_UE_id(module_id, rnti);
UE_id = find_UE_id(module_id, new_rnti);
if (UE_id != -1) {
/* Activate reject timer, if RRCComplete not received after 10 frames, reject UE */
@@ -1259,9 +1257,10 @@ rrc_eNB_generate_RRCConnectionReestablishment(
/* Reject UE after 10 frames, LTE_RRCConnectionReestablishmentReject is triggered */
RC.mac[module_id]->UE_info.UE_sched_ctrl[UE_id].ue_reestablishment_reject_timer_thres = 100;
} else {
LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Generating LTE_RRCConnectionReestablishment without UE_id(MAC) rnti %x\n",
LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT " Generating LTE_RRCConnectionReestablishment without UE_id(MAC) rnti %x\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
rnti);
new_rnti);
}
}
@@ -1793,6 +1792,29 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
rrc_pdcp_config_asn1_req(ctxt_pP,
*SRB_configList2, // NULL,
DRB_configList,
NULL,
0xff, // already configured during the securitymodecommand
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
reestablish_rnti);
// /* Refresh SRBs/DRBs */
// if (!NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
// {
// rrc_rlc_config_asn1_req(ctxt_pP,
// *SRB_configList2, // NULL,
// DRB_configList,
// NULL, (LTE_PMCH_InfoList_r9_t *)NULL,
// 0,
// 0);
// }
}
LOG_I(RRC, "[RRCConnectionReestablishment]put UE %x into freeList\n", reestablish_rnti);
@@ -3217,9 +3239,10 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
0xff, // already configured during the securitymodecommand
NULL,
NULL,
NULL
, (LTE_PMCH_InfoList_r9_t *) NULL
, NULL);
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
@@ -5045,9 +5068,10 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
0xff, // already configured during the securitymodecommand
NULL,
NULL,
NULL
, (LTE_PMCH_InfoList_r9_t *) NULL
, NULL);
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
@@ -5094,13 +5118,15 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protoc
// Configure PDCP/RLC for the target
rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *) NULL, NULL);
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, (LTE_DRB_ToAddModList_t *)NULL, (LTE_DRB_ToReleaseList_t *)NULL, (LTE_PMCH_InfoList_r9_t *)NULL, 0, 0);
@@ -5192,8 +5218,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
kRRCenc,
kRRCint,
kUPenc,
(LTE_PMCH_InfoList_r9_t *) NULL,
NULL);
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
/* Refresh SRBs/DRBs */
rrc_rlc_config_asn1_req(ctxt_pP,
@@ -5630,7 +5657,7 @@ rrc_eNB_decode_ccch(
(rrcConnectionReestablishmentRequest->reestablishmentCause == LTE_ReestablishmentCause_handoverFailure) ? "Handover Failure" :
"reconfigurationFailure"));
{
uint16_t c_rnti = 0;
uint16_t old_rnti = 0;
if (rrcConnectionReestablishmentRequest->ue_Identity.physCellId != RC.rrc[ctxt_pP->module_id]->carrier[CC_id].physCellId) {
/* UE was moving from previous cell so quickly that RRCConnectionReestablishment for previous cell was recieved in this cell */
@@ -5662,9 +5689,9 @@ rrc_eNB_decode_ccch(
break;
}
c_rnti = BIT_STRING_to_uint16(&rrcConnectionReestablishmentRequest->ue_Identity.c_RNTI);
LOG_I(RRC, "reestablishment, previous c_rnti is %x (new is %lx)\n", c_rnti, ctxt_pP->rntiMaybeUEid);
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], c_rnti);
old_rnti = BIT_STRING_to_uint16(&rrcConnectionReestablishmentRequest->ue_Identity.c_RNTI);
LOG_I(RRC, "reestablishment, previous rnti is %x (new is %lx)\n", old_rnti, ctxt_pP->rntiMaybeUEid);
ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt_pP->module_id], old_rnti);
if (ue_context_p == NULL) {
LOG_E(RRC,
@@ -5675,12 +5702,14 @@ rrc_eNB_decode_ccch(
break;
}
int UE_id = find_UE_id(ctxt_pP->module_id, c_rnti);
int UE_id = find_UE_id(ctxt_pP->module_id, old_rnti);
if(UE_id == -1) {
LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" LTE_RRCConnectionReestablishmentRequest without UE_id(MAC) rnti %x, let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),c_rnti);
PROTOCOL_RRC_CTXT_UE_FMT
" LTE_RRCConnectionReestablishmentRequest without UE_id(MAC) rnti %x, let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
old_rnti);
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id);
break;
}
@@ -5695,23 +5724,25 @@ rrc_eNB_decode_ccch(
ue_context_p->ue_context.ue_reestablishment_timer = 0;
}
//previous rnti
rnti_t previous_rnti = 0;
// Check if we already have a request on going for same rnti (old)
rnti_t previous_new_rnti = 0;
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (reestablish_rnti_map[i][1] == c_rnti) {
previous_rnti = reestablish_rnti_map[i][0];
if (reestablish_rnti_map[i][1] == old_rnti) {
previous_new_rnti = reestablish_rnti_map[i][0];
break;
}
}
if(previous_rnti != 0) {
UE_id = find_UE_id(ctxt_pP->module_id, previous_rnti);
if (previous_new_rnti != 0) {
UE_id = find_UE_id(ctxt_pP->module_id, previous_new_rnti);
if(UE_id == -1) {
LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionReestablishmentRequest without UE_id(MAC) previous rnti %x, let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),previous_rnti);
PROTOCOL_RRC_CTXT_UE_FMT
" RRCConnectionReestablishmentRequest without UE_id(MAC) previous rnti %x, let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
previous_new_rnti);
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id);
break;
}
@@ -5730,8 +5761,10 @@ rrc_eNB_decode_ccch(
//c-plane not end
if((ue_context_p->ue_context.StatusRrc != RRC_RECONFIGURED) && (ue_context_p->ue_context.reestablishment_cause == LTE_ReestablishmentCause_spare1)) {
LOG_E(RRC,
PROTOCOL_RRC_CTXT_UE_FMT" LTE_RRCConnectionReestablishmentRequest (UE %x c-plane is not end), let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),c_rnti);
PROTOCOL_RRC_CTXT_UE_FMT
" LTE_RRCConnectionReestablishmentRequest (UE %x c-plane is not end), let's reject the UE\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
old_rnti);
rrc_eNB_generate_RRCConnectionReestablishmentReject(ctxt_pP, ue_context_p, CC_id);
break;
}
@@ -5746,7 +5779,7 @@ rrc_eNB_decode_ccch(
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt_old_p,
ctxt_pP->instance,
ENB_FLAG_YES,
c_rnti,
old_rnti,
ctxt_pP->frame,
ctxt_pP->subframe);
rrc_eNB_process_RRCConnectionReconfigurationComplete(&ctxt_old_p,
@@ -5777,8 +5810,8 @@ rrc_eNB_decode_ccch(
// insert C-RNTI to map
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (reestablish_rnti_map[i][0] == 0) {
reestablish_rnti_map[i][0] = ctxt_pP->rntiMaybeUEid;
reestablish_rnti_map[i][1] = c_rnti;
reestablish_rnti_map[i][0] = ctxt_pP->rntiMaybeUEid; // New rnti
reestablish_rnti_map[i][1] = old_rnti;
LOG_D(RRC, "reestablish_rnti_map[%d] [0] %x, [1] %x\n",
i, reestablish_rnti_map[i][0], reestablish_rnti_map[i][1]);
break;
@@ -5786,6 +5819,10 @@ rrc_eNB_decode_ccch(
}
ue_context_p->ue_context.reestablishment_cause = rrcConnectionReestablishmentRequest->reestablishmentCause;
ue_context_p->ue_context.StatusRrc = RRC_INACTIVE; // Ue should be inactive !
ue_context_p->ue_context.rnti =
ctxt_pP->rntiMaybeUEid; // We need to talk to the UE with the new rnti for RRCConnectionReestablishment
LOG_D(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept connection reestablishment request from UE physCellId %ld cause %ld\n",
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
rrcConnectionReestablishmentRequest->ue_Identity.physCellId,
@@ -5817,14 +5854,15 @@ rrc_eNB_decode_ccch(
Idx);
rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL
, (LTE_PMCH_InfoList_r9_t *) NULL
,NULL);
NULL,
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, NULL, NULL, NULL, 0, 0);
}
@@ -5994,13 +6032,15 @@ rrc_eNB_decode_ccch(
Idx);
rrc_pdcp_config_asn1_req(ctxt_pP,
ue_context_p->ue_context.SRB_configList,
(LTE_DRB_ToAddModList_t *) NULL,
(LTE_DRB_ToReleaseList_t *) NULL,
(LTE_DRB_ToAddModList_t *)NULL,
(LTE_DRB_ToReleaseList_t *)NULL,
0xff,
NULL,
NULL,
NULL,
(LTE_PMCH_InfoList_r9_t *) NULL,NULL);
(LTE_PMCH_InfoList_r9_t *)NULL,
NULL,
0);
rrc_rlc_config_asn1_req(ctxt_pP, ue_context_p->ue_context.SRB_configList, NULL, NULL, NULL, 0, 0);
@@ -6563,9 +6603,7 @@ rrc_eNB_decode_dcch(
for (i = 0; i < MAX_MOBILES_PER_ENB; i++) {
if (reestablish_rnti_map[i][0] == ctxt_pP->rntiMaybeUEid) {
reestablish_rnti = reestablish_rnti_map[i][1];
ue_context_p = rrc_eNB_get_ue_context(
RC.rrc[ctxt_pP->module_id],
reestablish_rnti);
LOG_D(RRC, "reestablish_rnti = %x,\n", reestablish_rnti);
// clear currentC-RNTI from map
reestablish_rnti_map[i][0] = 0;
reestablish_rnti_map[i][1] = 0;

View File

@@ -268,15 +268,17 @@ static void rrc_M2AP_init_MBMS(
LOG_I(RRC, "[eNB %d] Frame %d : Radio Bearer config request for MBMS\n", enb_mod_idP, frameP); //check the lcid
// Configuring PDCP and RLC for MBMS Radio Bearer
rrc_pdcp_config_asn1_req(&ctxt,
(LTE_SRB_ToAddModList_t *)NULL, // LTE_SRB_ToAddModList
(LTE_DRB_ToAddModList_t *)NULL, // LTE_DRB_ToAddModList
(LTE_SRB_ToAddModList_t *)NULL, // LTE_SRB_ToAddModList
(LTE_DRB_ToAddModList_t *)NULL, // LTE_DRB_ToAddModList
(LTE_DRB_ToReleaseList_t *)NULL,
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
, &(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9)
,NULL);
0, // security mode
NULL, // key rrc encryption
NULL, // key rrc integrity
NULL // key encryption
,
&(RC.rrc[enb_mod_idP]->carrier[CC_id].mcch_message->pmch_InfoList_r9),
NULL,
0);
rrc_rlc_config_asn1_req(&ctxt,
NULL, // LTE_SRB_ToAddModList

View File

@@ -706,22 +706,46 @@ int gtpv1u_update_s1u_tunnel(
pthread_mutex_lock(&globGtp.gtp_lock);
getInstRetInt(compatInst(instance));
if ( inst->ue2te_mapping.find(create_tunnel_req->rnti) == inst->ue2te_mapping.end() ) {
LOG_E(GTPU,"[%ld] Update not already existing tunnel (new rnti %x, old rnti %x)\n",
instance, create_tunnel_req->rnti, prior_rnti);
// Check if tunnels already exist for new rnti
if (inst->ue2te_mapping.find(create_tunnel_req->rnti) != inst->ue2te_mapping.end()) {
LOG_E(GTPU, "[%ld] Update already existing tunnel for new rnti %x\n", instance, create_tunnel_req->rnti);
return -1;
}
// Check if tunnels exists for old rnti because we should take these tunnels.
// If we do not have tunnels, we create new one to not stop the software
auto it=inst->ue2te_mapping.find(prior_rnti);
if ( it != inst->ue2te_mapping.end() ) {
if (it == inst->ue2te_mapping.end()) {
LOG_W(GTPU,
"[%ld] Update a not existing tunnel, start create the new one (new rnti %x, old rnti %x)\n",
instance,
create_tunnel_req->rnti,
prior_rnti);
pthread_mutex_unlock(&globGtp.gtp_lock);
AssertFatal(false, "logic bug: update of non-existing tunnel (new ue id %u, old ue id %u)\n", create_tunnel_req->rnti, prior_rnti);
/* we don't know if we need 4G or 5G PDCP and can therefore not create a
* new tunnel */
gtpv1u_enb_create_tunnel_resp_t tmp;
(void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp, pdcp_data_req);
return 0;
}
// If tunnels exist for old rnti, we use them for new rnti
inst->ue2te_mapping[create_tunnel_req->rnti]=it->second;
// Replace old RNTI by new one in te2ue_mapping
teid_t teid_incoming, teid_outcoming = 0;
for (int i = 0; i < create_tunnel_req->num_tunnels; i++) {
teid_incoming = it->second.bearers[create_tunnel_req->eps_bearer_id[i]].teid_incoming;
teid_outcoming = create_tunnel_req->sgw_S1u_teid[i];
globGtp.te2ue_mapping[teid_incoming].ue_id = create_tunnel_req->rnti;
LOG_I(GTPU,
"[%ld] Updated tunnel (new rnti %x, old rnti %x) DL teid =%x UL teid =%x\n",
instance,
create_tunnel_req->rnti,
prior_rnti,
teid_incoming,
teid_outcoming);
}
// Remove old rnti value from ue2te_mapping
inst->ue2te_mapping.erase(it);
pthread_mutex_unlock(&globGtp.gtp_lock);
return 0;