srsran / oran-sc-ric

Simplified ORAN SC RIC with improved usability and xApp examples
GNU Affero General Public License v3.0
39 stars 7 forks source link

No E2 connection error in real USRP #13

Closed LoganCome closed 6 months ago

LoganCome commented 6 months ago

Thanks a lot for the great resources! I am deploying the project in real usrp and UE. I made the following Steps:

  1. I deployed srsRAN and Open5GC, and I was able to establish and run a normal connection between the UE, gNB, and CN.

  2. I installed the oran-sc-ric

  3. I modified the gNB configuration with adding the following:

    e2:
    enable_du_e2: true                # Enable DU E2 agent (one for each DU instance)
    e2sm_kpm_enabled: true            # Enable KPM service module
    e2sm_rc_enabled: true             # Enable KPM service module
    addr: 10.0.2.10                   # RIC IP address
    bind_addr: 10.0.2.1               # 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: 36421                       # RIC port

    However, I encountered the following problem when running the xApp:

  4. The figure is the error output in app No E2 connectioand containers: Screenshot 2024-06-07 02:10:30 Screenshot 2024-06-07 02:14:01 Screenshot 2024-06-07 02:14:45

  5. The gNB log file gnb.log

  6. Contents of gNB configure file gnb_rf_x410_tdd_n78_20mhz.txt

The error is same with #4 , It seems like a problem that's easy to run into. As you said in #3 , oran-sc-ric is independent with srsRAN and CN. However, for a real USRP and CN scenario, what adaptations are necessary? I suspect that my configuration has omissions.

Could you please help and guide me? I would really appreciate it.

pgawlowicz commented 6 months ago

It seems the gnb e2 agent is not connected to RIC, is it?

In RIC logs, you should see sth similar to:

ric_rtmgr_sim       | 2024/04/02 11:07:39 POST /ric/v1/handles/associate-ran-to-e2t  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_001_001_00019b"]}] elapsed: 10.77µs
LoganCome commented 6 months ago

@pgawlowicz Hi! Thanks for your reply! But I think gnb e2 agent is connected to RIC, as the following output in gNB:

 sudo ./gnb -c ~/Documents/gnb_rf_x410_tdd_n78_20mhz.yml

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

--== srsRAN gNB (commit 2f90c8b60) ==--

