Commit 8b2a34dc authored by arora's avatar arora 🎤
Browse files

updated docker-compose and tutorial

parent 76f2e547
......@@ -22,13 +22,7 @@ services:
ipv4_address: 192.168.70.131
oai-amf:
container_name: "oai-amf"
image: oai-amf:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/amf.pcap 2>&1 > /dev/null &
/openair-amf/bin/oai_amf -c /openair-amf/etc/amf.conf -o | tee /tmp/amf.log 2>&1
"
cap_add:
- NET_ADMIN
image: oai-amf:v1.1.0
environment:
- TZ=Europe/paris
- INSTANCE=0
......@@ -93,13 +87,7 @@ services:
ipv4_address: 192.168.70.132
oai-smf:
container_name: "oai-smf"
image: oai-smf:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/smf.pcap 2>&1 > /dev/null &
/openair-smf/bin/oai_smf -c /openair-smf/etc/smf.conf -o | tee /tmp/smf.log 2>&1
"
cap_add:
- NET_ADMIN
image: oai-smf:v1.1.0
environment:
- TZ=Europe/Paris
- INSTANCE=0
......@@ -110,7 +98,7 @@ services:
- SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
- SMF_API_VERSION=v1
- DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
- DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
- DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129
- AMF_IPV4_ADDRESS=192.168.70.132
- AMF_PORT=80
- AMF_API_VERSION=v1
......@@ -142,11 +130,7 @@ services:
ipv4_address: 192.168.70.133
oai-spgwu:
container_name: "oai-spgwu"
image: oai-spgwu-tiny:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/spgwu.pcap 2>&1 > /dev/null &
/openair-spgwu-tiny/bin/oai_spgwu -c /openair-spgwu-tiny/etc/spgw_u.conf -o | tee /tmp/spgwu.log 2>&1
"
image: oai-spgwu-tiny:v1.1.0
environment:
- TZ=Europe/Paris
- PID_DIRECTORY=/var/run
......@@ -200,7 +184,6 @@ services:
"apt update; apt install -y iptables iproute2 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"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
depends_on:
- oai-spgwu
networks:
......@@ -209,12 +192,12 @@ services:
networks:
public_net:
external:
name: demo-oai-public-net
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
name: demo-oai
# public_net:
# driver: bridge
# name: demo-oai
# ipam:
# config:
# - subnet: 192.168.70.128/26
# driver_opts:
# com.docker.network.bridge.name: "demo-oai"
......@@ -2,13 +2,7 @@ version: '3.8'
services:
oai-nrf:
container_name: "oai-nrf"
image: oai-nrf:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/nrf.pcap 2>&1 > /dev/null &
/openair-nrf/bin/oai_nrf -c /openair-nrf/etc/nrf.conf -o | tee /tmp/nrf.log 2>&1
"
cap_add:
- NET_ADMIN
image: oai-nrf:v1.1.0
environment:
- NRF_INTERFACE_NAME_FOR_SBI=eth0
- NRF_INTERFACE_PORT_FOR_SBI=80
......@@ -48,13 +42,7 @@ services:
ipv4_address: 192.168.70.131
oai-amf:
container_name: "oai-amf"
image: oai-amf:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/amf.pcap 2>&1 > /dev/null &
/openair-amf/bin/oai_amf -c /openair-amf/etc/amf.conf -o | tee /tmp/amf.log 2>&1
"
cap_add:
- NET_ADMIN
image: oai-amf:v1.1.0
environment:
- TZ=Europe/paris
- INSTANCE=0
......@@ -97,7 +85,7 @@ services:
- OPERATOR_KEY=63bfa50ee6523365ff14c1f45f88737d
- NRF_IPV4_ADDRESS=192.168.70.130
- NRF_PORT=80
- NF_REGISTRATION=no
- NF_REGISTRATION=yes
- SMF_SELECTION=yes
- USE_FQDN_DNS=yes
- NRF_API_VERSION=v1
......@@ -119,13 +107,7 @@ services:
ipv4_address: 192.168.70.132
oai-smf:
container_name: "oai-smf"
image: oai-smf:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/smf.pcap 2>&1 > /dev/null &
/openair-smf/bin/oai_smf -c /openair-smf/etc/smf.conf -o | tee /tmp/smf.log 2>&1
"
cap_add:
- NET_ADMIN
image: oai-smf:v1.1.0
environment:
- TZ=Europe/Paris
- INSTANCE=0
......@@ -136,7 +118,7 @@ services:
- SMF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
- SMF_API_VERSION=v1
- DEFAULT_DNS_IPV4_ADDRESS=192.168.18.129
- DEFAULT_DNS_SEC_IPV4_ADDRESS=8.8.8.8
- DEFAULT_DNS_SEC_IPV4_ADDRESS=192.168.18.129
- AMF_IPV4_ADDRESS=0.0.0.0
- AMF_PORT=80
- AMF_API_VERSION=v1
......@@ -168,11 +150,7 @@ services:
ipv4_address: 192.168.70.133
oai-spgwu:
container_name: "oai-spgwu"
image: oai-spgwu-tiny:latest
command: >
bash -c "nohup tshark -i eth0 -w /tmp/spgwu.pcap 2>&1 > /dev/null &
/openair-spgwu-tiny/bin/oai_spgwu -c /openair-spgwu-tiny/etc/spgw_u.conf -o | tee /tmp/spgwu.log 2>&1
"
image: oai-spgwu-tiny:v1.1.2
environment:
- TZ=Europe/Paris
- PID_DIRECTORY=/var/run
......@@ -226,7 +204,6 @@ services:
"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"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
depends_on:
- oai-spgwu
networks:
......@@ -236,11 +213,11 @@ networks:
public_net:
external:
name: demo-oai-public-net
public_net:
driver: bridge
name: demo-oai-public-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
# public_net:
# driver: bridge
# name: demo-oai-public-net
# ipam:
# config:
# - subnet: 192.168.70.128/26
# driver_opts:
# com.docker.network.bridge.name: "demo-oai"
......@@ -99,6 +99,43 @@
# 3. Networking #
- The [docker-compose.yaml](../docker-compose/docker-compose.yaml) will create the network automatically.
- The [docker-compose.yaml](../docker-compose/docker-compose.yaml) can create the network automatically, currently in the file automatic network creation is disabled. It can be enabled by uncommenting the lines.
```bash
networks:
public_net:
driver: bridge
name: demo-oai
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
```
- In user wants to create manual network then below is the command
components. To capture initial message exchange between smf<-->nrf<-->upf.
```bash
(docker-compose-host)$ docker network create \
--driver=bridge \
--subnet=192.168.70.128/26 \
-o "com.docker.network.bridge.name"="demo-oai" \
demo-oai-public-net
455631b3749ccd6f10a366cd1c49d5a66cf976d176884252d5d88a1e54049bc5
(docker-compose-host)$ ifconfig demo-oai
demo-oai: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.70.129 netmask 255.255.255.192 broadcast 192.168.70.191
ether 02:42:9c:0a:23:44 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(docker-compose-host)$ docker network ls
NETWORK ID NAME DRIVER SCOPE
d2d34e05bb2d bridge bridge local
455631b3749c demo-oai-public-net bridge local
```
You are ready to check out the tutorial that [how 5g core works](./DEPLOY_SA5G_WITH_DS_TESTER.md).
......@@ -15,6 +15,15 @@
![SA dsTest Demo](./images/docker-compose/5gCN.jpg)
This tutorial will help in understanding how to deploy OAI core network using docker-compose. In this tutorial we have used [dsTest](https://www.developingsolutions.com/products/dstest-5g-core-network-testing/) a commercial paid gNB emulator. Though instead of this readers can also use gNBsim (an opensource gNB emulator), you can follow another tutorial for [this](./DEPLOY_SA5G_WITH_GNBSIM.md). Please follow the tutorial step by step to create a stable testbed.
Reading time: 20mins
Tutorial replication time: 1hr
Note: In case readers are interested in deploying debuggers/developers core network environment with more logs please follow [this tutorial](./DEBUG_5G_CORE.md)
**TABLE OF CONTENTS**
1. [Pre-requisites](#1-pre-requisites)
......@@ -41,7 +50,7 @@ The requried softwares and their respected versions are listed below. To replica
| docker-compose | 1.27.4, build 40524192 |
| Host operating system | Ubuntu 18.04.4 LTS |
| Container operating system | Ubuntu 18.04 |
| dsTest (Licensed) | 5.5 |
| dsTest (Licensed) | 5.6 |
| tshark | 3.4.4 (Git commit c33f6306cbb2) |
| wireshark | 3.4.4 (Git commit c33f6306cbb2) |
......@@ -51,24 +60,61 @@ To know how to configure the machine with the above requirements vist [pre-requi
## 2. Building Container Images ##
- 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.
- In this demo the image tags which were used are listed below, follow the [Building images](./BUILD_IMAGES.md) to build images with below tags.
| CNF Name | Branch Name | Commit at time of writing | Ubuntu 18.04 | RHEL8 |
| ----------- |:----------------------- | ------------------------------------------ | ------------ | ---------------|
| AMF | `develop` | `82ca64fe8d79dbadbb1a495124ee26352f81bd7a` | X | Releasing soon |
| SMF | `develop` | `0dba68d6a01e1dad050f47437647f62d40acaec6` | X | Releasing soon |
| NRF | `develop` | `0e877cb5b80a9c74fa6abca60b95e2d3d22f7a52` | X | Releasing soon |
| SPGW-U-TINY | `gtp_extension_header` | `b628036d2e6060da8ba77c5e4cdde35bf18a62a5` | X | Releasing soon |
| CNF Name | Branch Name | Tag | Ubuntu 18.04 | RHEL8 (UBI8) |
| ----------- | ----------- | -------- | ------------ | ----------------|
| AMF | `master` | `v1.1.0` | X | X |
| SMF | `master` | `v1.1.0` | X | X |
| NRF | `master` | `v1.1.0` | X | X |
| SPGW-U-TINY | `master` | `v1.1.2` | X | X |
## 3. Configuring Host Machines ##
- The `docker-compose-host` machine will be configured with `demo-oai-public-net` bridge automatically using [docker-compose.yaml](../docker-compose/docker-compose.yaml) at the time of deploying core network components. And also for each component it will start capturing `pcap` messages and stores it on the `/tmp/` location of that container. Use the below command as shown as an example.
All the network functions are connected using `demo-oai-net` bridge. There are two ways to create this bridge either manually or automatically using docker-compose. The manual version will allow packet capturing while network functions are getting deployed. So the initial tested setup packets can be captured for debugging purposes or checking if network functions registered properly to nrf. The second option of automatic deployment is good when initial packet capture is not important.
### 3.1 Creating bridge manually
- The `docker-compose-host` machine needs to be configured with `demo-oai-net` bridge before deploying core network components. To capture initial message exchange between smf<-->nrf<-->upf.
```bash
(docker-compose-host)$ docker cp container_name:/tmp/amf.pcap amf.pcap
(docker-compose-host)$ docker network create \
--driver=bridge \
--subnet=192.168.70.128/26 \
-o "com.docker.network.bridge.name"="demo-oai" \
demo-oai-public-net
455631b3749ccd6f10a366cd1c49d5a66cf976d176884252d5d88a1e54049bc5
(docker-compose-host)$ ifconfig demo-oai
demo-oai: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.70.129 netmask 255.255.255.192 broadcast 192.168.70.191
ether 02:42:9c:0a:23:44 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(docker-compose-host)$ docker network ls
NETWORK ID NAME DRIVER SCOPE
d2d34e05bb2d bridge bridge local
455631b3749c demo-oai-public-net bridge local
```
- Optional, if the `docker-compose-host` machine is not configured with packet forwarding then it can be done using below command,
### 3.1 Create bridge automatically
- Though the bridge can be automatically created using docker-compose file if there is no need to capture initial packets. Uncomment the last lines of the [docker-compose.yaml](../docker-compose/docker-compose.yaml) or docker-compose-no-nrf.yaml. Else replace with below section
```
networks:
public_net:
driver: bridge
name: demo-oai-net
ipam:
config:
- subnet: 192.168.70.128/26
driver_opts:
com.docker.network.bridge.name: "demo-oai"
```
- If the `docker-compose-host` machine is not configured with packet forwarding then it can be done using below command,
```bash
(docker-compose-host)$ sudo sysctl net.ipv4.conf.all.forwarding=1
......@@ -82,7 +128,8 @@ To know how to configure the machine with the above requirements vist [pre-requi
192.168.70.128/26 via IP_ADDR_NIC1\
dev NIC1_NAME
```
- To verify ping the ip-address of the `docker-compose-host` interface connected to demo-oai-public-net bridge,
- To verify ping the ip-address of the `docker-compose-host` interface connected to demo-oai bridge, if possible also ping amf from the dsTest-host machine.
```bash
(dsTest-host)$ ping 192.168.70.129
......@@ -110,7 +157,7 @@ To know how to configure the machine with the above requirements vist [pre-requi
| spgw_u.conf | (Github) OPENAIRINTERFACE/openair-spgwu-tiny | [etc/spgw_u.conf](https://github.com/OPENAIRINTERFACE/openair-spgwu-tiny/blob/gtp_extension_header/etc/spgw_u.conf) |
- **User Subscprition Profile**: The dsTest UE which will request for a PDU session will have this user profile. Verify that this entry is present in the oai_db.sql file located in docker-compose/oai-db.sql.
- **User Subscprition Profile**: The dsTest UE which will request for a PDU session will have this user profile. Verify that this entry is present in the oai_db.sql file located in [docker-compose/oai-db.sql](../docker-compose/oai_db.sql).
```
IMSI - 208950000000031
......@@ -260,7 +307,7 @@ To know how to configure the machine with the above requirements vist [pre-requi
Removing oai-nrf ... done
Network demo-oai-public-net is external, skipping
Core network stopped
```
```
## 8. Analysing the Scenario Results ##
......@@ -278,8 +325,6 @@ This section is subdivided in two parts the first part for analysing the message
| dsTest gNB/UE | 192.168.18.184 |
| Pcap/log files |
|:-------------------------------------------------------------------------------------------------------- |
| [5gcn-deployment.pcap](./results/dsTest/pcap/5gcn-deployment.pcap) |
......@@ -339,6 +384,7 @@ Using wireshark open scenario-execution.pcap use the filter ngap || http || pfcp
- This tutorial can be taken as reference to test the OAI 5G core with a COTS UE. The configuration files has to be changed according to the gNB and COTS UE information should be present in the mysql database.
- Generally, in a COTS UE two PDN sessions are created by default so configure the IMS in SMF properly. Currently some parameters can not be configured via [docker-compose.yaml](../docker-compose/docker-compose.yaml). We recommend you directly configure them in the conf file and mount the file in the docker during run time.
- Its not necessary to use [core-network.sh](../docker-compose/core-network.sh) bash script, it is possible to directly deploy using `docker-compose` command
- In case you want to deploy debuggers/developers core network environment with more logs please follow [this tutorial](./DEBUG_5G_CORE.md)
```
#To start the containers
......
......@@ -14,6 +14,11 @@
![SA dsTest Demo](./images/5gCN_gnbsim.jpg)
Reading time: 20mins
Tutorial replication time: 1hr
Note: In case readers are interested in deploying debuggers/developers core network environment with more logs please follow [this tutorial](./DEBUG_5G_CORE.md)
**TABLE OF CONTENTS**
1. Pre-requisites
......
......@@ -14,6 +14,11 @@
![SA dsTest Demo](./images/5gcn_vpp_upf.jpg)
Reading time: 20mins
Tutorial replication time: 1hr
Note: In case readers are interested in deploying debuggers/developers core network environment with more logs please follow [this tutorial](./DEBUG_5G_CORE.md)
**TABLE OF CONTENTS**
1. Pre-requisites
......
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