Skip to content

Testbed using Open5GS and UERANSIM for UE-based dynamic UPF selection between dual UPFs. Integrated with Intel OpenNESS to host a video streaming application at the MEC edge, demonstrating traffic steering and low-latency edge computing.

Notifications You must be signed in to change notification settings

achi07/MobiEdge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Open5GS 5GC & UERANSIM UE / RAN Sample Configuration

UERANSIM (5G UE & RAN (gNodeB) implementation) supports IPv4 of PDU Session Type from 2020.11.17 version, and the Data Plane facility has been enabled. Therefore, in order to use U-Plane's DN (Data Network) as a trial, I built a simulation environment for the 5GC mobile network. This briefly describes the overall and configuration files.


Table of Contents


Overview of Open5GS 5GC Simulation Mobile Network

I created a 5GC mobile network (Internet reachable) for simulation with the aim of creating an environment in which packets can be sent end-to-end with different DNs for each DNN.

The following minimum configuration was set as a condition.

  • C-Plane have multiple U-Planes.
  • U-Plane have multiple DNs.
  • Multiple UEs connect to same DN.

The built simulation environment is as follows.

The 5GC / UE / RAN used are as follows.

Each VMs are as follows.

VM # SW & Role IP address OS Memory (Min) HDD (Min)
VM1 Open5GS 5GC C-Plane 10.10.1.113/24 Ubuntu 20.04 1GB 20GB
VM2 Open5GS 5GC U-Plane1 10.10.1.84/24 Ubuntu 20.04 1GB 20GB
VM3 Open5GS 5GC U-Plane2 10.10.1.44/24 Ubuntu 20.04 1GB 20GB
VM4 UERANSIM RAN (gNodeB) 10.10.1.36/24 Ubuntu 20.04 1GB 10GB
VM5 UERANSIM UE 10.10.1.110/24 Ubuntu 20.04 1GB 10GB

Subscriber Information (other information is the same) is as follows.
Note. Please select OP or OPc according to the setting of UERANSIM UE configuration files.

UE # IMSI DNN OP/OPc
UE0 001010000000000 internet OPc
UE1 001010000000001 internet2 OPc
UE2 001010000000002 internet2 OPc
UE3 001010000000003 ims OPc
UE4 001010000000004 ims OPc

I registered these information with the Open5GS WebUI. In addition, 3GPP TS 35.208 "4.3 Test Sets" is published by 3GPP as test data for the 3GPP authentication and key generation functions (MILENAGE).

Each DNs are as follows.

DN TUNnel interface of DN DNN TUNnel interface of UE U-Plane #
10.45.0.0/16 ogstun internet uesimtun0 U-Plane1
10.46.0.0/16 ogstun2 internet2 uesimtun1, uesimtun2 U-Plane1
10.47.0.0/16 ogstun3 ims uesimtun3, uesimtun4 U-Plane2

Additional information.

Open5GS 5GC U-Plane worked fine on Raspberry Pi 4 Model B. I used Ubuntu 20.04 (64bit) for Raspberry Pi 4 as the OS. I think it would be convenient to place a compact U-Plane in the edge environment and use it as an end-point for DN.

In addition, I have not confirmed the communication performance.

Changes in configuration files of Open5GS 5GC and UERANSIM UE / RAN

Please refer to the following for building Open5GS and UERANSIM respectively.

Changes in configuration files of Open5GS 5GC C-Plane

The following parameters including DNN can be used in the logic that selects UPF as the connection destination by PFCP.

  • DNN
  • TAC (Tracking Area Code)
  • nr_CellID

For the sake of simplicity, I used only DNN this time. Please refer to here for the logic to select UPF.

  • open5gs/install/etc/open5gs/amf.yaml
--- amf.yaml.orig       2021-04-20 14:19:04.000000000 +0000
+++ amf.yaml    2021-08-29 11:42:33.671647271 +0000
@@ -180,23 +180,23 @@
       - addr: 127.0.0.5
             port: 7777
         ngap:
           - addr: 10.10.1.113
        guami:
          - plmn_id:
              mcc: 001
              mnc: 01
            amf_id:
              region: 2
              set: 1 
        tai:
          - plmn_id:
              mcc: 001
              mnc: 01 
          tac: 1
        plmn_support:
          - plmn_id:
              mcc: 001
              mnc: 01
        s_nssai:
          - sst: 1
        security:
  • open5gs/install/etc/open5gs/smf.yaml
