# 5G sim
https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/NR_SA_tutorials/doc/NR_SA_CN5G_gNB_N300_COTS_UE_Tutorial.md
### 4G RFSIM - Javier Morgade - getting error while running feMBMS on RFSIMULATOR
Not sure what you do exactly want to test but this log looks okay to me ... if you push some traffic you should be able to see some additional log on the UE side
1. The following establishes a regular eMBMS (mixed unicast / multicast) session
`sudo RFSIMULATOR=enb ./lte-softmodem -O ../../../ci-scripts/conf_files/lte-fdd-mbms-basic-sim.conf --rfsim --noS1 --nokrnmod 1`
`sudo RFSIMULATOR=127.0.0.1 ./lte-uesoftmodem -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1 --rfsim`
2. Simply use lte-fdd-fembms-basic-sim.conf if you wanna set up FeMBMS (broadcast dedicated) ... both files differ on flag: (mbms_dedicated_serving_cell = "ENABLE") though. Moreover, you may also like to increase "allocated_sf_end".
`sudo RFSIMULATOR=enb ran_build/build/lte-softmodem -O ../../../ci-scripts/conf_files/lte-fdd-fembms-basic-sim.conf --rfsim --noS1 --nokrnmod 1`
`sudo RFSIMULATOR=127.0.0.1 ./lte-uesoftmodem -C 2680000000 -r 25 --ue-rxgain 120 --ue-txgain 0 --ue-max-power 0 --ue-scan-carrier --nokrnmod 1 --noS1 --rfsim`
3. In order to push IP traffic i.e RTP video streaming (for both MBMS and FeMBMS):
- get a suitable video file (i.e jellyfish-5-mbps-hd-h264.mkv). You may want to install ffmpeg
- You should be able to find two tun interfaces (oaitun_enm1 10.0.2.1) and (oaitun_uem1 10.0.2.2) so simply push traffic on eNB Machine:
`ffmpeg -re -i jellyfish-5-mbps-hd-h264.mkv -f rtp_mpegts rtp://10.0.2.2:5000`
- ... and playback on UE Machine:
`ffplay rtp://10.0.2.2:5000`
You can always try all this on the same machine ... simply try with other IP from same subnet (i.e 10.0.2.3) and you should be able to see packets passing through the MBMS session (see UE log)
**But us for testing purposes (not use our Internet bandwidth) we prefer to manage traffic internally.**
# Missing traffic generator - build manually - [link](https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/GENERATE_TRAFFIC.md#1-build-a-traffic-generator-image)
## 1. Build a traffic generator image #
```bash
$ cd openair-epc-fed
$ cd ci-scripts
$ docker build --target trf-gen --tag trf-gen:production --file Dockerfile.traffic.generator.ubuntu18.04 .
$ docker image prune --force
$ docker image ls
trf-gen production bfdfe4e7ac51 1 minute ago 217MB
```
## 2. Instantiate a container #
```bash
$ docker run --privileged --name prod-trf-gen --network prod-oai-public-net -d trf-gen:production
```
## 3. Redirect the traffic from the UE Allocation pool(s) to SPGW-U container #
```bash
$ SPGWU_IP=`docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-oai-spgwu-tiny`
$ docker exec -it prod-trf-gen /bin/bash -c "ip route add 12.1.1.0/24 via ${SPGWU_IP} dev eth0"
```
## 4. Ping an attached UE #
```bash
$ docker exec -it prod-trf-gen /bin/bash -c "ping -c 20 12.1.1.2"
```
## 5. Iperf versions #
Depending on the `iperf` version that is installed on your UE, use:
```bash
$ docker exec -it prod-trf-gen /bin/bash -c "iperf --version"
iperf version 2.0.10 (2 June 2018) pthreads
$ docker exec -it prod-trf-gen /bin/bash -c "/iperf-2.0.5/bin/iperf --version"
iperf version 2.0.5 (08 Jul 2010) pthreads
```