基于docker容器的,OAI 5G全栈部署方案 (OAI 5G核心网 + OAI 5G接入网 + OAI 5G终端 + RF模拟器)

本文目录

  • 一,部署准备:
  • 二,部署示意图
  • 三,下载或者编译各个网元的容器镜像docker images
  • 四,下载部署用的配置与脚本文件
  • 五,部署OAI 5G核心网
  • 六,开始部署OAI 5G基站
  • 七,开始部署5G终端
  • 八,验证终端已经可以通过OAI 5G基站/核心网去访问internet
  • 九,停止整个端到端部署
  • 十,如果你要部署CU/DU分离的gNB

本文描述的是OAI官方支持的独立接入部署方案,这是一个基于docker容器的,OAI 5G全栈部署方案。
在这个方案中,包含了OAI 5G核心网、OAI 5G接入网、OAI 5G终端和RF模拟器。完成此方案部署后,可以基于些方案进行5G端到端测试方案和各种场景的测试与研究。

一,部署准备:

  • 已经正确安装ubuntu18.04或者更新的ubuntu系统
  • 在系统上正确安装了docker和docker-compose
  • 已经安装python3.9或以上版本
  • 已经安装git软件
  • ubuntu系统能正常访问网络

具体可以参照部署OAI软件前的准备工作一文。

二,部署示意图

如下图,本端到端的独立接入部署方案,主要由以下三大网元构成,每个网元由一个或者多个不同功能的子网元构成。

  • OAI 5G 核心网
    • mysql
    • oai-nrf
    • oai-amf
    • oai-smf
    • oai-spgwu
    • oai-ext-dn
  • OAI 5G 接入网基站
    • oai-gnb
  • OAI 5G 终端
    • oai-nr-ue
      基于docker容器的,OAI 5G全栈部署方案 (OAI 5G核心网 + OAI 5G接入网 + OAI 5G终端 + RF模拟器)_第1张图片
      注意,这个部署方案中,我们使用了RF模拟器(以下称射频仿真器),RF模拟器是OAI 5G RAN项目的一个子项目,这个项目又称为L1仿真框架。这个项目是为了在没有射频卡的情况下进行功能测试,引入了射频仿真器, 射频仿真器使用基于TCP/IP的软件通信代替了射频卡。使得在没有实时时钟限制的情况下OAI 5G基站和OAI 用户终端可以通过射频接口相互通信。I/Q 采样数据可以通过一个无线信道模拟器进行传输。射频仿真器已经支持了多入多出技术(MIMO)。

三,下载或者编译各个网元的容器镜像docker images

各个网元的容器镜像docker images保存在docker hub网站上。

  1. 登录docker-hub
sudo docker login
  1. 下载各个网元的容器镜像docker images
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
  1. 退出登录
sudo docker logout

四,下载部署用的配置与脚本文件

使用http或者git从oai官方代码托管网站下载penairinterface5g/ci-scripts整个目录以及目录下所有文件与目录。
基于docker容器的,OAI 5G全栈部署方案 (OAI 5G核心网 + OAI 5G接入网 + OAI 5G终端 + RF模拟器)_第2张图片

五,部署OAI 5G核心网

注意 ,一定要进入/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    

六,开始部署OAI 5G基站

这时要注意,我们要保持在/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 ] |----------------------------------------------------------------------------------------------------------------|

七,开始部署5G终端

同样,也是先部署,过一会后再查看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 ] |----------------------------------------------------------------------------------------------------------------|

八,验证终端已经可以通过OAI 5G基站/核心网去访问internet

登录到终端容器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

十,如果你要部署CU/DU分离的gNB

注意,只要你
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

其它全部都不变。

你可能感兴趣的:(5G,开源软件,5G,docker,容器)