---
# System prepended metadata

title: OAI - srsRAN

---

# srsRAN UE -> OAI
#### SSH setting (Optional)
OAI computer:
```bash=
sudo apt install openssh-server
ifconfig

> ...
> wlp58s0: ...
>         inet <ip>
> ...
```
srsRAN computer:
> <inetIP> should be replaced.
```bash=
ssh labuser@<inetIP>

> 1234
```

#### Edit .conf files
> OAI
> > mmc|mnc|tac
    tac|mcc|mnc|band|frequency|offset
>
> srsRAN
> > earfcn|imsi
```bash=
gedit /usr/local/etc/oai/mme.conf
gedit ~/openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf

gedit .config/srsran/ue.conf
```

#### Edit OAI HSS DB
```bash!
sudo apt install phpmyadmin && sudo sed -i '1i Include /etc/phpmyadmin/apache.conf' /etc/apache2/apache2.conf && sudo service apache2 restart && firefox http://localhost/phpmyadmin
```
    
#### Run systems
```bash=
cd && sudo ./openair-cn/scripts/run_hss
sudo ./openair-cn/scripts/run_mme
sudo ./openair-cn/scripts/run_spgw
sudo -E ./openairinterface5g/cmake_targets/lte_build_oai/build/lte-softmodem -O ./openairinterface5g/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
    
sudo ~/srsRAN_4G/build/srsue/src/srsue ~/.config/srsran/ue.conf
```

#### Capture packets
```bash=
    sudo apt install wireshark
    tcpdump -i any -w file_name
```
- hss key imsi  
![hss](https://hackmd.io/_uploads/Bk4pFyRzkg.png)

- mme attached ue
![mme](https://hackmd.io/_uploads/SJ5TYyCzkl.png)

- enb rrc connected
![enb](https://hackmd.io/_uploads/SJ0TK1RMJg.png)

- ue rrc connected
[RRC][I][FRAME 00000][eNB][MOD 00][RNTI 7e9] UE State = RRC_CONNECTED
    
#
> [name=Joon]
> 
> experiment environment: 
> > software:
> Ubuntu 18.04.6 LTS (amd64)
> 
> 
> > hardware:
> intel NUC
> USRP
> 
> reference:
> [ue.conf modifying](https://hackmd.io/@jhong/srslte)
> [srsRAN UE command](https://docs.srsran.com/projects/4g/en/latest/usermanuals/source/srsue/source/2_ue_getstarted.html)
> [tcpdump command](https://study-melody.tistory.com/36)
> [file sharing via SSH](https://cyberpanel.net/blog/transfer-files-over-ssh)
> [RRC protocol](https://www.sharetechnote.com/html/BasicCallFlow_LTE.html)
> [chatGPT](https://chatgpt.com/)
>
> based on:
> [OAI on Ubuntu 18](https://hackmd.io/@intJoon/rkmtmeae1l)
> [srsRAN](https://hackmd.io/@intJoon/Bk_ywZVlyx)