.. _AraRAN_Experiment_srsRAN_Outdoor: srsRAN Outdoor 5G SA Experiment with COTS UE ----------------------------------------------------------------------------- **Platform:** srsRAN software stack and Universal Software Radio Peripherals (USRPs) **Resources used:** USRP NI N320 (BS), N320 host computer, Quectel RM5xxQ-GL (UE), Quectel host computer, power amplifiers, CommScope SS-65M-R2 Sector BS Antenna, and Quectel YEMN017AA Antenna. .. **Short Description:** The experiment demonstrates a basic over-the-air 5G network using srsRAN_Project, NI N320 and Quectel UE. The setup includes an srsgNB, COTS UE (Quectel), and Open5GS core network. The core network deployed in the data center and connects to the base station via long distance fiber backhaul connection. **Description:** This experiment features a 5G network deployment using containerized 5G software components of *srsRAN_Project*, i.e., a containerized srsgNB, a containerized UE running minicom, and a Quectel RM5xxQ-GL attached to the UE container. The core network is deployed in the data center and connects to the base station via long distance fiber backhaul connection. The following figure shows the 5G network created from the experiment. .. image:: images/srs.drawio.png :align: center | .. note:: For srsRAN 5G experiments, there exists an Open5GS core network deployed at the data center. The core network always runs an *iperf3* server in the background. Even though users do not have access to the core network for the experiment, they can run *iperf3* and *ping* commands to communicate with the core network. **Detailed Steps for the Experiment** #. Login to `ARA portal `_ with your credentials. #. Create two reservations using the *Project -> Reservations -> Leases* tab from the dashboard. Since each base station serves specific UEs in its footprint, we need to take extra care while reserving the nodes for experiments as well as setting the configuration parameters for gNB and UE. Following are the BS-UE combinations for the OAI outdoor experiment. You can make use of any resource combination listed below for your experiment. **Experiment Resource Combination 1 (for Curtiss Farm)** .. list-table:: :widths: 5 15 10 15 15 :header-rows: 1 :align: center * - Resource No. - Site - Resource Type - Device Type - Device ID * - 1 - Curtiss Farm - AraRAN - Base Station - 000 * - 2 - Curtiss Farm - AraRAN - User Equipment - 000 * - 3 - Portable - AraRAN - User Equipment - 000 * - 4 - FeedMill - AraRAN - User Equipment - 000, 001 **Experiment Resource Combination 2 (for Agronomy Farm)** .. list-table:: :widths: 5 15 10 15 15 :header-rows: 1 :align: center * - Resource No. - Site - Resource Type - Device Type - Device ID * - 1 - Agronomy Farm - AraRAN - Base Station - 000 * - 2 - Agronomy Farm - AraRAN - User Equipment - 001, 010 **Experiment Resource Combination 3 (for Gilbert)** .. list-table:: :widths: 5 15 10 15 15 :header-rows: 1 :align: center * - Resource No. - Site - Resource Type - Device Type - Device ID * - 1 - Gilbert - AraRAN - Base Station - 000 * - 2 - Horticulture - AraRAN - User Equipment - 000, 001 * - 3 - Gilbert - AraRAN - User Equipment - 003 .. #. Create the containers on the respective nodes as provided in the following table. .. list-table:: :widths: 5 10 2 4 5 :header-rows: 1 :align: center * - Component/Reservation - Container Image - CPU - Memory - Network * - Base Station (gNB) - ``arawirelesshub/srsran:gnb_v2`` - 8 - 8192 - ARA_Shared_Net * - User Equipment (Quectel) - ``arawirelesshub/srsran:ue_v2`` - 8 - 8192 - ARA_Shared_Net #. Once the container is launched, take a note on the floating IP if you want to access the container from your PC via ARA jumpbox. The containers can be accessed via the console tab of the respective containers in the *Project -> Containers* tab from the dashboard or using ssh via the jumpbox server. Visit :ref:`ARA_Jumpbox` for more information on accessing containers via jumpbox. #. In the gNB container, run the following command to check the radios connected to the host. In case the command cannot find SDR, refer the instructions in :ref:`FAQ `. :: # uhd_find_devices The output of the above command should look like the following image. **Base Station** .. image:: images/uhdfinddev.png :align: center **Note:** The base station may show multiple SDRs, each corresponding to one sector. #. To make the **gNB** connected to the core network, you need to attach the gNB to the **AMF** of the core network. First note down the IP address of the interface ``eth4`` of the **gNB** container by executing the following command in the terminal. :: # ifconfig eth4 For this experiment, we assume that the IP address of eth4 on gNB is **10.189.3.112** as shown below. .. image:: images/eth4_ifconfig.png :align: center #. **Running the gNB:** In the gNB container, run the srsgNB with the appropriate SDR address and bind address parameters. The command format is: :: # ./gnb_start.sh -c srsRAN/build/apps/gnb/n320.yml -a -b Where: * ``-a`` specifies the SDR address (depends on the UE you are using) * ``-b`` specifies the bind address (the IP address of ``eth4`` from **Step 6**) * ``-w`` (optional) specifies the bandwidth in MHz (20 MHz by default) Use the following table to determine the correct SDR address based on your UE: .. list-table:: :widths: 20 15 :header-rows: 1 :align: center * - User Equipment - SDR Address (``-a`` flag) * - CurtissFarm-UE-000, Portable-UE-000, AgronomyFarm-UE-[001, 010], Gilbert-UE-003 - 192.168.20.2 * - Horticulture-UE-[000, 001] - 192.168.30.2 * - FeedMill-UE-[000, 001] - 192.168.40.2 **Example:** If you are using Horticulture-UE-001 and your ``eth4`` IP address is **10.189.3.112**, run: :: # ./gnb_start.sh -c srsRAN/build/apps/gnb/n320.yml -a 192.168.30.2 -b 10.189.3.112 --json-metrics .. note:: When the gNB starts, per-UE metrics such as CQI, MCS, DL/UL bit-rates, SNR, and packet success/drop counts are written to a ``gnb_metricsx.json`` file in the ``/root`` directory. See the :ref:`gNB logs section ` for how to follow these metrics in real time with ``tail`` or inspect the saved JSON after the experiment. .. note:: For **Horticulture-UE-000 and Horticulture-UE-001**: These UEs are located beyond 1.2 km from the base station and require significantly higher TX and RX power to maintain a stable connection. Use TX gain of **52** and RX gain of **45** by adding the ``--tx-gain`` and ``--rx-gain`` flags to the command. To achieve maximum throughput, you may also add the ``-w 40`` flag to set the bandwidth to 40 MHz: :: # ./gnb_start.sh -c srsRAN/build/apps/gnb/n320.yml -a 192.168.30.2 -b 10.189.3.112 --tx-gain 52 --rx-gain 45 -w 40 --json-metrics Where ``--tx-gain`` specifies the TX gain, ``--rx-gain`` specifies the RX gain, and ``-w`` specifies the bandwidth in MHz. .. To test the reachability of the 5G Core from the gNB container, run a ping in the gNB container toward the ``AMF`` of the core network. :: # ping 10.189.8.8 After running srsgNB, your terminal should look like the image below. .. image:: images/srsgnb_start.png :align: center .. #. **Starting Minicom in the UE:** In the UE container, start *minicom* using the following command :: # minicom When *minicom* opens, its interface shows as follows: .. image:: images/minicom_welcome.png :align: center Now, run the following command in *mininet* to reset the Quectel radio. :: at+cfun=1,1 .. note:: The *minicom* terminal may not respond immediately after opening. In such cases, quit *minicom* (``CTRL+A`` + ``Z`` and ``Q``), wait for about 30 seconds, and then re-open *minicom*. On pressing ``CTRL+A`` + ``Z``, *minicom* summarizes its commands as follows. You can select the options as required. .. image:: images/ctrlAZ.png :align: center .. .. hint:: At times, when you type any character in the *minicom* terminal it may not be displayed in the terminal. In such case, enable Echo-mode by pressing ``CTRL+A`` + ``Z`` and ``E``. On the successful execution of the ``at+cfun=1,1`` command, the radio gets disconnected with a message as follows. .. image:: images/quecteloff.png :align: center The radio turns on automatically in a few seconds. The following messages indicate the radio reset is complete. .. image:: images/quectel_ready.png :align: center Next, check if the UE is registered to the 5G network by running the following command. :: at+qeng="servingcell" If the UE is registered successfully to the network, you should see the image below. If not, repeat the command above until you see message. .. image:: images/atcommandservingcell.png :align: center Now exit the minicom terminal by pressing ``CTRL+A`` + ``Z`` and then ``Q``. 8. **Establishing a PDU Session:** On the UE container, run the UE start script, which automates the entire process of bringing up the UE, checking registration, and establishing the PDU session. :: # ./ue_start.sh The script will perform the following steps automatically: * **[1/4]** Reboot the Quectel radio * **[2/4]** Check UE registration to the 5G network (may retry if not registered) * **[3/4]** Start the PDU session using Quectel Connection Manager * **[4/4]** Detect the network interface and IPv4 address After successful execution, the output should look similar to the image below: .. image:: images/ue_conn_est.png :align: center The UE is now assigned an IP address by the Session Management Function of the core network and has a network interface (e.g., ``enxd62467e35368``) ready for user-plane testing. The script provides convenient ping and iperf3 commands at the end for your reference. Latency Experiment ^^^^^^^^^^^^^^^^^^^^^^^^^ On establishing a successful connection, you may check the latency toward the core network by following the steps. 9. **Ping test to the Core Network**: On the UE container, copy the ping command from the output shown in the image above (from **Step 8**) and run it to ping the core network and ensure stable connection. For example: :: # ping -I enxd62467e35368 10.45.0.1 -c 10 An example output of the *ping* command is shown below. .. image:: images/ping_result.png :align: center .. #. **End-to-end throughput test**: Run the *iperf* client to find the uplink throughput toward the core network. :: # iperf -c 192.168.70.135 -u -i 1 -B 12.1.1.28 The sample output of the *iperf* command is shown below. .. image:: images/iperf_uplink_Console_6.png :align: center For recording the *iperf* output to a text file (say *iperf_output.txt*), we can use following command: :: # iperf -c 192.168.70.135 -u -i 1 -B 12.1.1.28 > iperf_output.txt The command below prints the output or the content of the file *iperf_output.txt*. :: # cat iperf_output.txt Throughput Test ^^^^^^^^^^^^^^^^^^^^^ 10. **TCP Throughput Test**: On the UE container, copy the iperf3 command from the output shown in **Step 8** and run it to measure the downlink throughput from the core network to the UE. The command uses TCP protocol with the ``-R`` flag for reverse mode (downlink). For example: :: # iperf3 -c 10.45.0.1 -p 5203 -B 10.45.0.10 -R -t 10 .. note:: Make sure to use your UE's assigned IP address (obtained from Step 8) in the ``-B`` flag. The **iPerf3** command output shows the downlink throughput as follows. .. image:: images/iperf_result.png :align: center On the gNB, you can view the console traces with parameters such as bit-rate, CQI, and MCS. To view these parameters, press ``t`` followed by ``ENTER`` inside the gNB container. The srsgNB console trace will display as shown in the image below (while the **iPerf3** command is running at the UE). .. image:: images/gnb_log.png :align: center .. _srsran_gnb_logs: Accessing gNB Logs ^^^^^^^^^^^^^^^^^^^^^^ The gNB writes per-UE metrics to JSON logs in the ``/root`` directory. Each run creates a file named ``gnb_metricsx.json``. **Log schema (example):** .. code-block:: json { "ue_container": { "pci": 3, "rnti": 24658, "cqi": 7, "ri": 1, "dl_mcs": 18, "dl_brate": 92.5, "dl_nof_ok": 12345, "dl_nof_nok": 12, "dl_bs": 0, "pusch_snr_db": 18.7, "ul_mcs": 16, "ul_brate": 21.3, "ul_nof_ok": 6789, "ul_nof_nok": 4, "bsr": 0 } } **Accessing the logs:** - Real time during the gNB run (Please open a separate terminal to follow logs): :: # tail -f /root/gnb_metricsx.json - After the experiment, open the saved log file: :: # nano /root/gnb_metricsx.json Use these logs to track CQI, MCS, DL/UL bit-rates, SNR, and packet success/drop rates for each UE while the gNB is running.