---
# System prepended metadata

title: Jingwen's solution
tags: [ME]

---

# Jingwen's solution

## 5G IMS system

* 4.4.3 IMS support
    IMS support for 5GC is defined in TS 23.228 [15].
    The 5G System architecture supports N5 interface between PCF and P-CSCF and supports Rx interface between PCF
    and P-CSCF, to enable IMS service. See TS 23.228 [15], TS 23.503 [45] and TS 23.203 [4].
    NOTE 1: Rx support between PCF and P-CSCF is for backwards compatibility for early deployments using
    Diameter between IMS and 5GC functions. 
    * TS 23.501: 4.4.3
* DL NAS transport
    * ![](https://hackmd.io/_uploads/Sk5Ona84n.png)



## Environment (using ZMQ)
![](https://hackmd.io/_uploads/ByedILDE3.png)

### srsUE
* https://docs.srsran.com/projects/project/en/latest/tutorials/source/srsUE/source/index.html#zeromq-based-setup
* https://docs.srsran.com/projects/4g/en/latest/app_notes/source/zeromq/source/index.html#zeromq-appnote
```
# Install UHD 3.9.7
git clone https://github.com/EttusResearch/uhd.git
cd <uhd-repo-path>
git checkout -b origin/UHD-3.9.LTs    // For srsUE, we need to use UHD-3.9
cd host
mkdir build
cd build
cmake ../
make
make test # This step is optional
sudo make install
sudo ldconfig


# Install ZeroMQ
sudo apt-get install libzmq3-dev


# Build srsUE
git clone https://github.com/srsRAN/srsRAN_4G.git
cd srsRAN_4G
mkdir build
cd build
cmake ../
make


# Put extra attention in the cmake console output. Make sure you read the following line:
...
-- FINDING ZEROMQ.
-- Checking for module 'ZeroMQ'
--   No package 'ZeroMQ' found
-- Found libZEROMQ: /usr/local/include, /usr/local/lib/libzmq.so
...


# Let’s start with creating a new network namespace called “ue1” for the (first) UE:
sudo ip netns add ue1


# To verify the new “ue1” netns exists, run:
sudo ip netns list


# Run srsUE:

cd ./srsue/src
sudo ./srsue ue.conf
```

[ue.conf](https://drive.google.com/drive/u/1/folders/1nBjYJtoCDQQ_gL2j8GgtZ1kZavmfLPTh)

### srsRAN(gNB)
* https://docs.srsran.com/projects/project/en/latest/tutorials/source/srsUE/source/index.html

```
# Install UHD 4.0
git clone https://github.com/EttusResearch/uhd.git
cd <uhd-repo-path>
git checkout -b origin/UHD-4.0    // For srsUE, we need to use UHD-3.9
cd host
mkdir build
cd build
cmake ../
make
make test # This step is optional
sudo make install
sudo ldconfig


# Install ZeroMQ
sudo apt-get install libzmq3-dev

# Build srsRAN project (gNB)
git clone https://github.com/srsran/srsRAN_Project.git
cd srsRAN_Project
mkdir build
cd build
cmake ../ -DENABLE_EXPORT=ON -DENABLE_ZEROMQ=ON
make

# Pay extra attention to the cmake console output. Make sure you read the following line:
...
-- FINDING ZEROMQ.
-- Checking for module 'ZeroMQ'
--   No package 'ZeroMQ' found
-- Found libZEROMQ: /usr/local/include, /usr/local/lib/libzmq.so
...

# Run gNB:
cd ./apps/gnb
sudo ./gnb -c gnb.yml
```


[enb.conf, rb.conf, rr.conf](https://drive.google.com/drive/u/1/folders/1nBjYJtoCDQQ_gL2j8GgtZ1kZavmfLPTh)
### Open5GS
* Quick start
    * https://open5gs.org/open5gs/docs/guide/01-quickstart/
* Build from source
    * https://open5gs.org/open5gs/docs/guide/02-building-open5gs-from-sources/

```
# Getting MongoDB
# Import the public key used by the package management system.
$ sudo apt update
$ sudo apt install gnupg
$ curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor


# Create the list file /etc/apt/sources.list.d/mongodb-org-6.0.list for your version of Ubuntu.
# On ubuntu 22.04 (Jammy)
$ echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list


# Install the MongoDB packages.
$ sudo apt update
$ sudo apt install -y mongodb-org
$ sudo systemctl start mongod (if '/usr/bin/mongod' is not running)
$ sudo systemctl enable mongod (ensure to automatically start it on system boot)
Tip: MongoDB is used as database for NRF/PCF/UDR and PCRF/HSS.

# Setting up TUN device (not persistent after rebooting)
# Create the TUN device with the interface name ogstun.
$ sudo ip tuntap add name ogstun mode tun
$ sudo ip addr add 10.45.0.1/16 dev ogstun
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
$ sudo ip link set ogstun up
# Tip: The script provided in $GIT_REPO/misc/netconf.sh makes it easy to configure the TUN device as follows: $ sudo ./misc/netconf.sh


# Building Open5GS

#Install the dependencies for building the source code.
$ sudo apt install python3-pip python3-setuptools python3-wheel ninja-build build-essential flex bison git cmake libsctp-dev libgnutls28-dev libgcrypt-dev libssl-dev libidn11-dev libmongoc-dev libbson-dev libyaml-dev libnghttp2-dev libmicrohttpd-dev libcurl4-gnutls-dev libnghttp2-dev libtins-dev libtalloc-dev meson

# Git clone.
$ git clone https://github.com/open5gs/open5gs

# To compile with meson:
$ cd open5gs
$ meson build --prefix=`pwd`/install
$ ninja -C build
Please free up enough memory space on the VM and run the test program.

The test program has been run on [VirtualBox - CPU: 1, Memory: 4.00 GB] and [Docker for Mac - CPU: 2, Memory: 2.00 GB] with default setting (max.ue: 4,096, pool.packet: 32,768).

# Check whether the compilation is correct.
$ ./build/tests/attach/attach ## EPC Only
$ ./build/tests/registration/registration ## 5G Core Only

# Run all test programs as below.
$ cd build
$ meson test -v
# Tip: You can also check the result of ninja -C build test with a tool that captures packets. If you are running wireshark, select the loopback interface and set FILTER to s1ap || gtpv2 || pfcp || diameter || gtp || ngap || http2.data.data || http2.headers. You can see the virtually created packets. testattach.pcapng/testregistration.pcapng

# You need to perform the installation process.
$ cd build
$ ninja install
$ cd ../
```


```
# Building the WebUI of Open5GS
# Node.js is required to build WebUI of Open5GS

$ sudo apt install curl
$ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
$ sudo apt install nodejs

# Install the dependencies to run WebUI

$ cd webui
$ npm ci

# The WebUI runs as an npm script.

$ npm run dev

# Server listening can be changed by setting the environment variable HOSTNAME or PORT as below.

$ HOSTNAME=192.168.0.11 npm run dev
$ PORT=7777 npm run dev


# Register Subscriber Information
# Connect to http://127.0.0.1:3000 and login with admin account.

Username : admin
Password : 1423

Note: You can change the password in Account Menu.

# To add subscriber information, you can do WebUI operations in the following order:

Go to Subscriber Menu.
Click + Button to add a new subscriber.
Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
Click SAVE Button
```



```
# Run Open5GS

$ ./install/bin/open5gs-nrfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:43:43.669: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nrf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:43:43.669: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nrf.log' (../lib/app/ogs-init.c:129)
10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [127.0.0.10]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:43.670: [sbi] INFO: nghttp2_server() [::1]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:43.671: [app] INFO: NRF initialize...done (../src/nrf/app.c:31)

$ ./install/bin/open5gs-scpd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:43:45.709: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/scp.yaml' (../lib/app/ogs-init.c:126)
10/22 10:43:45.709: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/scp.log' (../lib/app/ogs-init.c:129)
10/22 10:43:45.711: [sbi] INFO: nghttp2_server() [127.0.1.10]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:43:45.712: [app] INFO: SCP initialize...done (../src/scp/app.c:31)

$ ./install/bin/open5gs-amfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:01.416: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/amf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:01.416: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/amf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:01.419: [sbi] INFO: NF Service [namf-comm] (../lib/sbi/context.c:1401)
10/22 10:44:01.420: [sbi] INFO: nghttp2_server() [127.0.0.5]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:01.420: [amf] INFO: ngap_server() [127.0.0.5]:38412 (../src/amf/ngap-sctp.c:61)
10/22 10:44:01.420: [sctp] INFO: AMF initialize...done (../src/amf/app.c:33)

$ ./install/bin/open5gs-smfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:03.217: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/smf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:03.217: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/smf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2123 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2123 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [127.0.0.4]:2152 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [gtp] INFO: gtp_server() [::1]:2152 (../lib/gtp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [127.0.0.4]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: pfcp_server() [::1]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:03.269: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.7]:8805 (../lib/pfcp/path.c:61)
10/22 10:44:03.269: [sbi] INFO: NF Service [nsmf-pdusession] (../lib/sbi/context.c:1401)
10/22 10:44:03.270: [sbi] INFO: nghttp2_server() [127.0.0.4]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:03.270: [app] INFO: SMF initialize...done (../src/smf/app.c:31)

$ ./install/bin/open5gs-upfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:06.884: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/upf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:06.884: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/upf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:06.892: [pfcp] INFO: pfcp_server() [127.0.0.7]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:06.892: [gtp] INFO: gtp_server() [127.0.0.7]:2152 (../lib/gtp/path.c:30)
10/22 10:44:06.892: [app] INFO: UPF initialize...done (../src/upf/app.c:31)

$./install/bin/open5gs-ausfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:08.747: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/ausf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:08.747: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/ausf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:08.748: [sbi] INFO: NF Service [nausf-auth] (../lib/sbi/context.c:1401)
10/22 10:44:08.749: [sbi] INFO: nghttp2_server() [127.0.0.11]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:08.749: [app] INFO: AUSF initialize...done (../src/ausf/app.c:31)

$ ./install/bin/open5gs-udmd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:10.724: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udm.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:10.724: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udm.log' (../lib/app/ogs-init.c:129)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-ueau] (../lib/sbi/context.c:1401)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-uecm] (../lib/sbi/context.c:1401)
10/22 10:44:10.726: [sbi] INFO: NF Service [nudm-sdm] (../lib/sbi/context.c:1401)
10/22 10:44:10.727: [sbi] INFO: nghttp2_server() [127.0.0.12]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:10.727: [app] INFO: UDM initialize...done (../src/udm/app.c:31)

$./install/bin/open5gs-pcfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:14.265: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:14.265: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:14.269: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-am-policy-control] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-smpolicycontrol] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: NF Service [npcf-policyauthorization] (../lib/sbi/context.c:1401)
10/22 10:44:14.269: [sbi] INFO: nghttp2_server() [127.0.0.13]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:14.269: [app] INFO: PCF initialize...done (../src/pcf/app.c:31)

$ ./install/bin/open5gs-nssfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:16.250: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/nssf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:16.250: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/nssf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:16.252: [sbi] INFO: NF Service [nnssf-nsselection] (../lib/sbi/context.c:1401)
10/22 10:44:16.252: [sbi] INFO: nghttp2_server() [127.0.0.14]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:16.252: [app] INFO: NSSF initialize...done (../src/nssf/app.c:31)

$ ./install/bin/open5gs-bsfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:18.836: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/bsf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:18.836: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/bsf.log' (../lib/app/ogs-init.c:129)
10/22 10:44:18.837: [sbi] INFO: NF Service [nbsf-management] (../lib/sbi/context.c:1401)
10/22 10:44:18.837: [sbi] INFO: nghttp2_server() [127.0.0.15]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:18.837: [app] INFO: BSF initialize...done (../src/bsf/app.c:31)

$ ./install/bin/open5gs-udrd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:24.018: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/udr.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:24.018: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/udr.log' (../lib/app/ogs-init.c:129)
10/22 10:44:24.021: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:44:24.021: [sbi] INFO: NF Service [nudr-dr] (../lib/sbi/context.c:1401)
10/22 10:44:24.021: [sbi] INFO: nghttp2_server() [127.0.0.20]:7777 (../lib/sbi/nghttp2-server.c:150)
10/22 10:44:24.021: [app] INFO: UDR initialize...done (../src/udr/app.c:31)

$ ./install/bin/open5gs-mmed
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:26.011: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/mme.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:26.011: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/mme.log' (../lib/app/ogs-init.c:129)
10/22 10:44:26.062: [gtp] INFO: gtp_server() [127.0.0.2]:2123 (../lib/gtp/path.c:30)
10/22 10:44:26.063: [gtp] INFO: gtp_connect() [127.0.0.3]:2123 (../lib/gtp/path.c:60)
10/22 10:44:26.063: [mme] INFO: s1ap_server() [127.0.0.2]:36412 (../src/mme/s1ap-sctp.c:62)
10/22 10:44:26.063: [sctp] INFO: MME initialize...done (../src/mme/app-init.c:33)

$ ./install/bin/open5gs-sgwcd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:29.050: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwc.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:29.050: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwc.log' (../lib/app/ogs-init.c:129)
10/22 10:44:29.058: [gtp] INFO: gtp_server() [127.0.0.3]:2123 (../lib/gtp/path.c:30)
10/22 10:44:29.058: [pfcp] INFO: pfcp_server() [127.0.0.3]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:29.058: [pfcp] INFO: ogs_pfcp_connect() [127.0.0.6]:8805 (../lib/pfcp/path.c:61)
10/22 10:44:29.058: [app] INFO: SGW-C initialize...done (../src/sgwc/app.c:31)

$ ./install/bin/open5gs-sgwud
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:44:36.178: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/sgwu.yaml' (../lib/app/ogs-init.c:126)
10/22 10:44:36.178: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/sgwu.log' (../lib/app/ogs-init.c:129)
10/22 10:44:36.185: [pfcp] INFO: pfcp_server() [127.0.0.6]:8805 (../lib/pfcp/path.c:30)
10/22 10:44:36.185: [gtp] INFO: gtp_server() [127.0.0.6]:2152 (../lib/gtp/path.c:30)
10/22 10:44:36.185: [app] INFO: SGW-U initialize...done (../src/sgwu/app.c:31)

$ ./install/bin/open5gs-hssd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:49:22.963: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/hss.yaml' (../lib/app/ogs-init.c:126)
10/22 10:49:22.963: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/hss.log' (../lib/app/ogs-init.c:129)
10/22 10:49:22.965: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:49:22.996: [app] INFO: HSS initialize...done (../src/hss/app-init.c:31)
10/22 10:49:22.997: [diam] INFO: CONNECTED TO 'mme.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108)

$ ./install/bin/open5gs-pcrfd
Open5GS daemon v2.4.11-100-gbea24d7

10/22 10:49:26.089: [app] INFO: Configuration: '/home/acetcom/Documents/git/open5gs/install/etc/open5gs/pcrf.yaml' (../lib/app/ogs-init.c:126)
10/22 10:49:26.089: [app] INFO: File Logging: '/home/acetcom/Documents/git/open5gs/install/var/log/open5gs/pcrf.log' (../lib/app/ogs-init.c:129)
10/22 10:49:26.091: [dbi] INFO: MongoDB URI: 'mongodb://localhost/open5gs' (../lib/dbi/ogs-mongoc.c:130)
10/22 10:49:26.124: [app] INFO: PCRF initialize...done (../src/pcrf/app-init.c:31)
10/22 10:49:26.125: [diam] INFO: CONNECTED TO 'smf.localdomain' (SCTP,soc#15): (../lib/diameter/common/logger.c:108)
```

```
# For convenience, you can execute all NFs at once by using the following command.

$ ./build/tests/app/5gc ## 5G Core Only with ./build/configs/sample.yaml
$ ./build/tests/app/epc -c ./build/configs/srslte.yaml ## EPC Only with ./build/configs/srslte.yaml
$ ./build/tests/app/app ## Both 5G Core and EPC with ./build/configs/sample.yaml
```
[run5gc.sh, sample.yaml](https://drive.google.com/drive/u/1/folders/1nBjYJtoCDQQ_gL2j8GgtZ1kZavmfLPTh)


### Testing the Network
```
# PING
# This is the simplest way to test the network. This will test whether or not the UE and core can successfully communicate.

# Uplink
# To test the connection in the uplink direction, use the following:
sudo ip netns exec ue1 ping 10.45.0.1

# Downlink
# To run traffic in the downlink direction use:
ping 10.45.0.2

# The IP for the UE can be taken from the UE console output. This will change each time a UE reconnects to the network, so it is best practice to always double check the latest IP assigned by reading it from the console before running the downlink traffic.
```
![](https://hackmd.io/_uploads/HJdlqyq4n.png)

![](https://hackmd.io/_uploads/Hy_g5ycV2.png)


* Packet forwarding
    * sudo sysctl -w net.ipv4.ip_forward=1
    * sudo iptables -I FORWARD -p udp --dport 8787 -j ACCEPT
    * sudo iptables -t nat -I OUTPUT -p udp -o ogstun --dport 8700 -j DNAT --to-destination 10.45.0.1:8787 
    * sudo iptables -t nat -I OUTPUT -p udp -o lo --dport 8700 -j DNAT --to-destination 10.45.0.1:8787