RF simulator, 1 eNB, 2 UEs, all-in-one

This tutorial explains how to connect 2 UEs to a eNB, with simulated RF board, on same machine.

It reuse the other tutorials we published in a quite complex IP addresses configuration

Constrains

  1. 50 RB (10MHz) as it seems current commit in develop branch doesn’t work well on 100RB
  2. Full mode, with EPC: the noS1 mode seems to not work with two UEs

Let’s go

RF simulator and OAI UE tutorial

Do this tutorial, with the UE on same machine option.

To install EPC, eNB, use all-in-one tuto, with latest commit in develop branch

      • you can add –ninja on ./build_oai … and replace all “make” by “ninja” that will be faster compilation for same result

you should reach one UE in traffic, all on one machine

Now, we will add the second UE

Make a second SIM

The UE always use the current directory files for SIM files
( hidden files: .usim.nvram0,  .ue.nvram0, .ue_emm.nvram0)

so we make a second directory and create the files in this directory

cd ..
mkdir build2
cd build2
cp ~/opencells-mods/sim.conf sim2.conf
# edit the file: change only the msin: MSIN="0100001112";
../../nas_sim_tools/build/conf2uedata -c sim2.conf -o .

Make a second network namespace

sudo ip netns delete ueNameSpace2
sudo ip link delete v-eth2
sudo ip netns add ueNameSpace2
sudo ip link add v-eth2 type veth peer name v-ue2
sudo ip link set v-ue2 netns ueNameSpace2
sudo ip addr add 10.201.1.1/24 dev v-eth2
sudo ip link set v-eth2 up
sudo iptables -t nat -A POSTROUTING -s 10.201.1.0/255.255.255.0 -o enp0s31f6 -j MASQUERADE
sudo iptables -A FORWARD -i enp0s31f6 -o v-eth2 -j ACCEPT
sudo iptables -A FORWARD -o enp0s31f6 -i v-eth2 -j ACCEPT
sudo ip netns exec ueNameSpace2 ip link set dev lo up
sudo ip netns exec ueNameSpace2 ip addr add 10.201.1.2/24 dev v-ue2
sudo ip netns exec ueNameSpace2 ip link set v-ue2 up
sudo ip netns exec ueNameSpace2 bash

Run the second UE

cd build2
ip netns exec ueNameSpace2 bash
./lte-uesoftmodem -C 2685000000 -r 50 --rfsim --rfsimulator.serveraddr 10.201.1.1

Traffic test

In one more window, launch some traffic in the second UE

ip netns exec ueNameSpace2 bash
ping -I oaitun_ue1 10.201.1.1

 

