24 - Configuración de RAN con srsRAN e SDR LimeSDR

Volver ó curso

Ubuntu Server versión 22.04 LTS

Antes de comezar

Se consciente de en que carpeta estás traballando en cada momento:

pwd

Tampouco perdas a conta dos comandos que levas executado:

history

Se estás perdido e non logras atopar o ficheiro que precisas, lembra o comando find para buscar. Exemplo para atopar enb.conf:

find / -name enb.conf

O primeiro paso desta práctica é instalar un frontend de radiofrecuencia mediante a tarxeta SDR e os seus drivers.

Instalación de LimeSDR (SoapySDR e LimeSuite)

Comproba que a SDR estea conectada con:

lsusb

Instalamos compilador:

apt install -y build-essential cmake

Descargamos SoapySDR:

git clone https://github.com/pothosware/SoapySDR.git
cd SoapySDR && git checkout tags/soapy-sdr-0.7.2
mkdir build && cd build
cmake ../
make -j4  # Usa catro fíos para acelerar a compilación
sudo make install
sudo ldconfig

Instalamos compilador cmake:

sudo apt install -y libusb-1.0-0-dev

Agora descargamos as librerías LimeSuite:

cd ~
git clone https://github.com/myriadrf/LimeSuite.git
cd LimeSuite && git checkout tags/v20.01.0
mkdir builddir && cd builddir/

Compilamos:

cmake ../
make -j4
sudo make install
sudo ldconfig
cd ../udev-rules
sudo ./install.sh

E probamos a conexión co hardware SDR:

LimeUtil --find
LimeUtil --update
SoapySDRUtil --find


Instalación de eNB/gNB mediante srsRAN

srsRAN consta de tres compoñentes:

Cada compoñente se xestiona cun ou varios ficheiros de configuración. Como o noso core é Open5GS, só precisamos a parte de srsENB.

Ficheiros de srsEPC (core):

Ficheiros de srsENB (eNB/gNB):

Ficheiros de srsUE (UE):

Instalamos srsRAN mediante descarga e compilación. Comezamos cos programas dedependencias:

sudo apt update -y && sudo apt-get install -y screen build-essential cmake libfftw3-dev libmbedtls-dev libboost-program-options-dev libconfig++-dev libsctp-dev

Imos á carpeta persoal:

cd ~

Descargamos o código fonte e procedemos a compilar:

git clone https://github.com/srsRAN/srsRAN_4G.git
cd srsRAN_4G && mkdir build && cd build/

Compilamos:

cmake ../
make -j4

Comprobamos que a compilación sexa correcta:

# make -j4 test
make test  # comprobaciones instalacion correcta

Instalamos os binarios:

sudo make install
ldconfig

Preparamos os ficheiros de configuración de srsRAN co script SRSRAN_install_configs.sh:

Finalmente, poñemos o scaling_governor da CPU en modo performance para lograr a máxima potencia de cálculo e ancho de banda posible:

Esto falla por ser VM:

echo "performance" | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
cd ~

Firewall

Comproba con:

iptables -L

Abre os portos da S1:

sudo iptables -A INPUT -p sctp -m sctp --dport 36412 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 2152 -j ACCEPT

Posta en marcha da celda con LimeSDR

Seguro que tes unha LimeSDR? Se a túa SDR é a USRP, preme nesta ligazón.

nano /etc/srsran/enb.conf

Cambios:

[enb]
mcc = 999
mnc = 70
mme_addr = 10.207.0.160        ## IP for external MME, eg. 192.168.1.10
gtp_bind_addr = 10.207.XX.YY   ## local interface IP for external S1-U, eg. 192.168.1.3
s1c_bind_addr = 10.207.XX.YY   ## local interface IP for external S1-MME, eg. 192.168.1.3
n_prb = 15
tm = 1                     ## Rank indicator de MIMO
nof_ports = 1              ## Modo MIMO (en este caso no se activa pq LimeSDR Mini no soporta)

[rf]
dl_earfcn = 3350           ## Poñer só se non hai máis de 1 celda
tx_gain = 60               ## this power seems to work best
rx_gain = 40
device_name = soapy
device_args = auto         ## does not work with anything other than 'auto'

Información sobre tm (Rank Indicator): https://www.sharetechnote.com/html/Handbook_LTE_RI.html

Agora retocamos o ficheiro rr.conf. Ten en conta que o dl_earfcn debe coincidir en ambos, e que o tac (tracking area code) debe ser o mesmo que en Open5GS.

nano /etc/srsran/rr.conf

Cambios para 4G (ver titorial para 5G SA):

Máis info sobre códigos | e sobre PCI.

