From 008ad98574471b55aa85bee71453d8e272e96a5d Mon Sep 17 00:00:00 2001 From: Deepanshu Karnwal Date: Wed, 18 Nov 2020 12:35:12 +0530 Subject: [PATCH] [Issue-Id: RICAPP-150]: Introduced Anomaly ACK for AD xApp use case Signed-off-by: Deepanshu Karnwal Change-Id: Iacee85c65700525df131bea2244d6bc50f1b0feb --- Dockerfile | 4 ++-- assets/bootstrap.rt | 1 + routes.txt | 1 + src/ts_xapp/ts_xapp.cpp | 9 ++++++++- xapp-descriptor/config.json | 12 +++++++----- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9571fe6..3259306 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ # the builder has: git, wget, cmake, gcc/g++, make, python2/3. v7 dropped nng support # -FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:8-u18.04 as buildenv +FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:9-u18.04 as buildenv # spaces to save things in the build image to copy to final image RUN mkdir -p /playpen/assets /playpen/src /playpen/bin @@ -42,7 +42,7 @@ WORKDIR /playpen # versions we snarf from package cloud ARG RMR_VER=4.0.5 ARG SDL_VER=1.0.4 -ARG XFCPP_VER=1.0.0 +ARG XFCPP_VER=1.2.0 # package cloud urls for wget ARG PC_REL_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch diff --git a/assets/bootstrap.rt b/assets/bootstrap.rt index 38084cb..6b0f249 100644 --- a/assets/bootstrap.rt +++ b/assets/bootstrap.rt @@ -3,4 +3,5 @@ newrt | start mse | 20011 | -1 | service-ricplt-a1mediator-rmr.ricplt:4562 mse | 30000 | -1 | service-ricxapp-qpdriver-rmr.ricxapp.svc.cluster.local:4560 +mse | 30004 | -1 | service-ricxapp-ad-rmr:4560 newrt | end diff --git a/routes.txt b/routes.txt index 5837eb1..15e2edf 100755 --- a/routes.txt +++ b/routes.txt @@ -1,4 +1,5 @@ newrt|start rte|20011|service-ricplt-a1mediator-rmr:10000 rte|30000|service-ricxapp-qpdriver.ricxapp.svc.cluster.local:4562 +rte|30004|service-ricxapp-ad-rmr:4560 newrt|end diff --git a/src/ts_xapp/ts_xapp.cpp b/src/ts_xapp/ts_xapp.cpp index 1ef8a56..8194b15 100644 --- a/src/ts_xapp/ts_xapp.cpp +++ b/src/ts_xapp/ts_xapp.cpp @@ -532,7 +532,13 @@ void run_loop() { } } - +/* This function works with Anomaly Detection(AD) xApp. It is invoked when anomalous UEs are send by AD xApp. + * It just print the payload received from AD xApp and send an ACK with same UEID as payload to AD xApp. + */ +void ad_callback( Message& mbuf, int mtype, int subid, int len, Msg_component payload, void* data ) { + cout << "payload is " << payload.get() << "\n"; + mbuf.Send_response(30004, -1, strlen((char *) payload.get()), (unsigned char *) payload.get()); +} extern int main( int argc, char** argv ) { @@ -551,6 +557,7 @@ extern int main( int argc, char** argv ) { xfw->Add_msg_cb( 20010, policy_callback, NULL ); xfw->Add_msg_cb( 30002, prediction_callback, NULL ); + xfw->Add_msg_cb( 30003, ad_callback, NULL ); /*Register a callback function for msg type 30003*/ std::thread loop_thread; diff --git a/xapp-descriptor/config.json b/xapp-descriptor/config.json index c703bf9..7d1ce13 100644 --- a/xapp-descriptor/config.json +++ b/xapp-descriptor/config.json @@ -19,10 +19,10 @@ "port": 4560, "rxMessages": [ "TS_QOE_PREDICTION", - "A1_POLICY_REQ" - + "A1_POLICY_REQ", + "TS_ANOMALY_UPDATE" ], - "txMessages": [ "TS_UE_LIST" ], + "txMessages": [ "TS_UE_LIST", "TS_ANOMALY_ACK" ], "policies": [20008], "description": "rmr receive data port for mcxapp" }, @@ -39,11 +39,13 @@ "maxSize": 2072, "numWorkers": 1, "txMessages": [ - "TS_UE_LIST" + "TS_UE_LIST", + "TS_ANOMALY_ACK" ], "rxMessages": [ "TS_QOE_PREDICTION", - "A1_POLICY_REQ" + "A1_POLICY_REQ", + "TS_ANOMALY_UPDATE" ], "policies": [20008] } -- 2.16.6