Skip to main content

End-to-end 5G Network Creation

· 3 min read
Murat Sever

In this post, we are creating a 5G standalone (SA) network using srsRAN. We will use a COTS UE, Redmi Note 12 Pro 5G and USRPB210 Software Defined Radio (SDR) from NI to attach with the gNB we have created.

srsRAN 5G Stack

The srsRAN Project is a complete open-source RAN solution from SRS which is 3GPP and O-RAN compliant. It is entirely developed by SRS with minimal external dependencies. It supports FDD/TDD on all FR1 bands. srsRAN Image

srsRAN can be installed in two ways. One way is to use binary packets suited to your distribution. The other that we have also used is to install it from source. srsRAN gNB is configured using YAML configuration files. It supports nested configuration parameters. Configuration can be arbitrarily split across multiple files. Any parameter not explicitly configured uses default values. Documentation contains full list of configuration parameters.

In this work, the core network and gNB will run on the same machine, a powerful Victus (HP) laptop. USRP B210 is directly plugged into USB3 port. So, don't use a USB hub unless it's very high performant. We are not using any external clock in our setup, but it's recommended to use one if available. 5G setup

COTS UE (5G Phone) Selection

This is a very critical step. Because many phones advertised as 5G are only NSA. They always prefer to attach to 4G. Don't use a phone bought from operator since those phones will be locked to specific PLMN values. You can check known mobile phones reported as working from srsRAN documentation. You should also add the SIM credentials to the 5GC subscriber list. This is well documented in the docs as well. If you want internet access from the phone you should set IP forwarding and masquerade.

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o <internet_nic> -j MASQUERADE

Running

Now it's time to take the phone out of airplane mode, try to attach to the cell. Every second we see some statistics on the console, like shown below. PDU session is created, UE is assigned an IP, and I can ping the UE from gNB. 5G console

The following metrics are provided in the console output:

metricDefinition
pciPhysical Cell Identifier
rntiRadio Network Temporary Identifier (UE identifier)
cqiChannel Quality Indicator reported by the UE (1-15)
mcsModulation and coding scheme (0-28)
brateBitrate (bits/sec)
okNumber of packets successfully sent
nokNumber of packets dropped
(%)% of packets dropped
puschPUSCH SINR (Signal-to-Interference-plus-Noise Ratio)
bsrBuffer Status Report - data waiting to be transmitted as reported by the UE (bytes)

More to come on enhancing the speed of the connection.