Closed infinitydon closed 3 years ago
@infinitydon
PCAP file will be very helpful to solve this. Please attach if you have one. (ngap/nas packets will be sufficient).
Thanks for reporting this issue.
@infinitydon
In the packet 160, AMF sends a packet with security header type "integrity protected with new 5GS security context". And it means that the packet is a SecurityModeCommand, but the packet itself is either encrypted or corrupted. (And SecurityModeCommand should not be encrypted)
Therefore we can say that there is a bug on AMF side.
And it can be related to this issue: https://github.com/free5gc/free5gc/issues/104
Btw, which free5gc version are you using?
I am using Freegc v3.0.4:
[ec2-user@ip-172-31-38-94 istio-injection]$ kubectl -n free5gc logs free5gc-amf-deployment-86ddbdf69d-b9bbf | more
2021-03-11T08:48:02Z [INFO][AMF][App] amf
2021-03-11T08:48:02Z [INFO][AMF][App] AMF version:
version: v3.0.4-5-g797c046
build time: 2020-10-23T14:50:06Z
commit hash: 1b92f8cf
commit time: 2020-09-28T21:02:22Z
go version: go1.14.4 linux/amd64
In the past, they said that the issue was fixed in release v3.0.4, but perhaps there is another bug. I think free5gc should look at this issue, because clearly there is a bug on AMF side.
I was able to get this working by using the following AMF security config:
security:
integrityOrder:
# - NIA0
- NIA2
cipheringOrder:
# - NEA0
- NEA2
ubuntu@ip-172-31-203-193:~/UERANSIM/build$ sudo ./nr-ue -c free5gc-ue.yaml
UERANSIM v3.1.4
[2021-03-11 14:04:13.380] [nas] [debug] NAS layer started
[2021-03-11 14:04:13.381] [rrc] [debug] RRC layer started
[2021-03-11 14:04:13.381] [nas] [info] UE switches to state [MM-DEREGISTERED/PLMN-SEARCH]
[2021-03-11 14:04:13.381] [nas] [info] UE connected to gNB
[2021-03-11 14:04:13.381] [nas] [info] UE switches to state [MM-DEREGISTERED/NORMAL-SERVICE]
[2021-03-11 14:04:13.381] [nas] [debug] Sending Initial Registration
[2021-03-11 14:04:13.381] [nas] [info] UE switches to state [MM-REGISTER-INITIATED/NA]
[2021-03-11 14:04:13.381] [rrc] [debug] Sending RRC Setup Request
[2021-03-11 14:04:13.382] [rrc] [info] RRC connection established
[2021-03-11 14:04:13.382] [nas] [info] UE switches to state [CM-CONNECTED]
[2021-03-11 14:04:13.468] [nas] [debug] Security Mode Command received
[2021-03-11 14:04:13.468] [nas] [debug] Derived NAS keys integrity[48497A93CC85318C59DEF6634378BFA2] ciphering[E67A0C93F8293575A1ACAB5202CABB04]
[2021-03-11 14:04:13.468] [nas] [debug] Selected integrity[2] ciphering[2]
[2021-03-11 14:04:13.680] [nas] [debug] Registration accept received
[2021-03-11 14:04:13.680] [nas] [info] UE switches to state [MM-REGISTERED/NORMAL-SERVICE]
[2021-03-11 14:04:13.680] [nas] [info] Initial Registration is successful
[2021-03-11 14:04:13.680] [nas] [info] Initial PDU sessions are establishing [1#]
[2021-03-11 14:04:13.680] [nas] [debug] Sending PDU session establishment request
[2021-03-11 14:04:14.211] [nas] [warning] SM cause received in PduSessionEstablishmentAccept: PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED
[2021-03-11 14:04:14.211] [nas] [info] PDU Session establishment is successful PSI[1]
[2021-03-11 14:04:14.232] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 60.60.0.1] is up.
Hi,
Please I am having issues running ueransim with Free5gc. Any ideas what could be the issue?
UE:
AMF logs:
Config UE:
Config gNB: