transmission of RRCReestablishmentRequest message

This commit is contained in:
francescomani
2024-03-13 17:57:28 +01:00
parent bfe77c7f29
commit bb19306797
12 changed files with 98 additions and 25 deletions
+8 -5
View File
@@ -979,7 +979,10 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer, uint32_t pdu_length, uint8
return encoded;
}
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer, uint16_t c_rnti)
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti)
{
asn_enc_rval_t enc_rval;
NR_UL_CCCH_Message_t ul_ccch_msg;
@@ -994,16 +997,16 @@ uint8_t do_RRCReestablishmentRequest(uint8_t *buffer, uint16_t c_rnti)
rrcReestablishmentRequest = ul_ccch_msg.message.choice.c1->choice.rrcReestablishmentRequest;
// test
rrcReestablishmentRequest->rrcReestablishmentRequest.reestablishmentCause = NR_ReestablishmentCause_reconfigurationFailure;
rrcReestablishmentRequest->rrcReestablishmentRequest.reestablishmentCause = cause;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.c_RNTI = c_rnti;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.physCellId = 0;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.physCellId = cell_id;
// TODO properly setting shortMAC-I (see 5.3.7.4 of 331)
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf = buf;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[0] = 0x08;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.buf[1] = 0x32;
rrcReestablishmentRequest->rrcReestablishmentRequest.ue_Identity.shortMAC_I.size = 2;
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
if (LOG_DEBUGFLAG(DEBUG_ASN1)) {
xer_fprint(stdout, &asn_DEF_NR_UL_CCCH_Message, (void *)&ul_ccch_msg);
}
+4 -1
View File
@@ -131,7 +131,10 @@ uint8_t do_NR_ULInformationTransfer(uint8_t **buffer,
uint32_t pdu_length,
uint8_t *pdu_buffer);
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer, uint16_t c_rnti);
uint8_t do_RRCReestablishmentRequest(uint8_t *buffer,
NR_ReestablishmentCause_t cause,
uint32_t cell_id,
uint16_t c_rnti);
int do_RRCReestablishment(rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t *const buffer,
+4 -1
View File
@@ -54,6 +54,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
const frame_t frame,
const int slot,
const rnti_t rnti,
const uint32_t cellid,
const channel_t channel,
const uint8_t* pduP,
const sdu_size_t pdu_len)
@@ -84,6 +85,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
NR_RRC_MAC_BCCH_DATA_IND (message_p).slot = slot;
NR_RRC_MAC_BCCH_DATA_IND (message_p).sdu_size = sdu_size;
NR_RRC_MAC_BCCH_DATA_IND (message_p).gnb_index = gNB_index;
NR_RRC_MAC_BCCH_DATA_IND (message_p).phycellid = cellid;
NR_RRC_MAC_BCCH_DATA_IND (message_p).is_bch = (channel == NR_BCCH_BCH);
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(module_id), message_p);
}
@@ -122,10 +124,11 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
return(0);
}
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti)
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, int gnb_id)
{
MessageDef *message_p = itti_alloc_new_message(TASK_MAC_UE, 0, NR_RRC_MAC_MSG3_IND);
NR_RRC_MAC_MSG3_IND (message_p).rnti = rnti;
NR_RRC_MAC_MSG3_IND (message_p).gnb_id = gnb_id;
itti_send_msg_to_task(TASK_RRC_NRUE, GNB_MODULE_ID_TO_INSTANCE(mod_id), message_p);
}
+31 -6
View File
@@ -428,10 +428,12 @@ int check_si_status(NR_UE_RRC_SI_INFO *SI_info)
/*brief decode BCCH-BCH (MIB) message*/
static void nr_rrc_ue_decode_NR_BCCH_BCH_Message(NR_UE_RRC_INST_t *rrc,
const uint8_t gNB_index,
const uint32_t phycellid,
uint8_t *const bufferP,
const uint8_t buffer_len)
{
NR_BCCH_BCH_Message_t *bcch_message = NULL;
rrc->phyCellID = phycellid;
asn_dec_rval_t dec_rval = uper_decode_complete(NULL,
&asn_DEF_NR_BCCH_BCH_Message,
@@ -448,9 +450,17 @@ static void nr_rrc_ue_decode_NR_BCCH_BCH_Message(NR_UE_RRC_INST_t *rrc,
NR_UE_Timers_Constants_t *timers = &rrc->timers_and_constants;
if (is_nr_timer_active(timers->T311)) {
nr_timer_stop(&timers->T311);
nr_timer_start(&timers->T301);
rrc->ra_trigger = RRC_CONNECTION_REESTABLISHMENT;
// preparing MSG3 for re-establishment in advance
uint8_t buffer[1024];
int buf_size = do_RRCReestablishmentRequest(buffer,
rrc->reestablishment_cause,
rrc->phyCellID,
rrc->rnti); // old rnti
nr_rlc_srb_recv_sdu(rrc->ue_id, 0, buffer, buf_size);
// apply the default MAC Cell Group configuration
// (done at MAC by calling nr_ue_mac_default_configs)
@@ -590,16 +600,28 @@ static int nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si)
static void nr_rrc_handle_msg3_indication(NR_UE_RRC_INST_t *rrc, rnti_t rnti)
{
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
switch (rrc->ra_trigger) {
case INITIAL_ACCESS_FROM_RRC_IDLE:
// After SIB1 is received, prepare RRCConnectionRequest
rrc->rnti = rnti;
// start timer T300
NR_UE_Timers_Constants_t *tac = &rrc->timers_and_constants;
nr_timer_start(&tac->T300);
break;
case RRC_CONNECTION_REESTABLISHMENT:
AssertFatal(1==0, "ra_trigger not implemented yet!\n");
rrc->rnti = rnti;
nr_timer_start(&tac->T301);
int srb_id = 1;
// re-establish PDCP for SRB1
nr_pdcp_reestablishment(rrc->ue_id, srb_id, true);
// re-establish RLC for SRB1
int lc_id = nr_rlc_get_lcid_from_rb(rrc->ue_id, true, 1);
nr_rlc_reestablish_entity(rrc->ue_id, lc_id);
// apply the specified configuration defined in 9.2.1 for SRB1
nr_rlc_reconfigure_entity(rrc->ue_id, lc_id, NULL);
// TODO configure lower layers to suspend integrity protection and ciphering for SRB1
// resume SRB1
rrc->Srb[srb_id] = RB_ESTABLISHED;
break;
case DURING_HANDOVER:
AssertFatal(1==0, "ra_trigger not implemented yet!\n");
@@ -750,7 +772,8 @@ static void nr_rrc_manage_rlc_bearers(NR_UE_RRC_INST_t *rrc,
if (rrc->active_RLC_entity[lcid]) {
if (rlc_bearer->reestablishRLC)
nr_rlc_reestablish_entity(rrc->ue_id, lcid);
nr_rlc_reconfigure_entity(rrc->ue_id, lcid, rlc_bearer->rlc_Config);
if (rlc_bearer->rlc_Config)
nr_rlc_reconfigure_entity(rrc->ue_id, lcid, rlc_bearer->rlc_Config);
} else {
rrc->active_RLC_entity[lcid] = true;
AssertFatal(rlc_bearer->servedRadioBearer, "servedRadioBearer mandatory in case of setup\n");
@@ -1467,7 +1490,7 @@ void *rrc_nrue(void *notUsed)
LOG_D(NR_RRC, "[UE %ld] Received %s: gNB %d\n", rrc->ue_id, ITTI_MSG_NAME(msg_p), NR_RRC_MAC_BCCH_DATA_IND(msg_p).gnb_index);
NRRrcMacBcchDataInd *bcch = &NR_RRC_MAC_BCCH_DATA_IND(msg_p);
if (bcch->is_bch)
nr_rrc_ue_decode_NR_BCCH_BCH_Message(rrc, bcch->gnb_index, bcch->sdu, bcch->sdu_size);
nr_rrc_ue_decode_NR_BCCH_BCH_Message(rrc, bcch->gnb_index, bcch->phycellid, bcch->sdu, bcch->sdu_size);
else
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(rrc, bcch->gnb_index, bcch->sdu, bcch->sdu_size, bcch->rsrq, bcch->rsrp);
break;
@@ -1615,8 +1638,11 @@ static void nr_rrc_ue_process_ueCapabilityEnquiry(NR_UE_RRC_INST_t *rrc, NR_UECa
}
void nr_rrc_initiate_rrcReestablishment(NR_UE_RRC_INST_t *rrc,
NR_ReestablishmentCause_t cause,
const int gnb_id)
{
rrc->reestablishment_cause = cause;
NR_UE_Timers_Constants_t *timers = &rrc->timers_and_constants;
rrcPerNB_t *rrcNB = rrc->perNB + gnb_id;
@@ -1645,7 +1671,6 @@ void nr_rrc_initiate_rrcReestablishment(NR_UE_RRC_INST_t *rrc,
}
// release the MCG SCell(s), if configured
// no SCell configured in our implementation
rrc->nrRrcState = RRC_STATE_REESTABLISHMENT;
// reset MAC
// release spCellConfig, if configured
+4 -1
View File
@@ -56,6 +56,7 @@
#include "NR_UE-NR-Capability.h"
#include "NR_SL-PreconfigurationNR-r16.h"
#include "NR_MasterInformationBlockSidelink.h"
#include "NR_ReestablishmentCause.h"
#include "RRC/NR/nr_rrc_common.h"
#include "as_message.h"
@@ -85,7 +86,6 @@ typedef enum Rrc_State_NR_e {
RRC_STATE_INACTIVE_NR,
RRC_STATE_CONNECTED_NR,
RRC_STATE_DETACH_NR,
RRC_STATE_REESTABLISHMENT
} Rrc_State_NR_t;
typedef enum requested_SI_List_e {
@@ -186,10 +186,13 @@ typedef struct NR_UE_RRC_INST_s {
rrcPerNB_t perNB[NB_CNX_UE];
rnti_t rnti;
uint32_t phyCellID;
OAI_NR_UECapability_t UECap;
NR_UE_Timers_Constants_t timers_and_constants;
RA_trigger_t ra_trigger;
NR_ReestablishmentCause_t reestablishment_cause;
plmn_t plmnID;
NR_BWP_Id_t dl_bwp_id;
+2 -1
View File
@@ -73,6 +73,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
const frame_t frame,
const int slot,
const rnti_t rnti,
const uint32_t cellid,
const channel_t channel,
const uint8_t* pduP,
const sdu_size_t pdu_len);
@@ -86,7 +87,7 @@ void nr_rrc_going_to_IDLE(NR_UE_RRC_INST_t *rrc,
NR_RRCRelease_t *RRCRelease);
void nr_mac_rrc_ra_ind(const module_id_t mod_id, int frame, bool success);
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti);
void nr_mac_rrc_msg3_ind(const module_id_t mod_id, const int rnti, int gnb_id);
void set_rlf_sib1_timers_and_constants(NR_UE_Timers_Constants_t *tac, NR_SIB1_t *sib1);
/**\brief RRC UE task.