HewlettPackard / PacketRusher

High performance 5G UE/gNB Simulator and CP/UP load tester.
Apache License 2.0
100 stars 21 forks source link

Ngap Handover Test Issue #128

Closed golisrikanth1989 closed 2 weeks ago

golisrikanth1989 commented 2 weeks ago

Hi All, I am testing for N2 Handover with free5GC for different command versions.

while running with tunnel flag, there is an issue of service reject saying thatUE identity cannot be derived by the network sudo ./packetrusher multi-ue -n 1 -idl 13000 -ngh 23000 --tunnel -dedicatedGnb INFO[0000] Selecting 192.168.56.101 for host 192.168.56.101 as AMF's IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N3/Data IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/bloxtelap/PacketRusher/config/config.yml INFO[0000] PacketRusher version 1.0.1
INFO[0000] ---------------------------------------
INFO[0000] [TESTER] Starting test function: Testing registration of multiple UEs INFO[0000] [TESTER][UE] Number of UEs: 1
INFO[0000] [TESTER][GNB] gNodeB control interface IP/Port: 192.168.56.106/9487~ INFO[0000] [TESTER][GNB] gNodeB data interface IP/Port: 192.168.56.106/2152 INFO[0000] [TESTER][AMF] AMF IP/Port: 192.168.56.101/38412 INFO[0000] ---------------------------------------
WARN[0000] [TESTER] We are increasing the number of gNodeB to two for handover test cases. Make you sure you fill the requirements for having two gNodeBs. INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [TESTER] TESTING REGISTRATION USING IMSI 0000000001 UE INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [UE] Initiating Registration
INFO[0001] [UE] Switched from state 0 to state 1
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message without security header
INFO[0001] [UE][NAS] Receive Authentication Request
INFO[0001] [UE][NAS][MAC] Authenticity of the authentication request message: OK INFO[0001] [UE][NAS][SQN] SQN of the authentication request message: VALID INFO[0001] [UE][NAS] Send authentication response
INFO[0001] [UE] Switched from state 1 to state 2
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and with NEW 5G NAS SECURITY CONTEXT INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Security Mode Command
INFO[0001] [UE][NAS] Type of ciphering algorithm is 5G-EA0 INFO[0001] [UE][NAS] Type of integrity protection algorithm is 128-5G-IA2 INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Initial Context Setup Request INFO[0001] [GNB][UE] UE Context was created with successful INFO[0001] [GNB][UE] UE RAN ID 1
INFO[0001] [GNB][UE] UE AMF ID 17
INFO[0001] [GNB][UE] UE Mobility Restrict --Plmn-- Mcc: 208 Mnc: 93 INFO[0001] [GNB][UE] UE Masked Imeisv: 1110000000ffff00 INFO[0001] [GNB][UE] Allowed Nssai-- Sst: [01 01] Sd: [010203 010203] INFO[0001] [GNB][NGAP][AMF] Send Initial Context Setup Response. INFO[0001] [GNB] Initiating Initial Context Setup Response INFO[0001] [GNB][NGAP] No PDU Session to set up in InitialContextSetupResponse. INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Registration Accept
INFO[0001] [UE][NAS] UE 5G GUTI: &{119 11 [242 2 248 57 202 254 0 0 0 0 14]} INFO[0001] [UE] Switched from state 2 to state 3
INFO[0001] [UE] Initiating New PDU Session
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive PDU Session Resource Setup Request INFO[0001] [GNB][NGAP][UE] PDU Session was created with successful. INFO[0001] [GNB][NGAP][UE] PDU Session Id: 1
INFO[0001] [GNB][NGAP][UE] NSSAI Selected --- sst: NSSAI was not selected sd: NSSAI was not selected INFO[0001] [GNB][NGAP][UE] PDU Session Type: ipv4
INFO[0001] [GNB][NGAP][UE] QOS Flow Identifier: 9
INFO[0001] [GNB][NGAP][UE] Uplink Teid: 21
INFO[0001] [GNB][NGAP][UE] Downlink Teid: 1
INFO[0001] [GNB][NGAP][UE] Non-Dynamic-5QI: 9
INFO[0001] [GNB][NGAP][UE] Priority Level ARP: 15
INFO[0001] [GNB][NGAP][UE] UPF Address: 192.168.56.101 :2152 INFO[0001] [GNB] Initiating PDU Session Resource Setup Response INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive DL NAS Transport
INFO[0001] [UE][NAS] Receiving PDU Session Establishment Accept INFO[0001] [UE][NAS] PDU session QoS RULES: [1 0 6 49 49 1 1 255 9] INFO[0001] [UE][NAS] PDU session DNN: internet2
INFO[0001] [UE][NAS] PDU session NSSAI -- sst: 1 sd: 123 INFO[0001] [UE][NAS] PDU address received: 10.60.0.11
INFO[0002] [UE][GTP] Interface val0000000001 has successfully been configured for UE 10.60.0.11 INFO[0002] [UE][GTP] You can do traffic for this UE using VRF vrf0000000001, eg: INFO[0002] [UE][GTP] sudo ip vrf exec vrf0000000001 iperf3 -c IPERF_SERVER -p PORT -t 9000 INFO[0014] [UE] Switching to 5GMM-IDLE
INFO[0014] [GNB] Initiating UE Context Release Request
INFO[0014] [UE] Switched from state 3 to state 6
INFO[0014] [GNB][SCTP] Receive message in 0 stream
INFO[0014] [GNB][NGAP] Receive UE Context Release Command INFO[0014] [GNB] Initiating UE Context Complete
WARN[0014] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0014] [GNB][NGAP] Releasing UE Context, cause: radioNetwork: User inactivity INFO[0015] [GNB] Received incoming connection from new UE INFO[0015] [UE] Initiating Service Request
INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0015] [UE][NAS] Message without security header
ERRO[0015] [UE][NAS] Receive Service Reject
ERRO[0015] [UE][NAS] UE received a 5GMM Failure, cause: UE identity cannot be derived by the network INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive UE Context Release Command INFO[0015] [GNB] Initiating UE Context Complete
WARN[0015] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0015] [GNB][NGAP] Releasing UE Context, cause: nas: Normal release INFO[0024] [GNB] Initiating NGAP UE Handover
FATA[0024] [GNB][NGAP] Error getting UE from PR UE ID: UE is not find in GNB PR UE POOL