--- smf.yaml.orig       2021-08-29 10:31:09.958357944 +0000
+++ smf.yaml    2021-08-29 11:24:14.561432868 +0000
@@ -332,7 +332,7 @@
       - addr: 127.0.0.4
         port: 7777
     pfcp:
       - addr: 10.10.1.113
       - addr: ::1
     gtpc:
       - addr: 127.0.0.4
       - addr: ::1
     subnet:
       - addr: 10.45.0.1/16
         dnn: internet
       - addr: 10.46.0.1/16
         dnn: internet2
       - addr: 10.47.0.1/16
         dnn: ims
     dns:
       - 8.8.8.8
       - 8.8.4.4
# upf:
     pfcp:
       - addr: 10.10.1.84
dnn: [internet, internet2] - addr: 10.10.1.44
dnn: ims
 #
 # parameter:

Changes in configuration files of Open5GS 5GC U-Plane1

  • open5gs/install/etc/open5gs/upf.yaml
--- upf.yaml.orig       2021-08-29 10:41:25.138837531 +0000
+++ upf.yaml    2021-08-29 11:31:23.351000087 +0000
@@ -150,12 +150,16 @@
 # upf:
     pfcp:
       - addr: 10.10.1.84
     gtpu:
       - addr: 10.10.1.84
     subnet:
       - addr: 10.45.0.1/16
         dnn: internet
         dev: ogstun
       - addr: 10.46.0.1/16
         dnn: internet2
         dev: ogstun2
#
# smf:

Changes in configuration files of Open5GS 5GC U-Plane2

  • open5gs/install/etc/open5gs/upf.yaml
--- upf.yaml.orig       2021-08-29 10:49:52.500332471 +0000
+++ upf.yaml    2021-08-29 11:33:14.125398472 +0000
@@ -150,12 +150,13 @@
 #
 upf: pfcp:
       - addr: 10.10.1.44
     gtpu:
       - addr: 10.10.1.44
     subnet:
       - addr: 10.47.0.1/16
         dnn: ims
         dev: ogstun3
#
# smf:

Changes in configuration files of UERANSIM UE / RAN

Changes in configuration files of RAN

  • UERANSIM/config/open5gs-gnb.yaml
--- open5gs-gnb.yaml.orig       2021-04-20 11:07:30.000000000 +0000
+++ open5gs-gnb.yaml    2021-08-29 11:53:34.170068022 +0000
@@ -1,17 +1,17 @@
-mcc: '901'          # Mobile Country Code value
-mnc: '70'           # Mobile Network Code value (2 or 3 digits)
+mcc: '001'          # Mobile Country Code value
+mnc: '01'           # Mobile Network Code value (2 or 3 digits)
 
 nci: '0x000000010'  # NR Cell Identity (36-bit)
 idLength: 32        # NR gNB ID length in bits [22...32]
 tac: 1              # Tracking Area Code
 
linkIp: 10.10.1.36 (Usually same with local IP) # gNB's local IP address for Radio Link Simulation
ngapIp: 10.10.1.36 # gNB's local IP address for N2 Interface (Usually same with local IP)
gtpIp: 10.10.1.36 # gNB's local IP address for N3 Interface (Usually same with local IP)
 
 # List of AMF address information
 amfConfigs:
+  - address: 10.10.1.113 
     port: 38412
 # List of supported S-NSSAIs by this gNB

Changes in configuration files of UE0 (IMSI-001010000000000)

First, copy open5gs-ue0.yaml from open5gs-ue.yaml.

# cd UERANSIM/config
# cp open5gs-ue.yaml open5gs-ue0.yaml

Next, edit open5gs-ue0.yaml.

  • UERANSIM/config/open5gs-ue0.yaml
--- open5gs-ue.yaml.orig        2021-08-15 14:16:46.000000000 +0000
+++ open5gs-ue0.yaml    2021-08-29 11:46:16.784524371 +0000
@@ -1,9 +1,9 @@
 # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
-supi: 'imsi-901700000000001'
+supi: 'imsi-001010000000000'
 # Mobile Country Code value of HPLMN
-mcc: '901'
+mcc: '001'
 # Mobile Network Code value of HPLMN (2 or 3 digits)
-mnc: '70'
+mnc: '01'
 
 # Permanent subscription key
 key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
@@ -20,7 +20,7 @@
 
 # List of gNB IP addresses for Radio Link Simulation
 gnbSearchList:
-  - 127.0.0.1
+  - 10.10.1.36
 
 # UAC Access Identities Configuration
 uacAic:

Changes in configuration files of UE1 (IMSI-001010000000001)

First, copy open5gs-ue1.yaml from open5gs-ue.yaml.

# cd UERANSIM/config
# cp open5gs-ue.yaml open5gs-ue1.yaml

Next, edit open5gs-ue1.yaml.

  • UERANSIM/config/open5gs-ue1.yaml
--- open5gs-ue.yaml.orig        2021-08-15 14:16:46.000000000 +0000
+++ open5gs-ue1.yaml    2021-08-29 11:48:00.650373065 +0000
@@ -1,9 +1,9 @@
 # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
