blob: e5b91ae1d37a9b3d9eacd94bce41dde4f64a9f93 [file] [log] [blame]
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -07001..
2 SPDX-FileCopyrightText: © 2022 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
4
5.. _deployment_gnbsim_guide:
6
7gNBSim Deployment Guide
8========================
9
10gNBSim in AIAB mode with 2 interfaces
11```````````````````````````````````````
12
13- This is default mode of deployment for gNB Simulator
14- Multus cni needs to be enabled on cluster. Required for bess-upf & gNBSim
15- `make 5gc` will by default deploy gNB Simulator in this mode
16- One interface is used for user plane traffic towards UPF
17- Second interface is used to send traffic towards control plane (i.e. AMF).
18- UPF network & default gateway is provided in the override values.
19- Route to UPF network is added when POD comes up
20- defaultAs is configured per profile. This address is used to send data traffic during test
21
22.. note::
23 Multiple gNB's in one simulator instance need more changes in helm chart. This is pending work.
24
25To add UPF routes. Following is example of override values ::
26
27 config:
28 gnbsim:
29 gnb:
30 ip: 192.168.251.5/24 #user plane IP at gnb if 2 separate interface provided
31 singleInterface: false
32 networkTopo:
33 - upfAddr: "192.168.252.3/32"
34 upfGw: "192.168.251.1"
35
36
37.. image:: ../_static/images/Single-cluster_2_interface.jpg
38 :width: 700px
39
40gNB simulator running standalone with single interface
Vijaya Tiruveedulad15e8ac2022-10-26 22:43:45 +053041``````````````````````````````````````````````````````
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070042
43- Install gNB Simulator on any K8s cluster
44- Multus cni needs to be enabled for the K8s cluster where bess-upf runs
45- Make sure gNB Simulator can communicate with AMF & UPF
46- *TODO* - New Makefile target will deploy just 5G control plane
47- *TODO* - New Makefile target will deploy only gNB Simulator
48- Single interface is used for user plane traffic towards UPF & as well traffic towards AMF
49- defaultAs is configured per profile. This address is used to send data traffic during test
50- configure AMF address or FQDN appropriately
51
52.. note::
53 Multiple gNB's can not be simulated since only 1 gNB will be able to use 2152 port
54
55
56Following is example of override values ::
57
58 config:
59 gnbsim:
60 singleInterface: true
61 yamlCfgFiles:
62 gnb.conf:
63 configuration:
64 gnbs: # pool of gNodeBs
65 gnb1:
66 n3IpAddr: "POD_IP" # set if singleInterface is true
67
68.. image:: ../_static/images/Separate-cluster_Single_interface.jpg
69 :width: 700px
70
71gNBSim running standalone with 2 or more interfaces
72```````````````````````````````````````````````````
73
74- Install gNB Simulator on any K8s cluster
75- Multus cni needs to be enabled on cluster. Required for bess-upf & gNB
76- Make sure gNB Simulator can communicate with AMF & UPF
77- *TODO* - New Makefile target will deploy just 5G control plane
78- *TODO* - New Makefile target will deploy only gNB Simulator
79- One interface is used for user plane traffic towards UPF
80- Second interface is used to send traffic towards control plane (i.e. AMF).
81- UPF network & default gateway is provided in the override values.
82- Route to UPF network is added when POD comes up
83- defaultAs is configured per profile. This address is used to send data traffic during test
84- configure AMF address or FQDN appropriately
85
86.. note::
87 Multiple gNB's in one simulator instance need more changes in helm chart. This is pending work.
88
89
90To add UPF routes. Following is example of override values ::
91
92 config:
93 gnbsim:
94 gnb:
95 ip: 192.168.251.5/24 #user plane IP at gnb if 2 separate interface provided
96 singleInterface: false
97 networkTopo:
98 - upfAddr: "192.168.252.3/32"
99 upfGw: "192.168.251.1"
100
101.. image:: ../_static/images/Separate-cluster_2_interface.jpg
102 :width: 700px
Vijaya Tiruveedulad15e8ac2022-10-26 22:43:45 +0530103
104Running gNBSim Standalone Application in or out of a Docker
105```````````````````````````````````````````````````````````
106.. image:: ../_static/images/Standalone_gnbsim_1_interface.jpg
107 :width: 1000px
108
109Note that ``DATA-IFACE`` is ens1f0, this interface to be used for both control and data traffic
110
111We need two VMs, in this example we call one is SD-Core VM, other one is Simulator VM
112 * SD-Core VM: to Deploy AIAB
113 * Simulator VM: to Run gnbsim process in or out of Docker
114
115SD-Core VM Preparation:
116
117- To Expose External IP and Port of amf service, update sd-core-5g-values.yaml ::
118
119 amf:
120 # use externalIP if you need to access your AMF from remote setup and you don't
121 # want setup NodePort Service Type
122 ngapp:
123 externalIp: <DATA_IFACE_IP>
124 nodePort: 38412
125- Deploy 5g core with options DATA_IFACE=ens1f0 and ENABLE_GNBSIM=false, sample command::
126
127 $ ENABLE_GNBSIM=false DATA_IFACE=ens1f0 CHARTS=release-2.0 make 5g-core
128- Make sure that ``DATA_IFACE`` connected with Simulator VM
129
130Simulator VM Preparation
131
132- Single interface is used for user plane traffic towards UPF
133- Single interface is used to send traffic towards control plane (i.e. AMF).
134- Checkout gnbsim code using the following command::
135
136 $ git clone https://github.com/omec-project/gnbsim.git
137- Install 'go' if you want to run with local executable ::
138
139 $ wget https://go.dev/dl/go1.19.linux-amd64.tar.gz
140 $ sudo tar -xvf go1.19.linux-amd64.tar.gz
141 $ mv go /usr/local
142 $ export PATH=$PATH:/usr/local/go/bin
143- To Compile the code locally, you can use below commands::
144
145 $ ``go build`` or ``make docker-build``
146- Add following route in routing table for sending traffic over ``DATA_IFACE`` interface ::
147
148 $ ip route add 192.168.252.3 via <DATA-IFACE-IP-IN-SD-CORE-VM>
149- Just to Make sure the data connectivity, ping UPF IP from ``DATA_IFACE``::
150
151 $ ping 192.168.252.3 -I <DATA_IFACE>
152- configure correct n2 and n3 addresses in config/gnbsim.yaml ::
153
154 configuration:
155 singleInterface: false #default value
156 execInParallel: false #run all profiles in parallel
157 gnbs: # pool of gNodeBs
158 gnb1:
159 n2IpAddr: <DATA-IFACE-IP>># gNB N2 interface IP address used to connect to AMF
160 n2Port: 9487 # gNB N2 Port used to connect to AMF
161 n3IpAddr: <DATA-IFACE-IP> # gNB N3 interface IP address used to connect to UPF. when singleInterface mode is false
162 n3Port: 2152 # gNB N3 Port used to connect to UPF
163 name: gnb1 # gNB name that uniquely identify a gNB within application
164- configure AMF address or FQDN appropriately in gnbsim.yaml ::
165
166 configuration:
167 singleInterface: false #default value
168 execInParallel: false #run all profiles in parallel
169 gnbs: # pool of gNodeBs
170 gnb1:
171 defaultAmf:
172 hostName: # Host name of AMF
173 ipAddr: <AMF-SERVICE-EXTERNAL-IP> ># AMF Service external IP address in SD-Core VM
174 port: 38412 # AMF port
175- Run gnbsim application using the following command::
176
177 $ ./gnbsim -cfg config/gnbsim.yaml
178 (or)
179- Install Docker and run gnbsim inside a Docker with Docker hub Image or locally created Image ::
180
181 $ docker run --privileged -it -v ~/gnbsim/config:/gnbsim/config --net=host <Docker-Image> bash
182 $ ./gnbsim -cfg config/gnbsim.yaml
183
184Note: gnbsim docker images found at https://hub.docker.com/r/omecproject/5gc-gnbsim/tags