and while running the command without tunnel flag, there is no handover complete message and tunnel is diabled sudo ./packetrusher multi-ue -n 1 -ngh 23000 INFO[0000] Selecting 192.168.56.101 for host 192.168.56.101 as AMF's IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N3/Data IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/bloxtelap/PacketRusher/config/config.yml INFO[0000] PacketRusher version 1.0.1
INFO[0000] ---------------------------------------
INFO[0000] [TESTER] Starting test function: Testing registration of multiple UEs INFO[0000] [TESTER][UE] Number of UEs: 1
INFO[0000] [TESTER][GNB] gNodeB control interface IP/Port: 192.168.56.106/9487~ INFO[0000] [TESTER][GNB] gNodeB data interface IP/Port: 192.168.56.106/2152 INFO[0000] [TESTER][AMF] AMF IP/Port: 192.168.56.101/38412 INFO[0000] ---------------------------------------
WARN[0000] [TESTER] We are increasing the number of gNodeB to two for handover test cases. Make you sure you fill the requirements for having two gNodeBs. INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [TESTER] TESTING REGISTRATION USING IMSI 0000000001 UE INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [UE] Initiating Registration
INFO[0001] [UE] Switched from state 0 to state 1
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message without security header
INFO[0001] [UE][NAS] Receive Authentication Request
INFO[0001] [UE][NAS][MAC] Authenticity of the authentication request message: OK INFO[0001] [UE][NAS][SQN] SQN of the authentication request message: VALID INFO[0001] [UE][NAS] Send authentication response
INFO[0001] [UE] Switched from state 1 to state 2
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and with NEW 5G NAS SECURITY CONTEXT INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Security Mode Command
INFO[0001] [UE][NAS] Type of ciphering algorithm is 5G-EA0 INFO[0001] [UE][NAS] Type of integrity protection algorithm is 128-5G-IA2 INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Initial Context Setup Request INFO[0001] [GNB][UE] UE Context was created with successful INFO[0001] [GNB][UE] UE RAN ID 1
INFO[0001] [GNB][UE] UE AMF ID 19
INFO[0001] [GNB][UE] UE Mobility Restrict --Plmn-- Mcc: 208 Mnc: 93 INFO[0001] [GNB][UE] UE Masked Imeisv: 1110000000ffff00 INFO[0001] [GNB][UE] Allowed Nssai-- Sst: [01 01] Sd: [010203 010203] INFO[0001] [GNB][NGAP][AMF] Send Initial Context Setup Response. INFO[0001] [GNB] Initiating Initial Context Setup Response INFO[0001] [GNB][NGAP] No PDU Session to set up in InitialContextSetupResponse. INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Registration Accept
INFO[0001] [UE][NAS] UE 5G GUTI: &{119 11 [242 2 248 57 202 254 0 0 0 0 16]} INFO[0001] [UE] Switched from state 2 to state 3
INFO[0001] [UE] Initiating New PDU Session
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive PDU Session Resource Setup Request INFO[0001] [GNB][NGAP][UE] PDU Session was created with successful. INFO[0001] [GNB][NGAP][UE] PDU Session Id: 1
INFO[0001] [GNB][NGAP][UE] NSSAI Selected --- sst: NSSAI was not selected sd: NSSAI was not selected INFO[0001] [GNB][NGAP][UE] PDU Session Type: ipv4
INFO[0001] [GNB][NGAP][UE] QOS Flow Identifier: 9
INFO[0001] [GNB][NGAP][UE] Uplink Teid: 23
INFO[0001] [GNB][NGAP][UE] Downlink Teid: 1
INFO[0001] [GNB][NGAP][UE] Non-Dynamic-5QI: 9
INFO[0001] [GNB][NGAP][UE] Priority Level ARP: 15
INFO[0001] [GNB][NGAP][UE] UPF Address: 192.168.56.101 :2152 INFO[0001] [GNB] Initiating PDU Session Resource Setup Response INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive DL NAS Transport
INFO[0001] [UE][NAS] Receiving PDU Session Establishment Accept INFO[0001] [UE][NAS] PDU session QoS RULES: [1 0 6 49 49 1 1 255 9] INFO[0001] [UE][NAS] PDU session DNN: internet2
INFO[0001] [UE][NAS] PDU session NSSAI -- sst: 1 sd: 123 INFO[0001] [UE][NAS] PDU address received: 10.60.0.12
INFO[0001] [UE][GTP] Interface for UE 0000000001 has not been created. Tunnel has been disabled. INFO[0024] [GNB] Initiating NGAP UE Handover
INFO[0024] [GNB][SCTP] Receive message in 0 stream
INFO[0024] [GNB][NGAP] Receive Handover Request
INFO[0024] [GNB] Initiating Handover Request Acknowledge INFO[0024] [GNB][SCTP] Receive message in 0 stream
INFO[0024] [GNB][NGAP] Receive Handover Command
INFO[0024] [UE] gNodeB is telling us to use another gNodeB INFO[0024] [GNB] Cleaning up context on current gNb
INFO[0024] [GNB] Initiating Handover Notify
INFO[0024] [UE][GTP] Interface for UE 0000000001 has not been created. Tunnel has been disabled. INFO[0024] [GNB][SCTP] Receive message in 0 stream
INFO[0024] [GNB][NGAP] Receive UE Context Release Command INFO[0024] [GNB] Initiating UE Context Complete
INFO[0024] [GNB][NGAP] Releasing UE Context, cause: nas: Normal release