-supi: 'imsi-901700000000001'
+supi: 'imsi-001010000000001'
 # Mobile Country Code value of HPLMN
-mcc: '901'
+mcc: '001'
 # Mobile Network Code value of HPLMN (2 or 3 digits)
-mnc: '70'
+mnc: '01'
 
 # Permanent subscription key
 key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
@@ -20,7 +20,7 @@
 
 # List of gNB IP addresses for Radio Link Simulation
 gnbSearchList:
-  - 127.0.0.1
+  - 10.10.1.36
 
 # UAC Access Identities Configuration
 uacAic:
@@ -39,7 +39,7 @@
 # Initial PDU sessions to be established
 sessions:
   - type: 'IPv4'
-    apn: 'internet'
+    apn: 'internet2'
     slice:
       sst: 1
 

Changes in configuration files of UE2 (IMSI-001010000000002)

First, copy open5gs-ue2.yaml from open5gs-ue.yaml.

# cd UERANSIM/config
# cp open5gs-ue.yaml open5gs-ue2.yaml

Next, edit open5gs-ue2.yaml.

  • UERANSIM/config/open5gs-ue2.yaml
--- open5gs-ue.yaml.orig        2021-08-15 14:16:46.000000000 +0000
+++ open5gs-ue2.yaml    2021-08-29 11:48:51.433767874 +0000
@@ -1,9 +1,9 @@
 # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
-supi: 'imsi-901700000000001'
+supi: 'imsi-001010000000002'
 # Mobile Country Code value of HPLMN
-mcc: '901'
+mcc: '001'
 # Mobile Network Code value of HPLMN (2 or 3 digits)
-mnc: '70'
+mnc: '01'
 
 # Permanent subscription key
 key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
@@ -20,7 +20,7 @@
 
 # List of gNB IP addresses for Radio Link Simulation
 gnbSearchList:
-  - 127.0.0.1
+  - 10.10.1.36
 
 # UAC Access Identities Configuration
 uacAic:
@@ -39,7 +39,7 @@
 # Initial PDU sessions to be established
 sessions:
   - type: 'IPv4'
-    apn: 'internet'
+    apn: 'internet2'
     slice:
       sst: 1
 

Changes in configuration files of UE3 (IMSI-001010000000003)

First, copy open5gs-ue3.yaml from open5gs-ue.yaml.

# cd UERANSIM/config
# cp open5gs-ue.yaml open5gs-ue3.yaml

Next, edit open5gs-ue3.yaml.

  • UERANSIM/config/open5gs-ue3.yaml
--- open5gs-ue.yaml.orig        2021-08-15 14:16:46.000000000 +0000
+++ open5gs-ue3.yaml    2021-08-29 11:49:53.308233383 +0000
@@ -1,9 +1,9 @@
 # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
-supi: 'imsi-901700000000001'
+supi: 'imsi-001010000000003'
 # Mobile Country Code value of HPLMN
-mcc: '901'
+mcc: '001'
 # Mobile Network Code value of HPLMN (2 or 3 digits)
-mnc: '70'
+mnc: '01'
 
 # Permanent subscription key
 key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
@@ -20,7 +20,7 @@
 
 # List of gNB IP addresses for Radio Link Simulation
 gnbSearchList:
-  - 127.0.0.1
+  - 10.10.1.36
 
 # UAC Access Identities Configuration
 uacAic:
@@ -39,7 +39,7 @@
 # Initial PDU sessions to be established
 sessions:
   - type: 'IPv4'
-    apn: 'internet'
+    apn: 'ims'
     slice:
       sst: 1
 

Changes in configuration files of UE4 (IMSI-001010000000004)

First, copy open5gs-ue4.yaml from open5gs-ue.yaml.

# cd UERANSIM/config
# cp open5gs-ue.yaml open5gs-ue4.yaml

Next, edit open5gs-ue4.yaml.

  • UERANSIM/config/open5gs-ue4.yaml
--- open5gs-ue.yaml.orig        2021-08-15 14:16:46.000000000 +0000
+++ open5gs-ue4.yaml    2021-08-29 11:50:34.908537710 +0000
@@ -1,9 +1,9 @@
 # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 digits)
-supi: 'imsi-901700000000001'
+supi: 'imsi-001010000000004'
 # Mobile Country Code value of HPLMN
-mcc: '901'
+mcc: '001'
 # Mobile Network Code value of HPLMN (2 or 3 digits)
-mnc: '70'
+mnc: '01'
 
 # Permanent subscription key
 key: '465B5CE8B199B49FAA5F0A2EE238A6BC'
@@ -20,7 +20,7 @@
 
 # List of gNB IP addresses for Radio Link Simulation
 gnbSearchList:
-  - 127.0.0.1
+  - 10.10.1.36
 
 # UAC Access Identities Configuration
 uacAic:
@@ -39,7 +39,7 @@
 # Initial PDU sessions to be established
 sessions:
   - type: 'IPv4'
-    apn: 'internet'
+    apn: 'ims'
     slice:
       sst: 1
 

Network settings of Open5GS 5GC and UERANSIM UE / RAN

Network settings of Open5GS 5GC U-Plane1

First, uncomment the next line in the /etc/sysctl.conf file and reflect it in the OS.

net.ipv4.ip_forward=1
# sysctl -p

Next, configure the TUNnel interface and NAPT.

ip tuntap add name ogstun mode tun
ip addr add 10.45.0.1/16 dev ogstun
ip link set ogstun up

iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE

ip tuntap add name ogstun2 mode tun
ip addr add 10.46.0.1/16 dev ogstun2
ip link set ogstun2 up

iptables -t nat -A POSTROUTING -s 10.46.0.0/16 ! -o ogstun2 -j MASQUERADE

Network settings of Open5GS 5GC U-Plane2

First, uncomment the next line in the /etc/sysctl.conf file and reflect it in the OS.

net.ipv4.ip_forward=1
# sysctl -p

Next, configure the TUNnel interface and NAPT.

ip tuntap add name ogstun3 mode tun
ip addr add 10.47.0.1/16 dev ogstun3
ip link set ogstun3 up

iptables -t nat -A POSTROUTING -s 10.47.0.0/16 ! -o ogstun3 -j MASQUERADE

Build Open5GS and UERANSIM

Please refer to the following for building Open5GS and UERANSIM respectively.

Note. Install MongoDB with package manager on Open5GS 5GC C-Plane machine. MongoDB Compass is a convenient tool to look at the MongoDB database.

# apt update
# apt install mongodb
# systemctl start mongodb
# systemctl enable mongodb

It is not necessary to install MongoDB on Open5GS 5GC U-Plane machines.

Run Open5GS 5GC and UERANSIM UE / RAN

First run the 5GC, then UERANSIM (UE & RAN implementation).

Run Open5GS 5GC C-Plane

First, run Open5GS 5GC C-Plane.

  • Open5GS 5GC C-Plane
./install/bin/open5gs-nrfd &
sleep 5
./install/bin/open5gs-smfd &
./install/bin/open5gs-amfd &
./install/bin/open5gs-ausfd &
./install/bin/open5gs-udmd &
./install/bin/open5gs-udrd &
./install/bin/open5gs-pcfd &
./install/bin/open5gs-nssfd &
./install/bin/open5gs-bsfd &

Additional information.

PCF was added in Open5GS v2.1.0 released on 2020.12.11. Since PCF connects only to SBI, pcf.yaml is used as it is in this configuration example. And NSSF was added in Open5GS v2.2.0 released on 2021.03.08. Since NSSF also connects only to SBI, nssf.yaml is used as it is in this configuration example. And BSF was added in Open5GS v2.3.0 released on 2021.06.08. Since BSF also connects only to SBI, bsf.yaml is used as it is in this configuration example.

Run Open5GS 5GC U-Plane1 & U-Plane2

Next, run Open5GS 5GC U-Plane.

  • Open5GS 5GC U-Plane1
./install/bin/open5gs-upfd &
  • Open5GS 5GC U-Plane2
./install/bin/open5gs-upfd &

Run UERANSIM

Here, the case of UE1 (IMSI-001010000000001) & RAN is described. First, do an NG Setup between gNodeB and 5GC, then register the UE with 5GC and establish a PDU session.

Please refer to the following for usage of UERANSIM.

https://github.com/aligungr/UERANSIM/wiki/Usage

Start gNB

Start gNB as follows.

# ./nr-gnb -c ../config/open5gs-gnb.yaml
UERANSIM v3.2.6
[2022-04-05 10:28:34.673] [sctp] [info] Trying to establish SCTP connection... (10.10.1.113:38412)
[2022-04-05 10:28:34.683] [sctp] [info] SCTP connection established (10.10.1.113:38412)
[2022-04-05 10:28:34.683] [sctp] [debug] SCTP association setup ascId[10] [2022-04-05 10:28:34.683] [ngap] [debug] Sending NG Setup Request [2022-04-05 10:28:34.715] [ngap] [debug] NG Setup Response received [2022-04-05 10:28:34.715] [ngap] [info] NG Setup procedure is successful [2022-04-05 10:28:53.298] [rrc] [debug] UE[1] new signal detected [2022-04-05 10:28:53.303] [rrc] [info] RRC Setup for UE[1]
[2022-04-05 10:28:53.305] [ngap] [debug] Initial NAS message received from UE[1]
[2022-04-05 10:28:53.474] [ngap] [debug] Initial Context Setup Request received
[2022-04-05 10:28:53.724] [ngap] [info] PDU session resource(s) setup for UE[1] count[1]

