This guide is intended to give all the considerations and descriptors needed to deploy a 5G Core, a gnbsim to emulate access (gNB and UE) and a external network to test. This guide also includes a PNF VyOS Router and its configuration to ensure the connectivity between elements in this architecture.
## Architecture
This architecture considers:
![architecture](img/architecture.png)
- gnbsim: the open source software to emulate gNB and UE, it's used to connect a gNB and register a UE to the 5G Core. In this case we're deploying it as a VNF.
- 5gcore: The open source project created by OAI (Open Air Interface), it deploys the 5G SA core including NF like NRF, AMF, SMF, UDR, UDM, UPF. In this case we're going to deploy it as a CNF.
- ext-dn: this is the external network we're implementing to test the 5G core, it implements an iperf server to test from the UE. In this case we're deploying it as a VNF.
## Preparation
### Infrastructure preparation
#### Openstack
Two networks should be defined, one for 5gcore and other for communication between access and external-network:
- 5g-core-cp: 192.168.18.0/24 (could be shorter), gateway and port-security in the VMs must be disabled
- 5g-inter-vm: 192.168.1.0/29, gateway and port-security in the VMs must be disabled
#### Kubernetes cluster
Since 5G Core is going to be deployed on a K8s cluster, take note of what you need in your K8s Cluster first:
1. K8s cluster must have multus and macvlan installed since 5G core needs PODs with two interfaces.
2. Worker nodes must have one additional interface (ens8) in the network 192.168.18.0/24 (could be shorter), for example worker01 could have 192.168.18.3, worker02 could have 192.168.18.4 and so on.
#### PNF
VyOS Router will provide connectivity. It must have 3 interfaces:
- One should be the default for 5g-core-cp network: 192.168.18.129
- One should be the default for 5g-inter-vm network: 192.168.1.1
- One for management, this depends on the infra and will be used to connect from OSM.
You could use the infra.sh script to create PDU in OSM. You also have the pdu.yaml file, make sure to put there the management IP you have for your VyOS VM. Specific configuration for this deployment will be performed from OSM later.
## Launching the network service (NS)
Make sure that VNF/KNF packages are already onboarded in OSM (osm nfpkg-list), if not, you can create them:
```
osm nfpkg-create gnbsim_vnf
osm nfpkg-create ext-dn_vnf
osm nfpkg-create oai_knf
osm nfpkg-create vyos_ns
```
Make sure that NS package is already onboarded in OSM (osm nspkg-list), if not, you can create it:
```
osm nspkg-create 5gcore_ns
```
Then you have the 5g_core.yaml file which passes additional configuration to the NS, in this case:
- ssh_keys: this ssh key is of the server we'll be using to ssh to the VNF gnbsim and ext-dn. Another option is using cloud-init to set a password.
- k8s-namespace: a specific namespace is used to deploy the 5G Core in K8s cluster.
- vimAccountId: a different VIM is used to deploy gnbsim and ext-server.