# OAI 5G SA Setup Guide Steps to setup OAI 5g SA with COTS UE. ### Basic minimum hardware requirements and system setup: * No of PCs: 1 PC or 2 PCs. *Note: If you plan to setup both OAI RAN and OAI Core (OAI CN5G) on the same system, you need one PC otherwise Two PCs.)* - Laptop/Desktop/Server for OAI CN5G and OAI gNB - Operating System: [Ubuntu 22.04 LTS](https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso) - CPU: 8 cores x86_64 @ 3.5 GHz - RAM: 32 GB - ***Important:*** **Setting Low latency Kernel and Other parameters** on Laptop/Desktop/Server for OAI CN5G and OAI gNB. *Enable the Lowlatency operations (6GM Lab might already have the low latency configuration). Observe this [OAI Kernel Requirements] in your GRUB configuration (GUI GRUB is available): [OAI Kernel Requirements]. Following is the general procedure for setting up low latency kernel and other parameters (check if they are already setup/enabled, if so, you don't need this steps)* - Install required low-latency kernel `sudo apt-get install linux-image-lowlatency linux-headers-lowlatency` - Set CPU to C1 Remove all power management features in the BIOS (sleep states, in particular C-states) and CPU frequency scaling (Intel SpeedStep). In some cases, you can also do this with cpufreqtool. Also, disable hyperthreading in BIOS and make sure its turned off in Linux - check this using this command: `watch grep \"cpu MHz\" /proc/cpuinfo` * have a look at this [link](https://askubuntu.com/questions/523640/how-i-can-disable-cpu-frequency-scaling-and-set-the-system-to-performance) for further information. * you must disable p-state and c-state in linux so you need to add `intel_pstate=disable` to the Linux boot options, i.e `GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_pstate=disable"` in `/etc/default/grub`, then perform update-grub. You may optionally add the following as well `"processor.max_cstate=1 intel_idle.max_cstate=0 idle=poll"` * Append `"blacklist intel_powerclamp"` to the end of `/etc/modprobe.d/blacklist.conf`, to blacklist the intel_powerclamp" module. If the file does not exist, create one, and add the line into it. * You also need to disable hyperthreading, CPU frequency control, C-States, P-States and any other power management from BIOS as well. * Install i7z utility to check the cpu ``` sudo apt-get install i7z sudo i7z ``` - Install cpufrequtils: `sudo apt-get install cpufrequtils` * Then edit the following file (if it doesn't exist, create it): ``` sudo nano /etc/default/cpufrequtils ``` And add the following line to it: ``` GOVERNOR="performance" ``` Save and exit. * **Ensure:** Now you need to disable ondemand daemon, otherwise after you reboot the settings will be overwritten. ``` sudo update-rc.d ondemand disable ``` - Set governor of all CPUs to performance ` echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor` - Laptop for UE - Operating System: For Quick setup - Microsoft Windows 10 x64 (Recommended for first time setup). ***Note:** Setup scenario or compatability with Linux will be discussed later in the following sections of UE setup step.* - CPU: 4 cores x86_64 - RAM: 8 GB - Windows driver for Quectel MUST be equal or higher than version **2.4.6** - [USRP B210](https://www.ettus.com/all-products/ub210-kit/), [USRP N300](https://www.ettus.com/all-products/USRP-N300/) or [USRP X300](https://www.ettus.com/all-products/x300-kit/) - Please identify the network interface(s) on which the USRP is connected and update the gNB configuration file. This will be explained in the later stages of RAN setup. - **Important:** USRP is connected to the gNB PC via Gigabit Ethernet cable. Ensure that the gNB PC interface for USRP is up. That is in your gNB Host, you should see Network intefrace (that connects to USRP, other than your normal LAN interface). This interfcae may be in the name form as `enp21sofo` or `enp21sofo` or `enp2sofo`.. multiple of these may present (but may not be up and running). You need to see which one is yours that connect to usrp (you can use dmesg and see when you unplug/plug ethernet cable that connects gnb nad usrp). And Ensure the following is ther in its network configuration. - In identity: Change MTU to `9000`. - IN IPV6: change IPv4 Method to `Manual`. Address to interface ip address. Netmask to `255.255.255.0`. Leave other option as is (DNS and Routes whould be Automatic by default). - OFF and On the interface, then you should see that you are connected. Then your usrp can be detected when enquired as in step 2. - **Modem:** - Quectel RM500Q - Module, M.2 to USB adapter, antennas and SIM card - Firmware version of Quectel MUST be equal or higher than **RM500QGLABR11A06M4G**. The Frimware Version that comes with the Qucetal should be fine . - Other Modems: Compatability with the other modems will be discussed later in the following sections of UE setup **step 2.1** and further. - **Note:** Basic Minimum requirements put by OAI can be found at: https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_COTS_UE.md?ref_type=heads#1-scenario . --- ### Check List or Setup Steps: - [ ] 1. **Step 1:** Ensure Basic Minimum (hardware) requirements. - [ ] 2. **Setp 2:** Checking existing UHD installation, Dependencies and building Drivers. - [ ] 3. **Setp 3:** Setup OAI RAN. - [ ] 4. **Step 4:** Setup OAI Corenetwork (OAI CN5G). - [ ] 5. **Step 5:** Configuring simcards and settingUp UE. - [ ] 6. **Step 6:** Running OAI-CN, OAI-gNB, Connecting UE to OAI. - [ ] 7. **Step 6:** Other advanced settings (for calibration of gNB for performnce), observations or the issues. --- # Step 2: Checking existing UHD installation, Dependencies and building Drivers. This should be on the Laptop/Desktop/Server where OAI RAN is to be installed/deployed with gNB. * **Step 2.1:** Check UHD (drivers for USRP) is available. * `uhd_usrp_probe` for checking the connected/visible USRPs to the PC. There might be an error if USRP is not connected. However, just for checking of the UHD drivers is present/installed in the system or not, this command should run successful (irrespective if device is attached or not). * By default all the system in the 6G Mobile research lab is installwith the UHD driver version `3.5`. Specifically the version name should be - The UHD version found in our lab is: `UHD_3.15.0.0-0-gaea0e2de` . * If the UHD is not installed or needs to be updated (before updating it is strongly recommended to contact Lab admin) proceed to UHD installation (Step 2.2 and **Step 2.3** ). Otherwise, skip to **Step 2.4**. * **UHD Installation** (incase if it is not installed already) steps. * **Step 2.2:** Install dependencies through package manager via command: ```sudo apt-get install autoconf automake build-essential ccache cmake cpufrequtils doxygen ethtool g++ git inetutils-tools libboost-all-dev libncurses5 libncurses5-dev libusb-1.0-0 libusb-1.0-0-dev libusb-dev python3-dev python3-mako python3-numpy python3-requests python3-scipy python3-setuptools python3-ruamel.yaml``` . *If you are copy pasting this command, ensure the syntax when pasted on terminal, as it is single command for installing multiple packages make sure to have only single space between package names, not a line. Usually line break happens when you copy past a long command.* * Incase, you may have problem with `python3-numpt-dbg`, remove from installation list. * Check UHD essentials and dependencies from https://files.ettus.com/manual/page_build_guide.html * In addtion (worked for cmake successful, check this option only after your cmake is unsuccessful when you are building the UHD driver in your system), install: Python3-uhd : https://packages.ubuntu.com/search?keywords=uhd : `pyhton3-uhd`, `libuhd-dev` (if required, if dependencies not met before) and`make`. * **Step 2.3:** Build UHD from Source. * Cloning UHD repo and building: ```bash git clone https://github.com/EttusResearch/uhd.git ~/uhd cd ~/uhd # For the following command: This worked for installing Long Term Stable UHD driver 3.15 LTS for USRPs. # Version 4.5.0.0 is not tested for our setup. # It is said that 4.5.0.0 version is also working well. So if you want to install or consider upgrading 4.5.0.0 version of UHD, replace this command with git checkout v4.5.0.0. # Be carefull that, This shopuld also reflect the matching version for kernel within the USRP . git checkout v3.15.LTS cd host mkdir build cd build cmake ../ make -j $(nproc) make test # This step is optional sudo make install sudo ldconfig sudo uhd_images_downloader ``` * OAI Reference: https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/c5aeaf03dc9d50bc46a9955e97b0556261f359fd/doc/NR_SA_Tutorial_COTS_UE.md * All the above steps should be successful. If any issues, some might have solution or approaches in https://hackmd.io/@hhewvLfDTk-E9wuqlV1KaA/HJPKVU0Qn or refer thier official manual. --- # Step 3: Setup OAI RAN. * **Step 3.1: Building OAI gNB** * Build it as described in the section of [Build OAI gNB] . Read the next step before building. * **Important to Observe:** Our worked veriosn is with the tag `2023.w34`. you may switch to this tag using `git checkout 2023.w34` in the clone directry , before building the gNB in tha bove step. * **Step 3.2: Configuring gNB** * Enable ip forwarding in your gNB host system (important) ``` sudo sysctl net.ipv4.conf.all.forwarding=1 sudo iptables -P FORWARD ACCEPT ``` * Before running the gNB, it is to be configured. * Edit the suitbale conf file. Always use the latest configuration file available in `~/openairinterface5g/ci-scripts/conf_files`. * Old configs are available in `~/openairinterface5g/targets/PROJECTS/GENERIC-NR-5GC/CONF` * First let us see what should be changed. Then a tested config options or a tested config files is provided. * Parameters to modify in the configuration file: * Configuration file used and modified: `gnb.sa.band78.106prb.n310.7ds2u.conf` (in `~/openairinterface5g/ci-scripts/conf_files`). * plmn_list (your PLMN, SST, SD): It consist of the MCC, MNC, mnc_length, and network slice list(SST, SD). ``` // Tracking area code, 0x0000 and 0xfffe are reserved values tracking_area_code = 1; plmn_list = ({ mcc = 230; mnc = 36; mnc_length = 2; snssaiList = ({sst = 1;}, {sst = 1; sd = 1;}, {sst = 222; sd = 123;}); }); # Change mcc to your desired sim configuration, for czech it is 230. # chnage mnc to your desired sim configuration. # In our 6G lab simcards (if configured) has IMSI in this pattern 230320000000001, 230320000000001,...etc. ``` * amf_ip_address. ``` ////////// AMF parameters: amf_ip_address = ( { ipv4 = "192.168.70.132"; #this ip address should be the amf public_net ipv4 adress in your docker compose file in your core machine. ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; ``` * Network Interfaces: `GNB_INTERFACE_NAME_FOR_NG_AMF, GNB_IPV4_ADDRESS_FOR_NG_AMF, GNB_INTERFACE_NAME_FOR_NGU, GNB_IPV4_ADDRESS_FOR_NGU`. ``` NETWORK_INTERFACES : { GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai"; #change this to gNB network interface if core and gNB are not on the same machine. GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.27.150/24"; #Typically this is your gNB machine ip address. GNB_INTERFACE_NAME_FOR_NGU = "demo-oai"; #change this to gNB network interface if core and gNB are not on the same machine. GNB_IPV4_ADDRESS_FOR_NGU = "192.168.27.150/24"; #Typically this is your gNB machine ip address. GNB_PORT_FOR_S1U = 2152; # Spec 2152 }; ``` * sdr_addrs (IP address of your USRP, get ip adress from your admin or HW list). ``` `sdr_addrs = "addr=192.168.30.15,clock_source=internal,time_source=internal" #change ip address as per your USRP ip address. Ideally it should be your sf0 interfac adress of the USRP. whereit is connected to the gNB system. ``` * You can use this configuration file which is tested at [6G mobile Research Lab](https://campuscvut-my.sharepoint.com/:u:/g/personal/gorlapra_cvut_cz/Efel6XPYHeRDnnCPnpqj14IBeG7kWQs5mjoa7ElTLnrogQ?e=efS77k) * **Step 3.3: Running gNB** * Before running the gNB, make sure that you have already ***setup OAI Core Network (OAI CN) and OAI-CN should be running as said in Step 4***. * **Some Network setup at gNB to reach Core Network:** * Add route to your Core network (if your core network is not on the same host as gNB is deployed). Your gNB host needs to configured with a route to reach your OAI-CN host which are deployed using docker images. As the docker deployed containers cannot be reached outside of its own system, we need to add a route adress at gNB to reach them through the Core network host system. *Note: If your core network (OAI-CN) and gNB (openairinterface5g) is on the same system you do not need this.* ``` sudo ip route add 192.168.70.128/26 via IP_ADD_OF_CORE_HOST dev NETWORK_INTERFACE_NAME_OF_gNB_HOST #IP_ADD_OF_CORE_HOST: It is the system/computer ip adress where your core network is hosted or about to host. #INTERFACE_NAME_OF_gNB_HOST: It is the netwrok interface name of your gNB host. This is ideally an ethernet interface where you have common network access to connect to the core network. #This interface will have an ipadress already assigned, so incase you see multiple network interfaces, you may choose the interface having most common ip adress as your system ip. Example of interfaces: en01, ens0p3, etc... ` ``` * To verify if your gNB is able to reach the Core Network Docker containers, ping it (Assuming that your core network is up and running). You can also ping amf ip address. ``` gNB-host$: ping 192.168.70.132 PING 192.168.70.129 (192.168.70.132) 56(84) bytes of data. 64 bytes from 192.168.70.132: icmp_seq=1 ttl=64 time=0.260 ms 64 bytes from 192.168.70.132: icmp_seq=2 ttl=64 time=0.147 ms 64 bytes from 192.168.70.132: icmp_seq=3 ttl=64 time=0.187 ms 64 bytes from 192.168.70.132: icmp_seq=4 ttl=64 time=0.187 ms 64 bytes from 192.168.70.132: icmp_seq=5 ttl=64 time=0.181 ms ^C --- 192.168.70.129 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 108ms rtt min/avg/max/mdev = 0.147/0.192/0.260/0.038 ms ``` You may refer here in case of any failure: https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/docs/DEPLOY_SA5G_BASIC_DEPLOYMENT.md?ref_type=heads#43-in-case-you-forgot-the-section-below-is-for-both-manual-and-automatic-network-creation * Now Running OAI-gNB: ```bash cd ~/openairinterface5g source oaienv cd cmake_targets/ran_build/build sudo ./nr-softmodem --sa -O ../../../ci-scripts/conf_files/gnb.sa.band78.106prb.n310.7ds2u.conf --usrp-tx-thread-config 1 #Make sure your config file is in the path you are supplying, idelayy it is sudo ./nr-softmodem --sa -O PATH_To_CONF_File --usrp-tx-thread-config 1 #or sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band77.fr1.273PRB.2x2.usrpn300.conf --sa --usrp-tx-thread-config 1 ``` --- # Step 4: Setup OAI Corenetwork (OAI CN5G). * OAI Core network, like a general 5G core has many components such as AMF, SMF, AUSF, nrf, UDR, UDF, UPF(or SPGWF-tiny), Database(mysql) and other functional elements (some listed in this project group as repos. Don't use them). All these are configured and run as a docker containers. Hence we use the fedearted repo: `oai-cn5g-fed` https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed . This setup is on the OAI-CN host, where you intend to deploy. * Network setup ``` sudo sysctl net.ipv4.conf.all.forwarding=1 sudo iptables -P FORWARD ACCEPT ``` * **Step 4.1: Pull OAI Docker images** * Pull the oai cn docker images (if it is for the first time setup) as described in https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed/-/blob/master/docs/RETRIEVE_OFFICIAL_IMAGES.md . * **Step 4.2: Clone `oai-cn5g-fed`** (if it is not cloned already) * Now, clone (if you haven't) `oai-cn-fed` from https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed ``` cd git clone https://gitlab.eurecom.fr/oai/cn5g/oai-cn5g-fed.git cd ~/oai-cn5g-fed/docker-compose ``` * In the `~/oai-cn5g-fed/docker-compose` folder you will find several configuration YAML files for deploying different scenarios of core. And these files are the one which conatins all core config, and to be run. Our basic interest can be satisfied by the config file `docker-compose-basic-nrf.yaml`. Edit this file as follows. * Parameters to modify in the `docker-compose-basic-nrf.yaml` * `MCC, MNC, SERVED_GUAMI_MNC, PLMN_SUPPORT_MNC, PLMN_SUPPORT_TAC`. Make sure that your `MCC, MNC, tracjing Area Code (PLMN_...TAC) reflects your gNB configuration. Also make sure that the comments in the following is also followed. ``` oai-amf: container_name: "oai-amf" image: oaisoftwarealliance/oai-amf:v1.5.1 expose: - 80/tcp - 8080/tcp - 38412/sctp environment: - TZ=Europe/Paris - MCC=230 - MNC=36 - REGION_ID=128 - AMF_SET_ID=1 -#Atleast one SERVED_GUAMI_MCC_ , SERVED_GUAMI_MNC_ should be same as your MCC and MNC in core and gNB, repectively. - SERVED_GUAMI_MCC_0=230 - SERVED_GUAMI_MNC_0=36 - SERVED_GUAMI_REGION_ID_0=128 - SERVED_GUAMI_AMF_SET_ID_0=1 - SERVED_GUAMI_MCC_1=460 - SERVED_GUAMI_MNC_1=11 - SERVED_GUAMI_REGION_ID_1=10 - SERVED_GUAMI_AMF_SET_ID_1=1 - PLMN_SUPPORT_MCC=230 - PLMN_SUPPORT_MNC=36 - PLMN_SUPPORT_TAC=1 # Slice 0 (1, 0xFFFFFF) - SST_0=1 #If you haven't changed nay SSt in gNB config, the above is default in both gNB config and your current core yaml. Howver make sure atleast one of the slice is matched in gNB and core (this YAML) config. # At least one slice SHALL be defined and should be same as one of the slices SST, SD defined in your gNB config file.. # All the others are optional # Slice 1 (1, 1) - SST_1=1 - SD_1=1 # Slice 2 (222, 123) - SST_2=222 - SD_2=123 ``` * **Step 4.3: Configuring UE information in core** * File `docker-compose/database/oai_db2.sql` in the `oai-cn5g-fed` repo serves as the input file for UE info for authentication. *Note: Make sure that the syntax is not changed while adding ue info, failed to takecare my result in mysql container not depolyed when deploying OAI and results in oai not deployed prpoerly.* * Add oe/ Edit UE IMSI, opc, key in to `AuthenticationSubscription` of `oai_db2.sql` by editing it (may used gedit in linux). Example as follows ``` INSERT INTO `AuthenticationSubscription` (`ueid`, `authenticationMethod`, `encPermanentKey`, `protectionParameterId`, `sequenceNumber`, `authenticationManagementField`, `algorithmId`, `encOpcKey`, `encTopcKey`, `vectorGenerationInHss`, `n5gcAuthMethod`, `rgAuthenticationInd`, `supi`) VALUES ('208950000000031', '5G_AKA', '0C0A34601D4F07677303652C0462535B', '0C0A34601D4F07677303652C0462535B', '{\"sqn\": \"000000000020\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', '63bfa50ee6523365ff14c1f45f88737d', NULL, NULL, NULL, NULL, '208950000000031'), ('230360000070590', '5G_AKA', 'c053808154144dda5c24171d45e3bc0c', 'c053808154144dda5c24171d45e3bc0c', '{\"sqn\": \"000000000020\", \"sqnScheme\": \"NON_TIME_BASED\", \"lastIndexes\": {\"ausf\": 0}}', '8000', 'milenage', 'b2e7298d0a42311ccc3e25989fe80950', NULL, NULL, NULL, NULL, '230360000070590'); ``` Here in this example information of the one of the UE is as follows: `230360000070590` is `IMSI` (First 3 digits represents MCC, 36 is MNC), `c053808154144dda5c24171d45e3bc0c` is the Key (Ki) and `b2e7298d0a42311ccc3e25989fe80950` is the opc. Make sure you change this as per your sim configuration. Get your sim configuration from your admin/sim sheet details. * **Step 4.4: Deploying/Running OAI Core** * Deploying the core components for basic nrf scenario (`docker-compose-basic-nrf.yaml`) can be done by using python script It will take atleast `2-3 mins` for the docker to deploy all the conatiners and successfully running. Run the command `python3 core-network.py --type start-basic` in `~/oai-cn5g-fed/docker-compose`, you should see all this log and containers are healthy. ``` lab@5GM-Z4-2:~/oai-cn5g-fed/docker-compose$ python3 core-network.py --type start-basic [2023-12-12 20:06:21,481] root:DEBUG: Starting 5gcn components... Please wait.... [2023-12-12 20:06:21,781] root:DEBUG: docker-compose -f docker-compose-basic-nrf.yaml up -d Creating network "demo-oai-public-net" with driver "bridge" Creating oai-ext-dn ... done Creating mysql ... done Creating oai-nrf ... done Creating oai-udr ... done Creating oai-udm ... done Creating oai-ausf ... done Creating oai-amf ... done Creating oai-smf ... done Creating oai-spgwu ... done [2023-12-12 20:06:24,351] root:DEBUG: OAI 5G Core network started, checking the health status of the containers... takes few secs.... [2023-12-12 20:06:24,351] root:DEBUG: docker-compose -f docker-compose-basic-nrf.yaml ps -a [2023-12-12 20:06:45,259] root:DEBUG: All components are healthy, please see below for more details.... Name Command State Ports --------------------------------------------------------------------------------------------------- mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp oai-amf python3 /openair-amf/bin/e ... Up (healthy) 38412/sctp, 80/tcp, 8080/tcp, 9090/tcp oai-ausf python3 /openair-ausf/bin/ ... Up (healthy) 80/tcp, 8080/tcp oai-ext-dn /bin/bash -c ip route add ... Up (healthy) oai-nrf python3 /openair-nrf/bin/e ... Up (healthy) 80/tcp, 8080/tcp, 9090/tcp oai-smf python3 /openair-smf/bin/e ... Up (healthy) 80/tcp, 8080/tcp, 8805/udp oai-spgwu python3 /openair-spgwu-tin ... Up (healthy) 2152/udp, 8080/tcp, 8805/udp oai-udm python3 /openair-udm/bin/e ... Up (healthy) 80/tcp, 8080/tcp oai-udr python3 /openair-udr/bin/e ... Up (healthy) 80/tcp, 8080/tcp [2023-12-12 20:06:55,269] root:DEBUG: Checking if the containers are configured.... [2023-12-12 20:06:55,269] root:DEBUG: Checking if AMF, SMF and UPF registered with nrf core network.... [2023-12-12 20:06:55,269] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="AMF" | grep -o "192.168.70.132" 192.168.70.132 [2023-12-12 20:06:55,275] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="SMF" | grep -o "192.168.70.133" 192.168.70.133 [2023-12-12 20:06:55,281] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="UPF" | grep -o "192.168.70.134" 192.168.70.134 [2023-12-12 20:06:55,286] root:DEBUG: Checking if AUSF, UDM and UDR registered with nrf core network.... [2023-12-12 20:06:55,286] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="AUSF" | grep -o "192.168.70.138" 192.168.70.138 [2023-12-12 20:06:55,291] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="UDM" | grep -o "192.168.70.137" 192.168.70.137 [2023-12-12 20:06:55,296] root:DEBUG: curl -s -X GET http://192.168.70.130/nnrf-nfm/v1/nf-instances?nf-type="UDR" | grep -o "192.168.70.136" 192.168.70.136 [2023-12-12 20:06:55,301] root:DEBUG: AUSF, UDM, UDR, AMF, SMF and UPF are registered to NRF.... [2023-12-12 20:06:55,301] root:DEBUG: Checking if SMF is able to connect with UPF.... [2023-12-12 20:06:55,330] root:DEBUG: UPF did answer to N4 Association request from SMF.... [2023-12-12 20:06:55,345] root:DEBUG: SMF is receiving heartbeats from UPF.... [2023-12-12 20:06:55,345] root:DEBUG: OAI 5G Core network is configured and healthy.... ``` * And to stop the /undeploy, you can use `python3 core-network.py --type stop-basic` in `~/oai-cn5g-fed/docker-compose`. This is high recommended approach for undeploying core. * More help on different scenarios, you may look at `python3 core-network.py --help`. However, the above basic is necessary for deploying `5G SA`. --- # Step 5: Configuring simcards and settingUp UE. Importnat: First off enquire if the simcard is already configured with the ideal 6GM lab configuration, and get the details such as IMSI, Key (Ki), OPC key. * **Step 5.1: Sim Configuration (Recommended not to do if you don't know)**: Failing in giving right ADM1 key form the sim card may damage the sim permananetly. * Software for Programing SIM: https://gitea.osmocom.org/sim-card/pysim.git . * Useage example: * run ``./pySim-read.py -p0` or ``./pySim-read.py -p1` to see details of the simcard. The following is how you can see your simcard info. Its IMSI, ICCID. ``` $ ./pySim-read.py -p0 Reading ... ICCID: 1791198229180000071 IMSI: 001640000000071 SMSP: ffffffffffffffffffffffffe1ffffffffffffffffffffffff0581005155f5ffffffffffff000000 ACC: ffff MSISDN: Not available Done ! ``` * If you would like to change the IMSI, to reflect your MCC and MNC. You can do like this by running `./pySim-prog.py` with sim parameters. To change sim info to reflect MCC:230, MNC: 36, with following IMSI is as follows. ``` ./pySim-prog.py -p 0 -x 230 -y 36 -t sysmoISIM-SJA2 -i 230360000070591 -o 69c9116f802195a7835abbd2ef683b74 -k 2166eb6a29caeecfbd94fb9c6e1458fa -s 8988211000000700000 -a 40377618 Using PC/SC reader interface Ready for Programming: Insert card now (or CTRL-C to cancel) Generated card parameters : > Name : Magic > SMSP : e1ffffffffffffffffffffffff0581005155f5ffffffffffff000000 > ICCID : 8988211000000700000 > MCC/MNC : 230/36 > IMSI : 230360000070591 > Ki : 2166eb6a29caeecfbd94fb9c6e1458fa > OPC : 69c9116f802195a7835abbd2ef683b74 > ACC : None > ADM1(hex): 3430333737363138 > OPMODE : None Programming ... Warning: Programming of the ICCID is not implemented for this type of card. Programming successful: Remove card from reader ``` Note: Remember, `IMSI` can be changed, where as `ICCID`, `Ki`, `OPC`, `ADM1` remains same and thier values are in sim sheet. * To read or program the simcard using above, a simcard usb reader is to be used. * **Step 5.2: Modem Setup with SIM**: * Insert the simcard in the modem. * Quecetal modem `RM500Q-GL` is worked for our setup. * Drivers: *Note: These may be already installed.* * Install Quecetal driver in Windows (if modem is connected to windows as UE) - Working and Tested for connecting to OAI. * Install qmcli drivers for linux - Works but modem script required when connecting to oai. * Configuring modem with AT commands: * For use in Linux: Install `minicom` or `picocom`. In Windows use PuTTY or QNAvigator (Install Quecetal Drivers). * The next step for minicom is openning a terminal and:```sudo minicom -D /dev/ttyUSB2``` * You need to see something like following. ``` Welcome to minicom 2.7.1 OPTIONS: I18n Compiled on Dec 23 2019, 02:06:26. Port /dev/ttyUSB2, 11:03:46 Press CTRL-A Z for help on special keys ``` * Apply AT commands. First, type ATI and enter to see the Model number of Quectel. ``` ATI ``` ``` Quectel RM500Q-GL Revision: RM500QGLABR11A06M4G ``` * **Step 5.3: Connecting UE to OAI**: Using [Putty] or QNavigator in Windows or minicom/picocom in Linux, apply following AT commands to connect to the OAI network (After OAI core and gNB is running.) Note: these may be already instlled. This if For **Quectel**. ```bash # MUST be sent at least once everytime there is a firmware upgrade! AT+CGDCONT=1,"IP","oai" #oai here is the APN. This is default for OAI. AT+CGDCONT=2 AT+CGDCONT=3 # Activate PDP context, retrieve IP address and test with ping AT+CGACT=1,1 AT+CGPADDR=1 AT+QPING=1,"openairinterface.org" #Optional. ``` * **Windows (Recommended for initial setup):** your Quectel acts as dongle and you should be able to see it connected. You can browse the internet. Same can be observed on the gNB log. * **Linux:** If You are using linux, you should run [modem.sh] (when UE is about to connect, once it is powered ON) script so as to make sure that Quectel is always in dongle mode (not ethernet mode) and accepts the OAI range of ip. Change the appropriate parameters in this script. * This may not work as expected. * For SIMCOM modems setting into this mode has been a problematic, and we failed to achive connection on SIMCOM modems. For Quectel we were succesful. --- # Step 6: Running OAI-CN, OAI-gNB, Connecting UE to OAI. Follow the oder for setup running. 1. Run OAI-CN as said in **Step 4.4: Deploying/Running OAI Core**. 2. Run OAI gNB as said in **Step 3.3: Running gNB** 3. Connect UE to OAI as said **Step 5.3: Connecting UE to OAI** --- # Step 7:Other advanced settings (for calibration of gNB for performnce), observations or the issues. * Radio parameters to modify: these parameters allow you to change number of antennas on gNB or gains on the TX/RX port – In your gNB confi file: pdsch_AntennaPorts_XP, pusch_AntennaPorts, ul_prbblacklist(this can be commented out, but –tune-offset option has to be used), nb_tx, nb_rx, att_tx (set attenuation of TX), att_rx (set attenuation of RX) – it is beneficial to use attenuation (att_tx and att_rx), up to 20 dB, especially when your UE is close to the gNB - Some of the issues solved or identified can/may be found in [OAI-5G Setup Status]. - [OpenAirInterface5G RAN Main repo] - [OAI NR SA Setup Tutorial] [Build OAI gNB]: https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/c5aeaf03dc9d50bc46a9955e97b0556261f359fd/doc/NR_SA_Tutorial_COTS_UE.md#32-build-oai-gnb [6GM Lab Config file]:https://campuscvut-my.sharepoint.com/:u:/g/personal/gorlapra_cvut_cz/EaJwwNYf4qBCr2aNxMRy0WgBlej-lPirjQSGdokIASIvoA?e=FrUfEN [Putty]: https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe [modem.sh]: https://campuscvut-my.sharepoint.com/:u:/g/personal/gorlapra_cvut_cz/EZFa5Jmt-5pDt2BCNMuDRA4B6JiFpkDcwL9p2G3edL7BdA?e=cbZMIx [OAI Kernel Requirements]: https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/OpenAirKernelMainSetup#ubuntu-1604-ltslinux-kernel-version-48-or-higher [OpenAirInterface5G RAN Main repo]: https://gitlab.eurecom.fr/oai/openairinterface5g [OAI-5G Setup Status]: https://hackmd.io/@praveeng/HJPKVU0Qn [OAI NR SA Setup Tutorial]: https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/doc/NR_SA_Tutorial_COTS_UE.md?ref_type=heads