Commit 2aa8dad7 authored by yangjian's avatar yangjian

update v1.5.2

parent 973573a8
version: '3.3'
services:
openxg-5gc-1:
image: openxg5gc/openxg-5gc:latest
container_name: openxg-5gc-1
restart: always
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.0.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ../template/amf.template:/opt/5gcs/etc/amf.template
- ../template/smf.template:/opt/5gcs/etc/smf.template
- ../template/upf.template:/opt/5gcs/etc/upf.template
- ../template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py
environment:
# AMF
- MCC=466
- MNC=92
- TAC=100
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
# SMF
- SMF_DEFAULT_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_IMS_IPV4_RANGE=12.0.200.2 - 12.0.255.253
- SMF_CTNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_INTERNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
# UPF
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.0.0.0/16
openxg-5gc-2:
image: openxg5gc/openxg-5gc:latest
container_name: openxg-5gc-2
restart: always
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.1.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ../template/amf.template:/opt/5gcs/etc/amf.template
- ../template/smf.template:/opt/5gcs/etc/smf.template
- ../template/upf.template:/opt/5gcs/etc/upf.template
- ../template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py
environment:
# AMF
- MCC=466
- MNC=91
- TAC=100
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
# SMF
- SMF_DEFAULT_IPV4_RANGE=12.1.0.3 - 12.1.199.253
- SMF_IMS_IPV4_RANGE=12.1.200.2 - 12.1.255.253
- SMF_CTNET_IPV4_RANGE=12.1.0.3 - 12.1.199.253
- SMF_INTERNET_IPV4_RANGE=12.1.0.3 - 12.1.199.253
# UPF
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.1.0.0/16
openxg-5gc-3:
image: openxg5gc/openxg-5gc:latest
container_name: openxg-5gc-3
restart: always
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.2.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ../template/amf.template:/opt/5gcs/etc/amf.template
- ../template/smf.template:/opt/5gcs/etc/smf.template
- ../template/upf.template:/opt/5gcs/etc/upf.template
- ../template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py
environment:
# AMF
- MCC=466
- MNC=93
- TAC=100
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
# SMF
- SMF_DEFAULT_IPV4_RANGE=12.2.0.3 - 12.2.199.253
- SMF_IMS_IPV4_RANGE=12.2.200.2 - 12.2.255.253
- SMF_CTNET_IPV4_RANGE=12.2.0.3 - 12.2.199.253
- SMF_INTERNET_IPV4_RANGE=12.2.0.3 - 12.2.199.253
# UPF
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.2.0.0/16
openxg-5gc-4:
image: openxg5gc/openxg-5gc:latest
container_name: openxg-5gc-4
restart: always
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.3.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ../template/amf.template:/opt/5gcs/etc/amf.template
- ../template/smf.template:/opt/5gcs/etc/smf.template
- ../template/upf.template:/opt/5gcs/etc/upf.template
- ../template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py
environment:
# AMF
- MCC=466
- MNC=94
- TAC=100
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
# SMF
- SMF_DEFAULT_IPV4_RANGE=12.3.0.3 - 12.3.199.253
- SMF_IMS_IPV4_RANGE=12.3.200.2 - 12.3.255.253
- SMF_CTNET_IPV4_RANGE=12.3.0.3 - 12.3.199.253
- SMF_INTERNET_IPV4_RANGE=12.3.0.3 - 12.3.199.253
# UPF
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.3.0.0/16
networks:
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
openxg-5gc-1:
image: openxg5gc/openxg-5gc:latest
container_name: openxg-5gc-1
restart: always
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.0.0.10
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
- ../template/amf.template:/opt/5gcs/etc/amf.template
- ../template/smf.template:/opt/5gcs/etc/smf.template
- ../template/upf.template:/opt/5gcs/etc/upf.template
- ../template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py
environment:
# AMF
- MCC=466
- MNC=92
- TAC=100
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
# SMF
- SMF_DEFAULT_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_IMS_IPV4_RANGE=12.0.200.2 - 12.0.255.253
- SMF_CTNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_INTERNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
# UPF
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.0.0.0/16
openxg-amf-0:
container_name: "openxg-amf-0"
image: openxg-amf:v1.5.2
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.10
environment:
- AMF_LOG_LEVEL=debug # Which to use debug/trace/info/warning/error/critical/off
- MCC=466
- MNC=92
- TAC=100
- INTERFACE_NAME=eth0
- SMF_SBI_ADDR=10.0.0.9
- UPF_IP=10.0.0.8
# MYSQL
- AMF_MySQL_SERVER_ADDR=10.0.0.2
- AMF_MySQL_USERNAME=root
- AMF_MySQL_PASSWORD=123456
- AMF_MySQL_DATABASE=amfusers
openxg-smf-0:
container_name: "openxg-smf-0"
image: openxg-smf:v1.5.2
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.9
environment:
- SMF_LOG_LEVEL=debug # Which to use debug/trace/info/warning/error/critical/off
- INTERFACE_NAME=eth0
- AMF_SBI_ADDR=10.0.0.10
- UPF_N4_ADDR=10.0.0.8
- SMF_DEFAULT_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_IMS_IPV4_RANGE=12.0.200.2 - 12.0.255.253
- SMF_CTNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
- SMF_INTERNET_IPV4_RANGE=12.0.0.3 - 12.0.199.253
openxg-upf-0:
container_name: "openxg-upf-0"
image: openxg-upf:v1.5.2
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.8
depends_on:
- openxg-smf-0
environment:
- UPF_LOG_LEVEL=debug # Which to use debug/trace/info/warning/error/critical/off
- INTERFACE_NAME=eth0
- UPF_PDN_NETWORK_IPV4=12.0.0.0/16
- SMF_N4_ADDR=10.0.0.9
networks:
openxg:
name: docker-openxg
external: true
openxg:
name: docker-openxg
external: true
This diff is collapsed.
version: '3.8'
services:
openxg-gnb-1-1:
container_name: "openxg-gnb-1-1"
image: openxg5gc/openxg-ueransim:v3.2.6
openxg-gnb-0-0:
container_name: "openxg-gnb-0-0"
image: openxg-ueransim:v1.5.2
privileged: true
stdin_open: true
tty: true
......@@ -15,7 +15,6 @@ services:
ipv4_address: 10.0.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
- ../template/gnb.template:/ueransim/etc/gnb.template
#- ./lib/nr-gnb:/ueransim/bin/nr-gnb
environment:
......@@ -43,14 +42,14 @@ services:
- ENCONDINGMODE=1
- BROADCASTIP=127.0.0.1
- BROADCASTPORT=1111
openxg-ue-1-1-1:
container_name: "openxg-ue-1-1-1"
image: openxg5gc/openxg-ueransim:v3.2.6
openxg-ue-0-0-0:
container_name: "openxg-ue-0-0-0"
image: openxg-ueransim:v1.5.2
privileged: true
stdin_open: true
tty: true
depends_on:
- openxg-gnb-1-1
- openxg-gnb-0-0
logging:
driver: "json-file"
options:
......@@ -60,7 +59,6 @@ services:
ipv4_address: 10.0.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
- ../template/ue.template:/ueransim/etc/ue.template
#- ./lib/nr-ue:/ueransim/bin/nr-ue
environment:
......
version: '3.8'
services:
openxg-gnb-1-1:
container_name: "openxg-gnb-1-1"
image: openxg5gc/openxg-ueransim:v3.2.6
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.11
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
- ../template/gnb.template:/ueransim/etc/gnb.template
#- ./lib/nr-gnb:/ueransim/bin/nr-gnb
environment:
- UERANSIM_TYPE=GNB # Which to use GNB/UE
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.11
- AMF_IP=10.0.0.10
- NIC=0x000000010
- COREIP=127.0.0.1
- COREPORT=7777
- GNBTYPE=0 #TD:0;FD:1;地面:2;5G:3
- UPRESOURCEALLOCATION=78,10;32,8;40,2 #10个78M,8个32M
- DOWNRESOURCEALLOCATION=78,10;32,8;40,2 #10个78M,8个32M
- UPFREQUENCYMINIMUMRESOURCE=0 #频域最小资源
- UPTIMEPERIOD=0 #时域周期
- UPTIMEMINIMUMRESOURCE=0 #时域最小资源配置
- UPTOTALNUMBEROFLINES=0 #线路总数
- DOWNFREQUENCYMINIMUMRESOURCE=0
- DOWNTIMEPERIOD=0
- DOWNTIMEMINIMUMRESOURCE=0
- DOWNTOTALNUMBEROFLINES=0
- MODUALITIONMODE=1
- ENCONDINGMODE=1
- BROADCASTIP=127.0.0.1
- BROADCASTPORT=1111
openxg-ue-1-1-1:
container_name: "openxg-ue-1-1-1"
image: openxg5gc/openxg-ueransim:v3.2.6
privileged: true
stdin_open: true
tty: true
depends_on:
- openxg-gnb-1-1
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.12
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
- ../template/ue.template:/ueransim/etc/ue.template
#- ./lib/nr-ue:/ueransim/bin/nr-ue
environment:
- UERANSIM_TYPE=UE # Which to use GNB/UE
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.11
- IMSI=466920000000001
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
- AMF_VALUE=8000
- CONTROLPORT=9988
- CONTROLIP=127.0.0.1
openxg-ue-1-1-2:
container_name: "openxg-ue-1-1-2"
image: openxg5gc/openxg-ueransim:v3.2.6
privileged: true
stdin_open: true
tty: true
depends_on:
- openxg-gnb-1-1
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.13
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py
- ../template/ue.template:/ueransim/etc/ue.template
#- ./lib/nr-ue:/ueransim/bin/nr-ue
environment:
- UERANSIM_TYPE=UE # Which to use GNB/UE
- MCC=466
- MNC=92
- TAC=100
- GNB_IP=10.0.0.11
- IMSI=466920000000002
- KEY=00112233445566778899aabbccddeeff
- OPC=000102030405060708090a0b0c0d0e0f
- AMF_VALUE=8000
- CONTROLPORT=9988
- CONTROLIP=127.0.0.1
networks:
openxg:
name: docker-openxg
external: true
......@@ -3,7 +3,7 @@
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
#echo "$THIS_SCRIPT_PATH"
source ${THIS_SCRIPT_PATH}/install_help
source ${THIS_SCRIPT_PATH}/helper
function help()
{
......
#!/bin/bash
set -o pipefail
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source ${THIS_SCRIPT_PATH}/helper
function help()
{
#Usage:
echo_warning "Usage :"
echo_warning " $0 < local/remote >"
exit 100
}
REMOTE_URL="www.opensource5g.org:18083"
DOCKER_CONFIG="/etc/docker/daemon.json"
docker_config_presence=0
#Usage:
[ $# -ne 1 ] && [ $# -ne 2 ] && {
echo_error "Error : wrong args number $#."
help
}
if [ "$1" == "local" ]; then
REMOTE_URL="192.168.199.197:8083"
elif [ "$1" != "remote" ]; then
echo_error "Error : The parameter must be \"local\" or \"remote\""
help
fi
if [ -f "$DOCKER_CONFIG" ]; then
docker_config_presence=1
mv $DOCKER_CONFIG $DOCKER_CONFIG.back
fi
cat > $DOCKER_CONFIG << EOF
{
"insecure-registries": ["$REMOTE_URL"]
}
EOF
systemctl daemon-reload
systemctl restart docker
if [[ "$(docker images -q mysql:5.7 2> /dev/null)" != "" ]]; then
echo_success "mysql:5.7 already exists!"
else
docker pull $REMOTE_URL/mysql:5.7
docker tag $REMOTE_URL/mysql:5.7 mysql:5.7
docker rmi $REMOTE_URL/mysql:5.7
echo_success "mysql:5.7 is successfully pulled!"
fi
if [[ "$(docker images -q phpmyadmin/phpmyadmin:latest 2> /dev/null)" != "" ]]; then
echo_success "phpmyadmin/phpmyadmin:latest already exists!"
else
docker pull $REMOTE_URL/phpmyadmin/phpmyadmin:latest
docker tag $REMOTE_URL/phpmyadmin/phpmyadmin:latest phpmyadmin/phpmyadmin:latest
docker rmi $REMOTE_URL/phpmyadmin/phpmyadmin:latest
echo_success "phpmyadmin/phpmyadmin:latest is successfully pulled!"
fi
if [[ "$(docker images -q openxg-amf:v1.5.2 2> /dev/null)" != "" ]]; then
echo_success "openxg-amf:v1.5.2 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-amf:v1.5.2
docker tag $REMOTE_URL/diankeyuan/openxg-amf:v1.5.2 openxg-amf:v1.5.2
docker rmi $REMOTE_URL/diankeyuan/openxg-amf:v1.5.2
echo_success "openxg-amf:v1.5.2 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-smf:v1.5.2 2> /dev/null)" != "" ]]; then
echo_success "openxg-smf:v1.5.2 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-smf:v1.5.2
docker tag $REMOTE_URL/diankeyuan/openxg-smf:v1.5.2 openxg-smf:v1.5.2
docker rmi $REMOTE_URL/diankeyuan/openxg-smf:v1.5.2
echo_success "openxg-smf:v1.5.2 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-upf:v1.5.2 2> /dev/null)" != "" ]]; then
echo_success "openxg-upf:v1.5.2 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-upf:v1.5.2
docker tag $REMOTE_URL/diankeyuan/openxg-upf:v1.5.2 openxg-upf:v1.5.2
docker rmi $REMOTE_URL/diankeyuan/openxg-upf:v1.5.2
echo_success "openxg-upf:v1.5.2 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-ueransim:v1.5.2 2> /dev/null)" != "" ]]; then
echo_success "openxg-ueransim:v1.5.2 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.2
docker tag $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.2 openxg-ueransim:v1.5.2
docker rmi $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.2
echo_success "openxg-ueransim:v1.5.2 is successfully pulled!"
fi
rm $DOCKER_CONFIG
if [ $docker_config_presence -eq 1 ]; then
mv $DOCKER_CONFIG.back $DOCKER_CONFIG
fi
systemctl daemon-reload
systemctl restart docker
......@@ -65,34 +65,53 @@ process_args() {
}
start_5gc() {
echo "Start AMF: openxg-amf-$2"
docker run -itd --log-opt max-size=10m --privileged=true \
--name $1 \
--name openxg-amf-$2 \
--network docker-openxg --ip 10.$2.0.10 \
-v "$SRC/template/amf.template:/opt/5gcs/etc/amf.template" \
-v "$SRC/template/smf.template:/opt/5gcs/etc/smf.template" \
-v "$SRC/template/upf.template:/opt/5gcs/etc/upf.template" \
-v "$SRC/template/entrypoint_5gc.py:/opt/5gcs/etc/entrypoint.py" \
-e "AMF_LOG_LEVEL=debug" \
-e "MCC=$3" \
-e "MNC=$4" \
-e "TAC=100" \
-e "INTERFACE_NAME=eth0" \
-e "SMF_SBI_ADDR=10.$2.0.9" \
-e "UPF_IP=10.$2.0.8" \
-e "AMF_MySQL_SERVER_ADDR=10.$5.0.2" \
-e "AMF_MySQL_USERNAME=root" \
-e "AMF_MySQL_PASSWORD=123456" \
-e "AMF_MySQL_DATABASE=amfusers" \
openxg-amf:v1.5.2 > /dev/null
echo "Start SMF: openxg-smf-$2"
docker run -itd --log-opt max-size=10m --privileged=true \
--name openxg-smf-$2 \
--network docker-openxg --ip 10.$2.0.9 \
-e "SMF_LOG_LEVEL=debug" \
-e "INTERFACE_NAME=eth0" \
-e "AMF_SBI_ADDR=10.$2.0.10" \
-e "UPF_N4_ADDR=10.$2.0.8" \
-e "SMF_DEFAULT_IPV4_RANGE=12.$2.0.3 - 12.$2.199.253" \
-e "SMF_IMS_IPV4_RANGE=12.$2.200.2 - 12.$2.255.253" \
-e "SMF_CTNET_IPV4_RANGE=12.$2.0.3 - 12.$2.199.253" \
-e "SMF_INTERNET_IPV4_RANGE=12.$2.0.3 - 12.$2.199.253" \
openxg-smf:v1.5.2 > /dev/null
echo "Start UPF: openxg-upf-$2"
docker run -itd --log-opt max-size=10m --privileged=true \
--name openxg-upf-$2 \
--network docker-openxg --ip 10.$2.0.8 \
-e "UPF_LOG_LEVEL=debug" \
-e "INTERFACE_NAME=eth0" \
-e "UPF_PDN_NETWORK_IPV4=12.$2.0.0/16" \
openxg5gc/openxg-5gc:latest
-e "SMF_N4_ADDR=10.$2.0.9" \
openxg-upf:v1.5.2 > /dev/null
}
start_gnb() {
# -v "$SRC/docker-compose/lib/nr-gnb:/ueransim/bin/nr-gnb" \
docker run -itd --log-opt max-size=10m --privileged=true \
--name $1 \
--network docker-openxg --ip $2 \
-v "$SRC/template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py" \
-v "$SRC/template/gnb.template:/ueransim/etc/gnb.template" \
-e "UERANSIM_TYPE=GNB" \
-e "MCC=$3" \
......@@ -118,15 +137,14 @@ start_gnb() {
-e "ENCONDINGMODE=1" \
-e "BROADCASTIP=127.0.0.1" \
-e "BROADCASTPORT=1111" \
openxg5gc/openxg-ueransim:v3.2.6 \
/bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
openxg-ueransim:v1.5.2 \
/bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml" > /dev/null
}
start_ue() {
create_ue() {
# -v "$SRC/docker-compose/lib/nr-ue:/ueransim/bin/nr-ue" \
docker run -itd --log-opt max-size=10m --privileged=true \
docker create -it --log-opt max-size=10m --privileged=true \
--name $1 \
--network docker-openxg --ip $2 \
-v "$SRC/template/entrypoint_ueransim.py:/ueransim/etc/entrypoint.py" \
-v "$SRC/template/ue.template:/ueransim/etc/ue.template" \
-e "UERANSIM_TYPE=UE" \
-e "MCC=$3" \
......@@ -139,8 +157,8 @@ start_ue() {
-e "AMF_VALUE=8000" \
-e "CONTROLPORT=9988" \
-e "CONTROLIP=127.0.0.1" \
openxg5gc/openxg-ueransim:v3.2.6 \
/bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
openxg-ueransim:v1.5.2 \
/bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml" > /dev/null
}
# IPv4 地址自增
......@@ -183,7 +201,6 @@ nic=0x000000000
for ((i=0; i<fivegc_value; i++)); do
if [ "$fivegc_flag" = true ]; then
echo "Start 5GC: openxg-5gc-$i"
start_5gc openxg-5gc-$i $i $mcc $mnc 0
sleep 3
fi
......@@ -205,8 +222,8 @@ for ((i=0; i<fivegc_value; i++)); do
gnb_ue_ipv4=$(ip_increment "$gnb_ue_ipv4")
imsi=$(($imsi+1))
echo "Start UE: openxg-ue-$i-$j-$k imsi($imsi)"
start_ue openxg-ue-$i-$j-$k $gnb_ue_ipv4 $mcc $mnc $gnb_ip $imsi
echo "create UE: openxg-ue-$i-$j-$k imsi($imsi)"
create_ue openxg-ue-$i-$j-$k $gnb_ue_ipv4 $mcc $mnc $gnb_ip $imsi
done
......@@ -220,3 +237,12 @@ for ((i=0; i<fivegc_value; i++)); do
done
for ((x=0; x<fivegc_value; x++)); do
for ((y=0; y<gnb_value; y++)); do
for ((z=0; z<ue_value; z++)); do
echo "start UE: $(docker start openxg-ue-$x-$y-$z)"
done
done
done
......@@ -24,7 +24,8 @@ AMF =
INSTANCE_ID = 4; # 0 is the default
PID_DIRECTORY = "/var/run"; # /var/run is the default
AMF_NAME = "openxg-amf";
AMF_NAME = "OPENXG-AMF";
LOG_LEVEL = "{{ env["AMF_LOG_LEVEL"] }}";
RELATIVE_CAPACITY = 30;
# Display statistics about whole system (in seconds)
......@@ -41,7 +42,7 @@ AMF =
}
SERVED_GUAMI_LIST = (
{MCC = "{{ env["MCC"] }}"; MNC = "{{ env["MNC"] }}"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "{{ env["MCC"] }}"; MNC = "{{ env["MNC"] }}"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
PLMN_SUPPORT_LIST = (
......@@ -50,7 +51,7 @@ AMF =
SLICE_SUPPORT_LIST = (
# {SST = "@SST_0@"; SD = "@SD_0@"},
# {SST = "@SST_1@"; SD = "@SD_1@"},
{SST = 1; SD = 0xFFFFFF}
{SST = 1; SD = "0xFFFFFF"}
)
}
);
......@@ -69,14 +70,14 @@ AMF =
# AMF binded interface for SBI (N11 (SMF)/N12 (AUSF), etc.)
SBI:
{
INTERFACE_NAME = "lo";
IPV4_ADDRESS = "127.0.0.5/24";
PORT = 80;
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}";
IPV4_ADDRESS = "read";
PORT = 80;
API_VERSION = "v1";
HTTP2_PORT = 8404;
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 5; IPV4_ADDRESS = "127.0.0.6"; PORT = "80"; HTTP2_PORT = 8405, VERSION = "v1"; FQDN = "smf", SELECTED = "true"}
{SMF_INSTANCE_ID = 5; IPV4_ADDRESS = "{{ env["SMF_SBI_ADDR"] }}"; PORT = 80; HTTP2_PORT = 8405, VERSION = "v1"; FQDN = "smf", SELECTED = "true"}
);
};
......@@ -106,12 +107,14 @@ AMF =
# NSSF :
# {
# IPV4_ADDRESS = "";
# PORT = @NSSF_PORT@; # Default: 80
# API_VERSION = "@NSSF_API_VERSION@";
# FQDN = "@NSSF_FQDN@"
# IPV4_ADDRESS = "127.0.0.1";
# PORT = 80; # Default: 80
# API_VERSION = "v2";
# FQDN = "localhost"
# };
};
UPF_IP = "{{ env["UPF_IP"] }}"
SUPPORT_FEATURES:
{
......@@ -144,9 +147,3 @@ AMF =
};
};
MODULES =
{
NGAP_MESSAGE = (
{MSG_NAME = "NGSetupRequest"; ProcedureCode = 21; TypeOfMessage = "initialMessage"}
);
};
#!/usr/bin/env python3
from jinja2 import Environment, FileSystemLoader
import socket
import os
import sys
CONFIG_FILE = str(os.getenv('CONFIG_FILE','/opt/5gcs/etc/'))
AMF_CONFIG_FILE = str(os.getenv('AMF_CONFIG_FILE','/opt/5gcs/etc/amf.conf'))
SMF_CONFIG_FILE = str(os.getenv('SMF_CONFIG_FILE','/opt/5gcs/etc/smf.conf'))
UPF_CONFIG_FILE = str(os.getenv('UPF_CONFIG_FILE','/opt/5gcs/etc/spgw_u.conf'))
def resolve(hostname):
try:
return socket.gethostbyname(hostname)
except socket.error:
print(f"Not able to resolve {hostname}")
def render(filepath,funcs,values):
env = Environment(loader=FileSystemLoader(os.path.dirname(filepath)))
jinja_template = env.get_template(os.path.basename(filepath))
jinja_template.globals.update(funcs)
template_string = jinja_template.render(env=values)
return template_string
env_variables = dict()
#list of all the environment variables
for name, value in os.environ.items():
env_variables.update({name:value})
output = render(CONFIG_FILE + 'amf.template',{"resolve":resolve},env_variables)
with open(AMF_CONFIG_FILE, "w") as fh:
fh.write(output)
print(f"Configuration file {AMF_CONFIG_FILE} is ready")
output = render(CONFIG_FILE + 'smf.template',{"resolve":resolve},env_variables)
with open(SMF_CONFIG_FILE, "w") as fh:
fh.write(output)
print(f"Configuration file {SMF_CONFIG_FILE} is ready")
output = render(CONFIG_FILE + 'upf.template',{"resolve":resolve},env_variables)
with open(UPF_CONFIG_FILE, "w") as fh:
fh.write(output)
print(f"Configuration file {UPF_CONFIG_FILE} is ready")
if len(sys.argv) == 1:
sys.exit(0)
#important for running the network function it works like exec $@
os.execvp(sys.argv[1], sys.argv[1:])
#!/usr/bin/env python3
from jinja2 import Environment, FileSystemLoader
import socket
import os
import sys
CONFIG_FILE = str(os.getenv('CONFIG_FILE','/ueransim/etc/'))
def resolve(hostname):
try:
return socket.gethostbyname(hostname)
except socket.error:
print(f"Not able to resolve {hostname}")
def render(filepath,funcs,values):
env = Environment(loader=FileSystemLoader(os.path.dirname(filepath)))
jinja_template = env.get_template(os.path.basename(filepath))
jinja_template.globals.update(funcs)
template_string = jinja_template.render(env=values)
return template_string
env_variables = dict()
#list of all the environment variables
for name, value in os.environ.items():
env_variables.update({name:value})
if env_variables.get('UERANSIM_TYPE'):
if env_variables['UERANSIM_TYPE'] == 'GNB':
output = render(CONFIG_FILE + 'gnb.template',{"resolve":resolve},env_variables)
with open(CONFIG_FILE + 'gnb.yaml', "w") as fh:
fh.write(output)
print(f"Configuration file {CONFIG_FILE}gnb.yaml is ready")
elif env_variables['UERANSIM_TYPE'] == 'UE':
output = render(CONFIG_FILE + 'ue.template',{"resolve":resolve},env_variables)
with open(CONFIG_FILE + 'ue.yaml', "w") as fh:
fh.write(output)
print(f"Configuration file {CONFIG_FILE}ue.yaml is ready")
else :
print(f"Configuration file setup failed. (Unknown type: {env_variables['UERANSIM_TYPE']})")
else :
print(f"Configuration file setup failed. (not find env['UERANSIM_TYPE'])")
if len(sys.argv) == 1:
sys.exit(0)
#important for running the network function it works like exec $@
os.execvp(sys.argv[1], sys.argv[1:])
......@@ -21,24 +21,25 @@
SMF =
{
# FQDN = "SMF";
# FQDN = "oai-smf-svc";
INSTANCE = 5; # 0 is the default
PID_DIRECTORY = "/var/run"; # /var/run is the default
LOG_LEVEL = "{{ env["SMF_LOG_LEVEL"] }}"
INTERFACES :
{
N4 :
{
# SMF binded interface for N4 communication (UPF)
INTERFACE_NAME = "lo"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "127.0.0.100/24";
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
};
SBI :
{
# SMF binded interface for SBI interface (e.g., communication with AMF, UDM)
INTERFACE_NAME = "lo"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "127.0.0.6/24";
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
HTTP2_PORT = 8405; # YOUR NETWORK CONFIG HERE
API_VERSION = "v1"; # YOUR SMF API VERSION CONFIG HERE
......@@ -76,21 +77,21 @@ SMF =
{
# STRING, {"yes", "no"},
REGISTER_NRF = "no"; # Set to yes if SMF resgisters to an NRF
DISCOVER_UPF = "yes"; # Set to yes to enable UPF discovery and selection
DISCOVER_UPF = "no"; # Set to yes to enable UPF discovery and selection
DISCOVER_PCF = "no";
FORCE_PUSH_PROTOCOL_CONFIGURATION_OPTIONS = "no"; # Non standard feature, normally should be set to "no",
# but you may need to set to yes for UE that do not explicitly request a PDN address through NAS signalling
USE_LOCAL_SUBSCRIPTION_INFO = "yes"; # Set to yes if SMF uses local subscription information instead of from an UDMa
USE_LOCAL_PCC_RULES = "yes";
USE_LOCAL_PCC_RULES = "no";
USE_FQDN_DNS = "no"; # Set to yes if AMF/UDM/NRF/UPF will relying on a DNS to resolve FQDN
HTTP_VERSION = 1; # Default: 1
USE_NETWORK_INSTANCE = "yes"; # Set yes if network instance is to be used for given UPF
USE_NETWORK_INSTANCE = "no"; # Set yes if network instance is to be used for given UPF
ENABLE_USAGE_REPORTING = "no"; # Set yes if UE USAGE REPORTING is to be done at UPF
}
AMF :
{
IPV4_ADDRESS = "127.0.0.5"; # YOUR AMF CONFIG HERE
IPV4_ADDRESS = "{{ env["AMF_SBI_ADDR"] }}"; # YOUR AMF CONFIG HERE
PORT = 80; # YOUR AMF CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR SBI CONFIG HERE
# FQDN = "@AMF_FQDN@" # YOUR AMF FQDN CONFIG HERE
......@@ -121,8 +122,8 @@ SMF =
UPF_LIST = (
{
IPV4_ADDRESS = "127.0.0.101" ;
FQDN = "UPF";
IPV4_ADDRESS = "{{ env["UPF_N4_ADDR"] }}" ;
# FQDN = "localhost";
# NWI_LIST = ({DOMAIN_ACCESS = "@DOMAIN_ACCESS@", DOMAIN_CORE = "@DOMAIN_CORE@"})
} # YOUR UPF CONFIG HERE
); # NWI_LIST IS OPTIONAL PARAMETER
......
......@@ -23,6 +23,7 @@ SPGW-U =
#FQDN = "upf"; # FQDN for 4G
INSTANCE = 6; # 0 is the default
PID_DIRECTORY = "/var/run"; # /var/run is the default
LOG_LEVEL = "{{ env["UPF_LOG_LEVEL"] }}"
#ITTI_TASKS :
#{
......@@ -71,8 +72,8 @@ SPGW-U =
SX :
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME = "lo"; # STRING, interface name
IPV4_ADDRESS = "127.0.0.101/24"; # STRING, CIDR or "read" to let app read interface configured IP address
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}"; # STRING, interface name
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 8805; # Default is 8805
SCHED_PARAMS :
{
......@@ -95,12 +96,12 @@ SPGW-U =
POOL_SIZE = 1; # NUM THREADS
};
};
#HTTP_SERVER:
#{
# INTERFACE_NAME = "ens32";
# IPV4_ADDRESS = "read";
# PORT = 5000;
#};
HTTP_SERVER :
{
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}";
IPV4_ADDRESS = "read";
PORT = 5000;
};
};
SNAT = "yes"; # SNAT Values in {yes, no}
......@@ -109,7 +110,7 @@ SPGW-U =
);
SPGW-C_LIST = (
{IPV4_ADDRESS="127.0.0.100" ;}
{IPV4_ADDRESS="{{ env["SMF_N4_ADDR"] }}";}
);
NON_STANDART_FEATURES :
......
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