# OAI rf simulators
###### tags: `Construction`
## Build PHY Simulators
```bash=
cd /openairinterface5g
source oaienv
cd cmake_targets
# build the first time add -I
sudo ./build_oai [-I] --phy_simulators --gNB --nrUE --build-lib all
# To build rf_simulator
cd ran_build/build
make rfsimulator
```
## Execution
* Band 66
* Band 78 [TBD]
```bash=
# Band 66
# gNB
sudo RFSIMULATOR=server ./nr-softmodem --rfsim --sa -O ../../../targets/PROJECTS/GENERIC-NR 5GC/CONF/gnb.sa.band66.fr1.106PRB.usrpn300.conf
# NR UE
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --sa --rfsim -r 106 --numerology 1 --band 66 -C 2169080000 --CO -400000000 --ssb 396 -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
```
## Results
* gNB
`The gNB will wait UE to connect, so gNB will stucks here.`

* NR UR
1. Initial
`
The UE will initial the frequency band to what band you set.`

2. SSB
`
Then UE will start to detect the SSB and try to decode the MIB and SIB1`

3. RAP
`
After successfully decoding the SIB1, the UE will start the 4-step RAP.`
