blob: 9c769b7400e4ccf747252be9913b6b6c177f9fce [file] [log] [blame]
ajayb3f40982021-12-08 14:26:11 -08001..
2 SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
3 SPDX-License-Identifier: Apache-2.0
ajay87945292021-12-08 00:52:00 -08004.. _gNB-Simulator:
5
ajay6772dde2022-03-22 11:52:15 -07006gNB Simulator Deployment
7========================
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +05308
ajay6772dde2022-03-22 11:52:15 -07009gNB Simulator can be deployed in following modes,
10
11**gNB simulator in AIAB mode with 2 interfaces:**
12-------------------------------------------------
13
14- This is default mode of deployment for gNB Simulator
15- Multus cni needs to be enabled on cluster. Required for bess-upf & gNB
16- `make 5gc` will by default deploy gNB Simulator in this mode
17- One interface is used for user plane traffic towards UPF
18- Second interface is used to send traffic towards control plane (i.e. AMF).
19- UPF network & default gateway is provided in the override values.
20- Route to UPF network is added when POD comes up
21- defaultAs is configured per profile. This address is used to send data traffic during test
22
23.. note::
24 Multiple gNB's in one simulator instance need more changes in helm chart. This is pending work.
25
26To add UPF routes. Following is example of override values ::
27
28 config:
29 gnbsim:
30 gnb:
31 ip: 192.168.251.5/24 #user plane IP at gnb if 2 separate interface provided
32 singleInterface: false
33 networkTopo:
34 - upfAddr: "192.168.252.3/32"
35 upfGw: "192.168.251.1"
36
37
38.. image:: ../_static/images/Single-cluster_2_interface.jpg
39 :width: 700px
40
41**gNB simulator running standalone with 2 or more interfaces**
42--------------------------------------------------------------
43
44- Install gNB Simulator on any K8s cluster
45- Multus cni needs to be enabled on cluster. Required for bess-upf & gNB
46- Make sure gNB Simulator can communicate with AMF & UPF
47- *TODO* - New Makefile target will deploy just 5G control plane
48- *TODO* - New Makefile target will deploy only gNB Simulator
49- One interface is used for user plane traffic towards UPF
50- Second interface is used to send traffic towards control plane (i.e. AMF).
51- UPF network & default gateway is provided in the override values.
52- Route to UPF network is added when POD comes up
53- defaultAs is configured per profile. This address is used to send data traffic during test
54- configure AMF address or FQDN appropriately
55
56.. note::
57 Multiple gNB's in one simulator instance need more changes in helm chart. This is pending work.
58
59
60To add UPF routes. Following is example of override values ::
61
62 config:
63 gnbsim:
64 gnb:
65 ip: 192.168.251.5/24 #user plane IP at gnb if 2 separate interface provided
66 singleInterface: false
67 networkTopo:
68 - upfAddr: "192.168.252.3/32"
69 upfGw: "192.168.251.1"
70
71.. image:: ../_static/images/Separate-cluster_2_interface.jpg
72 :width: 700px
73
74
75**gNB simulator running standalone with single interface**
76----------------------------------------------------------
77
78- Install gNB Simulator on any K8s cluster
79- Multus cni needs to be enabled for the K8s cluster where bess-upf runs
80- Make sure gNB Simulator can communicate with AMF & UPF
81- *TODO* - New Makefile target will deploy just 5G control plane
82- *TODO* - New Makefile target will deploy only gNB Simulator
83- Single interface is used for user plane traffic towards UPF & as well traffic towards AMF
84- defaultAs is configured per profile. This address is used to send data traffic during test
85- configure AMF address or FQDN appropriately
86
87.. note::
88 Multiple gNB's can not be simulated since only 1 gNB will be able to use 2152 port
89
90
91Following is example of override values ::
92
93 config:
94 gnbsim:
95 singleInterface: true
96 yamlCfgFiles:
97 gnb.conf:
98 configuration:
99 gnbs: # pool of gNodeBs
100 gnb1:
101 n3IpAddr: "POD_IP" # set if singleInterface is true
102
103.. image:: ../_static/images/Separate-cluster_Single_interface.jpg
Vini Gajjare43a47f2021-12-16 13:47:04 +0530104 :width: 700px
105
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530106Description
107-----------
Vini Gajjar816e1852022-01-24 14:32:44 +0530108The gNBSim tool simulates gNodeB and UE by generating and processing NAS and
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530109NGAP messages for the configured UEs and call flows. The tool currently supports
110simulation profiles for the following procedures,
111
112* Registration
Vini Gajjar816e1852022-01-24 14:32:44 +0530113* UE Initiated PDU Session Establishment
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530114* UE Initiated De-registration.
Vini Gajjare43a47f2021-12-16 13:47:04 +0530115* AN Release
Vini Gajjar816e1852022-01-24 14:32:44 +0530116* Ue Initiated Service Request Procedure
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530117
118It is also capable to generate and send user data packets (ICMP echo request)
119and process down-link user data (ICMP echo response) over the established data
120plane path (N3 Tunnel).
121
ajaycbd17062022-03-06 11:12:58 -0800122
Vini Gajjar816e1852022-01-24 14:32:44 +0530123Configure gNBSim
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530124-----------------------
Vini Gajjar816e1852022-01-24 14:32:44 +0530125* The config file for gNBSim can be found at *<repo dir>/config/gnbsim.yaml*
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530126
Vini Gajjar816e1852022-01-24 14:32:44 +0530127 *Note: The configuration has following major fields (Read the comments in
128 the config file for more details)*
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530129
Vini Gajjar816e1852022-01-24 14:32:44 +0530130 * **gnbs**:
131 List of gNB's to be simulated. Each item in the list holds configuration
132 specific to a gNB.
133 * **profiles**:
134 List of test/simulation profiles. Each item in the list holds
135 configuration specific to a profile.
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530136
137* Enable or disable a specific profile using the **enable** field.
138
139 *Note: Currently following profiles are supported*
140
Vini Gajjar816e1852022-01-24 14:32:44 +0530141 * **register**:
142 Registration procedure
143 * **pdusessest** (Default):
144 Registration + UE initiated PDU Session Establishment + User Data packets
145 * **deregister**:
146 Registration + UE initiated PDU Session Establishment + User Data packets
147 + Deregister
148 * **anrelease**:
149 Registration + UE initiated PDU Session Establishment + User Data packets
150 + AN Release
151 * **uetriggservicereq**:
152 Registration + UE initiated PDU Session Establishment + User Data packets
153 + AN Release + UE Initiated Service Request
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530154
Vini Gajjar816e1852022-01-24 14:32:44 +0530155Run gNBSim
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530156-----------
Vini Gajjar816e1852022-01-24 14:32:44 +0530157* To quickly launch and test AiaB with 5G SD-CORE using gNBSim:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530158
Vini Gajjar816e1852022-01-24 14:32:44 +0530159 .. code-block:: bash
160
161 $ make 5g-test
162
163 (refer AiaB documentation :ref:`aiab-guide`)
164
165* Alternatively, once 5G SD-CORE is up, you can enter into the gNBSim pod by
166 running:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530167
168 .. code-block:: bash
169
170 $ kubectl exec -it gnbsim-0 -n omec bash
171
Vini Gajjar816e1852022-01-24 14:32:44 +0530172 Then run following command to launch gNBSim:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530173
174 .. code-block:: bash
175
176 $ ./gnbsim
177
Vini Gajjar816e1852022-01-24 14:32:44 +0530178 *Note: By default, the gNB Sim reads the configuration from
179 /gnbsim/config/gnb.conf file. To provide a different configuration file, use
180 the below command*
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +0530181
182 .. code-block:: bash
183
Vini Gajjar816e1852022-01-24 14:32:44 +0530184 $ ./gnbsim --cfg <config file path>
ajaycbd17062022-03-06 11:12:58 -0800185
186Build gNBSim
187-------------------
188
189* If you find a need to change gNBSim code and use the updated image in the AIAB setup then
190 follow below steps.
191
192* To modify gNBSim and build a new docker image:
193
194 .. code-block:: bash
195
196 $ git clone https://github.com/omec-project/gnbsim.git
197 $ cd gnbsim
198 $ make docker-build #requires golang installed on the machine
199
200* To use newly created image in the AiaB cluster:
201
202Update *~/aether-in-box/sd-core-5g-values.yaml* to point to the newly built image, then run:
203
204 .. code-block:: bash
205
206 $ cd ~/aether-in-a-box/
207 $ make reset-5g-test
208
209
210 .. code-block:: bash
211
212 $ make 5g-test
213
214 (refer AiaB documentation :ref:`aiab-guide`)
215
216