UPF cannot transfer flow to internet

In my test, I combine free5gc with gnbsim. I can capture gtp traffic on the UPF node, but UPF does not forward the traffic to the DN, and gnbsim also shows that it cannot connect to the internet. Our configuration is as follows:

AMF:
image
SMF:
image
UPF:
image
NAT:
image
The flow we captured on upf node is:

hi,Eddie
thanks. i also find the root cause in my case.
I send the icmp messages encap in the gtp,however didn’t do the checksum of the ipv4hdr, the kernal of gtp5g then drop the frame ,although the pdr worked and it remove the gtp header,but the kernal refuse to forward. after make checksum,it worked.
br,thornton.

Hello,

Can you please send me the code on how to do this. I cannot ping internet and I do not know what else to do, maybe my problem is related with this. Do I have to change something on registration_test.go?

upf.pcapng (1.6 KB)

It seems that UPF has successfully decapsulated the GTP packet.

How about checking if you have a right routing table firewall, and NAT setting on your host? Will the outgoing interface have get the decapsulated packet and will send it out?

And how is your MTU setting? Check if the packet is larger than the MTU and will it be disassmebled.

hi,Eddie.
Did you find any reason the the data forwarding. i face almost a same problem.
the gtp header was already removed in the pdr from access to core,however the far rule forwarding didn’t work.so can’t access outside.
br,thornton.

Hi @thornton,

Can I check if you set the NAT rules on iptables and if packet size smaller than MTU on UPF.
Also, what’s the routing rules on your system?

We solved this problem by configuring multiple hosts in the LAN. We deployed upf on one host separately, and the rest of the NF on another host, and connected to the 5GC using gbsim on the third host to connect internet. We specified the only interface(connect to internet) on the upf host and configured NAT.

1 Like