From: Ron Shacham Date: Tue, 8 Dec 2020 23:23:34 +0000 (-0500) Subject: Completed test with Viavi data X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=commitdiff_plain;h=e99b594eb6a250b50f9d7ef5ae59291b09bc7fb7 Completed test with Viavi data Signed-off-by: Ron Shacham Change-Id: I6b2850e09d5b51b95e2ea584237cb17cc17bd744 --- diff --git a/e2sim/e2sm_examples/kpm_e2sm/Dockerfile b/e2sim/e2sm_examples/kpm_e2sm/Dockerfile index 409de86..709d6e5 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.98.20.146 36422 +CMD kpm_sim 10.110.102.29 36422 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/reports.json b/e2sim/e2sm_examples/kpm_e2sm/reports.json index e3b6498..26f3f6b 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/reports.json +++ b/e2sim/e2sm_examples/kpm_e2sm/reports.json @@ -1,2 +1,13 @@ {"ueMeasReport":{"du-id":1002,"measTimeStampRf":"2020-11-05T15:39:58.858734","ueMeasReportList":[{"ue-id":"Pedestrian-11","nrCellIdentity":2,"targetTput":0.3,"servingCellRfReport":{"rsrp":74,"rsrq":65,"rssinr":113},"neighbourCellList":[{"nbCellIdentity":8,"nbCellRfReport":{"rsrp":67,"rsrq":65,"rssinr":112}},{"nbCellIdentity":7,"nbCellRfReport":{"rsrp":65,"rsrq":65,"rssinr":107}},{"nbCellIdentity":9,"nbCellRfReport":{"rsrp":64,"rsrq":65,"rssinr":106}},{"nbCellIdentity":1,"nbCellRfReport":{"rsrp":63,"rsrq":65,"rssinr":104}},{"nbCellIdentity":3,"nbCellRfReport":{"rsrp":62,"rsrq":65,"rssinr":101}},{"nbCellIdentity":10,"nbCellRfReport":{"rsrp":61,"rsrq":65,"rssinr":100}},{"nbCellIdentity":6,"nbCellRfReport":{"rsrp":59,"rsrq":65,"rssinr":95}}],"throughput":0.3,"prb_usage":23}]}} -{"cellMeasReport":{"du-id":1009,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":9,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"ueMeasReport":{"du-id":1005,"measTimeStampRf":"2020-11-05T15:39:58.858734","ueMeasReportList":[{"ue-id":"Pedestrian-14","nrCellIdentity":5,"targetTput":0.3,"servingCellRfReport":{"rsrp":74,"rsrq":65,"rssinr":113},"neighbourCellList":[{"nbCellIdentity":6,"nbCellRfReport":{"rsrp":67,"rsrq":65,"rssinr":112}},{"nbCellIdentity":1,"nbCellRfReport":{"rsrp":64,"rsrq":65,"rssinr":106}},{"nbCellIdentity":4,"nbCellRfReport":{"rsrp":61,"rsrq":65,"rssinr":100}},{"nbCellIdentity":7,"nbCellRfReport":{"rsrp":61,"rsrq":65,"rssinr":99}},{"nbCellIdentity":2,"nbCellRfReport":{"rsrp":58,"rsrq":65,"rssinr":94}},{"nbCellIdentity":3,"nbCellRfReport":{"rsrp":58,"rsrq":65,"rssinr":94}},{"nbCellIdentity":8,"nbCellRfReport":{"rsrp":56,"rsrq":65,"rssinr":90}}],"throughput":0.3,"prb_usage":23}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":7,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":1,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":2,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":5,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":9,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1006,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":6,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1012,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":12,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1010,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":10,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1004,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":4,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1003,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":3,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} +{"cellMeasReport":{"du-id":1008,"measTimeStampRf":"2020-11-05T15:39:58.859766","cellMeasReportList":[{"nrCellIdentity":8,"throughput":0.3,"pdcpByteMeasReport":{"measPeriodPdcpBytes":10,"pdcpBytesDl":307.2,"pdcpBytesUl":307.2},"prbMeasReport":{"measPeriodPrb":10,"availPrbDl":250,"availPrbUl":250}}]}} 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 af4a87f..18081f3 100644 --- a/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp +++ b/e2sim/e2sm_examples/kpm_e2sm/src/kpm/kpm_callbacks.cpp @@ -64,6 +64,14 @@ int main(int argc, char* argv[]) { fprintf(stderr, "JSON Test\n"); + 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; + + asn_codec_ctx_t *opt_cod; @@ -114,6 +122,30 @@ int main(int argc, char* argv[]) { } +void get_cell_id(uint8_t *nrcellid_buf, char *cid_return_buf) { + + uint8_t nr0 = nrcellid_buf[0] >> 4; + uint8_t nr1 = nrcellid_buf[0] << 4; + nr1 = nr1 >> 4; + + uint8_t nr2 = nrcellid_buf[1] >> 4; + uint8_t nr3 = nrcellid_buf[1] << 4; + nr3 = nr3 >> 4; + + uint8_t nr4 = nrcellid_buf[2] >> 4; + uint8_t nr5 = nrcellid_buf[2] << 4; + nr5 = nr5 >> 4; + + uint8_t nr6 = nrcellid_buf[3] >> 4; + uint8_t nr7 = nrcellid_buf[3] << 4; + nr7 = nr7 >> 4; + + uint8_t nr8 = nrcellid_buf[4] >> 4; + + sprintf(cid_return_buf, "373437%d%d%d%d%d%d%d%d%d", nr0,nr1,nr2,nr3,nr4,nr5,nr6,nr7,nr8); + +} + void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long actionId) { std::ifstream input("/playpen/src/reports.json"); @@ -170,7 +202,13 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long int nextRssinr; float tput; int prb_usage; + std::string ueId; + fprintf(stderr,"UE number %d\n", i); + + json::json_pointer p001(std::string("/ueMeasReport/ueMeasReportList/") + std::to_string(i) +"/ue-id"); + ueId = all_ues_json[p001].get(); + fprintf(stderr, "UEID %s\n", ueId.c_str()); json::json_pointer p0(std::string("/ueMeasReport/ueMeasReportList/") + std::to_string(i) +"/throughput"); tput = all_ues_json[p0].get(); @@ -178,7 +216,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long json::json_pointer p00(std::string("/ueMeasReport/ueMeasReportList/") + std::to_string(i) +"/prb_usage"); prb_usage = all_ues_json[p00].get(); - fprintf(stderr, "Throughput %d\n", prb_usage); + fprintf(stderr, "Throughput %d\n", prb_usage); json::json_pointer p1(std::string("/ueMeasReport/ueMeasReportList/") + std::to_string(i) +"/nrCellIdentity"); nextCellId = all_ues_json[p1].get(); @@ -199,10 +237,27 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long json::json_pointer p5(std::string("/ueMeasReport/ueMeasReportList/") + std::to_string(i) +"/neighbourCellList"); uint8_t *crnti_buf = (uint8_t*)calloc(1,2); + + if (ueId.find("Pedestrian") != string::npos) { + std::string ind = ueId.substr(11); + fprintf(stderr, "ind is %s\n", ind.c_str()); + + int indval = std::stoi(ind); + + if (indval < 10) { + crnti_buf[1] = indval; + crnti_buf[0] = 0; + } else { + crnti_buf[0] = indval/10; + crnti_buf[1] = indval % 10; + } + + } else if (ueId.find("Car") != string::npos) { + crnti_buf[0] = 4; + crnti_buf[1] = 1; + } - uint8_t *buf2 = (uint8_t*)"12"; - memcpy(crnti_buf, buf2, 2); - + // uint8_t *buf2 = (uint8_t*)"12"; std::string serving_str = "{\"rsrp\": " + std::to_string(nextRsrp) + ", \"rsrq\": " + std::to_string(nextRsrq) + ", \"rssinr\": " + std::to_string(nextRssinr) + "}"; @@ -240,8 +295,20 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long neighbor_str += ","; } + + + uint8_t *neighbor_cellid_buf = (uint8_t*)calloc(1,5); + neighbor_cellid_buf[0] = 0x22; + neighbor_cellid_buf[1] = 0x5B; + neighbor_cellid_buf[2] = 0xD6; + neighbor_cellid_buf[3] = nextNbCell; + neighbor_cellid_buf[4] = 0x70; + + char *cid_buf = (char*)calloc(1,24); + get_cell_id(neighbor_cellid_buf,cid_buf); - neighbor_str += "{\"CID\" : \"" + std::to_string(nextNbCell) + "\", \"Cell-RF\" : {\"rsrp\": " + std::to_string(nextNbRsrp) + + + neighbor_str += "{\"CID\" : \"" + std::string(cid_buf) + "\", \"Cell-RF\" : {\"rsrp\": " + std::to_string(nextNbRsrp) + ", \"rsrq\": " + std::to_string(nextNbRsrq) + ", \"rssinr\": " + std::to_string(nextNbRssinr) + "}}"; } @@ -256,12 +323,12 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long const uint8_t *neighbor_buf = reinterpret_cast(neighbor_str.c_str()); - // 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[3] = nextCellId; nrcellid_buf[4] = 0x70; uint8_t *gnbid_buf = (uint8_t*)calloc(1,3); @@ -328,7 +395,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long seqNum++; - std::this_thread::sleep_for (std::chrono::seconds(2)); + std::this_thread::sleep_for (std::chrono::milliseconds(50)); //Creating UE-level RAN-Container CUUP message @@ -380,7 +447,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long seqNum++; - std::this_thread::sleep_for (std::chrono::seconds(2)); + std::this_thread::sleep_for (std::chrono::milliseconds(50)); //Creating UE-level RAN-Container DU message @@ -434,7 +501,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long seqNum++; - std::this_thread::sleep_for (std::chrono::seconds(2)); + std::this_thread::sleep_for (std::chrono::milliseconds(50)); fprintf(stderr, "done with ue meas report\n"); } @@ -452,8 +519,13 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long float bytes_ul; int prb_dl; int prb_ul; + int cellid; fprintf(stderr,"UE number %d\n", i); + + json::json_pointer p00(std::string("/cellMeasReport/cellMeasReportList/") + std::to_string(i) +"/nrCellIdentity"); + cellid = all_ues_json[p00].get(); + fprintf(stderr, "Cell ID %d\n", cellid); json::json_pointer p0(std::string("/cellMeasReport/cellMeasReportList/") + std::to_string(i) +"/pdcpByteMeasReport/pdcpBytesDl"); bytes_dl = all_ues_json[p0].get(); @@ -480,7 +552,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long nrcellid_buf[0] = 0x22; nrcellid_buf[1] = 0x5B; nrcellid_buf[2] = 0xD6; - nrcellid_buf[3] = 0x00; + nrcellid_buf[3] = cellid; nrcellid_buf[4] = 0x70; uint8_t *gnbid_buf = (uint8_t*)calloc(1,3); @@ -489,10 +561,10 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long gnbid_buf[2] = 0xD6; uint8_t cuupid_buf[1]; - cuupid_buf[0] = 200; + cuupid_buf[0] = 20000; uint8_t duid_buf[1]; - duid_buf[0] = 300; + duid_buf[0] = 20000; uint8_t *cuupname_buf = (uint8_t*)"GNBCUUP5"; @@ -547,7 +619,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long seqNum++; - std::this_thread::sleep_for (std::chrono::seconds(2)); + std::this_thread::sleep_for (std::chrono::milliseconds(50)); //Encoding Style 1 Message Body @@ -609,7 +681,7 @@ void run_report_loop(long requestorId, long instanceId, long ranFunctionId, long e2sim.encode_and_send_sctp_data(pdu_style1); seqNum++; - std::this_thread::sleep_for (std::chrono::seconds(2)); + std::this_thread::sleep_for (std::chrono::milliseconds(50)); } }