<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://shishkebab.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://shishkebab.github.io/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2026-03-13T13:03:11-07:00</updated><id>https://shishkebab.github.io/feed.xml</id><title type="html">Sukwha Kyung</title><subtitle>Sukwha&apos;s Blog</subtitle><author><name>Sukwha Kyung</name><email>sukwha.kyung@asu.edu</email></author><entry><title type="html">Setting UERANSIM to connect to DN through Open5GS</title><link href="https://shishkebab.github.io/ue-open5gs-dn/" rel="alternate" type="text/html" title="Setting UERANSIM to connect to DN through Open5GS" /><published>2026-03-08T23:26:20-07:00</published><updated>2026-03-08T23:26:20-07:00</updated><id>https://shishkebab.github.io/ue-open5gs-dn</id><content type="html" xml:base="https://shishkebab.github.io/ue-open5gs-dn/"><![CDATA[<!-- 
**Update History:**
- Mar 10, 2026: Fixed typos
- Mar 12, 2026: Added 5G SBA diagram  
  
--- -->

<p>This post is a note on how to set up a 5G CN using Open5GS and UERANSIM for RAN on two separate hosts. The goal is pretty simple: establish a connection between UE and DN through UPF (i.e., UE → gNodeB → UPF → DN)
as illustrated in Figure 1 below.</p>

<figure id="sba">
  <img src="/assets/img/ue-open5gs-dn/setup.png" alt="Open5GS and UERANSIM setup" />
  <figcaption>Figure 1. Open5GS and UERANSIM setup</figcaption>
</figure>

<p>From here on, all the installations and configurations are done on <strong>Ubuntu 24.04 LTS</strong>.<br />
Let’s start by running Open5GS first.</p>

<h3 id="setting-up-open5gs">Setting Up Open5GS</h3>
<p>Over the past few years, the installation procedure for <a href="https://open5gs.org/open5gs/docs/guide/01-quickstart/">Open5GS</a> has not changed much and is quite straightforward.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">sudo </span>add-apt-repository ppa:open5gs/latest
<span class="nv">$ </span><span class="nb">sudo </span>apt update
<span class="nv">$ </span><span class="nb">sudo </span>apt <span class="nb">install </span>open5gs
</code></pre></div></div>

<p>By default, the core functions of Open5GS are configured to run on a single host. 
But we want to run a remote gNodeB and UE using UERANSIM, so we need to bind the Access and Mobility Function (<strong>AMF</strong>) to the IP address of the host runnning it. 
AMF is a core function in 5G SA that handles connection, mobility, and session management including UE registration and handover procedure.</p>

<ul>
  <li><strong>/etc/open5gs/amf.yaml:</strong></li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">amf</span><span class="pi">:</span>
  <span class="na">ngap</span><span class="pi">:</span>
    <span class="na">server</span><span class="pi">:</span>
      <span class="pi">-</span> <span class="na">address</span><span class="pi">:</span> <span class="s">&lt;HOST_IP&gt;</span>
<span class="nn">...</span>
</code></pre></div></div>

<p><em>ngap</em> represents the NGAP protocol used in N2 interface between gNodeB and AMF, and changing the loopback address to the host IP address allows the remote gNodeB to connect to the AMF.</p>

<p>There are other fields that you can configure, such as <em>MCC</em> and <em>MNC</em>. The default value for each field is 999 and 70 respectively.
999 for MCC is used for internal private networks, and unless you have a specific reason to change it to another value, you can leave it as it is.</p>

<p>We should also configure the User Plane Function (<strong>UPF</strong>) to allow user packets to be transported from gNodeB to DN through the UPF.</p>

<ul>
  <li><strong>/etc/open5gs/upf.yaml:</strong></li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">upf</span><span class="pi">:</span>
  <span class="na">gtpu</span><span class="pi">:</span>
    <span class="na">server</span><span class="pi">:</span>
        <span class="pi">-</span> <span class="na">addr</span><span class="pi">:</span> <span class="s">&lt;HOST_IP&gt;</span>
<span class="nn">...</span>
</code></pre></div></div>

<p>Make sure to restart each service after making changes to the configuration files.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">sudo </span>systemctl restart open5gs-amfd.service
<span class="nv">$ </span><span class="nb">sudo </span>systemctl restart open5gs-upfd.service
</code></pre></div></div>

<h3 id="setting-up-ueransim">Setting Up UERANSIM</h3>

<p>On a separate host, we install <a href="https://github.com/aligungr/UERANSIM/wiki">UERANSIM</a> to run a remote gNodeB and UE.</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>git clone https://github.com/aligungr/UERANSIM
<span class="nv">$ </span><span class="nb">cd </span>UERANSIM
<span class="nv">$ </span>make
</code></pre></div></div>

<p>Configure gNodebB first:</p>

<ul>
  <li><strong>UERANSIM/config/open5gs-gnb.yaml:</strong></li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># List of AMF address information</span>
<span class="na">amfConfigs</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="na">address</span><span class="pi">:</span> <span class="s">&lt;IP_Addr_of_Open5GS_host&gt;</span>
    <span class="na">port</span><span class="pi">:</span> <span class="m">38412</span>
</code></pre></div></div>

<p>Configure UE:</p>

<ul>
  <li><strong>UERANSIM/config/open5gs-ue.yaml:</strong></li>
</ul>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1"># List of gNB IP addresses for Radio Link Simulation</span>
<span class="na">gnbSearchList</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="s">&lt;IP_Addr_of_UERANSIM_host&gt;</span>
</code></pre></div></div>

<p>Now run the gNodeB first:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>build/nr-gnb <span class="nt">-c</span> config/open5gs-gnb.yaml
</code></pre></div></div>

<p>If successfully connected to AMF, you should see the following output:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[ngap] [info] NG Setup procedure is successful

</code></pre></div></div>

<p>You can check AMF log too:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span><span class="nb">tail</span> <span class="nt">-f</span> /var/log/open5gs/amf.log
</code></pre></div></div>

<p>Now we run the UE:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>build/nr-ue <span class="nt">-c</span> config/open5gs-ue.yaml
</code></pre></div></div>

<p>The following output indicates that the UE is successfully connected to gNodeB:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[nas] [debug] Sending Registration Complete
[nas] [info] Initial Registration is successful
[nas] [debug] Sending PDU Session Establishment Request
[nas] [debug] Configuration Update Command received
[nas] [debug] PDU Session Establishment Accept received
[nas] [info] PDU Session establishment is successful PSI[1]
</code></pre></div></div>

<p>Now we should be able to see a new NIC is present (<em>uesimtun0</em>).<br />
It means the user packets are encapsulated through GTP-U and transmitted to UPF.<br />
We can make sure by running commands like ping through the <em>uesimtun0</em> interfact:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>ping <span class="nt">-I</span> uesimtun0 8.8.8.8
</code></pre></div></div>

<p>Congrats! We have set up our own private 5G network!
Next, I plan to post another note about bringing COTS device on air to test real wireless communication, not just the simulation.</p>]]></content><author><name>Sukwha Kyung</name><email>sukwha.kyung@asu.edu</email></author><category term="5G" /><summary type="html"><![CDATA[A note on how to set up 5G CN using Open5GS and a remote RAN with UERANSIM.]]></summary></entry></feed>