blob: e8f6f1722979c63cc1a898109e8e6f686477d4c6 [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
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -07006gNBSim Usage
7=============
Vini Gajjare43a47f2021-12-16 13:47:04 +05308
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +05309Description
10-----------
Vini Gajjar816e1852022-01-24 14:32:44 +053011The gNBSim tool simulates gNodeB and UE by generating and processing NAS and
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053012NGAP messages for the configured UEs and call flows. The tool currently supports
13simulation profiles for the following procedures,
14
15* Registration
Vini Gajjar816e1852022-01-24 14:32:44 +053016* UE Initiated PDU Session Establishment
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053017* UE Initiated De-registration.
Vini Gajjare43a47f2021-12-16 13:47:04 +053018* AN Release
Vini Gajjar816e1852022-01-24 14:32:44 +053019* Ue Initiated Service Request Procedure
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070020* NW triggered de-registration
21* UE Requested PDU Session Release
22* NW triggered PDU Session Release
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053023
24It is also capable to generate and send user data packets (ICMP echo request)
25and process down-link user data (ICMP echo response) over the established data
26plane path (N3 Tunnel).
27
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070028gNBSim Code References
29----------------------
30
31* Code Repository: `github repository <https://github.com/omec-project/gnbsim>`_
32* Helm Chart: `gerrit repository <https://gerrit.opencord.org/plugins/gitiles/sdcore-helm-charts/+/refs/heads/master/5g-ran-sim/>`_
33* RAN SIM Helm Chart: `5g-ran-sim repository <https://charts.aetherproject.org>`_
34
ajaycbd17062022-03-06 11:12:58 -080035
Vini Gajjar816e1852022-01-24 14:32:44 +053036Configure gNBSim
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070037-----------------
38* The sample config file for gNBSim can be found `here <https://github.com/omec-project/gnbsim/blob/main/config/gnbsim.yaml>`_
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053039
Vini Gajjar816e1852022-01-24 14:32:44 +053040 *Note: The configuration has following major fields (Read the comments in
41 the config file for more details)*
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053042
Vini Gajjar816e1852022-01-24 14:32:44 +053043 * **gnbs**:
44 List of gNB's to be simulated. Each item in the list holds configuration
45 specific to a gNB.
46 * **profiles**:
47 List of test/simulation profiles. Each item in the list holds
48 configuration specific to a profile.
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070049 * **customProfiles**:
50 List of custom profiles. Each item in the list holds
51 configuration specific to a customProfile.
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053052
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070053* Enable or disable a specific profile using the `enable` field within profile block.
54 Note: Currently following profiles are supported
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053055
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053056
Vini Gajjar816e1852022-01-24 14:32:44 +053057Run gNBSim
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053058-----------
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070059
Vini Gajjar816e1852022-01-24 14:32:44 +053060* To quickly launch and test AiaB with 5G SD-CORE using gNBSim:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053061
Vini Gajjar816e1852022-01-24 14:32:44 +053062 .. code-block:: bash
63
64 $ make 5g-test
65
Ajay Lotan Thakur05ce5ce2022-09-25 20:36:16 -070066 (refer AiaB documentation :ref:`aiab5g-guide`)
Vini Gajjar816e1852022-01-24 14:32:44 +053067
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070068* Alternatively, you can do following
Vini Gajjar816e1852022-01-24 14:32:44 +053069 running:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053070
71 .. code-block:: bash
72
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070073 $ make 5g-core
74
75* Once all PODs are up then you can enter into the gNBSim pod by running
76
77 .. code-block:: bash
78
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053079 $ kubectl exec -it gnbsim-0 -n omec bash
80
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070081* Then run following command to launch gNBSim profiles:
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053082
83 .. code-block:: bash
84
85 $ ./gnbsim
86
Vini Gajjar816e1852022-01-24 14:32:44 +053087 *Note: By default, the gNB Sim reads the configuration from
88 /gnbsim/config/gnb.conf file. To provide a different configuration file, use
89 the below command*
Vini Gajjarcdfe0bf2021-12-03 14:51:07 +053090
91 .. code-block:: bash
92
Vini Gajjar816e1852022-01-24 14:32:44 +053093 $ ./gnbsim --cfg <config file path>
ajaycbd17062022-03-06 11:12:58 -080094
95Build gNBSim
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -070096------------
ajaycbd17062022-03-06 11:12:58 -080097
98* If you find a need to change gNBSim code and use the updated image in the AIAB setup then
99 follow below steps.
100
101* To modify gNBSim and build a new docker image:
102
103 .. code-block:: bash
104
105 $ git clone https://github.com/omec-project/gnbsim.git
106 $ cd gnbsim
107 $ make docker-build #requires golang installed on the machine
108
109* To use newly created image in the AiaB cluster:
110
111Update *~/aether-in-box/sd-core-5g-values.yaml* to point to the newly built image, then run:
112
113 .. code-block:: bash
114
115 $ cd ~/aether-in-a-box/
116 $ make reset-5g-test
117
118
119 .. code-block:: bash
120
121 $ make 5g-test
122
Ajay Lotan Thakur05ce5ce2022-09-25 20:36:16 -0700123 (refer AiaB documentation :ref:`aiab5g-guide`)
ajaycbd17062022-03-06 11:12:58 -0800124
125
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -0700126gNBSim System level features
127----------------------------
128
129* Logging summary result
130
131* HTTP API to create new profile. Below configuration enables http server in gNBSim.
132 Example to use gNBSim can be found `script <https://github.com/omec-project/gnbsim/blob/main/scripts/create-new-profile.sh>`_
133
134 .. code-block:: bash
135
136 config:
137 gnbsim:
138 httpServer:
139 enable: true #enable httpServer in gnbsim
140 port: 6000
141
142* Gnbsim can generate and send user data packets (ICMP echo request)
143 and process downlink user data (ICMP echo response) over the established data
144 plane path (N3 Tunnel). Configure number of data packets to be sent. Configure
145 AS (Application Server) address. This is used to send data packets.
146
147 .. code-block:: bash
148
149 - profileType: nwtriggeruedereg # profile type
150 profileName: profile6 # uniqely identifies a profile within application
151 enable: false # Set true to execute the profile, false otherwise.
152 gnbName: gnb1 # gNB to be used for this profile
153 startImsi: 208930100007497 # First IMSI. Subsequent values will be used if ueCount is more than 1
154 ueCount: 1 # Number of UEs for for which the profile will be executed
155 defaultAs: "192.168.250.1" #default icmp pkt destination
156 perUserTimeout: 10 #if no expected event received in this time then treat it as failure
157
158
159* Executing all enabled profiles in parallel or in sequential order.
160
161 .. code-block:: bash
162
163 config:
164 gnbsim:
165 yamlCfgFiles:
166 gnb.conf:
167 configuration:
168 execInParallel: false #run all profiles in parallel
169
170.. note::
171 There is execInParallel option under each profile as well. execInParallel under profile means that all the
172 subscribers in the profile are run in parallel
173
174* Timeout for each call flow within profile
175
176 .. code-block:: bash
177
178 - profileType: nwtriggeruedereg # profile type
179 profileName: profile6 # uniqely identifies a profile within application
180 perUserTimeout: 10 #if no expected event received in this time then treat it as failure
181
182* Getting gNBSim golang profile
183
184 .. code-block:: bash
185
186 config:
187 gnbsim:
188 goProfile:
189 enable: true #enable/disable golang profile in gnbsim
190 port: 5000
191
192* Run gNBSim with single Interface or multi interface
193
194 .. code-block:: bash
195
196 config:
197 gnbsim:
198 yamlCfgFiles:
199 gnb.conf:
200 configuration:
201 singleInterface: false #default false i.e. multiInterface. Works well for AIAB
202
203* Support of Custom Profiles: User can now define your own profile. New profile can be
204 created by using existing baseline procedure. Example of custom profile can be found here.
205 Check customProfiles in `gNBSim config <https://github.com/omec-project/gnbsim/blob/main/config/gnbsim.yaml>_`
206
207 .. code-block:: bash
208
209 customProfiles:
210 customProfiles1:
211 profileType: custom # profile type
212 profileName: custom1 # uniqely identifies a profile within application
213 enable: false # Set true to execute the profile, false otherwise.
214 execInParallel: false #run all subscribers in parallel
215 stepTrigger: true #wait for trigger to move to next step
216 gnbName: gnb1 # gNB to be used for this profile
217 startImsi: 208930100007487
218 ueCount: 5
219 defaultAs: "192.168.250.1" #default icmp pkt destination
220 opc: "981d464c7c52eb6e5036234984ad0bcf"
221 key: "5122250214c33e723a5dd523fc145fc0"
222 sequenceNumber: "16f3b3f70fc2"
223 plmnId: # Public Land Mobile Network ID, <PLMN ID> = <MCC><MNC>
224 mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
225 mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
226 startiteration: iteration1
227 iterations:
228 #at max 7 actions
229 - "name": "iteration1"
230 "1": "REGISTRATION-PROCEDURE 5"
231 "2": "PDU-SESSION-ESTABLISHMENT-PROCEDURE 5" #5 second delay after this procedure
232 "3": "USER-DATA-PACKET-GENERATION-PROCEDURE 10"
233 "next": "iteration2"
234 - "name": "iteration2"
235 "1": "AN-RELEASE-PROCEDURE 100"
236 "2": "UE-TRIGGERED-SERVICE-REQUEST-PROCEDURE 10"
237 "repeat": 5
238 "next": "iteration3"
239 - "name": "iteration3"
240 "1": "UE-INITIATED-DEREGISTRATION-PROCEDURE 10"
241 #"repeat": 0 #default value 0 . i.e execute once
242 #"next": "quit" #default value quit. i.e. no further iteration to run
243
Tiruveedula, Vijaya8585ae12023-04-19 19:06:45 +0530244* Support of Multiple gNBs: Two gnbs are configured by default. So User can create profiles by using these gnbs.
245 Configuration of two gNBs can be found here
246
247 .. code-block:: bash
248
249 gnb:
250 ips:
251 - '"192.168.251.5/24"' #gnb1 IP
252 - '"192.168.251.6/32"' #gnb2 IP
253 configuration:
254 runConfigProfilesAtStart: true
255 singleInterface: #this will be added thorugh configmap script
256 execInParallel: false #run all profiles in parallel
257 gnbs: # pool of gNodeBs
258 gnb1:
259 n2IpAddr: # gNB N2 interface IP address used to connect to AMF
260 n2Port: 9487 # gNB N2 Port used to connect to AMF
261 n3IpAddr: 192.168.251.5 # gNB N3 interface IP address used to connect to UPF
262 n3Port: 2152 # gNB N3 Port used to connect to UPF
263 name: gnb1 # gNB name that uniquely identify a gNB within application
264 globalRanId:
265 plmnId:
266 mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
267 mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
268 gNbId:
269 bitLength: 24
270 gNBValue: "000102" # gNB identifier (3 bytes hex string, range: 000000~FFFFFF)
271 supportedTaList:
272 - tac: "000001" # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
273 broadcastPlmnList:
274 - plmnId:
275 mcc: 208
276 mnc: 93
277 taiSliceSupportList:
278 - sst: 1 # Slice/Service Type (uinteger, range: 0~255)
279 sd: "010203" # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
280 defaultAmf:
281 hostName: amf # Host name of AMF
282 ipAddr: # AMF IP address
283 port: 38412 # AMF port
284 gnb2:
285 n2IpAddr: # gNB N2 interface IP address used to connect to AMF
286 n2Port: 9488 # gNB N2 Port used to connect to AMF
287 n3IpAddr: 192.168.251.6 # gNB N3 interface IP address used to connect to UPF
288 n3Port: 2152 # gNB N3 Port used to connect to UPF
289 name: gnb2 # gNB name that uniquely identify a gNB within application
290 globalRanId:
291 plmnId:
292 mcc: 208 # Mobile Country Code (3 digits string, digit: 0~9)
293 mnc: 93 # Mobile Network Code (2 or 3 digits string, digit: 0~9)
294 gNbId:
295 bitLength: 24
296 gNBValue: "000112" # gNB identifier (3 bytes hex string, range: 000000~FFFFFF)
297 supportedTaList:
298 - tac: "000001" # Tracking Area Code (3 bytes hex string, range: 000000~FFFFFF)
299 broadcastPlmnList:
300 - plmnId:
301 mcc: 208
302 mnc: 93
303 taiSliceSupportList:
304 - sst: 1 # Slice/Service Type (uinteger, range: 0~255)
305 sd: "010203" # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
306 defaultAmf:
307 hostName: amf # Host name of AMF
308 ipAddr: # AMF IP address
309 port: 38412 # AMF port
310
Ajay Lotan Thakur0b012662022-10-07 20:18:10 -0700311* Delay between Procedures can be added using customProfiles.