# <center><i class="fa fa-edit"></i> Learning the Fundamentals : Near RT- RAN Intelligent Controller </center>
###### tags: `Pre-Internship`
:::info
**Goal:**
To gain a basic understanding of the basics of Near RT-RIC
- [x] What's The Purpose of RIC
- [x] What's The component behind RIC
- [x] How RIC is implemented in 5G
**Resources:**
[ORAN Software Community](https://wiki.o-ran-sc.org/display/ORAN)
[OSC Training Course](https://hackmd.io/HvThns4FQjS1xScrNdvBmw?view)
[Previous Note](https://hackmd.io/XkCvjUDYT9mG-pro6EWWzA)
:::
## Near-Realtime RIC : Overview

The O-RAN reference architecture provides next generation RRM with embedded intelligence,while optionally accommodating legacy RRM. This resides within the RIC Near RT function layer. The RIC near-RT is completely compatible with legacy RRM and its design is started to enhancing the operational challenging functions such as per-UE controlled load-balancing, RB management, interference detection and mitigation.
RIC Near-RT has following functions includes:
1. It provides new functions leveraging embedded intelligence,such as QoS management, connectivity management and seamless handover control.
2. The RIC near-RT delivers a robust, secure, and scalable platform that allows for flexible on-boarding of third-party control-applications.
3. RIC near-RT functions leverages a database called the Radio-Network Information Base (R-NIB) which captures the near real-time state of the underlying network
4. It feeds various RAN measurements data, to the near-RT RIC to facilitate radio resource management
5. It also provides initiate configuration commands to CU/DU.
6. The near-RT RIC can be provided by traditional TEMs or 3rd-party players
7. RIC near-RT receives an AI model from RIC non-RT and execute it to change the functional behavior of the network
8.
## Architecture

The Architecture of Near-RT RIC includes:
### 1. xApps
- Provide Data monitoring
- Provide Parameter adjustment
- 2 Important part in xApp:
- Image : Docker Image
- Descriptor : Contains configuration data for xApp
### 2. Messaging Infrastructure
- Message interaction in Near-RT RIC
- Feature : Low Latency, POint-to-point
- Use RMR (RIC) Mesage Router
- Library that allows applications to send message to other application.
### 3. Conflict Mitigation
- Resolve Potential overlapping or conflicting situations.
- Direct Conflicts
- Two/more xApps request different settings to control target.
- ex : Person A and B is xApps A and B, person A request person C to go left, but person B request person C to go right.
- Conflict mitigtion will resolve which actin to take.
- Indirect Conflicts
- Two/more parameters that affect the same result will potentially have conflict.
- ex : xApps A contain antenna angle parameter, xApps B contain measurement deviations. Both affect the size of boundary and have a potential conflict when apllied.
### 4. xApp subscription management

- Manages subscription from the xApps to the E2 Nodes.
- When two or more xApss subscribe to the same E2 node, the subscription management will merge the identical subscription from different xApp into a single subscription.
### 5. Management Services
- To achieve LCM (Life-Cycle Management) of xApp
- FCAPS Management of Near-RT RIC.
- FCAPS = Fault, Configuration Accounting Performance Security
### 6. Security
- Prevent malicious third-party xApps from abusing radio network information.
- This is needed since O-RAN is an open interface, everyone can create their own third-party xApps.
### 7. SDL (Share Data Layer)
- It is an API related to database.
- Used to store and show any data to database.
- Enable stateless application processes.
- ex : In some process, server won't recall states of the user, it will reduce resource consumption.
---
## Near-Realtime RIC : Intefaces

1. A1 : is the interface between non-RT RIC and modular CU which contains non-RT RIC.
2. E2 : a standard interface between the near-RT RIC and CU/DU in the context of an O-RAN architecture.
3. O1 : Interface between orchestration & management entities (Orchestration/NMS) and O-RAN managed elements, for operation and management, by which FCAPS management, Software management, File management and other similar functions shall be achieved.
## Near-Realtime RIC : Components

### RIC Platform
1. A1 Mediator : The A1 Mediator listens on the northbound interface of the RIC for policy guidance. The caller (e.g., non RT RIC, SMO, etc.) creates policy types and policy instances through A1, and subsequently A1 exchanges messages with xApps via RMR.
2. E2 Manager : E2M records the state of each RAN
3. E2 Terminator : Routing Message from the xApps through the SCTP connection to the E2Node.
4. O1 Mediator : Reports Faults and Events.
5. Routing Manager : It is Responsible for distributing routing policies among the other platform components and xApps.
6. Subscription Manager : Subscription Manager is a basic platform service in RIC. It is responsible for managing E2 subscriptions from xApps to the Radio Access Network (RAN).
7. xApp Manager : To deploy/undeploy xApps, record xApps status, and support health check
### RIC xApps
xApps is an application designed to run on the Near-RT RIC, is also likely to consist of one or more microservices and at the point of on-boarding will identify which data it consumes and which data it provides. The application is independent of the Near-RT RIC and may be provided by any third party. E2 enables a direct association between the xApp and the RAN functionality.
#### xApp descriptor
xApp descriptor describes the packaging format of xApp image.
The xApp descriptor provides and includes:
* xApp management services with necessary information for the LCM of xApps, such as deployment, deletion, upgrade etc.
* Includes the basic information of xApp for LCM, including name, version, provider, URL of xApp image, virtual resource requirements (e.g. CPU), etc.
* Extra parameters related to the health management of the xApps, such as auto scaling when the load of xApp is too heavy and auto healing when xApp becomes unhealthy.
* FCAPS and control parameters to xApps when xApp is launched.
* Includes the FCAPS management specifications that specify the options of configuration, performance metrics collection, etc. for the xApp.
* Includes the control specifications that specify the data types consumed and provided by the xApp for control capabilities (e.g. PM data that the xApp subscribes, the message type of control messages).
#### xApp image
xApp image is the software package. The xApp image contains all the files needed to deploy an xApp. An xApp can have multiple versions of xApp image, which are tagged by the xApp image version number
#### Example xApps (under O-RAN SC’s RICAPP project)
* Measurement campaign xApp - general and procedure-specific KPIs for ~18 EN-DC related messages, using gslite stream processing tool
* Admission control xApp – uses E2 to play with EN-DC’s SgNBAdditionRequest to implement simple admission
* control on gNB.
* kpimon xApp - collects information from O-CU and O-DU using the E2 interface and calculates KPIs based on this information. Provides information to other xApps
* Proprietary closed-source xApps
* A good way to start getting involved
## xApp Manager
The **xApp Manager** provides a flexible and secure way to manage xApps on the RIC. It has a REST API that is able to do the following:
* xApp
* Deploy / undeploy
* Query status of xApps and xApp instances
* Perform a health check on the RIC
* Subcriptions (hooks)
* Add and delete subscription
* Updating subscriptions
* Getting subscriptions
The functions may also be called from a command line interface.
xApp status when queried displays the following:
* xApp name and version
* Status
* Instances
* Individual names and status
* IP
* Bound port
* TX / RX messages