435783178-Core-Network-Migration-Paths
435783178-Core-Network-Migration-Paths
org/open5gs/docs/guide/01-quickstart/
Quickstart
2025-01-12 02:48
1. Introduction to Open5GS
Welcome! If you want to set up your first Open5GS core you have come to the right place. Before we get started, we’ll spend a moment
to understand the basic architecture of the software.
TL;DR: Open5GS contains a series of software components and network functions that implement the 4G/ 5G NSA and 5G SA core functions. If
you know what each of these do already and how they interface with each other, skip to section 2.
The core has two main planes: the control plane and the user plane. These are physically separated in Open5GS as CUPS (control/ user
plane separation) is implemented.
The MME is the main control plane hub of the core. It primarily manages sessions, mobility, paging and bearers. It links to the HSS,
which generates SIM authentication vectors and holds the subscriber profile; and also to the SGWC and PGWC/SMF, which are the
control planes of the gateway servers. All the eNBs in the mobile network (4G basestations) connect to the MME. The final element of
the control plane is the PCRF, which sits in-between the PGWC/SMF and the HSS, and handles charging and enforces subscriber policies.
The user plane carries user data packets between the eNB/ NSA gNB (5G NSA basestations) and the external WAN. The two user plane
core components are the SGWU and PGWU/UPF. Each of these connect back to their control plane counterparts. eNBs/ NSA gNBs
connect to the SGWU, which connects to the PGWU/UPF, and on to the WAN. By having the control and user planes physically separated
like this, it means you can deploy multiple user plane servers in the field (eg somewhere with a high speed Internet connection), whilst
keeping control functionality centralised. This enables support of MEC use cases, for example.
All of these Open5GS components have config files. Each config file contains the component’s IP bind addresses/ local Interface names
and the IP addresses/ DNS names of the other components it needs to connect to. We’ll come back to this in Section 3.
5G SA Core
The Open5GS 5G SA Core contains the following functions:
The 5G SA core works in a different way to the 4G core - it uses a Service Based Architecture (SBA). Control plane functions are
configured to register with the NRF, and the NRF then helps them discover the other core functions. Running through the other
functions: The AMF handles connection and mobility management; a subset of what the 4G MME is tasked with. gNBs (5G basestations)
connect to the AMF. The UDM, AUSF and UDR carry out similar operations as the 4G HSS, generating SIM authentication vectors and
holding the subscriber profile. Session management is all handled by the SMF (previously the responsibility of the 4G MME/ SGWC/
PGWC). The NSSF provides a way to select the network slice, and PCF is used for charging and enforcing subscriber policies, and SEPP is
part of the roaming security architecture. Finally there is the SCP that enable indirect communication.
The 5G SA core user plane is much simpler, as it only contains a single function. The UPF carries user data packets between the gNB and
the external WAN. It connects back to the SMF too.
With the exception of the SMF and UPF, all config files for the 5G SA core functions only contain the function’s IP bind addresses/ local
Interface names and the IP address/ DNS name of the NRF.
Note: Package managers can be used to install Open5GS in Debian/Ubuntu and openSUSE environments (for major and minor builds). CentOS,
Fedora, and Mac OSX require you to build with source code.
Note: Nighly builds are offered by Osmocom on OBS. Scroll down to use a nightly build package.
Getting MongoDB
Ubuntu
Ubuntu makes it easy to install Open5GS as shown below.
Debian
The Open5GS packages for Debian are available on OBS. If you want to use the latest Debian version like Debian 10(Buster), you need to
install MongoDB first.
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_11/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_Testing/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Debian_Unstable/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/Raspbian_11/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_18.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_20.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.04/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_21.10/
https://download.opensuse.org/repositories/home:/acetcom:/open5gs:/latest/xUbuntu_22.04/
Nightly Builds
Nightly bulit package are provided by Osmocom on OBS. On Ubuntu 20.04 you can install it like this:
https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_10/
https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_11/
https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_Testing/
https://downloads.osmocom.org/packages/osmocom:/nightly/Debian_Unstable/
https://downloads.osmocom.org/packages/osmocom:/nightly/Raspbian_10/
https://downloads.osmocom.org/packages/osmocom:/nightly/Raspbian_11/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_18.04/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_20.04/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_20.10/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_21.04/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_21.10/
https://downloads.osmocom.org/packages/osmocom:/nightly/xUbuntu_22.04/
openSUSE
Martin Hauke packaged Open5GS for openSUSE on OBS.
1. Debian and Ubuntu based Linux distributions can install Node.js as follows:
4. Configure Open5GS
Okay - you have installed the software, now what to do with it? Well, there are some tweaks you will need to make to the config files,
and you will need to enter subscriber data into your HSS/ UDR. You will also need to set some IP Table rules to bridge the PGWU/UPF to
the WAN.
Out of the box, the default configurations see all of the Open5GS components fully configured for use on a single computer. They are
set to communicate with each other using the local loopback address space (127.0.0.X). The default addresses for each of the bind
interfaces for these components and functions are as follows:
If you are aiming to connect an external eNB to your core, you will also need to change the S1AP bind address of the MME and the
GTP-U bind address of the SGWU. If you are running an eNB stack locally, you will not need to make these changes.
Modify /etc/open5gs/mme.yaml to set the S1AP IP address, PLMN ID, and TAC.
################################################################################
# PFCP Server
Setup a 5G Core
You will need to modify the PLMN in your NRF and AMF config, and in case of AMF, further modify the TAC information. The
international test PLMN is 001/01, and the international private network PLMN is 999/99. You should stick to using either of these
PLMNs unless you have been issued a PLMN by your national regulator. (This PLMN will need to be configured in your gNB).
If you are aiming to connect an external gNB to your core, you will also need to change the NGAP bind address of the AMF and the
GTPU bind address of the UPF. If you are running an gNB stack locally, you will not need to make these changes.
Modify /etc/open5gs/amf.yaml to set the NGAP IP address, PLMN ID, TAC and NSSAI.
Configure logging
The Open5GS components log to /var/log/open5gs/*.log and to stderr by default.
global:
Username : admin
Password : 1423
To add subscriber information, you can do WebUI operations in the following order:
1. Go to Subscriber Menu.
2. Click + Button to add a new subscriber.
3. Fill the IMSI, security context(K, OPc, AMF), and APN of the subscriber.
4. Click SAVE Button
Enter the subscriber details of your SIM cards using this tool, to save the subscriber profile in the HSS and UDR MongoDB database
backend. If you are using test SIMs, the details are normally printed on the card.
Note: Subscribers added with this tool immediately register in the Open5GS HSS/UDR without the need to restart any daemon. However, if you
use the WebUI to change subscriber profile, you must restart the Open5GS AMF/MME daemon for the changes to take effect.
In order to bridge between the PGWU/UPF and WAN (Internet), you must enable IP forwarding and add a NAT rule to your IP Tables.
Configure the firewall correctly. Some operating systems (Ubuntu) by default enable firewall rules to block traffic.
Optionally, you may consider the settings below for security purposes.
### Ensure that the packets in the `INPUT` chain to the `ogstun` interface are accepted
$ sudo iptables -I INPUT -i ogstun -j ACCEPT
### Prevent UE's from connecting to the host on which UPF is running
$ sudo iptables -I INPUT -s 10.45.0.0/16 -j DROP
$ sudo ip6tables -I INPUT -s 2001:db8:cafe::/48 -j DROP
### If your core network runs over multiple hosts, you probably want to block
### UE originating traffic from accessing other network functions.
### Replace x.x.x.x/y with the VNFs IP/subnet
$ sudo iptables -I FORWARD -s 10.45.0.0/16 -d x.x.x.x/y -j DROP
• Make sure the PLMN and TAC of the eNB/gNB matches the settings in your MME/AMF
• Connect your eNB/gNB to the IP of your server via the standard S1AP/NGAP SCTP port 36412/38412 (for MME/AMF)
• Your eNB/gNB should report a successful S1/NG connection - congrats, your core is fully working!
• You can see actual traffic through wireshark – [srsenb.pcapng].
• You can view the log at /var/log/open5gs/*.log, eg:
1. On Ubuntu/Debian:
2. On openSUSE:
Open5GS
Sukchan Lee open5gs Open5GS is a C-language implementation of 5G Core and EPC,
[email protected] i.e. the core network of NR/LTE network (Release-17)