aligungr / UERANSIM

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

On Using the UERANSIM TUN Interface #186

Open aligungr opened 3 years ago

aligungr commented 3 years ago

I want to inform the community that User Plane functionalities are ready to use.

We are introducing the TUN interface in order to use UE's internet connectivity. This feature can be considered as beta and usage method is subject to change, but I think the feature seems more or less stable. And as always we are open to feedbacks, bug reports, pull requests etc.

In our tests, we have successfully browsed the internet using 3 different core networks. (Open5GS and 2 other commercial CNs)

You may want to try this feature for yourself. Related documentation can be found at: Using Data Plane Features

For your information, currently we only support IPv4 protocol. Other PDU types are in road map and not implemented yet.

- Ali

mimo123-code commented 3 years ago

thats great @aligungr . I have one query regarding the UE ip . where can i find it . is it the interafce for ex in my case in open5gs its ogustun i have created.

aligungr commented 3 years ago

@mimo123-code You can find the IP address in air.log file or UE's own log file located at ./logs/

s5uishida commented 3 years ago

Hi @aligungr

Thank you very much for supporting the TUN interface! I was able to confirm the operation here as well.

However, there is one point to worry about.

When 4) pdu-session-establishment was executed, the ICMP packet passed through the uesimtun interface, but after that,

./ue-binder.sh 10.45.0.2 ping google.com

when I executed the above, ICMP packets did not flow to the ogstun interface on the Open5GS side (the uesimtun interface has not been used), and it pinged google.com directly from the UERANSIM machine. In addition, Open5GS and UERANSIM are running on different machines.

However, it can be used as follows here, so there is no particular problem.

ping google.com -I uesimtun

I'm sorry if I make a mis-setting or misunderstand.

Anyway, thank you very much again for supporting the TUN interface! It's wonderful!!

s5uishida commented 3 years ago

Hi @aligungr

I was able to confirm the ping of the following configuration using PC(VM) x 3.

                                        -------------
                        ---------------| UERANSIM #1 | [PC-B]   $ ping google.com -I uesimtun
                        |               -------------
                        |               10.45.0.2
                        | 
                        | 10.45.0.1/16 (APN=internet)
 ------------       ---------
| google.com |-----| Open5GS | [PC-A]
 ------------       ---------
                        | 10.46.0.1/16 (APN=internet2)
                        |
                        |               10.46.0.2
                        |               -------------
                        ---------------| UERANSIM #2 | [PC-C]   $ ping google.com -I uesimtun
                                        -------------

This is just quick reporting.

P.S.

I would be very glad if one UERANSIM could handle multiple TUN interfaces. It is an image of one Tenant, one RAN, and multiple PDNs.

Sorry for the many requests.

aligungr commented 3 years ago

@s5uishida Thanks for the quick reporting.

Unfortunately ue-binder.sh may be ineffective for some applications. Especially for built-in ping tool in Linux system. When I checked the source code of ping tool, I saw that it uses SO_BINDTODEVICE settings manually. And that's why ue-binder.sh does not work for ping tool. Perhaps we should write our own ping tool for this purpose. However ue-binder should work with almost any other application.


Thanks for the suggestion, it can be useful if UERANSIM support multiple TUN interfaces. However uesimtun interface can have multiple IP addresses. You can utilize multiple PDU sessions or even multiple UEs at the same time using single uesimtun interface. You just need to pass different IP addresses while invoking ue-binder.sh. I'm sorry if I misunderstand.

Thanks.

s5uishida commented 3 years ago

Hi @aligungr

Thank you very much for your reply.

I understand the former reply. The application curl worked fine. Also, I will try various things about the latter here.

I will report if there is anything.

Thank you very much again.

s5uishida commented 3 years ago

Hi @aligungr

For example, I thought it would be good if an organization could set up one RAN, and prepare multiple terminals (smartphones and mobile GWs) with APNs set for each of the internet and intranet, and simulate the cases of using them properly. It feels like assigning a different PDN to each APN. Perhaps if the UE and RAN are separated, I think that it would be a natural configuration. Personally, I only need to send data traffic to the TUN interfaces formed end-to-end, so the current simulator that integrates UE and RAN is sufficient.

For your reference, the Open5GS configuration topics for the above operation verification https://github.com/aligungr/UERANSIM/issues/186#issuecomment-729401241 are shown below. Case of UPF x 1 and PDN x 2 (APN=internet, internet2)

open5gs/install/etc/open5gs/smf.yaml

--- smf.yaml.orig       2020-11-13 04:07:03.614900521 +0000
+++ smf.yaml    2020-11-16 00:05:22.623121711 +0000
@@ -179,7 +179,17 @@
       - addr: ::1
     pdn:
       - addr: 10.45.0.1/16
+        apn: internet
+        dev: ogstun
       - addr: cafe::1/64
+        apn: internet
+        dev: ogstun
+      - addr: 10.46.0.1/16
+        apn: internet2
+        dev: ogstun2
+      - addr: cafe::2/64
+        apn: internet2
+        dev: ogstun2
     dns:
       - 8.8.8.8
       - 8.8.4.4

open5gs/install/etc/open5gs/upf.yaml

--- upf.yaml.orig       2020-11-13 04:07:03.666833313 +0000
+++ upf.yaml    2020-11-18 01:20:07.996410796 +0000
@@ -165,10 +165,20 @@
     pfcp:
       - addr: 127.0.0.7
     gtpu:
-      - addr: 127.0.0.7
+      - addr: 192.168.100.30
     pdn:
       - addr: 10.45.0.1/16
+        apn: internet
+        dev: ogstun
       - addr: cafe::1/64
+        apn: internet
+        dev: ogstun
+      - addr: 10.46.0.1/16
+        apn: internet2
+        dev: ogstun2
+      - addr: cafe::2/64
+        apn: internet2
+        dev: ogstun2

 #
 # smf:

In addition, in Open5GS, when using multiple UPFs properly, the explanation of the selection logic is below.

https://github.com/open5gs/open5gs/pull/560#issue-483001043 https://github.com/open5gs/open5gs/issues/625

For your reference.

aligungr commented 3 years ago

@s5uishida Thanks for the suggestions and references. If I understand you correctly, being able to run multiple UEs on different machines will provide this functionality. Most probably (but not certainly), complete separation of UE and RAN will be performed after implementation of NR radio interface.