srsran / srsRAN_Project

Open source O-RAN 5G CU/DU solution from Software Radio Systems (SRS) https://docs.srsran.com/projects/project
https://www.srsran.com
GNU Affero General Public License v3.0
514 stars 173 forks source link

Failed to unpack E2SM KPM Action Definition #471

Closed PauBaguer closed 6 months ago

PauBaguer commented 8 months ago

Issue Description

Using the latest version of srsRAN and O-RAN SC i-release, I'm unable to run the KPIMON-go xApp due to a failure in decoding the RIC Subscription Request that arrives to srsRAN.

This problem causes the variable is_ind_msg_ready_ to always be in false and thus Indication messages are never sent.

Setup Details

We are using branch br-flexric after following the tutorial, as well as the latest version of srsRAN Project.

The code in O-RAN SC i-release is slightly modified to work around some internal communications bugs, in our view those changes should not affect the current problem.

logger.info() lines have been added to srsRAN Project to aid code understanding and debugging. (It should not affect message decoding either.)

Expected Behaviour

We expect the gNB to correctly decode all E2AP messages and start reporting KPM metrics via periodic RIC Indication messages.

Actual Behaviour

gnb.log At the start.

2024-02-13T11:33:04.016656 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbAvailDl", level cannot be supported.
2024-02-13T11:33:04.016659 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbAvailDl", cell scope has to be supported.
2024-02-13T11:33:04.016661 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbAvailUl", level cannot be supported.
2024-02-13T11:33:04.016661 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbAvailUl", cell scope has to be supported.
2024-02-13T11:33:04.016662 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbTotDl", level cannot be supported.
2024-02-13T11:33:04.016663 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbTotDl", cell scope has to be supported.
2024-02-13T11:33:04.016664 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbTotUl", level cannot be supported.
2024-02-13T11:33:04.016664 [E2SM-KPM] [D] Wrong definition of the supported metric: "RRU.PrbTotUl", cell scope has to be supported.

gnb.log receiving E2setupResponse.

2024-02-13T11:33:04.024290 [E2      ] [I] Generate RAN function definition for OID: 1.3.6.1.4.1.53148.1.2.2.2
2024-02-13T11:33:04.024530 [E2      ] [I] Added RAN function OID 1.3.6.1.4.1.53148.1.2.2.2 to candidate list under RAN Function ID 2
2024-02-13T11:33:04.024939 [E2-ASN1-PCK] [I] Received PDU of 60 bytes
2024-02-13T11:33:04.025031 [E2      ] [I] Handling E2 PDU of type successfulOutcome
2024-02-13T11:33:04.025034 [E2      ] [I] E2AP msg, "successfulOutcome.E2setupResponse", transaction id=0
2024-02-13T11:33:04.025042 [E2      ] [I] E2 Setup procedure successful.
2024-02-13T11:33:04.025055 [E2      ] [I] Received E2 Setup Response message
2024-02-13T11:33:04.025061 [E2      ] [I] Added supported RAN function with id 2 and OID 1.3.6.1.4.1.53148.1.2.2.2

gnb.log when receiving E2subscriptionRequest (where the failure occurs)

2024-02-13T11:33:14.032921 [E2-ASN1-PCK] [I] Received PDU of 340 bytes
2024-02-13T11:33:14.033065 [E2      ] [I] Handling E2 PDU of type initiatingMessage
2024-02-13T11:33:14.033068 [E2      ] [I] E2AP SDU, "initiatingMessage.RICsubscriptionRequest"
2024-02-13T11:33:14.033069 [E2      ] [I] Received RIC Subscription Request
2024-02-13T11:33:14.033074 [E2      ] [I] E2AP: Received subscription request
2024-02-13T11:33:14.033121 [ASN1    ] [E] The condition lb <= n <= ub (1 <= 55365 <= 32768) was not met

2024-02-13T11:33:14.033123 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/include/srsran/asn1/e2ap/../asn1_utils.h][1152] Decoding failure.
2024-02-13T11:33:14.033124 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3337] Decoding failure.
2024-02-13T11:33:14.033125 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/include/srsran/asn1/e2ap/../asn1_utils.h][1155] Decoding failure.
2024-02-13T11:33:14.033126 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3483] Decoding failure.
2024-02-13T11:33:14.033127 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3798] Decoding failure.
2024-02-13T11:33:14.033128 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3580] Decoding failure.
2024-02-13T11:33:14.033146 [E2-SUBSCRIBER] [I] myE2KPM: start_subscritpion - start
2024-02-13T11:33:14.033149 [ASN1    ] [E] The condition lb <= n <= ub (1 <= 55365 <= 32768) was not met

2024-02-13T11:33:14.033150 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/include/srsran/asn1/e2ap/../asn1_utils.h][1152] Decoding failure.
2024-02-13T11:33:14.033151 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3337] Decoding failure.
2024-02-13T11:33:14.033152 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/include/srsran/asn1/e2ap/../asn1_utils.h][1155] Decoding failure.
2024-02-13T11:33:14.033152 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3483] Decoding failure.
2024-02-13T11:33:14.033153 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3798] Decoding failure.
2024-02-13T11:33:14.033154 [ASN1    ] [E] [/home/i2cat/srsRAN_Project/lib/asn1/e2ap/e2sm_kpm.cpp][3580] Decoding failure.
2024-02-13T11:33:14.033170 [E2SM-KPM] [I] e2sm_kpm_report_service_style3::e2sm_kpm_report_service_style3
2024-02-13T11:33:14.033173 [E2-SUBSCRIBER] [I] myE2KPM: start_subscritpion - launch e2_indication_procedure
2024-02-13T11:33:14.033177 [E2-SUBSCRIBER] [I] myE2KPM: e2_indication_procedure::operator() - start
2024-02-13T11:33:14.033177 [E2-SUBSCRIBER] [I] myE2KPM: e2_indication_procedure::operator() - running
2024-02-13T11:33:14.033180 [E2-SUBSCRIBER] [I] myE2KPM: e2_indication_procedure::operator() - 1000 millis
2024-02-13T11:33:14.033181 [E2-SUBSCRIBER] [I] myE2KPM: start_subscritpion - end
2024-02-13T11:33:14.033183 [E2      ] [I] E2AP: Sending subscription response

gnb.log: These messages are periodically present.

2024-02-13T11:33:12.900423 [E2SM-KPM] [D] Received RLC metrics: ue=0 DRB1.

Console

-> % sudo ./srsRAN_Project/cmake-build-debug/apps/gnb/gnb -c /home/i2cat/srsRAN_Project/configs/gnb_zmq.yaml

The PRACH detector will not meet the performance requirements with the configuration {Format 0, ZCZ 0, SCS 1.25kHz, Rx ports 1}.
Lower PHY in executor blocking mode.

--== srsRAN gNB (commit 32dae89ea) ==--

Connecting to AMF on 172.27.7.6:38412
Available radio types: uhd and zmq.
Connecting to NearRT-RIC on 172.27.7.15:32222
Cell pci=1, bw=20 MHz, dl_arfcn=368500 (n3), dl_freq=1842.5 MHz, dl_ssb_arfcn=368410, ul_freq=1747.5 MHz

==== gNodeB started ===
Type <t> to view trace
Failed to unpack E2SM KPM Action Definition
Failed to unpack E2SM KPM Action Definition
q
Stopping ..

Steps to reproduce the problem

A "simulator" is provided at https://github.com/PauBaguer/o-ran-sc_i-release_kpimon-go_simulator to quickly simulate the messages sent by the RIC without needing it.

gNB config file:

# This configuration file example shows how to configure the srsRAN Project gNB to allow srsUE to connect to it.
# This specific example uses ZMQ in place of a USRP for the RF-frontend, and creates an FDD cell with 10 MHz bandwidth.
# To run the srsRAN Project gNB with this config, use the following command:
#   sudo ./gnb -c gnb_zmq.yaml

amf:
  addr: 172.27.7.6
  bind_addr: 172.27.7.15

ru_sdr:
  device_driver: zmq                # The RF driver name.
  device_args: tx_port=tcp://127.0.0.1:2000,rx_port=tcp://127.0.0.1:2001,base_srate=23.04e6 # Optionally pass arguments to the selected RF driver.
  srate: 23.04                      # RF sample rate might need to be adjusted according to selected bandwidth.
  tx_gain: 75                       # Transmit gain of the RF might need to adjusted to the given situation.
  rx_gain: 75                       # Receive gain of the RF might need to adjusted to the given situation.

cell_cfg:
  dl_arfcn: 368500                  # ARFCN of the downlink carrier (center frequency).
  band: 3                           # The NR band.
  channel_bandwidth_MHz: 20         # Bandwith in MHz. Number of PRBs will be automatically derived.
  common_scs: 15                    # Subcarrier spacing in kHz used for data.
  plmn: "00101"                     # PLMN broadcasted by the gNB.
  tac: 7                            # Tracking area code (needs to match the core configuration).
  pdcch:
    common:
      ss0_index: 0                  # Set search space zero index to match srsUE capabilities
      coreset0_index: 12            # Set search CORESET Zero index to match srsUE capabilities
    dedicated:
      ss2_type: common              # Search Space type, has to be set to common
      dci_format_0_1_and_1_1: false # Set correct DCI format (fallback)
  prach:
    prach_config_index: 1           # Sets PRACH config to match what is expected by srsUE

log:
  filename: /tmp/gnb.log            # Path of the log file.
  all_level: info                   # Logging level applied to all layers.
  hex_max_size: 0

pcap:
  mac_enable: false                 # Set to true to enable MAC-layer PCAPs.
  mac_filename: /tmp/gnb_mac.pcap   # Path where the MAC PCAP is stored.
  ngap_enable: false                # Set to true to enable NGAP PCAPs.
  ngap_filename: /tmp/gnb_ngap.pcap # Path where the NGAP PCAP is stored.
  e2ap_enable: true                 # Set to true to enable E2AP PCAPs.
  e2ap_filename: /tmp/gnb_e2ap.pcap # Path where the E2AP PCAP is stored.

e2:
  enable_du_e2: true                # Enable DU E2 agent (one for each DU instance)
  e2sm_kpm_enabled: true            # Enable KPM service module
  addr: 172.27.7.15 #10.108.129.80                    # RIC IP address
  bind_addr: 172.27.7.15           # A local IP that the E2 agent binds to for traffic from the RIC. ONLY required if running the RIC on a separate machine.
  port: 32222 # 36422                      # RIC port

metrics:
  rlc_json_enable: 1                # Enable RLC metrics reporting
  rlc_report_period: 1000           # Set reporting period to 1s%

Additional Information

PCAP capture: srsRAN-fail-to-decode-RICsubscriptionRequest.pcapng.txt

pgawlowicz commented 8 months ago

@PauBaguer Thanks for all details, I will investigate this issue.

GinesGarcia commented 8 months ago

Hi @PauBaguer , I've been facing the same issue. Any update on that?

Regards, Ginés.

PauBaguer commented 8 months ago

Hello @GinesGarcia, No news from my side, @pgawlowicz have you been able to pinpoint the source of the problem?

Thanks, Pau

P4sca1 commented 8 months ago

Hey @PauBaguer, I am currently working on a similar setup as yours:

I already managed to deploy the same setup using FlexRIC instead of the O-RAN Near-RT-RIC and was able to read metrics from a FlexRIC xApp. Now I want to tdo the same with the O-RAN RIC. I am at a point where the RIC and xApp are successfully deployed and the srsRAN gNodeB successfully connects to the RIC. I can see E2SetupRequest and E2SetupResponse in the pcap. However, I do not see any E2SubscriptionRequest - neither in the logs, nor in the pcaps. Have you changed something in the code of the kpimon-go app to make it compatible with srsRAN?

PauBaguer commented 7 months ago

Hello @P4sca1, Yes, I modified the xApp as well as the submgr component to work around bugs.

fklement commented 7 months ago

Hello @P4sca1, Yes, I modified the xApp as well as the submgr component to work around bugs.

Could you share what you needed to fix?

P4sca1 commented 7 months ago

I would also be interested in this. I found out that in order for the E2SubscriptionMessage to be sent, the gNB needs to be already connected when the kpimon-go xApp is started. However, the xApp crashes when trying to send the message.

pgawlowicz commented 6 months ago

Hi @PauBaguer, We have just released a repository that allows running ORAN-SC-RIC as a multi-container Docker application with a single docker command. You can find it here: https://github.com/srsran/oran-sc-ric

In addition, the repository provides two example Python-based xApps that allow requesting and monitoring E2 metrics from the gNB using all reporting styles (1-5) of the e2sm-kpm module (which was updated to version 3).

The Quick Start section in the readme file demonstrates how to use it. Note that until the next code release, you have to use the test branch from the srsRAN_Project repository.

pgawlowicz commented 6 months ago

Hi, I close this issue, as with the ORAN SC RIC we show that our E2 agent works correctly with all KPM Report Styles (1-5).