具体可以参照部署OAI软件前的准备工作一文。
如下图,本端到端的独立接入部署方案,主要由以下三大网元构成,每个网元由一个或者多个不同功能的子网元构成。
各个网元的容器镜像docker images保存在docker hub网站上。
sudo docker login
sudo docker pull mysql:8.0
sudo docker pull oaisoftwarealliance/oai-amf:v1.5.0
sudo docker pull oaisoftwarealliance/oai-nrf:v1.5.0
sudo docker pull oaisoftwarealliance/oai-smf:v1.5.0
sudo docker pull oaisoftwarealliance/oai-spgwu-tiny:v1.5.0
sudo docker pull oaisoftwarealliance/trf-gen-cn5g:focal
sudo docker pull oaisoftwarealliance/oai-gnb:develop
sudo docker pull oaisoftwarealliance/oai-nr-ue:develop
sudo docker logout
使用http或者git从oai官方代码托管网站下载penairinterface5g/ci-scripts整个目录以及目录下所有文件与目录。
注意 ,一定要进入/ci-scripts/yaml_files/5g_rfsimulator后才能开始部署,用docker-compose的以下命令部署后,直到打印出下列部署信息。稍等一会后,用docker-compose ps -a命令检查,如下图全部容易都进入healthy状态后说明核心网部署成功。
xxx@xxx-pc: cd ./ci-scripts/yaml_files/5g_rfsimulator
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d mysql oai-nrf oai-amf oai-smf oai-spgwu oai-ext-dn
Creating network "rfsim5g-oai-public-net" with driver "bridge"
Creating network "rfsim5g-oai-traffic-net" with driver "bridge"
Creating rfsim5g-oai-nrf ... done
Creating rfsim5g-mysql ... done
Creating rfsim5g-oai-amf ... done
Creating rfsim5g-oai-smf ... done
Creating rfsim5g-oai-spgwu ... done
Creating rfsim5g-oai-ext-dn ... done
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------
rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
rfsim5g-oai-amf python3 /openair-amf/bin/e ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp
rfsim5g-oai-ext-dn /bin/bash -c iptables -t ... Up (healthy)
rfsim5g-oai-nrf python3 /openair-nrf/bin/e ... Up (healthy) 80/tcp, 9090/tcp
rfsim5g-oai-smf python3 /openair-smf/bin/e ... Up (healthy) 80/tcp, 8080/tcp, 8805/udp
rfsim5g-oai-spgwu python3 /openair-spgwu-tin ... Up (healthy) 2152/udp, 8805/udp
这时要注意,我们要保持在/ci-scripts/yaml_files/5g_rfsimulator目录下。等待一会后,用docker-compose ps -a命令检查,如下图新增加了rfsim5g-oai-gnb ,和核心网原来的几个容器全部容易都进入healthy状态后说明OAI 5G基站部署成功。
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d oai-gnb
rfsim5g-oai-nrf is up-to-date
rfsim5g-mysql is up-to-date
rfsim5g-oai-amf is up-to-date
rfsim5g-oai-smf is up-to-date
rfsim5g-oai-spgwu is up-to-date
rfsim5g-oai-ext-dn is up-to-date
Creating rfsim5g-oai-gnb ... done
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------
rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
rfsim5g-oai-amf python3 /openair-amf/bin/e ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp
rfsim5g-oai-ext-dn /bin/bash -c iptables -t ... Up (healthy)
rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy)
rfsim5g-oai-nrf python3 /openair-nrf/bin/e ... Up (healthy) 80/tcp, 9090/tcp
rfsim5g-oai-smf python3 /openair-smf/bin/e ... Up (healthy) 80/tcp, 8080/tcp, 8805/udp
rfsim5g-oai-spgwu python3 /openair-spgwu-tin ... Up (healthy) 2152/udp, 8805/udp
此时我们可以登录到AMF网元容器,查看到已经有一台gNB OAI 5G基站注册成功,则说明工作正常。
[2023-03-03T12:18:54.149445] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
[2023-03-03T12:18:54.149447] [AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------|
[2023-03-03T12:18:54.149449] [AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN |
[2023-03-03T12:18:54.149454] [AMF] [amf_app] [info ] | 1 | Connected | 0xe000 | gnb-rfsim | 208, 99 |
[2023-03-03T12:18:54.149456] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
同样,也是先部署,过一会后再查看rfsim5g-oai-nr-ue容器状态,最后登录核心网AMF网元查看是否UE注册成功。
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d oai-nr-ue
rfsim5g-oai-nrf is up-to-date
rfsim5g-mysql is up-to-date
rfsim5g-oai-amf is up-to-date
rfsim5g-oai-smf is up-to-date
rfsim5g-oai-spgwu is up-to-date
rfsim5g-oai-ext-dn is up-to-date
rfsim5g-oai-gnb is up-to-date
Creating rfsim5g-oai-nr-ue ... done
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose ps -a
Name Command State Ports
-------------------------------------------------------------------------------------------------
rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
rfsim5g-oai-amf python3 /openair-amf/bin/e ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp
rfsim5g-oai-ext-dn /bin/bash -c iptables -t ... Up (healthy)
rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy)
rfsim5g-oai-nr-ue /opt/oai-nr-ue/bin/entrypo ... Up (healthy)
rfsim5g-oai-nrf python3 /openair-nrf/bin/e ... Up (healthy) 80/tcp, 9090/tcp
rfsim5g-oai-smf python3 /openair-smf/bin/e ... Up (healthy) 80/tcp, 8080/tcp, 8805/udp
rfsim5g-oai-spgwu python3 /openair-spgwu-tin ... Up (healthy) 2152/udp, 8805/udp
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker logs rfsim5g-oai-amf
[2023-03-03T12:23:34.150715] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
[2023-03-03T12:23:34.150718] [AMF] [amf_app] [info ] |----------------------------------------------------gNBs' information-------------------------------------------|
[2023-03-03T12:23:34.150720] [AMF] [amf_app] [info ] | Index | Status | Global ID | gNB Name | PLMN |
[2023-03-03T12:23:34.150727] [AMF] [amf_app] [info ] | 1 | Connected | 0xe000 | gnb-rfsim | 208, 99 |
[2023-03-03T12:23:34.150731] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
[2023-03-03T12:23:34.150732] [AMF] [amf_app] [info ]
[2023-03-03T12:23:34.150734] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
[2023-03-03T12:23:34.150735] [AMF] [amf_app] [info ] |----------------------------------------------------UEs' information--------------------------------------------|
[2023-03-03T12:23:34.150737] [AMF] [amf_app] [info ] | Index | 5GMM state | IMSI | GUTI | RAN UE NGAP ID | AMF UE ID | PLMN |Cell ID|
[2023-03-03T12:23:34.150743] [AMF] [amf_app] [info ] | 1| 5GMM-REGISTERED| 208990100001100| | 1971775486| 1| 208, 99 |14680064|
[2023-03-03T12:23:34.150746] [AMF] [amf_app] [info ] |----------------------------------------------------------------------------------------------------------------|
登录到终端容器rfsim5g-oai-nr-ue 的终端后,运行ping www.baidu.com。我们发现终端已经可以通过UPF访问internet。说明终端数据面已经通信正常。
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker exec -it rfsim5g-oai-nr-ue /bin/bash
root@8d28ed142b4e:/opt/oai-nr-ue# ping www.baidu.com
PING www.a.shifen.com (180.101.50.188) 56(84) bytes of data.
64 bytes from 180.101.50.188: icmp_seq=1 ttl=52 time=13.2 ms
64 bytes from 180.101.50.188: icmp_seq=2 ttl=52 time=12.8 ms
^C
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 2003ms
rtt min/avg/max/mdev = 12.811/13.015/13.219/0.204 ms
或者用iperf来进行打流测试,先用ping得到ping.online.net的iperf公网服务器的IP地址,再用iperf直接打流。
root@8d28ed142b4e:/opt/oai-nr-ue# ping ping.online.net
PING ping.online.net (62.210.18.40) 56(84) bytes of data.
64 bytes from ping.online.net (62.210.18.40): icmp_seq=1 ttl=51 time=204 ms
^C
--- ping.online.net ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
oot@8d28ed142b4e:/opt/oai-nr-ue# iperf -c 62.210.18.40 -n 100k -t 10
------------------------------------------------------------
Client connecting to 62.210.18.40, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.71.150 port 41510 connected with 62.210.18.40 port 5001
write failed: Broken pipe
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 7.8 sec 31.1 MBytes 33.5 Mbits/sec
看到所有容器都被停止,并且OAI的二个网桥被删除后,就说明各个端到端的部署已经被成功停止。
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose down
Stopping rfsim5g-oai-nr-ue ... done
Stopping rfsim5g-oai-gnb ... done
Stopping rfsim5g-oai-ext-dn ... done
Stopping rfsim5g-oai-spgwu ... done
Stopping rfsim5g-oai-smf ... done
Stopping rfsim5g-oai-amf ... done
Stopping rfsim5g-mysql ... done
Stopping rfsim5g-oai-nrf ... done
Removing rfsim5g-oai-nr-ue ... done
Removing rfsim5g-oai-gnb ... done
Removing rfsim5g-oai-ext-dn ... done
Removing rfsim5g-oai-spgwu ... done
Removing rfsim5g-oai-smf ... done
Removing rfsim5g-oai-amf ... done
Removing rfsim5g-mysql ... done
Removing rfsim5g-oai-nrf ... done
Removing network rfsim5g-oai-public-net
Removing network rfsim5g-oai-traffic-net
注意,只要你
1)进入的部署脚本和配置的目录更换成scripts/yaml_files/5g_f1_rfsimulator。
2)并且在开始部署OAI 5G基站这一步,
把命令
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d oai-gnb
换成以下命令则可(分别部署CU和DU)
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d oai-cu
xxx@xxx-pc:~/ci-scripts/yaml_files/5g_rfsimulator$ sudo docker-compose up -d oai-du
其它全部都不变。