Commit 02c7387c authored by maaroufi's avatar maaroufi

Corrected some typos, stripped dollars from bash commands to make it easier to...

Corrected some typos, stripped dollars from bash commands to make it easier to copy and moved section 5 to the beginning because it needs to be followed at the beginning of the tutorial
parent 464a62dd
...@@ -13,17 +13,53 @@ ...@@ -13,17 +13,53 @@
</table> </table>
This page is only valid for an `Ubuntu18` host. This page is only valid for an `Ubuntu18` host.
I has been tested also for `Ubuntu20`.
This tutorial is only valid once this file is merged into the `develop` branch. This tutorial is only valid once this file is merged into the `develop` branch.
# 1. Adapt the `docker-compose` to your environment #
The yaml file is in the following directory: `ci-scripts/yaml_files/5g_l2sim_tdd`</br>
In the `SMF` section, provide your own DNS IP address:
```yaml
DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
```
In the `gNB` section, provide your docker-host primary IP address and interface name: in our case `172.21.16.128` and `eno1`.
```yaml
GNB_NGA_IF_NAME: eno1
GNB_NGA_IP_ADDRESS: 172.21.16.128
GNB_NGU_IF_NAME: eno1
GNB_NGU_IP_ADDRESS: 172.21.16.128
```
Same thing in the `nr-ue` section:
```yaml
NR_UE_NFAPI_IF_NAME: eno1
```
This tutorial is a first draft. This nFAPI feature and the proxy are still under development.
At time of writing, we were able to run in `host-mode`, 1 `NR-UE` and just ping traffic.
Later development will include:
- deploying `gNB-VNF`, `proxy` and `UE` in isolated containers (with their own IP address)
- more UEs
- more traffic (`UDP` and `TCP`)
# 1. Retrieving the images on Docker-Hub # # 2. Retrieving the images on Docker-Hub #
Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`. Currently the images are hosted under the team account `oaisoftwarealliance`. They were previously hosted under the user account `rdefosseoai`.
Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`. Once again you may need to log on [docker-hub](https://hub.docker.com/) if your organization has reached pulling limit as `anonymous`.
```bash ```bash
$ docker login docker login
```
```bash
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one. Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: Username:
Password: Password:
...@@ -32,33 +68,33 @@ Password: ...@@ -32,33 +68,33 @@ Password:
Now pull images. Now pull images.
```bash ```bash
$ docker pull mysql:8.0 docker pull mysql:8.0
$ docker pull oaisoftwarealliance/oai-amf:v1.5.0 docker pull oaisoftwarealliance/oai-amf:v1.5.0
$ docker pull oaisoftwarealliance/oai-nrf:v1.5.0 docker pull oaisoftwarealliance/oai-nrf:v1.5.0
$ docker pull oaisoftwarealliance/oai-smf:v1.5.0 docker pull oaisoftwarealliance/oai-smf:v1.5.0
$ docker pull oaisoftwarealliance/oai-spgwu-tiny:v1.5.0 docker pull oaisoftwarealliance/oai-spgwu-tiny:v1.5.0
$ docker pull oaisoftwarealliance/trf-gen-cn5g:focal docker pull oaisoftwarealliance/trf-gen-cn5g:focal
$ docker pull oaisoftwarealliance/oai-gnb:develop docker pull oaisoftwarealliance/oai-gnb:develop
$ docker pull oaisoftwarealliance/oai-nr-ue:develop docker pull oaisoftwarealliance/oai-nr-ue:develop
$ docker pull oaisoftwarealliance/proxy:develop docker pull oaisoftwarealliance/proxy:develop
``` ```
And **re-tag** them for tutorials' docker-compose file to work. And **re-tag** them for tutorials' docker-compose file to work.
```bash ```bash
$ docker image tag oaisoftwarealliance/proxy:develop oai-lte-multi-ue-proxy:latest docker image tag oaisoftwarealliance/proxy:develop oai-lte-multi-ue-proxy:latest
``` ```
```bash ```bash
$ docker logout docker logout
``` ```
Note that the proxy image is based on the source available at [https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy). Note that the proxy image is based on the source available at [https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy).
At time of writing, the `latest` tag corresponded to `56cfdc046a5f96d5e67d42a2fc2bf6ba2fe58b41` commit. At time of writing, the `latest` tag corresponded to `56cfdc046a5f96d5e67d42a2fc2bf6ba2fe58b41` commit.
# 2. Deploy containers # # 3. Deploy containers #
**CAUTION: this SHALL be done in multiple steps.** **CAUTION: this SHALL be done in multiple steps.**
...@@ -72,11 +108,13 @@ The `gNB`, `proxy` and `NR-UE` containers will be deployed in `host`-mode. It wi ...@@ -72,11 +108,13 @@ The `gNB`, `proxy` and `NR-UE` containers will be deployed in `host`-mode. It wi
sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up sudo ifconfig lo: 127.0.0.2 netmask 255.0.0.0 up
``` ```
## 2.1. Deploy OAI 5G Core Network ## ## 3.1. Deploy OAI 5G Core Network ##
```bash ```bash
$ cd ci-scripts/yaml_files/5g_l2sim_tdd cd ci-scripts/yaml_files/5g_l2sim_tdd
$ docker-compose up -d mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn docker-compose up -d mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
```
```bash
Creating network "l2sim-oai-public-net" with driver "bridge" Creating network "l2sim-oai-public-net" with driver "bridge"
Creating network "l2sim-oai-traffic_net-net" with driver "bridge" Creating network "l2sim-oai-traffic_net-net" with driver "bridge"
Creating l2sim-oai-nrf ... done Creating l2sim-oai-nrf ... done
...@@ -90,7 +128,9 @@ Creating l2sim-oai-ext-dn ... done ...@@ -90,7 +128,9 @@ Creating l2sim-oai-ext-dn ... done
Wait for a bit. Wait for a bit.
```bash ```bash
$ docker-compose ps -a docker-compose ps -a
```
```bash
Name Command State Ports Name Command State Ports
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
...@@ -104,7 +144,9 @@ l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 880 ...@@ -104,7 +144,9 @@ l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 880
At this point, you can prepare a capture on the newly-created public docker bridges: At this point, you can prepare a capture on the newly-created public docker bridges:
```bash ```bash
$ ifconfig ifconfig
```
```bash
... ...
l2sim-public: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 l2sim-public: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.71.129 netmask 255.255.255.192 broadcast 192.168.71.191 inet 192.168.71.129 netmask 255.255.255.192 broadcast 192.168.71.191
...@@ -124,16 +166,19 @@ l2sim-traffic: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ...@@ -124,16 +166,19 @@ l2sim-traffic: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
TX packets 3999 bytes 23367972 (23.3 MB) TX packets 3999 bytes 23367972 (23.3 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
... ...
```
$ sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not arp and not port 53 and not port 2152 and not port 2153)" -i l2sim-public -i l2sim-traffic -w /tmp/capture_5g_l2sim_tdd.pcap > /tmp/tshark.log 2>&1 & ```bash
sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not arp and not port 53 and not port 2152 and not port 2153)" -i l2sim-public -i l2sim-traffic -w /tmp/capture_5g_l2sim_tdd.pcap > /tmp/tshark.log 2>&1 &
``` ```
## 2.2. Deploy OAI gNB in Standalone Mode as a VNF ## ## 3.2. Deploy OAI gNB in Standalone Mode as a VNF ##
**CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).** **CAUTION: To execute this 2nd step, the whole `CN5G` SHALL be in `healthy` state (especially the `mysql` container).**
```bash ```bash
$ docker-compose up -d oai-gnb docker-compose up -d oai-gnb
```
```bash
l2sim-oai-nrf is up-to-date l2sim-oai-nrf is up-to-date
l2sim-oai-spgwu is up-to-date l2sim-oai-spgwu is up-to-date
l2sim-oai-ext-dn is up-to-date l2sim-oai-ext-dn is up-to-date
...@@ -144,6 +189,8 @@ Wait for a bit. ...@@ -144,6 +189,8 @@ Wait for a bit.
```bash ```bash
$ docker-compose ps -a $ docker-compose ps -a
```
```bash
Name Command State Ports Name Command State Ports
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
...@@ -157,8 +204,10 @@ l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 880 ...@@ -157,8 +204,10 @@ l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 880
You can verify that the `gNB` is connected with the `AMF`: You can verify that the `gNB` is connected with the `AMF`:
```bagh ```bash
$ docker logs rfsim5g-oai-amf docker logs l2sim-oai-amf
```
```bash
... ...
[AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------| [AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------|
[AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN | [AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN |
...@@ -167,10 +216,12 @@ $ docker logs rfsim5g-oai-amf ...@@ -167,10 +216,12 @@ $ docker logs rfsim5g-oai-amf
... ...
``` ```
## 2.3. Deploy OAI NR-UE and proxy ## 3.3. Deploy OAI NR-UE and proxy
```bash ```bash
$ docker-compose up -d proxy oai-nr-ue0 docker-compose up -d proxy oai-nr-ue0
```
```bash
l2sim-mysql is up-to-date l2sim-mysql is up-to-date
l2sim-oai-nrf is up-to-date l2sim-oai-nrf is up-to-date
l2sim-oai-amf is up-to-date l2sim-oai-amf is up-to-date
...@@ -185,7 +236,9 @@ Creating l2sim-proxy ... done ...@@ -185,7 +236,9 @@ Creating l2sim-proxy ... done
Wait for a bit. Wait for a bit.
```bash ```bash
$ docker-compose ps -a docker-compose ps -a
```
```bash
Name Command State Ports Name Command State Ports
------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------
l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp l2sim-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
...@@ -197,8 +250,11 @@ l2sim-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/ ...@@ -197,8 +250,11 @@ l2sim-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/
l2sim-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp l2sim-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp
l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp l2sim-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
l2sim-proxy /oai-lte-multi-ue-proxy/bi ... Up (healthy) l2sim-proxy /oai-lte-multi-ue-proxy/bi ... Up (healthy)
```
$ docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}} {{.MemUsage}}\t{{.MemPerc}}" l2sim-mysql l2sim-oai-amf l2sim-oai-ext-dn l2sim-oai-gnb l2sim-oai-nr-ue0 l2sim-oai-nrf l2sim-oai-smf l2sim-oai-spgwu l2sim-proxy ```bash
docker stats --no-stream --format "table {{.Container}}\t{{.CPUPerc}} {{.MemUsage}}\t{{.MemPerc}}" l2sim-mysql l2sim-oai-amf l2sim-oai-ext-dn l2sim-oai-gnb l2sim-oai-nr-ue0 l2sim-oai-nrf l2sim-oai-smf l2sim-oai-spgwu l2sim-proxy
```
```bash
CONTAINER CPU % MEM USAGE / LIMIT MEM % CONTAINER CPU % MEM USAGE / LIMIT MEM %
l2sim-mysql 0.03% 206.7MiB / 62.54GiB 0.32% l2sim-mysql 0.03% 206.7MiB / 62.54GiB 0.32%
l2sim-oai-amf 4.05% 29.49MiB / 62.54GiB 0.05% l2sim-oai-amf 4.05% 29.49MiB / 62.54GiB 0.05%
...@@ -216,7 +272,9 @@ l2sim-proxy 6.97% 290.4MiB / 62.54GiB 0.45% ...@@ -216,7 +272,9 @@ l2sim-proxy 6.97% 290.4MiB / 62.54GiB 0.45%
But the CPU speed matters; I am running on a fast server: But the CPU speed matters; I am running on a fast server:
```bash ```bash
$ lscpu lscpu
```
```bash
Architecture: x86_64 Architecture: x86_64
CPU(s): 16 CPU(s): 16
... ...
...@@ -239,7 +297,9 @@ We will work on this issue. ...@@ -239,7 +297,9 @@ We will work on this issue.
Making sure the OAI UE is connected: Making sure the OAI UE is connected:
```bash ```bash
$ docker exec -it l2sim-oai-nr-ue /bin/bash docker exec -it l2sim-oai-nr-ue0 /bin/bash
```
```bash
root@bb4d400a832d:/opt/oai-nr-ue# ifconfig root@bb4d400a832d:/opt/oai-nr-ue# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.71.137 netmask 255.255.255.192 broadcast 192.168.71.191 inet 192.168.71.137 netmask 255.255.255.192 broadcast 192.168.71.191
...@@ -266,14 +326,19 @@ oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500 ...@@ -266,14 +326,19 @@ oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
``` ```
# 3. Check traffic # # 4. Check traffic #
## 3.1. Check your Internet connectivity ## ## 4.1. Check your Internet connectivity ##
You can also check with the `ext-dn` container (IP address is `192.168.72.135` in docker-compose) You can also check with the `ext-dn` container (IP address is `192.168.72.135` in docker-compose)
```bash ```bash
$ docker exec -it l2sim-oai-nr-ue /bin/bash docker exec -it l2sim-oai-nr-ue0 /bin/bash
```
```bash
ping -I oaitun_ue1 -c 20 192.168.72.135
```
```bash
root@bb4d400a832d# ping -I oaitun_ue1 -c 20 192.168.72.135 root@bb4d400a832d# ping -I oaitun_ue1 -c 20 192.168.72.135
PING 192.168.72.135 (192.168.72.135) from 12.1.1.2 oaitun_ue1: 56(84) bytes of data. PING 192.168.72.135 (192.168.72.135) from 12.1.1.2 oaitun_ue1: 56(84) bytes of data.
64 bytes from 192.168.72.135: icmp_seq=1 ttl=63 time=65.1 ms 64 bytes from 192.168.72.135: icmp_seq=1 ttl=63 time=65.1 ms
...@@ -287,10 +352,12 @@ PING 192.168.72.135 (192.168.72.135) from 12.1.1.2 oaitun_ue1: 56(84) bytes of d ...@@ -287,10 +352,12 @@ PING 192.168.72.135 (192.168.72.135) from 12.1.1.2 oaitun_ue1: 56(84) bytes of d
rtt min/avg/max/mdev = 16.413/120.639/209.673/57.159 ms rtt min/avg/max/mdev = 16.413/120.639/209.673/57.159 ms
``` ```
# 4. Un-deployment # # 5. Un-deployment #
```bash ```bash
$ docker-compose down docker-compose down
```
```bash
Stopping l2sim-oai-nr-ue2 ... done Stopping l2sim-oai-nr-ue2 ... done
Stopping l2sim-oai-nr-ue ... done Stopping l2sim-oai-nr-ue ... done
Stopping l2sim-oai-gnb ... done Stopping l2sim-oai-gnb ... done
...@@ -313,68 +380,3 @@ Removing network l2sim-oai-public-net ...@@ -313,68 +380,3 @@ Removing network l2sim-oai-public-net
Removing network l2sim-oai-traffic-net Removing network l2sim-oai-traffic-net
``` ```
# 5. Adapt the `docker-compose` to your environment #
In the `SMF` section, provide your own DNS IP address:
```yaml
DEFAULT_DNS_IPV4_ADDRESS=172.21.3.100
```
gNB section:
All the parameter values will be taken from the mounted config file
```yaml
oai-gnb:
[...]
volumes:
- ../../conf_files/gnb.sa.band78.106prb.l2sim.conf:/opt/oai-gnb/etc/gnb.conf
```
with the configuration file having something like:
```libconfig
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.128";
GNB_INTERFACE_NAME_FOR_NGU = "eno1";
GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.128";
GNB_PORT_FOR_NGU = 2152; # Spec 2152
};
```
For the UE, all the parameter values will be taken from the mounted config
file. Example:
```yaml
oai-nr-ue0:
[...]
volumes:
- ../../conf_files/nrue.band78.106prb.l2sim.conf:/opt/oai-nr-ue/etc/nr-ue.conf
- ../../../openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results:/opt/oai-nr-ue/openair1/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results
```
where the UE configuration (mounted to `/opt/oai-nr-ue/etc/nr-ue.conf`) reads
```libconfig
MACRLCs = (
{
num_cc = 1;
tr_n_preference = "nfapi";
local_n_if_name = "eno1";
remote_n_address = "127.0.0.1"; //Proxy IP
local_n_address = "127.0.0.1";
...
```
This tutorial is a first draft. This nFAPI feature and the proxy are still under development.
At time of writing, we were able to run in `host-mode`, 1 `NR-UE` and just ping traffic.
Later development will include:
- deploying `gNB-VNF`, `proxy` and `UE` in isolated containers (with their own IP address)
- more UEs
- more traffic (`UDP` and `TCP`)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment