Skip to content

gNB Configuration

⚠️ RF Compliance Warning - Read Before Configuring!

Before configuring and starting the gNB for radio transmission, ensure you have:

  1. ✅ Read RF Regulations & Compliance
  2. ✅ Prepared an RF shielded box or cable connection + attenuator
  3. ✅ Understood the legal consequences of illegal transmission (5-15 days detention)

If you just want to test software functionality, use ZMQ simulation mode without connecting SDR hardware.

This page details the srsRAN gNB configuration parameters.

Configuration File Structure

gNB uses YAML format configuration:

yaml
gnb_id: 411
gnb_id_bit_length: 22

cell_cfg:
  # Cell configuration
  
cu_cp:
  # CU-CP configuration
  
ru_sdr:
  # SDR configuration
  
log:
  # Logging configuration

Complete Configuration Example

USRP B210 Configuration

yaml
# gNB Identity
gnb_id: 411
gnb_id_bit_length: 22

# Cell Configuration
cell_cfg:
  dl_arfcn: 632628          # n78 band center frequency
  band: 78                   # NR band
  channel_bandwidth_MHz: 20  # Bandwidth
  common_scs: 30             # Subcarrier spacing (kHz)
  plmn: "00101"              # PLMN
  tac: 1                     # Tracking Area Code

  pdcch:
    common:
      ss0_index: 0
      coreset0_index: 12
    dedicated:
      ss2_type: common
      dci_format_0_1_and_1_1: false

  prach:
    prach_config_index: 1

# CU-CP Configuration (Core Network Connection)
cu_cp:
  amf:
    addr: 192.168.1.10       # AMF address
    port: 38412              # NGAP port
    bind_addr: 192.168.1.20  # gNB local address
    n2_bind_addr: 192.168.1.20
    n2_bind_interface: eth0  # Optional

  upf:
    bind_addr: 192.168.1.20  # N3 interface address

# SDR Configuration
ru_sdr:
  device_driver: uhd         # USRP driver
  device_args: type=b200     # Device parameters
  srate: 23.04               # Sample rate (MHz)
  tx_gain: 50                # TX gain (dB)
  rx_gain: 40                # RX gain (dB)
  
  # Clock configuration
  clock: internal            # internal/external/gpsdo
  sync: internal

# Logging Configuration
log:
  filename: /tmp/gnb.log
  all_level: info            # debug/info/warning/error
  phy_level: info
  mac_level: info
  rlc_level: info
  pdcp_level: info
  rrc_level: info
  ngap_level: info

# Performance Configuration
expert:
  phy:
    threads:
      pdsch:
        nof_threads: 2
      pusch:
        nof_threads: 2

Key Parameters

Cell Parameters

ParameterDescriptionCommon Values
dl_arfcnDownlink Absolute Radio Frequency Channel NumberSee band table
bandNR band number78, 41, 3, etc.
channel_bandwidth_MHzChannel bandwidth10, 20, 40, 100
common_scsSubcarrier spacing15, 30 kHz
plmnPublic Land Mobile NetworkMust match Open5GS
tacTracking Area CodeMust match Open5GS

Band and ARFCN

Common n78 band ARFCNs:

Center FrequencyARFCNSCS
3.5 GHz63262830 kHz
3.6 GHz63666630 kHz
3.7 GHz64070430 kHz

Core Network Connection

ParameterDescription
amf.addrOpen5GS AMF IP address
amf.portNGAP port, default 38412
amf.bind_addrgNB local IP
upf.bind_addrN3 interface bind address

Start gNB

bash
# Foreground
sudo gnb -c gnb.yaml

# Background
sudo gnb -c gnb.yaml > /tmp/gnb.log 2>&1 &

Verify Connection

Check AMF Connection

On successful connection, gNB logs show:

[NGAP   ] NG Setup procedure successful
[NGAP   ] AMF connected

Open5GS AMF logs show:

[amf] INFO: gNB-N2 accepted[192.168.1.20]:38412

Troubleshooting

NGAP Connection Failed

[NGAP   ] Failed to connect to AMF

Check:

  1. AMF address and port are correct
  2. Network connectivity ping 192.168.1.10
  3. AMF service is running
  4. Firewall rules

PLMN Mismatch

[NGAP   ] NGAP Setup Failure - Unknown PLMN

Ensure plmn matches Open5GS configuration.

Next Steps

Released under the MIT License.