Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCTP bind failed: Cannot assign requested address - Unable to connecto to free5gc AMF #722

Open
lpfernandes opened this issue Aug 7, 2024 · 1 comment

Comments

@lpfernandes
Copy link

Hi, I'm trying to set a basic enviroment where I have a VM with free5gc core running and another VM wieht ueransim, I have made the changes to the config files on both sides however I unable to connect to the AMF on free5gc VM.
The following is the error I get:

coreadmin@ueransim:~/UERANSIM/build$ ./nr-gnb -c ../config/free5gc-gnb.yaml
UERANSIM v3.2.5
[2024-08-07 11:22:22.794] [sctp] [info] Trying to establish SCTP connection... (192.168.176.135:38412)
[2024-08-07 11:22:22.795] [gtp] [error] GTP/UDP task could not be created. Socket bind failed: Cannot assign requested address
[2024-08-07 11:22:22.798] [sctp] [error] Binding to 192.168.176.135:0 failed. SCTP bind failed: Cannot assign requested address

If I run a manually test from the ueransim VM using ncat I can establish a connection:

UERANSIM VM:
coreadmin@ueransim:~/UERANSIM/build$ ncat 192.168.176.135 38412 --sctp

free5gc VM:
2024-08-07T11:24:55.219220642Z [INFO][AMF][Ngap] [AMF] SCTP Accept from: 192.168.176.137:52824
2024-08-07T11:28:02.253648226Z [INFO][AMF][Ngap] Handle SCTP Notification[addr: 192.168.176.137:52824]
2024-08-07T11:28:02.253880811Z [WARN][AMF][Ngap] RAN context has been removed[addr: 192.168.176.137:52824]
2024-08-07T11:28:02.254034277Z [INFO][AMF][Ngap] Handle SCTP Connection Error[addr: 192.168.176.137:52824] - remove RAN
2024-08-07T11:28:02.254081094Z [WARN][AMF][Ngap] RAN context has been removed[addr: 192.168.176.137:52824]
SCTPConn: SCTPWrite failed bad file descriptor

The following are my config files:

coreadmin@ueransim:~/UERANSIM/build$ cat ../config/free5gc-gnb.yaml
mcc: '208' # Mobile Country Code value
mnc: '93' # Mobile Network Code value (2 or 3 digits)

nci: '0x000000010' # NR Cell Identity (36-bit)
idLength: 32 # NR gNB ID length in bits [22...32]
tac: 1 # Tracking Area Code

linkIp: 127.0.0.1 # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
ngapIp: 192.168.176.135 # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 192.168.176.135 # gNB's local IP address for N3 Interface (Usually same with local IP)

List of AMF address information

amfConfigs:

  • address: 192.168.176.135
    port: 38412

List of supported S-NSSAIs by this gNB

slices:

  • sst: 0x1
    sd: 0x010203

Indicates whether or not SCTP stream number errors should be ignored.

ignoreStreamIds: true


coreadmin@free5gc:~/free5gc/config$ less ~/free5gc/config/amfcfg.yaml

info:
version: 1.0.9
description: AMF initial local configuration

configuration:
amfName: AMF # the name of this AMF
ngapIpList: # the IP list of N2 interfaces on this AMF
- 192.168.176.135 # ip of free5gc VM


less ~/free5gc/config/smfcfg.yaml

interfaces: # Interface list for this UPF
- interfaceType: N3 # the type of the interface (N3 or N9)
endpoints: # the IP address of this N3/N9 interface on this UPF
- 192.168.176.135

less ~/free5gc/config/upfcfg.yaml

version: 1.0.3
description: UPF initial local configuration

The listen IP and nodeID of the N4 interface on this UPF (Can't set to 0.0.0.0)

pfcp:
addr: 127.0.0.8 # IP addr for listening
nodeID: 127.0.0.8 # External IP or FQDN can be reached
retransTimeout: 1s # retransmission timeout
maxRetrans: 3 # the max number of retransmission

gtpu:
forwarder: gtp5g

The IP list of the N3/N9 interfaces on this UPF

If there are multiple connection, set addr to 0.0.0.0 or list all the addresses

ifList:
- addr: 192.168.176.135
type: N3
# name: upf.5gc.nctu.me
# ifname: gtpif
# mtu: 1400

Using UERANSIM v3.2.6 and free5gc v3.4.2

Any help would be appreciated, thanks.

@laf0rge
Copy link

laf0rge commented Aug 30, 2024

I would start with an strace on the ueransim to check the details of the SCTP socket bind call it is issuing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants