fasferraz / NWu-Non3GPP-5GC

NWu IKEv2/IPSec Dialer for 5GC / N3IWF
GNU General Public License v3.0
29 stars 16 forks source link

No connection found for UE to send NAS message. This message will be cached in N3IWF #5

Closed AravindkannanCT closed 1 year ago

AravindkannanCT commented 1 year ago

Hi, i am getting the folllowing error in the n3iwf from free5gc, No connection found for UE to send NAS message. This message will be cached in N3IWF

and from the logs from your script is : [ 2023-05-23 13:43:15.048422 ]

Signaling SA CHILD created. Establishing TCP session towards NAS...

Cannot create namespace file "/run/netns/tcp_socket_signalling": File exists [ 2023-05-23 13:43:15.154198 ] cmd: ip netns exec tcp_socket_signalling ip link set dev tun2 up [ 2023-05-23 13:43:15.181579 ] cmd: ip netns exec tcp_socket_signalling ip addr add 10.0.0.247/32 dev tun2 [ 2023-05-23 13:43:15.200347 ] cmd: ip netns exec tcp_socket_signalling route add -net 0.0.0.0/0 gw 10.0.0.247 [ 2023-05-23 13:43:17.283005 ] Tcp connection to NAS timeouted. Ending TCP Process. [ 2023-05-23 13:43:17.284410 ] Exiting TCP process. Process terminated.

AravindkannanCT commented 1 year ago

request: 21 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Inbound SPI: 4138871412, Outbound SPI: 3685019592 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Encoding IKE payloads 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Authentication] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Configuration] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [SecurityAssociation] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [TrafficSelector] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [TrafficSelector] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Notification] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Notification] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Encoding IKE message 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Encoding IKE payloads 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Encrypted] marshal(): Start marshalling 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] ====== IPSec/Child SA Info ====== 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] XFRM interface if_id: 1 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Inbound SPI: 0x00000000f6b22a74 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] [UE:127.0.0.1] -> [N3IWF:10.0.2.15] 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Encryption Algorithm: 12 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Encryption Key: 0x19f9c6c0f6325f830bd9bab60558edc8223fdb14509642c7e48aef279f5c9b69 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Integrity Algorithm: 2 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Integrity Key: 0xa71f2f3b0e3428ec4c18bdd710ebe1c351207916 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] ====== IPSec/Child SA Info ====== 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] XFRM interface if_id: 1 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Outbound SPI: 0x00000000dba4efc8 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] [N3IWF:10.0.2.15] -> [UE:127.0.0.1] 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Encryption Algorithm: 12 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Encryption Key: 0xab0e56b6a9c738bd8c77e98230a47ac0eaa9f2982f41da885d3b978fb368d0ac 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Integrity Algorithm: 2 2023-05-23T13:49:13Z [DEBU][N3IWF][IKE] IPSec Integrity Key: 0x0b044994d36ac144aecee9d18a3129fa43858f8d 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Encoding IKE message 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] Encoding IKE payloads 2023-05-23T13:49:13Z [INFO][N3IWF][IKE] [Encrypted] marshal(): Start marshalling 2023-05-23T13:49:13Z [INFO][N3IWF][NGAP] [N3IWF] Send Initial Context Setup Response 2023-05-23T13:49:13Z [INFO][N3IWF][NGAP] [N3IWF] Handle Downlink NAS Transport 2023-05-23T13:49:13Z [WARN][N3IWF][NGAP] No NAS signalling session found, retry... 2023-05-23T13:49:13Z [WARN][N3IWF][IKE] Received an IKE packet that does not prepend 4 bytes zero from UDP port 4500, this packet may be the UDP encapsulated ESP. The packet will not be handled. 2023-05-23T13:49:13Z [WARN][N3IWF][NGAP] No NAS signalling session found, retry... 2023-05-23T13:49:14Z [WARN][N3IWF][NGAP] No connection found for UE to send NAS message. This message will be cached in N3IWF 2023-05-23T13:49:14Z [WARN][N3IWF][IKE] Received an IKE packet that does not prepend 4 bytes zero from UDP port 4500, this packet may be the UDP encapsulated ESP. The packet will not be handled. 2023-05-23T13:49:17Z [WARN][N3IWF][IKE] Received an IKE packet that does not prepend 4 bytes zero from UDP port 4500, this packet may be the UDP encapsulated ESP. The packet will not be handled. 2023-05-23T13:49:24Z [WARN][N3IWF][IKE] Received an IKE packet that does not prepend 4 bytes zero from UDP port 4500, this packet may be the UDP encapsulated ESP. The packet will not be handled. 2023-05-23T13:49:40Z [WARN][N3IWF][IKE] Received an IKE packet that does not prepend 4 bytes zero from UDP port 4500, this packet may be the UDP encapsulated ESP. The packet will not be handled.

AymanSadiki commented 11 months ago

Hi, I'm having the same problem, how did you fix it?

Signaling SA CHILD created. Establishing TCP session towards NAS...

Cannot create namespace file "/run/netns/tcp_socket_signalling": File exists [ 2023-09-29 08:41:52.346083 ] cmd: ip netns exec tcp_socket_signalling ip link set dev tun2 up [ 2023-09-29 08:41:52.352494 ] cmd: ip netns exec tcp_socket_signalling ip addr add 10.0.0.50/32 dev tun2 [ 2023-09-29 08:41:52.357528 ] cmd: ip netns exec tcp_socket_signalling route add -net 0.0.0.0/0 gw 10.0.0.50 [ 2023-09-29 08:41:54.379555 ] Tcp connection to NAS timeouted. Ending TCP Process. [ 2023-09-29 08:41:54.380013 ] Exiting TCP process. Process terminated.

AravindkannanCT commented 11 months ago

If i remember correctly, this error message has to do with the operator code type "OPc". can you check that once in the core network ? this has to be declared when deploying a new UE in the webinterface of free5gc.....but i am not sure if thats the case.

AymanSadiki commented 11 months ago

Do you mean this?

image
AravindkannanCT commented 11 months ago

yes and change it to OPc

AymanSadiki commented 11 months ago

If I change it to OPc, I get the error that you mentioned in another chat. The error is in state 4 "nwu_swu' object has no attribute 'kn3iwf'

AravindkannanCT commented 11 months ago

then i think its 'OP'. i will give you my connection string that was successful . most probably it has to do with the network interfaces.....

"python3 nwu_emulator.py -a internet -M 208 -N 93 -I 208930000000001 -K 8baf473f2f8fd09487cccbd7097c6862 -P 8e27b6af0e692e750f32667a3b14605d -d 17.0.0.4 -s 22.0.0.4 -F -n tunnel_name -U 500"

17.0.0.4 is the ike_bind 22.0.0.4 is the gtpbind address in the n3iwf cfg