Verified Commit 2e6c5f16 authored by Rohan's avatar Rohan
Browse files

Dockerfile added for test with vpp-upf

parent f08d9a44
......@@ -13,6 +13,7 @@ RED='\033[0;31m'
NC='\033[0m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
WHITE='\033[0;97m'
STATUS=0 #STATUS 0 exit safe STATUS 1 exit with an error
if [[ $1 == 'start' ]]; then
......@@ -23,6 +24,12 @@ if [[ $1 == 'start' ]]; then
elif [[ $2 == 'gnbsim' ]]; then
echo -e "${BLUE}Starting gnbsim ${NC}..."
docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim$3
elif [[ $2 == 'gnbsim-vpp' ]]; then
echo -e "${BLUE}Starting gnbsim ${NC}..."
docker-compose -f docker-compose-gnbsim.yaml up -d gnbsim-vpp
elif [[ $2 == 'vpp-upf' ]]; then
echo -e "${BLUE}Starting 5gcn with vpp-upf ${NC}..."
docker-compose -f docker-compose-vpp-upf.yaml up -d
else
echo -e "${BLUE}Starting 5gcn components in the order mysql, amf, smf, spgwu${NC}..."
docker-compose -f docker-compose-no-nrf.yaml -p 5gcn up -d
......@@ -34,6 +41,8 @@ if [[ $1 == 'start' ]]; then
nrf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-nrf)
elif [[ $2 == 'gnbsim' ]]; then
gnbsim_health=$(docker inspect --format='{{json .State.Health.Status}}' gnbsim)
elif [[ $2 == 'vpp-upf' ]]; then
vpp_upf_health=$(docker inspect --format='{{json .State.Health.Status}}' vpp-upf)
fi
amf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-amf)
smf_health=$(docker inspect --format='{{json .State.Health.Status}}' oai-smf)
......@@ -54,7 +63,7 @@ if [[ $1 == 'start' ]]; then
STATUS=0
break
elif [[ $2 != 'nrf' ]]; then
echo -ne "here mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health, oai-spgwu : $spgwu_health\033[0K\r"
echo -ne "mysql : $mysql_health, oai-amf : $amf_health, oai-smf : $smf_health, oai-spgwu : $spgwu_health\033[0K\r"
STATUS=1
sleep 2
else
......@@ -103,10 +112,16 @@ elif [[ $1 == 'stop' ]]; then
docker-compose -f docker-compose.yaml -p 5gcn down
elif [[ $2 == 'gnbsim' ]]; then
docker-compose -f docker-compose-gnbsim.yaml down
elif [[ $2 == 'vpp-upf' ]]; then
docker-compose -f docker-compose-vpp-upf.yaml down
else
docker-compose -f docker-compose-no-nrf.yaml -p 5gcn down
fi
echo -e "${GREEN}Service $2 is stopped${NC}"
else
echo -e "Only use the following options\n\n${RED}start${NC}: start the 5gCN\n${RED}stop${NC}: stops the 5gCN\n${RED}nrf${NC}: nrf should be used\n${RED}no-nrf${NC}: nrf should not be used\nExample: ./core-network.sh start nrf"
echo -e "Only use the following options\n\n${RED}start ${WHITE}[option]${NC}: start the 5gCN/gnbsim\n"\
"${RED}stop ${WHITE}[option]${NC}: stops the 5gCN/gnbsim\n${WHITE}--option\n${RED} nrf${NC} : nrf should be used\n"\
"${RED} no-nrf${NC} : nrf should not be used\n${RED} vpp-upf${NC} : vpp-upf should be used (without nrf)\n"\
"${RED} gnbsim${NC} : gnbsim should be used\n${RED} gnbsim-vpp${NC} : gnbsim should be used for vpp-upf\n"\
"\nExample: ./core-network.sh start nrf\n"
fi
......@@ -135,7 +135,6 @@ services:
interval: 10s
timeout: 5s
retries: 5
gnbsim5:
container_name: gnbsim5
image: gnbsim:develop
......@@ -169,11 +168,55 @@ services:
interval: 10s
timeout: 5s
retries: 5
gnbsim-vpp:
container_name: gnbsim-vpp
image: gnbsim:develop
privileged: true
environment:
- MCC=208
- MNC=95
- GNBID=5
- TAC=0x00a000
- SST=222
- SD=00007b
- PagingDRX=v32
- RANUENGAPID=0
- IMEISV=35609204079514
- MSIN=0000000035
- RoutingIndicator=1234
- ProtectionScheme=null
- KEY=0C0A34601D4F07677303652C0462535B
- OPc=63bfa50ee6523365ff14c1f45f88737d
- DNN=default
- URL=http://www.asnt.org:8080/
- NRCellID=1
- NGAPPeerAddr=192.168.71.132
- GTPuLocalAddr=192.168.72.141
- GTPuIFname=eth0
networks:
public_net_core:
ipv4_address: 192.168.71.141
public_net_access:
ipv4_address: 192.168.72.141
healthcheck:
test: /bin/bash -c "ifconfig gtp-gnb"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net:
external:
name: demo-oai-public-net
public_net_core:
name: oai-public-core
ipam:
config:
- subnet: 192.168.71.0/24
public_net_access:
name: oai-public-access
ipam:
config:
- subnet: 192.168.72.0/24
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
# public_net:
# driver: bridge
......
version: '3.8'
services:
mysql:
container_name: "mysql"
image: mysql:5.7
volumes:
- ./oai_db.sql:/docker-entrypoint-initdb.d/oai_db.sql
- ./mysql-healthcheck.sh:/tmp/mysql-healthcheck.sh
environment:
- TZ=Europe/Paris
- MYSQL_DATABASE=oai_db
- MYSQL_USER=test
- MYSQL_PASSWORD=test
- MYSQL_ROOT_PASSWORD=linux
healthcheck:
test: /bin/bash -c "/tmp/mysql-healthcheck.sh"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net_core:
ipv4_address: 192.168.71.131
oai-amf:
container_name: "oai-amf"
image: oai-amf:develop
environment:
- TZ=Europe/paris
- INSTANCE=0
- PID_DIRECTORY=/var/run
- MCC=208
- MNC=95
- REGION_ID=128
- AMF_SET_ID=1
- SERVED_GUAMI_MCC_0=208
- SERVED_GUAMI_MNC_0=95
- SERVED_GUAMI_REGION_ID_0=128
- SERVED_GUAMI_AMF_SET_ID_0=1
- SERVED_GUAMI_MCC_1=460
- SERVED_GUAMI_MNC_1=11
- SERVED_GUAMI_REGION_ID_1=10
- SERVED_GUAMI_AMF_SET_ID_1=1
- PLMN_SUPPORT_MCC=208
- PLMN_SUPPORT_MNC=95
- PLMN_SUPPORT_TAC=0xa000
- SST_0=222
- SD_0=123
- SST_1=1
- SD_1=12
- AMF_INTERFACE_NAME_FOR_NGAP=eth0
- AMF_INTERFACE_NAME_FOR_N11=eth0
- SMF_INSTANCE_ID_0=1
- SMF_IPV4_ADDR_0=192.168.71.133
- SMF_HTTP_VERSION_0=v1
- SMF_INSTANCE_ID_1=2
- SMF_IPV4_ADDR_1=0.0.0.0
- SMF_HTTP_VERSION_1=v1
- MYSQL_SERVER=192.168.71.131
- MYSQL_USER=root
- MYSQL_PASS=linux
- MYSQL_DB=oai_db
- OPERATOR_KEY=63bfa50ee6523365ff14c1f45f88737d
- NRF_IPV4_ADDRESS=0.0.0.0
- NRF_PORT=80
- NF_REGISTRATION=no
- SMF_SELECTION=no
- NRF_API_VERSION=v1
- AUSF_IPV4_ADDRESS=127.0.0.1
- AUSF_PORT=80
- AUSF_API_VERSION=v1
depends_on:
- mysql
volumes:
- ./amf-healthcheck.sh:/openair-amf/bin/amf-healthcheck.sh
healthcheck:
test: /bin/bash -c "/openair-amf/bin/amf-healthcheck.sh"
interval: 10s
timeout: 15s
retries: 5
networks:
public_net_core:
ipv4_address: 192.168.71.132
oai-smf:
container_name: "oai-smf"
image: oai-smf:vpp-upf
environment:
- TZ=Europe/Paris
- INSTANCE=0
- PID_DIRECTORY=/var/run
- SMF_INTERFACE_NAME_FOR_N4=eth0
- SMF_INTERFACE_NAME_FOR_SBI=eth0
- SMF_INTERFACE_PORT_FOR_SBI=80
- 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
- AMF_IPV4_ADDRESS=192.168.71.132
- AMF_PORT=80
- AMF_API_VERSION=v1
- UDM_IPV4_ADDRESS=127.0.0.1
- UDM_PORT=80
- UDM_API_VERSION=v1
- UPF_IPV4_ADDRESS=192.168.71.202
- NRF_IPV4_ADDRESS=0.0.0.0
- NRF_PORT=80
- NRF_API_VERSION=v1
- REGISTER_NRF=no
- DISCOVER_UPF=no
- USE_NETWORK_INSTANCE=yes
extra_hosts:
- "gw1.vppupf.node.5gcn.mnc95.mcc208.3gppnetwork.org:192.168.71.202"
# depends_on:
# - oai-amf
# volumes:
# - ./smf-healthcheck.sh:/openair-smf/bin/smf-healthcheck.sh
# healthcheck:
# test: /bin/bash -c "/openair-smf/bin/smf-healthcheck.sh"
# interval: 10s
# timeout: 5s
# retries: 5
networks:
public_net_core:
ipv4_address: 192.168.71.133
vpp-upf:
image: vpp-upg:develop
privileged: true
container_name: vpp-upf
environment:
- NWI_CORE=core.oai.org
- NWI_ACCESS=access.oai.org
- NWI_SGI=sgi.oai.org
- GW_ID=1
- MNC03=95
- MCC=208
- REALM=3gppnetwork.org
- NETWORK_UE_IP=12.1.1.0/24
- N3_IPV4_ADDRESS_REMOTE=192.168.72.141
- N3_IPV4_ADDRESS_LOCAL=192.168.72.202
- N4_IPV4_ADDRESS_REMOTE=192.168.71.133
- N4_IPV4_ADDRESS_LOCAL=192.168.71.202
- N6_IPV4_ADDRESS_REMOTE=192.168.73.135
- N6_IPV4_ADDRESS_LOCAL=192.168.73.202
- VPP_MAIN_CORE=0
- VPP_CORE_WORKER=1
# - VPP_PLUGIN_PATH=/usr/lib64/vpp_plugins/ # RHEL7
- VPP_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/vpp_plugins/ # Ubntu18.04
- INTERFACE_ACCESS=eth0
- INTERFACE_CORE=eth1
- INTERFACE_SGI=eth2
healthcheck:
test: /bin/bash -c "pgrep vpp"
interval: 10s
timeout: 5s
retries: 5
networks:
public_net_core:
ipv4_address: 192.168.71.134
public_net_access:
ipv4_address: 192.168.72.134
public_net_sgi_lan:
ipv4_address: 192.168.73.134
oai-ext-dn:
image: ubuntu:bionic
privileged: true
container_name: oai-ext-dn
entrypoint: /bin/bash -c \
"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.73.202 dev eth0; sleep infinity"
command: ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
depends_on:
- vpp-upf
networks:
public_net_sgi_lan:
ipv4_address: 192.168.73.135
networks:
public_net_core:
name: oai-public-core
ipam:
config:
- subnet: 192.168.71.0/24
public_net_access:
name: oai-public-access
ipam:
config:
- subnet: 192.168.72.0/24
public_net_sgi_lan:
name: oai-public-sgi-lan
ipam:
config:
- subnet: 192.168.73.0/24
# Incase the user wants docker-compose to create a bridge rather than creating the bridge manually then uncomment the below lines
# public_net:
# driver: bridge
# name: demo-oai-public-net
# ipam:
# config:
# - subnet: 192.168.71.128/26
# driver_opts:
# com.docker.network.bridge.name: "demo-oai"
#!/bin/bash
set -eo pipefail
sleep 2
IS_VPP_UPF=$(docker ps -a | grep vpp-upg | awk {'print $2'})
if [$IS_VPP_UPF=="vpp-upg:develop"];then
x=1, VPP_STATUS=0
while [ $x -le 10 ]
do
VPP_UPF_PFCP_ENDPOINT=$(docker exec -it vpp-upf ./bin/vppctl show upf pfcp endpoint | awk -v RS='([0-9]+\\.){3}[0-9]+' 'RT{print RT}')
PING_STATE=$(ping -c 3 $VPP_UPF_PFCP_ENDPOINT | grep "icmp_seq")
if [ -z "$var" ];then
echo "PFCP endpoint could not be reached"
else
echo "PFCP endpoint is ready, restarting SMF"
docker restart oai-smf
fi
x=$(( $x + 1 ))
done
fi
STATUS=0
SMF_IP_SBI_INTERFACE=$(ifconfig $SMF_INTERFACE_NAME_FOR_SBI | grep inet | awk {'print $2'})
#Check if entrypoint properly configured the conf file and no parameter is unset(optional)
......
......@@ -22,3 +22,4 @@
5. [Tutorial: 5G Core Network Deployment using Helm Charts](./DEPLOY_SA5G_HC.md)
6. [Tutorial: 5G Core Network Deployment and Testing with gnbsim](./DEPLOY_SA5G_WITH_GNBSIM.md)
7. [Tutorial: 5G Core Network Deployment in Virtual Machines and Testing with COTSUE](./DEPLOY_SA5G_VM_COTSUE.md)
8. [Tutorial: 5G Core Network Deployment and Testing with VPP-UPF](./DEPLOY_SA5G_WITH_VPP_UPF.md)
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