Any suggestion on this for sucessful handover test and logs/pcaps are attached below ngap_handover_test_withtunnel.log ngaphandover_with.zip

linouxis9 commented 2 weeks ago

Hi @golisrikanth1989, Thanks a lot for opening this issue. Could you share with me the free5gc's AMF and SMF logs (with it set at debug level)? Also, does it work if you do the Handover before the Idling? Thanks! Valentin

golisrikanth1989 commented 2 weeks ago

Thank you for the Response, @linouxis9. Please let me know if any logs/pcaps ngap test cases are required. amf.log

linouxis9 commented 2 weeks ago

Yes if possible @golisrikanth1989, I would need AMF's logs and pcap when running sudo ./packetrusher multi-ue -n 1 -idl 13000 -ngh 23000 --tunnel -dedicatedGnb and sudo ./packetrusher multi-ue -n 1 -idl 13000 --tunnel -dedicatedGnb. I believe the issue is actually not with NGAP Handover but with the Idling / Service Request procedure. Thanks a lot!

golisrikanth1989 commented 2 weeks ago

@linouxis9 Here is the info required for the above cases,

sudo ./packetrusher multi-ue -n 1 -idl 13000 -ngh 23000 --tunnel -dedicatedGnb [sudo] password for bloxtelap: INFO[0000] Selecting 192.168.56.101 for host 192.168.56.101 as AMF's IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N3/Data IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/bloxtelap/PacketRusher/config/config.yml INFO[0000] PacketRusher version 1.0.1
INFO[0000] ---------------------------------------
INFO[0000] [TESTER] Starting test function: Testing registration of multiple UEs INFO[0000] [TESTER][UE] Number of UEs: 1
INFO[0000] [TESTER][GNB] gNodeB control interface IP/Port: 192.168.56.106/9487~ INFO[0000] [TESTER][GNB] gNodeB data interface IP/Port: 192.168.56.106/2152 INFO[0000] [TESTER][AMF] AMF IP/Port: 192.168.56.101/38412 INFO[0000] ---------------------------------------
WARN[0000] [TESTER] We are increasing the number of gNodeB to two for handover test cases. Make you sure you fill the requirements for having two gNodeBs. INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [TESTER] TESTING REGISTRATION USING IMSI 0000000001 UE INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [UE] Initiating Registration
INFO[0001] [UE] Switched from state 0 to state 1
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message without security header
INFO[0001] [UE][NAS] Receive Authentication Request
INFO[0001] [UE][NAS][MAC] Authenticity of the authentication request message: OK INFO[0001] [UE][NAS][SQN] SQN of the authentication request message: VALID INFO[0001] [UE][NAS] Send authentication response
INFO[0001] [UE] Switched from state 1 to state 2
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and with NEW 5G NAS SECURITY CONTEXT INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Security Mode Command
INFO[0001] [UE][NAS] Type of ciphering algorithm is 5G-EA0 INFO[0001] [UE][NAS] Type of integrity protection algorithm is 128-5G-IA2 INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Initial Context Setup Request INFO[0001] [GNB][UE] UE Context was created with successful INFO[0001] [GNB][UE] UE RAN ID 1
INFO[0001] [GNB][UE] UE AMF ID 1
INFO[0001] [GNB][UE] UE Mobility Restrict --Plmn-- Mcc: 208 Mnc: 93 INFO[0001] [GNB][UE] UE Masked Imeisv: 1110000000ffff00 INFO[0001] [GNB][UE] Allowed Nssai-- Sst: [01 01] Sd: [010203 010203] INFO[0001] [GNB][NGAP][AMF] Send Initial Context Setup Response. INFO[0001] [GNB] Initiating Initial Context Setup Response INFO[0001] [GNB][NGAP] No PDU Session to set up in InitialContextSetupResponse. INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Registration Accept
INFO[0001] [UE][NAS] UE 5G GUTI: &{119 11 [242 2 248 57 202 254 0 0 0 0 1]} INFO[0001] [UE] Switched from state 2 to state 3
INFO[0001] [UE] Initiating New PDU Session
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive PDU Session Resource Setup Request INFO[0001] [GNB][NGAP][UE] PDU Session was created with successful. INFO[0001] [GNB][NGAP][UE] PDU Session Id: 1
INFO[0001] [GNB][NGAP][UE] NSSAI Selected --- sst: NSSAI was not selected sd: NSSAI was not selected INFO[0001] [GNB][NGAP][UE] PDU Session Type: ipv4
INFO[0001] [GNB][NGAP][UE] QOS Flow Identifier: 9
INFO[0001] [GNB][NGAP][UE] Uplink Teid: 1
INFO[0001] [GNB][NGAP][UE] Downlink Teid: 1
INFO[0001] [GNB][NGAP][UE] Non-Dynamic-5QI: 9
INFO[0001] [GNB][NGAP][UE] Priority Level ARP: 15
INFO[0001] [GNB][NGAP][UE] UPF Address: 192.168.56.101 :2152 INFO[0001] [GNB] Initiating PDU Session Resource Setup Response INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive DL NAS Transport
INFO[0001] [UE][NAS] Receiving PDU Session Establishment Accept INFO[0001] [UE][NAS] PDU session QoS RULES: [1 0 6 49 49 1 1 255 9] INFO[0001] [UE][NAS] PDU session DNN: internet2
INFO[0001] [UE][NAS] PDU session NSSAI -- sst: 1 sd: 123 INFO[0001] [UE][NAS] PDU address received: 10.60.0.1
INFO[0002] [UE][GTP] Interface val0000000001 has successfully been configured for UE 10.60.0.1 INFO[0002] [UE][GTP] You can do traffic for this UE using VRF vrf0000000001, eg: INFO[0002] [UE][GTP] sudo ip vrf exec vrf0000000001 iperf3 -c IPERF_SERVER -p PORT -t 9000 INFO[0014] [UE] Switching to 5GMM-IDLE
INFO[0014] [GNB] Initiating UE Context Release Request
INFO[0014] [UE] Switched from state 3 to state 6
INFO[0014] [GNB][SCTP] Receive message in 0 stream
INFO[0014] [GNB][NGAP] Receive UE Context Release Command INFO[0014] [GNB] Initiating UE Context Complete
INFO[0014] [GNB][NGAP] Releasing UE Context, cause: radioNetwork: User inactivity WARN[0014] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0015] [GNB] Received incoming connection from new UE INFO[0015] [UE] Initiating Service Request
INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0015] [UE][NAS] Message without security header
ERRO[0015] [UE][NAS] Receive Service Reject
ERRO[0015] [UE][NAS] UE received a 5GMM Failure, cause: UE identity cannot be derived by the network INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive UE Context Release Command INFO[0015] [GNB] Initiating UE Context Complete
WARN[0015] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0015] [GNB][NGAP] Releasing UE Context, cause: nas: Normal release INFO[0024] [GNB] Initiating NGAP UE Handover
FATA[0024] [GNB][NGAP] Error getting UE from PR UE ID: UE is not find in GNB PR UE POOL ngap_idl_test_amflogpcap.zip