The Open5GS C-Plane log when executed is as follows.

4/05 10:28:30.371: [amf] INFO: gNB-N2 accepted[10.10.1.36]:42875 in ng-path module (../src/amf/ngap-sctp.c:113) 04/05 10:28:30.371: [amf] INFO: gNB-N2 accepted[10.10.1.36] in master_sm module (../src/amf/amf-sm.c:619)
04/05 10:28:30.371: [amf] INFO: [Added] Number of gNBs is now 1 (../src/amf/context.c:876)
04/05 10:28:30.371: [amf] INFO: gNB-N2[10.10.1.36] max_num_of_ostreams : 10 (../src/amf/amf-sm.c:658)
04/05 10:28:48.994: [amf] INFO: InitialUEMessage (../src/amf/ngap- handler.c:361)
04/05 10:28:48.994: [amf] INFO: [Added] Number of gNB-UEs is now 1 (../src/amf/context.c:2072)
04/05 10:28:48.994: [amf] INFO: RAN_UE_NGAP_ID[1] AMF_UE_NGAP_ID[1] TAC[1] CellID[0x10] (../src/amf/ngap-handler.c:497)

Start UE (UE1)

Start UE (UE1) as follows. This will register the UE with 5GC and establish a PDU session.

# ./nr-ue -c ../config/open5gs-ue1.yaml 
UERANSIM v3.2.6
[2022-04-05 10:28:48.095] [nas] [info] UE switches to state [MM- DEREGISTERED/PLMN-SEARCH]
[2022-04-05 10:28:48.098] [rrc] [debug] New signal detected for cell[1], total [1] cells in coverage
[2022-04-05 10:28:48.098] [nas] [info] Selected plmn[001/01] [2022-04-05 10:28:48.098] [rrc] [info] Selected cell plmn[001/01] tac[1] category[SUITABLE]
[2022-04-05 10:28:48.098] [nas] [info] UE switches to state [MM- DEREGISTERED/PS]
[2022-04-05 10:28:48.098] [nas] [info] UE switches to state [MM- DEREGISTERED/NORMAL-SERVICE]
[2022-04-05 10:28:48.098] [nas] [debug] Initial registration required due to [MM-DEREG-NORMAL-SERVICE]
[2022-04-05 10:28:48.101] [nas] [debug] UAC access attempt is allowed for identity[0], category[MO_sig]
[2022-04-05 10:28:48.101] [nas] [debug] Sending Initial Registration [2022-04-05 10:28:48.101] [nas] [info] UE switches to state [MM-REGISTER- INITIATED]
[2022-04-05 10:28:48.101] [rrc] [debug] Sending RRC Setup Request [2022-04-05 10:28:48.102] [rrc] [info] RRC connection established [2022-04-05 10:28:48.102] [rrc] [info] UE switches to state [RRC- CONNECTED]
[2022-04-05 10:28:48.102] [nas] [info] UE switches to state [CM-CONNECTED] [2022-04-05 10:28:48.163] [nas] [debug] Authentication Request received [2022-04-05 10:28:48.230] [nas] [debug] Security Mode Command received
[2022-04-05 10:28:48.230] [nas] [debug] Selected integrity[2] ciphering[0] [2022-04-05 10:28:48.273] [nas] [debug] Registration accept received [2022-04-05 10:28:48.273] [nas] [info] UE switches to state [MM- REGISTERED/NORMAL-SERVICE]
[2022-04-05 10:28:48.273] [nas] [debug] Sending Registration Complete [2022-04-05 10:28:48.273] [nas] [info] Initial Registration is successful [2022-04-05 10:28:48.273] [nas] [debug] Sending PDU Session Establishment Request
[2022-04-05 10:28:48.273] [nas] [debug] UAC access attempt is allowed for identity[0], category[MO_sig]
[2022-04-05 10:28:48.475] [nas] [debug] Configuration Update Command received
[2022-04-05 10:28:48.523] [nas] [debug] PDU Session Establishment Accept received
[2022-04-05 10:28:48.523] [nas] [info] PDU Session establishment is successful PSI[1]
[2022-04-05 10:28:48.589] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 10.46.0.2] is up.

The Open5GS C-Plane log when executed is as follows.

