Skip to main content

DevOps Beginners

To use the DevOps environment, we suggest the following workflow on the DevOps machines.

Determine the Correct Version

The first step is to know which version of the application you have on the cluster. Otherwise, you cannot determine which tag of the soure code to use for patching. To get the versions of the applications, you could use the list command from the CLI, by running:

cli list models

The output would look like this:

╭───────────────┬─────────────────────┬─────────────────────┬───────────────╮
│ MODEL NAME │ APPLICATION VERSION │ HELM CHART │ HYDRA VERSION │
├───────────────┼─────────────────────┼─────────────────────┼───────────────┤
│ oai-ran-model │ 2022.w40 │ oai-ran-model-1.0.0 │ v3.4.0 │
╰───────────────┴─────────────────────┴─────────────────────┴───────────────╯

We consider the variable {tag} to represent the application version, in this case 2022.w40.

In this tutorial, we only cover the workflow of DevOps for OAI RAN. The workflow for other applications is similar.

Build OAI RAN from Source Code

Preparing the Environment

If you are using the DevOps machine, you could skip cloning and simply move to the directory ~/networks/oai-ran. Otherwise, you need to clone the OAI RAN repository and install the required dependencies.

git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
cd openairinterface5g

Then we make sure of the right tag of the source code.

git pull
git checkout {tag}

source oaienv
cd cmake_targets

OAI project includes a build script build_oai located at the root of the openairinterface5g/cmake_targets directory. This script is developed to build the OAI binaries (executables, shared libraries) for different hardware platforms, and use cases.

TitleCommandInfo
Download the required packages./build_oai -i -IThis command is required only if in the PC OAI was never installed before
USRP 5G./build_oai --gNB --ninja -w USRP -C -cValid both for B2xx and N3xx
USRP 4G./build_oai --eNB --ninja -w USRP -C -cValid both for B2xx and N3xx
AW2S./build_oai --gNB -w AW2SORI -C -c --ninjaRemember to copy the libori.so in /usr/local/lib before compiling
OAI CU-DU both on the same machine./build_oai --gNB --ninja -w USRP -C -cDoes not require any specific command line. Use the command line of the radio target library that you will connect to the DU. For example in this case USRP
OAI CU (CU-DU in different machines)./build_oai --gNB --ninja -C -cTo build just the CU it is not required to specify any radio target
OAI DU (CU-DU in different machines)./build_oai --gNB --ninja -w USRP -C -cDoes not require any specific command line. Use the command line of the radio target library that you will connect to the DU. For example in this case USRP
AMARI SDR 5G./build_oai --gNB --ninja -w AMARISDR -C -cNOT PUBLIC
AMARI SDR 4G./build_oai --eNB --ninja -w AMARISDR -C -cNOT PUBLIC
OAI LTE UE./build_oai -w USRP --UE --ninjaUse OAI UE with USRP B210
OAI 5G UE./build_oai -w USRP --nrUE --ninjaUse OAI UE with USRP B210
OAI RF Simulator./build_oai --ninja --gNBNo RF simulator for LTE

The most useful building arguments explained:

ArgumentInfo
-IDownload external packages
-iInstall OAI required files for system
--eNBcompiles the LTE executable lte-softmodem
--gNBcompiles the 5G executable nr-softmodem
--UEcompiles OAI LTE UE lte-uesoftmodem
--nrUEcompiles OAI 5G UE nr-uesoftmodem
--ninjause ninja instead of make
-wspecifies the radio target link library
-CClean all, erase all the files from previous compilations
-cErase all the files and rebuild from start
-hOAI help for the command options
caution

If it is the first time that you are building the source code, you need to install the dependencies. This could be skipped in the DevOps machine.

Compile only the desired target library

caution

This procedure is possible only if the CMake is already done either manually or running at least once the build_oai.

It is possible to compile or recompile only the desired target library of the OAI project.

Example: You developed some new code or changed something in the OAI gNB. To save time it is possible to recompile just the gNB and not the full project (ASN, other libraries, etc.)

cd openairinterface5g/cmake_targets/ran_build/build/
# to compile the gNB
ninja nr-softmodem
# to compile the eNB
ninja lte-softmodem

The same applies to the radio target libraries.

Example: You compiled the project without any radio target library, and then you want to be able to use it with USRP.

ninja liboai_usrpdevif

You then need either to create this symbolic link liboai_device.so -> liboai_usrpdevif.so, or add the following section in the configuration file specifying the target library to use.

device :
{
name = "oai_usrpdevif";
};

Check out the configuration reference for more information about the configuration file sections.

Running OAI RAN

This section collects the possible useful commands to run OAI project under different cases. Before burring the project be sure to have

  • a suitable configuration file. Check out the configuration reference for more information.
  • have your RU properly connected. Check out the RU notes for more information.
