oai core network starts multi-slice automatic generation method

Introduction

Starting a slice requires:

  1. Core network side: Start the core network yaml file and related configuration files (datebase conf healthscripts) corresponding to the server of the business (such as)
  2. Base station side: The virtual machine starts the yaml file of ueransim and related configuration proxy program (ueransim-5gc-proxy.py)
  3. Connection at both ends: One service corresponds to one network cable, and different slices of the same service run on the same network cable

Network configuration design scheme:

Core network side

  • Core network side: There are three IP addresses used in a slice yaml file. Taking slice 1 as an example, 192.168.10.xxx 192.168.12.xxx 192.168.13.xxx are used. Therefore, each core network needs to allocate three network segments.
  • The following distribution can be made: each slice is divided into three network segments, and slices of the same service type use continuous network segments.
  • For example: In the following allocation, each service can start 20 slices, and there is an association between the slice id and the corresponding network segment with id*4=network segment
business type slice id Slicing uses ip
video business 1 192.168.4.xx 192.168.6.xx 192.168.7.xx
video business 2 192.168.8.xx 192.168.10.xx 192.168.11.xx
video business 3 192.168.12.xx 192.168.14.xx 192.168.15.xx
video business 19 192.168.76.xx 192.168.78.xx 192.168.79.xx
ftp business 20 192.168.80.xx 192.168.82.xx 192.168.83.xx
ftp business 21 192.168.84.xx 192.168.86.xx 192.168.87.xx
ftp business 39 192.168.156.xx 192.168.158.xx 192.168.159.xx
Train control business 40 192.168.160.xx 192.168.162.xx 192.168.163.xx
Train control business 41 192.168.164.xx 192.168.166.xx 192.168.167.xx
Train control business 59 192.168.236.xx 192.168.238.xx 192.168.239.xx
  • The current configuration of the core network side network of the three service types is as follows:
business type Physical network port ubuntu network port ip
video business NIC3 ensxx 192.168.16.6
FTP business NIC4 ensxx 192.168.26.6
Train control business NIC2 ensxx 192.168.36.6

(!!! In order to avoid ip conflicts, subsequent changes should be required)
For example:

business type Physical network port ubuntu network port ip
video business NIC3 ensxx 192.168.241.241
FTP business NIC4 ensxx 192.168.242.242
Train control business NIC2 ensxx 192.168.243.243

base station side

  • Each time a slice is started on the base station side, a virtual machine is required, and each virtual machine needs to be configured with the network card it uses and the corresponding ip

  • For virtual machines of different business types, open different network ports. Each virtual machine has three network ports, which are used for Internet communication business side communication and core network side communication.

  • For the same type of business, use the same network port configuration, but set different ip

    1. Internet communication ip setting: use dhcp to automatically assign
    2. Communication ip setting on the core network side: To transmit data with the corresponding service port on the core network side, it needs to be on the same network segment, such as video service, it needs to be on the 192.168. Assign the same as the id, for example, the ip of slice 1 is set to 192.168.16.1
    3. Service-side communication ip setting: the currently used network segment is 192.168.19.xxx. In order to avoid conflicts, the network segment needs to be reconfigured and correspond to the slice ID one by one. For example, it is allocated to the 192.168.251.xxx network segment
  • For example:

business type slice id Corresponding core network ip Core network side communication ip business side communication ip
video business 1 192.168.4.xx 192.168.6.xx 192.168.7.xx 192.168.241.1 192.168.251.1
video business 2 192.168.8.xx 192.168.10.xx 192.168.11.xx 192.168.241.2 192.168.251.2
video business 3 192.168.12.xx 192.168.14.xx 192.168.15.xx 192.168.241.3 192.168.251.3
video business 19 192.168.76.xx 192.168.78.xx 192.168.79.xx 192.168.241.19 192.168.251.19
ftp business 20 192.168.80.xx 192.168.82.xx 192.168.83.xx 192.168.242.20 192.168.251.20
ftp business 21 192.168.84.xx 192.168.86.xx 192.168.87.xx 192.168.242.21 192.168.251.21
ftp business 39 192.168.156.xx 192.168.158.xx 192.168.159.xx 192.168.242.39 192.168.251.39
Train control business 40 192.168.160.xx 192.168.162.xx 192.168.163.xx 192.168.243.40 192.168.251.40
Train control business 41 192.168.164.xx 192.168.166.xx 192.168.167.xx 192.168.243.41 192.168.251.41
Train control business 59 192.168.236.xx 192.168.238.xx 192.168.239.xx 192.168.243.59 192.168.251.59

