Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • yassir63/oai-cn5g-fed
  • oai_test/oai-cn5g-fed
  • rupadhya/oai-cn5g-fed
  • limx1980/oai-cn5g-fed
  • tanish/oai-cn5g-fed
  • batuhanduyuler/oai-cn5g-fed
  • turletti/oai-cn5g-fed
  • niboucha/oai-cn5g-fed
  • white/oai-cn5g-fed
  • oai/cn5g/oai-cn5g-fed
10 results
Show changes
Commits on Source (9)
Showing
with 347 additions and 82 deletions
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface 5G Traffic Generator
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as trf-gen-cn5g
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
net-tools \
tshark \
tzdata \
iperf \
iproute2 \
iputils-ping \
traceroute \
tcpdump \
iperf3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
CMD ["sleep", "infinity"]
......@@ -50,6 +50,7 @@ def upfVppTag = params.upfVppTag
def upfVppBranch = params.upfVppTag
// means to shorten the pipeline
def run_mini_gnbsim = true
def run_static_ue_ip = true
def run_vpp_upf = true
def run_slicing_w_nssf = true
......@@ -88,6 +89,7 @@ pipeline {
if (params.NRF_TAG != null) {
nrfTag = params.NRF_TAG
echo "Upstream Job passed NRF_TAG to use: ${nrfTag}"
run_mini_gnbsim = true
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -99,6 +101,7 @@ pipeline {
if (params.AMF_TAG != null) {
amfTag = params.AMF_TAG
echo "Upstream Job passed AMF_TAG to use: ${amfTag}"
run_mini_gnbsim = true
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -110,6 +113,7 @@ pipeline {
if (params.SMF_TAG != null) {
smfTag = params.SMF_TAG
echo "Upstream Job passed SMF_TAG to use: ${smfTag}"
run_mini_gnbsim = true
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -121,6 +125,7 @@ pipeline {
if (params.SPGWU_TAG != null) {
spgwuTag = params.SPGWU_TAG
echo "Upstream Job passed SPGWU_TAG to use: ${spgwuTag}"
run_mini_gnbsim = true
run_static_ue_ip = true
run_vpp_upf = false
run_slicing_w_nssf = true
......@@ -132,6 +137,7 @@ pipeline {
if (params.AUSF_TAG != null) {
ausfTag = params.AUSF_TAG
echo "Upstream Job passed AUSF_TAG to use: ${ausfTag}"
run_mini_gnbsim = false
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -143,6 +149,7 @@ pipeline {
if (params.UDM_TAG != null) {
udmTag = params.UDM_TAG
echo "Upstream Job passed UDM_TAG to use: ${udmTag}"
run_mini_gnbsim = false
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -154,6 +161,7 @@ pipeline {
if (params.UDR_TAG != null) {
udrTag = params.UDR_TAG
echo "Upstream Job passed UDR_TAG to use: ${udrTag}"
run_mini_gnbsim = false
run_static_ue_ip = true
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -165,6 +173,7 @@ pipeline {
if (params.NSSF_TAG != null) {
nssfTag = params.NSSF_TAG
echo "Upstream Job passed NSSF_TAG to use: ${nssfTag}"
run_mini_gnbsim = false
run_static_ue_ip = false
run_vpp_upf = false
run_slicing_w_nssf = true
......@@ -176,6 +185,7 @@ pipeline {
if (params.UPF_VPP_TAG != null) {
upfVppTag = params.UPF_VPP_TAG
echo "Upstream Job passed UPF_VPP_TAG to use: ${upfVppTag}"
run_mini_gnbsim = false
run_static_ue_ip = false
run_vpp_upf = true
run_slicing_w_nssf = true
......@@ -261,6 +271,29 @@ pipeline {
}
}
}
stage ('Check Minimalist Deployment Tutorial') {
when { expression {run_mini_gnbsim} }
steps {
script {
updateDockerCompose('docker-compose/docker-compose-mini-nrf.yaml', amfTag, nrfTag, smfTag, spgwuTag, ausfTag, udmTag, udrTag, nssfTag, upfVppTag)
dir ('ci-scripts') {
// Tee will make the command always pass
// Please use the same log name as the folder used in the tutorial
sh 'python3 ./checkTutorial.py --tutorial DEPLOY_SA5G_WITH_GNBSIM.md | tee ../archives/mini-gnbsim.log'
}
// Checking if FAIL appears
try {
sh 'grep -L FAIL archives/mini-gnbsim.log > /dev/null'
currentBuild.result = 'FAILURE'
echo "Minimalist gnbsim Tutorial FAILED"
} catch (Exception e) {
echo "Minimalist gnbsim Tutorial PASSED"
}
archivesArtifacts('docker-compose/docker-compose-mini-nrf.yaml', 'mini-gnbsim')
cleanUpDockerCompose('docker-compose/docker-compose-mini-nrf.yaml')
}
}
}
stage ('Check Static UE IP Tutorial') {
when { expression {run_static_ue_ip} }
steps {
......
......@@ -40,7 +40,7 @@ class HtmlReport():
self.file = open(cwd + '/test_results_oai_cn5g_tutorials.html', 'w')
self.generateHeader()
tutorials = ['static-ue-ip', 'vpp-upf-gnbsim', 'slicing-with-nssf']
tutorials = ['mini-gnbsim', 'static-ue-ip', 'vpp-upf-gnbsim', 'slicing-with-nssf']
for tutorial in tutorials:
if not os.path.isfile(cwd + '/archives/' + tutorial + '.log'):
continue
......
......@@ -272,12 +272,10 @@ services:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
depends_on:
- oai-spgwu
......
......@@ -250,6 +250,7 @@ services:
- DNN_RANGE1=12.1.1.2 - 12.1.1.128
- DNN_RANGE0=12.2.1.2 - 12.2.1.128
- DNN_NI1=default
- UE_MTU=1500
depends_on:
- oai-nrf
- oai-amf
......@@ -313,11 +314,10 @@ services:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
depends_on:
- oai-spgwu
......
......@@ -267,11 +267,10 @@ services:
public_net_core:
ipv4_address: 192.168.73.134
oai-ext-dn:
image: ubuntu:bionic
image: image: trf-gen-cn5g:latest
privileged: true
container_name: "oai-ext-dn"
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.2.1.0/24 via 192.168.73.202 dev eth0; sleep infinity"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
......
......@@ -307,11 +307,10 @@ services:
public_net_core:
ipv4_address: 192.168.73.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: "oai-ext-dn"
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.73.202 dev eth0; sleep infinity"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
......
......@@ -35,7 +35,7 @@ services:
public_net_access:
ipv4_address: 192.168.72.141
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......
......@@ -30,7 +30,7 @@ services:
public_net:
ipv4_address: 192.168.70.156
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......@@ -64,7 +64,7 @@ services:
public_net:
ipv4_address: 192.168.70.157
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......@@ -98,7 +98,7 @@ services:
public_net:
ipv4_address: 192.168.70.158
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......@@ -132,7 +132,7 @@ services:
public_net:
ipv4_address: 192.168.70.159
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......@@ -166,7 +166,7 @@ services:
public_net:
ipv4_address: 192.168.70.160
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......@@ -198,7 +198,7 @@ services:
networks:
public_net:
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......
......@@ -187,12 +187,10 @@ services:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
depends_on:
- oai-spgwu
......
......@@ -147,6 +147,7 @@ services:
- DNN_RANGE1=12.1.1.2 - 12.1.1.128
- DNN_RANGE0=12.2.1.2 - 12.2.1.128
- DNN_NI1=default
- UE_MTU=1500
depends_on:
- oai-nrf
- oai-amf
......@@ -210,12 +211,10 @@ services:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
depends_on:
- oai-spgwu
......
......@@ -210,12 +210,10 @@ services:
public_net:
ipv4_address: 192.168.70.134
oai-ext-dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.1.1.0/24 via 192.168.70.134 dev eth0; sleep infinity"
depends_on:
- oai-spgwu
......@@ -233,4 +231,4 @@ networks:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
\ No newline at end of file
com.docker.network.bridge.name: "demo-oai"
......@@ -536,11 +536,10 @@ services:
public_net_core:
ipv4_address: 192.168.73.144
oai_ext_dn:
image: ubuntu:bionic
image: trf-gen-cn5g:latest
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"apt update; apt install -y iptables iproute2 iperf3 iputils-ping;"\
"iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE;"\
"ip route add 12.2.1.2/32 via 192.168.70.142 dev eth0;"\
"ip route add 12.1.1.129/32 via 192.168.70.143 dev eth0;"\
......
......@@ -148,7 +148,7 @@ services:
public_net_access:
ipv4_address: 192.168.72.156
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
test: /bin/bash -c "ip address show dev gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
......
......@@ -440,6 +440,15 @@ $ sudo podman build --target oai-nssf --tag oai-nssf:latest \
The above command is with podman, in case of docker it can be changed with its docker equivalent.
# 12. Build Traffic-Generator Image #
This is just an utility image.
```bash
$ docker build --target trf-gen-cn5g --tag trf-gen-cn5g:latest \
--file ci-scripts/Dockerfile.traffic.generator.ubuntu18.04 \
.
```
You are ready to [Configure the Containers](./CONFIGURE_CONTAINERS.md) or deploying the images using [helm-charts](./DEPLOY_SA5G_HC.md)
......
......@@ -27,5 +27,6 @@ Welcome to the tutorial home page of OAI 5g Core project. Here you can find lot
- [Using Docker-Compose, perform a `basic` deployment and test with `OAI RF simulator`](https://gitlab.eurecom.fr/oai/openairinterface5g/-/tree/develop/ci-scripts/yaml_files/5g_rfsimulator)
- [Using Docker-Compose, perform a `basic` deployment and test with `UERANSIM`](./DEPLOY_SA5G_WITH_UERANSIM.md)
- [Using Docker-Compose, perform a `basic` deployment and test with `Network Slicing`](./DEPLOY_SA5G_SLICING.md)
- [Using Docker-Compose, when testing with Commercial UE, troubleshoot traffic issues](./TROUBLESHOOT_COTS_UE_TRAFFIC.md)
- The Developer Corner
- [How to Deploy Developers Core Network and Basic Debugging](./DEBUG_5G_CORE.md)
......@@ -24,15 +24,16 @@ Note: In case readers are interested in deploying debuggers/developers core netw
**TABLE OF CONTENTS**
1. Pre-requisites
1. [Pre-requisites](#1-pre-requisites)
2. Building Container Images
3. Configuring Host Machines
4. Configuring OAI 5G Core Network Functions
5. Deploying OAI 5G Core Network
5. [Deploying OAI 5G Core Network](#5-deploying-oai-5g-core-network)
6. [Getting a `gnbsim` docker image](#6-getting-a-gnbsim-docker-image)
7. [Executing `gnbsim` Scenario](#7-executing-the-gnbsim-scenario)
8. [Analysing Scenario Results](#8-analysing-the-scenario-results)
8. [Analysing the Scenario Results](#8-analysing-the-scenario-results)
9. [Trying some advanced stuff](#9-trying-some-advanced-stuff)
10. [Undeploy the network functions](#10-undeploy-the-network-functions)
* In this demo the image tags and commits which were used are listed below, follow the [Building images](./BUILD_IMAGES.md) to build images with below tags.
......@@ -49,26 +50,56 @@ This tutorial is an extension of a previous tutorial: [testing a `minimalist` de
Moreover, there are various other opensource gnb/ue simulator tools that are available for SA5G test. In this tutorial, we use an opensource simulator tool called `gnbsim`. With the help of `gnbsim` tool, we can perform very basic SA5G test by simulating one gnb and one ue.
##### About gnbsim -
**About gnbsim:**
Gnbsim is a 5G SA gNB/UE (Rel. 16) simulator for testing 5G System. It is a 3rd party opensource tool written in golang. The [original repository](https://github.com/hhorai/gnbsim) is not available anymore, but a number of forks can be found, e.g., [here](https://github.com/AlohaLuo/gnbsim-backup), [here](https://github.com/Prabhjot-Sethi/gnbsim), and in [this repo](https://gitlab.eurecom.fr/kharade/gnbsim) which we will use in the following. Gnbsim simulates NGAP, NAS and GTPU protocols. Current version of gnbsim simulates one gnb and one ue.
Let's begin !!
* Steps 1 to 5 are similar as previous tutorial. Please follow these steps to deploy OAI 5G core network components.
* We depoloy gnbsim docker service on same host as of core network, so there is no need to create additional route as
* We deploy gnbsim docker service on same host as of core network, so there is no need to create additional route as
we did for dsTest-host.
* Before we proceed further for end-to-end SA5G test, make sure you have healthy docker services for OAI cn5g
```bash
oai-cn5g-fed/docker-compose$ python3 core-network.py --type start-mini --fqdn no --scenario 1
## 1. Pre-requisites
Create the folder to store the logs.
<!---
For CI purposes please ignore this line
``` shell
docker-compose-host $: rm -rf /tmp/oai/mini-gnbsim
```
-->
``` shell
docker-compose-host $: mkdir -p /tmp/oai/mini-gnbsim
docker-compose-host $: chmod 777 /tmp/oai/mini-gnbsim
```
**CAUTION: all the commands are to be executed from the `docker-compose` folder on the `CN5G host` server.**
## 5. Deploying OAI 5G Core Network
As a first timer, we recommend to first run without any PCAP capture.
``` console
docker-compose-host $: python3 ./core-network.py --type start-mini --fqdn no --scenario 1
...
[2021-09-14 16:44:47,176] root:DEBUG: OAI 5G Core network is configured and healthy....
```
For CI purposes, we are deploying with an automated PCAP capture on the docker network.
**REMEMBER: if you are planning to run your CN5G deployment for a long time, the PCAP file can become huge!**
``` shell
docker-compose-host $: python3 ./core-network.py --type start-mini --fqdn no --scenario 1 --capture /tmp/oai/mini-gnbsim/mini-gnbsim.pcap
```
More details in [section 7 of the `minimalist` tutorial](./DEPLOY_SA5G_MINI_DS_TESTER_DEPLOYMENT.md#7-deploying-oai-5g-core-network).
```bash
``` console
oai-cn5g-fed/docker-compose$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 23 seconds ago Up 22 seconds oai-ext-dn
......@@ -82,16 +113,19 @@ oai-cn5g-fed/docker-compose$
We can also use basic deployment of 5GCN (with AUSF, UDM, UDR) as below -
```bash
oai-cn5g-fed/docker-compose$ python3 core-network.py --type start-basic
``` console
docker-compose-host $: python3 ./core-network.py --type start-basic
```
## 6. Getting a `gnbsim` docker image ##
## 6. Getting a `gnbsim` docker image
You have the choice:
* Build `gnbsim` docker image
* Building `gnbsim` docker image
Please clone the repository outside of the `oai-cn5g-fed` workspace.
```bash
``` console
$ cd
$ git clone https://gitlab.eurecom.fr/kharade/gnbsim.git
$ cd gnbsim
$ docker build --tag gnbsim:latest --target gnbsim --file docker/Dockerfile.ubuntu.18.04 .
......@@ -101,23 +135,30 @@ OR
* You can pull a prebuilt docker image for `gnbsim`
```bash
``` console
docker pull rohankharade/gnbsim
docker image tag rohankharade/gnbsim:latest gnbsim:latest
```
## 7. Executing the `gnbsim` Scenario ##
## 7. Executing the `gnbsim` Scenario
* The configuration parameters are preconfigured in [docker-compose-gnbsim.yaml](../docker-compose/docker-compose-gnbsim.yaml) and one can modify it for test.
* The configuration parameters, are preconfigured in [docker-compose.yaml](../docker-compose/docker-compose.yaml) and [docker-compose-gnbsim.yaml](../docker-compose/docker-compose-gnbsim.yaml) and one can modify it for test.
* Launch gnbsim docker service
```bash
oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim
### 7.1. Launch gnbsim docker service
``` shell
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim
Creating gnbsim ... done
docker-compose-host $: sleep 40
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml ps -a
Name Command State Ports
--------------------------------------------------------------
gnbsim /gnbsim/bin/entrypoint.sh ... Up (healthy)
```
* After launching gnbsim, make sure all services status are healthy -
```bash
oai-cn5g-fed/docker-compose$ docker ps -a
After launching gnbsim, make sure all services status are healthy -
``` console
docker-compose-host $: docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ad428f94fb0 gnbsim:latest "/gnbsim/bin/entrypo…" 33 seconds ago Up 32 seconds (healthy) gnbsim
c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 4 minutes ago Up 4 minutes oai-ext-dn
......@@ -128,11 +169,19 @@ c25db05aa023 ubuntu:bionic "/bin/bash -c ' apt …" 4 minu
565617169b42 mysql:5.7 "docker-entrypoint.s…" 4 minutes ago Up 4 minutes (healthy) 3306/tcp, 33060/tcp mysql
```
Now we are ready to perform some traffic test.
* Ping test <br/>
You can see also if the UE got an allocated IP address.
``` shell
docker-compose-host $: docker logs gnbsim 2>&1 | grep "UE address:"
[gnbsim]2022/09/14 16:45:40.584271 example.go:329: UE address: 12.1.1.2
```
### 7.2. Ping test
Here we ping UE from external DN container.
```bash
$ docker exec -it oai-ext-dn ping -c 3 12.1.1.2
``` shell
docker-compose-host $: docker exec oai-ext-dn ping -c 3 12.1.1.2
PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data.
64 bytes from 12.1.1.2: icmp_seq=1 ttl=64 time=0.235 ms
64 bytes from 12.1.1.2: icmp_seq=2 ttl=64 time=0.145 ms
......@@ -141,12 +190,11 @@ PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data.
--- 12.1.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2036ms
rtt min/avg/max/mdev = 0.145/0.276/0.448/0.127 ms
rohan@rohan:~/gitrepo/oai-cn5g-fed/docker-compose$
```
Here we ping external DN from UE (gnbsim) container.
```bash
oai-cn5g-fed/docker-compose$ docker exec gnbsim ping -c 3 -I 12.1.1.2 google.com
``` shell
docker-compose-host $: docker exec gnbsim ping -c 3 -I 12.1.1.2 google.com
PING google.com (172.217.18.238) from 12.1.1.2 : 56(84) bytes of data.
64 bytes from par10s10-in-f238.1e100.net (172.217.18.238): icmp_seq=1 ttl=115 time=5.12 ms
64 bytes from par10s10-in-f238.1e100.net (172.217.18.238): icmp_seq=2 ttl=115 time=7.52 ms
......@@ -157,10 +205,11 @@ PING google.com (172.217.18.238) from 12.1.1.2 : 56(84) bytes of data.
rtt min/avg/max/mdev = 5.119/6.606/7.515/1.064 ms
```
* Iperf test <br/>
### 7.3. Iperf test
Here we do iperf traffic test between gnbsim UE and external DN node. We can make any node as iperf server/client.<br/>
Running iperf server on external DN container
```bash
``` console
$ docker exec -it oai-ext-dn iperf3 -s
-----------------------------------------------------------
Server listening on 5201
......@@ -188,7 +237,7 @@ Server listening on 5201
-----------------------------------------------------------
```
Running iperf client on gnbsim
```bash
``` console
$ docker exec -it gnbsim iperf3 -c 192.168.70.135 -B 12.1.1.2
Connecting to host 192.168.70.135, port 5201
[ 5] local 12.1.1.2 port 55553 connected to 192.168.70.135 port 5201
......@@ -210,9 +259,20 @@ Connecting to host 192.168.70.135, port 5201
iperf Done.
```
* Note:- The iperf test is just for illustration purpose and results of the test may vary based on resources available for the docker services
## 8. Analysing the Scenario Results ##
**Note:- The iperf test is just for illustration purpose and results of the test may vary based on resources available for the docker services.**
## 8. Analysing the Scenario Results
You can recover the logs like this:
``` console
docker-compose-host $: docker logs oai-nrf > /tmp/oai/mini-gnbsim/nrf.log 2>&1
docker-compose-host $: docker logs oai-amf > /tmp/oai/mini-gnbsim/amf.log 2>&1
docker-compose-host $: docker logs oai-smf > /tmp/oai/mini-gnbsim/smf.log 2>&1
docker-compose-host $: docker logs oai-spgwu > /tmp/oai/mini-gnbsim/spgwu.log 2>&1
docker-compose-host $: docker logs gnbsim > /tmp/oai/mini-gnbsim/gnbsim.log 2>&1
```
| Container | Ip-address |
| ------------- |:-------------- |
......@@ -235,22 +295,32 @@ iperf Done.
* For detailed analysis of messages, please refer previous tutorial of [testing with dsTester](./docs/DEPLOY_SA5G_WITH_DS_TESTER.md).
## 9. Trying Some Advanced Stuff ##
## 9. Trying Some Advanced Stuff
Here we try some scaling test with gnbsim. There are additional IMSIs are added into database (208950000000031-208950000000040). Now we create few more gnbsim instances (4 more for now). We use same script to generate additional instance as follow -
```bash
oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim2
``` shell
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim2
Creating gnbsim2 ... done
oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim3
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim3
Creating gnbsim3 ... done
oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim4
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim4
Creating gnbsim4 ... done
oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim5
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim5
Creating gnbsim5 ... done
docker-compose-host $: sleep 40
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml ps -a
docker-compose-host $: docker logs gnbsim2 2>&1 | grep "UE address:"
[gnbsim]2022/09/14 16:45:41.584271 example.go:329: UE address: 12.1.1.3
docker-compose-host $: docker logs gnbsim3 2>&1 | grep "UE address:"
[gnbsim]2022/09/14 16:45:42.584271 example.go:329: UE address: 12.1.1.4
docker-compose-host $: docker logs gnbsim4 2>&1 | grep "UE address:"
[gnbsim]2022/09/14 16:45:43.584271 example.go:329: UE address: 12.1.1.5
docker-compose-host $: docker logs gnbsim5 2>&1 | grep "UE address:"
[gnbsim]2022/09/14 16:45:44.584271 example.go:329: UE address: 12.1.1.6
```
So here basically, minimum configuration parameters that need to change is gnbid, imsi and container ip address in docker-compose-gnbsim.yaml.
Please make sure status of instance is healthy before creating one more instance. Now here we have deployed all 5 gnbsim intances -
```bash
``` console
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a25174c51297 gnbsim:latest "/gnbsim/bin/entrypo…" 3 minutes ago Up 3 minutes (healthy) gnbsim5
......@@ -267,7 +337,7 @@ cc407925adf2 oai-nrf:latest "/bin/bash /openair-…" 16 min
```
* Let's verify all gnb and ue are registered at our 5G core -
```bash
``` console
$ docker logs oai-amf
truncated output
[2021-05-17T12:17:28.539943] [AMF] [amf_app] [info ]
......@@ -294,8 +364,8 @@ truncated output
```
* Finally lets ping UE from external DN node -
```bash
$ docker exec -it oai-ext-dn ping -c 2 12.1.1.2
``` shell
docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.2
PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data.
64 bytes from 12.1.1.2: icmp_seq=1 ttl=64 time=0.416 ms
64 bytes from 12.1.1.2: icmp_seq=2 ttl=64 time=0.763 ms
......@@ -303,7 +373,7 @@ PING 12.1.1.2 (12.1.1.2) 56(84) bytes of data.
--- 12.1.1.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1008ms
rtt min/avg/max/mdev = 0.416/0.589/0.763/0.175 ms
$ docker exec -it oai-ext-dn ping -c 2 12.1.1.3
docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.3
PING 12.1.1.3 (12.1.1.3) 56(84) bytes of data.
64 bytes from 12.1.1.3: icmp_seq=1 ttl=64 time=0.328 ms
64 bytes from 12.1.1.3: icmp_seq=2 ttl=64 time=0.620 ms
......@@ -311,7 +381,7 @@ PING 12.1.1.3 (12.1.1.3) 56(84) bytes of data.
--- 12.1.1.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1005ms
rtt min/avg/max/mdev = 0.328/0.474/0.620/0.146 ms
$ docker exec -it oai-ext-dn ping -c 2 12.1.1.4
docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.4
PING 12.1.1.4 (12.1.1.4) 56(84) bytes of data.
64 bytes from 12.1.1.4: icmp_seq=1 ttl=64 time=0.408 ms
64 bytes from 12.1.1.4: icmp_seq=2 ttl=64 time=0.694 ms
......@@ -319,7 +389,7 @@ PING 12.1.1.4 (12.1.1.4) 56(84) bytes of data.
--- 12.1.1.4 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1032ms
rtt min/avg/max/mdev = 0.408/0.551/0.694/0.143 ms
$ docker exec -it oai-ext-dn ping -c 2 12.1.1.5
docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.5
PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data.
64 bytes from 12.1.1.5: icmp_seq=1 ttl=64 time=0.289 ms
64 bytes from 12.1.1.5: icmp_seq=2 ttl=64 time=0.233 ms
......@@ -327,13 +397,37 @@ PING 12.1.1.5 (12.1.1.5) 56(84) bytes of data.
--- 12.1.1.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1004ms
rtt min/avg/max/mdev = 0.233/0.261/0.289/0.028 ms
docker-compose-host $: docker exec oai-ext-dn ping -c 2 12.1.1.6
PING 12.1.1.6 (12.1.1.6) 56(84) bytes of data.
64 bytes from 12.1.1.6: icmp_seq=1 ttl=63 time=0.577 ms
64 bytes from 12.1.1.6: icmp_seq=2 ttl=63 time=0.346 ms
--- 12.1.1.6 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1015ms
rtt min/avg/max/mdev = 0.346/0.461/0.577/0.117 ms
```
Let recover one last time the logs:
``` shell
docker-compose-host $: docker logs oai-nrf > /tmp/oai/mini-gnbsim/nrf.log 2>&1
docker-compose-host $: docker logs oai-amf > /tmp/oai/mini-gnbsim/amf.log 2>&1
docker-compose-host $: docker logs oai-smf > /tmp/oai/mini-gnbsim/smf.log 2>&1
docker-compose-host $: docker logs oai-spgwu > /tmp/oai/mini-gnbsim/spgwu.log 2>&1
docker-compose-host $: docker logs gnbsim > /tmp/oai/mini-gnbsim/gnbsim.log 2>&1
docker-compose-host $: docker logs gnbsim2 > /tmp/oai/mini-gnbsim/gnbsim2.log 2>&1
docker-compose-host $: docker logs gnbsim3 > /tmp/oai/mini-gnbsim/gnbsim3.log 2>&1
docker-compose-host $: docker logs gnbsim4 > /tmp/oai/mini-gnbsim/gnbsim4.log 2>&1
docker-compose-host $: docker logs gnbsim5 > /tmp/oai/mini-gnbsim/gnbsim5.log 2>&1
```
## 10. Undeploy the network functions
Last thing is to remove all services - <br/>
* Undeploy the gnbsim
```bash
/oai-cn5g-fed/docker-compose$ docker-compose -f docker-compose-gnbsim.yaml down
### 10.1. Undeploy the gnbsim container(s)
``` shell
docker-compose-host $: docker-compose -f docker-compose-gnbsim.yaml down
Stopping service gnbsim ...
Stopping gnbsim5 ... done
Stopping gnbsim4 ... done
......@@ -349,10 +443,12 @@ Network demo-oai-public-net is external, skipping
Service gnbsim is stopped
```
* Undeploy the core network
```bash
oai-cn5g-fed/docker-compose$ python3 ./core-network.py --type stop-mini --fqdn no --scenario 1
### 10.2. Undeploy the core network
``` shell
docker-compose-host $: python3 ./core-network.py --type stop-mini --fqdn no --scenario 1
...
[2021-09-14 16:47:44,070] root:DEBUG: OAI 5G core components are UnDeployed....
```
## 11. End of tutorial
......@@ -49,6 +49,8 @@ $ docker pull rdefosseoai/oai-udm:latest
$ docker pull rdefosseoai/oai-ausf:latest
$ docker pull rdefosseoai/oai-upf-vpp:latest
$ docker pull rdefosseoai/oai-nssf:latest
# Utility image to generate traffic
$ docker pull rdefosseoai/trf-gen-cn5g:latest
```
And **re-tag** them for tutorials' docker-compose file to work.
......@@ -63,6 +65,7 @@ $ docker image tag rdefosseoai/oai-udm:latest oai-udm:latest
$ docker image tag rdefosseoai/oai-ausf:latest oai-ausf:latest
$ docker image tag rdefosseoai/oai-upf-vpp:latest oai-upf-vpp:latest
$ docker image tag rdefosseoai/oai-nssf:latest oai-nssf:latest
$ docker image tag rdefosseoai/trf-gen-cn5g:latest trf-gen-cn5g:latest
```
Finally you may logoff --> your token is stored in plain text..
......
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">OpenAirInterface 5G Core Network : testing with Commercial UE traffic troubleshooting</font></b>
</td>
</tr>
</table>
`COTS-UE` means `Commercial Off-The-Shelf UE`.
Prior to `2022.w12` tag, if you were deploying a `minimalist` or `basic` OAI 5G CN, you see the following issue:
* Ping operations from `ext-dn` to `COTS-UE` or from `COTS-UE` to `ext-dn` were OK
* `TCP` iperf traffic test was OK in `Downlink` and `Uplink`
* `UDP` iperf traffic test was OK in `Uplink` (ie from `COTS-UE` to `ext-dn`)
* But `UDP` `Downlink` iperf traffic test was not working.
The issue is the `MTU` value affected to the interface on the UE.
For example, we are using Quectel modules and it looked like this:
```bash
$ ifconfig wwan0
wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1356
inet 12.1.1.129 netmask 255.255.255.0 broadcast 12.1.1.255
```
2 solutions:
* Either you force the `MTU` value (if possible):
```bash
$ sudo ip link set dev wwan0 mtu 1500
```
* The better one is to tell the `SMF` to use this `1500` value.
I made 2 examples in the `docker-compose/docker-compose-basic-nrf.yaml` and `docker-compose/docker-compose-mini-nrf.yaml` files:
```bash
$ git diff docker-compose/docker-compose-basic-nrf.yaml
diff --git a/docker-compose/docker-compose-basic-nrf.yaml b/docker-compose/docker-compose-basic-nrf.yaml
index 04aceae..fef0835 100644
--- a/docker-compose/docker-compose-basic-nrf.yaml
+++ b/docker-compose/docker-compose-basic-nrf.yaml
@@ -250,6 +250,7 @@ services:
- DNN_RANGE1=12.1.1.2 - 12.1.1.128
- DNN_RANGE0=12.2.1.2 - 12.2.1.128
- DNN_NI1=default
+ - UE_MTU=1500
depends_on:
- oai-nrf
- oai-amf
$ git diff docker-compose/docker-compose-mini-nrf.yaml
diff --git a/docker-compose/docker-compose-mini-nrf.yaml b/docker-compose/docker-compose-mini-nrf.yaml
index cd58557..35b3d3b 100644
--- a/docker-compose/docker-compose-mini-nrf.yaml
+++ b/docker-compose/docker-compose-mini-nrf.yaml
@@ -147,6 +147,7 @@ services:
- DNN_RANGE1=12.1.1.2 - 12.1.1.128
- DNN_RANGE0=12.2.1.2 - 12.2.1.128
- DNN_NI1=default
+ - UE_MTU=1500
depends_on:
- oai-nrf
- oai-amf
```
With this `SMF` setup:
```bash
$ ifconfig wwan0
wwan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 12.1.1.129 netmask 255.255.255.0 broadcast 12.1.1.255
```