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