04/05 10:28:48.994: [amf] INFO: [suci-0-001-01-0000-0-0-0000000001] Unknown UE by SUCI (../src/amf/context.c:1398)
04/05 10:28:48.994: [amf] INFO: [Added] Number of AMF-UEs is now 1 (../src/amf/context.c:1197)
04/05 10:28:48.994: [gmm] INFO: Registration request (../src/amf/gmm- sm.c:134)
04/05 10:28:48.994: [gmm] INFO: [suci-0-001-01-0000-0-0-0000000001] SUCI (../src/amf/gmm-handler.c:157)
04/05 10:28:49.152: [app] WARNING: Try to discover [UDR] (../lib/sbi/path.c:110)
04/05 10:28:49.153: [pcf] INFO: [ef57c832-b4ca-41ec-b204-b9fa37bd8eef] (NF-discover) NF registered (../src/pcf/nnrf-handler.c:288)
04/05 10:28:49.153: [pcf] INFO: [ef57c832-b4ca-41ec-b204-b9fa37bd8eef] (NF-discover) NF Profile updated (../src/pcf/nnrf-handler.c:350)
04/05 10:28:49.363: [gmm] INFO: [imsi-001010000000001] Registration complete (../src/amf/gmm-sm.c:1063)
04/05 10:28:49.363: [amf] INFO: [imsi-001010000000001] Configuration update command (../src/amf/nas-path.c:389)
04/05 10:28:49.363: [gmm] INFO: UTC [2022-04-05T10:28:49] Timezone[0]/DST[0] (../src/amf/gmm-build.c:502)
04/05 10:28:49.363: [gmm] INFO: LOCAL [2022-04-05T10:28:49] Timezone[0]/DST[0] (../src/amf/gmm-build.c:507)
04/05 10:28:49.363: [amf] INFO: [Added] Number of AMF-Sessions is now 1 (../src/amf/context.c:2084)
04/05 10:28:49.364: [gmm] INFO: UE SUPI[imsi-001010000000001] DNN[internet2] S_NSSAI[SST:1 SD:0xffffff] (../src/amf/gmm-handler.c:1068) 04/05 10:28:49.378: [amf] INFO: [b7a64c10-b4ca-41ec-b218-157c8c9a9366] (NF-discover) NF registered (../src/amf/nnrf-handler.c:344)
04/05 10:28:49.379: [amf] INFO: [b7a64c10-b4ca-41ec-b218-157c8c9a9366] (NF-discover) NF Profile updated (../src/amf/nnrf-handler.c:406)
04/05 10:28:49.380: [smf] INFO: [Added] Number of SMF-UEs is now 1 (../src/smf/context.c:797)
04/05 10:28:49.380: [smf] INFO: [Added] Number of SMF-Sessions is now 1 (../src/smf/context.c:2777)
04/05 10:28:49.401: [smf] INFO: UE SUPI[imsi-001010000000001] DNN[internet2] IPv4[10.46.0.2] IPv6[] (../src/smf/npcf-handler.c:492) 04/05 10:28:49.404: [gtp] INFO: gtp_connect() [10.10.1.84]:2152 (../lib/gtp/path.c:60)

The Open5GS U-Plane1 log when executed is as follows.

4/05 10:28:50.223: [upf] INFO: [Added] Number of UPF-Sessions is now 1 (../src/upf/context.c:160)
04/05 10:28:50.223: [gtp] INFO: gtp_connect() [127.0.0.4]:2152 (../lib/gtp/path.c:60)
04/05 10:28:50.223: [upf] INFO: UE F-SEID[CP:0x1 UP:0x1] APN[internet2] PDN-Type[1] IPv4[10.46.0.2] IPv6[] (../src/upf/context.c:361)
04/05 10:28:50.237: [gtp] INFO: gtp_connect() [10.10.1.36]:2152 (../lib/gtp/path.c:60)

Looking at the console log of the nr-ue command, UE1 has been assigned the IP address 10.46.0.2 from Open5GS 5GC.

[2021-08-29 12:20:40.161] [app] [info] Connection setup for PDU session[1] is successful, TUN interface[uesimtun0, 10.46.0.2] is up.

Just in case, make sure it matches the IP address of the UE1's TUNnel interface.

# ip addr show
...
5: uesimtun0: <POINTOPOINT,PROMISC,NOTRAILERS,UP,LOWER_UP> mtu 1400 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none 
    inet 10.46.0.2/32 scope global uesimtun0
       valid_lft forever preferred_lft forever
    inet6 fe80::cb81:7519:c5e3:b23c/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever
...

Ping google.com

Specify the UE1's TUNnel interface and try ping.

Please refer to the following for usage of TUNnel interface.

https://github.com/aligungr/UERANSIM/wiki/Usage

Case for going through DN 10.46.0.0/16

Execute tcpdump on VM2 (U-Plane1) and check that the packet goes through if=ogstun.

  • ping google.com on VM5 (UE1)
# ping google.com -I uesimtun0 -n
PING google.com (172.217.161.206) from 10.46.0.2 uesimtun0: 56(84) bytes of data.
64 bytes from 172.217.161.206: icmp_seq=1 ttl=61 time=43.9 ms
64 bytes from 172.217.161.206: icmp_seq=2 ttl=61 time=46.2 ms
64 bytes from 172.217.161.206: icmp_seq=3 ttl=61 time=51.1 ms
  • Run tcpdump on VM2 (U-Plane1)
# tcpdump -i ogstun -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ogstun, link-type RAW (Raw IP), capture size 262144 bytes
12:23:32.832271 IP 10.46.0.2 > 172.217.161.206: ICMP echo request, id 2, seq 1, length 64
12:23:32.873621 IP 172.217.161.206 > 10.46.0.2: ICMP echo reply, id 2, seq 1, length 64
12:23:33.834172 IP 10.46.0.2 > 172.217.161.206: ICMP echo request, id 2, seq 2, length 64
12:23:33.877963 IP 172.217.161.206 > 10.46.0.2: ICMP echo reply, id 2, seq 2, length 64
12:23:34.836635 IP 10.46.0.2 > 172.217.161.206: ICMP echo request, id 2, seq 3, length 64
12:23:34.885181 IP 172.217.161.206 > 10.46.0.2: ICMP echo reply, id 2, seq 3, length 64

You could specify the IP address assigned to the TUNnel interface to run almost any applications as in the following example using nr-binder tool.

  • Run curl google.com on VM5 (UE1)
# sh nr-binder 10.46.0.2 curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
  • Run tcpdump on VM2 (U-Plane1)
12:24:47.324306 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [S], seq 413110957, win 65280, options [mss 1360,sackOK,TS val 254485831 ecr 0,nop,wscale 7], length 0
12:24:47.371513 IP 172.217.161.206.80 > 10.46.0.2.54927: Flags [S.], seq 6336001, ack 413110958, win 65535, options [mss 1460], length 0
12:24:47.373700 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [.], ack 1, win 65280, length 0
12:24:47.374132 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [P.], seq 1:75, ack 1, win 65280, length 74: HTTP: GET / HTTP/1.1
12:24:47.374321 IP 172.217.161.206.80 > 10.46.0.2.54927: Flags [.], ack 75, win 65535, length 0
12:24:47.469691 IP 172.217.161.206.80 > 10.46.0.2.54927: Flags [P.], seq 1:529, ack 75, win 65535, length 528: HTTP: HTTP/1.1 301 Moved Permanently
12:24:47.471025 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [.], ack 529, win 64752, length 0
12:24:47.474272 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [F.], seq 75, ack 529, win 64752, length 0
12:24:47.474550 IP 172.217.161.206.80 > 10.46.0.2.54927: Flags [.], ack 76, win 65535, length 0
12:24:47.527897 IP 172.217.161.206.80 > 10.46.0.2.54927: Flags [F.], seq 529, ack 76, win 65535, length 0
12:24:47.528962 IP 10.46.0.2.54927 > 172.217.161.206.80: Flags [.], ack 530, win 64752, length 0

Please note that the ping tool does not work with nr-binder. Please refer to here for the reason.

For UE1-UE4 as well, execute tcpdump on each U-Plane and check the packets flowing through ogstunX.

You could now create the end-to-end TUN interfaces on the DN and send any packets on the network.


In investigating 5G SA, I have built a simulation environment and can now use a very useful system for investigating 5GC and MEC of 5G SA mobile network. I would like to thank the excellent developers and all the contributors of Open5GS and UERANSIM.

OpenNESS, Open5GS and UERANSIM Experiment:

Run the OpenNESS MEC Server, please refere to the converged-edge-experience-kits/README.md

  1. Try to ping the OpenNESS VM from the UE1 via UPF1
ubuntu@ue:~/UERANSIM/build$ sh nr-binder 10.46.0.2 ping 10.10.1.245 PING 10.10.1.245 (10.10.1.245) 56(84) bytes of data.
64 bytes from 10.10.1.245: icmp_seq=1 ttl=64 time=1.81 ms
64 bytes from 10.10.1.245: icmp_seq=2 ttl=64 time=0.681 ms
64 bytes from 10.10.1.245: icmp_seq=3 ttl=64 time=0.708 ms 64 bytes from 10.10.1.245: icmp_seq=4 ttl=64 time=0.794 ms ^C
--- 10.10.1.245 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3059ms rtt min/avg/max/mdev = 0.681/0.997/1.806/0.468 ms
  1. The traffic on the UPF1 VM
ubuntu@open5gsuplane1:~/open5gs$ sudo tcpdump -i ogstun2 -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ogstun2, link-type RAW (Raw IP), capture size 262144 bytes 10:45:09.058770 IP 10.46.0.2.39613 > 10.10.1.245.80: Flags [S], seq 2160309204, win 65280, options [mss 1360,sackOK,TS val 4220556984 ecr 0,nop,wscale 7], length 0
10:45:09.060340 IP 10.10.1.245.80 > 10.46.0.2.39613: Flags [R.], seq 0, ack 2160309205, win 0, length 0
  1. After connecting the VM, try to retrive the video on the UE1 via UPF1
ubuntu@ue:~/UERANSIM/build$ sh nr-binder 10.46.0.2 curl -v "http://10.10.1.245:8081" --output ~/{output file}.bin
* Trying 10.10.1.245:8081...

*TCP_NODELAY set

% Total % Received % Xferd Average Speed Time Time

Dload Upload Total Spent Left Speed

0

Time Current

0 0

0

0 0 0* Connected to 10.10.1.245 (10.10.1.245) port 8081 (#0)

> GETHTTP/1.1

>Host: 10.10.1.245:8081

> User-Agent: curl/7.68.0

> Accept: */*

>

* Mark bundle as not supporting multiuse

*HTTP 1.0, assume close after body

<HTTP/1.0 200 OK

<Content-type: application/octet-stream

<Cache-Control: no-cache

<Connection: close.

{ [405 bytes data]

100 6964k 0 6964k 0

0 84070

0 ::-- 0:01:24:--:-- 63586

*Closing connection 0 curl: (3) unmatched close brace/bracket in URL position 5:

file}.bin

NOTE: Due to nr-binder application limitation usuage, VLC can't be used the curl video request works with the nr-binder. The curl download the video until one loop of the streaming is done.

  1. The traffic on the UPF1 VM, for retriving the video from the OpenNESS MEC Server:
ubuntu@open5gsuplane1:~/open5gs$ sudo tcpdump -i ogstun2 -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ogstun2, link-type RAW (Raw IP), capture size 262144 bytes 10:45:09.
18:02:26.457713 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 615593, win 5123, options [nop, nop, TS val 38227530 ecr 117789648], length 0

18:02:26.457823 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 616891, win 5113, options [nop, nop, TS val 38227530 ecr 117789648], length 0

18:02:26.457917 IP 10.46.0.2.50263> 10.10.1.245.8081: Flags [.], ack 618189, win 5103, options [nop, nop, TS val 38227530 ecr 117789648], length 0

18:02:26.457960 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 619487, win 5148, options [nop, nop, TS val 38227531 ecr 117789648], length 0

18:02:26.458270 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [P.], seq 619487:620088, ack 81, win 203, options [nop, nop, TS val 117789652 ecr 382275301, length 601

18:02:26.460400 IP 10.46.0.2.50263 >10.10.1.245.8081: Flags [.], ack 620088, win 5148, options [nop, nop, TS val 38227533 ecr 117789652], length 0

18:02:26.716970 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 620088:621386, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716986 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 621386:622684, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716987 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 622684:623982, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 382275331, length 1298

18:02:26.716989 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 623982:625280, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716991 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 625280:626578, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716992 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 626578:627876, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716994 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [.], seq 627876:629174, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 38227533], length 1298

18:02:26.716995 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [P.], seq 629174:630088, ack 81, win 203, options [nop, nop, TS val 117789910 ecr 382275331, length 914

18:02:26.720057 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 621386, win 5148, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720275 IP 10.46.0.2.50263 >10.10.1.245.8081: Flags [.], ack 622684, win 5139, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720377 IP 10.46.0.2.50263 >10.10.1.245.8081: Flags [.], ack 623982, win 5130, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720469 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 625280, win 5121, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720542 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 626578, win 5112, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720603 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 627876, win 5148, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720654 IP 10.46.0.2.50263 >10.10.1.245.8081: Flags [.], ack 629174, win 5139, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.720672 IP 10.46.0.2.50263 > 10.10.1.245.8081: Flags [.], ack 630088, win 5132, options [nop, nop, TS val 38227793 ecr 117789910], length 0

18:02:26.721242 IP 10.10.1.245.8081 > 10.46.0.2.50263: Flags [P.], seq 630088:630987, ack 81, win 203, options [nop, nop, TS val 117789915 ecr 38227793], length
  1. To add the virtual interface for the UE that allows the traffic via UPF,
ubuntu@ue:~/UERANSIM/build$sudo ip route add 10.10.1.84 dev uesimtun0

About

Testbed using Open5GS and UERANSIM for UE-based dynamic UPF selection between dual UPFs. Integrated with Intel OpenNESS to host a video streaming application at the MEC edge, demonstrating traffic steering and low-latency edge computing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published