TitleCommandNotes
USRP 5G B2xxsudo ./nr-softmodem -O <path config file> --sa -E --continuous-txB2xx specific arguments
USRP 5G N3xxsudo ./nr-softmodem -O <path config file> --sa --usrp-tx-thread-config 1N3xx specific arguments
USRP 4G B210sudo ./lte-softmodem -O <path config file>B2xx
USRP 4G N300-
AW2Ssudo ./nr-softmodem -O <path config file> --saDo not use option --continuous-tx or other options specific to USRP
OAI CU-DU both on the same machineFor the CU sudo ./nr-softmodem -O <path config file> --sa, for the DU sudo ./nr-softmodem -O path config file> --sa -E --continuous-txRun twice the same executable nr-softmodem in different terminals. The DU does not require any specific command line. Simply use the command line adapted to the radio you are going to connect, in this case we provide an example for B210
OAI CU (CU-DU in different machines)sudo ./nr-softmodem -O <path config file> --saRun the OAI CU in the first machine
OAI DU (CU-DU in different machines)sudo ./nr-softmodem -O path config file> --sa -E --continuous-txRun the OAI DU in the second machine. The DU does not require any specific command line. Simply use the command line adapted to the radio you are going to connect, in this case we provide an example for B210
AMARI SDR 5Gsudo ./nr-softmodem -O <path config file> --saNot active for now. It accepts both options with or without -E. Amarisoft SDR card supports the full sampling frequency thanks to the PCIe connection but accepts also the 3/4 one
AMARI SDR 4Gsudo ./lte-softmodem -O <path config file>Not active for now. Not tested with the new version
OAI LTE UE??
OAI 5G UE??
OAI RF Simulator??
ArgumentInfo
-OSpecify the conf file location
-EIf present applies the 3/4 sampling frequency. It is mandatory for the 5G SA B210 because the board cannot support the full sampling rate
--continuous-txoption to be added for the execution ONLY with USRPs to maximize the throughput
--saoption to activate the 5G SA. If you don't put it the program will run in NSA mode
--usrp-tx-thread-configAdd additional threads to the TX. Use it only with USRP N3xx
-huse OAI help option to see more running parameters

OAI 5GC via Snaps

Installation

tip

You could skip this step on a DevOps machine.

Identify the interfaces to be used for the NGAP protocol. Since in this example OAI-RAN and OAI-CN are running on the same machine the local interface will be used. These IP addresses are important also for the configuration of the gNB. If you need to run the CN in a different host then the gNB, simply substitute the IP addresses of this example with the appropriate ones to connect the two machines.

#interface name
lo
# AMF IP address for ngap
127.5.2.2
# gNB IP address to connect to AMF
127.5.2.130

Checkout the Hydra Snap Guide for more information about the installation of the OAI 5GC.

Adding UEs to the database

sudo oai-db.init sql
# Initiating the whole db as in the fist command or this alternative allows just to initiate the 5G Database
sudo oai-db.add-user-5g # follow the instructions
sudo oai-db.get-user-5g # check the user has been added

The SIM card we will use for this setup has the following parameters:

imsi: "505010100000003",
opc : "C42449363BBAD02B66D16BC975D77CC1",
K : "fec86ba6eb707ed08905757b1bb44b8f",

Check if the UE you want to use is already registered in the 5G database:

sudo oai-db.get-user-5g
[sudo] password for aigrette:
Thu, 17 Mar 2022 07:51:53 +0100: [INF] Synchronizing the configuration.
+-----------------+---------------------------+------------------------------------+------------------------------------+
| imsi | mmeidentity_idmmeidentity | key | OPc |
+-----------------+---------------------------+------------------------------------+------------------------------------+
| 505010000000001 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000002 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000003 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000004 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000005 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000006 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000007 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000008 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000009 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000010 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000011 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000012 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000013 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000014 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000015 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000016 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000017 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000018 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000019 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
| 505010000000020 | 1 | 0x8BAF473F2F8FD09487CCCBD7097C6862 | 0x8E27B6AF0E692E750F32667A3B14605D |
+-----------------+---------------------------+------------------------------------+------------------------------------+

The SIM card is not inserted, so we proceed to insert it manually.

sudo oai-db.add-user-5g
Thu, 17 Mar 2022 07:55:44 +0100: [INF] Synchronizing the configuration.
Please specify the value for AMF_ID (default 1): # leave the default one by simpling press ENTER key
Please specify the value for IMSI (default 505010000000001): 505010100000003 # specific for your sim card
Please specify the value for KEY (default 8baf473f2f8fd09487cccbd7097c6862): fec86ba6eb707ed08905757b1bb44b8f # specific for your sim card
Please specify the value for OPC (default 8e27b6af0e692e750f32667a3b14605d): C42449363BBAD02B66D16BC975D77CC1 # specific for your sim card