business side

  • Service end: When the service end accesses, it needs to be consistent with the network segment on the base station side. According to the above configuration, it needs to use the 192.168.251.xxx network segment, so it can be allocated from 192.168.251.101, which also has a corresponding relationship with the slice id
business type slice id Corresponding core network ip Core network side communication ip business side communication ip business end ip
video business 1 192.168.4.xx 192.168.6.xx 192.168.7.xx 192.168.241.1 192.168.251.1 192.168.251.101
video business 2 192.168.8.xx 192.168.10.xx 192.168.11.xx 192.168.241.2 192.168.251.2 192.168.251.102
video business 3 192.168.12.xx 192.168.14.xx 192.168.15.xx 192.168.241.3 192.168.251.3 192.168.251.103
video business 19 192.168.76.xx 192.168.78.xx 192.168.79.xx 192.168.241.19 192.168.251.19 192.168.251.119
ftp业务 20 192.168.80.xx 192.168.82.xx 192.168.83.xx 192.168.242.20 192.168.251.20 192.168.251.120
ftp业务 21 192.168.84.xx 192.168.86.xx 192.168.87.xx 192.168.242.21 192.168.251.21 192.168.251.121
ftp业务 39 192.168.156.xx 192.168.158.xx 192.168.159.xx 192.168.242.39 192.168.251.39 192.168.251.139
列控业务 40 192.168.160.xx 192.168.162.xx 192.168.163.xx 192.168.243.40 192.168.251.40 192.168.251.140
列控业务 41 192.168.164.xx 192.168.166.xx 192.168.167.xx 192.168.243.41 192.168.251.41 192.168.251.141
列控业务 59 192.168.236.xx 192.168.238.xx 192.168.239.xx 192.168.243.59 192.168.251.59 192.168.251.159

业务端口号

  • 在核心网侧,所有业务的sever都运行在一台机器上,需要对业务的端口号进行分配,并且与切片id进行对应
  • 后续同一切片中需要启动多个业务时,同一切片会使用到多个端口号
  • 可以进行如下分配:
业务类型 切片id 对应核心网ip 核心网侧通信ip 业务侧通信ip 业务端ip 业务端口号
视频业务 1 192.168.4.xx 192.168.6.xx 192.168.7.xx 192.168.241.1 192.168.251.1 192.168.251.101 2001 3001 4001…
视频业务 2 192.168.8.xx 192.168.10.xx 192.168.11.xx 192.168.241.2 192.168.251.2 192.168.251.102 2002 3002 4002…
视频业务 3 192.168.12.xx 192.168.14.xx 192.168.15.xx 192.168.241.3 192.168.251.3 192.168.251.103 2003 3003 4003…
视频业务 19 192.168.76.xx 192.168.78.xx 192.168.79.xx 192.168.241.19 192.168.251.19 192.168.251.119 2019 3019 4019…
ftp业务 20 192.168.80.xx 192.168.82.xx 192.168.83.xx 192.168.242.20 192.168.251.20 192.168.251.120 2020 3020 4020…
ftp业务 21 192.168.84.xx 192.168.86.xx 192.168.87.xx 192.168.242.21 192.168.251.21 192.168.251.121 2021 3021 4021…
ftp业务 39 192.168.156.xx 192.168.158.xx 192.168.159.xx 192.168.242.39 192.168.251.39 192.168.251.139 2039 3039 4039…
列控业务 40 192.168.160.xx 192.168.162.xx 192.168.163.xx 192.168.243.40 192.168.251.40 192.168.251.140 2040 3040 4040…
列控业务 41 192.168.164.xx 192.168.166.xx 192.168.167.xx 192.168.243.41 192.168.251.41 192.168.251.141 2041 3004 4041…
列控业务 59 192.168.236.xx 192.168.238.xx 192.168.239.xx 192.168.243.59 192.168.251.59 192.168.251.159 2059 3059 4059…

后端实现途径

所有的目的都是为了在qt前端界面点击按钮,可以控制切片的自动生成。