Connecting to AMF on 192.168.18.196:38412
Available radio types: uhd.
[INFO] [UHD] linux; GNU C++ version 9.4.0; Boost_107100; UHD_4.5.0.HEAD-0-g471af98f
[INFO] [LOGGING] Fastpath logging disabled at runtime.
Making USRP object with args 'type=x4xx,num_recv_frames=64,num_send_frames=64,master_clock_rate=245.76e6,send_frame_size=8000,recv_frame_size=8000'
[INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=192.168.10.2,type=x4xx,product=x410,serial=32C3434,name=ni-x4xx-32C3434,fpga=X4_200,claimed=False,addr=192.168.10.2,num_recv_frames=64,num_send_frames=64,master_clock_rate=245.76e6,send_frame_size=8000,recv_frame_size=8000
[INFO] [MPM.PeriphManager] init() called with device args `fpga=X4_200,master_clock_rate=(245760000.0,),mgmt_addr=192.168.10.2,name=ni-x4xx-32C3434,num_recv_frames=64,num_send_frames=64,product=x410,recv_frame_size=8000,send_frame_size=8000,clock_source=internal,time_source=internal,initializing=True'.
[WARNING] [0/Radio#0] Attempting to set tick rate to 0. Skipping.
Connecting to NearRT-RIC on 10.0.2.10:36421
Cell pci=1, bw=20 MHz, dl_arfcn=632628 (n78), dl_freq=3489.42 MHz, dl_ssb_arfcn=632256, ul_freq=3489.42 MHz

==== gNodeB started ===
Type <t> to view trace
Late: 0; Underflow: 1; Overflow: 0;
Late: 0; Underflow: 1; Overflow: 0;
Late: 0; Underflow: 3; Overflow: 0;
Late: 0; Underflow: 2; Overflow: 0;

And the following is the launch output of the oran-sc-ric:

sudo docker-compose up
[sudo] password for eeuser: 
[+] Running 7/0
 ⠿ Container ric_dbaas           Created                                                                                                                                         0.0s
 ⠿ Container ric_e2mgr           Created                                                                                                                                         0.0s
 ⠿ Container ric_rtmgr_sim       Created                                                                                                                                         0.0s
 ⠿ Container python_xapp_runner  Created                                                                                                                                         0.0s
 ⠿ Container ric_submgr          Created                                                                                                                                         0.0s
 ⠿ Container ric_e2term          Created                                                                                                                                         0.0s
 ⠿ Container ric_appmgr          Created                                                                                                                                         0.0s
Attaching to python_xapp_runner, ric_appmgr, ric_dbaas, ric_e2mgr, ric_e2term, ric_rtmgr_sim, ric_submgr
ric_rtmgr_sim       | 2024/06/06 19:17:27 Server started on port 12020
ric_appmgr          | cp: cannot stat '/opt/ric/certificates/*': No such file or directory
ric_appmgr          | 2024/06/06 19:17:27 Using config file: /opt/ric/config/appmgr.yaml
ric_e2mgr           | {"ts":1717701448020,"crit":"INFO","id":"e2mgr","mdc":{"CONTAINER_NAME":"ric_e2mgr","HOST_NAME":"ric_e2mgr_host","PID":"1","POD_NAME":"e2mgr_pod","SERVICE_NAME":"ric_e2mgr_service","SYSTEM_NAME":"oran_sc_ric","e2mgr":"0.2.2","time":"2024-06-06T19:17:28Z"},"msg":"#app.main - Configuration {logging.logLevel: debug, http.port: 3800, rmr: { port: 3801, maxMsgSize: 65536}, routingManager.baseUrl: http://10.0.2.15:12020/ric/v1/handles/, notificationResponseBuffer: 100, bigRedButtonTimeoutSec: 5, maxRnibConnectionAttempts: 3, rnibRetryIntervalMs: 10, keepAliveResponseTimeoutMs: 4500, keepAliveDelayMs: 1500, e2tInstanceDeletionTimeoutMs: 15000,e2ResetTimeOutSec: 10,globalRicId: { ricId: AACCE, mcc: 001, mnc: 01}, rnibWriter: { stateChangeMessageChannel: RAN_CONNECTION_STATUS_CHANGE, ranManipulationChannel: RAN_MANIPULATION}"}
ric_e2mgr           | {"ts":1717701448020,"crit":"INFO","id":"e2mgr","mdc":{"CONTAINER_NAME":"ric_e2mgr","HOST_NAME":"ric_e2mgr_host","PID":"1","POD_NAME":"e2mgr_pod","SERVICE_NAME":"ric_e2mgr_service","SYSTEM_NAME":"oran_sc_ric","e2mgr":"0.2.2","time":"2024-06-06T19:17:28Z"},"msg":"Using config file: /opt/E2Manager/resources/configuration.yaml\n"}
ric_dbaas           | 1:C 06 Jun 2024 19:17:28.023 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
ric_dbaas           | 1:C 06 Jun 2024 19:17:28.023 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started
ric_dbaas           | 1:C 06 Jun 2024 19:17:28.023 # Configuration loaded
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.024 * monotonic clock: POSIX clock_gettime
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.024 * Running mode=standalone, port=6379.
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.024 # Server initialized
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.024 * Module 'exstrings' loaded from /usr/local/libexec/redismodule/libredismodule.so
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 * Loading RDB produced by version 6.2.14
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 * RDB age 1901 seconds
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 * RDB memory usage when created 0.81 Mb
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 # Done loading RDB, keys loaded: 6, keys expired: 0.
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 * DB loaded from disk: 0.000 seconds
ric_dbaas           | 1:M 06 Jun 2024 19:17:28.025 * Ready to accept connections
ric_e2mgr           | redis: got 7 elements in COMMAND reply, wanted 6
ric_e2mgr           | 1717701448034 1/RMR [INFO] ric message routing library on SI95 p=tcp:3801 mv=3 flg=00 id=a (f447e29 4.9.4 built: Dec 13 2023)
ric_submgr          | {"ts":1717701448132,"crit":"INFO","id":"submgr","mdc":{"time":"2024-06-06T19:17:28"},"msg":"Using config file: /opt/config/submgr-config.yaml"}
ric_submgr          | redis: got 7 elements in COMMAND reply, wanted 6
ric_submgr          | redis: got 7 elements in COMMAND reply, wanted 6
ric_submgr          | redis: got 7 elements in COMMAND reply, wanted 6
ric_submgr          | redis: got 7 elements in COMMAND reply, wanted 6
ric_submgr          | 1717701448138 1/RMR [INFO] ric message routing library on SI95 p=4560 mv=3 flg=00 id=a (f447e29 4.9.4 built: Dec 13 2023)
ric_submgr          | 2024/06/06 19:17:28 Serving xapp framework at http://[::]:8088
ric_e2term          | 1717701448214 1/RMR [INFO] ric message routing library on SI95 p=38000 mv=3 flg=00 id=a (f447e29 4.9.4 built: Dec 13 2023)
ric_appmgr          | redis: got 7 elements in COMMAND reply, wanted 6
ric_appmgr          | 2024/06/06 19:17:28 Serving app manager at http://[::]:8080
ric_rtmgr_sim       | 2024/06/06 19:17:29 POST /ric/v1/handles/dissociate-ran  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 28.255µs
ric_submgr          | RMR is ready now ...
ric_rtmgr_sim       | 2024/06/06 19:17:48 POST /ric/v1/handles/associate-ran-to-e2t  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 13.143µs
ric_submgr          | {"ts":1717701562763,"crit":"ERROR","id":"submgr","mdc":{"CONTAINER_NAME":"ric_submgr","HOST_NAME":"ric_submgr_host","PID":"1","POD_NAME":"submgr_pod","SERVICE_NAME":"ric_submgr_service","SYSTEM_NAME":"oran_sc_ric","time":"2024-06-06T19:19:22"},"msg":"No E2 connection for ranName gnb_001_001_00019b"}
ric_dbaas           | 1:M 06 Jun 2024 19:22:29.020 * 100 changes in 300 seconds. Saving...
ric_dbaas           | 1:M 06 Jun 2024 19:22:29.020 * Background saving started by pid 15
ric_dbaas           | 15:C 06 Jun 2024 19:22:29.029 * DB saved on disk
ric_dbaas           | 15:C 06 Jun 2024 19:22:29.029 * RDB: 0 MB of memory used by copy-on-write
ric_dbaas           | 1:M 06 Jun 2024 19:22:29.121 * Background saving terminated with success
ric_rtmgr_sim       | 2024/06/06 19:27:01 POST /ric/v1/handles/dissociate-ran  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 28.592µs
ric_rtmgr_sim       | 2024/06/06 19:27:16 POST /ric/v1/handles/associate-ran-to-e2t  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 21.512µs

I think the last line is the output mentioned by you?

pgawlowicz commented 6 months ago

why it is associating and dissociating 2 times? did you restart gnb?

LoganCome commented 6 months ago

@pgawlowicz I have another guess, whether it is related to the IP address settings of amf and e2. Since my core network is deployed on another PC, the IP address of amf is 192.168.18.196. This seems to be quite different from the configuration in this repository. Screenshot 2024-06-07 04:05:19

LoganCome commented 6 months ago

why it is associating and dissociating 2 times? did you restart gnb?

@pgawlowicz

I tested it again, and here's what happened:

When I run sudo docker-compose up, the last line of output is:

ric_rtmgr_sim       | 2024/06/06 20:13:42 POST /ric/v1/handles/dissociate-ran  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 18.106µs
ric_submgr          | RMR is ready now ...

After I start the gNB, the following line is output:

ric_rtmgr_sim       | 2024/06/06 20:14:07 POST /ric/v1/handles/associate-ran-to-e2t  body: [{"E2TAddress":"10.0.2.10:38000","ranNamelist":["gnb_466_092_00019b"]}] elapsed: 23.537µs

Therefore, the situation you mentioned occurred: it is associating and dissociating 2 times.

LoganCome commented 6 months ago

@pgawlowicz I just discovered that the issue was caused by an incorrect setting of the gNB ID. Thank you very much for your suggestions. I think we can close this issue now.