blob: 47b163a8fd205a5a5da86aaba5a43bfcff172458 [file] [log] [blame]
Ajay Lotan Thakur05ce5ce2022-09-25 20:36:16 -07001..
2 SPDX-FileCopyrightText: © 2022 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
5.. _deployment_upf_guide:
6
7UPF Deployment Guide
8====================
9
10- Each Site has one or more UPFs dedicated for use case
Ajay Lotan Thakur5e1c42e2022-11-03 22:36:44 -070011- Each Slice supports only 1 UPF
Ajay Lotan Thakur05ce5ce2022-09-25 20:36:16 -070012- UPFs can be added during runtime and UP/CP form PFCP association
13- Edges can run on different versions of UPF. Changes are always backward compatible
14- Option to Install only 4G or 5G or both
15- Multiple UPF (user plane function) options available to meet the needs of different applications BESS-UPF, P4-UPF
16- Many UPFs can connect to same control plane. Control Plane selects UPF based on
17 various criteria - DNN/Slice (5G), Apn, IMSI, ULI(4G), Slice IDs
18- IP address allocation supported at Control plane and also at UPF
Ajay Lotan Thakur5e1c42e2022-11-03 22:36:44 -070019- UPF Attach/detach to SD-Core. UPF Pools created based on enterprise need.
20
21Option1: AF_PACKET Mode UPF
Marikkannu, Sureshc85fb3d2023-09-29 08:25:37 -070022----------------------------
Ajay Lotan Thakur5e1c42e2022-11-03 22:36:44 -070023
24- Refer Aether in a box (AIAB) for this mode.
25- AIAB has all default values and its good example of how to use AF_PACKET mode
26- If performance is not the concern then this option should be considered
27- AF_PACKET mode is easy to deploy and does not need to do extra installations on K8s node
28
29
30Option2: SRIOV and DPDK enabled UPF
Marikkannu, Sureshc85fb3d2023-09-29 08:25:37 -070031------------------------------------
32Please follow the below procedure to bring up UPF in DPDK mode with SRIOV.
Ajay Lotan Thakur5e1c42e2022-11-03 22:36:44 -070033
Marikkannu, Sureshc85fb3d2023-09-29 08:25:37 -070034Pre-requisite:
35''''''''''''''
36- As a pre-requisite please make sure virtualization and VT-d parameters are enabled in BIOS.
37
38- make sure enough hugepage memory allocated, iommu enabled. These changes can be made by updating
39 below parameter in /etc/default/grub as follows,
40
41 .. code-block::
42
43 GRUB_CMDLINE_LINUX="intel_iommu=on iommu=pt default_hugepagesz=1G hugepagesz=1G hugepages=32 transparent_hugepage=never"
44
45 Note: Number of hugepages = 2 X No of UPF Instances
46
47 Once it is updated apply the changes by running below command,
48
49 .. code-block::
50
51 $sudo update-grub
52 $sudo reboot
53
54 You can verify the allocated hugepages using below command,
55
56 .. code-block::
57
58 curl https://raw.githubusercontent.com/DPDK/dpdk/main/usertools/dpdk-hugepages.py -O dpdk-hugepages.py
59
60 $chmod +x dpdk-hugepages.py
61 $./dpdk-hugepages.py -s
62 Node Pages Size Total
63 0 2048 2Mb 4Gb
64 1 2048 2Mb 4Gb
65
66 Hugepages mounted on /dev/hugepages
67
68step 1: Create VF devices and bind them to the vfio-pci driver
69'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
70- Create required VF devices as follows (In this example the PF interface used is "ens801f0")
71
72 .. code-block::
73
74 echo 2 > /sys/class/net/ens801f0/device/sriov_numvfs
75
76 Now retrieve the PCI address for the newly created VF devices using below command,
77
78 .. code-block::
79
80 ls -l /sys/class/net/ens801f0/device/virtfn*
81
82- Bind the VF devices to the vfio-pci driver as follows,
83
84 .. code-block::
85
86 curl https://raw.githubusercontent.com/ceph/dpdk/master/tools/dpdk-devbind.py -O dpdk-devbind.py
87 chmod +x dpdk-devbind.py
88
89 ./dpdk-devbind.py -b vfio-pci 0000:b1:01.0
90 ./dpdk-devbind.py -b vfio-pci 0000:b1:01.1
91
92
93step 2 - Install SRIOV device plugin
94''''''''''''''''''''''''''''''''''''
95- Install the required packages for kubernetes,
96
97 .. code-block::
98
99 cd aether-in-a-box
100 make node-prep
101
102- Download sriov-device-plugin.yaml and install,
103
104 .. code-block::
105
106 $wget https://github.com/opennetworkinglab/aether-configs/blob/main/sys/sriov-device-plugin/sriov-device-plugin.yaml
107 $kubectl apply -f sriov-device-plugin.yaml
108
109- Create the sriov-device-plugin-config.yaml file with below details and install,
110
111 .. code-block::
112
113 apiVersion: v1
114 kind: ConfigMap
115 metadata:
116 name: sriovdp-config
117 data:
118 config.json: |
119 {
120 "resourceList": [
121 {
122 "resourcePrefix": "intel.com",
123 "resourceName": "intel_sriov_vfio_access",
124 "selectors": {
125 "pfNames": ["ens801f0#0-1"],
126 "vendors": ["8086"],
127 "drivers": ["vfio-pci"]
128 }
129 },
130 {
131 "resourcePrefix": "intel.com",
132 "resourceName": "intel_sriov_vfio_core",
133 "selectors": {
134 "pfNames": ["ens801f0#2-3"],
135 "vendors": ["8086"],
136 "drivers": ["vfio-pci"]
137 }
138 }
139 ]
140 }
141
142 $kubectl apply -f sriov-device-plugin-config.yaml
143
144- Make sure that there are minimum 1 intel_sriov_vfio_access/intel_sriov_vfio_core resources available,
145
146 .. code-block::
147
148 $kubectl get nodes -o json | jq '.items[].status.allocatable'
149 {
150 "cpu": "144",
151 "ephemeral-storage": "222337451653",
152 "hugepages-1Gi": "32Gi",
153 "intel.com/intel_sriov_vfio_access": "1",
154 "intel.com/intel_sriov_vfio_core": "1",
155 "memory": "494544488Ki",
156 "pods": "110"
157 }
158
159step 3 - Deploy 5G core using AiaB
160'''''''''''''''''''''''''''''''''''
161
162Update sd-core-5g-values.yaml file parameters as follows (along with any other changes
163required with respect to the environment),
164
165 .. code-block::
166
167 diff --git a/sd-core-5g-values.yaml b/sd-core-5g-values.yaml
168 index 58232ad..1c8893d 100644
169 --- a/sd-core-5g-values.yaml
170 +++ b/sd-core-5g-values.yaml
171 @@ -224,7 +224,7 @@ omec-sub-provision:
172 omec-user-plane:
173 enable: true
174 resources:
175 - enabled: false
176 + enabled: true
177 images:
178 repository: "registry.opennetworking.org/docker.io/"
179 # uncomment below section to add update bess image tag
180 @@ -234,12 +234,13 @@ omec-user-plane:
181 config:
182 upf:
183 name: "oaisim"
184 + privileged: true
185 sriov:
186 - enabled: false #default sriov is disabled in AIAB setup
187 + enabled: true #default sriov is disabled in AIAB setup
188 hugepage:
189 - enabled: false #should be enabled if dpdk is enabled
190 + enabled: true #should be enabled if dpdk is enabled
191 #can be any other plugin as well, remember this plugin dictates how IP address are assigned.
192 - cniPlugin: macvlan
193 + cniPlugin: vfioveth
194 ipam: static
195 routes:
196 - to: ${NODE_IP}
197 @@ -247,12 +248,16 @@ omec-user-plane:
198 enb:
199 subnet: ${RAN_SUBNET} #this is your gNB network
200 access:
201 - iface: ${DATA_IFACE}
202 + resourceName: "intel.com/intel_sriov_vfio_access"
203 + ip: "192.168.252.3/24"
204 + gateway: "192.168.252.1"
205 core:
206 - iface: ${DATA_IFACE}
207 + resourceName: "intel.com/intel_sriov_vfio_core"
208 + ip: "192.168.250.3/24"
209 + gateway: "192.168.250.1"
210 cfgFiles:
211 upf.json:
212 - mode: af_packet #this mode means no dpdk
213 + mode: dpdk #this mode means no dpdk
214
215- Deploy the 5g-core (in the below case GNBSIM is disabled) as required,
216
217 .. code-block::
218
219 ENABLE_GNBSIM=false DATA_IFACE=ens801f0 CHARTS=latest make 5g-core
220
221 UPF will be deployed with DPDK now and you can verify the traffic using UERANSIM (or any preferred method). If you want to deploy the Aether with RoC then use below command,
222
223 .. code-block::
224
225 ENABLE_GNBSIM=false DATA_IFACE=ens801f0 CHARTS=latest make roc-5g-models 5g-core
226
227.. note::
228
229 - This option should be preferred if performance is utmost important
230 - Please refer to `UPF Installation Guide <https://docs.google.com/document/d/1-BT7XqVsL7ffBlD7aweYaScKDQH7Gv5tHKt-sJGuf6c/edit#>`_ guide for more details