After re-make Free5GC, UE can no longer ping to google via 5GC

Hi guys,

I was using UERANSIM to connect to the Free5GC and it can successfully ping “google.com”, everything is right. But once I modify the code of 5GC, I add a print code with Golang in AMF, SMF, or other NFs, and type the command “make” to re-build Free5GC again. And then I use UERANSIM again to connect the Free5GC. My UE can no longer ping google via 5GC. Are some procedures wrong or has the Free5GC can’t modify the open-source code?

Or if there are correct ways or procedures to re-build the Free5GC after adding some code in the NFs, please give some advice.

Thanks a lot

Hi @ChiaChia1114

Your procedures seem ok, and are feasible for me.
Is there any error msg after you rebuild free5GC? Maybe you can provide what you have modified in free5GC or some console log.

Hi @tmchen

Yeah, that is the problem. I add fmt.println("some text") in any NF code. Then rebuild free5gc and use UERANSIM to ping google. there isn’t any ack until its timeout. Also, there aren’t any error messages in my log. So, I can’t find out what’s the problem.

Could you still ping google.com after modifying the code in any NF code? I am wondering about your make procedure.

Thanks a lot

hi @ChiaChia1114

here is my procedure:

  1. add a code println("11111111") in amf
  2. back to free5gc directory and run command make
  3. re-run free5gc and UERANSIM

the network is available & the code i added is success

hope this is helpful for you

Hi @tmchen

Wow, that’s weird, haha. After you use UERANSIM, are you still can ping google.com?

Or maybe my environment is wrong? I am using ubuntu 20.04 and the kernel is 5.8. May I ask how is your environment or do you just follow the official guide? Thanks for your help.

Thanks a lot

hi @ChiaChia1114

yes, it is ok to ping google.com
following is my environment (my UERANSIM version is v3.2.6)
image

Hi @tmchen

Thanks a lot. I will try your way later.

Thanks a lot.

Hi @tmchen

Seems it doesn’t work for me, haha. I try to modify the code in amf/gmm/handler.go with the following picture:

Then I used UERANSIM to ping “google.com”. It still can’t ping successfully.

These are my environment setting:
Free5gc

  • ubuntu-20.04.2 LTS
  • kernel: 5.4.0-77-generic
  • Free5GC version: v3.0.6
  • IP: 192.168.56.101

UERANSIM

  • version: v3.2.6
  • IP: 192.168.56.102

NOTE:Both Free5GC and UERANSIM are run in the virtual box.

I also try the latest version of Free5GC, but it can’t ping “google.com” before I modify the code. So, that’s weird for me, too. Maybe my architecture is wrong or something I missed. I follow the official guide with this link step by step. Should I have to change the kernel and Ubuntu version to as same as yours?
Thanks for your information.

Thanks a lot

Hi @ChiaChia1114,

I added the code in the same way as you did, and successfully showed up in the log( as below)


Also is able to ping google.com

Did your ue in UERANSIM successfully get PDU seeesion?( as below)

Maybe you can try reboot your vm and re-config the env (the step 3 in link)
Also, make sure to re-build gtp5g.

Hi @tmchen

God, man… I think I have to change the environment like yours. I will try it. I am sure that my UE successfully get the PDU session. BTW, do I need to re-build gtp5g every time after I modify the code? Thanks for your help.

Thanks a lot

Hi, @ChiaChia1114

just re-build gtp5g after you reboot your vm
or you can use command lsmod | grep gtp5g to check your gtp5g.

All the best!