Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UE cannot connect to the internet #28

Closed
lossi771 opened this issue Jun 30, 2021 · 9 comments
Closed

UE cannot connect to the internet #28

lossi771 opened this issue Jun 30, 2021 · 9 comments

Comments

@lossi771
Copy link

lossi771 commented Jun 30, 2021

Environment

  • Ubuntu: 18.04
  • Docker version: 20.10.7
  • Docker compose version: 1.29.2
  • Kernel-release: 5.0.0-23-generic
  • Loaded Kernel module gtp5g
  • Stopped ufw on host machine
  • Deployment status:
ubuntu@5gcore:~$ sudo docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED       STATUS       PORTS                                       NAMES
c2ea8c3c88f2   ueransim_ueransim               "/bin/sh -c 'tail -f…"   2 hours ago   Up 2 hours                                               ueransim
a2464d59b2a5   free5gc-compose_free5gc-n3iwf   "sh -c './n3iwf-ipse…"   2 hours ago   Up 2 hours                                               n3iwf
a648ea356bea   free5gc-compose_free5gc-udm     "./udm -udmcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    udm
0fcbec3c6e17   free5gc-compose_free5gc-ausf    "./ausf -ausfcfg ../…"   2 hours ago   Up 2 hours   8000/tcp                                    ausf
bb26275cf7d8   free5gc-compose_free5gc-smf     "./smf -smfcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    smf
89bcb8ec6c89   free5gc-compose_free5gc-nssf    "./nssf -nssfcfg ../…"   2 hours ago   Up 2 hours   8000/tcp                                    nssf
b42c67a6023b   free5gc-compose_free5gc-amf     "./amf -amfcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    amf
2d0a5155444e   free5gc-compose_free5gc-udr     "./udr -udrcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    udr
b45bef7aadbb   free5gc-compose_free5gc-pcf     "./pcf -pcfcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    pcf
7d529b2f69e0   free5gc-compose_free5gc-nrf     "./nrf -nrfcfg ../co…"   2 hours ago   Up 2 hours   8000/tcp                                    nrf
790325003c2b   free5gc-compose_free5gc-webui   "./webui"                2 hours ago   Up 2 hours   0.0.0.0:5000->5000/tcp, :::5000->5000/tcp   webui
166b1be36f00   free5gc-compose_free5gc-upf-b   "sh -c 'bash upf-ipt…"   2 hours ago   Up 2 hours                                               upfb
37fba01aad00   free5gc-compose_free5gc-upf-1   "sh -c 'bash upf-ipt…"   2 hours ago   Up 2 hours                                               upf1
979a06263f12   mongo                           "docker-entrypoint.s…"   2 hours ago   Up 2 hours   27017/tcp                                   mongodb
cbbda4113d7a   free5gc-compose_free5gc-upf-2   "sh -c 'bash upf-ipt…"   2 hours ago   Up 2 hours                                               upf2

The UPFs have been deployed following the comment at the following link: #26 (comment). So the UPFs start running a bash script to install the required iptables rules.

The UERANSIM has been deployed inside another Docker container attached to free5gc-compose Docker network and ran after the free5gc-compose is up and running.

Configurations

We provided each NF a static IP address, the ones reported in the following code are the ones related to the UERANSIM container (10.100.200.20) and to the AMF container (10.100.200.15).

UERANSIM/config/free5gc-gnb inside the UERANSIM Docker container

linkIp: 127.0.0.1  
ngapIp: 10.100.200.20
gtpIp: 10.100.200.20 

amfConfigs:
  - address: 10.100.200.15
    port: 38412 

Current Behavior

The ping -I uesimtun0 8.8.8.8 command ran inside the UERANSIM Docker container is not receiving any ICMP reply as expected.

root@c2ea8c3c88f2:/UERANSIM# ping -I uesimtun0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 60.60.0.1 uesimtun0: 56(84) bytes of data.
^C
--- 8.8.8.8 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5100ms

In order to try to understand the reason of this behavior we monitored some internal interfaces on the UERANSIM container and on the upfb container.

UERANSIM
For the UERANSIM container we monitored the uesimtun0 and the eth0 interfaces.

root@c2ea8c3c88f2:/UERANSIM# tcpdump -i uesimtun0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on uesimtun0, link-type RAW (Raw IP), capture size 262144 bytes
08:49:53.822143 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 1, length 64
08:49:54.826409 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 2, length 64
08:49:55.854379 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 3, length 64
08:49:56.874415 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 4, length 64
08:49:57.898378 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 5, length 64
08:49:58.922433 IP 60-60-0-1.rev.home.ne.jp > dns.google: ICMP echo request, id 430, seq 6, length 64
root@c2ea8c3c88f2:/UERANSIM# tcpdump -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
08:49:53.822775 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:54.826699 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:55.854889 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:56.874752 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:57.898741 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:58.922758 IP c2ea8c3c88f2.2152 > upfb.free5gc-compose_privnet.2152: UDP, length 100
08:49:59.050271 ARP, Request who-has upfb.free5gc-compose_privnet tell c2ea8c3c88f2, length 28
08:49:59.050418 ARP, Reply upfb.free5gc-compose_privnet is-at 02:42:0a:64:c8:05 (oui Unknown), length 28
08:50:00.330386 IP c2ea8c3c88f2.60184 > amf.free5gc-compose_privnet.38412: sctp (1) [HB REQ] 
08:50:00.330506 IP amf.free5gc-compose_privnet.38412 > c2ea8c3c88f2.60184: sctp (1) [HB REQ]

