5G core network
Joining a base station gives a device a radio link. The core network decides whether the device is allowed on, gives it an address, and carries its traffic to the internet. Earlier generations built the core from purpose-made boxes. The 5G core is defined as a set of cooperating software services, and it maps closely onto how cloud platforms are built. If you run Kubernetes, most of the patterns here will look familiar.
Service-based architecture
Section titled “Service-based architecture”The core is a set of network functions (NFs). Each offers a standardized service to the others over an API, and each can be deployed as one or more microservice instances in a data center or at the edge. Two design choices are worth noting:
- Control plane and user plane separation. One function, the UPF, forwards user packets. All the others handle signaling, identity, sessions, and policy. The data path can be scaled and placed independently of the control logic.
- Stateless functions. Persistent subscriber and session data live in separate repositories. A function instance reads and writes that state per transaction, the way a web service uses a database. Instances can then scale out and fail over without losing sessions.
Functions talk request and response over HTTP-based service interfaces, and also use subscribe and notify, where a function registers interest and gets pushed updates. Standardized links between functions, devices, and base stations are called reference points, named N1, N2, N3, and so on.
| Function | Plane | What it does |
|---|---|---|
| AMF (access and mobility management) | Control | Registers devices, authorizes access, tracks location, coordinates mobility. The only control function that talks directly to the device (over N1) and a base station (over N2) |
| SMF (session management) | Control | Sets up PDU sessions, allocates IP addresses, and configures the UPF |
| UPF (user plane) | User | Forwards user IP packets between the base station and the internet, through tunnels |
| UDM and UDR | Data | Subscriber identities, profiles, subscription rights. The UDR is the underlying store |
| AUSF (authentication server) | Control | Authenticates the device cryptographically against the SIM |
| PCF (policy control) | Control | Policy for QoS, mobility, charging, and roaming |
| NRF (network repository) | Control | Service registry. Functions register and discover each other, like service discovery in a cluster |
| NSSF (slice selection) | Control | Selects the network slice for a session |
| NEF and AF | Control | Expose network capabilities to outside and edge applications |
| SEPP (security edge proxy) | Control | Protects signaling between a home and a visited operator when roaming |
A network slice is a logically separate end-to-end network, with its own set of functions and resource guarantees, on shared physical infrastructure. One operator can run a low-latency slice for industrial control next to a best-effort slice for consumer traffic.
Identity: SIM and IMSI
Section titled “Identity: SIM and IMSI”Cellular networks identify a subscriber by a SIM (a card, or the software equivalent, the eSIM). It holds secret keys and the IMSI, made of three parts:
| Part | Meaning |
|---|---|
| MCC | Mobile country code, 3 digits |
| MNC | Mobile network code, 2 or 3 digits. With the MCC, it names the home operator |
| MSIN | The subscriber’s number within that operator |
When a device is on another operator’s network, it is roaming on a visited network. Authentication still happens against the home network, with the visited operator’s functions relaying through the SEPP. Service depends on the roaming agreements between the operators. How the authentication exchange itself works is in Wireless security.
Registration and session setup
Section titled “Registration and session setup”A device has to do two things in the core before it can send data.
1. Registration
Section titled “1. Registration”sequenceDiagram
participant D as Device
participant G as gNB
participant A as AMF
participant U as AUSF
participant M as UDM
D->>G: RRC setup (random access)
G->>A: Registration request
A->>D: Identity request and response
A->>U: Authenticate
U-->>D: Mutual authentication (SIM keys)
A->>M: Register device and state
A->>D: Registration accept
The base station picks an AMF and forwards the request. The AMF asks the device for its identity, and the AUSF runs the mutual authentication: the network proves it is genuine to the device, as well as the reverse. The AMF then records the device’s state in the UDM and accepts the registration.
2. PDU session establishment
Section titled “2. PDU session establishment”The device asks for a PDU session, its data connection.
- The AMF picks an SMF.
- The SMF checks the request against the subscriber’s profile in the UDM.
- The SMF picks a UPF and creates a GTP tunnel between the base station and that UPF.
- The SMF allocates an IPv4 or IPv6 address for the device and returns the session and tunnel details via the AMF and the base station.
- The base station and device configure the radio data path. The device can now send packets to the internet.
Compare this with joining Wi-Fi: DHCP gives the address and the AP bridges onto Ethernet. In cellular, the SMF gives the address and a tunnel carries the traffic.
| Step | Wi-Fi | 5G |
|---|---|---|
| Find the network | Beacon frames | Synchronization signals and SIB1 |
| First contact | CSMA/CA | PRACH |
| Link handshake | Association | RRC setup |
| Identity | Passphrase or 802.1X | SIM, IMSI, AUSF |
| Address | DHCP | SMF allocates in PDU session |
| Data path | Layer 2 bridge | GTP tunnel to the UPF |
The tunnel: GTP-U
Section titled “The tunnel: GTP-U”All of a device’s user traffic passes through its UPF, inside a tunnel. The user packet, with the device’s own IP address, is wrapped in a GTP-U header, then UDP, then an outer IP header addressed between the base station and the UPF.
flowchart LR
Dev["Device<br/>IP z"] -->|"radio"| GNB["Base station<br/>IP y"]
GNB -->|"outer IP y to x<br/>UDP + GTP-U<br/>inner packet: z to w"| UPF["UPF<br/>IP x"]
UPF -->|"plain IP packet z to w"| Inet["Internet"]
For a packet arriving from the internet (source w, destination z): the UPF wraps it in GTP-U/UDP/IP addressed to the base station y. The backhaul routers forward on the outer header like any IP packet. The base station strips the outer layers, and sends the original packet over the radio to the device. Uplink is the mirror.
Why a tunnel? Without it, every router in the backhaul would need a route for every active device and would have to update it each time a device moves between base stations. With tunnels, the backhaul only knows the fixed addresses of base stations and UPFs. When a device moves, only the tunnel endpoint at the UPF changes. The UPF is a fixed mobility anchor for the session.
The tunnel’s practical costs:
- MTU. GTP-U/UDP/IP headers add overhead, so the usable MTU on mobile links is often a little under 1,500. Path MTU problems that show as stalled large transfers are common on cellular paths. TCP MSS clamping at the UPF or a lower interface MTU avoids them. See fragmentation and PMTU.
- Addresses. Operators often put devices behind carrier-grade NAT, so many subscribers share a public address. This breaks inbound connections to phones. See carrier-grade NAT.
- Visibility. The inner IP address you see on the phone is not the one on the internet.
Where DevOps meets the core
Section titled “Where DevOps meets the core”- Cloud-native deployment. Core functions are shipped as containers and run on Kubernetes. The UPF is the exception that needs special handling, because high-throughput packet forwarding calls for kernel-bypass networking such as DPDK or SR-IOV.
- Private 5G. Enterprises can run their own small core and RAN, often using shared spectrum such as CBRS, for factories, ports, and campuses. They then own the same lifecycle problems as any platform: upgrades, observability, and certificates.
- Edge breakout. An application function at the edge can pull selected traffic out locally (“local breakout”) for low latency, instead of hauling it to a central UPF.
- IoT connectivity. Fleets of devices get cellular SIMs and operate through the operator’s core. The access point name, the IP range, and whether private addressing or a VPN is used are all decisions at the core.