---
# System prepended metadata

title: 'xApp Development: Colosseum Near RT RIC and OAI'

---

# xApp Development: Colosseum Near RT RIC and OAI

[TOC]

---

## Architecture

![image](https://hackmd.io/_uploads/SyMP-AKulx.png)

## Pre-Requisites

- **OAI**: [OAI Installation](https://hackmd.io/@nomaden/BkFteqYOlx)
- **Colosseum Near RT RIC** 
    For RIC, we will be using Colosseum Near RT RIC. Follow this tutorial to setup the RIC: [Colosseum Near RT RIC Setup](https://hackmd.io/EcYW22grRDSGmM9id95UHg#Near-RT-RIC-Setup). **(No need to deploy ns-o-ran)**
- **FlexRIC**
    FlexRIC will only be used for the Service Model (SM) connector since Colosseum sm-connector is not compatible. [FlexRIC Installation](https://hackmd.io/@nomaden/rJPhM5FOgg)

## Setup Colosseum Near RT RIC

Open three terminal:
- One for gNB-CU
- One for gNB-DU
- One for Colosseum Near RT RIC

### Change E2Term Port

```bash!
sudo nano ~/colosseum-near-rt-ric/setup-scripts/setup-lib.sh
```

Change E2 SCTP Port to 36421:

```shell!
E2TERM_SCTP_PORT=36421
```

![image](https://hackmd.io/_uploads/HyGJ1y9ulx.png =200x)

### Deploy the Near RT RIC components

```bash!
cd ~/colosseum-near-rt-ric/setup-scripts
./setup-ric-bronze.sh
```

### Check Docker

```bash!
docker ps
```

:::success
:::spoiler Result
![image](https://hackmd.io/_uploads/Sy8zZCFOlg.png)
::::::

## Setup OAI O-RAN

### DU Configuration

```bash!
sudo nano ~/openairinterface5g/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf
```

Add these on the bottom of the file:
```conf!
e2_agent = {
  near_ric_ip_addr = "10.0.2.1";
  sm_dir = "/usr/local/lib/flexric/"
}
```

![image](https://hackmd.io/_uploads/HJgRyGu_lg.png =500x)

### Run CU

```bash!
cd ~/openairinterface5g/cmake_targets/ran_build/build
sudo ./nr-softmodem -O ~/oai/targets/PROJECTS/GENERIC-NR-5GC/CONF/cu_gnb.conf --rfsim --sa -E
```

:::info
:::spoiler Result
![image](https://hackmd.io/_uploads/HykegCFOex.png)

>[!Note] Error Notes
>We can just ignore the GTP-U error since we don't use the Core components.
::::::

### Run DU

```bash!
sudo ./nr-softmodem -O ~/oai/targets/PROJECTS/GENERIC-NR-5GC/CONF/du_gnb.conf --rfsim --sa -E
```

:::info
:::spoiler Result
![image](https://hackmd.io/_uploads/r1ep-0Kdxg.png =500x)
::::::

## Result

### CU and DU Can Connect

:::spoiler **CU**
![image](https://hackmd.io/_uploads/rJSxG0Kdxg.png =500x)
:::

:::spoiler **DU**
![image](https://hackmd.io/_uploads/By6mM0tdex.png =500x)
:::

### E2 Agent from DU

:::spoiler **Created**
![image](https://hackmd.io/_uploads/BkFwGRKOle.png =500x)
:::

### E2 Agent can't Connect to E2Term RIC

:::spoiler **Timeout**
![image](https://hackmd.io/_uploads/HkdjMCK_xe.png =500x)
:::

## Conclusion

For now, I haven't found any way to make the OAI O-RAN E2 Agent to be compatible with Colosseum Near RT RIC.