Unable to ping from uernasim pod

Hi All,

I have successfully deployed(Kubernetes helm based installation) Free5gc and Uernasim on my Kubernetes single node cluster. All the free5gc & ueransim pods are coming up and in running state. GTP tunnel interface is getting created on ueransim however Ping is not working from the uesimtun0 interface. Please find the details below,

Pod Status
*$ kubectl get pods *
NAME READY STATUS RESTARTS AGE
free6gc-free5gc-amf-amf-6d84c87565-s8fhx 1/1 Running 0 5m47s
free6gc-free5gc-ausf-ausf-7d45f5d64d-f95q5 1/1 Running 0 5m47s
free6gc-free5gc-nrf-nrf-68b575646d-8xxqf 1/1 Running 0 5m47s
free6gc-free5gc-nssf-nssf-88976c5cc-2f2m8 1/1 Running 0 5m47s
free6gc-free5gc-pcf-pcf-5fc48b4f6d-zmvf6 1/1 Running 0 5m47s
free6gc-free5gc-smf-smf-6845877c9d-b72s9 1/1 Running 0 5m47s
free6gc-free5gc-udm-udm-dddc64797-868bb 1/1 Running 0 5m47s
free6gc-free5gc-udr-udr-7746494994-jxrfs 1/1 Running 0 5m47s
free6gc-free5gc-upf-upf-7db7fb848c-46nj8 1/1 Running 0 5m47s
free6gc-free5gc-webui-webui-9c8bdcb9d-v2x6w 1/1 Running 0 5m47s
mongodb-0 1/1 Running 0 5m47s
ue-ueransim-gnb-64499ff5b6-bcm5h 1/1 Running 1 (3m46s ago) 4m22s
ue-ueransim-test-connection 0/1 Completed 0 106s
ue-ueransim-ue-7459587c95-69kgn 1/1 Running 0 4m22s

helm ue connectivity test
$ helm --namespace default test ue
NAME: ue
LAST DEPLOYED: Tue Aug 16 19:20:19 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: connectivity-test-configmap
Last Started: Tue Aug 16 19:21:50 2022
Last Completed: Tue Aug 16 19:21:50 2022
Phase: Succeeded
TEST SUITE: ue-ueransim-test-connection
Last Started: Tue Aug 16 19:21:50 2022
Last Completed: Tue Aug 16 19:22:13 2022
Phase: Succeeded

ueransim logs
$ kubectl logs ue-ueransim-ue-7459587c95-w9tcb
UERANSIM v3.2.4
[2022-08-16 19:20:26.149] [nas] [info] UE switches to state [MM-DEREGISTERED/PLMN-SEARCH]
[2022-08-16 19:20:26.149] [rrc] [warning] Acceptable cell selection failed, no cell is in coverage
[2022-08-16 19:20:26.149] [rrc] [error] Cell selection failure, no suitable or acceptable cell found
[2022-08-16 19:20:26.149] [rrc] [debug] New signal detected for cell[1], total [1] cells in coverage
[2022-08-16 19:20:26.149] [nas] [info] Selected plmn[208/93]
[2022-08-16 19:20:26.149] [rrc] [info] Selected cell plmn[208/93] tac[1] category[SUITABLE]
[2022-08-16 19:20:26.149] [nas] [info] UE switches to state [MM-DEREGISTERED/PS]
[2022-08-16 19:20:26.149] [nas] [info] UE switches to state [MM-DEREGISTERED/NORMAL-SERVICE]
[2022-08-16 19:20:26.149] [nas] [debug] Initial registration required due to [MM-DEREG-NORMAL-SERVICE]
[2022-08-16 19:20:26.149] [nas] [debug] UAC access attempt is allowed for identity[0], category[MO_sig]
[2022-08-16 19:20:26.149] [nas] [debug] Sending Initial Registration
[2022-08-16 19:20:26.149] [nas] [info] UE switches to state [MM-REGISTER-INITIATED]
[2022-08-16 19:20:26.149] [rrc] [debug] Sending RRC Setup Request
[2022-08-16 19:20:26.150] [rrc] [info] RRC connection established
[2022-08-16 19:20:26.150] [rrc] [info] UE switches to state [RRC-CONNECTED]
[2022-08-16 19:20:26.150] [nas] [info] UE switches to state [CM-CONNECTED]
[2022-08-16 19:20:26.166] [nas] [debug] Authentication Request received
[2022-08-16 19:20:26.166] [nas] [debug] Sending Authentication Failure due to SQN out of range
[2022-08-16 19:20:26.174] [nas] [debug] Authentication Request received
[2022-08-16 19:20:26.256] [nas] [debug] Security Mode Command received
[2022-08-16 19:20:26.256] [nas] [debug] Selected integrity[2] ciphering[0]
[2022-08-16 19:20:26.356] [nas] [debug] Registration accept received
[2022-08-16 19:20:26.356] [nas] [info] UE switches to state [MM-REGISTERED/NORMAL-SERVICE]
[2022-08-16 19:20:26.356] [nas] [debug] Sending Registration Complete
[2022-08-16 19:20:26.356] [nas] [info] Initial Registration is successful
[2022-08-16 19:20:26.356] [nas] [debug] Sending PDU Session Establishment Request
[2022-08-16 19:20:26.356] [nas] [debug] UAC access attempt is allowed for identity[0], category[MO_sig]
[2022-08-16 19:20:26.589] [nas] [debug] PDU Session Establishment Accept received
[2022-08-16 19:20:26.589] [nas] [info] PDU Session establishment is successful PSI[1]
[2022-08-16 19:20:26.600] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 10.1.0.1] is up.

ueransim interface details

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

  • link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00*
  • inet 127.0.0.1/8 scope host lo*
  •   valid_lft forever preferred_lft forever*
    

2: [email protected]: mtu 1480 qdisc noop state DOWN group default qlen 1000

  • link/ipip 0.0.0.0 brd 0.0.0.0*
    3: uesimtun0: <POINTOPOINT,PROMISC,NOTRAILERS,UP,LOWER_UP> mtu 1400 qdisc fq_codel state UNKNOWN group default qlen 500
  • link/none *
  • inet 10.1.0.1/32 scope global uesimtun0*
  •   valid_lft forever preferred_lft forever*
    

*802: [email protected]: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1376 qdisc noqueue state UP group default *

  • link/ether 3e:f1:dd:40:8a:c6 brd ff:ff:ff:ff:ff:ff link-netnsid 0*
  • inet 10.32.0.62/12 brd 10.47.255.255 scope global eth0*
  •   valid_lft forever preferred_lft forever*
    

Ping test
# ping -I uesimtun0 www.google.com
PING www.google.com (172.253.62.105) from 10.1.0.1 uesimtun0: 56(84) bytes of data.
^C

15 packets transmitted, 0 received, 100% packet loss, time 14329ms

Requesting help to fix this connectivity issue from ueransim, Thanks in advance.

Please let me know for any other logs/details.

hi @Sooraj ,

I wonder where the packets go?
You can try tcpdump in each interface of every component (e.g., gnb, upf).
If packet stops at UPF, make sure you have set up the networking rules correctly as follows:

$ sysctl -w net.ipv4.ip_forward=1
$ iptables -t nat -A POSTROUTING -o <N6_interface> -j MASQUERADE
$ systemctl stop ufw
$ iptables -I FORWARD 1 -j ACCEPT