Commit 36b8bb1b authored by matzakos's avatar matzakos

Trigger UE context modification request at the CU upon reception of PDU...

Trigger UE context modification request at the CU upon reception of PDU Session Resource setup request from the AMF

-F1 message successfully encoded at the CU (including SRB2, DRB and F1-U tunnel configuration) and received from the DU.
-Next steps: handling of UE context modification request at the DU and triggering the UE context setup response towards the CU.
parent a84ecd14
......@@ -46,6 +46,8 @@ MESSAGE_DEF(F1AP_DL_RRC_MESSAGE , MESSAGE_PRIORITY_MED, f1ap_dl_rrc
//MESSAGE_DEF(F1AP_INITIAL_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED, f1ap_initial_context_setup_req_t , f1ap_initial_context_setup_req )
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_SETUP_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_setup_resp)
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_REQ, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_req)
MESSAGE_DEF(F1AP_UE_CONTEXT_MODIFICATION_RESP, MESSAGE_PRIORITY_MED, f1ap_ue_context_setup_t, f1ap_ue_context_modification_resp)
......
......@@ -39,15 +39,15 @@
#define F1AP_INITIAL_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_initial_ul_rrc_message
#define F1AP_UL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ul_rrc_message
#define F1AP_UE_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_req
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_setup_resp
#define F1AP_UE_CONTEXT_RELEASE_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_resp
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
#define F1AP_UE_CONTEXT_MODIFICATION_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_resp
#define F1AP_UE_CONTEXT_MODIFICATION_FAIL(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_fail
#define F1AP_DL_RRC_MESSAGE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_dl_rrc_message
#define F1AP_UE_CONTEXT_RELEASE_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_RELEASE_CMD(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_release_req
#define F1AP_UE_CONTEXT_MODIFICATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_ue_context_modification_req
/* Length of the transport layer address string
* 160 bits / 8 bits by char.
......@@ -352,6 +352,11 @@ typedef struct cu_to_du_rrc_information_s {
uint8_t measConfig_length;
}cu_to_du_rrc_information_t;
typedef enum QoS_information_e {
NG_RAN_QoS = 0,
EUTRAN_QoS = 1,
} QoS_information_t;
typedef struct f1ap_ue_context_setup_s {
uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t gNB_DU_ue_id;
......@@ -370,6 +375,7 @@ typedef struct f1ap_ue_context_setup_s {
uint8_t du_to_cu_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
QoS_information_t QoS_information_type;
uint8_t drbs_failed_to_be_setup_length;
f1ap_rb_failed_to_be_setup_t *drbs_failed_to_be_setup;
f1ap_srb_to_be_setup_t *srbs_to_be_setup;
......
......@@ -180,6 +180,12 @@ void * F1AP_CU_task(void *arg) {
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
break;
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
LOG_I(F1AP, "CU Task received F1AP_UE_CONTEXT_MODIFICATION_REQ\n");
CU_send_UE_CONTEXT_MODIFICATION_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_UE_CONTEXT_MODIFICATION_REQ(received_msg));
break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
LOG_I(F1AP, "CU Task Received F1AP_UE_CONTEXT_RELEASE_CMD\n");
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
......
......@@ -72,7 +72,8 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
/*
* UE Context Modification (gNB-CU initiated)
*/
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance);
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance,
f1ap_ue_context_setup_t *f1ap_ue_context_modification_req);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
......
......@@ -78,6 +78,10 @@ static int f1ap_decode_initiating_message(F1AP_F1AP_PDU_t *pdu) {
case F1AP_ProcedureCode_id_UEContextSetup:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextSetup\n", __func__);
break;
case F1AP_ProcedureCode_id_UEContextModification:
LOG_I(F1AP, "%s(): F1AP_ProcedureCode_id_UEContextModification\n", __func__);
break;
// case F1AP_ProcedureCode_id_InitialContextSetup:
// res = asn_encode_to_new_buffer(NULL, ATS_CANONICAL_XER, &asn_DEF_F1AP_F1AP_PDU, pdu);
......
......@@ -3979,6 +3979,10 @@ void *rrc_gnb_task(void *args_p) {
rrc_CU_process_ue_context_setup_response(msg_p, msg_name_p, instance);
break;
case F1AP_UE_CONTEXT_MODIFICATION_REQ:
LOG_I(NR_RRC, "F1AP_UE_CONTEXT_MODIFICATION_REQ itti message received from the F1AP layer of the DU \n");
break;
/* Messages from X2AP */
case X2AP_ENDC_SGNB_ADDITION_REQ:
LOG_I(NR_RRC, "Received ENDC sgNB addition request from X2AP \n");
......
......@@ -1111,7 +1111,51 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
// TEST
// ue_context_p->ue_context.pdusession[0].status = PDU_SESSION_STATUS_DONE;
// rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(&ctxt, ue_context_p, 0);
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, NULL);
if(!NODE_IS_CU(RC.nrrrc[ctxt.module_id]->node_type)){
rrc_gNB_generate_dedicatedRRCReconfiguration(&ctxt, ue_context_p, NULL);
}
else{
/*Generate a UE context modification request message towards the DU to instruct the DU
*for SRB2 and DRB configuration and get the updates on master cell group config from the DU*/
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_MODIFICATION_REQ);
f1ap_ue_context_setup_t *req=&F1AP_UE_CONTEXT_MODIFICATION_REQ (message_p);
//UE_IDs will be extracted from F1AP layer
req->gNB_CU_ue_id = 0;
req->gNB_DU_ue_id = 0;
req->rnti = ue_context_p->ue_context.rnti;
req->mcc = RC.nrrrc[ctxt.module_id]->configuration.mcc[0];
req->mnc = RC.nrrrc[ctxt.module_id]->configuration.mnc[0];
req->mnc_digit_length = RC.nrrrc[ctxt.module_id]->configuration.mnc_digit_length[0];
req->nr_cellid = RC.nrrrc[ctxt.module_id]->nr_cellid;
//if (ue_context_p->ue_context.established_pdu_sessions_flag == 1) {
/*Instruction towards the DU for SRB2 configuration*/
req->srbs_to_be_setup = malloc(1*sizeof(f1ap_srb_to_be_setup_t));
req->srbs_to_be_setup_length = 1;
f1ap_srb_to_be_setup_t *SRBs=req->srbs_to_be_setup;
SRBs[0].srb_id = 2;
SRBs[0].lcid = 2;
/*Instruction towards the DU for DRB configuration and tunnel creation*/
gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
req->drbs_to_be_setup = malloc(1*sizeof(f1ap_drb_to_be_setup_t));
req->drbs_to_be_setup_length = 1;
f1ap_drb_to_be_setup_t *DRBs=req->drbs_to_be_setup;
LOG_I(RRC, "Length of DRB list:%d \n", req->drbs_to_be_setup_length);
DRBs[0].drb_id = 1;
DRBs[0].rlc_mode = RLC_MODE_AM;
DRBs[0].up_ul_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.my_addr);
DRBs[0].up_ul_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.my_portd;
DRBs[0].up_ul_tnl_length = 1;
DRBs[0].up_dl_tnl[0].tl_address = inet_addr(RC.nrrrc[ctxt.module_id]->eth_params_s.remote_addr);
DRBs[0].up_dl_tnl[0].port=RC.nrrrc[ctxt.module_id]->eth_params_s.remote_portd;
DRBs[0].up_dl_tnl_length = 1;
//}
itti_send_msg_to_task (TASK_CU_F1, ctxt.module_id, message_p);
}
return(0);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment