STAFFCHAPTER 28

Virtualised and cloud-native cores

A core is software now, and software gets restarted, scaled and updated. Learn what virtualised and cloud-native mean, where a function keeps its state, how long a network takes to notice a dead function, and what a Tier 3 operator would have to run

55 MINHOW MOBILE NETWORKS WORKUPDATED 2026-11-13
PREDICT

In the lab, every function registers with the NRF (the network repository function, the core's directory) and sends it a heartbeat every 10 s; the NRF's log says Heartbeat:10s. You stop the AUSF's container with docker kill, with no warning. How long until the NRF logs that the AUSF is gone?

A mobile core used to be a cabinet. A vendor sold a mobile switching centre or a packet gateway as a box with its own chassis, cards, software and support contract, and you scaled it by buying a bigger one. Today the same functions are programs, and where they run is a choice. This chapter is about that choice, and about what changes when a core function is something an orchestrator starts, kills and restarts. The lab is a good teacher: it is a containerised core, fourteen containers started by one file. It is not a production cloud-native core, and the places where it is not are the lesson.

From appliances to virtual functions

An appliance ties three things together: the hardware, the operating software and the function it performs. If the box fails, the function fails. If you need ten per cent more capacity, you buy another box, and it arrives in months.

In October 2012 a group of network operators published a white paper, which ETSI (the European Telecommunications Standards Institute) hosts, that called for exactly the opposite: put network functions on standard servers, switches and storage, and run them as software. ETSI’s Network Functions Virtualisation (NFV) group followed. Its architecture has three blocks, and the words recur in every vendor document.

Block What it is Example
VNF (virtualised network function) The function as software An SMF, a packet gateway, an IMS server
NFVI (NFV infrastructure) The compute, storage and network a VNF runs on, with the hypervisor that shares the hardware among virtual machines A rack of servers in a data centre
MANO (management and orchestration) Starts, stops, scales and heals VNFs: an orchestrator, a VNF manager and a manager of the infrastructure The system that decides where a new instance runs

The first generation of VNFs were mostly the old software put into a virtual machine (VM), an emulated computer with its own operating system. The gain was real: one pool of servers, faster ordering, one team for the hardware. The limits were also real. A VM carries a whole operating system, so it starts in minutes and weighs gigabytes. The function inside is often still one large program that holds all its state, so you scale it by adding another large program. Moving a monolith onto a VM changes where it runs and little else.

What “cloud-native” adds

The Cloud Native Computing Foundation (CNCF) defines cloud-native technologies as those that let organisations build and run scalable applications in public, private and hybrid clouds, and names containers, service meshes, microservices, immutable infrastructure and declarative APIs as examples. Four of those ideas matter to a core.

  • Containers. A container is a process with its own view of the file system and network, sharing the host’s kernel. It starts in seconds, and the lab’s whole core is images of a few hundred megabytes, not machines.
  • Small, separate functions. The 5G core was designed this way. Its service-based architecture (SBA) splits the core into functions that call each other’s services over HTTP, the one you read in the ladder at port 7777. A function does one job (authenticate, hold a session, apply policy) and can be started or replaced alone.
  • Declared state. You do not start each instance by hand. You declare “three copies of this function, this image, this configuration”, and an orchestrator makes it so and keeps it so.
  • State kept apart. A function that stores nothing about the phones it serves can be killed and replaced at any moment. One that stores a lot cannot.

The word for a network function built that way is a cloud-native network function (CNF). The difference from a VNF is in the building, not the logo: a CNF is designed to be restarted, scaled and updated all the time, and a VNF often assumes it will run for months.

The lab’s core, taken apart

Look at what the lab already gives you, from the files in labs/telecoms.

One image, many functions. Eleven of the fourteen services use the same image, gradiant/open5gs:2.7.2, 380 MB, and run a different program from it (open5gs-amfd, open5gs-smfd and so on). The image holds seventeen of these daemons, including the 4G ones. The programs are small: the SMF is 5.6 MB, the AMF 4.1 MB, the UPF 684 KB, the SCP 340 KB. The image is large because of the operating system layer and libraries around them. The other images are gradiant/ueransim:3.2.6 (309 MB, the cell and phone), mongo:6.0 (1.1 GB) and busybox:1.36 (6.76 MB, the stand-in for the internet). An image is pulled once and shared; a new copy of a function costs the memory it uses, not another 380 MB of disk.

A directory. Each function registers with the NRF when it starts and sends a heartbeat every 10 s. Other functions find it by asking the NRF, through the SCP (service communication proxy), which every request passes through. The SCP is itself told by the NRF when a function appears or goes. The nrf.yaml file is tiny: it holds the network code and an address.

A start-up order that is only an order. compose.yaml says depends_on: [scp] for the AUSF and so on. Compose starts those containers after the SCP’s container has started. It does not wait until the SCP is ready. That is why the README tells you to wait 20 to 30 seconds after up before starting the phone, and why the functions are written to retry until the NRF answers (you will watch it in the break).

A restart policy. Every function has restart: unless-stopped. Docker restarts a container whose process exits by itself. You will see that a container you kill with docker kill is not restarted, because the policy leaves a container you stopped yourself alone. A production orchestrator also restarts a function that dies, and it does so by watching the function’s health, not only its exit.

Three functions with a database beside them. db_uri: mongodb://mongo/open5gs appears in the UDR’s, the PCF’s and the HSS’s configuration, and nowhere else. The subscription, the policy data and the authentication keys are kept there. The AMF, the SMF and the UPF have no store beside them: the phones the AMF has registered (ran_ue, amf_session), the sessions the SMF holds (ues_active, sessionnbr) and the forwarding rules in the UPF (upf_sessionnbr) exist as the function’s own counts, and in the 50-phone run they read 50 in each. That one fact decides what a restart costs. Where the memory lives, the memory is lost.

What the footprint says

The orchestrator’s recorded run read docker stats --no-stream on the idle core and again with 50 phones registered. All 14 containers together held about 196 MiB idle and 233 MiB with 50 phones. The AMF grew from 19.4 to 26.4 MiB and the SMF from 34.1 to 39.9 MiB. The function that grew most was not the AMF: it was the SCP, from 6.5 to 17.3 MiB, because every request in the core goes through it. The simulated phones were the busiest container at 28% of a CPU; the next was the simulated cell at 5.2%, and no core function was above 1.2% (the database was at 3.4%). The figures come from one snapshot on a virtual machine under software emulation, so compare them with each other and not with a real network.

Two lessons follow. A core function is cheap in memory: the whole lab idles in less than 200 MiB. And the part of the core that grows is the part that sees every request, so you size the proxy and the directory, not only the functions you can name. You will compute all this yourself in step 1.

Where state lives

Ibeabuchi’s question was about state, so spend a section on it.

3GPP’s architecture (TS 23.501) lists, among its principles, support for stateless network functions, where the compute resource is decoupled from the storage resource. It also defines an optional function for that: the UDSF (unstructured data storage function), where any function can store and fetch its own data, such as a phone’s context. The idea is that if no function holds anything that matters, any instance can handle any request, and an instance that dies loses nothing.

In practice three kinds of state exist, and they behave differently.

Kind Where it lives in the lab What a restart does Usual remedy
Subscriber data (keys, subscription, policy) MongoDB, behind the UDR and PCF Nothing: the data is in the database Replicate the database; protect it as the most valuable asset
Per-phone context (registered, where, which slice) The AMF’s memory Expected: the attached phones lose their context and must register again (step 6 checks) Several AMFs in a set, with the context shared or recoverable
Per-session context (address, QoS flows, forwarding rules) The SMF’s and the UPF’s memory Expected: sessions drop, or the SMF and UPF disagree about what exists (step 6 checks) Restore from a store, or let the phone re-establish

The AMF’s identity shows how the standard handles the second row. In the lab’s Registration accept (frame 366 of attach-and-browse) the phone is given a temporary identity, the 5G-GUTI, and its AMF part reads: AMF Region ID 2, AMF Set ID 1, AMF Pointer 0, which is the guami in core/amf.yaml (region 2, set 1). An AMF set is a group of AMFs that serve the same area and slices, so that any member can take over a phone from another. The lab has one AMF in the set, so you never see a take-over. A production core has several, and whether a phone survives the loss of one depends on whether the context is shared among them, which is a design decision of the product.

Be sceptical of the word “stateless”. Timers, ongoing sessions and charging counters are state. A vendor who says the function is stateless usually means that the state is held in a store beside it, which moves the question to the store: how it is replicated, how fast it is, and what happens when it is down.

Failing, detecting, recovering

A failure has three stages, and the time in each is a design choice: the function dies, someone notices, and something starts a replacement. The lab shows all three in miniature.

AUSFNRF lists itA requestrunningstopped (Exited 137): not restarted by Dockerrunning, new instance idREGISTERED, heartbeat every 10 snot listedREGISTERED againno one answers (the failure looks different in each half)killedNo heartbeatstartedup to about 11 s (5 to 11 s in checks)registers within a second

The picture is not to scale. The time between the kill and the restart was up to the person typing; the two measured times are the NRF’s detection (up to about 11 s) and the new instance’s registration (about a second after the container started).

Dying politely and dying suddenly are different events. docker compose restart udm sends the function a stop signal, and it de-registers itself: the NRF drops it in the same instant and the replacement registers about 0.2 s later with a new instance id. docker kill gives it no chance, and the NRF waits for a missed heartbeat. A planned change should look like the first, an outage like the second. If your maintenance procedure produces the second, you have built a ten-second outage into every change.

The directory heals itself, in this design. When you stop the NRF and start it again, the other functions are listed again with the instance ids they had before. They noticed, and registered again. The NRF holds the registry in memory, so the registry is rebuilt from what the functions say, not restored from a backup. That is cloud-native in a small case: the thing that is lost is cheap to recreate.

The radio side does not always heal. The README lists a quirk: if the AMF restarts, the lab’s cell (UERANSIM 3.2.6) keeps logging that it cannot find a suitable AMF until you restart the cell. A real base station retries its link to the core by itself. A core that recovers in seconds is no use to phones if the other end of the link needs a person.

Health is more than “the process is running”. Kubernetes asks each container three questions: is it alive (a liveness probe; if not, restart it), is it ready for traffic (a readiness probe; if not, take it out of the Service) and has it finished starting (a startup probe). The default interval for a probe is 10 s, and a function that is alive but cannot reach its database is not ready. In the lab, the NRF’s heartbeat does the second job at the level of 3GPP: a function that is up but not heartbeating is out of the directory.

Scaling and the arithmetic of N+1

An orchestrator can add copies of a function when load rises: in Kubernetes the autoscaler watches a measure such as CPU and changes the number of copies. Whether that helps depends on what is the limit.

  • The user plane scales with packets. A UPF’s limit is how fast it moves packets, so a cluster needs a way to give the UPF direct access to a network card (techniques called SR-IOV, single-root I/O virtualisation, and DPDK, the Data Plane Development Kit). An ordinary container network is too slow for the busiest sites, so telecoms clusters carry these extras. The N3 tunnel overhead belongs to the transmission chapter (Transmission, backhaul and tower sharing).
  • The control plane scales with transactions a second: registrations, session set-ups, authentication. In IoT and machine connectivity you fitted a queue to the busy-hour trace and showed that a core that finishes 25 registrations a second cannot be rescued from a spike by making it twice as fast. More copies of the AMF help only if the work divides: the phones’ registrations do, but the database behind the UDR and the single link from the cell may not.
  • Anything with a single shared point limits all the rest: the NRF, the SCP, the database.

The lab’s own run shows why you must measure. One phone registers in 601 ms, twenty at once in a median of 1,982 ms, and fifty at once in a median of 5,517 ms (95th percentile 5,914 ms, maximum 6,248 ms). The line fitted to the twenty in the IoT chapter (1.6 s fixed plus 40 ms per registration) predicts a median of about 2.6 s for fifty. The run measured 5.5 s. Either the fit from eighteen points does not extend, or something else became the limit: the functions, the cell and the phones share one emulated machine. The recorded run cannot tell you which. A forecast built from small tests is a guess until you test at the size you care about.

N+1 and what it costs. N+1 means running one more copy than the load needs, so that one can fail without the service suffering. The arithmetic is simple, and the trap is in its assumptions. A registration and data session in the lab’s ladder passes through ten things in series: SCP, AMF, AUSF, UDM, UDR, the database, PCF, BSF, SMF and UPF. If each is up 99.9% of the time, which is about nine hours down a year, the chain is up 0.999 to the tenth power: 99.0%, or about 87 hours a year. Two independent copies of each make each stage 99.9999% and the chain 99.9990%. But the copies are independent only if they do not share the same machine, power, rack or software bug. Put both on one host that is itself 99.9% available and you are back to 99.8990%. Step 5 computes this. The figures are illustrative; the shape is general: replication removes the failures of an instance, and what is left is whatever the copies share. In Nigeria that includes power, which Transmission, backhaul and tower sharing covers.

Updates are failures you schedule. Kubernetes can replace instances gradually (a rolling update, limited by settings called maxUnavailable and maxSurge) and go back if the new version misbehaves. That works if old and new versions can serve at the same time and if sessions on the instance being replaced can move. For a function that holds phones’ contexts in memory, a rolling update is a controlled version of the restart you will observe in step 6. Ask a vendor how its AMF is upgraded and what the phones attached to it see.

Kubernetes, in outline

Kubernetes is the orchestrator most cloud-native cores are designed for. You do not need to run it to understand a core. The lab’s concepts map onto it directly.

In the lab In Kubernetes What differs
A service in compose.yaml A Deployment: the number of copies and the image Compose has one copy; a Deployment keeps N and replaces the dead
restart: unless-stopped The Deployment’s controller, plus probes Restarts on health, not only on exit
depends_on Readiness probes and init containers Waits for readiness, not for a container to start
./core:/etc/atlas:ro A ConfigMap mounted into the container A change is versioned and rolled out
The mongo volume A PersistentVolume claimed by a StatefulSet Storage that outlives a container
Address 10.33.0.5 on the core network A Service, a stable name and address in front of changing containers Functions find each other by name; the NRF and SCP still do the 3GPP-level discovery
docker stats Metrics from the cluster (CPU, memory per container), plus the functions’ own Prometheus metrics scripts/metrics.sh reads the second kind

Five extras make a telecoms cluster different from a web cluster.

  1. SCTP. The cell talks to the AMF over SCTP, the transport that stops the lab’s AMF and cell starting on a machine whose kernel lacks it. Kubernetes supports SCTP in Services, stable since v1.20, but the nodes’ kernels and the network plugin must support it, a cloud load balancer often does not carry it, and an SCTP association with several addresses needs a plugin that can give a container several interfaces.
  2. Fast packets. The user plane needs the extras above.
  3. More than one network interface per container. A function may need separate networks for signalling, user traffic and management.
  4. Time and placement. A user plane function belongs near the radio to keep the delay low; a subscriber database belongs somewhere safe. A scheduler that places containers wherever there is room has to be told.
  5. Operations. A cluster has its own failure modes: certificates that expire, a control plane that loses its quorum, a rolling update that evicts the wrong pods. Whoever runs the core now also runs the cluster. This is the cost that vendors’ slides leave out.

Who runs the cloud

Where the cluster sits is a business and a regulatory decision, and the options are few.

  • Own servers in a data centre the operator rents or builds. Control and low delay; it carries the power, cooling, hardware and staff.
  • A private cloud in the same places, run as a platform that several functions share. Lumora Mobile’s container platform, which Ihuoma runs, is of this kind.
  • A public cloud region. Elastic, no hardware to buy, and a bill that varies. It brings questions: where the region physically is, what delay a user plane there adds, who can see the subscriber data, and what the licence and the data protection rules say about it.
  • A core as a service from a vendor or a host, where someone else runs the cluster.

Public clouds do carry production cores. Nokia announced in 2022 that it was supporting DISH Wireless’s launch of what the company called the world’s first telco network using a 5G standalone core on a public cloud (AWS), and AWS has published its own account of the deployment. That is a vendor’s and an operator’s claim from 2022, about a United States network with its own spectrum and radio: it shows that the approach is possible, not that it suits a Nigerian virtual operator.

What Kolanut Mobile and Lumora Mobile can run

The NCC’s virtual operator framework (section 4.2) gives a Tier 2 Simple Facilities Virtual Operator its own SIM and its own HLR, HSS, AuC and EIR, with no core switching or interconnect. A Tier 3 Core Facilities Virtual Operator adds core network elements for switching and interconnection (IMS, MSC and GMSC, PGSN/PGW, SGSN/SGW, MME), interconnect agreements, and may own a mobile network code; it relies on the host for radio access. A Tier 4 Virtual Aggregator or Enabler buys bulk capacity from a licensed network and resells it to several virtual operators, or provides a platform to which they outsource business and operations support, and may act as a Tier 3 operator where a region is unserved or underserved. The elements the table lists are 2G to 4G names; it does not name the AMF, SMF or UPFas of 2026-11.

Read what is not in that table. The framework does not say how a Tier 3 operator’s MME or IMS must be built, nor whether the 5G functions count as the same elements. Whether it may use a public cloud, a managed core or a platform run by someone else is a question for the NCC, for Lumora Mobile’s host agreement and for the MVNO Business course, which owns the licence and the money. The Tier 3 and Tier 4 courses own what those tiers build and run; this chapter gives you the technical questions to bring.

Kolanut Mobile at its Tier 2 stage already runs something that matters here: its own HSS (module 2’s subscriber databases). In the lab’s terms, it runs the part of the core that holds the most valuable state (the keys and subscriptions in MongoDB), and nothing that carries a phone’s traffic. A move to Tier 3 would add elements in the middle: functions that hold phones’ contexts and carry sessions, whose restart a subscriber notices. That is a different operational burden, and the numbers in this chapter, up to about eleven seconds to notice a failure and state that vanishes with the process, are the things Kolanut would own.

LAB Take the core apart: footprint, registry, restart and what a line cannot tell you ~55 MIN
YOU NEEDDocker with Compose v2Python 3.9 or laterSCTP in the kernel, for step 6 only (the live core): steps 1 to 5 and the break need only Docker and Python and work on any machine, including one without SCTP

You will compute the lab core’s footprint from the recorded run, look at one image and its programs, start the eight functions that need no SCTP and read their registry, stop one politely and one without warning, compute what replication buys, and then (on the live core) restart a function that holds phones. Work in labs/telecoms. Make a folder of your own, mkdir -p $HOME/mywork, for the scripts. Steps 3 and 4 and the break start the database and the SCTP-free functions with Compose; they work on a machine without SCTP, so a cloud sandbox is fine.

1. Compute the footprint (any machine with Python). Save this as $HOME/mywork/footprint.py. The figures are the recorded docker stats --no-stream readings, in MiB; replace them with your own to compare. They are from a virtual machine under software emulation.

#!/usr/bin/env python3
"""What the lab core costs in memory, idle and with 50 phones registered.

The figures are `docker stats --no-stream` readings from the recorded run
(a VM under software emulation, 2026-11-13). MiB of memory per container.
Replace them with your own readings to compare. Standard library only.
"""

IDLE = {"gnb": 2.93, "pcf": 6.062, "bsf": 4.977, "udm": 5.207, "amf": 19.35,
        "ausf": 5.078, "nssf": 4.922, "smf": 34.07, "udr": 5.57, "scp": 6.496,
        "internet": 0.449, "mongo": 68.81, "nrf": 5.824, "upf": 25.87}
LOAD50 = {"gnb": 3.328, "pcf": 7.984, "bsf": 5.387, "udm": 9.68, "amf": 26.38,
          "ausf": 7.965, "nssf": 5.012, "smf": 39.93, "udr": 6.422, "scp": 17.3,
          "internet": 0.449, "mongo": 70.23, "nrf": 6.352, "upf": 26.76}
PHONES = 50

idle_total, load_total = sum(IDLE.values()), sum(LOAD50.values())
print(f"{len(IDLE)} containers, idle:        {idle_total:6.1f} MiB")
print(f"{len(IDLE)} containers, {PHONES} phones:   {load_total:6.1f} MiB")
print(f"growth: {load_total - idle_total:.1f} MiB, "
      f"{(load_total - idle_total) / PHONES * 1024:.0f} KiB per phone, all functions together\n")

print(f"{'function':<10}{'idle':>8}{'50 phones':>11}{'growth':>9}{'KiB/phone':>11}")
rows = sorted(IDLE, key=lambda f: LOAD50[f] - IDLE[f], reverse=True)
for f in rows:
    d = LOAD50[f] - IDLE[f]
    print(f"{f:<10}{IDLE[f]:>8.1f}{LOAD50[f]:>11.1f}{d:>9.1f}{d / PHONES * 1024:>11.0f}")

# The tempting step: draw a line through two points and extend it.
slope = (LOAD50["amf"] - IDLE["amf"]) / PHONES          # MiB per phone
print("\nThe two-point line for the AMF alone (do not trust it):")
for n in (1_000, 100_000, 1_100_000):
    print(f"  {n:>9,} phones -> {(IDLE['amf'] + slope * n) / 1024:10,.1f} GiB")
python3 $HOME/mywork/footprint.py
14 containers, idle:         195.6 MiB
14 containers, 50 phones:    233.2 MiB
growth: 37.6 MiB, 769 KiB per phone, all functions together

function      idle  50 phones   growth  KiB/phone
scp            6.5       17.3     10.8        221
amf           19.4       26.4      7.0        144
smf           34.1       39.9      5.9        120
udm            5.2        9.7      4.5         92
ausf           5.1        8.0      2.9         59
pcf            6.1        8.0      1.9         39
mongo         68.8       70.2      1.4         29
upf           25.9       26.8      0.9         18
udr            5.6        6.4      0.9         17
nrf            5.8        6.4      0.5         11
bsf            5.0        5.4      0.4          8
gnb            2.9        3.3      0.4          8
nssf           4.9        5.0      0.1          2
internet       0.4        0.4      0.0          0

The two-point line for the AMF alone (do not trust it):
      1,000 phones ->        0.2 GiB
    100,000 phones ->       13.7 GiB
  1,100,000 phones ->      151.1 GiB

The SCP grows most, not the AMF, because every request goes through it. The core is under 200 MiB idle. The last three lines are a trap: 151 GiB for one AMF is the output of a line through two points, and no capacity plan should contain it. The run does not say how much of the AMF’s growth is per phone and how much is a one-off cost of handling the first phones. Your numbers will differ if you use your own readings.

2. One image, many programs (any machine with Docker). If the images are not on the machine, docker compose pull fetches them.

docker images --format '{{.Repository}}:{{.Tag}}\t{{.Size}}' | grep -E "open5gs|ueransim|mongo|busybox"
docker run --rm --entrypoint sh gradiant/open5gs:2.7.2 -c 'ls /opt/open5gs/bin | wc -l; cd /opt/open5gs/bin; du -h open5gs-smfd open5gs-amfd open5gs-upfd open5gs-nrfd open5gs-scpd'

The first command prints four lines: mongo:6.0 1.1GB, gradiant/ueransim:3.2.6 309MB, gradiant/open5gs:2.7.2 380MB and busybox:1.36 6.76MB (the order may differ). The second prints 17, the number of programs in the image, then their sizes: 5.6M open5gs-smfd, 4.1M open5gs-amfd, 684K open5gs-upfd, 632K open5gs-nrfd, 340K open5gs-scpd. One 380 MB image supplies eleven of the fourteen services; the functions themselves are a few megabytes. The sizes come from this image and Docker’s way of reporting them; another build will differ.

3. Start the functions that need no SCTP and read the registry (any machine with Docker). The AMF and the cell need SCTP. The directory, the proxy and the functions behind them speak HTTP over TCP and do not. Save this as $HOME/mywork/nrf_list.py: it asks the NRF for its list of instances (the nnrf-nfm service, TS 29.510) and prints one line for each.

#!/usr/bin/env python3
"""List what the NRF knows: one line per registered function instance.

Asks the NRF's discovery-management API (Nnrf_NFManagement, TS 29.510) for
its instance list, then for each profile. Run it where 10.33.0.10 is
reachable (the lab's core network). The NRF speaks HTTP/2 without TLS, so
the script uses curl, as scripts/metrics.sh does.
"""
import json
import subprocess

NRF = "http://10.33.0.10:7777/nnrf-nfm/v1/nf-instances"


def get(url):
    out = subprocess.run(["curl", "-s", "--http2-prior-knowledge", url],
                         capture_output=True, text=True, check=True).stdout
    return json.loads(out)


profiles = []
for item in get(NRF)["_links"]["items"]:
    profiles.append(get(item["href"]))

print(f"{'type':<6} {'status':<11} {'heartbeat':>9}  {'address':<14} instance id")
for p in sorted(profiles, key=lambda p: p["nfType"]):
    addr = (p.get("ipv4Addresses") or ["?"])[0]
    print(f"{p['nfType']:<6} {p['nfStatus']:<11} {str(p.get('heartBeatTimer', '-')) + ' s':>9}  {addr:<14} {p['nfInstanceId']}")
print(f"{len(profiles)} instances registered")
docker compose up -d mongo nrf scp ausf udm udr pcf nssf bsf
sleep 10
docker compose ps --format 'table {{.Service}}\t{{.Image}}\t{{.Status}}'
docker compose logs --no-color nrf | grep "NF registered"
docker run --rm --network atlas-telecoms_core -v "$HOME/mywork:/q:ro" nicolaka/netshoot:v0.13 python3 /q/nrf_list.py

docker compose ps lists the nine services as Up (more if the hss is running too). The NRF’s log has seven lines like this one, within a second of each other (instance ids and times differ on your run):

nrf-1  | 11/13 22:11:13.232: [nrf] INFO: [23746ecc-dfaf-41f1-8499-b70fb795ab40] NF registered [Heartbeat:10s] (../src/nrf/nf-sm.c:202)

The listing has eight rows, because the NRF registers itself:

type   status      heartbeat  address        instance id
AUSF   REGISTERED       10 s  10.33.0.11     23d93f46-dfaf-41f1-a16a-5b8fa5d303b9
BSF    REGISTERED       10 s  10.33.0.15     23b9a1a4-dfaf-41f1-bf12-d12fd5439eb5
NRF    REGISTERED       10 s  10.33.0.10     23652e62-dfaf-41f1-8a92-87637779a9b9
NSSF   REGISTERED       10 s  10.33.0.14     23ca3316-dfaf-41f1-bff8-d18c4c066ed1
PCF    REGISTERED       10 s  10.33.0.13     23aab28e-dfaf-41f1-8970-875827675523
SCP    REGISTERED       10 s  10.33.0.200    23746ecc-dfaf-41f1-8499-b70fb795ab40
UDM    REGISTERED       10 s  10.33.0.12     2387ac1c-dfaf-41f1-99d4-b747fdc4abfa
UDR    REGISTERED       10 s  10.33.0.20     23996e3e-dfaf-41f1-a121-9d80ee5f08a1
8 instances registered

The functions register within a few seconds of starting, because the database is already up. The full core takes 20 to 30 s to settle because the AMF, SMF and UPF and their links take longer, and the order of start-up is not the order of readiness. Each function’s heartbeat is the 10 s the NRF expects.

4. Stop a function politely, then without warning (any machine). Restart the UDM, and read what the NRF saw:

docker compose restart udm
sleep 3
docker compose logs --no-color nrf --since 10s | grep -E "NF registered|de-registered"

Two de-registered lines for the old UDM instance and, 0.2 s later, one NF registered line with a new instance id (recorded):

nrf-1  | 11/13 22:11:32.089: [nrf] INFO: [2387ac1c-dfaf-41f1-99d4-b747fdc4abfa] NF de-registered (../src/nrf/nf-sm.c:218)
nrf-1  | 11/13 22:11:32.089: [nrf] INFO: [2387ac1c-dfaf-41f1-99d4-b747fdc4abfa] NF de-registered (../src/nrf/nrf-sm.c:176)
nrf-1  | 11/13 22:11:32.286: [nrf] INFO: [2ecff494-dfaf-41f1-8627-0b57191d882b] NF registered [Heartbeat:10s] (../src/nrf/nf-sm.c:202)

The function told the NRF it was leaving. The instance id is not the function’s name: the replacement is a new instance of the same function, which is why a registry keyed by instance id must be rebuilt, not edited.

Now kill the AUSF with no warning, and wait for the NRF:

docker kill atlas-telecoms-ausf-1
date +%T
sleep 14
docker compose logs --no-color nrf --since 20s | grep -E "No heartbeat"
docker compose ps -a ausf --format '{{.Service}} {{.Status}}'
docker compose start ausf
sleep 3
docker compose logs --no-color nrf --since 6s | grep "NF registered"

The NRF logs a warning and then the de-registration up to about 11 s after date printed its time: the interval of 10 s plus a 1 s margin, counted from the last heartbeat it received, so the wait can be as short as a few seconds (in checks for this chapter it was between about 5 and 11 s). The line looks like this, with your own id and time:

nrf-1  | 11/13 22:11:44.909: [nrf] WARNING: [23d93f46-dfaf-41f1-a16a-5b8fa5d303b9] No heartbeat (../src/nrf/nrf-sm.c:278)

docker compose ps -a prints ausf Exited (137) 14 seconds ago: 137 is 128 plus signal 9, a process that was killed. Docker did not restart it, even though the service has restart: unless-stopped: the policy leaves a container you stopped yourself alone. After docker compose start ausf the NRF logs one NF registered with a new instance id within about a second of the start.

5. Compute what replication buys (any machine with Python). Save this as $HOME/mywork/resilience.py. The chain is the set of functions the attach-and-browse ladder touches for a registration and a data session. The availability figures are illustrative, not a measurement of any product.

#!/usr/bin/env python3
"""Availability of a data session when every function it needs must be up.

The chain is the set of functions the lab's attach-and-browse ladder touches
for a registration and a data session. The availability figures are
ILLUSTRATIVE, not measurements of any product or network. Standard library
only.
"""

CHAIN = ["scp", "amf", "ausf", "udm", "udr", "mongo", "pcf", "bsf", "smf", "upf"]
HOURS = 8760            # hours in a (non-leap) year


def one_of(a, copies):
    """Availability when any one of `copies` independent instances is enough."""
    return 1 - (1 - a) ** copies


def chain(a, copies):
    out = 1.0
    for _ in CHAIN:
        out *= one_of(a, copies)
    return out


def show(label, avail):
    print(f"{label:<44}{avail * 100:>9.4f} %{(1 - avail) * HOURS:>11.2f} h/year")


a = 0.999               # one instance: three nines (illustrative)
host = 0.999            # the machine or site they all share (illustrative)
print(f"{len(CHAIN)} functions in series; one instance = {a * 100:.1f} %; shared host = {host * 100:.1f} %\n")
print(f"{'case':<44}{'available':>11}{'down':>17}")
show("1 instance each, independent", chain(a, 1))
show("2 instances each, independent", chain(a, 2))
show("3 instances each, independent", chain(a, 3))
show("2 instances each, all on one host", chain(a, 2) * host)
show("2 instances each, spread over 2 hosts", chain(a, 2) * one_of(host, 2))
python3 $HOME/mywork/resilience.py
10 functions in series; one instance = 99.9 %; shared host = 99.9 %

case                                          available             down
1 instance each, independent                  99.0045 %      87.21 h/year
2 instances each, independent                 99.9990 %       0.09 h/year
3 instances each, independent                100.0000 %       0.00 h/year
2 instances each, all on one host             99.8990 %       8.85 h/year
2 instances each, spread over 2 hosts         99.9989 %       0.10 h/year

Read the fourth line. Two copies of every function, on one host, are about ninety times worse than the same two copies on two hosts. The third line rounds to 100.0000% and is not a promise: the model has no software bug that hits all copies at once, no mistaken change and no loss of the directory. Every real outage is in what the model leaves out.

6. Restart a function that holds phones (needs the live core). Start the core and the phone as in the lab’s README (docker compose up -d, scripts/subscriber.sh add 999700000000001 465B5CE8B199B49FAA5F0A2EE238A6BC E8ED289DEBA952E4283B54E88E6183CA 2340000000001, docker compose --profile phone up -d ue), wait 30 s, and check the phone has a session. Then:

scripts/metrics.sh smf
docker compose restart smf
sleep 15
scripts/metrics.sh smf
docker compose exec ue ping -c 3 -I uesimtun0 10.34.0.80
docker compose exec ue nr-cli imsi-999700000000001 --exec ps-list

Recorded on the lab core on 2026-11-13 (a VM under software emulation; timestamps and addresses vary). Before the restart:

## smf (10.33.0.4:9090)
ues_active 1
bearers_active 1
fivegs_smffunction_sm_sessionnbr{plmnid="99970",snssai="1"} 1
...

After docker compose restart smf and 15 s, the SMF’s block is empty: ## smf (10.33.0.4:9090) and nothing under it. metrics.sh hides zero values, so every session gauge is now 0. The count was held in the process and went with it. The phone does not know:

2 packets transmitted, 0 received, 100% packet loss, time 1046ms
 state: PS-ACTIVE
 address: 10.45.0.2

ps-list still reports the session as PS-ACTIVE with its address, and nothing reaches the data network. scripts/metrics.sh upf showed fivegs_upffunction_sm_n4sessionestabreq 1 and fivegs_upffunction_upf_qosflows{dnn="internet"} 1, but no upf_sessionnbr line: the UPF has dropped the session too, and only its cumulative counters remember there was one. Three parts of the network now disagree about whether this phone has a session. That is Ibeabuchi’s answer: in this core, the SMF’s state lives in its process, a restart loses it, and nobody tells the phone. A cloud-native design keeps that state outside the process so a replacement can carry on, which is the first thing to ask about any vendor’s restart story.

Then restart the AMF with docker compose restart amf and read docker compose logs --tail 5 gnb. The recorded cell log ends:

[sctp] [warning] Unhandled SCTP notification received
[ngap] [error] Association terminated for AMF[2]
[ngap] [debug] Removing AMF context[2]

and scripts/metrics.sh amf prints only its header: no gnb line, no phones. The phone’s own status still says cm-state: CM-CONNECTED and rm-state: RM-REGISTERED, a view of a network that is gone. As the README says, the lab’s cell does not reconnect by itself: run docker compose restart gnb, then restart the phone. A live network’s cell would reconnect on its own.

Stop the directory, then restart a function that needs it. Run:

docker compose stop nrf
docker compose restart udm
sleep 12
docker compose logs --no-color udm --since 20s | grep -E "Retry|Status Code" | head -6
docker compose start nrf
sleep 12
docker compose logs --no-color udm --since 15s | grep "NF registered"
docker run --rm --network atlas-telecoms_core -v "$HOME/mywork:/q:ro" nicolaka/netshoot:v0.13 python3 /q/nrf_list.py

With no NRF, the new UDM keeps retrying its registration; look for the retry lines in its log. Within a few seconds of the NRF coming back it logs NF registered [Heartbeat:10s]. The function waited and retried: this is the answer to the depends_on you read, because start order is not readiness, and a core that depends on start order is a core that fails when anything starts late. The final listing shows every other function back in the NRF’s registry with the same instance id it had before; only the NRF and the UDM have new ones. The registry was rebuilt from the functions that had it. Then answer: if the NRF is a single instance, what does a phone trying to register see during those 12 seconds, and what would you want before you let a production core depend on one? To finish, docker compose rm -sf nrf scp ausf udm udr pcf nssf bsf removes the eight functions and leaves the database (and the hss, if it is running) as it was.

For the paper question: Kolanut Mobile has 1.1 million subscribers. Using the 151 GiB figure from step 1 as a starting point, write down three reasons it is wrong, and then the three runs (how many phones, which numbers to record, which setting to read first: every function’s core/*.yaml caps global.max.ue at 1,024) that would let you replace it with a forecast. The recorded load run used 50 phones; you would need at least three more sizes below that cap, and they have not been run for this chapter.

DECIDE

Kolanut Mobile, at the stage where it has 120 people and 1.1 million subscribers, runs its own HSS under a Tier 2 licence and is weighing Tier 3. Ibeabuchi has three vendor quotes for a cloud-native core of IMS and packet functions, none of which Kolanut has run. Kolanut has no on-call rota for a core. Ihuoma at Lumora Mobile says Lumora would keep carrying the traffic and the radio either way. The board wants a recommendation on how to proceed.

READING
  1. DOC
    CNCF Cloud Native Definition v1.1 Cloud Native Computing Foundation, 2024

    The short, official statement of what cloud-native means: containers, service meshes, microservices, immutable infrastructure and declarative APIs. Read the whole page; it takes two minutes and gives you the words a vendor's slide should be measured against.

  2. DOC
    ETSI GS NFV 002: Network Functions Virtualisation (NFV); Architectural Framework ETSI, 2014

    The source for the VNF, NFVI and MANO blocks and the vocabulary around them. Read the overview of the architectural framework; skip the reference-point tables first time.

  3. DOC
    3GPP TS 23.501: System architecture for the 5G System (5GS) 3GPP

    The source for the principle of stateless functions, the UDSF, AMF regions and sets, and the network function service framework. Use it as a reference; search for UDSF and AMF Set. Read: the architecture principles in clause 4 and the AMF set and region description.

  4. DOC
    3GPP TS 29.510: 5G System; Network function repository services 3GPP

    What the NRF is: registration, heartbeat, discovery and subscription to changes, in the form you read in step 3. Read the NFManagement service section and the NFProfile; skip the rest first time. Read: the Nnrf_NFManagement service and the NFProfile data type.

  5. DOC
    Kubernetes: Deployments The Kubernetes Authors

    How a declared number of copies is kept and updated: replicas, rolling updates, maxUnavailable and maxSurge, and rollback. Read the sections on creating a Deployment and on the rolling update strategy.

  6. DOC
    Kubernetes: Protocols for Services The Kubernetes Authors

    The short page that says which transport protocols a Service supports and what SCTP needs from the plugin and the cloud. Read the SCTP section before you promise anyone a 5G core on a cluster.

  7. POST
    Nokia supports DISH Wireless launch of world's first telco network using 5G Standalone Core on AWS public cloud Nokia, 2022

    A vendor's announcement of a core in a public cloud. Read it as a dated, interested claim and look for what it does not say: failure behaviour, staffing and cost.

  8. DOC
    NCC: License Framework for the Establishment of Mobile Virtual Network Operators in Nigeria Nigerian Communications Commission

    The primary source for what a Tier 2, Tier 3 and Tier 4 virtual operator may own. Read section 4.2 for the tiers; the fees and the application procedure belong to the MVNO Business course.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Operating a network: the operations centre, alarms and change control →