-
• This section will set up an end-to-end environment with a commercial terminal, commercial base station, and Open5GS 5GC, detailing the precautions, issues encountered, and analysis of solutions during the setup process.. -
• This section mainly involves the following issues: USIM card subscription information configuration, authentication parameters, APN, and slice configuration.
Network Topology
The core network uses Open5GS, and both the terminal and base station use commercial equipment.

Base Station Configuration
Modify the base station configuration file to set the AMF NG Server’s IP address to the Open5GS amf IP address; also configure the base station NGAP local address, which is used to establish the SCTP connection for the NG interface.
Open5GS Configuration
Configure the amf’s plmn, tac, and slice information as follows.
##vim /etc/open5gs/amf.yaml
guami:
- plmn_id:
mcc:460
mnc:97
amf_id:
region:1
set:1
tai:
- plmn_id:
mcc:460
mnc:97
tac:61
plmn_support:
- plmn_id:
mcc:460
mnc:97
s_nssai:
- sst:1
sd: 1
Terminal Configuration
After completing the base station cell and frequency point configuration, the terminal can be configured to lock frequency and cell to shorten network search time.
Access Issue Analysis
Once the basic configurations are completed, sequentially run the core network, base station, and terminal.
After the core network is running, first check the logs to confirm whether each network element starts normally; refer to Playing with 5G: Deploying Various Network Elements on Friendly Arm NanoPi R2S to Experience 5G End-to-End Functionality.
After the base station starts, the Open5GS amf log will indicate a successful connection to the base station. If there is no prompt, check whether the NG interface address configurations on both the base station and Open5GS sides match.
After the network side runs successfully, the terminal powers on to search, and there may still be the following issues.
Cannot find SUCI
The amf log shows the following error message:
## UE Access Issue
6/0911:35:07.431:[amf] INFO:Unknown UE by5G-S_TMSI[AMF_ID:0x10041,M_TMSI:0x1001d90](../src/amf/context.c:1794)
06/0911:35:07.431:[amf] INFO:[Added]Number of AMF-UEsis now 1(../src/amf/context.c:1563)
06/0911:35:07.431:[gmm] INFO:Registration request (../src/amf/gmm-sm.c:985)
06/0911:35:07.431:[gmm] INFO:[Unknown ID]5G-S_GUTI[AMF_ID:0x10041,M_TMSI:0x1001d90](../src/amf/gmm-handler.c:165)
06/0911:35:07.499:[gmm] INFO:Identity response (../src/amf/gmm-sm.c:1154)
06/0911:35:07.499:[gmm] INFO:[suci-0-460-97-0-0-0-0000001111] SUCI (../src/amf/gmm-handler.c:916)
06/0911:35:07.537:[gmm] WARNING:[suci-0-460-97-0-0-0-0000001111]Cannot find SUCI [404](../src/amf/gmm-sm.c:1472)
06/0911:35:07.537:[amf] WARNING:[suci-0-460-97-0-0-0-0000001111]Registration reject [11](../src/amf/nas-path.c:219)
06/0911:35:08.046:[amf] INFO: UE ContextRelease[Action:3](../src/amf/ngap-handler.c:1632)
06/0911:35:08.046:[amf] INFO: RAN_UE_NGAP_ID[0] AMF_UE_NGAP_ID[1](../src/amf/ngap-handler.c:1633)
06/0911:35:08.046:[amf] INFO: SUCI[suci-0-460-97-0-0-0-0000001111](../src/amf/ngap-handler.c:1636)
Solution: Open the Open5GS web UI, add UE subscription information, IMSI, K, Op are the writing parameters for the USIM card. The slice information must match the Open5GS amf configuration.
##Issue 1: Cannot find SUCI --> Add UE subscription information
IMSI: 46097xxxxxx1111
K: xxxx
OP: xxxx
Slice Configurations: sst.sd 1.000001
Authentication failure (Synch failure)
The error message is as follows: Authentication failure (Synch failure)
06/0911:46:52.858:[amf] INFO:InitialUEMessage(../src/amf/ngap-handler.c:372)
06/0911:46:52.858:[amf] INFO:[Added]Number of gNB-UEsis now 1(../src/amf/context.c:2502)
06/0911:46:52.858:[amf] INFO: RAN_UE_NGAP_ID[1] AMF_UE_NGAP_ID[2] TAC[61]CellID[0x1771](../src/amf/ngap-handler.c:533)
06/0911:46:52.859:[amf] INFO:[suci-0-460-97-0-0-0-0000001111]Unknown UE by SUCI (../src/amf/context.c:1776)
06/0911:46:52.859:[amf] INFO:[Added]Number of AMF-UEsis now 1(../src/amf/context.c:1563)
06/0911:46:52.859:[gmm] INFO:Registration request (../src/amf/gmm-sm.c:985)
06/0911:46:52.859:[gmm] INFO:[suci-0-460-97-0-0-0-0000001111] SUCI (../src/amf/gmm-handler.c:152)
06/0911:46:53.018:[gmm] WARNING:Authentication failure(Synch failure)(../src/amf/gmm-sm.c:1367)
06/0911:46:53.579:[gmm] INFO:[imsi-460970000001111]Registration complete (../src/amf/gmm-sm.c:1917)
06/0911:46:53.579:[amf] INFO:[imsi-460970000001111]Configuration update command (../src/amf/nas-path.c:612)
06/0911:46:53.579:[gmm] INFO: UTC [2023-06-09T03:46:53]Timezone[0]/DST[0](../src/amf/gmm-build.c:546)
06/0911:46:53.579:[gmm] INFO: LOCAL [2023-06-09T11:46:53]Timezone[28800]/DST[0](../src/amf/gmm-build.c:551)
06/0911:46:55.819:[amf] INFO:[Added]Number of AMF-Sessionsis now 1(../src/amf/context.c:2523)
06/0911:46:55.819:[gmm] WARNING:[imsi-460970000001111] DNN NotSupported OR NotSubscribedin the Slice(../src/amf/gmm-handler.c:1223)
06/0911:47:11.899:[gmm] WARNING:[imsi-460970000001111] DNN NotSupported OR NotSubscribedin the Slice(../src/amf/gmm-handler.c:1223)
Carefully check the authentication parameters and unify the APN settings on both Open5GS and the terminal side, which can be set to internet.
DNN Not Supported OR Not Subscribed in the Slice
06/0915:59:32.408:[gmm] INFO:Identity response (../src/amf/gmm-sm.c:1154)
06/0915:59:32.408:[gmm] INFO:[suci-0-460-97-0-0-0-0000001111] SUCI (../src/amf/gmm-handler.c:916)
06/0915:59:32.968:[gmm] INFO:[imsi-460970000001111]Registration complete (../src/amf/gmm-sm.c:1917)
06/0915:59:32.968:[amf] INFO:[imsi-460970000001111]Configuration update command (../src/amf/nas-path.c:612)
06/0915:59:32.968:[gmm] INFO: UTC [2023-06-09T07:59:32]Timezone[0]/DST[0](../src/amf/gmm-build.c:546)
06/0915:59:32.968:[gmm] INFO: LOCAL [2023-06-09T15:59:32]Timezone[28800]/DST[0](../src/amf/gmm-build.c:551)
06/0915:59:35.208:[amf] INFO:[Added]Number of AMF-Sessionsis now 1(../src/amf/context.c:2523)
06/0915:59:35.208:[gmm] WARNING:[imsi-460970000001111] DNN NotSupported OR NotSubscribedin the Slice(../src/amf/gmm-handler.c:1223)
06/0915:59:51.288:[gmm] WARNING:[imsi-460970000001111] DNN NotSupported OR NotSubscribedin the Slice(../src/amf/gmm-handler.c:1223)
The cause of this error is incorrect APN configuration. Unify the APN settings on both Open5GS and the terminal side, such as internet.
After modification, the correct registration log is as follows:
06/0917:04:40.549:[amf] INFO:InitialUEMessage(../src/amf/ngap-handler.c:372)
06/0917:04:40.549:[amf] INFO:[Added]Number of gNB-UEsis now 1(../src/amf/context.c:2502)
06/0917:04:40.549:[amf] INFO: RAN_UE_NGAP_ID[0] AMF_UE_NGAP_ID[4] TAC[61]CellID[0x1771](../src/amf/ngap-handler.c:533)
06/0917:04:40.560:[amf] INFO:[suci-0-460-97-0-0-0-0000001111]Known UE by5G-S_TMSI[AMF_ID:0x10040,M_TMSI:0xc00005d3](../src/amf/context.c:1790)
06/0917:04:40.574:[gmm] INFO:Registration request (../src/amf/gmm-sm.c:985)
06/0917:04:40.574:[gmm] INFO:[suci-0-460-97-0-0-0-0000001111]5G-S_GUTI[AMF_ID:0x10040,M_TMSI:0xc00005d3](../src/amf/gmm-handler.c:165)
06/0917:04:40.948:[gmm] INFO:[imsi-460970000001111]Registration complete (../src/amf/gmm-sm.c:1917)
06/0917:04:40.948:[amf] INFO:[imsi-460970000001111]Configuration update command (../src/amf/nas-path.c:612)
06/0917:04:40.948:[gmm] INFO: UTC [2023-06-09T09:04:40]Timezone[0]/DST[0](../src/amf/gmm-build.c:546)
06/0917:04:40.948:[gmm] INFO: LOCAL [2023-06-09T17:04:40]Timezone[28800]/DST[0](../src/amf/gmm-build.c:551)
ERROR: [5:0] No SmContextCreateError
After the above modifications, DNN/SST/SD all matched, after registration completion, the base station side captured packets showing that the PDU establishment process failed, the amf log is as follows:
06/0917:04:43.189:[gmm] INFO: UE SUPI[imsi-460970000001111] DNN[internet] S_NSSAI[SST:1 SD:0x1](../src/amf/gmm-handler.c:1236)
06/0917:04:43.277:[amf] ERROR:[5:0]NoSmContextCreateError(../src/amf/nsmf-handler.c:126)
06/0917:04:43.277:[amf] WARNING:[suci-0-460-97-0-0-0-0000001111] DL NAS transport (../src/amf/nas-path.c:1014)
06/0917:04:43.277:[amf] ERROR: AMF_SESS_CLEAR (../src/amf/amf-sm.c:524)
06/0917:04:43.277:[amf] INFO:[Removed]Number of AMF-Sessionsis now 4(../src/amf/context.c:2530)
06/0917:04:48.229:[gmm] INFO: UE SUPI[imsi-460970000001111] DNN[internet] S_NSSAI[SST:1 SD:0x1](../src/amf/gmm-handler.c:1236)
06/0917:04:48.231:[amf] ERROR:[6:0]NoSmContextCreateError(../src/amf/nsmf-handler.c:126)
06/0917:04:48.231:[amf] WARNING:[suci-0-460-97-0-0-0-0000001111] DL NAS transport (../src/amf/nas-path.c:1014)
5GC log: ERROR: [5:0] No SmContextCreateError (../src/amf/nsmf-handler.c:126), by capturing the air interface signaling, it was found that the UE requested two slices, but the core does not support it, thus there is a prompt in the reg Accept, but it does not affect the subsequent process.
Continuing with packet analysis, the issue lies in the PDU session establishment request being sent out, the core network replies: <span>payload was not forwarded </span>
Comparing the differences in packets, it was found that if the PDP context does not specify sst.sd during dialing, the PDP estReq defaults to establishing two slices (eMBB/uRLLC), if sst.sd (1.1) is specified, the UE only requests eMBB, as shown in the right image.

