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 | |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 6 | gNB Simulator |
| 7 | ============= |
| 8 | |
Vini Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 9 | .. image:: ../_static/images/gNBSim.png |
| 10 | :width: 700px |
| 11 | |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 12 | Description |
| 13 | ----------- |
| 14 | The gNB Sim tool simulates gNodeB and UE by generating and processing NAS and |
| 15 | NGAP messages for the configured UEs and call flows. The tool currently supports |
| 16 | simulation profiles for the following procedures, |
| 17 | |
| 18 | * Registration |
| 19 | * UE initiated PDU Session Establishment |
| 20 | * UE Initiated De-registration. |
Vini Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 21 | * AN Release |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 22 | |
| 23 | It is also capable to generate and send user data packets (ICMP echo request) |
| 24 | and process down-link user data (ICMP echo response) over the established data |
| 25 | plane path (N3 Tunnel). |
| 26 | |
| 27 | Configure gNB Simulator |
| 28 | ----------------------- |
| 29 | * The config file for GNBSIM can be found at *<repo dir>/config/gnbsim.yaml* |
| 30 | |
| 31 | *Note: The configuration has following major fields (Read the comments in the config file for more details)* |
| 32 | |
| 33 | * **gnbs**: List of gNB's to be simulated. Each item in the list holds configuration specific to a gNB. |
| 34 | * **profiles**: List of test/simulation profiles. Each item in the list holds configuration specific to a profile. |
| 35 | |
| 36 | * Enable or disable a specific profile using the **enable** field. |
| 37 | |
| 38 | *Note: Currently following profiles are supported* |
| 39 | |
| 40 | * **register**: Registration procedure |
| 41 | * **pdusessest** (Default): Registration + UE initiated PDU Session Establishment + User Data packets |
| 42 | * **deregister**: Registration + UE initiated PDU Session Establishment + User Data packets + Deregister |
| 43 | |
| 44 | Build gNB Simulator |
| 45 | ------------------- |
| 46 | * To modify gNB Sim within a container run |
| 47 | |
| 48 | .. code-block:: bash |
| 49 | |
| 50 | $ kubectl exec -it gnbsim-0 -n omec bash |
| 51 | |
| 52 | Make required changes and run |
| 53 | |
| 54 | .. code-block:: bash |
| 55 | |
| 56 | $ go build |
| 57 | |
| 58 | * To modify gNB Sim and build a new docker image |
| 59 | |
| 60 | .. code-block:: bash |
| 61 | |
| 62 | $ cd <repo dir> |
| 63 | $ make docker-build |
| 64 | |
| 65 | Use newly created image in the AIAB cluster run, |
| 66 | |
| 67 | .. code-block:: bash |
| 68 | |
| 69 | $ cd <aiab repo dir> |
| 70 | $ make reset-5g-test |
| 71 | |
| 72 | Modify the override file (ransim-values.yaml) to add the new image name |
| 73 | |
| 74 | .. code-block:: bash |
| 75 | |
| 76 | $ make 5gc |
| 77 | |
| 78 | Run gNB Sim |
| 79 | ----------- |
| 80 | |
| 81 | Enter into the gNB Sim pod by running |
| 82 | |
| 83 | .. code-block:: bash |
| 84 | |
| 85 | $ kubectl exec -it gnbsim-0 -n omec bash |
| 86 | |
| 87 | After entering the pod run, |
| 88 | |
| 89 | .. code-block:: bash |
| 90 | |
| 91 | $ ./gnbsim |
| 92 | |
| 93 | *Note: By default, the gNB Sim reads the configuration from /free5gc/config/gnb.conf file. To provide a different configuration file, |
| 94 | use the below command* |
| 95 | |
| 96 | .. code-block:: bash |
| 97 | |
| 98 | $ ./gnbsim --cfg config/gnbsim.yaml |