Running free5gc stage3 with Amarisoft gNodeB + UE

Hi all,
I invested a few weeks of work in order to debug free5gc with a Huawei P40 5G and Amarisoft gNodeB. As it is wasted time to do this twice, I would like to share my findings with you.

All modifications of the free5gc are combined in this fork: https://github.com/ralfkundel/free5gc (Stars are welcome :wink: )

In detail, I modified the following 4 subreposities (all included in the above fork):

@free5gc team: If I can support you in any way to integrate them, please let me know.

in general there have been several minor and two major issues:

  • The UE Aggregate Maximum Bit Rate is missing
  • it is required to have an “ims” dnn in parall to “internet”. For that, a second UPF+SMF can be started.

With this modifications, free5gc stage3 is working together with Huawei P40.

best regards,
Ralf Kundel

db.policyData.ues.amData.insert({“subscCats” : [ “free5gc” ], “ueId” : “imsi-001010000000011”})
db.policyData.ues.smData.insert({“smPolicySnssaiData” : { “01112233” : { “smPolicyDnnData” : { “internet” : { “dnn” : “internet” }, “ims” : { “dnn” : “ims” } }, “snssai” : { “sst” : 1, “sd” : “112233” } } }, “ueId” : “imsi-001010000000011” })
db.subscriptionData.authenticationData.authenticationSubscription.insert({“opc” : { “encryptionAlgorithm” : 0, “encryptionKey” : 0, “opcValue” : “” }, “ueId” : “imsi-001010000000011”, “authenticationMethod” : “5G_AKA”, “permanentKey” : { “encryptionAlgorithm” : 0, “encryptionKey” : 0, “permanentKeyValue” : “00112233445566778899AABBCCDDEEFE” }, “sequenceNumber” : “000000000dcd”, “authenticationManagementField” : “8000”, “milenage” : { “op” : { “encryptionAlgorithm” : 0, “encryptionKey” : 0, “opValue” : “000102030405060708090A0B0C0D0E0F” } } })
db.subscriptionData.provisionedData.amData.insert({“gpsis” : [ “msisdn-0900000000” ], “subscribedUeAmbr” : { “uplink” : “1000 Kbps”, “downlink” : “3000 Kbps” }, “nssai” : { “singleNssais” : [ { “sst” : 1, “sd” : “112233” } ], “defaultSingleNssais” : [ { “sst” : 1, “sd” : “112233” } ] }, “ueId” : “imsi-001010000000011”, “servingPlmnId” : “00101” })
db.subscriptionData.provisionedData.smData.insert({“singleNssai” : { “sst” : 1, “sd” : “112233” }, “dnnConfigurations” : {
“internet” : { “5gQosProfile” : { “5qi” : 9, “arp” : { “priorityLevel” : 8, “preemptCap” : “”, “preemptVuln” : “” }, “priorityLevel” : 8 }, “sessionAmbr” : { “uplink” : “3000 Kbps”, “downlink” : “1000 Kbps” }, “pduSessionTypes” : { “defaultSessionType” : “IPV4”, “allowedSessionTypes” : [ “IPV4” ] }, “sscModes” : { “defaultSscMode” : “SSC_MODE_1”, “allowedSscModes” : [ “SSC_MODE_1”, “SSC_MODE_2”, “SSC_MODE_3” ] } },
“ims” : { “5gQosProfile” : { “5qi” : 5, “arp” : { “priorityLevel” : 8, “preemptCap” : “”, “preemptVuln” : “” }, “priorityLevel” : 8 }, “sessionAmbr” : { “uplink” : “3000 Kbps”, “downlink” : “1000 Kbps” }, “pduSessionTypes” : { “defaultSessionType” : “IPV4”, “allowedSessionTypes” : [ “IPV4” ] }, “sscModes” : { “defaultSscMode” : “SSC_MODE_1”, “allowedSscModes” : [ “SSC_MODE_1”, “SSC_MODE_2”, “SSC_MODE_3” ] } }
}, “ueId” : “imsi-001010000000011”, “servingPlmnId” : “00101” })

Thanks for your info! It’s very helpful!
Could your provide the N1/N2 Pcap file? Thanks!

This sounds great!

The patch seems to be use some workaround, we’ll review it and try to patch it with some normal solution and merge the PR.

Hi,
yes, totally agree. Half of the fixes are “dirty workarounds”. However, some fixes could be merged. For them, we created 3 merge requests. In order to get it work, 3 more “dirty workaround commits” in amf and smf are needed.

The pull requests of the clean parts of the fixes are:
https://github.com/free5gc/amf/pull/15
https://github.com/free5gc/ngap/pull/2
https://github.com/free5gc/nas/pull/7

The other fixes in amf/smf needs major changes such as updates in the DB (e.g. for the Maximum UE Bit Rate)

best,
Ralf

2 Likes

can you show us your config and other settings? Is your ue’s usage setting voice centric or data centric?

Hi,
please find below the config. Please not, it is required to modify the run.sh script as well in order to start the two smf+upf. you must add something like this:

sudo -E src/upf/build/bin/free5gc-upfd -f config/upfcfg_ralf.yaml &
PID_LIST+=($!)
sudo -E src/upf/build/bin/free5gc-upfd -f config/upfcfg_ims_ralf.yaml &
PID_LIST+=($!)
bin/smf --smfcfg config/smfcfg_imf.conf &
PID_LIST+=($!)

In general it is important/tricky, that:

  • The UE-IP addresses of the PDU session for the ims should be in the same subnet as the IMS server is. In this case: 172.16.5.64/27
  • Only the traffic from the internet UPF should be applied on the NAT. So:

sudo iptables -t nat -A POSTROUTING -s 60.60.0.0/24 -o <OUT_IFACE> -j MASQUERADE

  • The route back from the IMS server (in the Amarisoft box) to the UPF must be configured accordingly. (ip route add … via …)

The following figure might help:
free5gc-setup.pdf (216.5 KB)

best,
Ralf

smfcfg.conf (970 Bytes) smfcfg_imf.conf (900 Bytes) upfcfg_ims_ralf.yaml (496 Bytes) upfcfg_ralf.yaml (539 Bytes) amfcfg.conf (1.0 KB)

Thanks a lot for your guidance. I have another question, according to “free5gc-setup.pdf” did you mean your Amarisoft gNodeB have an IMS server inside?

Yes, the Amarisoft gNodeB also includes an IMS server and 5GC which can be used independently.

Our design is currently a little bit dirty. The issue is that the Huawei P40 does not connect if there is no IMS server responding. Even though this IMS server is not working with our free5gc, it is sufficient to answer “something” to the UE.

And as we did not have another IMS server, we just took the built in IMS. But I’m pretty sure that any other IMS server would work as well as long as it is responding something to the UE. Maybe Kamailo IMS would be an alternative (just the result of 1 min googling).

best,
Ralf

Hi all,
a short status update on this project.
I created a new version of free5gc v3.0.5 which is running with Amarisoft RAN and Huawei P40.
The code base can be cloned here:
https://github.com/ralfkundel/free5gc

In addition I created two pull requests which add missing features to the amf and smf:

in general I have to say: good job of free5gc team integrating my feedback above! the version 3.0.5 had some minor bugs which have been, however, been fixed in the meantime on the main branch of the smf. Thus, only two config file fields are missing for ims support (the two pull requests) in amf and smf.

I will try to document it a little bit better and will maybe create a tutorial pdf or markdown readme.

best,

2 Likes

@ralfkundel

Which 5G band did you use to test?
Did Amarisoft RAN and Huawei P40 support N79?

BTW, we merged all PRs and released v3.0.6.
You can the new release without patches.
If v3.0.6 has something missed, please let us know.

Regards,