cell_list =
(
  {
        // rf_port = 0;
        cell_id = 0x01;
        tac = 0x0001;         # Debe coincidir con Open5GS
        pci = 1;
        root_seq_idx = 204;
        dl_earfcn = 3350;     # Debe coincidir con enb.conf u omitirse en enb.conf
        //ul_earfcn = 21400;
        ho_active = true;
        //meas_gap_period = 0; // 0 (inactive), 40 or 80
        //meas_gap_offset_subframe = [6, 12, 18, 24, 30];
        // target_pusch_sinr = -1;
        // target_pucch_sinr = -1;
        // enable_phr_handling = false;
        // min_phr_thres = 0;
        // allowed_meas_bw = 6;
        // t304 = 2000; // in msec. possible values: 50, 100, 150, 200, 500, 1000, 2000

        // CA cells
        scell_list = (
        // {cell_id = 0x02; cross_carrier_scheduling = false; scheduling_cell_id = 0x02; ul_allowed = true}
        )

        // Cells available for handover
        meas_cell_list =
        (
          {
            eci = 0x19B01;
            dl_earfcn = 3350;
            pci = 1;
            //direct_forward_path_available = false;
            //allowed_meas_bw = 6;
            //cell_individual_offset = 0;
          },
          {
            eci = 0x19C01;
            dl_earfcn = 3350;
            pci = 6;
          }
        );

        // Select measurement report configuration (all reports are combined with all measurement objects)
        meas_report_desc =
        (
          {
            eventA = 3
            a3_offset = 6;
            hysteresis = 0;
            time_to_trigger = 480;
            trigger_quant = "RSRP";
            max_report_cells = 1;
            report_interv = 120;
            report_amount = 1;
          }
        );

        meas_quant_desc = {
          // averaging filter coefficient
          rsrq_config = 4;
          rsrp_config = 4;
        };
  }
  // Add here more cells
);
Retoca o campo “ExecStart” para que a ruta a “srsenb” sexa a correcta.
Retoca o campo “ExecStart” para que a ruta a “srsenb” sexa a correcta.

Posta en marcha de celda

Temos dúas opcións de executar:

Comproba a conexión eNB a core cunha terminal no log de cada equipo (core e eNB):

Conexión entre srsENB e Open5GS
Conexión entre srsENB e Open5GS
Active RF plugins: libsrsran_rf_soapy.so
Inactive RF plugins:
---  Software Radio Systems LTE eNodeB  ---

Reading configuration file /etc/srsran/enb.conf...
Couldn't open sib.conf, trying /root/.config/srsran/sib.conf
Couldn't open /root/.config/srsran/sib.conf either, trying /etc/srsran/sib.conf
Couldn't open rr.conf, trying /root/.config/srsran/rr.conf
Couldn't open /root/.config/srsran/rr.conf either, trying /etc/srsran/rr.conf
Couldn't open rb.conf, trying /root/.config/srsran/rb.conf
Couldn't open /root/.config/srsran/rb.conf either, trying /etc/srsran/rb.conf
WARNING: Could not verify cpu0 scaling governor
WARNING: Could not verify cpu1 scaling governor
WARNING: Could not verify cpu2 scaling governor
WARNING: Could not verify cpu3 scaling governor
WARNING: Could not verify cpu4 scaling governor
WARNING: Could not verify cpu5 scaling governor
WARNING: Could not verify cpu6 scaling governor
WARNING: Could not verify cpu7 scaling governor

Built in Release mode using commit 921f17484 on branch master.

/root/srsRAN_4G/srsenb/src/enb_cfg_parser.cc:1881: Force DL EARFCN for cell PCI=2 to 1934
Opening 1 channels in RF device=soapy with args=default
Supported RF device list: soapy file
Soapy has found device #0: addr=24607:1027, driver=lime, label=LimeSDR Mini [USB 3.0] 1D3AC7D78F1823, media=USB 3.0, module=FT601, name=LimeSDR Mini, serial=1D3AC7D78F1823,
Selecting Soapy device: 0
Detected LimeSDR. Consider using LTE rates for better RF performance.
Either compile with '-DUSE_LTE_RATES=True' or start srsENB/srsUE with '--expert.lte_sample_rates=true'
[INFO] Make connection: 'LimeSDR Mini [USB 3.0] 1D3AC7D78F1823'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
Setting up Rx stream with 1 channel(s)
Setting up Tx stream with 1 channel(s)
[INFO] RX LPF configured
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 5 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
Available device sensors:
 - clock_locked
 - lms7_temp
Available sensors for Rx channel 0:
 - lo_locked
State of gain elements for Rx channel 0 (AGC not supported):
 - TIA: 9.00 dB
 - LNA: 30.00 dB
 - PGA: -7.00 dB
State of gain elements for Tx channel 0 (AGC not supported):
 - PAD: 0.00 dB
 - IAMP: 0.00 dB
Rx antenna set to LNAH
Tx antenna set to BAND1

==== eNodeB started ===
Type <t> to view trace
[INFO] RX LPF configured
Setting frequency: DL=1878.4 Mhz, UL=1783.4 MHz for cc_idx=0 nof_prb=15
[INFO] Selected TX path: Band 2
[INFO] Tx calibration finished
[INFO] Rx calibration finished

Volver ao curso