Free5GC Core with OAI GNB/UE

Hello everyone!

We are trying to set up an environment with RIC using the Free5GC core (v4.1.0) and the gNB and UE developed by OAI for FlexRIC support. However, we are facing issues when connecting the gNB to the AMF, where we keep seeing the following error log:
[DEBU][AMF][Ngap] SCTP read timeout

Has anyone successfully connected Free5GC with OAI’s gNB?
What configurations were necessary besides setting TAC, PLMN, and the AMF IPs and gNB interfaces?

Hi,

The log [DEBU][AMF][Ngap] SCTP read timeout is not an error – it just means AMF is waiting for NGAP messages from the gNB.

If you see this continuously, it usually means the gNB did not send the NGSetupRequest. Please double-check:

  • SCTP association is established (check with ss -ta | grep sctp).
  • PLMN, TAC, and gNB ID match between OAI config and free5GC.
  • The AMF IP/port are correctly set in the OAI gNB config.

Most of the time, the fix is on the gNB side configuration (gNB ID or PLMN mismatch).

Thanks.

Thank you for your willingness to help, and sorry for the delay in responding. I was running some tests before replying. I tried a few changes, but unfortunately, the issue remains the same.
One detail I forgot to mention earlier is that we are using a fully containerized environment.

To help with the analysis, I’m attaching the AMF and gNB logs, as well as the configuration files for both.

The gNB compose configuration is as follows:

gnb:
    container_name: "oai-gnb"
    image: oaisoftwarealliance/oai-gnb:develop
    privileged: true
    environment:
        USE_ADDITIONAL_OPTIONS: -E --rfsim --log_config.global_log_options level,nocolor,time,line_num,function
    volumes:
        - ./gnb.conf:/opt/oai-gnb/etc/gnb.conf
    healthcheck:
        test: /bin/bash -c "pgrep nr-softmodem"
        start_period: 10s
        start_interval: 500ms
        interval: 10s
        timeout: 5s
        retries: 5
    networks:
        privnet:
            ipv4_address: 10.100.200.202

gnb.txt (53.4 KB) amf.txt (42.4 KB)

These are the configuration files:
amfcfg.yaml (7.1 KB)
gnb.conf (10.8 KB)

Hi,

After checking the configuration files you provided, it seems that the issue may come from an IP binding mismatch between the AMF and gNB.

In amfcfg.yaml:

sbi:
  registerIPv4: amf.free5gc.org
  bindingIPv4: amf.free5gc.org

the AMF is bound to the hostname amf.free5gc.org.

However, in gnb.conf:

amf_ip_address = ( { ipv4 = "10.100.200.16"; });

the gNB attempts to connect directly to 10.100.200.16. If the hostname amf.free5gc.org is not mapped to 10.100.200.16 (either via /etc/hosts or DNS), the AMF may bind to a different or invalid interface, causing the SCTP connection to time out.

I recommend updating amfcfg.yaml as follows:

sbi:
  registerIPv4: 10.100.200.16
  bindingIPv4: 10.100.200.16

and ensuring that both the AMF and gNB IPs are reachable and reside within the same network namespace.

I hope this helps you resolve the issue.

Thank you again for your support.
I made the suggested changes, but the behavior remains the same — the SCTP timeout is still occurring.

Hi,

After checking the AMF source code (service.go, around line 207) and running a test with UERANSIM in debug mode, I confirmed that the [DEBU][AMF][Ngap] SCTP read timeout message is normal.

It comes from this part of the loop:

case syscall.EAGAIN:
    logger.NgapLog.Debugln("SCTP read timeout")
    continue

This means the SCTP socket did not receive any data within the polling interval — it simply times out and retries the read.
The connection remains active and healthy; AMF just keeps waiting for the next NGAP message.

So if you see “SCTP read timeout” repeatedly but the gNB and UE are registered successfully, you can safely ignore it.
It’s a normal polling mechanism, not a network or protocol failure.

Thanks.

Thanks for the support, I was able to connect the UEs and get IP after some configuration changes.

Best regards.