Commit 01ea60b2 authored by yangjian's avatar yangjian

add diankeyuan-aarch64

parent 1575962d
# OpenXG Core Network Installation Instructions
<br>
## *docker 部署*
- ### 下载源码
```shell
git clone http://git.opensource5g.org/openxg/openxg-5gcs-release.git
git checkout diankeyuan-aarch64
```
<br>
- ### 安装arm架构(aarch64)对应的docker、docker-compose
<br>
- ### 拉取镜像
```shell
cd openxg-5gcs-release/scripts
./pull_images.sh
```
<br>
- ### 启动数据库并创建docker网桥
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-mysql.yml up -d
```
>*注:<br>
>phpmyadmin访问地址: http://<宿主机IP>:8080 <br>
>用户名:root <br>
>密码:123456 <br>
<br>
- ### 构建并启动容器
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-5gc.yml up -d # 运行5gc
docker-compose -f docker-compose-ueransim.yml up -d # 连接基站、UE
```
<br>
- ### 关闭并删除容器
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-5gc.yml down -t 0 # 关闭5gc
docker-compose -f docker-compose-ueransim.yml down -t 0 # 关闭基站、UE
```
<br>
- ### 日志
```shell
cd openxg-5gcs-release/docker-compose
docker logs -f openxg-amf # 查看amf日志
docker logs -f openxg-smf # 查看smf日志
docker logs -f openxg-upf # 查看upf日志
docker logs -f openxg-gnb # 查看gnb日志
docker logs -f openxg-ue # 查看ue日志
```
<br>
- ### 网元配置文件
```shell
openxg-5gcs-release/etc # 配置文件路径
amf.conf # amf配置文件
smf.conf # smf配置文件
upf.conf # upf配置文件
gnb.yaml # gnb配置文件
ue.yaml # ue配置文件
```
<br>
This source diff could not be displayed because it is too large. You can view the blob instead.
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
FLUSH PRIVILEGES;
flush privileges;
ALTER user 'root'@'%' IDENTIFIED BY '123456';
flush privileges;
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld]
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
skip-host-cache
skip-name-resolve
datadir=/var/lib/mysql
socket=/var/run/mysqld/mysqld.sock
secure-file-priv=/var/lib/mysql-files
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
default-time-zone='+8:00'
max_connections=16384
max_user_connections=16000
[client]
socket=/var/run/mysqld/mysqld.sock
!includedir /etc/mysql/conf.d/
[mysqld]
character-set-server=utf8mb4
default-time-zone='+8:00'
innodb_rollback_on_timeout='ON'
max_connections=16384
max_user_connections=16000
innodb_lock_wait_timeout=500
# Copyright (c) 2014, 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
# By default we only accept connections from localhost
#bind-address = 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
max_connections=16384
max_user_connections=16000
version: '3.3'
services:
openxg-amf-0:
container_name: "openxg-amf-0"
image: openxg-amf:v1.5.3
openxg-amf:
container_name: "openxg-amf"
image: openxg-amf:v1.5.1
privileged: true
stdin_open: true
tty: true
......@@ -12,23 +12,12 @@ services:
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
# 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.3
ipv4_address: 172.11.200.14
volumes:
- ../etc/amf.conf:/openxg-amf/etc/amf.conf
openxg-smf:
container_name: "openxg-smf"
image: openxg-smf:v1.5.1
privileged: true
stdin_open: true
tty: true
......@@ -38,20 +27,13 @@ services:
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
ipv4_address: 172.11.200.15
volumes:
- ../etc/smf.conf:/openxg-smf/etc/smf.conf
openxg-upf-0:
container_name: "openxg-upf-0"
image: openxg-upf:v1.5.3
openxg-upf:
container_name: "openxg-upf"
image: openxg-upf:v1.5.1
privileged: true
stdin_open: true
tty: true
......@@ -61,16 +43,13 @@ services:
max-size: "1m"
networks:
openxg:
ipv4_address: 10.0.0.8
ipv4_address: 172.11.200.25
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
- openxg-smf
volumes:
- ../etc/upf.conf:/openxg-upf/etc/upf.conf
networks:
openxg:
name: docker-openxg
external: true
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
iperf3:
image: openxg5gc/iperf3:latest
container_name: iperf3
restart: always
logging:
driver: "json-file"
options:
max-size: "100m"
networks:
openxg:
ipv4_address: 10.11.12.1
stdin_open: true
tty: true
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
networks:
openxg:
name: docker-openxg
external: true
version: '3.3'
services:
mysql:
image: mysql:5.7
image: www.opensource5g.org:18082/diankeyuan/aarch64/mysql:latest
container_name: mysql
restart: always
logging:
......@@ -10,24 +10,21 @@ services:
max-size: "1m"
networks:
openxg:
aliases:
- web_mysql
ipv4_address: 10.0.0.2
ipv4_address: 172.11.200.10
ports:
- "3306:3306"
- "33060:33060"
- "3309:3306"
- "33090:33060"
volumes:
- ./database/docker-compose-mysqlData/:/var/lib/mysql
- ./database/my.conf:/etc/mysql/conf.d/my.conf
- ./database/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- ./database/amfusers.sql:/docker-entrypoint-initdb.d/create_db_sql.sql
- ./database/my.cnf:/etc/my.cnf
- ./database/amfusers.sql:/docker-entrypoint-initdb.d/amfusers.sql
- ./database/grant_root_remote.sql:/docker-entrypoint-initdb.d/grant_root_remote.sql
environment:
MYSQL_ROOT_PASSWORD: root
phpmyadmin:
image: phpmyadmin/phpmyadmin
image: www.opensource5g.org:18082/diankeyuan/aarch64/phpmyadmin:latest
container_name: phpmyadmin
restart: always
logging:
......@@ -38,13 +35,11 @@ services:
- mysql
networks:
openxg:
aliases:
- web_phpmyadmin
ipv4_address: 10.0.0.3
ipv4_address: 172.11.200.9
ports:
- "8080:80"
environment:
PMA_HOST: 10.0.0.2
PMA_HOST: 172.11.200.10
PMA_PORT: 3306
networks:
......@@ -53,6 +48,6 @@ networks:
name: docker-openxg
ipam:
config:
- subnet: 10.0.0.0/8
- subnet: 172.11.200.0/24
driver_opts:
com.docker.network.bridge.name: "docker-openxg"
version: '3.8'
services:
openxg-gnb-0-0:
container_name: "openxg-gnb-0-0"
image: openxg-ueransim:v1.5.3
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/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-0-0-0:
container_name: "openxg-ue-0-0-0"
image: openxg-ueransim:v1.5.3
privileged: true
stdin_open: true
tty: true
depends_on:
- openxg-gnb-0-0
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/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-gnb:
container_name: "openxg-gnb"
image: openxg-ueransim:v3.2.6
privileged: true
stdin_open: true
tty: true
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
openxg:
ipv4_address: 172.11.200.100
command: /bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml"
volumes:
- ../etc/gnb.yaml:/ueransim/etc/gnb.yaml
openxg-ue:
container_name: "openxg-ue"
image: openxg-ueransim:v3.2.6
privileged: true
stdin_open: true
tty: true
depends_on:
- openxg-gnb
logging:
driver: "json-file"
options:
max-size: "1m"
networks:
- openxg
command: /bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml"
volumes:
- ../etc/ue.yaml:/ueransim/etc/ue.yaml
networks:
openxg:
name: docker-openxg
external: true
......@@ -25,7 +25,7 @@ AMF =
PID_DIRECTORY = "/var/run"; # /var/run is the default
AMF_NAME = "OPENXG-AMF";
LOG_LEVEL = "{{ env["AMF_LOG_LEVEL"] }}";
LOG_LEVEL = "debug";
RELATIVE_CAPACITY = 30;
# Display statistics about whole system (in seconds)
......@@ -38,16 +38,16 @@ AMF =
GUAMI:
{
MCC = "{{ env["MCC"] }}"; MNC = "{{ env["MNC"] }}"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"
MCC = "466"; MNC = "92"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "1"
}
SERVED_GUAMI_LIST = (
{MCC = "{{ env["MCC"] }}"; MNC = "{{ env["MNC"] }}"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
{MCC = "466"; MNC = "92"; RegionID = "128"; AMFSetID = "4"; AMFPointer = "0"} #48bits <MCC><MNC><RegionID><AMFSetID><AMFPointer>
);
PLMN_SUPPORT_LIST = (
{
MCC = "{{ env["MCC"] }}"; MNC = "{{ env["MNC"] }}"; TAC = {{ env["TAC"] }};
MCC = "466"; MNC = "92"; TAC = 100;
SLICE_SUPPORT_LIST = (
# {SST = "@SST_0@"; SD = "@SD_0@"},
# {SST = "@SST_1@"; SD = "@SD_1@"},
......@@ -61,7 +61,7 @@ AMF =
# AMF binded interface for N1/N2 interface (NGAP)
NGAP_AMF:
{
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}";
INTERFACE_NAME = "eth0";
IPV4_ADDRESS = "read";
PORT = 38412;
PPID = 60;
......@@ -70,14 +70,14 @@ AMF =
# AMF binded interface for SBI (N11 (SMF)/N12 (AUSF), etc.)
SBI:
{
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}";
INTERFACE_NAME = "eth0";
IPV4_ADDRESS = "read";
PORT = 80;
API_VERSION = "v1";
HTTP2_PORT = 8404;
SMF_INSTANCES_POOL = (
{SMF_INSTANCE_ID = 5; IPV4_ADDRESS = "{{ env["SMF_SBI_ADDR"] }}"; PORT = 80; HTTP2_PORT = 8405, VERSION = "v1"; FQDN = "smf", SELECTED = "true"}
{SMF_INSTANCE_ID = 5; IPV4_ADDRESS = "172.11.200.15"; PORT = 80; HTTP2_PORT = 8405, VERSION = "v1"; FQDN = "smf", SELECTED = "true"}
);
};
......@@ -131,10 +131,10 @@ AMF =
AUTHENTICATION:
{
## MySQL mandatory options
MYSQL_server = "{{ env["AMF_MySQL_SERVER_ADDR"] }}"; # MySQL Server address
MYSQL_user = "{{ env["AMF_MySQL_USERNAME"] }}"; # Database server login
MYSQL_pass = "{{ env["AMF_MySQL_PASSWORD"] }}"; # Database server password
MYSQL_db = "{{ env["AMF_MySQL_DATABASE"] }}"; # Your database name
MYSQL_server = "172.11.200.10"; # MySQL Server address
MYSQL_user = "root"; # Database server login
MYSQL_pass = "123456"; # Database server password
MYSQL_db = "amfusers"; # Your database name
RANDOM = "true";
};
......
mcc: '466' # Mobile Country Code value
mnc: '92' # Mobile Network Code value (2 or 3 digits)
nci: '0x000000010' # NR Cell Identity (36-bit)
idLength: 32 # NR gNB ID length in bits [22...32]
tac: 100 # Tracking Area Code
linkIp: 172.11.200.100 # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: 172.11.200.100 # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 172.11.200.100 # gNB's local IP address for N3 Interface (Usually same with local IP)
# List of AMF address information
amfConfigs:
- address: 172.11.200.14
port: 38412
# List of supported S-NSSAIs by this gNB
slices:
- sst: 1
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
......@@ -24,7 +24,7 @@ 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"] }}"
LOG_LEVEL = "debug"
INTERFACES :
{
......@@ -53,10 +53,10 @@ SMF =
DNN_LIST = (
# PDU_SESSION_TYPE choice in {IPv4, IPv6, IPv4v6}
# DNN IP ADDRESS RANGE format is for example: "12.2.1.2 - 12.2.1.128"
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "{{ env["SMF_DEFAULT_IPV4_RANGE"] }}"; IPV6_PREFIX = "2001:1:2::/64"},
{DNN_NI = "ims"; PDU_SESSION_TYPE = "IPv4v6"; IPV4_RANGE = "{{ env["SMF_IMS_IPV4_RANGE"] }}"; IPV6_PREFIX = "3001:1:2::/64"},
{DNN_NI = "ctnet"; PDU_SESSION_TYPE = "IPv4v6"; IPV4_RANGE = "{{ env["SMF_CTNET_IPV4_RANGE"] }}"; IPV6_PREFIX = "4001:1:2::/64"},
{DNN_NI = "internet"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "{{ env["SMF_INTERNET_IPV4_RANGE"] }}"; IPV6_PREFIX = "5001:1:2::/64"}
{DNN_NI = "default"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "192.169.0.3 - 192.169.199.253"; IPV6_PREFIX = "2001:1:2::/64"},
{DNN_NI = "ims"; PDU_SESSION_TYPE = "IPv4v6"; IPV4_RANGE = "192.169.0.3 - 192.169.199.253"; IPV6_PREFIX = "3001:1:2::/64"},
{DNN_NI = "ctnet"; PDU_SESSION_TYPE = "IPv4v6"; IPV4_RANGE = "192.169.0.3 - 192.169.199.253"; IPV6_PREFIX = "4001:1:2::/64"},
{DNN_NI = "internet"; PDU_SESSION_TYPE = "IPv4"; IPV4_RANGE = "192.169.0.3 - 192.169.199.253"; IPV6_PREFIX = "5001:1:2::/64"}
);
# DNS address communicated to UEs
......@@ -91,7 +91,7 @@ SMF =
AMF :
{
IPV4_ADDRESS = "{{ env["AMF_SBI_ADDR"] }}"; # YOUR AMF CONFIG HERE
IPV4_ADDRESS = "172.11.200.14"; # 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
......@@ -122,7 +122,7 @@ SMF =
UPF_LIST = (
{
IPV4_ADDRESS = "{{ env["UPF_N4_ADDR"] }}" ;
IPV4_ADDRESS = "172.11.200.25" ;
# FQDN = "localhost";
# NWI_LIST = ({DOMAIN_ACCESS = "@DOMAIN_ACCESS@", DOMAIN_CORE = "@DOMAIN_CORE@"})
} # YOUR UPF CONFIG HERE
......
# IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
supi: 'imsi-{{ env["IMSI"] }}'
supi: 'imsi-466920000000001'
# Mobile Country Code value of HPLMN
mcc: '{{ env["MCC"] }}'
mcc: '466'
# Mobile Network Code value of HPLMN (2 or 3 digits)
mnc: '{{ env["MNC"] }}'
mnc: '92'
# Permanent subscription key
key: '{{ env["KEY"] }}'
key: '00112233445566778899aabbccddeeff'
# Operator code (OP or OPC) of the UE
op: '{{ env["OPC"] }}'
op: '000102030405060708090a0b0c0d0e0f'
# This value specifies the OP type and it can be either 'OP' or 'OPC'
opType: 'OPC'
# Authentication Management Field (AMF) value
amf: '{{ env["AMF_VALUE"] }}'
amf: '8000'
# IMEI number of the device. It is used if no SUPI is provided
imei: '356938035643803'
# IMEISV number of the device. It is used if no SUPI and IMEI is provided
......@@ -20,10 +20,8 @@ imeiSv: '4370816125816151'
# List of gNB IP addresses for Radio Link Simulation
gnbSearchList:
- {{ env["GNB_IP"] }}
controlPort: {{ env["CONTROLPORT"] }}
controlIp:
- {{ env["CONTROLIP"] }}
- 172.11.200.100
# UAC Access Identities Configuration
uacAic:
mps: false
......@@ -69,3 +67,4 @@ ciphering:
integrityMaxRate:
uplink: 'full'
downlink: 'full'
......@@ -23,7 +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"] }}"
LOG_LEVEL = "debug"
#ITTI_TASKS :
#{
......@@ -58,7 +58,7 @@ SPGW-U =
S1U_S12_S4_UP :
{
# S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface, virtual ethernet interface, we don't advise wireless interfaces
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}"; # STRING, interface name, YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "eth0"; # STRING, interface name, YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read"; # STRING, CIDR or "read to let app read interface configured IP address
#PORT = 2152; # Default is 2152
SCHED_PARAMS :
......@@ -72,7 +72,7 @@ SPGW-U =
SX :
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}"; # STRING, interface name
INTERFACE_NAME = "eth0"; # 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 :
......@@ -86,7 +86,7 @@ SPGW-U =
SGI :
{
# No config to set, the software will set the SGi interface to the interface used for the default route.
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}"; # STRING, interface name or "default_gateway"
INTERFACE_NAME = "eth0"; # STRING, interface name or "default_gateway"
IPV4_ADDRESS = "read"; # STRING, CIDR or "read" to let app read interface configured IP address
SCHED_PARAMS :
{
......@@ -98,7 +98,7 @@ SPGW-U =
};
HTTP_SERVER :
{
INTERFACE_NAME = "{{ env["INTERFACE_NAME"] }}";
INTERFACE_NAME = "eth0";
IPV4_ADDRESS = "read";
PORT = 5000;
};
......@@ -106,11 +106,11 @@ SPGW-U =
SNAT = "yes"; # SNAT Values in {yes, no}
PDN_NETWORK_LIST = (
{NETWORK_IPV4 = "{{ env["UPF_PDN_NETWORK_IPV4"] }}";} # 1 ITEM SUPPORTED ONLY
{NETWORK_IPV4 = "192.169.0.0/16";} # 1 ITEM SUPPORTED ONLY
);
SPGW-C_LIST = (
{IPV4_ADDRESS="{{ env["SMF_N4_ADDR"] }}";}
{IPV4_ADDRESS="172.11.200.15";}
);
NON_STANDART_FEATURES :
......
# OpenXG Core Network Installation Instructions
> ## docker 部署
1. 下载源码
```shell
git clone http://git.opensource5g.org/openxg/openxg-5gcs-release.git
git checkout oai
```
2. 安装docker、docker-compose
```shell
cd openxg-5gcs-release/scripts
./install.sh -I
```
3. 启动数据库并创建docker网桥
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-mysql.yml up -d
```
以上命令部署了phpmyadmin,通过访问http://本机ip:8080 可以打开。用户名为:root,密码为:123456;
用户sim卡信息在 amfusers数据库 users表中。
4. 启动核心网
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-5gc.yml up -d #构建并启动容器
```
5. 启动iperf
```shell
docker-compose -f docker-compose-iperf3.yml up -d
```
6. 连接基站、UE
```shell
docker-compose -f docker-compose-ueransim-gnb.yml up -d #启动gNB
docker-compose -f docker-compose-ueransim-ue.yml up -d #启动UE
docker exec -it ueransim-ue ping -I uesimtun0 www.baidu.com #检测ue访问外网
docker exec -it ueransim-ue iperf3 -c 172.11.200.200 -u -l 1300 -b 10M -B <ueransim容器中生成的 UE IP> #打流
```
外部基站需要在基站所在主机中执行以下命令:
```shell
route add -net 172.11.200.0 netmask 255.255.255.0 gw <核心网所在主机的IP>
```
> ## 关闭并删除docker容器
```shell
cd openxg-5gcs-release/docker-compose
docker-compose -f docker-compose-ueransim-ue.yml down -t 0 #关闭UE
docker-compose -f docker-compose-ueransim-gnb.yml down -t 0 #关闭gNB
docker-compose -f docker-compose-iperf3.yml down -t 0 #关闭iperf
docker-compose -f docker-compose-5gc.yml down -t 0 #关闭核心网
docker-compose -f docker-compose-mysql.yml down -t 0 #关闭数据库
```
> ## 日志
```shell
cd openxg-5gcs-release/docker-compose
docker logs -f openxg-5gc #查看核心网状态日志
docker exec -it openxg-5gc tail -f /opt/5gcs/log/amf.log #查看amf日志
docker exec -it openxg-5gc tail -f /opt/5gcs/log/smf.log #查看smf日志
docker exec -it openxg-5gc tail -f /opt/5gcs/log/upf.log #查看spgwu日志
```
#!/bin/bash
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
#echo "$THIS_SCRIPT_PATH"
source ${THIS_SCRIPT_PATH}/helper
function help()
{
echo_info " "
echo_info "Usage: build_allinone -I"
echo_info " "
echo_info "Options:"
echo_info "Mandatory arguments to long options are mandatory for short options too."
echo_info " -I, --install-deps Check installed software necessary to build and run Docker."
echo_info " -h, --help Print this help."
echo_info " "
}
function main()
{
if [ $# -lt 1 ]; then
echo_error "$0 \"-h\" Or \"--help\""
fi
until [ -z "$1" ]
do
case "$1" in
-I | --install-deps)
dv=$(docker -v)
until [ "${dv:0:14}" = "Docker version" ]
do
apt-get update
apt-get install -y docker.io
dv=$(docker -v)
done
echo "already installed docker"
# install curl
cv=$(curl -V)
until [ "${cv:0:4}" = "curl" ]
do
apt-get install -y curl
cv=$(curl -V)
done
echo "already installed curl"
# install docker-compose
dcv=$(docker-compose --version)
until [ ${dcv:23:6} == 1.28.2 ]
do
# curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
cp $THIS_SCRIPT_PATH/../libs/docker-compose /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
dcv=$(docker-compose --version)
done
echo "already installed docker-compose"
shift
;;
-h | --help)
help
shift
return 0
;;
*)
echo_error "Unknown option $1"
help
return 1
;;
esac
done
}
main "$@"
......@@ -6,33 +6,12 @@ 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
}
source ${THIS_SCRIPT_PATH}/script_helper
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
......@@ -46,57 +25,57 @@ 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!"
if [[ "$(docker images -q mysql:latest> /dev/null)" != "" ]]; then
echo_success "mysql:latest 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!"
docker pull $REMOTE_URL/diankeyuan/aarch64/mysql:latest
docker tag $REMOTE_URL/diankeyuan/aarch64/mysql:latest mysql:latest
docker rmi $REMOTE_URL/diankeyuan/aarch64/mysql:latest
echo_success "mysql:latest is successfully pulled!"
fi
if [[ "$(docker images -q phpmyadmin/phpmyadmin:latest 2> /dev/null)" != "" ]]; then
echo_success "phpmyadmin/phpmyadmin:latest already exists!"
if [[ "$(docker images -q phpmyadmin:latest 2> /dev/null)" != "" ]]; then
echo_success "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!"
docker pull $REMOTE_URL/diankeyuan/aarch64/phpmyadmin:latest
docker tag $REMOTE_URL/diankeyuan/aarch64/phpmyadmin:latest phpmyadmin:latest
docker rmi $REMOTE_URL/diankeyuan/aarch64/phpmyadmin:latest
echo_success "phpmyadmin:latest is successfully pulled!"
fi
if [[ "$(docker images -q openxg-amf:v1.5.3 2> /dev/null)" != "" ]]; then
echo_success "openxg-amf:v1.5.3 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-amf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/openxg-amf:v1.5.3 openxg-amf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/openxg-amf:v1.5.3
docker pull $REMOTE_URL/diankeyuan/aarch64/openxg-amf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/aarch64/openxg-amf:v1.5.3 openxg-amf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/aarch64/openxg-amf:v1.5.3
echo_success "openxg-amf:v1.5.3 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-smf:v1.5.3 2> /dev/null)" != "" ]]; then
echo_success "openxg-smf:v1.5.3 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-smf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/openxg-smf:v1.5.3 openxg-smf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/openxg-smf:v1.5.3
docker pull $REMOTE_URL/diankeyuan/aarch64/openxg-smf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/aarch64/openxg-smf:v1.5.3 openxg-smf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/aarch64/openxg-smf:v1.5.3
echo_success "openxg-smf:v1.5.3 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-upf:v1.5.3 2> /dev/null)" != "" ]]; then
echo_success "openxg-upf:v1.5.3 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-upf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/openxg-upf:v1.5.3 openxg-upf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/openxg-upf:v1.5.3
docker pull $REMOTE_URL/diankeyuan/aarch64/openxg-upf:v1.5.3
docker tag $REMOTE_URL/diankeyuan/aarch64/openxg-upf:v1.5.3 openxg-upf:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/aarch64/openxg-upf:v1.5.3
echo_success "openxg-upf:v1.5.3 is successfully pulled!"
fi
if [[ "$(docker images -q openxg-ueransim:v1.5.3 2> /dev/null)" != "" ]]; then
echo_success "openxg-ueransim:v1.5.3 already exists!"
else
docker pull $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.3
docker tag $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.3 openxg-ueransim:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/openxg-ueransim:v1.5.3
docker pull $REMOTE_URL/diankeyuan/aarch64/ueransim:v1.5.3
docker tag $REMOTE_URL/diankeyuan/aarch64/ueransim:v1.5.3 openxg-ueransim:v1.5.3
docker rmi $REMOTE_URL/diankeyuan/aarch64/ueransim:v1.5.3
echo_success "openxg-ueransim:v1.5.3 is successfully pulled!"
fi
......
###############################
## echo and family
###############################
black='\E[30m'
red='\E[31m'
green='\E[32m'
......@@ -32,3 +30,4 @@ echo_fatal() { cecho "$*" $red; exit -1 ;}
echo_warning() { cecho "$*" $yellow ;}
echo_success() { cecho "$*" $green ;}
echo_info() { cecho "$*" $blue ;}
#!/bin/bash
# 显示帮助信息的函数
help() {
echo "Usage: $0 --5gc <value> --gnb <value> --ue <value>"
echo
echo "Options:"
echo " --5gc <value> Set the 5gc value."
echo " --gnb <value> Set the gnb value."
echo " --ue <value> Set the ue value."
echo " --close Close the project."
echo " --help Display this help message."
}
close() {
docker rm -f $(docker ps -aq | grep -v $(docker ps -aqf "name=mysql") | grep -v $(docker ps -aqf "name=phpmyadmin"))
}
# 处理命令行参数的函数
process_args() {
while [[ "$#" -gt 0 ]]; do
case $1 in
--5gc)
if [[ -n $2 && $2 != --* ]]; then
fivegc_flag=true
fivegc_value=$2
shift 2
else
echo "Error: --5gc requires a value."
exit 1
fi
;;
--gnb)
if [[ -n $2 && $2 != --* ]]; then
gnb_value=$2
shift 2
else
echo "Error: --gnb requires a value."
exit 1
fi
;;
--ue)
if [[ -n $2 && $2 != --* ]]; then
ue_value=$2
shift 2
else
echo "Error: --ue requires a value."
exit 1
fi
;;
--close)
close
exit 0
;;
--help)
help
exit 0
;;
*)
echo "Error: Invalid option $1"
help
exit 1
;;
esac
done
}
start_5gc() {
echo "Start AMF: openxg-amf-$2"
docker run -itd --log-opt max-size=10m --privileged=true \
--name openxg-amf-$2 \
--network docker-openxg --ip 10.$2.0.10 \
-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 "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.3 > /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.3 > /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" \
-e "SMF_N4_ADDR=10.$2.0.9" \
openxg-upf:v1.5.3 > /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/gnb.template:/ueransim/etc/gnb.template" \
-e "UERANSIM_TYPE=GNB" \
-e "MCC=$3" \
-e "MNC=$4" \
-e "TAC=100" \
-e "GNB_IP=$2" \
-e "AMF_IP=$5" \
-e "NIC=$6" \
-e "COREIP=127.0.0.1" \
-e "COREPORT=7777" \
-e "GNBTYPE=0" \
-e "UPRESOURCEALLOCATION=78,10;32,8;40,2" \
-e "DOWNRESOURCEALLOCATION=78,10;32,8;40,2" \
-e "UPFREQUENCYMINIMUMRESOURCE=0" \
-e "UPTIMEPERIOD=0" \
-e "UPTIMEMINIMUMRESOURCE=0" \
-e "UPTOTALNUMBEROFLINES=0" \
-e "DOWNFREQUENCYMINIMUMRESOURCE=0" \
-e "DOWNTIMEPERIOD=0" \
-e "DOWNTIMEMINIMUMRESOURCE=0" \
-e "DOWNTOTALNUMBEROFLINES=0" \
-e "MODUALITIONMODE=1" \
-e "ENCONDINGMODE=1" \
-e "BROADCASTIP=127.0.0.1" \
-e "BROADCASTPORT=1111" \
openxg-ueransim:v1.5.3 \
/bin/bash -c "/ueransim/bin/nr-gnb -c /ueransim/etc/gnb.yaml" > /dev/null
}
start_ue() {
# -v "$SRC/docker-compose/lib/nr-ue:/ueransim/bin/nr-ue" \
docker run -itd --log-opt max-size=10m --privileged=true \
--name $1 \
--network docker-openxg --ip $2 \
-v "$SRC/template/ue.template:/ueransim/etc/ue.template" \
-e "UERANSIM_TYPE=UE" \
-e "MCC=$3" \
-e "MNC=$4" \
-e "TAC=100" \
-e "GNB_IP=$5" \
-e "IMSI=$6" \
-e "KEY=00112233445566778899aabbccddeeff" \
-e "OPC=000102030405060708090a0b0c0d0e0f" \
-e "AMF_VALUE=8000" \
-e "CONTROLPORT=9988" \
-e "CONTROLIP=127.0.0.1" \
openxg-ueransim:v1.5.3 \
/bin/bash -c "/ueransim/bin/nr-ue -c /ueransim/etc/ue.yaml" > /dev/null
}
# IPv4 地址自增
ip_increment() {
local ip=$1
local a b c d
IFS=. read -r a b c d <<< "$ip"
local ip_int=$(( (a << 24) | (b << 16) | (c << 8) | d ))
ip_int=$(($ip_int + 1))
echo "$(( (ip_int >> 24) & 0xFF )).$(( (ip_int >> 16) & 0xFF )).$(( (ip_int >> 8) & 0xFF )).$(( ip_int & 0xFF ))"
}
# 初始化默认值
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
SRC=$(dirname $THIS_SCRIPT_PATH)
fivegc_value="1"
gnb_value=""
ue_value=""
fivegc_flag=false
# 处理命令行参数
process_args "$@"
# 检查是否提供了所需的参数
if [[ -z $gnb_value || -z $ue_value ]]; then
echo "Error: Both --gnb and --ue options are required."
help
exit 1
fi
# 打印传递的参数
echo "5GC Value: $fivegc_value"
echo "gNB Value: $gnb_value"
echo "UE Value: $ue_value"
mcc=466
mnc=91
nic=0x000000000
for ((i=0; i<fivegc_value; i++)); do
if [ "$fivegc_flag" = true ]; then
start_5gc openxg-5gc-$i $i $mcc $mnc 0
sleep 3
fi
amf_ip="10.$i.0.10"
gnb_ue_ipv4=$amf_ip
imsi=$(($(($mcc$mnc)) * 10000000000))
for ((j=0; j<gnb_value; j++)); do
gnb_ue_ipv4=$(ip_increment "$gnb_ue_ipv4")
gnb_ip=$gnb_ue_ipv4
nic=$((nic+0x10))
echo "Start gNB: openxg-gnb-$i-$j"
start_gnb openxg-gnb-$i-$j $gnb_ip $mcc $mnc $amf_ip $(printf "0x%09x\n" "$nic")
for ((k=0; k<ue_value; k++)); 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
done
done
mnc=$((mnc + 1))
if [[ $mnc -gt 99 ]]; then
echo "Error: mnc($mnc) > 99, out of range!"
exit 0
fi
done
mcc: '{{ env["MCC"] }}' # Mobile Country Code value
mnc: '{{ env["MNC"] }}' # Mobile Network Code value (2 or 3 digits)
nci: '{{ env["NIC"] }}' # NR Cell Identity (36-bit)
idLength: 32 # NR gNB ID length in bits [22...32]
tac: {{ env["TAC"] }} # Tracking Area Code
linkIp: {{ env["GNB_IP"] }} # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: {{ env["GNB_IP"] }} # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: {{ env["GNB_IP"] }} # gNB's local IP address for N3 Interface (Usually same with local IP)
coreIp: {{ env["COREIP"] }}
corePort: {{ env["COREPORT"] }}
gnbType: {{ env["GNBTYPE"] }}
upresourceAllocation : '{{ env["UPRESOURCEALLOCATION"] }}'
downresourceAllocation : '{{ env["DOWNRESOURCEALLOCATION"] }}'
upfrequencyMinimumResource : {{ env["UPFREQUENCYMINIMUMRESOURCE"] }}
uptimePeriod : {{ env["UPTIMEPERIOD"] }}
uptimeMinimumResource : {{ env["UPTIMEMINIMUMRESOURCE"] }}
uptotalNumberOfLines : {{ env["UPTOTALNUMBEROFLINES"] }}
downfrequencyMinimumResource : {{ env["DOWNFREQUENCYMINIMUMRESOURCE"] }}
downtimePeriod : {{ env["DOWNTIMEPERIOD"] }}
downtimeMinimumResource : {{ env["DOWNTIMEMINIMUMRESOURCE"] }}
downtotalNumberOfLines : {{ env["DOWNTOTALNUMBEROFLINES"] }}
ModualitionMode : {{ env["MODUALITIONMODE"] }}
EncondingMode : {{ env["ENCONDINGMODE"] }}
broadcastIp: {{ env["BROADCASTIP"] }}
broadcastPort: {{ env["BROADCASTPORT"] }}
# List of AMF address information
amfConfigs:
- address: {{ env["AMF_IP"] }}
port: 38412
# List of supported S-NSSAIs by this gNB
slices:
- sst: 1
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
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