:::warning # <center><i class="fa fa-edit"></i> Introduction to OpenRAN GYM </center> ::: ###### tags: `RIC` `TEEP` `Internship` `OpenRAN Gym` :::success **Learning Objective: 🎯** The study objectives were to: - [x] Learn to use this platform - [x] Understand the main concept about this topics - [x] Able to duplicate the result from the paper ::: :::info **Reference: 📚** - [OpenRAN Gym](https://drive.google.com/file/d/1s1SNj7G_MbHZF-3j0w7ajj1udWoEbBtW/view?usp=sharing) ::: :::danger **Table of contents: 📜** [TOC] ::: ## Module 1: O-RAN ### 1. The paper's abstract :::spoiler Click to view the abstract from this paper, you can skip this if you already understand \ ==Open Radio Access Network (RAN) architectures will enable interoperability, openness and programmable data driven control in next generation cellular networks.== However, developing and testing efficient solutions that generalize across heterogeneous cellular deployments and scales, and that optimize network performance in such diverse environments is a complex task that is still largely unexplored. In this paper we present OpenRAN Gym, a unified, open, and O-RAN-compliant ==experimental toolbox for data collection, design, prototyping and testing of end-to-end data-driven control solutions for next generation Open RAN systems.== OpenRAN Gym extends and combines into a unique solution several software frameworks for data collection of RAN statistics and RAN control, and a lightweight O-RAN near-real-time RAN Intelligent Controller (RIC) tailored to run on experimental wireless platforms. We first provide an overview of the various architectural components of OpenRAN Gym and describe how it is used to collect data and design, train and test artificial intelligence and machine learning O-RAN-compliant applications (xApps) at scale. We then describe in detail how to test the developed xApps on softwarized RANs and provide an example of two xApps developed with OpenRAN Gym that are used to control a network with 7 base stations and 42 users deployed on the Colosseum testbed. Finally, we show how solutions developed with OpenRAN Gym on Colosseum can be exported to real-world, heterogeneous wireless platforms, such as the Arena testbed and the POWDER and COSMOS platforms of the PAWR program. OpenRAN Gym and its software components are open-source and publicly available to the research community. By guiding the readers from instantiating the components of OpenRAN Gym, to running experiments in a softwarized RAN with an O-RAN-compliant near-RT RIC and xApps, we aim at providing a key reference for researchers and practitioners working on experimental Open RAN systems. ::: ### 2. Introduction Open Radio Access Netwrok (RAN) is the new approach to cellular communications promotes opennes, virtualization, and programmibility of RAN functionalities and components, also enables data-driven intelligent control loops for cellular systems. As such, the Open RAN enables network operators to support new bespoke services on shared physical infrastructures, and to dynamically reconfigure them based on network conditions and user demand. The resulting increased efficiency will also decrease the operational costs of the network. O-RAN introduces two network RAN Intelligent Controllers (RICs), operating at different timescales, enabling programmatic closed-loop control of the RAN elements. It also defines a set of open interfaces to connect the controllers to key elements of the RAN, such as the NR Central Units (CUs), DIstributed Units (DUs), Radio Units (RUs), and the LTE O-RAN-compilant evolved Node Bases (eNBs). In details, the near-real-time (or near-RT) RIC connects to the RAN elements (i.e. CUs and DUs) through the E2 interface, and enables control loops operating at timescales ranging between 10 ms and 1 s. Instead, the non-real-time (or non-RT) RIC is included as part of Service Management and Orchestration (SMO) framewroks, and operates at timescales larger than 1s. Typical workflows for the design and testing of such AI/ML algorithms encompass a number of different steps such as : 1. data models, to create practical datasets representative of the different environments (e.g., the wireless channel) where the AI/ML models will be deployed, as well as of various performance indicators of the network 2. AI/ML model design, selecting the inputs and outputs of the models, and training and testing, to evaluate the effectiveness and limits of such models 3. model deployment as applications deployed on the RICs, i.e., xApps/rApps or—as recently proposed indirectly on the CUs/DUs via dApps 4. model fine-tuning with run-time data from the RAN, to adapt the models to different production environments 5. the actual control, inference and/or forecasting or the RAN ### 3. What is OpenRAN Gym? OpenRAN Gym is platform-independent, and it allows users to perform data collection campaigns, prototye, and evaluate solutions in a set of heterogeneous wireless environments and deployments before transitioning them to production networks. As such, OpenRAN Gym can be used to first prototype and validate solutions on the Colosseum wireless network emulator, and then seamlessly transfer such solutions to heterogeneous platforms, such as the Arena testbed, and the POWDER and COSMOS platforms from the PAWR program The OpenRAN Gym architecture is shown in the figure below. ![image alt](https://openrangym.com/assets/post-assets/openrangym-architecture.png) Its main components are: 1. publicly- and remotely-accessible experimental wireless platforms for collecting data, prototyping, and testing solutions in heterogeneous environments. Example of these are the Colosseum wireless network emulator , the Arena testbed, and the platforms of the PAWR program 2. a softwarized RAN implemented through open protocol stacks for cellular networks, such as srsRAN and OpenAirInterface 3. a data collection and control framework, such as SCOPE, that exposes Application Programming Interfaces (APIs) to extract relevant Key Performance Measurements (KPMs) from the RAN, and dynamically control it at run-time 4. an O-RAN control architecture, such as ColO-RAN, able to connect to the RAN through open and standardized interfaces (e.g., the ORAN E2 interface), receive the run-time KPMs from the RAN, and control it through AI/ML solutions running, for instance, as xApps/rApps ### 4. How about data collection and control framework? The data collection and control framework of OpenRAN Gym is based on SCOPE. This framework provides a programmable environment for prototyping and testing solutions for softwarized RANs, and data collection capabilities of relevant KPMs (e.g., throughput, Transport Blocks (TBs), buffer occupancy). Open APIs to fine-tune the configuration of the RAN at run time, and to perform data collection campaigns are also provided by SCOPE. Coupled with different testbeds—such as Colosseum and the platform of the PAWR program—SCOPE can facilitate the collection of RAN KPMs in a set of heterogeneous scenarios and environments by automatically collect such statistics from the running experiments. Finally, SCOPE connects to the O-RAN near-RT RIC through a RAN-side O-RAN E2 termination, which is based on the OSC DU. This allows user-defined xApps running on the near-RT RIC to swiftly interface with the RAN base stations, and to dynamically control their functionalities at run time (e.g., modify the scheduling policy and set the amount of resources allocated to each network slice). ### 5. How SCOPE works? SCOPE provides Command-line Interface (CLI) tools to start the cellular base stations and configure them through parameters passed via configuration files. The main parameters of interest to OpenRAN Gym are described as follows. >* **network-slicing**: enables/disables the network slicing functionalities of the base station. >* **slice-allocation**: if network slicing has been enabled, this parameter can be used to set the Resource Block Groups (RBGs) allocated by the base station to each slice. The input of this configuration option is passed as {slice:[first rbg, last rbg],...}. As an example, {0:[0,5],1:[6,10]} allocates RBGs 0-5 to slice 0 and 6-10 to slice 1. >* **slice-scheduling-policy**: sets the scheduling policy used for each network slice of the base station. As an example, [1,2] assigns slicing policy 1 to slice 0 and policy 2 to slice 1. The possible numerical values for this field match the scheduling policies supported by SCOPE (i.e., 0: round-robin, 1: waterfilling, 2: proportionally fair). >* **slice-users**: associates UEs to a specific network slice. The input of this configuration option is passed as {slice:[ue1,ue2],...}. As an example, {0:[4,5],1:[2,3]} assigns UEs 4, 5 to slice 0, and UEs 2, 3 to slice 1. >* **generic-testbed**: specifies whether SCOPE is running on a testbed other than Colosseum. In this case, the parameters node-is-bs and ue-id can also be passed to specify whether the node should act as a base station or a UE, and the identifier of the UE in the latter case. ### 6. How is the xAPP's workflow on Colloseum? The main steps to develop a data-driven xApp using OpenRAN Gym on Colosseum: 1. Data collection : This step involves collecting the data that will be used to train and test the AI/ML model to embed in the xApp. In Colosseum, this can be done by combining the data-collection capabilities of SCOPE with the automated experiments of Colosseum. 2. Model design, training and testing : This step includes the selection of the AI/ML algorithm that the model will use, along with the data used as input, the reward function, and the set of output actions (e.g., to perform inference or control of the RAN). 3. Deploy the model as an xApp: After the model has been tested (step 2), it can be deployed as an xApp on the ColO-RAN near-RT RIC. 4. Online model fine-tuning : At run-time, the xApp communicates with the SCOPE base station through the nearRT RIC and the E2 termination. To this aim, the xApp first subscribes to the base station by sending it a RIC Subscription message. Then, it triggers periodic KPMs reports—with periodicity tunable based on the needs of the users from the base station. These reports are sent through RIC Indication messages, and they may be used by the xApp to fine-tune the model online, allowing it to adapt to varying wireless conditions and traffic demand. 5. Perform RAN control/inference : This entails the xApp transmitting the actions computed by the model to the SCOPE base station through RIC Control messages.