aligungr / UERANSIM

Open source 5G UE and RAN (gNodeB) implementation.
GNU General Public License v3.0
783 stars 321 forks source link

Ping test failing when multiple UERANSIM UEs connects to Free5GC #228

Closed aweimeow closed 3 years ago

aweimeow commented 3 years ago

Hello,

Our team was trying to connect multiple UEs to free5gc, but we found the "ue-ping" fails occasionally, and the fail was by UE, some UE ue-ping command succeeds everytime, some UE fails everytime. Like the following screenshot:

image

But we tried to ping with the virtual interfaces (uesimtun1 ~ 9), every UE works.

Does that mean the ue-ping sends the incorrect ICMP echo sometimes? Thanks

aligungr commented 3 years ago

Hello @aweimeow

It's a strange case, I'll check if this happens for me as well.

aweimeow commented 3 years ago

Hi @aligungr,

Thanks for the reply, I have a few more information may help at here.

  1. We tried to build the container version of UERANSIM, it works well, every UE can ping Google DNS(8.8.8.8). Does UERANSIM installed any networking rules to host?
  2. We checked the ICMP packets, and the ue-ping will generate the ICMP echo with multiple iterated request id, but use ping tool to send ICMP echo via the virtual interface, the request id was same one (0x158c).

image image

We are guessing the kernel drop duplicated sequence id when the sequence number conflicted, hope the information are helpful

aligungr commented 3 years ago

@aweimeow Thanks for the reply.

Does UERANSIM installed any networking rules to host?

Yes, by default UERANSIM configures a routing table, an IP rule, and an IP route. You can disable it by starting UERANSIM with -no-route-config. See https://github.com/aligungr/UERANSIM/wiki/Configuring-the-TUN-interface

We are guessing the kernel drop duplicated sequence id when the sequence number conflicted

Yes, I think obviously there is a bug in our UE. Sequence id counter is currently incremented per UE but it should be global. I'll fix it shortly after.

Thanks for the additional information to fix this issue.

aligungr commented 3 years ago

@aweimeow I've just pushed the fix to the master. Please let me know if this fixes your issue.

aweimeow commented 3 years ago

Hello @aligungr,

Thanks for the quick fix :)

The ICMP echo id's issue solved: image

And I noticed that your link describes that UERANSIM shouldn't be install with core network in the same computer (or the same network namespace I think), do you know what is the problem to make it can't work?

aligungr commented 3 years ago

@aweimeow Actually it's just a precaution statement to avoid some headaches :) For some cases it may work and for some other cases it may not work.

UE needs to create a network interface, and this is for sure. But even some core networks create a network interface with the same IP given to UE. And this is very problamatic. Because someone cannot use the same IP address in two different network interfaces in Linux. (If you don't use an NS)

And that's why we don't suggest the usage of them in the same computer.

aweimeow commented 3 years ago

Hi @aligungr,

Thanks for the answer, everything is good now :)