# 5G Core - The study of 5G Core
## What is 5G?
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://hackmd.io/_uploads/SkgKypNZKp.jpg" alt="logo iperf" width="500" />
</div>
Fifth Generation (5G) technology represents the latest evolution in wireless communication systems, designed to provide unprecedented levels of connectivity, speed, and reliability. 5G goes beyond simply enhancing mobile broadband; it introduces a diverse range of applications and services by significantly increasing data transfer rates and reducing latency. Operating on higher frequency bands, 5G utilizes millimeter waves to transmit data, allowing for faster communication between devices. This enables a multitude of applications, including augmented reality (AR), virtual reality (VR), autonomous vehicles, and the Internet of Things (IoT), to flourish with minimal delay.
5G architecture is characterized by a more decentralized and flexible network, emphasizing the use of software-defined networking (SDN) and network function virtualization (NFV). This shift enhances network efficiency, enabling dynamic resource allocation based on demand. The deployment of small cells, massive MIMO (Multiple Input Multiple Output), and beamforming techniques further enhances coverage and capacity.
## Explained 5G Core
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://hackmd.io/_uploads/BJxCTEbFT.png" alt="logo iperf" width="500" />
</div>
5G Core (5GC) serves as the central component of a 5G network, overseeing both data and control plane operations. Positioned as the nucleus of the network architecture, the 5G core undertakes crucial functions such as aggregating data traffic, establishing communication with user equipment (UE), delivering essential network services, and fortifying security measures.
The functionalities of the 5G core span a wide array of services that are fundamental to enabling seamless communication within the mobile network. Among these services are authentication, authorization, as well as data and policy management. In the current landscape, many commercial operators deploy 5G in a non-standalone (NSA) configuration. This involves incorporating a new 5G radio (5G NR) access network atop an existing 4G LTE network core. Alternatively, standalone 5G (SA) configuration utilizes a completely new 5G network core in conjunction with the 5G NR access network. The standalone setup offers advantages such as simpler network management, improved performance, and a more flexible environment for both end users and operators. Therefore the 5G core network is aimed to be:
1. **Flexible**: 5G Core should be able to flexibly add new services and configure the network on a shared infrastructure.
2. **Agile**: The 5G Core should shorten the service implementation time from hours to minutes and delivers faster time-to-market (TTM) for new services from months to days.
3. **Scalable**: 5G Core should be scalable rapidly and highly with telco-grade reliability.
4. **Tunable**: 5G Core should be able to quickly adapt and optimise the network according to operating conditions. It should also support cost-efficient migration from 4G to 5G based on access agnostic common core.
To achieve these aims, the key 5GC design principles are:
1. **Network slicing**: This feature enables independent scalability and decoupled technical evolution and flexible deployments & configuration of the network as per the needs of the different services.
1. **Modular function design**: This is a form of functional disaggregation such that a function composed of multiple modules can be created according to the use case's requirements.
1. **Unified authentication framework** : This is useful in multi-access core, for efficiency and to enable operators to offer "follow-the-user" services, independently of access method.
1. **“Stateless" network functions**: With this feature, the "compute" resource is decoupled from the "storage" resource. This concept is derived from cloud applications. It enables much more efficient creation and consumption of network resources.
1. **Support for cloud native applications**: This is further step from NFV (Network Function Virtualisation) and improves the scalability and efficient creation and consumption of network resources.
1. **Network capability exposure**: Exposing information about the network's capabilities to internal and external applications is very important where operators want to integrate 5G with vertical industry processes.
1. **Support for mobile edge computing**: This is to support access to low- latency services hosted in local data centres. Typically, user-plane functions might be deployed remotely i.e. near to the user, while the control plane is centralized.
## Architecture and Components of 5G Core
### Service Based Architecture
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://i.imgur.com/tTlx0aB.png" alt="logo iperf" width="500" />
</div>
In the depicted architecture, the Service-Based Architecture (SBA) enables seamless connectivity between components within 5G core networks, even if they originate from different sources or suppliers. Through SBA, Network Functions (NFs) are interconnected with authorized access to each other's services, fostering collaboration and efficient communication.
The accompanying diagram visually illustrates the interconnection of NFs using the SBI (Service-Based Interface) Message Bus. Additionally, the diagram showcases the implementation of Control and User Plane Separation (CUPS), emphasizing the distinct separation of the control plane and user plane within the 5G network architecture.
### Components
5G Core disaggregated 4G evolved packet core and introduced new functions. The following are the 5GC components: connectivity and mobility management, authentication and authorization, subscriber data management, policy management, and more. 5GC system functions are completely software-based and designed as cloud-native 5G core (agnostic to the underlying cloud infrastructure), providing deployment agility and flexibility. The following are the core functions of 5GC:
1. **Network Repository Function (NRF)** : Serves as a central repository within the 5G Core (5GC) architecture, facilitating the discovery and management of network functions, enabling efficient communication and coordination between various network elements.
2. **gNodeB (gNB)** : Stands for "Next Generation NodeB," representing the radio access node in the 5G network responsible for radio communication with user equipment (UE). The gNB plays a key role in providing enhanced connectivity, increased data rates, and improved overall performance in the 5G wireless network.
3. **User plane Function (UPF)** : Manages the user data traffic by processing and forwarding it, ensuring efficient communication between the user equipment (UE) and the network.
4. **Data network (DN)** : Represents the network infrastructure responsible for storing and transmitting data, playing a crucial role in facilitating seamless connectivity and data exchange within the 5G Core (5GC) architecture.
5. **Core Access and Mobility Management Function (AMF)** : Controls access to the 5G network, handling mobility management tasks and ensuring smooth handovers for mobile devices.
6. **Authentication Server Function (AUSF)** : Verifies and authenticates the identity of users, ensuring secure access to the 5G network.
7. **Session Management Function (SMF)** : Manages and controls the data sessions between the user equipment and the network, optimizing the data flow for efficient communication.
8. **Network Slice Selection Function (NSSF)** : Facilitates the selection and management of network slices, enabling customization of network resources based on specific service requirements.
9. **Network Exposure Function (NEF)** : Provides an interface for external applications and services to access network information, enabling seamless integration with diverse applications.
10. **Policy Control function (PCF)** : Governs the policies for data flow and usage within the network, ensuring efficient resource allocation and network management.
11. **Unified Data Management (UDM)** : Centralizes the management of user-related data, providing a unified repository for user profiles and information.
12. **Application Function (AF)** : Manages and controls specific applications and services, ensuring their seamless integration and operation within the 5G network.
## Control and User Plan Separation (CUPS)
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://i.imgur.com/t7N1ZH1.png" alt="logo iperf" width="600" />
</div>
Control and User Plane Separation (CUPS) in 5G is an architectural framework designed to distinctly separate the control plane and user plane in a network. This separation is intended to optimize latency by positioning the user plane in close proximity to the Radio Access Network (RAN).
CUPS brings several advantages, including the capability to reduce latency in application services. This is achieved by strategically selecting user plane nodes that are closer to the RAN or better suited for the intended User Equipment (UE) usage, all without increasing the number of control plane nodes. Additionally, CUPS supports the expansion of data traffic by allowing the incorporation of user plane nodes without the need to alter the count of SGW-C, PGW-C, and TDF-C in the network. The architecture also enables the independent location and scaling of the Control Plane (CP) and User Plane (UP) resources of the Evolved Packet Core (EPC) nodes, facilitating their separate evolution. Lastly, CUPS facilitates the independent evolution of CP and UP functions and promotes the efficient delivery of user plane data through the implementation of Software Defined Networking.
## Difference between SBA and Monolithic
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://i.imgur.com/7niaARf.png" alt="logo iperf" width="600" />
</div>
The primary difference between Service-Based Architecture (SBA) and Monolithic architecture lies in their approach to connectivity and structure. In a Monolithic architecture, as depicted in the diagram using point-to-point references like N1, N2, and others, components are tightly integrated within a single, unified structure. In contrast, SBA introduces a more modular approach, where point-to-point references are primarily used to connect the user plane and control plane, allowing for a more flexible and scalable network architecture.
In the Monolithic architecture, components are closely coupled and often interdependent, making it challenging to update or modify individual elements without affecting the entire system. On the other hand, SBA embraces a service-oriented design, enabling components to communicate through standardized interfaces, promoting interoperability, and facilitating the independent evolution of different services. This modularity enhances flexibility, scalability, and the ability to integrate components from diverse sources or suppliers within the 5G core network.
## Implement SBA in Real Life
Implementing Service-Based Architecture (SBA) in real-life scenarios brings forth a transformative impact, as illustrated in the provided picture below :
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://i.imgur.com/kNIlX1K.png" alt="logo iperf" width="600" />
</div>
The adoption of SBA introduces a paradigm shift by incorporating edge computation into the 5G Core architecture. This is a significant departure from traditional approaches, allowing for a more distributed and versatile deployment. In the depicted scenario, the control plane, a critical component responsible for managing access and mobility within the network, is strategically deployed in containers or virtual machines. This deployment strategy is designed to position the control plane closer to the Radio Access Network (RAN), thereby reducing latency and enhancing the overall responsiveness of the network.
The modular nature of SBA enables the independent deployment and scaling of specific network functions, fostering flexibility and adaptability. This flexibility is particularly evident in the ability to deploy the control plane components in containers, which provide a lightweight and efficient environment for hosting these functions. By bringing edge computation into the 5G Core, SBA optimizes the network architecture to accommodate the growing demands of emerging technologies such as the Internet of Things (IoT), augmented reality (AR), and virtual reality (VR).
## Network Slicing
Slicing involves creating custom networks with dedicated elements for specific purposes. Each network slice represents a dynamic, logical end-to-end network. A User Equipment (UE) can access multiple slices over the same Access Network, each serving a distinct service type with agreed-upon Service-level Agreements (SLA). For instance, one slice may handle high-throughput traffic for enhanced Mobile Broadband (eMBB), while another serves massive IoT (mIoT) subscribers with small, infrequent data transmissions but significant signaling traffic. Slices can also cater to subscribers from different enterprises, like a dedicated slice for each Mobile Virtual Network Operator (MVNO). Network slicing in 5G is illustrated in picture below :
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://hackmd.io/_uploads/rJMxofEKa.png" alt="logo iperf" width="600" />
</div>
in the figure, UE1 accesses two services, IOT1 and IOT2, with distinct network requirements. Two network slices, slice#2 and slice#3, exist to meet these requirements. They share the AMF, but session management is separate. UE2 accesses the internet through a dedicated network slice #1. Network Slicing, defined in 3GPP TS 23.501, encompasses Core Network Control Plane, User Plane Network Functions, and the 5G Access Network within a Public Land Mobile Network (PLMN). While the term "network slicing" is new in 5G, similar functionalities have evolved from EPS to 5GS. Initially introduced in 4G Release 13, EPS supported Dedicated Core Networks (DCNs) with features like 'Decor.' In Release 14, Enhanced Decor (eDecor) improved DCNs by allowing UEs to store and provide the selected DCN ID during attach, simplifying Core Network selection but increasing dependency on UE support.
3GPP TS 23.501 defines Network Function, Slice, and Slice Instance as follows:
1. **Network Function**: A 3GPP adopted or 3GPP defined processing function in a network, which has defined functional behavior and 3GPP defined interfaces. (Note: A network function can be implemented either as a network element on a dedicated hardware, as a software instance running on a dedicated hardware, or as a virtualized function instantiated on an appropriate platform, e.g. on a cloud infrastructure.)
1. **Network Slice**: A logical network that provides specific network capabilities and network characteristics.
1. **Network Slice instance**: A set of Network Function instances and the required resources (e.g. compute, storage and networking resources) which form a deployed Network Slice.
## Cloud Native Architecture
<div style="text-align:center; margin-bottom: 30px;">
<img src="https://hackmd.io/_uploads/Byo_6zVFp.png" alt="logo iperf" width="400" />
</div>
The Cloud-Native strategy prioritizes minimizing technical risks by advocating a departure from the traditional cautious and slow approach. Instead, it encourages a rapid but cautious progression, emphasizing small, reversible, and low-risk steps. According to the Cloud Native Computing Foundation, cloud-native entails container packaging, dynamic management by a central orchestrator, and a focus on microservices. Container technologies like Docker, Kubernetes, and Mesosphere are well-suited for cloud-native applications, offering a lightweight and atomic computing unit.
Regarding specific aspects:
1. Seamless monitoring and operations in a Cloud-Native environment require observability, involving the collection, storage, and visualization of logs, metrics, traces, and other data points.
1. Security plays a crucial role in handling storage, provisioning, as well as managing identities, certificates, and keys in a Cloud-Native setup.
1. For Cloud Native Applications implementing business logic through stateless microservices, there is a typical reliance on stateful backing services to store data. Various open-source projects, including different database technologies, aim to fulfill these requirements.
Applications following the cloud-native pattern share common characteristics:
1. **Microservices-based**: Each application comprises small, independently operable services owned by individual development teams. Microservices allow teams to work autonomously on development, deployment, scaling, and upgrades.
1. **Containerized**: Cloud-native applications are packaged in containers, providing isolation for microservices. Containers are highly accessible, scalable, and portable, making them ideal for building and running microservices-based applications.
1. **Continuous delivery model**: Cloud-native applications operate on a continuous delivery model, supporting rapid cycles of build, test, deploy, release, and development. This facilitates collaboration between software service developers and infrastructure IT operations teams, enabling quick and non-disruptive software updates in alignment with DevOps principles. Cloud-native applications are dynamically managed on modern platforms like Kubernetes.
## Enable Support For AI/ML
As part of Release 15, 3GPP has introduced the Network Data Analytics Function (NWDAF), a network function that facilitates machine learning, enabling 5G operators to monitor network slice status and third-party application performance. NWDAF serves as the central analytics point in the 5G core network. Notably, 3GPP focuses on standardizing the types of raw information examined by NWDAF, rather than the specific algorithms employed. In accordance with 3GPP TR 23.791, several formula-based and AI-ML analytics use cases have been outlined for 5G utilizing NWDAF. These include:
1. Load-level computation and prediction for a network slice instance.
1. Service experience computation and prediction for an application/UE group.
1. Load analytics information and prediction for a specific Network Function (NF).
1. Network load performance computation and future load prediction.
1. UE (User Equipment) Expected behavior prediction.
1. UE Abnormal behavior/anomaly detection.
1. UE Mobility-related information and prediction.
1. UE Communication pattern prediction.
1. Congestion information – both current and predicted for a specific location.
1. Quality of Service (QoS) sustainability, involving reporting and predicting QoS changes.