UPFB
For the upfb we monitored the eth0 and the upfgtp interfaces.

root@166b1be36f00:/free5gc/free5gc-upfd# tcpdump -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
08:49:53.822884 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:54.826754 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:55.854920 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:56.874792 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:57.898779 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:58.922804 IP ueransim.free5gc-compose_privnet.2152 > 166b1be36f00.2152: UDP, length 100
08:49:59.050381 ARP, Request who-has 166b1be36f00 tell ueransim.free5gc-compose_privnet, length 28
08:49:59.050408 ARP, Reply 166b1be36f00 is-at 02:42:0a:64:c8:05 (oui Unknown), length 28
ubuntu@5gcore:~/free5gc-compose$ docker exec -it upfb bash
root@166b1be36f00:/free5gc/free5gc-upfd# tcpdump -i upfgtp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on upfgtp, link-type RAW (Raw IP), capture size 262144 bytes

Logs

amf.log
nrf.log
smf.log
upf1.log
upf2.log
upfb.log
nr-gnb.log
nr-ue.log

We have not seen any packet passing through the upfgtp interface of the upfb container, so we think that we are missing some configuration or we are misconfiguring the deployment.
Hoping someone can give us an hint on how to solve this issue, best regards!

@minziran
Copy link

Same problem.

@abousselmi
Copy link
Collaborator

What is the result of sysctl net.ipv4.ip_forward on you host machine ?
If it's 0, try to set it to 1 using sysctl -w net.ipv4.ip_forward=1

@hyame-alameddine
Copy link

Issue Description:
We would like to report the same issue as above. We have the free5gc-compose deployed on a virtual machine and the UERANSIM deployed on another. When the we ping google through the uesimtun0 interface we don't receive any replies. We notices that the upftgtp interface is not assigned any IP addresses.

We appreciate if you can guide us through this issue.
Please find below more details:

Environment
Ubuntu: 20.04-Focal
Docker version: 20.10.8
Docker compose version: 1.29.2
Kernel-release: 5.4.0-88-generic
Loaded Kernel module gtp5

Deployment Status
Free5gc-compose deployment status showing the list of containers on which the 5G network functions are deployed
image

The UERANSIM has been deployed inside another virtual machine and ran after the free5gc-compose is up and running.

Current Behavior
From UERANSIM virtual machine, pinging google: ping -I uesimtun0 google.com doe snot result in any ICMP replies.
image

To better understand and debug the issue, we monitored several interfaces on both the UERANSIM and free5gc-compose virtual machines.

Debugging Details
UPFb
Monitoring eth0 interface in the UPFb function => No packets observed
image

Monitoring upfgtp interface in the UPFb function => No packets observed
image

Verifying if upfgtp interface is assigned an IP address => no IP address is assigned to the upfgtp interface. We appreciate if someone can guide us towards verifying the reason for this.
image

UPFb routing table
image

UERANSIM
Monitoring the uesimtun0 interface in UERANSIM
image

Applying the changes suggested by #26 does not fix the issue nor changed the above reported outputs

@abousselmi
Copy link
Collaborator

Hi @hyame-alameddine, is there any updates on this issue ?

@hyame-alameddine
Copy link

hyame-alameddine commented Dec 14, 2021

Hello @abousselmi;

We fixed the issue by doing the following:
1- We deployed free5gc-compose on a virtual machine running on top of openstack

2- We deployed the UERANSIM on the same virtual machine hosting the free5gc-compose.
We modified the IP addresses as mentioned in https://www.free5gc.org/installations/stage-3-sim-install/ in the

  • ~/UERANSIM/config/free5gc-gnb.yaml
  • ~/UERANSIM/config/free5gc-ue.yaml
    Note that, you need to set the AMF container IP address. This IP address changes every time you run the free5gc-compose, so you need to update the above files constantly based on that. If you do not wish to do so, you can fix the IP addresses of all the network functions in docker-compose.yaml file in Free5GC-compose.

3- We uncommented the line natifname: eth0 in free5gc-compose/config/ubfcfgb, free5gc-compose/config/ubfcfg1, free5gc-compose/config/ubfcfg2.
Note that the free5gc-compose has 3 UPF instances, the request goes through the branching UPF (upfb), then it is routed either to UPF1 or UPF2. to verify this, we run sudo traceroute --interface=uesimtun0 google.com after building the UERANSIM free5gc-gnb.yaml and free5gc-ue.yaml

