From 4f7b44e86217306af73ed84977c4c20c38a9f55c Mon Sep 17 00:00:00 2001 From: Teodora Date: Wed, 2 Apr 2025 16:10:34 +0200 Subject: [PATCH 01/14] Remove the cmake option XAPP_MULTILANGUAGE from all Dockerfiles The FlexRIC main CMakeLists.txt sets XAPP_MULTILANGUAGE to OFF by default. Related commit ID: https://gitlab.eurecom.fr/mosaic5g/flexric/-/commit/637f718c3241f2f9ee809ecbd8a67ccb88575e65 --- docker/Dockerfile.build.fhi72.rhel9 | 3 +-- docker/Dockerfile.build.fhi72.ubuntu22 | 3 +-- docker/Dockerfile.build.rhel9 | 4 +--- docker/Dockerfile.build.ubuntu22 | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docker/Dockerfile.build.fhi72.rhel9 b/docker/Dockerfile.build.fhi72.rhel9 index 942896c4f8..b8ad1560ba 100644 --- a/docker/Dockerfile.build.fhi72.rhel9 +++ b/docker/Dockerfile.build.fhi72.rhel9 @@ -61,7 +61,7 @@ RUN /bin/sh oaienv && \ --gNB \ --build-lib 'telnetsrv enbscope uescope nrscope' \ -t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \ - --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION" &&\ + --build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION" &&\ # Mainly to see if the sanitize option was perfectly executed ldd ran_build/build/nr-softmodem && \ ldd ran_build/build/liboran_fhlib_5g.so && \ @@ -72,7 +72,6 @@ RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ scl enable gcc-toolset-13 "\ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ - -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ -DE2AP_VERSION=$E2AP_VERSION .. &&\ ninja && \ diff --git a/docker/Dockerfile.build.fhi72.ubuntu22 b/docker/Dockerfile.build.fhi72.ubuntu22 index f4a4ab6de7..5da6d0b608 100644 --- a/docker/Dockerfile.build.fhi72.ubuntu22 +++ b/docker/Dockerfile.build.fhi72.ubuntu22 @@ -71,7 +71,7 @@ RUN /bin/sh oaienv && \ --gNB \ --build-lib "telnetsrv enbscope uescope nrscope" \ -t oran_fhlib_5g --cmake-opt -Dxran_LOCATION=/opt/phy/fhi_lib/lib \ - --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ + --build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ $BUILD_OPTION && \ # Mainly to see if the sanitize option was perfectly executed ldd ran_build/build/nr-softmodem && \ @@ -82,7 +82,6 @@ RUN /bin/sh oaienv && \ RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ - -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ -DE2AP_VERSION=$E2AP_VERSION \ -DCMAKE_C_COMPILER=gcc-12 \ diff --git a/docker/Dockerfile.build.rhel9 b/docker/Dockerfile.build.rhel9 index cff25b7169..c707f25ad8 100644 --- a/docker/Dockerfile.build.rhel9 +++ b/docker/Dockerfile.build.rhel9 @@ -41,8 +41,7 @@ RUN /bin/sh oaienv && \ scl enable gcc-toolset-13 "\ CXXFLAGS='-Werror -fstack-protector-strong' CFLAGS='-Werror -fstack-protector-strong' ./build_oai -c --ninja \ --eNB --gNB --RU --UE --nrUE \ - --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt \ - -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ + --build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ --build-lib 'telnetsrv enbscope uescope nrscope' \ --build-tool-opt -k10 \ -w USRP -t Ethernet \ @@ -57,7 +56,6 @@ RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ scl enable gcc-toolset-13 "\ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ - -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ -DE2AP_VERSION=$E2AP_VERSION .. &&\ ninja && \ diff --git a/docker/Dockerfile.build.ubuntu22 b/docker/Dockerfile.build.ubuntu22 index c0de631c41..a3c2417b33 100644 --- a/docker/Dockerfile.build.ubuntu22 +++ b/docker/Dockerfile.build.ubuntu22 @@ -43,7 +43,7 @@ RUN /bin/sh oaienv && \ --eNB --gNB --RU --UE --nrUE \ --build-lib "telnetsrv enbscope uescope nrscope" \ -w USRP -t Ethernet \ - --build-e2 --cmake-opt -DXAPP_MULTILANGUAGE=OFF --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ + --build-e2 --cmake-opt -DKPM_VERSION=$KPM_VERSION --cmake-opt -DE2AP_VERSION=$E2AP_VERSION \ --noavx512 \ --build-tool-opt -k10 \ --cmake-opt -DCMAKE_C_FLAGS="-Werror" --cmake-opt -DCMAKE_CXX_FLAGS="-Werror" $BUILD_OPTION && \ @@ -57,7 +57,6 @@ RUN /bin/sh oaienv && \ RUN mkdir -p openair2/E2AP/flexric/build && \ cd openair2/E2AP/flexric/build && \ cmake -GNinja -DCMAKE_BUILD_TYPE=Release \ - -DXAPP_MULTILANGUAGE=OFF \ -DKPM_VERSION=$KPM_VERSION \ -DE2AP_VERSION=$E2AP_VERSION \ -DCMAKE_C_COMPILER=gcc-12 \ From f5a75caa4c46977d6b68e9544f1cd484e00494ec Mon Sep 17 00:00:00 2001 From: Teodora Date: Wed, 2 Apr 2025 16:23:01 +0200 Subject: [PATCH 02/14] Do not check E2AP/KPM versions if E2 agent disabled --- CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b607056aa4..b340c8785a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,14 +300,15 @@ add_definitions(-DHAVE_NETINET_IN_H) set(E2_AGENT "OFF" CACHE STRING "O-RAN-compliant E2 Agent") set_property(CACHE E2_AGENT PROPERTY STRINGS "ON" "OFF") -set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version") -set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3") -message(STATUS "Selected E2AP_VERSION: ${E2AP_VERSION}") - -set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use") -set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00") -message(STATUS "Selected KPM Version: ${KPM_VERSION}") +if (E2_AGENT) + set(E2AP_VERSION "E2AP_V2" CACHE STRING "E2AP version") + set_property(CACHE E2AP_VERSION PROPERTY STRINGS "E2AP_V1" "E2AP_V2" "E2AP_V3") + message(STATUS "Selected E2AP version: ${E2AP_VERSION}") + set(KPM_VERSION "KPM_V2_03" CACHE STRING "The KPM SM version to use") + set_property(CACHE KPM_VERSION PROPERTY STRINGS "KPM_V2_03" "KPM_V3_00") + message(STATUS "Selected KPM version: ${KPM_VERSION}") +endif() add_boolean_option(ENABLE_IMSCOPE OFF "Enable phy scope based on imgui" OFF) add_boolean_option(ENABLE_IMSCOPE_RECORD OFF "Enable recording IQ data for imscope" OFF) From 3f930551ffc5038f3b4b67d112ae93f39844b310 Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 4 Apr 2025 17:14:05 +0200 Subject: [PATCH 03/14] Fix CU to not contain the pointer for MAC/RLC stats Segmentation fault occured since the commit ID 9e5c5497abce7e6a47079e42a4a89168f75c35d2, where we try to copy the pointer which was not even been allocated. Before, we were copying the address of a NULL pointer and therefore no segmentation fault. This commit fixes the segmentation fault by checking if the memory was allocated, i.e. should not be in the case of CU (as it doesn't contain MAC/RLC layers). --- openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c index aaf46797ac..e887740402 100644 --- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c +++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c @@ -115,7 +115,9 @@ static cudu_ue_info_pair_t fill_ue_related_info(arr_ue_id_t* arr_ue_id, const si if (arr_ue_id->ue_id[ue_idx].type == GNB_UE_ID_E2SM) { ue_info.rrc_ue_id = *arr_ue_id->ue_id[ue_idx].gnb.ran_ue_id; // rrc_ue_id - ue_info.ue = arr_ue_id->ue_info_list[ue_idx]; + if (arr_ue_id->ue_info_list != NULL) { + ue_info.ue = arr_ue_id->ue_info_list[ue_idx]; + } } else if (arr_ue_id->ue_id[ue_idx].type == GNB_CU_UP_UE_ID_E2SM) { /* in OAI implementation, CU-UP ue id = CU-CP ue id => CU-UP ue id = rrc_ue_id, but it should not be the case by the spec */ From 2b3e1772d6698a4de7dd2a12fb38fa2a7cf88c60 Mon Sep 17 00:00:00 2001 From: Teodora Date: Wed, 9 Apr 2025 10:34:18 +0200 Subject: [PATCH 04/14] Add e2_agent section in CU/DU split configuration --- targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf | 5 +++++ .../CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf index 4acca69864..f57725cc9b 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf @@ -71,3 +71,8 @@ log_config : { f1ap_log_level = "info"; ngap_log_level = "info"; }; + +e2_agent = { + near_ric_ip_addr = "127.0.0.1"; + sm_dir = "/usr/local/lib/flexric/" +}; diff --git a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf index d4f7f82c74..3221813bef 100644 --- a/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf +++ b/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf @@ -210,3 +210,8 @@ log_config: { f1ap_log_level = "info"; ngap_log_level = "debug"; }; + +e2_agent = { + near_ric_ip_addr = "127.0.0.1"; + sm_dir = "/usr/local/lib/flexric/" +}; From 2644594c324ae01cb466ca80d874fc39799f3aaa Mon Sep 17 00:00:00 2001 From: Teodora Date: Wed, 9 Apr 2025 11:06:07 +0200 Subject: [PATCH 05/14] Update the E2AP README - prerequisites - use the links to FlexRIC tutorial - build FlexRIC - use the build tutorial from FlexRIC tutorial - explain in more details the supported service model functionalities - explanation if no RIC INDICATION is being sent - use multi-UE rfsim tutorial from doc/, not oai-workshops repository --- openair2/E2AP/README.md | 233 ++++++++++++++++++++-------------------- 1 file changed, 117 insertions(+), 116 deletions(-) diff --git a/openair2/E2AP/README.md b/openair2/E2AP/README.md index 9b2b2716fb..ba742b2dda 100644 --- a/openair2/E2AP/README.md +++ b/openair2/E2AP/README.md @@ -11,163 +11,147 @@ Please see [NOTICE](NOTICE.md) file for third party software that is included in # Overview -This tutorial describes the steps of deployment 5G OAI RAN, with integrated E2 agent and a nearRT-RIC using O-RAN compliant FlexRIC. +This tutorial describes the steps of deployment 5G OAI RAN, with integrated E2 agent, and a nearRT-RIC using O-RAN compliant FlexRIC. [[_TOC_]] -# 1. Installation +# 1. Mandatory prerequisites of FlexRIC before starting with E2 agent +* [GCC compiler](https://gitlab.eurecom.fr/mosaic5g/flexric#111-gcc-compiler) +* [(opt.) configure Wireshark](https://gitlab.eurecom.fr/mosaic5g/flexric#112-opt-wireshark) +* [Mandatory dependencies](https://gitlab.eurecom.fr/mosaic5g/flexric#121-mandatory-dependencies) -## 1.1 Install prerequisites - -- A *recent* CMake (at least v3.15). - - On Ubuntu, you might want to use [this PPA](https://apt.kitware.com/) to install an up-to-date version. - -- SWIG (at least v.4.1). - - We use SWIG as an interface generator to enable the multi-language feature (i.e., C/C++ and Python) for the xApps. Please, check your SWIG version (i.e, `swig - -version`) and install it from scratch if necessary as described here: https://swig.org/svn.html or via the code below: - - ```bash - git clone https://github.com/swig/swig.git - cd swig - git checkout release-4.1 - ./autogen.sh - ./configure --prefix=/usr/ - make -j8 - make install - ``` - -- Flatbuffer encoding(optional). - - We also provide a flatbuffers encoding/decoding scheme as alternative to ASN.1. In case that you want to use it follow the - instructions at https://github.com/dvidelabs/flatcc and provide the path for the lib and include when selecting it at `ccmake ..` from the build directory - -## 1.2 Download the required dependencies. - -Below an example of how to install it in ubuntu -```bash -sudo apt install libsctp-dev python3.8 cmake-curses-gui libpcre2-dev python-dev -``` # 2. Deployment ## 2.1 OAI RAN +OAI E2 agent contains: +* RAN functions: exposure of service models capabilities +* FlexRIC submodule: for message enc/dec + +Currently available versions: +| |E2SM-KPM v2.03|E2SM-KPM v3.00| +|:-----------|:-------------|:-------------| +| E2AP v1.01 | Y | Y | +| E2AP v2.03 | Y (default) | Y | +| E2AP v3.01 | Y | Y | + +Note: E2SM-KPM `v2.01` is supported only in FlexRIC, but not in OAI. ### 2.1.1 Clone the OAI repository ```bash -git clone https://gitlab.eurecom.fr/oai/openairinterface5g oai -cd oai/ +git clone https://gitlab.eurecom.fr/oai/openairinterface5g ``` ### 2.1.2 Build OAI with E2 Agent -- By default, OAI will build the E2 Agent with E2AP v2 and KPM v2. If you want a different version, edit the variable E2AP\_VERSION and KPM\_VERSION at OAI's CMakeLists.txt file. - -Currently available versions: -| |KPM v2.03|KPM v3.00| -|:-----------|:--------|:--------| -| E2AP v1.01 | Y | Y | -| E2AP v2.03 | Y | Y | -| E2AP v3.01 | Y | Y | - -Please note that KPM SM v2.01 is supported only in FlexRIC, but not in OAI. - +#### Using build_oai script ```bash -cd cmake_targets/ -./build_oai -I -w SIMU --gNB --nrUE --build-e2 --ninja +cd openairinterface5g/cmake_targets/ +./build_oai -I # if you never installed OAI, use this command once before the next line +# +./build_oai --gNB --nrUE --build-e2 --cmake-opt -DE2AP_VERSION=E2AP_VX --cmake-opt -DKPM_VERSION=KPM_VY --ninja ``` +where `X`=`1`,`2`,`3`, and `Y`=`2_03`,`3_00`. * `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. - * `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one, liboai_usrpdevif.so). The RF simulatorRF simulator is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build. + * `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one, `liboai_usrpdevif.so`). The RF simulator is implemented as a specific device replacing RF hardware, it can be specifically built using `-w SIMU` option, but is also built during any softmodem build. * `--gNB` is to build the `nr-softmodem` and `nr-cuup` executables and all required shared libraries * `--nrUE` is to build the `nr-uesoftmodem` executable and all required shared libraries * `--ninja` is to use the ninja build tool, which speeds up compilation - * `--build-e2` option is to use the E2 agent, integrated within RAN. + * `--build-e2` option is to use the E2 agent, integrated within E2 nodes (gNB-mono, DU, CU, CU-UP, CU-CP). -If the openair2/E2AP/flexric folder is empty, try manually the following commands: +#### Using cmake directly ```bash -git submodule init -git submodule update +cd openairinterface5g +mkdir build && cd build +cmake .. -GNinja -DE2_AGENT=ON -DE2AP_VERSION=E2AP_VX -DKPM_VERSION=KPM_VY +ninja nr-softmodem nr-cuup nr-uesoftmodem params_libconfig rfsimulator ``` +where `X`=`1`,`2`,`3`, and `Y`=`2_03`,`3_00`. + ## 2.2 FlexRIC +Important to note: OAI RAN and FlexRIC must be compiled with the same E2AP and E2SM-KPM versions. -By default, FlexRIC will build the nearRT-RIC with E2AP v2 and KPM v2. If you want a different version, edit the variable E2AP\_VERSION and KPM\_VERSION at FlexRIC's CMakeLists.txt file. Note that OAI's and FlexRIC's E2AP\_VERSION and KPM\_VERSION need to match due to O-RAN incompatibilities among versions. - - -### 2.2.1 Clone the FlexRIC repository +### 2.2.1 Case 1: OAI RAN and FlexRIC on the same machine +Instead of cloning the new FlexRIC repository, feel free to use FlexRIC submodule as a nearRT-RIC + xApp framework, apart from the E2 agent side. In order to achieve this, please follow the next steps: ```bash -git clone https://gitlab.eurecom.fr/mosaic5g/flexric flexric -cd flexric/ -git checkout f1c08ed2b9b1eceeda7941dd7bf435db0168dd56 +cd openairinterface5g/openair2/E2AP/flexric +git submodule init && git submodule update # only if OAI RAN wasn't previously compiled with --build-e2 or -DE2_AGENT options ``` +and continue as described in the [build FlexRIC section](https://gitlab.eurecom.fr/mosaic5g/flexric#22-build-flexric). -### 2.2.2 Build FlexRIC -```bash -mkdir build && cd build && cmake .. && make -j8 -``` +### 2.2.2 Case 2: OAI RAN and FlexRIC on different machines +The [FlexRIC submodule compilation step](#221-case-1-oai-ran-and-flexric-on-the-same-machine) is **mandatory** as the OAI RAN must use the Service Models (which are built as shared libraries). +To build FlexRIC on the other machine, follow the complete [FlexRIC installation](https://gitlab.eurecom.fr/mosaic5g/flexric#2-flexric-installation) process. -### 2.2.3 Installation of Service Models (SMs) -```bash -sudo make install -``` - -By default the service model libraries will be installed in the path `/usr/local/lib/flexric` while the configuration file in `/usr/local/etc/flexric`. # 3. Service Models available in OAI RAN ## 3.1 O-RAN +For a deeper understanding, we recommend that users of FlexRIC familiarize themselves with O-RAN WG3 specifications available at the [O-RAN specifications page](https://orandownloadsweb.azurewebsites.net/specifications). -We assume that user is familiar with O-RAN WG3 specifications that can be found at https://orandownloadsweb.azurewebsites.net/specifications. +The following specifications are recommended: +* `O-RAN.WG3.E2GAP-v02.00` - nearRT-RIC architecture & E2 General Aspects and Principles: important for a general understanding for E2 +* `O-RAN.WG3.E2AP-version` - E2AP protocol description +* `O-RAN.WG3.E2SM-KPM-version` - E2SM-KPM Service Model description +* `O-RAN.WG3.E2SM-RC-v01.03` - E2SM-RC Service Model description ### 3.1.1 E2SM-KPM - -As mentioned in section [2.1.2 Build OAI with E2 Agent](#212-build-oai-with-e2-agent), we support KPM v2.03/v3.00. Uses ASN.1 encoding. +As mentioned in section [2.1 OAI RAN](#21-oai-ran), we support KPM `v2.03/v3.00` which all use ASN.1 encoding. Per O-RAN specifications, 5G measurements supported by KPM are specified in 3GPP TS 28.552. From 3GPP TS 28.552, we support the following list: - * "DRB.PdcpSduVolumeDL" - * "DRB.PdcpSduVolumeUL" - * "DRB.RlcSduDelayDl" - * "DRB.UEThpDl" - * "DRB.UEThpUl" - * "RRU.PrbTotDl" - * "RRU.PrbTotUl" + * `DRB.PdcpSduVolumeDL` + * `DRB.PdcpSduVolumeUL` + * `DRB.RlcSduDelayDl` + * `DRB.UEThpDl` + * `DRB.UEThpUl` + * `RRU.PrbTotDl` + * `RRU.PrbTotUl` -From O-RAN.WG3.E2SM-KPM-version specification, we implemented: - * REPORT Service Style 4 ("Common condition-based, UE-level" - section 7.4.5) - fetch above measurements per each UE that matches common criteria (e.g. S-NSSAI). +From `O-RAN.WG3.E2SM-KPM-version` specification, we implemented: + * REPORT Service Style 4 ("Common condition-based, UE-level" - section 7.4.5) - fetch above measurements per each UE based on the common S-NSSAI `(1, 0xffffff)` condition ### 3.1.2 E2SM-RC +We support E2SM-RC `v1.03` which uses ASN.1 encoding. -We support RC v1.03. Uses ASN.1 encoding. - -From ORAN.WG3.E2SM-RC-v01.03 specification, we implemented: +From `O-RAN.WG3.E2SM-RC-v01.03` specification, we implemented: * REPORT Service Style 1 ("Message copy" - section 7.4.2) - aperiodic subscription for "RRC Message" and "UE ID" * REPORT Service Style 4 ("UE Information" - section 7.4.5) - aperiodic subscription for "UE RRC State Change" - * CONTROL Service Style 1 ("Radio Bearer Control" - section 7.6.2) - "QoS flow mapping configuration" (e.g creating a new DRB) + * CONTROL Service Style 1 ("Radio Bearer Control" - section 7.6.2) - "QoS flow mapping configuration"; please be aware that this functionality is defined as per O-RAN "To control the multiplexing of QoS flows to a DRB", + but OAI RAN doesn't support multiple QoS flows in one DRB. Therefore, this use case was adjusted for creation of new DRB, instead of creation of new QoS flow in the existing DRB. + More information can be found in the branch [qoe-e2](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/qoe-e2?ref_type=heads). It's not merged due to incompliance with O-RAN specifications. + We showcased this demo in the O-RAN F2F Osaka meeting. Please feel free to download the [demo video](https://lf-o-ran-sc.atlassian.net/wiki/download/attachments/13566077/oai-flexric-demo-ric.mp4?api=v2) and [accompanying presentation](https://lf-o-ran-sc.atlassian.net/wiki/download/attachments/13566077/oai-FlexRIC-demo.pdf?api=v2). ## 3.2 Custom Service Models +In addition, we support custom Service Models for L2/L3. Please find the KPIs for each layer in the following structs: +* MAC: `mac_ue_stats_impl_t` +* RLC: `rlc_radio_bearer_stats_t` +* PDCP: `pdcp_radio_bearer_stats_t` +* GTP: `gtp_ngu_t_stats_t` -In addition, we support custom Service Models, such are MAC, RLC, PDCP, and GTP. Use plain encoding. +All use plain encoding, i.e., no ASN.1, but write the binary data into network messages. -If you are interested in TC and SLICE SMs, please follow the instructions at https://gitlab.eurecom.fr/mosaic5g/flexric. +There exist two additional custom Service Models, SLICE and TC (traffic control), but they are not supported in OAI RAN. They can only be tested with [E2 agent emulators](https://gitlab.eurecom.fr/mosaic5g/flexric#4-deployment) within FlexRIC framework. # 4. Start the process +At this point, we assume the 5G Core Network is already running in the background. For more information, please follow the [5GCN tutorial](../../doc/NR_SA_Tutorial_OAI_CN5G.md). -At this point, we assume the 5G Core Network is already running in the background. For more information, please follow the tutorial at https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_OAI_CN5G.md. +Optionally run Wireshark and capture E2AP traffic. -In order to configure E2 agent, please, add the following block in OAI's configuration file: +The E2 node (gNB-mono, DU, CU, CU-UP, CU-CP) configuration file must contain the `e2_agent` section. Please adjust the following example to your needs: ```bash e2_agent = { near_ric_ip_addr = "127.0.0.1"; - sm_dir = "/usr/local/lib/flexric/" + sm_dir = "/usr/local/lib/flexric/"; } ``` -* start E2 Node agents - As per O-RAN.WG3.E2SM-v02.00 specifications, UE ID (section 6.2.2.6) representation in OAI is: +* start the E2 nodes + + As per `O-RAN.WG3.E2SM-v02.00` specifications, `UE ID` (section 6.2.2.6) representation in OAI is: | | gNB-mono | CU | CU-CP | CU-UP | DU | |:----------------------|:----------------|:----------------|:----------------|:----------------------|:-------------------| | CHOICE UE ID case | GNB_UE_ID_E2SM | GNB_UE_ID_E2SM | GNB_UE_ID_E2SM | GNB_CU_UP_UE_ID_E2SM | GNB_DU_UE_ID_E2SM | @@ -179,68 +163,85 @@ e2_agent = { * start the gNB-mono ```bash - cd oai/cmake_targets/ran_build/build - sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim -E + cd /build + sudo ./nr-softmodem -O /targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim ``` * if CU/DU split is used, start the gNB as follows ```bash - sudo ./nr-softmodem -O --rfsim -E - sudo ./nr-softmodem -O + cd /build + sudo ./nr-softmodem -O /targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsim + sudo ./nr-softmodem -O /targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf ``` * if CU-CP/CU-UP/DU split is used, start the gNB as follows ```bash - sudo ./nr-softmodem -O --rfsim -E - sudo ./nr-softmodem -O - sudo ./nr-cuup -O + cd /build + sudo ./nr-softmodem -O /targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsim + ./nr-softmodem -O /ci-scripts/conf_files/gnb-cucp.sa.f1.conf --gNBs.[0].plmn_list.[0].mcc 001 --gNBs.[0].plmn_list.[0].mnc 01 --gNBs.[0].local_s_address "127.0.0.3" --gNBs.[0].amf_ip_address.[0].ipv4 "192.168.70.132" --gNBs.[0].E1_INTERFACE.[0].ipv4_cucp "127.0.0.3" --gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NG_AMF "192.168.70.129" --e2_agent.near_ric_ip_addr "127.0.0.1" --e2_agent.sm_dir "/usr/local/lib/flexric/" + sudo ./nr-cuup -O /ci-scripts/conf_files/gnb-cuup.sa.f1.conf --gNBs.[0].plmn_list.[0].mcc 001 --gNBs.[0].plmn_list.[0].mnc 01 --gNBs.[0].local_s_address "127.0.0.6" --gNBs.[0].E1_INTERFACE.[0].ipv4_cucp "127.0.0.3" --gNBs.[0].E1_INTERFACE.[0].ipv4_cuup "127.0.0.6" --gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NG_AMF "192.168.70.129" --gNBs.[0].NETWORK_INTERFACES.GNB_IPV4_ADDRESS_FOR_NGU "192.168.70.129" --e2_agent.near_ric_ip_addr "127.0.0.1" --e2_agent.sm_dir "/usr/local/lib/flexric/" --rfsim + ``` * start the nrUE ```bash - cd oai/cmake_targets/ran_build/build + cd /build + # for gNB-mono sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.serveraddr 127.0.0.1 + # for CU/DU and CU-CP/CU-UP/DU split + sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3450720000 --rfsim --uicc0.imsi 001010000000001 --rfsimulator.serveraddr 127.0.0.1 ``` + Note: [multi-UE rfsim deployment tutorial](../../doc/NR_SA_Tutorial_OAI_multi_UE.md?ref_type=heads#run-multiple-ues-in-rfsimulator) * start the nearRT-RIC ```bash - cd flexric + cd flexric # or openairinterface5g/openair2/E2AP/flexric ./build/examples/ric/nearRT-RIC ``` * Start different xApps - - * start the KPM monitor xApp - measurements stated in [3.1.1 E2SM-KPM](#311-e2sm-kpm) for each UE that matches S-NSSAI common criteria + Important to note: if no RIC INDICATION is received by any of the xApps, either the + * start the KPM monitor xApp - measurements stated in [3.1.1 E2SM-KPM](#311-e2sm-kpm) for each UE that matches S-NSSAI `(1, 0xffffff)` common criteria ```bash - cd flexric + cd flexric # or openairinterface5g/openair2/E2AP/flexric ./build/examples/xApp/c/monitor/xapp_kpm_moni ``` - Note: we assume that each UE has only 1 DRB; CU-UP does not store the slices, therefore "coarse filtering" is used + Note: we assume that each UE has only 1 DRB; CU-UP does not store the slices, therefore "coarse filtering" is used; **if no RIC INDICATION message received**, please check if: + (1) UE is connected to the gNB + (2) UE has a PDU session (LCID 4) + (3) UE supports the slice `(1, 0xffffff)` * start the RC monitor xApp - aperiodic subscriptions for "UE RRC State Change", "RRC Message" copy (`RRC Reconfiguration`, `Measurement Report`, `Security Mode Complete`, `RRC Setup Complete`), and "UE ID" when `RRC Setup Complete` and/or `F1 UE Context Setup Request` detected ```bash - cd flexric + cd flexric # or openairinterface5g/openair2/E2AP/flexric ./build/examples/xApp/c/monitor/xapp_rc_moni ``` - * start the RC control xApp - RAN control function "QoS flow mapping configuration" (e.g. creating a new DRB) + * start the KPM monitor and RC control xApp - this xApp is only a PoC. It collects the measurements stated in [3.1.1 E2SM-KPM](#311-e2sm-kpm) and sends the RC Control message + for "QoS flow mapping configuration". However, no control is being done within the RAN itself. Please refer to [3.1.2 E2SM-RC](#312-e2sm-rc) for detailed explanation. ```bash - cd flexric + cd flexric # or openairinterface5g/openair2/E2AP/flexric ./build/examples/xApp/c/kpm_rc/xapp_kpm_rc ``` * start the (MAC + RLC + PDCP + GTP) monitor xApp ```bash - cd flexric + cd flexric # or openairinterface5g/openair2/E2AP/flexric ./build/examples/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni ``` + Note: GTP is not yet implemented in CU-UP; **if no RIC INDICATION message received**, please check if: + (1) UE is connected to the gNB + (2) UE has a PDU session (LCID 4) - if no PDU session, only MAC/GTP stats will be sent + + * if `XAPP_MULTILANGUAGE` option is enabled, start the python xApps: + ```bash + python3 build/examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py # only supported by the gNB-mono + ``` + The latency that you observe in your monitor xApp is the latency from the E2 Agent to the nearRT-RIC and xApp. Therefore, FlexRIC is well suited for use cases with ultra low-latency requirements. -Additionally, all the data received in the `xapp_gtp_mac_rlc_pdcp_moni` xApp is also written to /tmp/xapp_db in case that offline data processing is wanted (e.g., Machine Learning/Artificial Intelligence applications). You can browse the data using e.g., sqlitebrowser. +Additionally, all the data received in the `xapp_gtp_mac_rlc_pdcp_moni` xApp is also written to `/tmp/xapp_db_` in case that offline data processing is wanted (e.g., Machine Learning/Artificial Intelligence applications). You can browse the data using e.g., `sqlitebrowser`. + Please note: * KPM SM database is not been updated, therefore commented in `flexric/src/xApp/db/sqlite3/sqlite3_wrapper.c:1152` * RC SM database is not yet implemented. - -# Optional - Multiple UEs - -If you are interested in having multiple UEs in rfsim mode, please, follow the instructions at https://gitlab.eurecom.fr/oaiworkshop/summerworkshop2023/-/tree/main/ran#multiple-ues. From dfa1bd4efe7c3c58661f52d684cb3c0f94932987 Mon Sep 17 00:00:00 2001 From: Teodora Date: Tue, 29 Apr 2025 17:55:26 +0200 Subject: [PATCH 06/14] Add the NSSAI logging condition in KPM It is a periodic output, based on the reporting period. --- openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c index e887740402..4468cdf0b9 100644 --- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c +++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_kpm.c @@ -173,6 +173,7 @@ static void capture_sst_sd(test_cond_value_t* test_cond_value, uint8_t *sst, uin *sd = malloc(**sd); **sd = buf[1] << 16 | buf[2] << 8 | buf[3]; } + printf("[E2 AGENT][E2SM-KPM] Condition NSSAI (%d, %x).\n", *sst, (*sd) ? **sd : 0xffffff); break; } default: @@ -408,7 +409,10 @@ bool read_kpm_sm(void* data) ue_type_matcher fp_match_cond_type = (*match_cond_arr[test_info.test_cond_type])[node_type]; arr_ue_id_t arr_ue_id = fp_match_cond_type(test_info); - if (arr_ue_id.sz == 0) return false; + if (arr_ue_id.sz == 0) { + printf("[E2 AGENT][E2SM-KPM] No UE matches the condition criteria.\n"); + return false; + } kpm->ind.msg.frm_3 = fill_kpm_ind_msg_frm_3(&arr_ue_id, &frm_4->action_def_format_1); } break; From 227f9e92f6b94291e85001a87b616d0ba88604ee Mon Sep 17 00:00:00 2001 From: Teodora Date: Tue, 29 Apr 2025 22:13:24 +0200 Subject: [PATCH 07/14] Properly fill RC RAN Function Name Follow-up for https://gitlab.eurecom.fr/mosaic5g/flexric/-/commit/143c0238e977035ce9cf5491ff41f06b29f6a278. --- .../E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c index 4dfddf6253..14c357496c 100644 --- a/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c +++ b/openair2/E2AP/RAN_FUNCTION/O-RAN/ran_func_rc.c @@ -27,6 +27,7 @@ #include "../../flexric/src/sm/rc_sm/ie/ir/ran_param_list.h" #include "../../flexric/src/agent/e2_agent_api.h" #include "openair2/E2AP/flexric/src/lib/sm/enc/enc_ue_id.h" +#include "openair2/E2AP/flexric/src/sm/rc_sm/rc_sm_id.h" #include #include @@ -379,10 +380,26 @@ static void fill_rc_control(ran_func_def_ctrl_t* ctrl) ctrl_style->ran_param_ctrl_out = NULL; } +static ran_function_name_t fill_rc_ran_func_name(void) +{ + ran_function_name_t dst = { + .name = cp_str_to_ba(SM_RAN_CTRL_SHORT_NAME), + .oid = cp_str_to_ba(SM_RAN_CTRL_OID), + .description = cp_str_to_ba(SM_RAN_CTRL_DESCRIPTION), + .instance = NULL + }; + return dst; +} + e2sm_rc_func_def_t fill_rc_ran_def_gnb(void) { e2sm_rc_func_def_t def = {0}; + // RAN Function Name + // Mandatory + // 9.3.2 + def.name = fill_rc_ran_func_name(); + // RAN Function Definition for EVENT TRIGGER // Optional // 9.2.2.2 @@ -421,6 +438,11 @@ static e2sm_rc_func_def_t fill_rc_ran_def_cu(void) { e2sm_rc_func_def_t def = {0}; + // RAN Function Name + // Mandatory + // 9.3.2 + def.name = fill_rc_ran_func_name(); + // RAN Function Definition for EVENT TRIGGER // Optional // 9.2.2.2 @@ -459,6 +481,11 @@ static e2sm_rc_func_def_t fill_rc_ran_def_null(void) { e2sm_rc_func_def_t def = {0}; + // RAN Function Name + // Mandatory + // 9.3.2 + def.name = fill_rc_ran_func_name(); + // RAN Function Definition for EVENT TRIGGER // Optional // 9.2.2.2 @@ -491,6 +518,11 @@ static e2sm_rc_func_def_t fill_rc_ran_def_cucp(void) { e2sm_rc_func_def_t def = {0}; + // RAN Function Name + // Mandatory + // 9.3.2 + def.name = fill_rc_ran_func_name(); + // RAN Function Definition for EVENT TRIGGER // Optional // 9.2.2.2 @@ -547,9 +579,6 @@ void read_rc_setup_sm(void* data) rc_e2_setup_t* rc = (rc_e2_setup_t*)data; /* Fill the RAN Function Definition with currently supported measurements */ - - // RAN Function Name is already filled in fill_ran_function_name() in rc_sm_agent.c - const ngran_node_t node_type = get_e2_node_type(); rc->ran_func_def = ran_def_rc[node_type](); From bd97d1165495b93ebff74e4279900a92f28cfb67 Mon Sep 17 00:00:00 2001 From: Teodora Date: Tue, 29 Apr 2025 22:16:29 +0200 Subject: [PATCH 08/14] Update FlexRIC submodule commit ID --- openair2/E2AP/flexric | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/E2AP/flexric b/openair2/E2AP/flexric index 2638b58e20..df754a8553 160000 --- a/openair2/E2AP/flexric +++ b/openair2/E2AP/flexric @@ -1 +1 @@ -Subproject commit 2638b58e201ab15200d0e02c6225e9aac35ab51b +Subproject commit df754a85537f6db255b5330b8d83eda6a2742f25 From 735bc2fa050c5d2dfb991fe1a26ecc7111bc835c Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 2 May 2025 01:10:24 +0200 Subject: [PATCH 09/14] Delete unnecessary test cases for OAI-FlexRIC CI pipeline Needless sleep time test case, and duplicated test case for the xApp with custom SMs. --- .../xml_files/container_5g_flexric_rfsim.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml index d0d3446f41..05e050ab64 100644 --- a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml @@ -32,7 +32,6 @@ 000001 000002 000003 - 002001 010000 000004 333333 @@ -40,7 +39,6 @@ 010002 010003 020005 - 010013 002006 444444 100002 @@ -50,12 +48,6 @@ - - IdleSleep - Sleep - 10 - - Pull_Local_Registry Pull Images from Local Registry @@ -204,12 +196,4 @@ docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/sms-moni-010003.log - - Custom_Command - Custom SMs monitoring - localhost - yes - docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/sms-moni-010013.log - - From 498d2f8b374ca791fed2e14888d71320157bab68 Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 2 May 2025 01:18:19 +0200 Subject: [PATCH 10/14] Improve OAI-FlexRIC CI pipeline Instead of running xApps from oai-flexric container, create dedicated xApp containers. In addition, modify the flexric.conf: DB_PATH doesn't exist; DB_DIR is the correct name. --- .../xml_files/container_5g_flexric_rfsim.xml | 36 +++++----- .../5g_rfsimulator_flexric/conf/flexric.conf | 4 +- .../5g_rfsimulator_flexric/docker-compose.yml | 68 +++++++++++++++++++ 3 files changed, 90 insertions(+), 18 deletions(-) diff --git a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml index 05e050ab64..a56248fe0e 100644 --- a/ci-scripts/xml_files/container_5g_flexric_rfsim.xml +++ b/ci-scripts/xml_files/container_5g_flexric_rfsim.xml @@ -165,35 +165,39 @@ - Custom_Command + Deploy_Object RC monitoring - localhost - yes - docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_rc_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/rc-moni-010000.log + ci-scripts/yaml_files/5g_rfsimulator_flexric + xapp-rc-moni + 0 + 0 - Custom_Command + Deploy_Object KPM monitoring - localhost - yes - docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_kpm_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/kpm-moni-010001.log + ci-scripts/yaml_files/5g_rfsimulator_flexric + xapp-kpm-moni + 0 + 0 - Custom_Command + Deploy_Object KPM monitoring and RC control - localhost - yes - docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/kpm_rc/xapp_kpm_rc" > ../cmake_targets/log/5g_rfsimulator_flexric/kpm_rc-010002.log + ci-scripts/yaml_files/5g_rfsimulator_flexric + xapp-kpm-rc + 0 + 0 - Custom_Command + Deploy_Object Custom SMs monitoring - localhost - yes - docker exec oai-flexric bash -c "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" > ../cmake_targets/log/5g_rfsimulator_flexric/sms-moni-010003.log + ci-scripts/yaml_files/5g_rfsimulator_flexric + xapp-gtp-mac-rlc-pdcp-moni + 0 + 0 diff --git a/ci-scripts/yaml_files/5g_rfsimulator_flexric/conf/flexric.conf b/ci-scripts/yaml_files/5g_rfsimulator_flexric/conf/flexric.conf index 5ffbf3d47f..481c4e68f9 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_flexric/conf/flexric.conf +++ b/ci-scripts/yaml_files/5g_rfsimulator_flexric/conf/flexric.conf @@ -1,5 +1,5 @@ [NEAR-RIC] NEAR_RIC_IP = 192.168.70.150 + [XAPP] -DB_PATH = /flexric/db/ -DB_NAME = xapp_rnis_db +DB_DIR = /tmp/ diff --git a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml index 9afdd02b60..899e02295f 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml @@ -13,6 +13,74 @@ services: interval: 10s timeout: 5s + xapp-rc-moni: + image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop} + command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_rc_moni" + container_name: xapp-rc-moni + depends_on: + - oai-flexric + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.70.154 + volumes: + - ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf + healthcheck: + test: /bin/bash -c "pgrep xapp_rc_moni" + interval: 10s + timeout: 5s + + xapp-kpm-moni: + image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop} + command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_kpm_moni" + container_name: xapp-kpm-moni + depends_on: + - oai-flexric + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.70.155 + volumes: + - ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf + healthcheck: + test: /bin/bash -c "pgrep xapp_kpm_moni" + interval: 10s + timeout: 5s + + xapp-kpm-rc: + image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop} + command: "stdbuf -o0 /usr/local/flexric/xApp/c/kpm_rc/xapp_kpm_rc" + container_name: xapp-kpm-rc + depends_on: + - oai-flexric + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.70.156 + volumes: + - ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf + healthcheck: + test: /bin/bash -c "pgrep xapp_kpm_rc" + interval: 10s + timeout: 5s + + xapp-gtp-mac-rlc-pdcp-moni: + image: ${REGISTRY:-oaisoftwarealliance}/oai-flexric:${FLEXRIC_TAG:-develop} + command: "stdbuf -o0 /usr/local/flexric/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni" + container_name: xapp-gtp-mac-rlc-pdcp-moni + depends_on: + - oai-flexric + - oai-gnb + networks: + public_net: + ipv4_address: 192.168.70.157 + volumes: + - ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf + healthcheck: + test: /bin/bash -c "pgrep -f xapp_gtp_mac_rlc_pdcp_moni" + interval: 10s + timeout: 5s + oai-gnb: image: ${REGISTRY:-oaisoftwarealliance}/${GNB_IMG:-oai-gnb}:${TAG:-develop} privileged: true From a84a5328f2fa0753b7be9cb55c63bb9fd4aec673 Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 2 May 2025 01:31:29 +0200 Subject: [PATCH 11/14] Make xApp duration flexible Improvement introduced in https://gitlab.eurecom.fr/mosaic5g/flexric/-/commit/0410c023726b18b9002f5adb39f7df95f49a7d7a. --- openair2/E2AP/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openair2/E2AP/README.md b/openair2/E2AP/README.md index ba742b2dda..7866467397 100644 --- a/openair2/E2AP/README.md +++ b/openair2/E2AP/README.md @@ -199,12 +199,13 @@ e2_agent = { ./build/examples/ric/nearRT-RIC ``` +`XAPP_DURATION` environment variable overwrites the default xApp duration of 20s. * Start different xApps Important to note: if no RIC INDICATION is received by any of the xApps, either the * start the KPM monitor xApp - measurements stated in [3.1.1 E2SM-KPM](#311-e2sm-kpm) for each UE that matches S-NSSAI `(1, 0xffffff)` common criteria ```bash cd flexric # or openairinterface5g/openair2/E2AP/flexric - ./build/examples/xApp/c/monitor/xapp_kpm_moni + XAPP_DURATION=30 ./build/examples/xApp/c/monitor/xapp_kpm_moni ``` Note: we assume that each UE has only 1 DRB; CU-UP does not store the slices, therefore "coarse filtering" is used; **if no RIC INDICATION message received**, please check if: (1) UE is connected to the gNB @@ -214,20 +215,20 @@ e2_agent = { * start the RC monitor xApp - aperiodic subscriptions for "UE RRC State Change", "RRC Message" copy (`RRC Reconfiguration`, `Measurement Report`, `Security Mode Complete`, `RRC Setup Complete`), and "UE ID" when `RRC Setup Complete` and/or `F1 UE Context Setup Request` detected ```bash cd flexric # or openairinterface5g/openair2/E2AP/flexric - ./build/examples/xApp/c/monitor/xapp_rc_moni + XAPP_DURATION=30 ./build/examples/xApp/c/monitor/xapp_rc_moni ``` * start the KPM monitor and RC control xApp - this xApp is only a PoC. It collects the measurements stated in [3.1.1 E2SM-KPM](#311-e2sm-kpm) and sends the RC Control message for "QoS flow mapping configuration". However, no control is being done within the RAN itself. Please refer to [3.1.2 E2SM-RC](#312-e2sm-rc) for detailed explanation. ```bash cd flexric # or openairinterface5g/openair2/E2AP/flexric - ./build/examples/xApp/c/kpm_rc/xapp_kpm_rc + XAPP_DURATION=30 ./build/examples/xApp/c/kpm_rc/xapp_kpm_rc ``` * start the (MAC + RLC + PDCP + GTP) monitor xApp ```bash cd flexric # or openairinterface5g/openair2/E2AP/flexric - ./build/examples/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni + XAPP_DURATION=30 ./build/examples/xApp/c/monitor/xapp_gtp_mac_rlc_pdcp_moni ``` Note: GTP is not yet implemented in CU-UP; **if no RIC INDICATION message received**, please check if: (1) UE is connected to the gNB @@ -235,7 +236,7 @@ e2_agent = { * if `XAPP_MULTILANGUAGE` option is enabled, start the python xApps: ```bash - python3 build/examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py # only supported by the gNB-mono + XAPP_DURATION=30 python3 build/examples/xApp/python3/xapp_mac_rlc_pdcp_gtp_moni.py # only supported by the gNB-mono ``` The latency that you observe in your monitor xApp is the latency from the E2 Agent to the nearRT-RIC and xApp. From 5b837f925090041e572a297b647ee27c8d26fe99 Mon Sep 17 00:00:00 2001 From: Teodora Date: Wed, 4 Jun 2025 16:38:20 +0200 Subject: [PATCH 12/14] Remove unnecessary shared volume for SMs Follow-up for https://gitlab.eurecom.fr/mosaic5g/flexric/-/commit/497b4d345171ab92b7060b68c12f4e2e58621444. --- .../yaml_files/5g_rfsimulator_flexric/docker-compose.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml index 899e02295f..6b9771e1c1 100644 --- a/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml +++ b/ci-scripts/yaml_files/5g_rfsimulator_flexric/docker-compose.yml @@ -7,7 +7,6 @@ services: ipv4_address: 192.168.70.150 volumes: - ./conf/flexric.conf:/usr/local/etc/flexric/flexric.conf - - sharedXappLibs:/usr/local/lib/flexric/ healthcheck: test: /bin/bash -c "pgrep nearRT-RIC" interval: 10s @@ -95,7 +94,6 @@ services: ipv4_address: 192.168.70.151 volumes: - ../../conf_files/gnb.sa.band78.106prb.rfsim.flexric.conf:/opt/oai-gnb/etc/gnb.conf - - sharedXappLibs:/usr/local/lib/flexric/ healthcheck: test: /bin/bash -c "pgrep nr-softmodem" interval: 10s @@ -140,9 +138,6 @@ services: timeout: 5s retries: 5 -volumes: - sharedXappLibs: - networks: public_net: name: oai-cn5g-public-net From 26b3b16aa51fe1c1e36f1f1c4543eb88dad6ffcd Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 23 May 2025 10:28:30 +0200 Subject: [PATCH 13/14] Move the OSC nearRT-RIC tutorial in OAI E2 agent from FlexRIC --- openair2/E2AP/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openair2/E2AP/README.md b/openair2/E2AP/README.md index 7866467397..43a39f5afd 100644 --- a/openair2/E2AP/README.md +++ b/openair2/E2AP/README.md @@ -246,3 +246,17 @@ Additionally, all the data received in the `xapp_gtp_mac_rlc_pdcp_moni` xApp is Please note: * KPM SM database is not been updated, therefore commented in `flexric/src/xApp/db/sqlite3/sqlite3_wrapper.c:1152` * RC SM database is not yet implemented. + +# 5. O-RAN SC nearRT-RIC interoperability + +The E2AP port for OSC nearRT-RIC is 36422, but the default value in E2 agent is 36421. Before proceeding with integration, please set the `e2ap_server_port` to 36422, and recompile the OAI. + +## 5.1 H release +We showcased the QoE use case during the O-RAN F2F meeting Phoenix, October 2023: +* [recorded presentation](https://zoom.us/rec/play/N5mnAQUcEVRf8HN6qLYa4k7kjNq3bK4hQiYqHGv9KUoLfcR6GHiE-GvnmAudT6xccmZSbkxxYHRwTaxk.Zi7d8Sl1kQ6Sk1SH?canPlayFromShare=true&from=share_recording_detail&continueMode=true&componentName=rec-play&originRequestUrl=https%3A%2F%2Fzoom.us%2Frec%2Fshare%2FwiYXulPlAqIIDY_vLPQSGqYIj-e5Ef_UCxveMjrDNGgXLLvEcDF4v1cmVBe8imb4.WPi-DA_dfPDBQ0FH). This use case is shown after 4 minutes (04:00). +* [accompanying flyer](https://openairinterface.org/wp-content/uploads/2023/10/demo2-phoenix.pdf) + +The same was shown in the following events: +* [Joint OSC/OSFG-OAI Workshop](https://openairinterface.org/joint-osc-oai-workshop-end-to-end-open-source-reference-designs-for-o-ran/) + +In order to reproduce this testbed, please follow the [O-RAN SC nearRT-RIC installation guide](https://lf-o-ran-sc.atlassian.net/wiki/spaces/GS/overview), and the [kpm-rc-xapp](https://github.com/mirazabal/kpm_rc-xapp) xApp used. Please note that we cannot give support for the O-RAN SC nearRT-RIC. From 83df3c5e79f878c81091f5d26a90357c71fc8231 Mon Sep 17 00:00:00 2001 From: Teodora Date: Fri, 23 May 2025 11:00:06 +0200 Subject: [PATCH 14/14] Add OSC nearRT-RIC J release contribution and xDevSM framework --- openair2/E2AP/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair2/E2AP/README.md b/openair2/E2AP/README.md index 43a39f5afd..5644d10cb5 100644 --- a/openair2/E2AP/README.md +++ b/openair2/E2AP/README.md @@ -260,3 +260,10 @@ The same was shown in the following events: * [Joint OSC/OSFG-OAI Workshop](https://openairinterface.org/joint-osc-oai-workshop-end-to-end-open-source-reference-designs-for-o-ran/) In order to reproduce this testbed, please follow the [O-RAN SC nearRT-RIC installation guide](https://lf-o-ran-sc.atlassian.net/wiki/spaces/GS/overview), and the [kpm-rc-xapp](https://github.com/mirazabal/kpm_rc-xapp) xApp used. Please note that we cannot give support for the O-RAN SC nearRT-RIC. + +## 5.2 J release +The OAI E2 Agent has been successfully integrated with the J release of the O-RAN OSC nearRT-RIC, leveraging the xDevSM framework developed by the MMWG at the University of Bologna and the WIoT at Northeastern University. + +xDevSM framework uses KPM SM (`libkpm_sm.so`) and RC SM (`librc_sm.so`) libraries from FlexRIC. Therefore, only E2AP is validated between OAI E2 Agent and OSC nearRT-RIC. + +Please follow [the xDevSM framework tutorial](https://openrangym.com/tutorials/xdevsm-tutorial) in order to reproduce this testbed, and try [the example xApps](https://github.com/wineslab/xDevSM-xapps-examples) built using this framework.