ajay | b3f4098 | 2021-12-08 14:26:11 -0800 | [diff] [blame] | 1 | .. |
| 2 | SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org> |
| 3 | SPDX-License-Identifier: Apache-2.0 |
ajay | 8794529 | 2021-12-08 00:52:00 -0800 | [diff] [blame] | 4 | .. _gNB-Simulator: |
| 5 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 6 | gNBSim Usage |
| 7 | ============= |
Vini Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 8 | |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 9 | Description |
| 10 | ----------- |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 11 | The gNBSim tool simulates gNodeB and UE by generating and processing NAS and |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 12 | NGAP messages for the configured UEs and call flows. The tool currently supports |
| 13 | simulation profiles for the following procedures, |
| 14 | |
| 15 | * Registration |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 16 | * UE Initiated PDU Session Establishment |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 17 | * UE Initiated De-registration. |
Vini Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 18 | * AN Release |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 19 | * Ue Initiated Service Request Procedure |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 20 | * NW triggered de-registration |
| 21 | * UE Requested PDU Session Release |
| 22 | * NW triggered PDU Session Release |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 23 | |
| 24 | It is also capable to generate and send user data packets (ICMP echo request) |
| 25 | and process down-link user data (ICMP echo response) over the established data |
| 26 | plane path (N3 Tunnel). |
| 27 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 28 | gNBSim 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 | |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 35 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 36 | Configure gNBSim |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 37 | ----------------- |
| 38 | * The sample config file for gNBSim can be found `here <https://github.com/omec-project/gnbsim/blob/main/config/gnbsim.yaml>`_ |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 39 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 40 | *Note: The configuration has following major fields (Read the comments in |
| 41 | the config file for more details)* |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 42 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 43 | * **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 Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 49 | * **customProfiles**: |
| 50 | List of custom profiles. Each item in the list holds |
| 51 | configuration specific to a customProfile. |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 52 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 53 | * Enable or disable a specific profile using the `enable` field within profile block. |
| 54 | Note: Currently following profiles are supported |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 55 | |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 56 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 57 | Run gNBSim |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 58 | ----------- |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 59 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 60 | * To quickly launch and test AiaB with 5G SD-CORE using gNBSim: |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 61 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 62 | .. code-block:: bash |
| 63 | |
| 64 | $ make 5g-test |
| 65 | |
Ajay Lotan Thakur | 05ce5ce | 2022-09-25 20:36:16 -0700 | [diff] [blame] | 66 | (refer AiaB documentation :ref:`aiab5g-guide`) |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 67 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 68 | * Alternatively, you can do following |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 69 | running: |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 70 | |
| 71 | .. code-block:: bash |
| 72 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 73 | $ 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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 79 | $ kubectl exec -it gnbsim-0 -n omec bash |
| 80 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 81 | * Then run following command to launch gNBSim profiles: |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 82 | |
| 83 | .. code-block:: bash |
| 84 | |
| 85 | $ ./gnbsim |
| 86 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 87 | *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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 90 | |
| 91 | .. code-block:: bash |
| 92 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 93 | $ ./gnbsim --cfg <config file path> |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 94 | |
| 95 | Build gNBSim |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 96 | ------------ |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 97 | |
| 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 | |
| 111 | Update *~/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 Thakur | 05ce5ce | 2022-09-25 20:36:16 -0700 | [diff] [blame] | 123 | (refer AiaB documentation :ref:`aiab5g-guide`) |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 124 | |
| 125 | |
Ajay Lotan Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 126 | gNBSim 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, Vijaya | 8585ae1 | 2023-04-19 19:06:45 +0530 | [diff] [blame] | 244 | * 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 Thakur | 0b01266 | 2022-10-07 20:18:10 -0700 | [diff] [blame] | 311 | * Delay between Procedures can be added using customProfiles. |