4- We run the following on free5gc-compose

  • Run the following at the Free5gC-compose virtual machine:
  • sudo sysctl -w net.ipv4.ip_forward=1
  • sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
  • Run free5GC-compose: ~/free5gc-compose$ sudo docker-compose up -d
  • In the upfb container, run:
  • sudo iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
  • sudo systemctl stop ufw_

5- We build the UERANSIM gnb and UE
Make sure that the subscriber is OP not OPC after each build of the free5gc-compose

  • For gnb, we run:
  • cd ~/UERANSIM
  • build/nr-gnb -c config/free5gc-gnb.yaml
  • For UE, we run:
  • cd ~/UERANSIM
  • sudo build/nr-ue -c config/free5gc-ue.yaml

6- We added post routing into the upfb network setting by running the following:

  • sudo docker exec -it upfb bash
  • apt-get install iptables
  • iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  • iptables -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1400
  • exit

@abousselmi
Copy link
Collaborator

Hi @hyame-alameddine

Thank you for your feedback. This is very well detailed. I will include it in the README of the project.

Bests,

@killjoyzd
Copy link

Issue Description: We would like to report the same issue as above. We have the free5gc-compose deployed on a virtual machine and the UERANSIM deployed on another. When the we ping google through the uesimtun0 interface we don't receive any replies. We notices that the upftgtp interface is not assigned any IP addresses.

We appreciate if you can guide us through this issue. Please find below more details:

Environment Ubuntu: 20.04-Focal Docker version: 20.10.8 Docker compose version: 1.29.2 Kernel-release: 5.4.0-88-generic Loaded Kernel module gtp5

Deployment Status Free5gc-compose deployment status showing the list of containers on which the 5G network functions are deployed image

The UERANSIM has been deployed inside another virtual machine and ran after the free5gc-compose is up and running.

Current Behavior From UERANSIM virtual machine, pinging google: ping -I uesimtun0 google.com doe snot result in any ICMP replies. image

To better understand and debug the issue, we monitored several interfaces on both the UERANSIM and free5gc-compose virtual machines.

Debugging Details UPFb Monitoring eth0 interface in the UPFb function => No packets observed image

Monitoring upfgtp interface in the UPFb function => No packets observed image

Verifying if upfgtp interface is assigned an IP address => no IP address is assigned to the upfgtp interface. We appreciate if someone can guide us towards verifying the reason for this. image

UPFb routing table image

UERANSIM Monitoring the uesimtun0 interface in UERANSIM image

Applying the changes suggested by #26 does not fix the issue nor changed the above reported outputs

  • r

Have you tried again to deploy free5gc-compose and ueransim on the different computers, I had the same problem you had before. Thank you

@andrmarkv
Copy link

Hello,
I had similar issue and it was related to the wrong configuration in upfcfg.yaml.
Please verify that your free5gc-upfd process is not listening on localhost.

Wrong configuration:
sudo netstat -lnup | grep 2152
udp 0 0 127.0.0.8:2152 0.0.0.0:* 1202/./NFs/upf/buil

Good configuration:
sudo netstat -lnup | grep 2152
udp 0 0 10.0.6.103:2152 0.0.0.0:* 2303/./NFs/upf/buil

Root cause of my problem was in the fact that I was doing changes in the wrong configuration file. All online manuals were pointing to the BUILD directory (for example: free5gc/NFs/upf/build/config/upfcfg.yaml) however when I was running free5gc core it was reading parameters from the free5gc/config/upfcfg.yaml.

In my case to fix configuration I needed to change file
free5gc/config/upfcfg.yaml
and replace gtpu.addr parameter
...
gtpu:

  • addr: 10.0.6.103: # 127.0.0.8

Hope it helps

@TulebaevTemirlan
Copy link

Hello, I had similar issue and it was related to the wrong configuration in upfcfg.yaml. Please verify that your free5gc-upfd process is not listening on localhost.

Wrong configuration: sudo netstat -lnup | grep 2152 udp 0 0 127.0.0.8:2152 0.0.0.0:* 1202/./NFs/upf/buil

Good configuration: sudo netstat -lnup | grep 2152 udp 0 0 10.0.6.103:2152 0.0.0.0:* 2303/./NFs/upf/buil

Root cause of my problem was in the fact that I was doing changes in the wrong configuration file. All online manuals were pointing to the BUILD directory (for example: free5gc/NFs/upf/build/config/upfcfg.yaml) however when I was running free5gc core it was reading parameters from the free5gc/config/upfcfg.yaml.

In my case to fix configuration I needed to change file free5gc/config/upfcfg.yaml and replace gtpu.addr parameter ... gtpu:

  • addr: 10.0.6.103: # 127.0.0.8

Hope it helps

Hello!

Good configuration:
sudo netstat -lnup | grep 2152 (I entered this command on free5gc(linked clone VM, but no output showed)
udp 0 0 10.0.6.103:2152 0.0.0.0:* 2303/./NFs/upf/buil How check this configurations?

and why in configuring the /free5gc/config/upfcfg.yaml the IP address should be 10.0.6.103( my free5gcVM has 192.168.56.1/24 address) ?

With respect, a student that has the same problem of uesimtun0 not pinging google.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants