Commit 0252a426 authored by sergio-tarazona's avatar sergio-tarazona
Browse files

new oai-helm procedure created

parent 537efb33
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
ssh_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrcvnKVl3o2cN7YFmajQ2RqGGRVgL0OhdkQCXpehJSL/7rxD0rURlUCipqAvqzDQ0UvfPDxWKOJSxhZRY0SCOlb4W6WNBW7hTE31AjS0YtH/JUimc99567y3F1937sy3nzt4yAlIAoI3y7ZZKJI4EP29A47TZ2WbAuQhI/TsDbJmNpXLB0XtBvzTMJuPffwJep0nWp2nYyv21NBBk5rQF6yTi2dDJ3DwcatfaIv5o0UeI07mbyEmxV2hVrIxPKv3KG65dBvbvF+sjdFMp0tJUfqDn/FJso+jqlwmmvrtk+8bmhL7vzzMyUXyfCjUV2G+u0GOPjl3Q+rnxjCsl2yEib
k8s-namespace: oai
vnf:
- member-vnf-index: gnbsim
  vimAccountId: b0fe741c-37d9-4f42-bce7-b163122a9790
- member-vnf-index: ext-server
  vimAccountId: 74c9e008-28ce-45c4-9634-9aec3177fb76
+59 −0
Original line number Diff line number Diff line
nsd:
  nsd:
  - description: NS with 1 VNF for gnbsim, 1 VNF for ext server, 1 PNF for VyOS router and 1 KNF for 5G OAI Core
    df:
    - id: default-df
      vnf-profile:
      - id: gnbsim
        virtual-link-connectivity:
        - constituent-cpd-id:
          - constituent-base-element-id: gnbsim
            constituent-cpd-id: vnf-mgmt-ext
          virtual-link-profile-id: mgmtnet
        - constituent-cpd-id:
          - constituent-base-element-id: gnbsim
            constituent-cpd-id: vnf-internal-ext
            ip-address: 192.168.1.5
          virtual-link-profile-id: datanet
        vnfd-id: gnbsim-vnf
      - id: ext-server
        virtual-link-connectivity:
        - constituent-cpd-id:
          - constituent-base-element-id: ext-server
            constituent-cpd-id: vnf-mgmt-ext
          virtual-link-profile-id: mgmtnet
        - constituent-cpd-id:
          - constituent-base-element-id: ext-server
            constituent-cpd-id: vnf-internal-ext
            ip-address: 192.168.1.6
          virtual-link-profile-id: datanet
        vnfd-id: ext-dn-vnf
      - id: vyos-pnf
        virtual-link-connectivity:
        - constituent-cpd-id:
          - constituent-base-element-id: vyos-pnf
            constituent-cpd-id: gateway_public-ext
          virtual-link-profile-id: mgmtnet
        vnfd-id: vyos_pnf
      - id: 5gcore_knf
        virtual-link-connectivity:
        - constituent-cpd-id:
          - constituent-base-element-id: 5gcore_knf
            constituent-cpd-id: mgmt-ext
          virtual-link-profile-id: mgmtnet
        vnfd-id: oai_knf
    id: 5gcore-ns
    name: 5gcore-ns
    version: 1.0
    virtual-link-desc:
    - id: mgmtnet
      mgmt-network: true
      vim-network-name: osm-ext
    - id: datanet
      vim-network-name: 5g-inter-vm
    vnfd-id:
    - gnbsim-vnf
    - oai_knf
    - ext-dn-vnf
    - vyos_pnf

oai-helm/README.md

0 → 100644
+113 −0
Original line number Diff line number Diff line
# OAI 5G Core deployment using helm-based EE

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.
```
ssh_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrcvnKVl3o2cN7YFmajQ2RqGGRVgL0OhdkQCXpehJSL/7rxD0rURlUCipqAvqzDQ0UvfPDxWKOJSxhZRY0SCOlb4W6WNBW7hTE31AjS0YtH/JUimc99567y3F1937sy3nzt4yAlIAoI3y7ZZKJI4EP29A47TZ2WbAuQhI/TsDbJmNpXLB0XtBvzTMJuPffwJep0nWp2nYyv21NBBk5rQF6yTi2dDJ3DwcatfaIv5o0UeI07mbyEmxV2hVrIxPKv3KG65dBvbvF+sjdFMp0tJUfqDn/FJso+jqlwmmvrtk+8bmhL7vzzMyUXyfCjUV2G+u0GOPjl3Q+rnxjCsl2yEib
k8s-namespace: oai
vnf:
- member-vnf-index: gnbsim
  vimAccountId: b0fe741c-37d9-4f42-bce7-b163122a9790
- member-vnf-index: ext-server
  vimAccountId: 74c9e008-28ce-45c4-9634-9aec3177fb76
```
The command to instantiate this NS is:
```
osm ns-create --ns_name 5g --nsd_name 5gcore-ns --vim_account whitecloud --config_file 5g_params.yaml
```

## Starting services from OSM

Since Helm-based EE is used to create primitives for day-1 and day-2, we're going to use the GUI to start external server and gnbsim services:

### Starting external server service

First log in OSM and find the NS created, then click in "Action" and click in "Exec Primitive" 

![architecture](img/login.png)

In the opened window select "VNF Level Primitive", "ext-server", "ext_dn_up", "file" and type "ext-dn-oai", then click in Execute:

![architecture](img/ext-server.png)

### Starting gnbsim service

First log in OSM and find the NS created, then click in "Action" and click in "Exec Primitive" 

![architecture](img/login.png)

In the opened window select "VNF Level Primitive", "gnbsim", "gnbsim_up", "file" and type "gnbsim", then click in Execute:

![architecture](img/gnbsim.png)

With these two primitives executed we're ready to test traffic.

## Testing traffic

1. Using management IP assigned to the external server proceed to ssh to the instance (remember to do it from the server you have copied the ssh keys)
2. Execute the iperf command:
    ```
    docker exec -ti oai-ext-dn iperf3 -s
    ```  
3. Using the management IP assigned to gnbsim proceed to ssh to the instance (remember to do it from the server you have copied the ssh keys)
    ```
    docker exec -ti gnbsim iperf3 -c 192.168.70.135 -B 12.1.1.2
    ```
4. You should be able to see traffic going from gnbsim to external server passing through 5G Core.
 No newline at end of file
+16 KiB

File added.

No diff preview for this file type.

+130 −0
Original line number Diff line number Diff line
vnfd:
  description: ext-dn VNF with 2 networks attached
  df:
  - id: default-df
    instantiation-level:
    - id: default-instantiation-level
      vdu-level:
      - number-of-instances: 1
        vdu-id: ext-dn-VM
    vdu-profile:
    - id: ext-dn-VM
      min-number-of-instances: 1
    lcm-operations-configuration:
      operate-vnf-op-config:
        day1-2:
        - config-primitive:
          - execution-environment-primitive: ext_dn_up
            execution-environment-ref: ext-dn
            name: ext_dn_up
            parameter:
            - data-type: STRING
              name: file
          - execution-environment-primitive: ext_dn_down
            execution-environment-ref: ext-dn
            name: ext_dn_down
            parameter:
            - data-type: STRING
              name: file    
          - execution-environment-primitive: send_command
            execution-environment-ref: ext-dn
            name: send_command
            parameter:
            - data-type: STRING
              name: file    
          config-access:
            ssh-access:
              default-user: ubuntu
              required: true
          execution-environment-list:
          - external-connection-point-ref: vnf-mgmt-ext
            helm-chart: eechart
            id: ext-dn
          id: ext-dn-vnf
          initial-config-primitive:
          - execution-environment-ref: ext-dn
            name: config
            parameter:
            - name: ssh-hostname
              value: <rw_mgmt_ip>
            - name: ssh-username
              value: ubuntu
            seq: 1
          - execution-environment-ref: ext-dn
            name: run_script
            parameter:
            - name: file
              value: install_docker.sh
            seq: 2  
          - execution-environment-ref: ext-dn
            name: copy_files
            parameter:
            - name: file
              value: docker-compose.yaml
            seq: 3
  ext-cpd:
  - id: vnf-mgmt-ext
    int-cpd:
      cpd: vdu-eth0-int
      vdu-id: ext-dn-VM
  - id: vnf-internal-ext
    int-cpd:
      cpd: vdu-eth1-int
      vdu-id: ext-dn-VM
  id: ext-dn-vnf
  mgmt-cp: vnf-mgmt-ext
  product-name: ext-dn-vnf
  sw-image-desc:
  - id: ubuntu20.04
    image: ubuntu20.04
    name: ubuntu20.04
  - id: ubuntu20.04-azure
    name: ubuntu20.04-azure
    image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest
    vim-type: azure
  - id: ubuntu20.04-gcp
    name: ubuntu20.04-gcp
    image: ubuntu-os-cloud:image-family:ubuntu-2004-lts
    vim-type: gcp
  vdu:
  - id: ext-dn-VM
    int-cpd:
    - id: vdu-eth0-int
      virtual-network-interface-requirement:
      - name: vdu-eth0
        position: 0
        virtual-interface:
          type: PARAVIRT
    - id: vdu-eth1-int
      port-security-enabled: false
      virtual-network-interface-requirement:
      - name: vdu-eth1
        position: 1
        virtual-interface:
          type: PARAVIRT
    - id: vdu-eth2-int
      virtual-network-interface-requirement:
      - name: vdu-eth2
        position: 2
        virtual-interface:
          type: PARAVIRT
    name: ext-dn-VM
    supplemental-boot-data:
      boot-data-drive: true
    sw-image-desc: ubuntu20.04
    alternative-sw-image-desc:
    - ubuntu20.04-azure
    - ubuntu20.04-gcp
    virtual-compute-desc: ext-dn-VM-compute
    virtual-storage-desc:
    - ext-dn-VM-storage
  version: 1.0
  virtual-compute-desc:
  - id: ext-dn-VM-compute
    virtual-cpu:
      num-virtual-cpu: 1
    virtual-memory:
      size: 4.0
  virtual-storage-desc:
  - id: ext-dn-VM-storage
    size-of-storage: 20
Loading