15 thoughts on “RF simulator, 1 eNB, 2 UEs, all-in-one”

  1. Hello Laurent,

    I am currently trying out connecting 2 UE’s via rfsim to 1 enb.
    My setup is a bit different than yours since i am using 4 devices for it. 1 eNB, 1 EPC, 2 UEs.

    When I am using just 1 UE it connects to the EPC network and get’s the IP address and can ping the EPC with it. But when i try to connect the 2nd UE , i do not get any IP address and the first UE gets disconnect with following message:

    [HW] Received Rx/Tx synchro out of order

    The second UE stops after :

    [HW] rfsimulator: connection established
    rfsimulator: Success
    [HW] Scheduler policy=1 priority=40 affinity=[8]YYYYYYYY label=UE_thread
    [HW] UE got first timestamp: starting at 744629759

    Do you have any solution for that ? My aim is to get a IP address for both UEs and ping each other.

    I am using the current develop branch for eNB and UE, and some old EPC branch.

    Thank you in advance.
    Regards

    Christopher

    1. Hi Christopher,
      It should work, if the EPC routes correctly the packets at the edge (SGi interface)
      If you use current (or recent) develop branch commit for oai RAN, i would debug your issue.
      If yes, please send me the command lines, the config files by email or on this page

  2. Hello Laurent,

    Trying to follow this tutorial i am getting the same issue as described by Christopher.

    My setup is based in docker containers, with eNB and the 2 UEs in individual containers.
    The first UE, independent of which one is first, connects correctly and has connectivity. The second UE gets stuck on this “[HW] UE got first timestamp: starting at 384034559”, where the first UE no longer has a connection to the CN, or outside world for that matter.
    I am running with the magma-mme, and as mentioned the first UE gets connected, but the second one crashes it, so i am stumped as to how this occurs, and hoped to ask for your help in this matter.

    Best regards
    Andreas

  3. Hello Laurent,

    My environment is docker, I build the software with ubuntu image and the build command:sudo ./build_oai -I –gNB -x –nrUE –install-system-files -w SIMU –build-lib telnetsrv
    Run gnb with command:sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf –rfsim –sa –rfsimulator.options chanmod –rfsimulator.modelname AWGN -E
    Run ue with command: sudo ./nr-uesoftmodem -r 106 –numerology 1 –band 78 -C 3619200000 –rfsim –sa –nokrnmod -E -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/ue.conf
    and when the UE try to access the gnb, the error log as below, hoped for your help for this issue, and this issue confuse me long time. if you need more log, and can provide more detail info.

    [NR_PHY] [gNB 0][RAPROC] Frame 675, slot 19 Initiating RA procedure with preamble 37, energy 54.0 dB (I0 389, thres 120), delay 0 start symbol 0 freq index 0
    [MAC] UL_info[Frame 675, Slot 19] Calling initiate_ra_proc RACH:SFN/SLOT:675/19
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] [gNB 0][RAPROC] CC_id 0 Frame 675 Activating Msg2 generation in frame 676, slot 7 using RA rnti 10b SSB, new rnti b7c0 index 0 RA index 0
    [NR_MAC] [gNB 0][RAPROC] CC_id 0 Frame 676, slotP 7: Generating RA-Msg2 DCI, rnti 0x10b, state 1, CoreSetType 2
    [NR_MAC] [RAPROC] Msg3 slot 17: current slot 7 Msg3 frame 676 k2 7 Msg3_tda_id 3
    [NR_MAC] [gNB 0][RAPROC] Frame 676, Subframe 7: rnti b7c0 RA state 2
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] handle harq for rnti b7c0, in RA process
    [NR_MAC] [gNB 0][RAPROC] Frame 677, Slot 10 : CC_id 0 Scheduling retransmission of Msg3 in (677,17)
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] handle harq for rnti b7c0, in RA process
    [NR_MAC] [gNB 0][RAPROC] Frame 678, Slot 10 : CC_id 0 Scheduling retransmission of Msg3 in (678,17)
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] handle harq for rnti b7c0, in RA process
    [NR_MAC] [gNB 0][RAPROC] Frame 679, Slot 10 : CC_id 0 Scheduling retransmission of Msg3 in (679,17)
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] Random Access 0 failed at state 2 (Reached msg3 max harq rounds)
    [NR_MAC] Search for not existing rnti (ignore for RA): b7c0
    [NR_MAC] handle harq for rnti b7c0, in RA process
    [NR_MAC] handle_nr_ul_harq(): unknown RNTI 0xb7c0 in PUSCH
    [NR_PHY] [gNB 0][RAPROC] Frame 685, slot 19 Initiating RA procedure with preamble 37, energy 54.0 dB (I0 393, thres 120), delay 0 start symbol 0 freq index 0

    1. Dear Bergen,
      It seems ok, i suggest to remove the channel simulation (remove –rfsimulator.options chanmod –rfsimulator.modelname AWGN)
      Then, if the UE can connect, we will have to tune the channel simulation parameters (pathloss, noise, …)

  4. Hi @laurent!

    How can we change a scheduling algorithm from default one to any other in 5G SA setup?

    Your suggestion is highly appreciated!

    BR, Venaktesh G

  5. Hello Laurent,

    When running multiple UEs, is the interference between them taken into account by the rfsimulator? I am considering SINR, so the interference is an important part.

    Thank you & Kind regards,
    Duc Tung

    1. Hi,
      Yes it is.

      If you don’t use --rfsimulator.options chanmod you are in transparent transmission mode, so the UE signals are sum up
      As the gNB likely schedule each UE on different UL resources, it should not interfer.

      If you use chanmod and the telnet server to control the channels, you can set different signal attenuation (pathloss) or noise added on each UE
      This mode is quite complex to use, a more detailed tutorial would help, nevertheless you can use some gdb session and/or the softscope to understand better how the channell model paramters are applied (block in rxAddInput() function)

      Regards,
      Laurent

  6. Hi Laurent,
    I am trying to use 3 cell phones to OAI 5G SA testbed with open-cell SIMs. I have configured those SIM cards, should i need to configure NetName spaces for these SIM cards to get attached to the OAI 5G testbed?

    1. Hi,
      no relation with SIM cards
      of course, you need to set 3subscriptions, so different IMSI
      name spaces are for the OAI UE, that doesn’t work with HW SIMs for now.
      Maybe re-read and refine your question ?

      1. Hi Laurent,
        Thanks for your quick response. In my testbed I am using Flexric with Sqlite3 db whereas in my RAN i a using mysql db (COTS Tutorial). I believe my SIM cards info should match with the db, not sure which db should I match with? Suppose I have 3 phones with following information – 3 IMSIs, opc, key. Shouldn’t these information match in OAI Sqlite3 for FlexRIC or MYSQL database for COTS Tutorial?

      2. what do you mean by …..”that doesn’t work with HW SIMs for now.”? Can’t we use multiple HW SIMs with 5G SA testbed? so 3 different IMSI name spaces only for soft UE, not with the actual phones, right? Can’t I use multiple Phones either with OAI RAN or srsRAN RAN?

        1. Hi,
          OpenAir UE uses only software SIM (the configuration file).
          If we want to connect the OAI UE to a commercial network, we will need to use the SIMs from the operator, so what i called HW SIM.

          so 3 different IMSI name spaces only for soft UE => yes
          I use multiple Phones either with OAI RAN or srsRAN RAN => yes

          Regards,
          LAurent

Leave a Reply

Your email address will not be published. Required fields are marked *