/PacketRusher$ sudo ./packetrusher multi-ue -n 1 -idl 13000 --tunnel -dedicatedGnb INFO[0000] Selecting 192.168.56.101 for host 192.168.56.101 as AMF's IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N3/Data IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/bloxtelap/PacketRusher/config/config.yml INFO[0000] PacketRusher version 1.0.1
INFO[0000] ---------------------------------------
INFO[0000] [TESTER] Starting test function: Testing registration of multiple UEs INFO[0000] [TESTER][UE] Number of UEs: 1
INFO[0000] [TESTER][GNB] gNodeB control interface IP/Port: 192.168.56.106/9487~ INFO[0000] [TESTER][GNB] gNodeB data interface IP/Port: 192.168.56.106/2152 INFO[0000] [TESTER][AMF] AMF IP/Port: 192.168.56.101/38412 INFO[0000] ---------------------------------------
INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [TESTER] TESTING REGISTRATION USING IMSI 0000000001 UE INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [UE] Initiating Registration
INFO[0001] [UE] Switched from state 0 to state 1
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message without security header
INFO[0001] [UE][NAS] Receive Authentication Request
INFO[0001] [UE][NAS][MAC] Authenticity of the authentication request message: OK INFO[0001] [UE][NAS][SQN] SQN of the authentication request message: VALID INFO[0001] [UE][NAS] Send authentication response
INFO[0001] [UE] Switched from state 1 to state 2
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and with NEW 5G NAS SECURITY CONTEXT INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Security Mode Command
INFO[0001] [UE][NAS] Type of ciphering algorithm is 5G-EA0 INFO[0001] [UE][NAS] Type of integrity protection algorithm is 128-5G-IA2 INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Initial Context Setup Request INFO[0001] [GNB][UE] UE Context was created with successful INFO[0001] [GNB][UE] UE RAN ID 1
INFO[0001] [GNB][UE] UE AMF ID 3
INFO[0001] [GNB][UE] UE Mobility Restrict --Plmn-- Mcc: 208 Mnc: 93 INFO[0001] [GNB][UE] UE Masked Imeisv: 1110000000ffff00 INFO[0001] [GNB][UE] Allowed Nssai-- Sst: [01 01] Sd: [010203 010203] INFO[0001] [GNB][NGAP][AMF] Send Initial Context Setup Response. INFO[0001] [GNB] Initiating Initial Context Setup Response INFO[0001] [GNB][NGAP] No PDU Session to set up in InitialContextSetupResponse. INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Registration Accept
INFO[0001] [UE][NAS] UE 5G GUTI: &{119 11 [242 2 248 57 202 254 0 0 0 0 3]} INFO[0001] [UE] Switched from state 2 to state 3
INFO[0001] [UE] Initiating New PDU Session
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive PDU Session Resource Setup Request INFO[0001] [GNB][NGAP][UE] PDU Session was created with successful. INFO[0001] [GNB][NGAP][UE] PDU Session Id: 1
INFO[0001] [GNB][NGAP][UE] NSSAI Selected --- sst: NSSAI was not selected sd: NSSAI was not selected INFO[0001] [GNB][NGAP][UE] PDU Session Type: ipv4
INFO[0001] [GNB][NGAP][UE] QOS Flow Identifier: 9
INFO[0001] [GNB][NGAP][UE] Uplink Teid: 3
INFO[0001] [GNB][NGAP][UE] Downlink Teid: 1
INFO[0001] [GNB][NGAP][UE] Non-Dynamic-5QI: 9
INFO[0001] [GNB][NGAP][UE] Priority Level ARP: 15
INFO[0001] [GNB][NGAP][UE] UPF Address: 192.168.56.101 :2152 INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [GNB] Initiating PDU Session Resource Setup Response INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive DL NAS Transport
INFO[0001] [UE][NAS] Receiving PDU Session Establishment Accept INFO[0001] [UE][NAS] PDU session QoS RULES: [1 0 6 49 49 1 1 255 9] INFO[0001] [UE][NAS] PDU session DNN: internet2
INFO[0001] [UE][NAS] PDU session NSSAI -- sst: 1 sd: 123 INFO[0001] [UE][NAS] PDU address received: 10.60.0.2
INFO[0002] [UE][GTP] Interface val0000000001 has successfully been configured for UE 10.60.0.2 INFO[0002] [UE][GTP] You can do traffic for this UE using VRF vrf0000000001, eg: INFO[0002] [UE][GTP] sudo ip vrf exec vrf0000000001 iperf3 -c IPERF_SERVER -p PORT -t 9000 INFO[0014] [UE] Switching to 5GMM-IDLE
INFO[0014] [GNB] Initiating UE Context Release Request
INFO[0014] [UE] Switched from state 3 to state 6
INFO[0014] [GNB][SCTP] Receive message in 0 stream
INFO[0014] [GNB][NGAP] Receive UE Context Release Command INFO[0014] [GNB] Initiating UE Context Complete
WARN[0014] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0014] [GNB][NGAP] Releasing UE Context, cause: radioNetwork: User inactivity INFO[0015] [GNB] Received incoming connection from new UE INFO[0015] [UE] Initiating Service Request
INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0015] [UE][NAS] Message without security header
ERRO[0015] [UE][NAS] Receive Service Reject
ERRO[0015] [UE][NAS] UE received a 5GMM Failure, cause: UE identity cannot be derived by the network INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive UE Context Release Command INFO[0015] [GNB] Initiating UE Context Complete
WARN[0015] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0015] [GNB][NGAP] Releasing UE Context, cause: nas: Normal release ^CINFO[0102] [UE] Terminating UE as requested
INFO[0103] [UE] UE Terminated
INFO[0103] [UE] Switched from state 6 to state 0

