Comments (25)
Can you show the lish of interfaces on the host in wich you are installing UERANSIM with their ip addresses.
gNB's local IP address for N2 interface.
ngapIp: 127.0.0.1 ==> has to match the AMF ip address (NGAP)
gNB's local IP address for N3 interface.
gtpIp: 127.0.0.1 ==> has to match the UPF ip address (GTP )
for example in your case, ngapIp should be something like 172.18.104.x (i.e. the address of the interface which is in the same subnet as AMF NGAP interface)
You can also set it to 0.0.0.0 to use all host's interfaces.
Hope that will help you!
from ueransim.
@Milton0630 Please see this issue: #191
from ueransim.
@aligungr Thanks for your reply.
But I followed issue, I still have same problem.
There is my pcap file.
open5gs_UERANSIM.zip
Sorry to trouble you. Thanks
from ueransim.
According to PCAP file we can say that there is a NAT related problem.
Actually ping scenario is well tested between UERANSIM and Open5GS many times by many people. Therefore if you encounter this kind of problems then almost always there is a configuration/setup related problem.
My suggestions are (in order):
- Use UERANSIM and Open5GS in two different fresh virtual machines.
- Double check configurations for both UERANSIM and Open5GS
- Run
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
to enable IP forwarding (on Open5G's machine) - Run this command: #191 (comment) (on Open5G's machine)
Let me know if this solves your problem, otherwise we can investigate the problem again. But most probably these 4 suggestion will fix your issue (especially 1st item).
from ueransim.
@aligungr Thanks for your help.
My suggestions are (in order):
- Use UERANSIM and Open5GS in two different fresh virtual machines.
- Double check configurations for both UERANSIM and Open5GS
- Run sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" to enable IP forwarding (on Open5G's machine)
- Run this command: #191 (comment) (on Open5G's machine)
After following your suggestion1, I used UERANSIM and Open5GS in two different VMs and Ping is normal.
Thank you very much.
By the way, if I use UERANSIM and Open5GS in same VM, how do I set NAT rules?
Thanks again.
from ueransim.
@Milton0630
Can you please try the following command ?
sysctl -w net.ipv4.conf.all.route_localnet=1
from ueransim.
@mohuchi Thanks for your reply.
I ran the commond you said in virtual machine where open5gs and UERANSIM are deployed, but the ping timeout still occurred.
from ueransim.
@Milton0630
I faced the similar issue with free5GC(v3.0.4) + UERANSIM v2.2.1.
I reverted UERANSIM v2.2.1 to v2.0.2 and the issue was resolved.
from ueransim.
@mohuchi
I also reverted UERANSIM v2.2.1 to v2.0.2 and ping was normal.
from ueransim.
There was a bug on v2.0.1. But from v2.0.2 to the latest version, it should work with free5gc. Here's an example screenshot from my setup: (UERANSIM v2.2.1, free5gc v3.0.4)
And here's the gnb.yaml
file:
# MCC and MNC values of the gNB
plmn:
mcc: 208
mnc: 93
# ID of the gNB inside of its PLMN
gnbId: 1
# Tracking Area Code (TAC)
tac: 1
# NR Cell Identity (NCI)
nci: '0000000100'
# gNB's local IP address for N2 interface.
ngapIp: 192.168.1.37
# gNB's local IP address for N3 interface.
gtpIp: 192.168.1.37
# List of AMF address information
amfConfigs:
- ngapIp: 192.168.1.48
ngapPort: 38412
# List of NSSAIs supported by this gNB
nssais:
- sst: '0x01'
sd: '0x010203'
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
from ueransim.
Thank you for the comment.
I ran both free5GC and UERANSIM on the same VM. The environment is similar to @Milton0630 's one.
The issue which ping failed occrued on my environment.
from ueransim.
Hello!
I'm running UERANSIM v2.2.1 and free5gc v3.0.4 in different containers (one container for each free5gc NF and one container for UERANSIM). When running with one upf for free5gc PDU session is successfully created and ping works fine. But I have the following in UERANSIM logs:
2021-01-07 21:03:35.379 [INFO] [TIMER] [ue-208930000000004] NAS Timer expired: NasTimer{timerCode=3510, interval=15}
Should I neglect this error?
And in the AMF log I have this error when creating a UE but it creates it successfuly:
2021-01-07T20:03:16Z [ERRO][AMF][NGAP] [Build Error] DecodeString imeisv error: encoding/hex: odd length hex string (/go/src/free5gc/src/amf/ngap/message/build.go:1144 free5gc/src/amf/ngap/message.BuildInitialContextSetupRequest)
Is this because the IMSI format in UERANSIM is not compatible with free5gc?
Another question, has anyone tested UERANSIM with free5gc in ULCL mode (One branching and 2 anchors UPFs). When I test this, the UE traffic goes only through the first anchor UPF (upf1)
Regards,
from ueransim.
Hi @raoufkh
Another question, has anyone tested UERANSIM with free5gc in ULCL mode (One branching and 2 anchors UPFs). When I test this, the UE traffic goes only through the first anchor UPF (upf1)
When I tried ULCL at the end of the year, it seemed that the IMSI string length was probably not handled properly in free5GC.
Also, ULCL traffic has gone through an unintended route.
I will check my environment again later.
from ueransim.
For your other question;
"NAS timer expired" message is related to internals of the UE, and it is not an error. You can neglect that message.
It basicly says that UE needs to generate a fresh SUPI/SUCI in case of an identity request, since the previous one is evicted. (More on TS 24.501)
from ueransim.
I ran both free5GC and UERANSIM on the same VM. The environment is similar to @Milton0630 's one.
The issue which ping failed occrued on my environment.
I found out the workaroud.
In order to avoid the issue with v2.2.1, I have to use the VRF feature in Linux kernel.
See) https://www.kernel.org/doc/Documentation/networking/vrf.txt
Here is the steps to use VRF feature.
[Prerequisite]
-
Installing and loadading VRF featutre. I assume that you use free5gc.
apt install linux-modules-extra-5.0.0-23-generic
modprobe vrf -
Starting with './nr-agent --no-route-config'.
-
Making the VRF table for ueransim
ip link add dev vrf_uesim type vrf table 1000
ip link set dev vrf_uesim up
[Steps]
-
Establishing a PDU connection via './nr-cli' commands.
-
Binding uesimtun0 interfae to the VRF table:vrf_uesim and adding default route.
ip link set dev uesimtun0 master vrf_uesim up
ip route add default dev uesimtun0 table 1000 -
Checking the routing tables related to the VRF table.
root@free5gc-ohuchi:~/UERANSIM# ip route list vrf vrf_uesim <<< VRF table
default dev uesimtun0 scope link
root@free5gc-ohuchi:~/UERANSIM# ip route <<< 'main' routitng talbe
default via 100.207.2.4 dev ens192 proto dhcp metric 101
100.207.2.0/24 dev ens192 proto kernel scope link src 100.207.2.244 metric 101
100.64.4.0/24 dev upfgtp proto static
169.254.0.0/16 dev ens192 scope link metric 1000
root@free5gc-ohuchi:~/UERANSIM# ip rule <<< NO policy-based routing configured
0: from all lookup local
1000: from all lookup [l3mdev-table] <<< VRF table
32766: from all lookup main
32767: from all lookup default
- Using uesimtun0 interface through VRF table. Ping succeeded.
root@free5gc-ohuchi:~/UERANSIM# ping -I uesimtun0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 100.64.4.1 uesimtun0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=112 time=3.57 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=112 time=3.30 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=112 time=3.18 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=112 time=2.95 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=112 time=3.35 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 2.950/3.273/3.576/0.218 ms
from ueransim.
Thanks a lot for the detailed description.
We developed the --no-route-config
feature for exactly this purpose. Some users may need a different routing configurations. And default one may be unusable for some cases.
However routing configuration is an optional operation, you can always use --no-route-config
if you manually bind your connection to uesimtunX
interface. Therefore I wonder something in this case. I think --no-route-config
option should be sufficient if you use ping -I uesimtun0 8.8.8.8
, and it should work without VRF settings. (Because ping -I
command directly binds to the specified interface, without using routing tables.)
Does --no-route-config
work for you in your environment without using VRF? I'd be glad if you inform me about this.
from ueransim.
Hello @aligungr
Thank you for this explanation. This reassures me.
from ueransim.
Hello @s5uishida
It works fine now for me. I'm using UERANSIM v2.2.1 and free5gc v3.0.4
I have another question as you've already tried to test the ULCL feature. In 3GPP specs, they say that the interface name between the Branching UPF and Anchors is named N9 interface. Should it be different from the N3 interface? And is there any way to specify it in the free5gc configuration?
from ueransim.
Does --no-route-config work for you in your environment without using VRF? I'd be glad if you inform me about this.
No. That did not work.
Here is the test log without VRF.
root@free5gc-ohuchi:~/UERANSIM# ./nr-agent --no-route-config
UERANSIM v2.2.1
Selected profile: "free5gc"
2021-01-13 21:49:34.653 [INFO] [SYS] UERANSIM agent has been started.
2021-01-13 21:50:05.196 [INFO] [CONN] [gnb-1] Trying to establish SCTP connection... (127.0.0.1:38412)
2021-01-13 21:50:05.227 [INFO] [CONN] [gnb-1] SCTP connection established
2021-01-13 21:50:06.662 [SUCC] [PROC] [gnb-1] NGSetup procedure is successful
2021-01-13 21:50:10.862 [INFO] [STATE] [ue-208930000000003] UE switches to state: MM_DEREGISTERED/MM_DEREGISTERED__PLMN_SEARCH
2021-01-13 21:50:11.065 [INFO] [CONN] [ue-208930000000003] UE connected to gNB.
2021-01-13 21:50:11.066 [INFO] [STATE] [ue-208930000000003] UE switches to state: MM_DEREGISTERED/MM_DEREGISTERED__NORMAL_SERVICE
2021-01-13 21:50:11.165 [INFO] [STATE] [ue-208930000000003] UE switches to state: MM_REGISTERED_INITIATED/MM_REGISTERED_INITIATED__NA
2021-01-13 21:50:13.595 [INFO] [STATE] [ue-208930000000003] UE switches to state: RM_REGISTERED
2021-01-13 21:50:13.597 [INFO] [STATE] [ue-208930000000003] UE switches to state: MM_REGISTERED/MM_REGISTERED__NORMAL_SERVICE
2021-01-13 21:50:13.599 [SUCC] [PROC] [ue-208930000000003] Registration is successful
2021-01-13 21:50:25.146 [WARN] [FLOW] [ue-208930000000003] SM cause received in PduSessionEstablishmentAccept: PDU session type IPv4 only allowed
2021-01-13 21:50:25.149 [INFO] [UEAPP] [ue-208930000000003] IPv4 connection setup with local IP: 100.64.4.1
2021-01-13 21:50:25.161 [INFO] [FLOW] [ue-208930000000003] PDU session established: PDU session identity value 1
2021-01-13 21:50:25.171 [SUCC] [PROC] [ue-208930000000003] PDU Session Establishment is successful
2021-01-13 21:50:25.250 [SUCC] [PROC] [gnb-1] PDU Session Establishment is successful
2021-01-13 21:50:27.247 [INFO] [TIMER] [ue-208930000000003] NAS Timer expired: NasTimer{timerCode=3510, interval=15}
2021-01-13 21:50:50.798 [ERRO] [UEAPP] [ue-208930000000003] Ping timeout for 8.8.8.8 after 3 sec no response
from ueransim.
Hello!
I can't run UE and Core on different server because nr-agent can't connect throw SCTP with AMF
root@free5gc:~/UERANSIM-2.2.3$ sudo ./nr-agent
UERANSIM v2.2.3
Selected profile: "free5gc"
2021-01-28 08:40:50.064 [INFO] [SYS] UERANSIM agent has been started.
2021-01-28 08:40:59.507 [INFO] [CONN] [gnb-1] Trying to establish SCTP connection... (172.18.104.101:38412)
2021-01-28 08:46:41.548 [ERRO] [CONN] [gnb-1] SCTP connection could not established: Connection timed out
but if I try to connect via withsctp telnet on the same server it works fine and even amf can get some message
root@free5gc:~/UERANSIM-2.2.3$ withsctp telnet 172.18.104.101 38412
Trying 172.18.104.101...
Connected to 172.18.104.101.
Escape character is '^]'.
AMF log
2021-01-28T13:11:10+03:00 [DEBU][AMF][NGAP] Get default sent param[value: &{Stream:0 SSN:0 Flags:0 _:0 PPID:0 Context:0 TTL:0 TSN:0 CumTSN:0 AssocID:0}]
2021-01-28T13:11:10+03:00 [DEBU][AMF][NGAP] Set default sent param[value: &{Stream:0 SSN:0 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:0 CumTSN:0 AssocID:0}]
2021-01-28T13:11:10+03:00 [DEBU][AMF][NGAP] Subscribe SCTP event[DATA_IO, SHUTDOWN_EVENT, ASSOCIATION_CHANGE]
2021-01-28T13:11:10+03:00 [DEBU][AMF][NGAP] Set read buffer to 8192 bytes
2021-01-28T13:11:10+03:00 [DEBU][AMF][NGAP] Set read timeout: {Sec:2 Usec:0}
2021-01-28T13:11:10+03:00 [INFO][AMF][NGAP] [AMF] SCTP Accept from: 172.18.104.20:36100
Anybody have some idea about this issue?
from ueransim.
@MSA-lab Make sure that you set ngapIp in gnb config file. Can you share your configuration file.
from ueransim.
# MCC and MNC values of the gNB
plmn:
mcc: 208
mnc: 93
# ID of the gNB inside of its PLMN
gnbId: 1
# Tracking Area Code (TAC)
tac: 1
# NR Cell Identity (NCI)
nci: '0000000100'
# gNB's local IP address for N2 interface.
ngapIp: 127.0.0.1
# gNB's local IP address for N3 interface.
gtpIp: 127.0.0.1
# List of AMF address information
amfConfigs:
- ngapIp: 172.18.104.101
ngapPort: 38412
# List of NSSAIs supported by this gNB
nssais:
- sst: '0x01'
sd: '0x010203'
# Indicates whether or not SCTP stream number errors should be ignored.
ignoreStreamIds: true
from ueransim.
You need to set ngapIp and gtpIp to your local IP, instead of loopback address (127.0.0.1)
For example in my computer I use 192.168.1.37 as local IP.
AMF will try to send the response to the your IP address specified the ngapIp field. That'ts the exact cause of the case.
I think that configuration is a little bit confusing, sorry.
Please let me know if that solves your problem
from ueransim.
thx for answers guys, replacing the default address with the real ip of my server, solve the problem
from ueransim.
Great
from ueransim.
Related Issues (20)
- web信息添加不了,然后总是报错 HOT 1
- OAI + UERANSIM Integration HOT 2
- Tunnel allocation failure after certain number of UEs HOT 10
- TUN interface is created in the UE, and not in the gNB
- [gNB] APER decoding failed for SCTP message HOT 5
- Error while running Configuration HOT 1
- [nas] [error] Initial Registration failed [CONGESTION] HOT 1
- Open5GS support: UE not registering
- GTP end marker handling
- IP route add issue
- Default UE SUPI/IMSI for free5gc changed on v3.4.0
- Ueransim and Free5gc UPF GTP Tunnelling
- Unable to Establish PDU Session between gNB and AMF - [NETWORK_FAILURE] Error
- Registration using Profile A HOT 8
- UE Registration Request not reaching AMF
- Profile B HOT 4
- coreDump for using nr-cli for ue
- UE Network slicing Test HOT 1
- Does it support EAP-TLS
- Unable to ping 8.8.8.8 from uesimtun interface HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ueransim.