###### tags: `open5gs` `openairinterface`
:::info
- **Location:** RT LAB
- **Date:** March 4, 2025
- **Author:** Saffana Zyan DINI
- **Contact:** Zyzy <M11102815@gapps.ntust.edu.tw>
- **Reference:**
- [End to End test open5gs and Openairinterface CU/DU split](https://hackmd.io/@HMiZWWkbRWe7Lksri7E63g/SyaWXi3ZJe)
- https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/6b3f26f538f4f3d99733ca43cef1ecb942ca857c/doc/handover-tutorial.md
:::
## General Source Code, Version and Config
1. Open5GS ~VM1
- version: v2.7.2-76-gce36143f5`sudo git describe --tags`
- VM OS : Ubuntu 22.04.6
- IP : 192.168.60.2
- ogstun : 10.45.0.1
1. Openairinterface ~VM2(CU) & ~VM3 (DU0, DU1 & UE)
- version: 2025.w04-15-g2650f8b102
- VM OS : Ubuntu 22.04.6
- IP cu ngap : 192.168.60.8
- IP cu f1ap (local) : 192.168.60.88
- IP cu f1ap (remote) : 0.0.0.0 # multi du
- IP DU0 f1ap (local) : 192.168.60.99
- IP DU0 f1ap (remote) : 192.168.60.88
- IP DU1 f1ap (local) : 192.168.60.11
- IP DU1 f1ap (remote) : 192.168.60.88
## Architecture

## Installation Guide
### Clone and Build OAI with e2 interface
Since the UE does not support any measurement reporting, it cannot trigger a handover on its own; it has to be triggered manually through telnet. Thus, build both gNB and UE as well as activate the build of telnet to that purpose
```
sudo git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git <directory name>
e.g. sudo git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git zy-OAI
cd cmake_targets
# build telnet support
./build_oai --ninja --nrUE --gNB --build-lib telnetsrv
```
## Usage/deployment
run CU —> run DU0 —> run UE connect to DU0 —> run DU1 —> trigger HO in CU
### Modify Configuration
* CU
```
cd ran_build/build/
sudo nano ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf
```
* DU0
```
sudo nano ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf
```
* UE
Make sure the information UE subcriber same as Open5gs webui or other CN that you use.
```
cd ran_build/build/
sudo nano ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
```
* DU1
```
cd ran_build/build
sudo nano ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf
```
### Run CU
```
cd ran_build/build
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-cu.sa.f1.conf --telnetsrv --telnetsrv.shrmod ci
```

### Run DU0
```
cd ran_build/build
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci0.conf --rfsimulator.serveraddr 127.0.0.1
```
keep `--rfsimulator.serveraddr 127.0.0.1` in DU, it will make error but it normal because it is act as client and ue act as server.


### Run UE
Run UE before run DU1, UE need to establish PDU session connection with DU0 first. then run DU1 to make handover procedure. You Also can change the pattern to run
DU1 --> UE --> DU0:
> **Chose one of them**
* this if you want to establish with DU0 first (DU0 --> UE --> DU1):
```
cd ran_build/build
sudo ./nr-uesoftmodem -C 3450720000 -r 106 --numerology 1 --ssb 516 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --rfsim --rfsimulator.serveraddr server
```

connect to DU, DU as client and UE as server

pdu session established

* if you want to establish with DU1 first (DU1 --> UE --> DU0), run:
```
cd ran_build/build
sudo ./nr-uesoftmodem -C 3649440000 -r 106 --numerology 1 --ssb 516 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf --rfsim --rfsimulator.serveraddr server
```
### Run DU1
```
sudo ./nr-softmodem --rfsim -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb-du.sa.band78.106prb.rfsim.pci1.conf --rfsimulator.serveraddr 127.0.0.1
```
incorrect result:

correct result:

### Triger Handover in CU using telnet
you can run it in every directory in CU VM
```
echo ci trigger_f1_ho | nc 127.0.0.1 9090 && echo
```

## Result
:dart: Handover Procedure
---
:::success
CU log


:::
==Importance==
DU0 log with UE handover procedure
:::danger
incorrect

:::
:::success
correct

:::
**DU1 log with UE handover procedure**
:::danger
incorrect

:::
:::success
correct

:::
UE log
:::success

:::
check PDU session establishment during handover:
> `ping 10.45.0.1` if after trigger handover in cu, ping still connect to DN your handover procedure is **success**