linouxis9 commented 2 weeks ago

I think I found the issue, PacketRusher might be using the wrong Integrity algorithm in the Service Request message. Can you test these two commands again but with setting NIA0/NEA0 = false and only NIA/NEA2 = true? Thanks @golisrikanth1989!

golisrikanth1989 commented 2 weeks ago

Hi @linouxis9, Tried setting up the amf and Packetrusher config as mentioned still the issues remain same i.e "UE Identify cannot be derived by Network" Screenshot from 2024-06-24 17-47-16

sudo ./packetrusher multi-ue -n 1 -idl 13000 --tunnel -dedicatedGnb INFO[0000] Selecting 192.168.56.101 for host 192.168.56.101 as AMF's IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N3/Data IP address INFO[0000] Selecting 192.168.56.106 for host 192.168.56.106 as gNodeB's N2/Control IP address INFO[0000] Loaded config at: /home/bloxtelap/PacketRusher/config/config.yml INFO[0000] PacketRusher version 1.0.1
INFO[0000] ---------------------------------------
INFO[0000] [TESTER] Starting test function: Testing registration of multiple UEs INFO[0000] [TESTER][UE] Number of UEs: 1
INFO[0000] [TESTER][GNB] gNodeB control interface IP/Port: 192.168.56.106/9487~ INFO[0000] [TESTER][GNB] gNodeB data interface IP/Port: 192.168.56.106/2152 INFO[0000] [TESTER][AMF] AMF IP/Port: 192.168.56.101/38412 INFO[0000] ---------------------------------------
INFO[0000] [GNB] SCTP/NGAP service is running
INFO[0000] [GNB] Initiating NG Setup Request
INFO[0000] [GNB][SCTP] Receive message in 0 stream
INFO[0000] [GNB][NGAP] Receive NG Setup Response
INFO[0000] [GNB][AMF] AMF Name: AMF
INFO[0000] [GNB][AMF] State of AMF: Active
INFO[0000] [GNB][AMF] Capacity of AMF: 255
INFO[0000] [GNB][AMF] PLMNs Identities Supported by AMF -- mcc: 208 mnc:93 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:010203 INFO[0000] [GNB][AMF] List of AMF slices Supported by AMF -- sst:01 sd:112233 INFO[0001] [TESTER] TESTING REGISTRATION USING IMSI 0000000001 UE INFO[0001] [GNB] Received incoming connection from new UE INFO[0001] [UE] Initiating Registration
INFO[0001] [UE] Switched from state 0 to state 1
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message without security header
INFO[0001] [UE][NAS] Receive Authentication Request
INFO[0001] [UE][NAS][MAC] Authenticity of the authentication request message: OK INFO[0001] [UE][NAS][SQN] SQN of the authentication request message: VALID INFO[0001] [UE][NAS] Send authentication response
INFO[0001] [UE] Switched from state 1 to state 2
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and with NEW 5G NAS SECURITY CONTEXT INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Security Mode Command
INFO[0001] [UE][NAS] Type of ciphering algorithm is 128-5G-EA2 INFO[0001] [UE][NAS] Type of integrity protection algorithm is 128-5G-IA2 INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive Initial Context Setup Request INFO[0001] [GNB][UE] UE Context was created with successful INFO[0001] [GNB][UE] UE RAN ID 1
INFO[0001] [GNB][UE] UE AMF ID 1
INFO[0001] [GNB][UE] UE Mobility Restrict --Plmn-- Mcc: 208 Mnc: 93 INFO[0001] [GNB][UE] UE Masked Imeisv: 1110000000ffff00 INFO[0001] [GNB][UE] Allowed Nssai-- Sst: [01 01] Sd: [010203 010203] INFO[0001] [GNB][NGAP][AMF] Send Initial Context Setup Response. INFO[0001] [GNB] Initiating Initial Context Setup Response INFO[0001] [GNB][NGAP] No PDU Session to set up in InitialContextSetupResponse. INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive Registration Accept
INFO[0001] [UE][NAS] UE 5G GUTI: &{119 11 [242 2 248 57 202 254 0 0 0 0 1]} INFO[0001] [UE] Switched from state 2 to state 3
INFO[0001] [UE] Initiating New PDU Session
INFO[0001] [GNB][SCTP] Receive message in 0 stream
INFO[0001] [GNB][NGAP] Receive PDU Session Resource Setup Request INFO[0001] [GNB][NGAP][UE] PDU Session was created with successful. INFO[0001] [GNB][NGAP][UE] PDU Session Id: 1
INFO[0001] [GNB][NGAP][UE] NSSAI Selected --- sst: NSSAI was not selected sd: NSSAI was not selected INFO[0001] [GNB][NGAP][UE] PDU Session Type: ipv4
INFO[0001] [GNB][NGAP][UE] QOS Flow Identifier: 9
INFO[0001] [GNB][NGAP][UE] Uplink Teid: 1
INFO[0001] [GNB][NGAP][UE] Downlink Teid: 1
INFO[0001] [GNB][NGAP][UE] Non-Dynamic-5QI: 9
INFO[0001] [GNB][NGAP][UE] Priority Level ARP: 15
INFO[0001] [GNB][NGAP][UE] UPF Address: 192.168.56.101 :2152 INFO[0001] [GNB] Initiating PDU Session Resource Setup Response INFO[0001] [UE][NAS] Message with security header
INFO[0001] [UE][NAS] Message with integrity and ciphered INFO[0001] [UE][NAS] successful NAS CIPHERING
INFO[0001] [UE][NAS] successful NAS MAC verification
INFO[0001] [UE][NAS] Receive DL NAS Transport
INFO[0001] [UE][NAS] Receiving PDU Session Establishment Accept INFO[0001] [UE][NAS] PDU session QoS RULES: [1 0 6 49 49 1 1 255 9] INFO[0001] [UE][NAS] PDU session DNN: internet2
INFO[0001] [UE][NAS] PDU session NSSAI -- sst: 1 sd: 123 INFO[0001] [UE][NAS] PDU address received: 10.60.0.1
INFO[0002] [UE][GTP] Interface val0000000001 has successfully been configured for UE 10.60.0.1 INFO[0002] [UE][GTP] You can do traffic for this UE using VRF vrf0000000001, eg: INFO[0002] [UE][GTP] sudo ip vrf exec vrf0000000001 iperf3 -c IPERF_SERVER -p PORT -t 9000 INFO[0014] [UE] Switching to 5GMM-IDLE
INFO[0014] [GNB] Initiating UE Context Release Request
INFO[0014] [UE] Switched from state 3 to state 6
INFO[0014] [GNB][SCTP] Receive message in 0 stream
INFO[0014] [GNB][NGAP] Receive UE Context Release Command WARN[0014] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0014] [GNB] Initiating UE Context Complete
INFO[0014] [GNB][NGAP] Releasing UE Context, cause: radioNetwork: User inactivity INFO[0015] [GNB] Received incoming connection from new UE INFO[0015] [UE] Initiating Service Request
INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive Downlink NAS Transport
INFO[0015] [UE][NAS] Message without security header
ERRO[0015] [UE][NAS] Receive Service Reject
ERRO[0015] [UE][NAS] UE received a 5GMM Failure, cause: UE identity cannot be derived by the network INFO[0015] [GNB][SCTP] Receive message in 0 stream
INFO[0015] [GNB][NGAP] Receive UE Context Release Command INFO[0015] [GNB] Initiating UE Context Complete
WARN[0015] [UE][0000000001] Stopping UE as communication with gNB was closed INFO[0015] [GNB][NGAP] Releasing UE Context, cause: nas: Normal release ^CINFO[0023] [UE] Terminating UE as requested
INFO[0023] [UE] UE Terminated
INFO[0023] [UE] Switched from state 6 to state 0

linouxis9 commented 2 weeks ago

Hi @golisrikanth1989,

I believe the PR #129 fix your issue, can you try your test case again with the fix in the pull request?

git pull
git checkout fix/128
go build cmd/packetrusher.go
sudo ./packetrusher...

Thanks a lot!

Valentin

golisrikanth1989 commented 2 weeks ago

Hi @linouxis9, Now, every mode(idl/xnh/ngh) is working with the fix/128. Thanks for the discussion and help. Here are the logs/pcaps for the test case attached to this idl_sucess_test.zip I wanted to learn and contribute to this project, Any suggestions on where to start? Thanks once again!

linouxis9 commented 2 weeks ago

Hi @golisrikanth1989, That's great to hear!! In what area would you like to contribute? Code, docs? Is there any feature missing you would like to contribute? As for doc, we are missing the Usage Guide here: https://github.com/HewlettPackard/PacketRusher/wiki which would explain some of the option you used (idk, ngh...) Thanks a lot! Valentin