Hi,
I’m developing an UE NWU client to establish a non-3GPP session with N3IWF in python (github dot com/fasferraz/NWu-Non3GPP-5GC) and using free5GC to test it.
During my development I found some issues in free5GC. For some of them I could adapt my code, but for others I needed to change some files.
I will explain the bugs I think I have found, and the ones I correct, in case anyone is doing the same.
- Free5gc does not send the PDU Session Establishment Accept to the UE through signaling SA child. Only creates the userplane SA child. That means that we must figure out what will be the session IP. Using free5gc defaults, that address is 60.60.0.1. First I added an option to my code to set the session IP in order to create the tunnel for user plane sesion correctly, but then I did some changes in the n3iwf/ngap/handler/handler.go and correct it.
- The GRE implementation does not comply with 3GPP requirements (it uses 4 bytes instead of 8 bytes with RQI). Solution: I adapted my code to it…
- The NAS messages should be prefixed with 2 bytes with NAS lengh information, but in free5GC NAS messages are carried directly in the TCP connection. Solution: I adapted my code.
- AN parameter “requested NSSAI” is not correctly formatted. Solution I adapt my code.
- EAP-AKA’ authentication not complete (in AMF), and several erroneous checks (in AUSF when comparing RES with XRES, wrong padding in RES processing, KSEAF calculated based on empty KAUSF key). Solution: I changed the ausf/producer/functions.go and ue_authentication.go and also amf/gmm/handler.go
- EAP-AKA’ packets do not have the subtype byte (e.g. AKA-Challenge, etc…) and the following 2 reserved bytes (3 bytes in total). Solution: I adapted my code.
- Integrity and Ciphering functions in AMF are using Bearer ID for 3GPP access, instead of non-3GPP access as stated in 33.501. Solution: I adapted my code.
Changes:
AMF:
github dot com/fasferraz/amf/commit/16cfa93455cf01f3e7ba4015b659d5857666eb09
AUSF:
github dot com/fasferraz/ausf/commit/dd70ddd6b72ca2f606fb4b2dae18dd1b1ef33db4
github dot com/fasferraz/ausf/commit/923de46ee7fbfd7718786a89a8bde536288fb1c9
N3IWF:
github dot com/fasferraz/n3iwf/commit/7226b0e1dc43fdd617a7f5f334443268ae9dbc88
I never programmed in Go, so these changes were just based on looking at the code and guessing what to do… because i wanted to move forward with my app (since this is the only 5G core that supports N3IWF that I’m aware of). I bet there are better ways to correct them.