From: Ron Shacham Date: Thu, 26 Nov 2020 03:40:48 +0000 (-0500) Subject: Additional fixes to KPM X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=commitdiff_plain;h=118b51ae4e036b90a198faa700435a01ae9297ca Additional fixes to KPM Signed-off-by: Ron Shacham Change-Id: Ibf4e3c0344870c4b8d5c63ae25d42dbee5964907 --- diff --git a/e2sim/e2sm_examples/kpm_e2sm/Dockerfile b/e2sim/e2sm_examples/kpm_e2sm/Dockerfile index 01bcac5..409de86 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/Dockerfile +++ b/e2sim/e2sm_examples/kpm_e2sm/Dockerfile @@ -102,4 +102,4 @@ RUN cd /playpen/src && \ make install -CMD kpm_sim 10.106.115.58 36422 +CMD kpm_sim 10.98.20.146 36422 diff --git a/e2sim/e2sm_examples/kpm_e2sm/README b/e2sim/e2sm_examples/kpm_e2sm/README new file mode 100644 index 0000000..54018e1 --- /dev/null +++ b/e2sim/e2sm_examples/kpm_e2sm/README @@ -0,0 +1,8 @@ + +For this simulation, we make the following assumptions: +DU ID can differ and we assign a separate ID +CU-CP and CU-UP are always the same +Cell Identities are different + +FQI and QFI Values are the same + diff --git a/e2sim/e2sm_examples/kpm_e2sm/README~ b/e2sim/e2sm_examples/kpm_e2sm/README~ new file mode 100644 index 0000000..0ae429d --- /dev/null +++ b/e2sim/e2sm_examples/kpm_e2sm/README~ @@ -0,0 +1,6 @@ + +For this simulation, we make the following assumptions: +DU ID can differ and we assign a separate ID +CU-CP and CU-UP are always the same +Cell Identities are different + diff --git a/e2sim/e2sm_examples/kpm_e2sm/e2sim-dev_1.0.0_amd64.deb b/e2sim/e2sm_examples/kpm_e2sm/e2sim-dev_1.0.0_amd64.deb new file mode 100644 index 0000000..2e62d12 Binary files /dev/null and b/e2sim/e2sm_examples/kpm_e2sm/e2sim-dev_1.0.0_amd64.deb differ diff --git a/e2sim/e2sm_examples/kpm_e2sm/e2sim_1.0.0_amd64.deb b/e2sim/e2sm_examples/kpm_e2sm/e2sim_1.0.0_amd64.deb new file mode 100644 index 0000000..06c5543 Binary files /dev/null and b/e2sim/e2sm_examples/kpm_e2sm/e2sim_1.0.0_amd64.deb differ diff --git a/e2sim/e2sm_examples/kpm_e2sm/helm/templates/deployment.yaml b/e2sim/e2sm_examples/kpm_e2sm/helm/templates/deployment.yaml index 6ea5f8d..84676db 100755 --- a/e2sim/e2sm_examples/kpm_e2sm/helm/templates/deployment.yaml +++ b/e2sim/e2sm_examples/kpm_e2sm/helm/templates/deployment.yaml @@ -36,5 +36,5 @@ spec: - name: e2sim image: e2simul:0.0.2 imagePullPolicy: IfNotPresent - restartPolicy: Always + restartPolicy: Never diff --git a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.cpp b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.cpp index c625a0d..613e793 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.cpp +++ b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.cpp @@ -172,14 +172,17 @@ void encode_kpm_function_description(E2SM_KPM_RANfunction_Description_t* ranfunc ASN_SEQUENCE_ADD(&ranfunc_desc->e2SM_KPM_RANfunction_Item.ric_ReportStyle_List->list, report_style6); xer_fprint(stderr, &asn_DEF_E2SM_KPM_RANfunction_Description, ranfunc_desc); -} +} -void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead) { +void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead, uint8_t *plmnid_buf, uint8_t *sst_buf, uint8_t *sd_buf, + long fqival, long qcival, uint8_t *nrcellid_buf, uint8_t *gnbid_buf, int gnbid_unused, + uint8_t *cuupid_buf, uint8_t *duid_buf, uint8_t *cuupname_buf) { - uint8_t *plmnid_buf = (uint8_t*)"747"; - uint8_t *sst_buf = (uint8_t*)"1"; - uint8_t *sd_buf = (uint8_t*)"100"; + + //uint8_t *plmnid_buf = (uint8_t*)"747"; + //uint8_t *sst_buf = (uint8_t*)"1"; + //uint8_t *sd_buf = (uint8_t*)"100"; E2SM_KPM_IndicationHeader_Format1_t* ind_header = (E2SM_KPM_IndicationHeader_Format1_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_Format1_t)); @@ -189,8 +192,8 @@ void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead) { plmnid->size = 3; memcpy(plmnid->buf, plmnid_buf, plmnid->size); - long fqival = 9; - long qcival = 9; + // long fqival = 9; + // long qcival = 9; OCTET_STRING_t *sst = (OCTET_STRING_t*)calloc(1, sizeof(OCTET_STRING_t)); sst->size = 6; @@ -217,44 +220,49 @@ void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead) { BIT_STRING_t *nrcellid = (BIT_STRING_t*)calloc(1, sizeof(BIT_STRING_t));; nrcellid->buf = (uint8_t*)calloc(1,5); nrcellid->size = 5; + memcpy(nrcellid->buf, nrcellid_buf, 5); + /* nrcellid->buf[0] = 0x22; nrcellid->buf[1] = 0x5B; nrcellid->buf[2] = 0xD6; nrcellid->buf[3] = 0x00; nrcellid->buf[4] = 0x70; - + */ nrcellid->bits_unused = 4; BIT_STRING_t *gnb_bstring = (BIT_STRING_t*)calloc(1, sizeof(BIT_STRING_t));; gnb_bstring->buf = (uint8_t*)calloc(1,4); gnb_bstring->size = 4; + memcpy(gnb_bstring->buf, gnbid_buf, 4); + /* gnb_bstring->buf[0] = 0xB5; gnb_bstring->buf[1] = 0xC6; gnb_bstring->buf[2] = 0x77; gnb_bstring->buf[3] = 0x88; + */ - gnb_bstring->bits_unused = 3; + gnb_bstring->bits_unused = gnbid_unused; INTEGER_t *cuup_id = (INTEGER_t*)calloc(1, sizeof(INTEGER_t)); - uint8_t buffer[1]; - buffer[0] = 20000; + // uint8_t buffer[1]; + // buffer[0] = 20000; cuup_id->buf = (uint8_t*)calloc(1,1); - memcpy(cuup_id->buf, buffer, 1); + memcpy(cuup_id->buf, cuupid_buf, 1); cuup_id->size = 1; INTEGER_t *du_id = (INTEGER_t*)calloc(1, sizeof(INTEGER_t)); - uint8_t buffer_duid[1]; - buffer_duid[0] = 20000; + // uint8_t buffer_duid[1]; + // buffer_duid[0] = 20000; du_id->buf = (uint8_t*)calloc(1,1); - memcpy(du_id->buf, buffer_duid, 1); + memcpy(du_id->buf, duid_buf, 1); du_id->size = 1; - uint8_t *buf5 = (uint8_t*)"GNBCUUP5"; + // uint8_t *buf5 = (uint8_t*)"GNBCUUP5"; OCTET_STRING_t *cuupname = (OCTET_STRING_t*)calloc(1, sizeof(OCTET_STRING_t)); cuupname->size = 8; cuupname->buf = (uint8_t*)calloc(1,8); - memcpy(cuupname->buf, buf5, cuupname->size); + memcpy(cuupname->buf, cuupname_buf, cuupname->size); ind_header->id_GlobalKPMnode_ID = (GlobalKPMnode_ID*)calloc(1,sizeof(GlobalKPMnode_ID)); @@ -281,7 +289,7 @@ void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead) { ind_header->gNB_Name->present = GNB_Name_PR_gNB_CU_UP_Name; ind_header->gNB_Name->choice.gNB_CU_UP_Name = *cuupname; - + ind_header->global_GNB_ID = (GlobalgNB_ID*)calloc(1,sizeof(GlobalgNB_ID)); ind_header->global_GNB_ID->plmn_id = *plmnid; ind_header->global_GNB_ID->gnb_id.present = GNB_ID_Choice_PR_gnb_ID; @@ -498,7 +506,8 @@ void encode_kpm_ocucp_user_level(RAN_Container_t *ranco, NRCellIdentity_t *nrcellid = (NRCellIdentity_t*)calloc(1,sizeof(NRCellIdentity_t)); - int nrcellid_size = strlen((char*)nrcellid_buf); + // int nrcellid_size = strlen((char*)nrcellid_buf); + int nrcellid_size = 5; nrcellid->buf = (uint8_t*)calloc(1, nrcellid_size); memcpy(nrcellid->buf, nrcellid_buf, nrcellid_size); nrcellid->size = 5; @@ -673,7 +682,8 @@ void encode_kpm_odu_user_level(RAN_Container_t *ranco, NRCellIdentity_t *nrcellid = (NRCellIdentity_t*)calloc(1,sizeof(NRCellIdentity_t)); - int nrcellid_size = strlen((char*)nrcellid_buf); + // int nrcellid_size = strlen((char*)nrcellid_buf); + int nrcellid_size = 5; nrcellid->buf = (uint8_t*)calloc(1,nrcellid_size); memcpy(nrcellid->buf, nrcellid_buf, nrcellid_size); nrcellid->size = nrcellid_size; @@ -740,6 +750,9 @@ void encode_kpm_report_rancontainer_du_parameterized(E2SM_KPM_IndicationMessage_ RAN_Container_t *ranco = (RAN_Container_t*)calloc(1,sizeof(RAN_Container_t)); encode_kpm_odu_user_level(ranco,plmnid_buf,nrcellid_buf,crnti_buf,prb_usage_dl,prb_usage_ul); + printf("After creating RAN container, xer printing it\n"); + xer_fprint(stderr, &asn_DEF_RAN_Container, ranco); + PM_Containers_List_t *containers_list = (PM_Containers_List_t*)calloc(1, sizeof(PM_Containers_List_t)); ASN_STRUCT_RESET(asn_DEF_PM_Containers_List, containers_list); containers_list->theRANContainer = ranco; @@ -763,7 +776,7 @@ void encode_kpm_report_rancontainer_du_parameterized(E2SM_KPM_IndicationMessage_ printf("error length %d\n", errlen); printf("error buf %s\n", error_buf); - // xer_fprint(stderr, &asn_DEF_E2SM_KPM_IndicationMessage, indicationmessage); + xer_fprint(stderr, &asn_DEF_E2SM_KPM_IndicationMessage, indicationmessage); asn_codec_ctx_t *opt_cod; @@ -797,6 +810,10 @@ void encode_kpm_report_rancontainer_cucp_parameterized(E2SM_KPM_IndicationMessag nrcellid_buf, crnti_buf, serving_buf, neighbor_buf); + printf("After creating RAN container, xer printing it\n"); + xer_fprint(stderr, &asn_DEF_RAN_Container, ranco); + + PM_Containers_List_t *containers_list = (PM_Containers_List_t*)calloc(1, sizeof(PM_Containers_List_t)); ASN_STRUCT_RESET(asn_DEF_PM_Containers_List, containers_list); containers_list->theRANContainer = ranco; @@ -902,6 +919,9 @@ void encode_kpm_report_rancontainer_cuup_parameterized(E2SM_KPM_IndicationMessag RAN_Container_t *ranco = (RAN_Container_t*)calloc(1,sizeof(RAN_Container_t)); encode_kpm_ocuup_user_level(ranco,plmnid_buf,nrcellid_buf,crnti_buf,pdcp_bytesdl,pdcp_bytesul); + fprintf(stderr, "After creating RAN container, xer printing it\n"); + xer_fprint(stderr, &asn_DEF_RAN_Container, ranco); + PM_Containers_List_t *containers_list = (PM_Containers_List_t*)calloc(1, sizeof(PM_Containers_List_t)); ASN_STRUCT_RESET(asn_DEF_PM_Containers_List, containers_list); containers_list->theRANContainer = ranco; @@ -925,7 +945,7 @@ void encode_kpm_report_rancontainer_cuup_parameterized(E2SM_KPM_IndicationMessag printf("error length %d\n", errlen); printf("error buf %s\n", error_buf); - // xer_fprint(stderr, &asn_DEF_E2SM_KPM_IndicationMessage, indicationmessage); + xer_fprint(stderr, &asn_DEF_E2SM_KPM_IndicationMessage, indicationmessage); asn_codec_ctx_t *opt_cod; diff --git a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.hpp b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.hpp index 51eb4dd..db533d5 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.hpp +++ b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/encode_kpm.hpp @@ -42,7 +42,7 @@ void encode_kpm_odu_user_level(RAN_Container_t *ranco); void encode_kpm_ocucp_user_level(RAN_Container_t *ranco); -void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead); +void encode_e2sm_kpm_indication_header(E2SM_KPM_IndicationHeader_t *ihead, uint8_t *plmnid_buf, uint8_t *sst_buf, uint8_t *sd_buf, long fqival, long qcival, uint8_t *nrcellid_buf, uint8_t *gnbid_buf, int gnbid_unused, uint8_t *cuupid_buf, uint8_t *duid_buf, uint8_t *cuupname_buf); void encode_kpm_ocuup_user_level(RAN_Container_t *ranco); diff --git a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp index 8171d3f..773c938 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp +++ b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp @@ -129,6 +129,14 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long json all_ues_json; + long fqival = 9; + long qcival = 9; + + uint8_t *plmnid_buf = (uint8_t*)"747"; + uint8_t *sst_buf = (uint8_t*)"1"; + uint8_t *sd_buf = (uint8_t*)"100"; + + fprintf(stderr,"De line is %s\n", str.c_str()); bool valid = false; @@ -247,8 +255,28 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long fprintf(stderr,"Creating UE-level RAN-Container CUCP message\n"); const uint8_t *neighbor_buf = reinterpret_cast(neighbor_str.c_str()); - uint8_t *plmnid_buf = (uint8_t*)"747"; - uint8_t *nrcellid_buf = (uint8_t*)"12340"; + + // uint8_t *nrcellid_buf = (uint8_t*)"12340"; + uint8_t *nrcellid_buf = (uint8_t*)calloc(1,5); + nrcellid_buf[0] = 0x22; + nrcellid_buf[1] = 0x5B; + nrcellid_buf[2] = 0xD6; + nrcellid_buf[3] = 0x00; + nrcellid_buf[4] = 0x70; + + uint8_t *gnbid_buf = (uint8_t*)calloc(1,3); + gnbid_buf[0] = 0x22; + gnbid_buf[1] = 0x5B; + gnbid_buf[2] = 0xD6; + + uint8_t cuupid_buf[1]; + cuupid_buf[0] = 20000; + + uint8_t duid_buf[1]; + duid_buf[0] = 20000; + + uint8_t *cuupname_buf = (uint8_t*)"GNBCUUP5"; + E2SM_KPM_IndicationMessage_t *ind_msg_cucp_ue = (E2SM_KPM_IndicationMessage_t*)calloc(1,sizeof(E2SM_KPM_IndicationMessage_t)); @@ -271,7 +299,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long E2SM_KPM_IndicationHeader_t* ind_header_cucp_ue = (E2SM_KPM_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_t)); - encode_e2sm_kpm_indication_header(ind_header_cucp_ue); + encode_e2sm_kpm_indication_header(ind_header_cucp_ue, plmnid_buf, sst_buf, sd_buf, fqival, qcival, nrcellid_buf, gnbid_buf, 0, cuupid_buf, duid_buf, cuupname_buf); fprintf(stderr, "Now printing xer outside of function call\n"); xer_fprint(stderr, &asn_DEF_E2SM_KPM_IndicationHeader, ind_header_cucp_ue); @@ -329,7 +357,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long E2SM_KPM_IndicationHeader_t* ind_header_cuup_ue = (E2SM_KPM_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_t)); - encode_e2sm_kpm_indication_header(ind_header_cuup_ue); + encode_e2sm_kpm_indication_header(ind_header_cuup_ue, plmnid_buf, sst_buf, sd_buf, fqival, qcival, nrcellid_buf, gnbid_buf, 0, cuupid_buf, duid_buf, cuupname_buf); uint8_t e2sm_header_buf_cuup_ue[8192]; size_t e2sm_header_buf_size_cuup_ue = 8192; @@ -382,7 +410,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long E2SM_KPM_IndicationHeader_t* ind_header_du_ue = (E2SM_KPM_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_t)); - encode_e2sm_kpm_indication_header(ind_header_du_ue); + encode_e2sm_kpm_indication_header(ind_header_du_ue, plmnid_buf, sst_buf, sd_buf, fqival, qcival, nrcellid_buf, gnbid_buf, 0, cuupid_buf, duid_buf, cuupname_buf); uint8_t e2sm_header_buf_du_ue[8192]; size_t e2sm_header_buf_size_du_ue = 8192; @@ -443,12 +471,32 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long prb_ul = all_ues_json[p3].get(); fprintf(stderr, "Avail PRB UL %d\n", prb_ul); - uint8_t *buf = (uint8_t*)"GNBCUUP5"; uint8_t *sst_buf = (uint8_t*)"1"; uint8_t *sd_buf = (uint8_t*)"100"; uint8_t *plmnid_buf = (uint8_t*)"747"; + uint8_t *nrcellid_buf = (uint8_t*)calloc(1,5); + nrcellid_buf[0] = 0x22; + nrcellid_buf[1] = 0x5B; + nrcellid_buf[2] = 0xD6; + nrcellid_buf[3] = 0x00; + nrcellid_buf[4] = 0x70; + + uint8_t *gnbid_buf = (uint8_t*)calloc(1,3); + gnbid_buf[0] = 0x22; + gnbid_buf[1] = 0x5B; + gnbid_buf[2] = 0xD6; + + uint8_t cuupid_buf[1]; + cuupid_buf[0] = 200; + + uint8_t duid_buf[1]; + duid_buf[0] = 300; + + uint8_t *cuupname_buf = (uint8_t*)"GNBCUUP5"; + + //Encoding Style 5 Message Body fprintf(stderr, "Encoding Style 5 Message body\n"); @@ -459,7 +507,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long (E2SM_KPM_IndicationMessage_t*)calloc(1,sizeof(E2SM_KPM_IndicationMessage_t)); E2AP_PDU *pdu_style5 = (E2AP_PDU*)calloc(1,sizeof(E2AP_PDU)); - encode_kpm_report_style5_parameterized(ind_msg_style5 , buf, bytes_dl, bytes_ul, sst_buf, sd_buf, plmnid_buf); + encode_kpm_report_style5_parameterized(ind_msg_style5 , cuupname_buf, bytes_dl, bytes_ul, sst_buf, sd_buf, plmnid_buf); uint8_t e2sm_message_buf_style5[8192]; size_t e2sm_message_buf_size_style5 = 8192; @@ -477,7 +525,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long E2SM_KPM_IndicationHeader_t* ind_header_style5 = (E2SM_KPM_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_t)); - encode_e2sm_kpm_indication_header(ind_header_style5); + encode_e2sm_kpm_indication_header(ind_header_style5, plmnid_buf, sst_buf, sd_buf, fqival, qcival, nrcellid_buf, gnbid_buf, 0, cuupid_buf, duid_buf, cuupname_buf); uint8_t e2sm_header_buf_style5[8192]; size_t e2sm_header_buf_size_style5 = 8192; @@ -514,8 +562,8 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long long fiveqi = 7; - uint8_t *nrcellid_buf = (uint8_t*)"12340"; + long l_dl_prbs = prb_dl; long l_ul_prbs = prb_ul; @@ -542,7 +590,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long E2SM_KPM_IndicationHeader_t* ind_header_style1 = (E2SM_KPM_IndicationHeader_t*)calloc(1,sizeof(E2SM_KPM_IndicationHeader_t)); - encode_e2sm_kpm_indication_header(ind_header_style1); + encode_e2sm_kpm_indication_header(ind_header_style1, plmnid_buf, sst_buf, sd_buf, fqival, qcival, nrcellid_buf, gnbid_buf, 0, cuupid_buf, duid_buf, cuupname_buf); uint8_t e2sm_header_buf_style1[8192]; size_t e2sm_header_buf_size_style1 = 8192;