aligungr / UERANSIM

Open source 5G UE and RAN (gNodeB) implementation.
GNU General Public License v3.0
760 stars 315 forks source link

[Questions] Errors in simulating a 5G network using UERANSIM and open5gs #252

Closed strongcourage closed 3 years ago

strongcourage commented 3 years ago

Hi all,

Recently, I tried to simulate a 5G network using UERANSIM version 3.0.2 and open5gs version 2.1.7 on Ubuntu 16.04. I used the default configuration files provided in /config, but get the following errors, probably due to UE's registration. I didn't find any solutions on this github repo, so if you know how to fix them, please let me know. Thank you.

$ ./open5gs-amfd
Open5GS daemon v2.1.7

02/15 10:18:57.514: [app] INFO: AMF initialize...done (../src/amf/app.c:33)
02/15 10:18:57.519: [sbi] INFO: nghttp2_server() [127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:145)
02/15 10:18:57.529: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:56)
02/15 10:18:57.529: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:465)
02/15 10:19:08.540: [amf] WARNING: [d4f8b14c-6f6e-41eb-b02b-e3cc3330ad85] Retry to registration with NRF (../src/amf/nf-sm.c:161)
02/15 10:19:08.541: [sbi] WARNING: [7] Failed to connect to ::1 port 7777: Connection refused (../lib/sbi/client.c:465)
02/15 10:19:09.670: [amf] INFO: gNB-S1 accepted[127.0.0.1]:47787 in ng-path module (../src/amf/ngap-sctp.c:108)
02/15 10:19:09.670: [amf] INFO: gNB-N1 accepted[127.0.0.1] in master_sm module (../src/amf/amf-sm.c:564)
02/15 10:19:09.670: [amf] INFO: [Added] Number of gNBs is now 1 (../src/amf/context.c:870)
02/15 10:19:14.382: [amf] INFO: InitialUEMessage (../src/amf/ngap-handler.c:349)
02/15 10:19:14.382: [amf] INFO: [Added] Number of gNB-UEs is now 1 (../src/amf/context.c:1786)
02/15 10:19:14.382: [amf] INFO:     RAN_UE_NGAP_ID[1] AMF_UE_NGAP_ID[1] TAC[1] CellID[0x100] (../src/amf/ngap-handler.c:483)
02/15 10:19:14.382: [amf] INFO: [suci-0-901-70-0000-0-0-0000000003] Unknown UE by SUCI (../src/amf/context.c:1315)
02/15 10:19:14.382: [amf] INFO: [Added] Number of AMF-UEs is now 1 (../src/amf/context.c:1131)
02/15 10:19:14.382: [gmm] INFO: Registration request (../src/amf/gmm-sm.c:131)
02/15 10:19:14.382: [gmm] INFO: [suci-0-901-70-0000-0-0-0000000003]    SUCI (../src/amf/gmm-handler.c:72)
02/15 10:19:14.382: [app] ERROR: Cannot discover [AUSF] (../lib/sbi/path.c:51)
02/15 10:19:14.382: [amf] WARNING: [suci-0-901-70-0000-0-0-0000000003] Registration reject [90] (../src/amf/nas-path.c:139)
...
02/15 10:19:14.525: [sbi] FATAL: ogs_sbi_xact_add: Assertion `xact' failed. (../lib/sbi/context.c:1025)
02/15 10:19:14.525: [core] FATAL: backtrace() returned 11 addresses (../lib/core/ogs-abort.c:37)
Aborted (core dumped)
$ ./nr-gnb -c ../config/open5gs-gnb.yaml
UERANSIM v3.0.2
[2021-02-15 10:19:09.667] [sctp] [info] Trying to establish SCTP connection... (127.0.0.5:38412)
[2021-02-15 10:19:09.670] [sctp] [info] SCTP connection established (127.0.0.5:38412)
[2021-02-15 10:19:09.670] [sctp] [debug] SCTP association setup ascId[141]
[2021-02-15 10:19:09.670] [ngap] [debug] SCTP association setup received ascId[141]
[2021-02-15 10:19:09.670] [ngap] [debug] Sending NG Setup Request
[2021-02-15 10:19:09.670] [ngap] [debug] NG Setup Response received
[2021-02-15 10:19:09.670] [ngap] [info] NG Setup procedure is successful
[2021-02-15 10:19:14.380] [mr] [info] New UE connected to gNB. Total number of UEs is now: 1
[2021-02-15 10:19:14.381] [rrc] [debug] Sending RRC Setup for UE[3]
[2021-02-15 10:19:14.382] [ngap] [debug] Initial NAS message received from UE 3
[2021-02-15 10:19:14.622] [sctp] [debug] SCTP association shutdown (clientId: 2)
[2021-02-15 10:19:14.622] [sctp] [debug] Unhandled SCTP notification received
[2021-02-15 10:19:14.623] [ngap] [error] Unhandled NTS message received with type 1003
$ ./nr-ue -c ../config/open5gs-ue.yaml
UERANSIM v3.0.2
[2021-02-15 10:19:14.379] [nas] [debug] NAS layer started
[2021-02-15 10:19:14.379] [rrc] [debug] RRC layer started
[2021-02-15 10:19:14.379] [nas] [info] UE switches to state: MM-DEREGISTERED/PLMN-SEARCH
[2021-02-15 10:19:14.380] [nas] [info] UE connected to gNB
[2021-02-15 10:19:14.380] [nas] [info] UE switches to state: MM-DEREGISTERED/NORMAL-SERVICE
[2021-02-15 10:19:14.380] [nas] [info] UE switches to state: MM-REGISTERED-INITIATED/NA
[2021-02-15 10:19:14.380] [rrc] [debug] Sending RRC Setup Request
[2021-02-15 10:19:14.381] [rrc] [info] RRC connection established
[2021-02-15 10:19:14.381] [nas] [info] UE switches to state: CM-CONNECTED
[2021-02-15 10:19:14.383] [nas] [error] Initial Registration failed [PAYLOAD_NOT_FORWARDED]
[2021-02-15 10:19:14.383] [nas] [error] Registration rejected with unhandled MMCause: PAYLOAD_NOT_FORWARDED
aligungr commented 3 years ago

Hi @strongcourage

It may be realted to open5gs but please provide some pcaps to help to analyse the problem.

strongcourage commented 3 years ago

Hi @aligungr,

Please find the pcap file. Thank you. 5g.pcap.zip

acetcom commented 3 years ago

Refer to https://github.com/open5gs/open5gs/issues/804

strongcourage commented 3 years ago

Hi @aligungr, As discussed in this tutorial, I modified the values of MCC/MNC in config/open5gs-ue.yaml, config/open5gs-gnb.yaml and /etc/open5gs/amf.yaml to 001/01 or 999/99, but get an error "MCC/MNC mismatch in SUCI generation". However, it seems that I successfully simulated a 5G network (GNB and UE can connect to each other) as follows. I'm wondering whether this error has any impacts. Thank you in advance.

gnb

ue

aligungr commented 3 years ago

@strongcourage

RRC connection is between UE and gNB, but you also need establish NAS connection and complete registration to the 5G core network. And in your case it is not successful because of the MCC/MNC Mismatch error.

Solution is to use same MCC and MNC values in imsi field and mcc/mnc fields in your UE config file. That is, first 3 digit of IMSI must be same with MCC value, and the other 2/3 digits must be same with the MNC value. Just look at your config file and see first 3 lines of the yaml.

strongcourage commented 3 years ago

Thank you guys, finally it works :) 5g-GNB

5g-UE