Double check that your UE is properly connected with sudo oai-db.get-user-5g

if you mistake some values:

sudo oai-db.sql
#once enter in the sql database do your query. For example in this case I want to modify the OPC of my user due to a typo I will do:
UPDATE users set users.OPc=0xC42449363BBAD02B66D16BC975D77CC1 where users.imsi='505010100000003';

AMF Configuration

The NGAP_AMF address is already configured by default.

NGAP_AMF :
{
INTERFACE_NAME = "lo";
IPV4_ADDRESS = "127.5.2.2/24";
PORT = 38412;
PPID = 60;
};

Change the operator Key with the one used by the operator of the SIM cards you are using:

# In our case
OPERATOR_key = "C42449363BBAD02B66D16BC975D77CC1"; # see SIM information

SMF Configuration

In the PDU_SESSION_TYPE check that there is the APN you will be using. In our case it "operator" "IPv4" is already defined in the given configuration.

DNN_LIST :
(
{
DNN_NI = "operator";
PDU_SESSION_TYPE = "IPv4";
IPV4_RANGE = "12.1.1.2 - 12.1.1.128";
IPV6_PREFIX = "2001:1:2::/64";
},
{
DNN_NI = "internet";
PDU_SESSION_TYPE = "IPv4";
IPV4_RANGE = "12.1.1.129 - 12.1.1.224";
IPV6_PREFIX = "3001:1:2::/64";
}
);

The same applies for section DEFAULT_SESSION_TYPE, the configured default APN "operator" "IPV4" with slice (default Row Commercial) "1 - 0x000000" are provided by default

SESSION_MANAGEMENT_SUBSCRIPTION_LIST :
(
{
NSSAI_SST = 1;
NSSAI_SD = "0x000000";
DNN = "operator";
DEFAULT_SESSION_TYPE = "IPV4";
DEFAULT_SSC_MODE = 1;
QOS_PROFILE_5QI = 6;
QOS_PROFILE_PRIORITY_LEVEL = 1;
QOS_PROFILE_ARP_PRIORITY_LEVEL = 1;
QOS_PROFILE_ARP_PREEMPTCAP = "NOT_PREEMPT";
QOS_PROFILE_ARP_PREEMPTVULN = "NOT_PREEMPTABLE";
SESSION_AMBR_UL = "20Mbps";
SESSION_AMBR_DL = "22Mbps";
},
)

Modify the DNS with the one of your network

# DNS address communicated to UEs
DEFAULT_DNS_IPV4_ADDRESS = "192.168.106.10";
DEFAULT_DNS_SEC_IPV4_ADDRESS = "192.168.106.12";
tip

To be sure of the DNS IP addresses to use one can check it with the command

systemd-resolve --status | grep 'DNS Servers' -A2
#moutput is
DNS Servers: 192.168.106.10
192.168.106.12

SPGWU Configuration

Be sure that in section UPF_INFO the attributes corresponding to the slice descriptor match the Quectel Row commercial and to the DNN descriptor match the name "operator" as for the configuration of the previous components.

        UPF_INFO
(
{
NSSAI_SST = 1;
NSSAI_SD = "0x000000";
DNN_LIST :
(
{
DNN = "operator";
}
);
}
);

Modify the IP address for S1-U communication with gNB

S1U_S12_S4_UP :
{
# S-GW binded interface for S1-U communication (GTPV1-U) can be ethernet interface
INTERFACE_NAME = "lo";
IPV4_ADDRESS = "127.5.2.2/24"; # modifed
...etc..

Modify the SX interface IP address with the one for the 5G:

SX :
{
# S/P-GW binded interface for SX communication
INTERFACE_NAME = "lo";
IPV4_ADDRESS = "127.5.4.131/24";

Also remove from the list the addresses for the 4G range

 # IP address of SX of PGW-C (i.e. SXC)
SPGW-C_LIST :
(
/*{
IPV4_ADDRESS = "127.4.30.2"; #remove
},*/
{
IPV4_ADDRESS = "127.5.4.2"; #keep
}
);

Configure the Interface name to the one of your sistem. The interface connected to internet

SGI :
{
# no config to set, the software will set the SGi interface to the interface used for the default route.
INTERFACE_NAME = "eno1";
IPV4_ADDRESS = "192.168.12.61";

Run the Snaps

Run the snaps in 4 different terminals

sudo oai-db.mdb
sudo oai-amf
sudo oai-smf
sudo oai-spgwu

In the gNB configuration file

Make sure that you are using the local addresses:

    ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "127.5.2.2";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);


NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "lo";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "127.5.2.130/24";
GNB_INTERFACE_NAME_FOR_NGU = "lo";
GNB_IPV4_ADDRESS_FOR_NGU = "127.5.2.130/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};

}

Patch using CDK

** 🚧 UNDER CONSTRUCTION 🚧 **