Therefore, modify the UE dialing context to specify slice information.
#UE Slice Information
C5GREG: 1,"0000xx", "000000000000xxxx",11, 1, "01"
<stat>,<tac>, <ci>, <AcT>,<Allowed_NSSAI_length>[,<Allowed_NSSAI>]
Additionally, if the UE subscription information in Open5GS does not configure the UE’s sd (000001), the core network will also not issue PDP estReqAcpt.
Finally, the successful access log is as follows:
06/0917:52:28.700:[amf] INFO:InitialUEMessage(../src/amf/ngap-handler.c:372)
06/0917:52:28.700:[amf] INFO:[Added]Number of gNB-UEsis now 1(../src/amf/context.c:2502)
06/0917:52:28.700:[amf] INFO: RAN_UE_NGAP_ID[5] AMF_UE_NGAP_ID[9] TAC[61]CellID[0x1771](../src/amf/ngap-handler.c:533)
06/0917:52:28.700:[amf] INFO:[suci-0-460-97-0-0-0-0000001111]Known UE by5G-S_TMSI[AMF_ID:0x10040,M_TMSI:0xc0000196](../src/amf/context.c:1790)
06/0917:52:28.700:[gmm] INFO:Registration request (../src/amf/gmm-sm.c:985)
06/0917:52:28.700:[gmm] INFO:[suci-0-460-97-0-0-0-0000001111]5G-S_GUTI[AMF_ID:0x10040,M_TMSI:0xc0000196](../src/amf/gmm-handler.c:165)
06/0917:52:29.020:[gmm] INFO:[imsi-460970000001111]Registration complete (../src/amf/gmm-sm.c:1917)
06/0917:52:29.020:[amf] INFO:[imsi-460970000001111]Configuration update command (../src/amf/nas-path.c:612)
06/0917:52:29.020:[gmm] INFO: UTC [2023-06-09T09:52:29]Timezone[0]/DST[0](../src/amf/gmm-build.c:546)
06/0917:52:29.020:[gmm] INFO: LOCAL [2023-06-09T17:52:29]Timezone[28800]/DST[0](../src/amf/gmm-build.c:551)
06/0917:52:31.500:[amf] INFO:[Added]Number of AMF-Sessionsis now 1(../src/amf/context.c:2523)
06/0917:52:31.500:[gmm] INFO: UE SUPI[imsi-460970000001111] DNN[internet] S_NSSAI[SST:1 SD:0x1](../src/amf/gmm-handler.c:1236)
06/0917:52:32.007:[amf] INFO:[imsi-460970000001111:5:11][0:0:NULL]/nsmf-pdusession/v1/sm-contexts/{smContextRef}/modify (../src/amf/nsmf-handler.c:744)
Slice Information Description
Comparison of UE PDU establishment request signaling capture. The left image does not carry NSSAI information, defaulting to establishing eMBB/URLLC slices, while the right image specifies establishing the eMBB slice.

Attached are terminal slice configuration commands for reference.
#Set preferred slice, supporting up to 8 slices, slices are separated by “:”, single slice format: SST or SST.SD, different slices are separated by “:”, for example: “SST:SST.SD"
AT+C5GPNSSAI=8,"01:02:03:04:05:06:07:08"
#Query preferred slice
AT+C5GPNSSAT?
Saving…
Attached are terminal slice configuration commands for reference.
#Set preferred slice, supporting up to 8 slices, slices are separated by “:”, single slice format: SST or SST.SD, different slices are separated by “:”, for example: “SST:SST.SD"
AT+C5GPNSSAI=8,"01:02:03:04:05:06:07:08"
#Query preferred slice
AT+C5GPNSSAT?
The End.