Adding ueransim test (#4)

* Adding ueransim test

* Delete open5gs-ue.yaml.old

* Added test UERANSIM

* Added UERANSIM test
This commit is contained in:
i-miguez
2021-03-03 13:09:00 +01:00
committed by GitHub
parent 488d547ade
commit 0ba28633c8
13 changed files with 423 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
# Open5gs Container Image
This repository provides a container image to deploy [Open5gs](https://open5gs.org/) services as a containers.
[Open5gs](https://open5gs.org/) is an open source project of 5GC and EPC (Release-16).
This project can be used to configure your own NR/LTE network. If gNB/eNB and USIM are available, you can build a private network using Open5GS.
Open5GS implemented 5GC and EPC using C-language. And WebUI is provided for testing purposes and is implemented in Node.JS and React.
## Usage
The idea is to deploy a container image for each of the core network services (i.e. hss, sgwc, amf, etc.). The image default CMD launches `/bin/bash`, so the recommendation is to change the command to `open5gs-hssd`, `open5gs-sgwcd`, `open5gs-amfd` or the corresponding daemon for the service you want to deploy.
The daemons take their configuration from the `/opt/open5gs/etc/open5gs/` and the `/opt/open5gs/etc/freeDiameter` image folders.
The folders include minimal working configurations for all the services.
The original open5gs configuration files are also provided at `/opt/open5gs/etc/orig`, with comments on available parameters.
Data plane service upf needs `/dev/ogstun` tun device access. You can create the tun interface in your host and mount it in the container or you can run upf container in privileged mode.
Some services must have access to a mongodb. You can modify the container environment variable `DB_URI=mongodb://mongo/open5gs` to configure access to mongodb.
### Deployment with Docker Compose
We provide a `docker-compose.yaml` file to deploy open5gs.
Just run `docker-compose up -d $(<open5gs-services.txt)` and check the services are up with `docker-compose ps`. To register the UE run `./register_subscriber.sh` or use the webui.
Add the UERANSIM services running `docker-compose up -d gnb ue` and check the services are up with `docker-compose ps`.
To remove the containers run `docker-compose down`.

View File

@@ -0,0 +1,4 @@
#!/bin/bash
docker-compose exec upf iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE;
#docker-compose exec ue ip route replace default via 10.45.0.1

View File

@@ -0,0 +1,164 @@
version: '2.4'
services:
mongo:
image: mongo
environment:
MONGO_INITDB_DATABASE: open5gs
webui:
build:
context: ../../open5gs/
dockerfile: Dockerfile.webui
args:
version: 2.1.7
image: openverso/open5gs-webui:2.1.7
restart: on-failure
environment:
DB_URI: mongodb://mongo/open5gs
ports:
- 3000:3000
nrf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-nrfd
restart : on-failure
amf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command:
- open5gs-amfd
restart : on-failure
smf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-smfd
restart : on-failure
mme:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-mmed
restart: on-failure
ports:
- 36412:36412
#/sctp
sgwc:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-sgwcd
restart : on-failure
sgwu:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-sgwud
restart : on-failure
upf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: ["open5gs-upfd"]
cap_add:
- all
privileged: true
restart: on-failure
ports:
- 2152:2152
pcrf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: ["open5gs-pcrfd"]
environment:
DB_URI: mongodb://mongo/open5gs
restart: on-failure
hss:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command: open5gs-hssd
environment:
DB_URI: mongodb://mongo/open5gs
restart: on-failure
udr:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
restart: on-failure
command:
- open5gs-udrd
udm:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
restart: on-failure
command:
- open5gs-udmd
ausf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command:
- open5gs-ausfd
restart : on-failure
pcf:
build:
context: ../../open5gs/
args:
version: 2.1.7
image: openverso/open5gs:2.1.7
command:
- open5gs-pcfd
restart : on-failure
gnb:
build:
context: ../../ueransim/
dockerfile: Dockerfile
image: openverso/ueransim:v3.1.0
command:
- gnb
environment:
AMF_HOSTNAME: amf
UE_HOSTNAME: ue
GNB_HOSTNAME: gnb
ue:
build:
context: ../../ueransim/
dockerfile: Dockerfile
image: openverso/ueransim:v3.1.0
command:
- ue
cap_add:
- all
privileged: true
environment:
GNB_HOSTNAME: gnb
APN: internet

View File

@@ -0,0 +1 @@
[{"_id":{"$oid":"603e4371894d2c0001c9e4d4"},"imsi":"001010000000004","pdn":[{"apn":"internet","_id":{"$oid":"603e4371894d2c0001c9e4d5"},"pcc_rule":[],"ambr":{"downlink":1024000,"uplink":1024000},"qos":{"qci":9,"arp":{"priority_level":8,"pre_emption_vulnerability":1,"pre_emption_capability":1}},"type":2}],"ambr":{"downlink":1024000,"uplink":1024000},"subscribed_rau_tau_timer":12,"network_access_mode":2,"subscriber_status":0,"access_restriction_data":32,"security":{"k":"465B5CE8B199B49FAA5F0A2EE238A6BC","amf":"8000","op":"E8ED289DEBA952E4283B54E88E6183CA","opc":null,"sqn":32},"__v":0}]

View File

@@ -0,0 +1 @@
mongo webui nrf amf smf mme sgwc sgwu upf pcrf hss udr udm ausf pcf

View File

@@ -0,0 +1,6 @@
#!/bin/bash
CONTAINER_NAME=open5gs-and-ueransim_mongo_1
docker cp imsi.json $CONTAINER_NAME:/tmp
docker exec $CONTAINER_NAME mongoimport --db open5gs --collection subscribers --file /tmp/imsi.json --type json --jsonArray