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 | 6772dde | 2022-03-22 11:52:15 -0700 | [diff] [blame] | 6 | gNB Simulator Deployment |
| 7 | ======================== |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 8 | |
ajay | 6772dde | 2022-03-22 11:52:15 -0700 | [diff] [blame] | 9 | gNB 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 | |
| 26 | To 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 | |
| 60 | To 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 | |
| 91 | Following 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 Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 104 | :width: 700px |
| 105 | |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 106 | Description |
| 107 | ----------- |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 108 | 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] | 109 | NGAP messages for the configured UEs and call flows. The tool currently supports |
| 110 | simulation profiles for the following procedures, |
| 111 | |
| 112 | * Registration |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 113 | * UE Initiated PDU Session Establishment |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 114 | * UE Initiated De-registration. |
Vini Gajjar | e43a47f | 2021-12-16 13:47:04 +0530 | [diff] [blame] | 115 | * AN Release |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 116 | * Ue Initiated Service Request Procedure |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 117 | |
| 118 | It is also capable to generate and send user data packets (ICMP echo request) |
| 119 | and process down-link user data (ICMP echo response) over the established data |
| 120 | plane path (N3 Tunnel). |
| 121 | |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 122 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 123 | Configure gNBSim |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 124 | ----------------------- |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 125 | * The config file for gNBSim can be found at *<repo dir>/config/gnbsim.yaml* |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 126 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 127 | *Note: The configuration has following major fields (Read the comments in |
| 128 | the config file for more details)* |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 129 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 130 | * **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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 136 | |
| 137 | * Enable or disable a specific profile using the **enable** field. |
| 138 | |
| 139 | *Note: Currently following profiles are supported* |
| 140 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 141 | * **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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 154 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 155 | Run gNBSim |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 156 | ----------- |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 157 | * To quickly launch and test AiaB with 5G SD-CORE using gNBSim: |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 158 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 159 | .. 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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 167 | |
| 168 | .. code-block:: bash |
| 169 | |
| 170 | $ kubectl exec -it gnbsim-0 -n omec bash |
| 171 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 172 | Then run following command to launch gNBSim: |
Vini Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 173 | |
| 174 | .. code-block:: bash |
| 175 | |
| 176 | $ ./gnbsim |
| 177 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 178 | *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 Gajjar | cdfe0bf | 2021-12-03 14:51:07 +0530 | [diff] [blame] | 181 | |
| 182 | .. code-block:: bash |
| 183 | |
Vini Gajjar | 816e185 | 2022-01-24 14:32:44 +0530 | [diff] [blame] | 184 | $ ./gnbsim --cfg <config file path> |
ajay | cbd1706 | 2022-03-06 11:12:58 -0800 | [diff] [blame] | 185 | |
| 186 | Build 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 | |
| 202 | Update *~/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 | |