核心网侧

  • 在核心网有两部分,一部分是OAI核心网,一部分是业务的sever
  • 有两种核心网生成方式,一种是事先将所有可能启动的核心网文件配置好,一种是根据切片id+核心网模板生成配置文件
  • 目前前者实现较容易:将三种切片的配置文件复制并配置好
  • 后者实现:三个业务模板文件,生成对应业务切片时根据业务模板,复制文件夹(包含启动核心网所需的所有文件),然后根据切片id更改其中一些文件的内容适配切片(核心网yaml文件的:ip、容器名、docker-compose服务名 ; 业务sever的ip与端口号)。

基站侧

  • 在基站侧有如下几个部分: 切片使用的虚拟机, ueransim基站, 业务代理proxy
  • 对于虚拟机,有两种可能,一种是对应每一个切片实现构建好虚拟机,提前开启虚拟机,这样的话虚拟机内部的所有配置,包括 ueransim基站和 业务代理proxy等,都可以提前配置好,这是符合逻辑的。 另一种可能是在核心网侧要启动切片后,基站侧根据对应业务的模板,复制一个新的虚拟机,并且自动配置虚拟机,以及其中的 ueransim基站与业务代理proxy。
  • 关于使用虚拟机而不是docker部署基站的原因:经过大量的尝试,一个机器中使用ueransim容器接入另一个机器上的OAI核心网只有使用host网络模式时可以成功完成用nr-binder进行通信,而这样一个虚拟机中只能部署使用一个ueransim,所以就形成了为了部署使用一个ueransim必须建立一个虚拟机的情况。(!!!如果这个问题能够解决,可以在一个虚拟机中部署使用多个ueransim,系统的性能将大大优化)
  • 目前使用第一种可能,实现难度较低,但对机器性能消耗较大!
  • 实现细节: 提前创建好虚拟机,按照网络配置设置好虚拟机的网口及ip,配置好ueransim文件(ueransim的yaml文件,文件路径命名)与proxy代理文件(代理的ip)

业务侧

  • 业务侧根据要接入的切片设置好ip和端口号就可以

前后端交互

  • 目前前端使用QT实现,使用到mysql数据库进行大部分的数据交互,后端代码大部分使用python编写。
  • 与前端相关联的后端代码代码主要分为: 切片启动代码 (在前端点击按钮,根据数据库内容启动对应的切片),状态监测代码(监测切片的状态实时反馈到数据库,如 cpu资源 存储资源 带宽资源 ) , 切片调试代码(在切片启动后,对切片进行适当的调试,如 业务停止 资源重分配 ueransim重启 切片重启)

以切片id为中心的变量组设计

  • 上面已经以切片id为中心,设计了如下相关变量:
    1. 业务类型(slice_type):

    2. 核心网oai网段(ip_oai):

    3. 核心网access网段(ip_access):

    4. 核心网core网段(ip_core):

    5. 基站的核心网侧通信ip(local_link_ngap_gtp_ip):

    6. 基站与核心网amf通信的网段(ip_oai):

    7. 基站与业务侧通信的ip():

    8. 业务端的ip():

    9. 业务的端口():

    10. 核心网网元使用的内存():

    11. 核心网网元使用的cpu():

操作笔记

手动创建新核心网yaml文件与ueransimyaml文件

  • 使用vs2022辅助修改,如下以slice40新建slice41
  1. 复制slice40文件夹,重命名为slice41,并对三个yaml文件进行重命名
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  2. 修改docker-compose-basic-vpp-nrf-slice41.yml
    a.替换所有slice40slice41
    b.替换所有192.168.160.192.168.164.
    c.替换所有192.168.162192.168.166
    d.替换所有192.168.163192.168.167
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  3. 修改ueransim-slice41.yaml
    a.修改所有slice40slice41
    b.修改所有192.168.241.40192.168.241.41
    c.修改所有192.168.160.132192.168.164.132

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

  1. 修改ueransim-slice41-local.yaml
    a.修改所有slice40slice41
    b.修改所有192.168.160.141192.168.164.141
    c.修改所有192.168.160.132192.168.164.132
    d.修改所有192.168.160.132192.168.164.132
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

使用python代码自动创建核心网yaml文件与ueransimyaml文件

Guess you like

Origin blog.csdn.net/qq_41224270/article/details/131191422