Commit f19fa8ad authored by Bing-Kai Hong's avatar Bing-Kai Hong

Create ITTI procedure for F1

parent 9e5f9bdb
Branches unavailable
2025.w08 2025.w07 2025.w06 2025.w05 2025.w04 2025.w03 2025.w02 2024.w51 2024.w50 2024.w49 2024.w48 2024.w47 2024.w46 2024.w45 2024.w44 2024.w43 2024.w42 2024.w41 2024.w40 2024.w39 2024.w38 2024.w36 2024.w35 2024.w34 2024.w33 2024.w32 2024.w31 2024.w30 2024.w29 2024.w28 2024.w27 2024.w26 2024.w25 2024.w24 2024.w23 2024.w22 2024.w21 2024.w18 2024.w17 2024.w16 2024.w15 2024.w14 2024.w13 2024.w12 2024.w11 2024.w10 2024.w09 2024.w08 2024.w06 2024.w05 2024.w04 2024.w03 2024.w02 2024.w01 2023.w51 2023.w50 2023.w49 2023.w48 2023.w47 2023.w45 2023.w43 2023.w42 2023.w41 2023.w40 2023.w39 2023.w38 2023.w37 2023.w36 2023.w34 2023.w33 2023.w32 2023.w31 2023.w30 2023.w29 2023.w28 2023.w27 2023.w26 2023.w25 2023.w24 2023.w23 2023.w22 2023.w21 2023.w20 2023.w19 2023.w18 2023.w18b 2023.w16 2023.w15 2023.w14 2023.w13 2023.w12 2023.w11 2023.w11b 2023.w10 2023.w10b 2023.w09 2023.w08 2023.w08b 2023.w07 2023.w06 2023.w05 2023.w03 2023.w02 2022.42 2022.41 2022.w51 2022.w50 2022.w49 2022.w48 2022.w47 2022.w46 2022.w45 2022.w43 2022.w42 2022.w42b 2022.w41 2022.w40 2022.w39 2022.w38 2022.w37 2022.w37b 2022.w36 2022.w35 2022.w33 2022.w32 2022.w31 2022.w31b 2022.w30 2022.w29 2022.w26 2022.w25 2022.w24 2022.w24b 2022.w23 2022.w22 2022.w21 2022.w20 2022.w19 2022.w18 2022.w17 2022.w15 2022.w15b 2022.w14a 2022.w13 2022.w13b 2022.w13a 2022.w12 2022.w10 2022.w09 2022.w09b 2022.w08 2022.w08b 2022.w07 2022.w07b 2022.w06 2022.w06a 2022.w05 2022.w05b 2022.w03_hotfix 2022.w03_b 2022.w02 2022.w01 2021.wk46 2021.wk14_a 2021.wk13_d 2021.wk13_c 2021.w51_c 2021.w51_a 2021.w50_a 2021.w49_b 2021.w49_a 2021.w48 2021.w47 2021.w46 2021.w46-powder 2021.w45 2021.w45_b 2021.w44 2021.w43 2021.w42 2021.w37 2021.w36 2021.w35 2021.w34 2021.w33 2021.w32 2021.w31 2021.w30 2021.w29 2021.w28 2021.w27 2021.w26 2021.w25 2021.w24 2021.w23 2021.w22 2021.w20 2021.w19 2021.w18_b 2021.w18_a 2021.w17_b 2021.w16 2021.w15 2021.w14 2021.w13_a 2021.w12 2021.w11 2021.w10 2021.w09 2021.w08 2021.w06 2021.w05 2021.w04 2021.w02 2020.w51_2 2020.w51 2020.w50 2020.w49 2020.w48_2 2020.w48 2020.w47 2020.w46_2 2020.w46 2020.w45_2 2020.w45 2020.w44 2020.w42_2 2020.w42 2020.w41 2020.w39 2020.w38 2020.w37 2020.w36 2020.w34 2020.w33 2020.w31 2020.w30 2020.w29 2020.w28 2020.w26 2020.w25 2020.w24 2020.w23 2020.w22 2020.w19 2020.w17 2020.w16 2020.w15 2020.w11 2020.w09 2020.w06 2020.w05 2020.w04 2020.w03 2019.w51 2019.w44 2019.w41 2019.w36 2019.w30 2019.w28 2019.w27 2019.w25 2019.w23 2019.w21 2019.w17 2019.w15 2019.w13 v2.2.0 v2.1.0 v2.0.0 v1.2.2 v1.2.1 v1.2.0 v1.1.1 v1.1.0 setparam nr-ip-over-lte-v.1.5 nr-ip-over-lte-v.1.4 nr-ip-over-lte-v.1.3 nr-ip-over-lte-v.1.2 nr-ip-over-lte-v.1.1 nr-ip-over-lte-v.1.0 flexran-eol develop-nr-2020w03 develop-nr-2020w02 develop-nr-2019w51 develop-nr-2019w50 develop-nr-2019w48 develop-nr-2019w47 develop-nr-2019w45 develop-nr-2019w43 develop-nr-2019w42 develop-nr-2019w40 benetel_phase_rotation benetel_gnb_rel_2.0 benetel_gnb_rel_1.0 benetel_enb_rel_2.0 benetel_enb_rel_1.0 ARC_1.3
No related merge requests found
......@@ -25,6 +25,8 @@
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
#define F1AP_CU_SCTP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_cu_sctp_req
#define F1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_req
#define F1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_resp
#define F1AP_SETUP_FAILURE(mSGpTR) (mSGpTR)->ittiMsg.f1ap_setup_failure
......
......@@ -53,6 +53,8 @@ TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000)
// GTP_V1U task
TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000)
TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200)
TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200)
/// X2ap task, acts as both source and target
TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
/// Sctp task (Used by both S1AP and X2AP)
......
......@@ -130,7 +130,7 @@ static uint32_t eNB_app_register(ngran_node_t node_type,uint32_t enb_id_start, u
LOG_I(ENB_APP,"[eNB %d] eNB_app_register via F1AP for instance %d\n", enb_id, ENB_MODULE_ID_TO_INSTANCE(enb_id));
AssertFatal(1==0,"No ITTI ask for F1AP yet\n");
// itti_send_msg_to_task (TASK_F1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
itti_send_msg_to_task (TASK_DU_F1, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
// configure GTPu here for F1U
}
else { // S1AP registration
......
......@@ -32,12 +32,12 @@
#include "conversions.h"
#include "f1ap_common.h"
#include "f1ap_messages_types.h"
#include "f1ap_encoder.h"
#include "f1ap_decoder.h"
#include "sctp_cu.h"
#include "platform_types.h"
#include "log.h"
#include "common/utils/LOG/log.h"
#include "intertask_interface.h"
#define MAX_F1AP_BUFFER_SIZE 4096
......@@ -86,46 +86,60 @@ uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_
}
// ==============================================================================
static
void CU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
{
int result;
DevAssert(sctp_data_ind != NULL);
void F1AP_CU_task(void) {
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void *F1AP_CU_task(void *arg) {
printf("Start F1AP CU task!\n");
sctp_cu_init();
//sctp_cu_init();
// MessageDef *received_msg = NULL;
// int result;
MessageDef *received_msg = NULL;
int result;
// F1AP_DEBUG("Starting F1AP layer\n");
//F1AP_DEBUG("Starting F1AP at DU\n");
// f1ap_eNB_prepare_internal_data();
//f1ap_eNB_prepare_internal_data();
// itti_mark_task_ready(TASK_F1AP);
itti_mark_task_ready(TASK_CU_F1);
// while (1) {
// switch (ITTI_MSG_ID(received_msg)) {
// case F1AP_SETUP_RESP:
// CU_send_F1_SETUP_RESPONSE();
// break;
// case F1AP_INITIAL_UL_RRC_MESSAGE:
// CU_handle_UL_INITIAL_RRC_MESSAGE_TRANSFER();
// break;
// case F1AP_DL_RRC_MESSAGE:
// CU_send_DL_RRC_MESSAGE_TRANSFER(); // SRBID and RRCContainer get issue when decode.
// break;
// //CU_send_UE_CONTEXT_SETUP_REQUEST();
// case F1AP_UE_CONTEXT_MODIFICATION_REQ:
// CU_send_UE_CONTEXT_MODIFICATION_REQUEST();
// break;
// //CU_send_gNB_CU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2); // some problem found
while (1) {
switch (ITTI_MSG_ID(received_msg)) {
//case F1AP_CU_SCTP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req
// 2. send a sctp_init req
// CU_send_sctp_init_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_REQ(received_msg));
// break;
// default:
case SCTP_DATA_IND:
CU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
// } // switch
default:
// F1AP_ERROR("CU Received unhandled message: %d:%s\n",
// ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
// } // while
received_msg = NULL;
} // while
return;
return NULL;
}
......
......@@ -32,10 +32,10 @@
#include "conversions.h"
#include "f1ap_common.h"
#include "f1ap_messages_types.h"
#include "platform_types.h"
#include "common/utils/LOG/log.h"
#include "sctp_du.h"
#include "intertask_interface.h"
/* This structure describes association of a DU to a CU */
......@@ -76,6 +76,9 @@ typedef struct f1ap_info {
#define F1AP_UE_IDENTIFIER_NUMBER 3
#define NUMBER_OF_eNB_MAX 3
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
uint8_t F1AP_get_next_transaction_identifier(module_id_t enb_mod_idP, module_id_t du_mod_idP) {
static uint8_t transaction_identifier[NUMBER_OF_eNB_MAX];
transaction_identifier[enb_mod_idP+du_mod_idP] = (transaction_identifier[enb_mod_idP+du_mod_idP] + 1) % F1AP_TRANSACTION_IDENTIFIER_NUMBER;
......@@ -91,36 +94,87 @@ uint8_t F1AP_get_UE_identifier(module_id_t enb_mod_idP, int CC_idP, int UE_id) {
}
// ==============================================================================
static
void DU_handle_sctp_data_ind(sctp_data_ind_t *sctp_data_ind)
{
int result;
DevAssert(sctp_data_ind != NULL);
f1ap_handle_message(sctp_data_ind->assoc_id, sctp_data_ind->stream,
sctp_data_ind->buffer, sctp_data_ind->buffer_length);
result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
void F1AP_DU_task(void) {
void *F1AP_DU_task(void *arg) {
printf("Start F1AP DU task!\n");
sctp_du_init();
//sctp_cu_init();
// while (1) {
MessageDef *received_msg = NULL;
int result;
// switch () {
//F1AP_DEBUG("Starting F1AP at DU\n");
// case F1AP_ProcedureCode_id_F1Setup:
DU_send_F1_SETUP_REQUEST((module_id_t)1, (module_id_t)2);
//f1ap_eNB_prepare_internal_data();
itti_mark_task_ready(TASK_DU_F1);
while (1) {
switch (ITTI_MSG_ID(received_msg)) {
// case TERMINATE_MESSAGE:
// //F1AP_WARN(" *** Exiting F1AP DU thread\n");
// itti_exit_task();
// break;
//DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER();
//DU_send_UL_RRC_MESSAGE_TRANSFER(); // OK
//DU_send_UE_CONTEXT_SETUP_RESPONSE(); // OK
//DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(); // OK
//DU_send_gNB_DU_CONFIGURATION_UPDATE((module_id_t)1, (module_id_t)2);
// default:
// } // switch
//case F1AP_SETUP_REQ: // this is not a true F1 message, but rather an ITTI message sent by enb_app
// 1. save the itti msg so that you can use it to sen f1ap_setup_req
// 2. send a sctp_association req
// DU_send_sctp_association_req(ITTI_MESSAGE_GET_INSTANCE(received_msg),
// &F1AP_SETUP_REQ(received_msg));
// break;
// } // while
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
// 2. send the f1setup_req
DU_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
&received_msg->ittiMsg.sctp_new_association_resp);
break;
return;
case SCTP_DATA_IND:
DU_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
break;
default:
// F1AP_ERROR("DU Received unhandled message: %d:%s\n",
// ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
break;
} // switch
result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
received_msg = NULL;
} // while
return NULL;
}
// ==============================================================================
void DU_send_sctp_association_req(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
{
//
AssertFatal(0,"Not implemented yet\n");
}
void DU_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
{
//
AssertFatal(0,"Not implemented yet\n");
}
// ==============================================================================
......
......@@ -6084,6 +6084,8 @@ openair_rrc_eNB_init(
openair_rrc_on(&ctxt);
if (RC.rrc[ctxt.module_id]->node_type == ngran_eNB_CU || RC.rrc[ctxt.module_id]->node_type == ngran_ng_eNB_CU)
// msg_p = itti_alloc_new_message (TASK_ENB_APP, F1AP_SCTP_REQ);
// RCconfig_CU_F1(msg_p, enb_id);
setup_ngran_CU(RC.rrc[ctxt.module_id]);
return 0;
......
......@@ -31,6 +31,7 @@
#include "ip_forward_messages_types.h"
#include "s11_messages_types.h"
#include "s1ap_messages_types.h"
#include "f1ap_messages_types.h"
#include "nas_messages_types.h"
#include "s6a_messages_types.h"
#include "sctp_messages_types.h"
......
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