Operating a network: the operations centre, alarms and change control
A network that was built well still fails on a Tuesday. Learn what an operations centre watches, how alarms are tuned and correlated, and why most big outages start with a change
You change one line in core/amf.yaml and restart the lab's AMF with docker compose restart amf. A few seconds later docker compose ps shows the AMF as Up. What do you expect the simulated cell to do, and is the change finished?
A mobile network is built once and operated for twenty years. The people who operate it do not mostly repair broken equipment. They watch for the early sign of a failure, decide who owns it, limit the damage, and make planned changes without causing new failures. This chapter is about that work: what an operations centre sees, how its alarms are tuned, how an incident is run, and how a change is made safely. You write an alarm engine over the lab’s own numbers, and you change the lab core and roll the change back.
What operating a network means
Operations is the set of jobs that keep a network doing what customers pay for. The old management model has five areas, summed up as FCAPS: fault, configuration, accounting, performance and security. Day to day, three of them take most of the hours.
- Fault management receives alarms from equipment, decides which matter, and gets someone working on them.
- Performance management reads counters and quality figures (the KPIs of the quality-of-service chapter) and notices that a cell is getting worse before it fails.
- Configuration and change management controls what is changed in the network, when, by whom, and how to go back.
Accounting is charging, which the earlier charging chapter covers, and security has its own chapter in module 3. The three above are what the people on shift touch every hour.
The work happens in a network operations centre (NOC): a room, or increasingly a set of screens in several places, staffed round the clock. A typical NOC has three layers. The first line watches the alarm list and the dashboards, recognises known problems, follows the runbook and raises tickets. The second line is engineers for a domain (radio, core, transmission, the IT systems) who diagnose what the first line cannot. The third line is the vendors and the designers of the network, who are called when the network behaves in a way nobody has seen. Shifts hand over with a written note, because an incident does not respect the clock.
Busayo leads the overnight shift in Lumora Mobile’s operations centre. Lumora carries 31 million subscribers, and the shift’s job is not to know every function. It is to see that something is wrong within minutes, to know whose it is, and to start the right person.
Alarms, KPIs and tickets are three different things
Three kinds of signal reach a NOC, and mixing them up is a common cause of a noisy, ignored screen.
| Signal | Who produces it | Example | What the shift does with it |
|---|---|---|---|
| Alarm | The equipment or a function reports its own fault | A link is down; a function lost its database; a fan failed | Acknowledge, find the owner, act |
| Threshold on a measure | A rule over counters and KPIs | Data-session success below 95% for three windows | The same, once the rule decides it is real |
| Ticket | A person or a rule asks for work | Customer care reports a trader cannot recharge | Track the work, not the symptom |
An alarm has a severity. The vocabulary most vendors follow comes from the ITU-T X.733 alarm reporting function: critical, major, minor, warning, plus indeterminate and cleared. Critical means a service-affecting fault that needs immediate action, major means service-affecting and urgent, minor a fault that does not yet affect service, and warning a condition that may become one. An alarm also has a lifecycle: it is raised, it may be acknowledged by a person, and it is cleared when the condition goes away. RFC 3877 defines these fields for the Simple Network Management Protocol; the idea is the same in every product.
Severity is about the network. Priority is about the business. A major alarm on a cell serving a handful of phones in the small hours has a lower priority than a minor alarm on the platform that sells recharge on market morning. A NOC needs both words.
Where the lab’s numbers come from
The lab’s 5G core exposes counters and gauges for four functions on port 9090 in the format Prometheus reads. scripts/metrics.sh fetches them from a helper container. A counter only goes up (registrations accepted); a gauge goes up and down (sessions open now). Open5GS’s registration counters are modelled on the 3GPP performance measurements in TS 28.552, the standard to read for what each one counts.
| Question | Function | Metric |
|---|---|---|
| Is a cell attached? | AMF | gnb |
| How many registrations were asked, and accepted? | AMF | fivegs_amffunction_rm_reginitreq, fivegs_amffunction_rm_reginitsucc |
| How many subscribers are registered, per slice? | AMF | fivegs_amffunction_rm_registeredsubnbr |
| How many data sessions exist? | AMF, SMF, UPF | amf_session, fivegs_smffunction_sm_sessionnbr, fivegs_upffunction_upf_sessionnbr |
| How many sessions were asked for, and created? | SMF | fivegs_smffunction_sm_pdusessioncreationreq, …_pdusessioncreationsucc |
| Did the policy function answer? | PCF | fivegs_pcffunction_pa_policysmassoreq, …_policysmassosucc |
| Is the process alive and how big is it? | each | process_resident_memory_bytes (--all only) |
Three properties of these numbers matter to anyone who builds alarms on them.
Counters reset when the process restarts. Restart the AMF and fivegs_amffunction_rm_reginitreq starts again from zero. A rule that compares today’s reading with yesterday’s raw reading sees a huge fall. Production systems compute a rate over a window and treat a drop in a counter as a reset, not as an event.
The same fact is held by several functions. The AMF, the SMF and the UPF each keep a count of data sessions. In a healthy core the three agree. When they do not, the control plane and the user plane disagree about who has a session, which is a fault in its own right and one no single function can report.
metrics.sh hides zeros. Its default view drops every line that ends in 0, so an idle function and a function that is not answering both print an empty section. In the recorded idle core the SMF, UPF and PCF sections are empty. A real alarm engine needs a heartbeat that cannot be zero in a running process, such as process_resident_memory_bytes from scripts/metrics.sh amf --all, and it must treat a missing heartbeat as an alarm. Silence is data.
Thresholds, flapping and noise
A threshold turns a number into a yes or no. Three mistakes recur.
The wrong number. A 95% session success threshold is meaningless on three attempts. The lab’s attach-and-browse trace has one registration, and its 95th percentile equals that one value. A rule needs a minimum sample, and the engine you will write has one. The thresholds in this chapter are illustrative. The lab runs under emulation on a laptop, and its registrations take 0.6 s alone and 5.5 s with fifty phones, so a threshold set from these runs describes the lab, not a network. Real thresholds come from your own busy hour, per cell, with the same rule that the quality chapter taught: a percentile and a unit of reporting you can act on.
Flapping. A measure that hovers near its threshold crosses it again and again. The alarm raises, clears, raises, and the shift learns to ignore it. The fix has two parts. Debouncing requires the breach to persist: raise only after two breaches in three windows. Hysteresis uses different thresholds to raise and to clear: raise below 95%, clear only at 97% or better for three windows. Both cost time. You will measure the cost in the lab.
Alerting on causes. The Prometheus project’s guidance on alerting is to alert on symptoms that a user would feel, and to keep cause-level signals (a disk filling, a replica down) for dashboards and tickets, so that a page always means someone has something to do. A session success rate is a symptom. A function’s memory is a cause, and a good second look once the symptom has fired.
A threshold is also a statement about what you will tolerate, and availability figures give it a price. These are 30-day months, from the arithmetic: minutes in the month times the fraction allowed to fail.
| Availability | Allowed downtime in 30 days |
|---|---|
| 99% | 7.2 hours |
| 99.9% | 43.2 minutes |
| 99.99% | 4.3 minutes |
| 99.999% | 26 seconds |
A maintenance window that takes the registration service down for ten minutes spends a quarter of a month’s allowance at 99.9%. Whether it counts against a target depends on how the agreement defines downtime, so ask for the definition before the number.
Correlation: one cause, many alarms
A fibre cut can raise alarms on every cell behind it, every link, and every service that ran across them. Hundreds of lines on the screen are one fault. An alarm storm buries the line that matters, and the shift spends the first ten minutes working out which line is the parent. Correlation is the work of reducing the storm to one alarm that names the likely cause, and its common forms are:
- By topology. If a parent is down, its children’s alarms are symptoms. Suppress them and show the parent.
- By time. Alarms that begin within seconds of each other and share a location are grouped.
- By rule over measures. Two measures that are healthy and unhealthy in a known pattern name a known problem.
The Prometheus Alertmanager calls the first of these inhibition (a firing alert silences others while it fires) and grouping, and it adds silences, which a person sets to mute an alert for a time, usually during a planned change. A silence with no end time is how a real alarm is lost: every silence needs an owner and an expiry.
The lab gives you a clean example of the third form. traces/fault-1.pcapng shows registrations at 100% and data sessions at 0 of 27. A registration dashboard is green. Two raw alarms could fire (low session success, repeated session refusals with one cause). The correlated rule says one thing: registered, no data, subscribers are attached and have no data, so look beyond the AMF. The shift now starts at the right place.
Cause codes add ownership. In the quality chapter you met cause 11 (“PLMN not allowed”) and cause 91 (“DNN not supported or not subscribed in the slice”), which often point at subscriber data and phone settings. An alarm engine can route them to provisioning and customer care, and reserve the core team’s pager for the failures that nothing in the subscriber’s data explains. The rule has a risk you will meet in the lab’s break step: a cause you class as a provisioning matter can hide a real fault that happens to produce it, so you add a guard that looks at the share of failures and not only at their cause.
Running an incident
An incident is an event that is degrading a service, or will, and needs a coordinated response. It is not the same as an alarm: most alarms never become one. The usual shape is five steps.
- Detect. An alarm, a KPI rule, a test SIM, or a customer reports it. The time from start to detection is the time to detect.
- Triage and declare. Decide how bad it is (the severity of the incident, which is about customers, not about the alarm) and who leads. Declare early: a declared incident that turns out small costs a few minutes; an undeclared one costs the first hour.
- Mitigate. Stop the harm before you understand it. Roll back the last change, move traffic, or switch to a spare. Understanding the cause comes after.
- Restore and verify. Confirm with a customer-like check that the service is back. A cleared alarm is not that confirmation.
- Review. Write a post-incident review that is blameless: it asks what the system, the process and the tools made easy, not who made the mistake. It ends with actions that have owners and dates.
Google’s site reliability engineering book describes the roles that make this work at scale: an incident commander who holds the whole picture and delegates, an operations lead who changes things, and a communications lead who keeps customers and management informed so the engineers can work. In a small NOC one person holds two roles, but the roles are still separate, and the commander does not touch the keyboard.
Two measures summarise a year of this. Mean time to detect says how quickly you notice. Mean time to restore says how quickly you recover. Both hide the tail, as every mean does, so report the median and a high percentile and read the worst incidents one by one.
The Rogers report shows what a missing way in costs. It says staff lacked access to the failed routers’ error logs and could not pinpoint the root cause for about 14 hours, and that Rogers has since separated its management network physically and logically. Mitigation cannot start while engineers cannot see or touch the equipment. Operators answer this with out-of-band management: a separate path to the equipment (a different network, a different provider, sometimes a modem on a console port) that works when the production network does not. Test it as you test a spare: switch the production network off in a drill and see whether you can still get in.
Change control
Most large outages follow a change, because change is the main thing that is different on the day. The regulator’s assessment ties the 2022 Rogers outage to work in a planned upgrade. Change control is the discipline of making changes in a way that limits what a mistake can do.
A change usually belongs to one of three kinds, as in the IT service management practice that telecom operations borrowed.
| Kind | What it is | How it is handled |
|---|---|---|
| Standard | Low-risk, repeated, pre-approved (add a subscriber range; renew a certificate) | Follows a documented procedure, no review each time |
| Normal | Planned, with risk (a software upgrade on the AMF) | A change record, a review, a window |
| Emergency | Needed now to stop an incident | Approved fast, by a named person, written up afterwards |
A normal change needs a change record before it starts. A useful one has these fields, and each answers a question the review will ask.
- What and why. The exact change (file, value, old and new) and the reason.
- Risk and impact. What can go wrong, which customers it touches, and how long the interruption is expected to last.
- The window. A maintenance window is a period agreed for changes, normally when traffic is lowest. A freeze is a period when changes are not allowed, such as a day with a large recharge or event peak. Both are agreed in advance and published.
- Approver and executor. Two different people, so that one can check the other.
- Verification. How you will know it worked, in customer terms: a test SIM registers, opens a session, fetches a page.
- Rollback, with a deadline. The steps to go back, and a time by which, if verification has not passed, you go back without further discussion.
The deadline is the field that is most often left out and most often needed. At 03:00, with a change half working and a manager asking for ten more minutes, the rollback deadline written the day before is the only thing that decides. A change is also better made staged: one cell or one function first, a pause to look at the measures, then the rest. A change that cannot be staged, such as a core upgrade, carries a heavier burden of rehearsal on a lab core of the kind you have been running.
Rollback has its own hazards. A rollback that was never tried may not work. A change that wrote to a database cannot be undone by restoring a file. State the type of rollback, and try it before the window, on the lab if you have nothing better.
Runbooks
A runbook is the written response to a known alarm. It exists so that the first line can act at 03:00 without waking a specialist, and so that the specialist’s knowledge is not in one head. A good runbook is short and has the same parts every time.
- Trigger. The exact alarm or rule that leads here.
- Impact. What customers experience, in their words.
- Confirm. The check that tells a true alarm from a false one: the test SIM, a counter, a command.
- Act. The safe first steps, in order, each with the command and the result to expect.
- Escalate. Who to call if step 4 does not clear it, and what to hand over.
- Roll back and review. What changed recently and how to reverse it.
For the correlated alarm your engine raises in the lab, the runbook for registered, no data confirms with a test SIM that a registration works and a session fails, reads kpi.sh for the refusal cause, compares the AMF, SMF and UPF session counts in metrics.sh, checks the change log for anything touched in the last day, and then escalates to the core team with those four facts attached. It does not guess at a cause. A runbook is a way of gathering evidence in a fixed order, and it is reviewed after every incident that exposed a gap.
What a virtual operator monitors, and who it calls
Kolanut Mobile, in its launch year, has 250,000 subscribers. It owns a brand, agents, recharge and customer care. The radio network, the core, the SIMs, the numbers and the counters are Lumora’s.
The NCC’s virtual operator framework (section 4.2) sets what each tier may own. A Tier 1 Services Virtual Operator has its own brand and distribution and owns no switching, intelligent network or numbers. A Tier 2 operator adds its own SIM and its own equipment register, home location register, authentication centre and home subscriber server. A Tier 3 operator adds core network elements such as the mobility management entity and the packet gateway, and relies on its host for radio accessas of 2026-11. So what a virtual operator can monitor depends on the tier. A Tier 1 operator cannot see a cell. A Tier 2 operator runs a subscriber database and must carry a pager for it. A Tier 3 operator owns part of the core and operates it as you have in this chapter. Which duties fall on the virtual operator and which on the host is set by the licence and the wholesale agreement, which the MVNO (mobile virtual network operator) Business course teaches.
In its launch year, Kolanut watches four things.
- Its own platforms. The recharge system, the SMS centre (the SMSC) and the USSD (Unstructured Supplementary Service Data, the menu-by-code service) application are Kolanut’s, and the alarm rules of this chapter apply to them in full.
- Test SIMs. A few Lumora-provisioned SIMs at fixed places run a scripted check on a schedule: register, open a session, fetch a page, record the time. It is a customer’s view, cheap, and the only network measurement Kolanut can take for itself.
- The host’s reports. The registration and session KPIs cut to Kolanut’s own subscriber range, by cell and by hour, as the quality chapter asked for.
- Customer signals. Complaints, agent calls and the recharge failure rate.
Kunmi runs Kolanut’s operations desk, and her job at 07:00 is to decide whether a trader’s complaint is Kolanut’s problem or Lumora’s, and to hand it over with evidence. The path to the host needs to be agreed before the first incident, and it has these parts.
| Part | What to agree | Illustrative example |
|---|---|---|
| Named contacts | A person and a deputy on each side, with a number that is answered at night | Kunmi and a deputy for Kolanut; Busayo’s shift for Lumora |
| Severity definitions | What counts as severity 1 in customer terms, not equipment terms | S1: data or recharge failing for more than about 5% of Kolanut subscribers |
| Response and update times | How soon Lumora answers and how often it updates during an incident | S1: answer in 15 minutes, update every 30 |
| Evidence to hand over | What Kunmi sends so Busayo’s shift can find it | An IMSI (the subscriber’s identity), a time, a test-SIM result, the cause code |
| Change notice | How far ahead Lumora announces a change, and what it says | A written record with window, impact, rollback deadline |
| After the incident | A review shared with Kolanut within an agreed time | The timeline and the actions that touch Kolanut |
Press reports describe an NCC directive of May 2025 on reporting major network outages by mobile operators: operators must tell consumers the cause, the areas affected and the estimated time to restore, and the NCC runs a public portal for major outages. Reports also mention a week’s public notice for planned outages and compensation after an outage of more than 24 hours, and they differ on some details. I could not read the directive itself, so this chapter gives none of its definitions, thresholds or deadlines. Read the current text before you write an escalation clause that depends on itas of 2026-11. The engineering point does not depend on the rule. Whoever owns the failing part, the customer sees the brand on the SIM, so the evidence in the table above is worth gathering at every tier.
You will turn the lab’s numbers into an alarm engine, watch alarms flap, and then make one controlled change to the live core with a rollback. Work in a folder of your own for your files (the steps call it ~/ops) and run the lab’s commands from labs/telecoms. Every figure in the engine is illustrative. All recorded lab times come from a virtual machine under software emulation, so compare runs with each other and not with a live network.
1. Collect the KPI summaries (any machine with Docker). Make the folder, summarise four recordings with scripts/kpi.sh, and save the fifth, the summary of a recorded run of fifty phones on the live core, as text.
mkdir -p ~/ops
for t in attach-and-browse busy-hour fault-1 wrong-dnn; do
scripts/kpi.sh traces/$t.pcapng > ~/ops/kpi-$t.txt
done
cat > ~/ops/kpi-load-50.txt <<'EOF'
signalling connections: 50 (a phone that goes idle and comes back gets a new one)
registrations: 50/50 = 100.0% accepted, 0 rejected
time to accept: median 5517 ms, 95th percentile 5914 ms, max 6248 ms
data sessions: 50/50 = 100.0% accepted, 0 rejected
time to accept: median 1778 ms, 95th percentile 2270 ms, max 2306 ms
deregistrations: 0
EOF
cat ~/ops/kpi-fault-1.txtFour files from the recordings and one you typed. The last command prints fault-1’s summary:
signalling connections: 1 (a phone that goes idle and comes back gets a new one)
registrations: 1/1 = 100.0% accepted, 0 rejected
time to accept: median 633 ms, 95th percentile 633 ms, max 633 ms
data sessions: 0/27 = 0.0% accepted, 27 rejected
time to accept: -
deregistrations: 1
failures by cause:
27 session reject: 38 network failureThe fifty-phone run comes from the live core’s recorded output: all 50 registered and opened a session, with registration median 5,517 ms against 601 ms for one phone and 1,982 ms for twenty.
2. Write the alarm engine and run it on the KPI summaries (any machine with Python). Save this as ~/ops/alarm.py. It reads kpi.sh text in one mode and metrics.sh text in the other, applies the rules of the chapter (a minimum sample, a cause classed as provisioning, the correlated registered, no data alarm, and silence as an alarm) and exits with 1 when a major or critical alarm is raised.
#!/usr/bin/env python3
"""A small alarm engine over the lab's own numbers.
python3 alarm.py kpi FILE FILE is the output of scripts/kpi.sh
python3 alarm.py metrics FILE FILE is the output of scripts/metrics.sh
Thresholds are illustrative. Tune them against your own busy hour.
Standard library only.
"""
import re
import sys
REG_MIN = 95.0 # registration success, per cent
SESS_MIN = 95.0 # data-session success, per cent
REG_P95_MAX = 3000 # ms, 95th percentile time to register
SESS_P95_MAX = 2000 # ms, 95th percentile time to open a session
MIN_SAMPLE = 5 # fewer attempts than this: a rate is a count, a percentile is noise
PROVISIONING = {"11", "91"} # causes that point at subscriber data, not at the network
def parse_kpi(text):
k = {"reg": (0, 0), "sess": (0, 0), "reg_p95": None, "sess_p95": None, "causes": []}
section = None
for line in text.splitlines():
m = re.match(r"(registrations|data sessions):\s+(\d+)/(\d+) = ", line)
if m:
section = "reg" if m.group(1) == "registrations" else "sess"
k[section] = (int(m.group(2)), int(m.group(3)))
continue
if re.match(r"(registrations|data sessions):", line): # "0 tried, so 0 accepted"
section = "reg" if line.startswith("registrations") else "sess"
continue
m = re.search(r"95th percentile (\d+) ms", line)
if m and section:
k[section + "_p95"] = int(m.group(1))
m = re.match(r"\s+(\d+)\s+(registration reject|session reject|5GMM status): (\d+) ?(.*)", line)
if m:
k["causes"].append((int(m.group(1)), m.group(2), m.group(3), m.group(4)))
return k
def pct(ok, tried):
return 100.0 * ok / tried
def top_cause(causes, kinds):
rows = [c for c in causes if c[1] in kinds]
return max(rows) if rows else None
def kpi_alarms(k):
out = []
reg_ok, reg_tried = k["reg"]
sess_ok, sess_tried = k["sess"]
if reg_tried == 0 and sess_tried == 0:
out.append(("MAJOR", "NO-TRAFFIC", "no registration or session attempts in the window; "
"silence is not a pass, it can mean the network cannot be reached"))
return out
reg_rate = pct(reg_ok, reg_tried) if reg_tried else None
sess_rate = pct(sess_ok, sess_tried) if sess_tried else None
reg_causes = [c for c in k["causes"] if c[1] == "registration reject"]
sess_causes = [c for c in k["causes"] if c[1] in ("session reject", "5GMM status")]
small = lambda n: f" (a sample of {n})" if n < MIN_SAMPLE else ""
registration_bad = reg_tried and reg_rate < REG_MIN
if registration_bad:
all_prov = reg_causes and all(c[2] in PROVISIONING for c in reg_causes)
c = top_cause(reg_causes, ("registration reject",))
why = f"; main cause {c[2]} {c[3]}" if c else ""
if all_prov:
out.append(("INFO", "REG-PROVISIONING",
f"registration success {reg_rate:.1f}%{small(reg_tried)}{why}: every refusal "
"points at subscriber data, so send it to provisioning, not to the core team"))
else:
out.append(("MAJOR", "REG-SUCCESS",
f"registration success {reg_rate:.1f}% ({reg_ok}/{reg_tried}){small(reg_tried)}{why}"))
if sess_tried == 0:
out.append(("INFO", "SESS-UNJUDGED",
"no data session was attempted, so session set-up is unjudged "
"(the registration alarm is the parent)"))
if sess_tried and sess_rate < SESS_MIN:
c = top_cause(sess_causes, ("session reject", "5GMM status"))
why = f"; main cause {c[2]} {c[3]}" if c else ""
reg_fine = reg_tried and reg_rate >= REG_MIN
all_prov = sess_causes and all(c2[2] in PROVISIONING for c2 in sess_causes)
if reg_fine and sess_rate < 50:
sev = "MINOR" if all_prov else "CRITICAL"
out.append((sev, "REGISTERED-NO-DATA",
f"registrations healthy ({reg_rate:.1f}%) but data sessions {sess_rate:.1f}% "
f"({sess_ok}/{sess_tried}){small(sess_tried)}{why}: subscribers are attached "
"and have no data; " + ("check their subscription and phone settings" if all_prov
else "look beyond the AMF")))
else:
out.append(("MAJOR", "SESS-SUCCESS",
f"data-session success {sess_rate:.1f}% ({sess_ok}/{sess_tried}){small(sess_tried)}{why}"))
if reg_tried >= MIN_SAMPLE and k["reg_p95"] and k["reg_p95"] > REG_P95_MAX:
out.append(("WARNING", "REG-SLOW", f"95th-percentile registration {k['reg_p95']} ms > {REG_P95_MAX} ms"))
if sess_tried >= MIN_SAMPLE and k["sess_p95"] and k["sess_p95"] > SESS_P95_MAX:
out.append(("WARNING", "SESS-SLOW", f"95th-percentile session set-up {k['sess_p95']} ms > {SESS_P95_MAX} ms"))
return out
def parse_metrics(text):
"""{(function, metric name): [(labels, value), ...]} from scripts/metrics.sh output."""
data, nf = {}, None
for line in text.splitlines():
m = re.match(r"## (\w+) ", line)
if m:
nf = m.group(1)
continue
m = re.match(r"(\w+)(\{[^}]*\})? ([\d.e+-]+)$", line.strip())
if m and nf:
data.setdefault((nf, m.group(1)), []).append((m.group(2) or "", float(m.group(3))))
return data
def total(data, nf, name):
"""Sum over labelled entries. A row with an empty snssai is the same count again."""
return sum(v for lab, v in data.get((nf, name), []) if 'snssai=""' not in lab)
def metric_alarms(data):
out = []
if total(data, "amf", "gnb") < 1:
out.append(("CRITICAL", "NO-CELL", "the AMF reports no cell attached (or printed nothing at all): "
"phones cannot register, whatever else looks healthy"))
reg_req = total(data, "amf", "fivegs_amffunction_rm_reginitreq")
reg_ok = total(data, "amf", "fivegs_amffunction_rm_reginitsucc")
if reg_req and pct(reg_ok, reg_req) < REG_MIN:
out.append(("MAJOR", "REG-COUNTERS", f"AMF counted {reg_ok:.0f} registrations accepted of {reg_req:.0f} asked "
f"({pct(reg_ok, reg_req):.1f}%)"))
sm_req = total(data, "smf", "fivegs_smffunction_sm_pdusessioncreationreq")
sm_ok = total(data, "smf", "fivegs_smffunction_sm_pdusessioncreationsucc")
if sm_req and pct(sm_ok, sm_req) < SESS_MIN:
out.append(("MAJOR", "SESS-COUNTERS", f"SMF counted {sm_ok:.0f} sessions created of {sm_req:.0f} asked "
f"({pct(sm_ok, sm_req):.1f}%)"))
amf_s = total(data, "amf", "amf_session")
smf_s = total(data, "smf", "fivegs_smffunction_sm_sessionnbr")
upf_s = total(data, "upf", "fivegs_upffunction_upf_sessionnbr")
if len({amf_s, smf_s, upf_s}) > 1:
out.append(("CRITICAL", "STATE-MISMATCH", f"sessions held: AMF {amf_s:.0f}, SMF {smf_s:.0f}, UPF {upf_s:.0f}: "
"the functions disagree about who has a session"))
reg_subs = total(data, "amf", "fivegs_amffunction_rm_registeredsubnbr")
if reg_subs > smf_s:
out.append(("WARNING", "REGISTERED-NO-SESSION", f"{reg_subs:.0f} subscribers registered, "
f"{smf_s:.0f} sessions: {reg_subs - smf_s:.0f} have no data session"))
return out
def main():
if len(sys.argv) != 3 or sys.argv[1] not in ("kpi", "metrics"):
sys.exit(__doc__)
text = open(sys.argv[2]).read()
alarms = kpi_alarms(parse_kpi(text)) if sys.argv[1] == "kpi" else metric_alarms(parse_metrics(text))
for sev, rule, msg in alarms:
print(f"{sev:8} {rule:20} {msg}")
if not alarms:
print("no alarms")
sys.exit(1 if any(a[0] in ("CRITICAL", "MAJOR") for a in alarms) else 0)
if __name__ == "__main__":
main()Run it on each summary:
cd ~/ops
for f in attach-and-browse busy-hour fault-1 wrong-dnn load-50; do
echo "## $f"; python3 alarm.py kpi kpi-$f.txt
done## attach-and-browse
no alarms
## busy-hour
INFO REG-PROVISIONING registration success 90.0%; main cause 11 PLMN not allowed: every refusal points at subscriber data, so send it to provisioning, not to the core team
## fault-1
CRITICAL REGISTERED-NO-DATA registrations healthy (100.0%) but data sessions 0.0% (0/27); main cause 38 network failure: subscribers are attached and have no data; look beyond the AMF
## wrong-dnn
MINOR REGISTERED-NO-DATA registrations healthy (100.0%) but data sessions 0.0% (0/2) (a sample of 2); main cause 91 DNN not supported or not subscribed in the slice: subscribers are attached and have no data; check their subscription and phone settings
## load-50
WARNING REG-SLOW 95th-percentile registration 5914 ms > 3000 ms
WARNING SESS-SLOW 95th-percentile session set-up 2270 ms > 2000 msRead each line against the chapter. attach-and-browse has one registration, so no latency rule is allowed to judge it. busy-hour has two refusals, both cause 11, and is an information line for provisioning, not a page: 90.0% would have failed a plain 95% rule. fault-1 is the correlated alarm, one critical line where a registration dashboard shows 100%. wrong-dnn raises the same rule at minor, because both causes are subscription matters, and the sample of 2 is said aloud. load-50 raises two warnings: nothing failed, but the slow tail is 5.9 s and 2.3 s. A warning is the right severity for a measure that is bad and a service that still works. Your thresholds describe this emulated lab, not a network.
3. Run the metrics rules on recorded counters (any machine with Python). Save the recorded scripts/metrics.sh output from the fifty-phone run (taken 60 seconds after the phones started) and from the idle core, then run the engine on both. Then make an edited copy that nobody recorded, and run it again.
cd ~/ops
cat > metrics-load-50.txt <<'EOF'
## amf (10.33.0.5:9090)
gnb 1
fivegs_amffunction_mm_confupdate 50
fivegs_amffunction_rm_reginitreq 50
fivegs_amffunction_rm_reginitsucc 50
amf_session 50
fivegs_amffunction_amf_authreq 50
ran_ue 50
fivegs_amffunction_rm_registeredsubnbr{plmnid="99970",snssai="1"} 50
## smf (10.33.0.4:9090)
ues_active 50
bearers_active 50
fivegs_smffunction_sm_sessionnbr{plmnid="99970",snssai="1"} 50
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="",snssai=""} 50
fivegs_smffunction_sm_pdusessioncreationreq{plmnid="99970",snssai="1"} 50
fivegs_smffunction_sm_pdusessioncreationsucc{plmnid="99970",snssai="1"} 50
fivegs_smffunction_sm_qos_flow_nbr{plmnid="99970",snssai="1",fiveqi="9"} 50
## upf (10.33.0.7:9090)
fivegs_upffunction_sm_n4sessionestabreq 50
fivegs_upffunction_upf_sessionnbr 50
fivegs_upffunction_upf_qosflows{dnn="internet"} 50
## pcf (10.33.0.13:9090)
fivegs_pcffunction_pa_policyamassoreq{plmnid="99970",snssai="1"} 50
fivegs_pcffunction_pa_policyamassosucc{plmnid="99970",snssai="1"} 50
fivegs_pcffunction_pa_policysmassoreq{plmnid="99970",snssai="1"} 50
fivegs_pcffunction_pa_policysmassosucc{plmnid="99970",snssai="1"} 50
fivegs_pcffunction_pa_sessionnbr{plmnid="99970",snssai="1"} 50
EOF
cat > metrics-idle.txt <<'EOF'
## amf (10.33.0.5:9090)
gnb 1
## smf (10.33.0.4:9090)
## upf (10.33.0.7:9090)
## pcf (10.33.0.13:9090)
EOF
echo "## recorded, 50 phones"; python3 alarm.py metrics metrics-load-50.txt
echo "## recorded, idle"; python3 alarm.py metrics metrics-idle.txt
# EDITED, not recorded: the UPF reports 31 sessions where the other two report 50
sed 's/^fivegs_upffunction_upf_sessionnbr 50/fivegs_upffunction_upf_sessionnbr 31/' metrics-load-50.txt > metrics-edited.txt
echo "## edited: UPF holds 31"; python3 alarm.py metrics metrics-edited.txt
# EDITED, not recorded: the line that says a cell is attached is removed
grep -v '^gnb ' metrics-load-50.txt > metrics-nocell.txt
echo "## edited: no cell"; python3 alarm.py metrics metrics-nocell.txt## recorded, 50 phones
no alarms
## recorded, idle
no alarms
## edited: UPF holds 31
CRITICAL STATE-MISMATCH sessions held: AMF 50, SMF 50, UPF 31: the functions disagree about who has a session
## edited: no cell
CRITICAL NO-CELL the AMF reports no cell attached (or printed nothing at all): phones cannot register, whatever else looks healthyEvery function in the recorded run counted 50, so the three session counts agree and nothing fires. The metrics-load-50.txt file has two pdusessioncreationreq rows, one with empty labels, which the engine ignores so that it does not count the same 50 twice. In the idle core only the AMF prints a line, and the SMF, UPF and PCF sections are empty because metrics.sh hides zero values. That is why the engine cannot tell an idle function from a dead one, and why a heartbeat is needed. The two edited files are made-up cases to show each rule fire; they are not recordings of a fault.
4. Watch an alarm flap, then debounce it (any machine with Python). Save this as ~/ops/flap.py. The series is a made-up evening of data-session success in 15-minute windows from 18:00.
#!/usr/bin/env python3
"""Why alarms flap, and what debouncing costs. The series is illustrative."""
LIMIT = 95.0 # raise when success falls below this, per cent
CLEAR_AT = 97.0 # a debounced alarm clears only at or above this ...
CLEAR_RUN = 3 # ... for this many windows in a row
RAISE_OF = (2, 3) # a debounced alarm raises when 2 of the last 3 windows breach
# Data-session success per 15-minute window from 18:00 (illustrative numbers)
series = [99.1, 98.7, 94.8, 95.3, 94.6, 95.2, 94.9, 96.0, 98.8, 99.0, 99.2, 94.2, 99.0, 99.1, 99.3, 99.0]
def clock(i):
minutes = 18 * 60 + 15 * i
return f"{minutes // 60:02d}:{minutes % 60:02d}"
def naive(values):
"""Raise on any breach, clear on any good window."""
events, active = [], False
for i, v in enumerate(values):
if v < LIMIT and not active:
active = True
events.append((clock(i), "RAISE"))
elif v >= LIMIT and active:
active = False
events.append((clock(i), "CLEAR"))
return events
def debounced(values):
"""Raise on 2 breaches in the last 3 windows; clear after 3 windows at 97 or better."""
events, active, good_run = [], False, 0
for i, v in enumerate(values):
recent = values[max(0, i - RAISE_OF[1] + 1): i + 1]
breaches = sum(1 for x in recent if x < LIMIT)
if not active and breaches >= RAISE_OF[0]:
active, good_run = True, 0
events.append((clock(i), "RAISE"))
elif active:
good_run = good_run + 1 if v >= CLEAR_AT else 0
if good_run >= CLEAR_RUN:
active = False
events.append((clock(i), "CLEAR"))
return events
for name, fn in (("naive", naive), ("debounced", debounced)):
ev = fn(series)
raises = sum(1 for _, e in ev if e == "RAISE")
print(f"{name:10} {raises} raises: " + ", ".join(f"{t} {e}" for t, e in ev))python3 ~/ops/flap.pynaive 4 raises: 18:30 RAISE, 18:45 CLEAR, 19:00 RAISE, 19:15 CLEAR, 19:30 RAISE, 19:45 CLEAR, 20:45 RAISE, 21:00 CLEAR
debounced 1 raises: 19:00 RAISE, 20:30 CLEARThe naive rule pages four times in one evening for what is one slow patch and one lone dip at 20:45. The debounced rule pages once, at 19:00, and ignores the 20:45 dip because one breach in three windows is not enough. The price is visible too: the first alarm arrives at 19:00, thirty minutes after the naive rule’s 18:30. A real NOC chooses that delay on purpose, per alarm: a short one for something that stops sales, a long one for a warning.
5. Read the live core and record a baseline (needs the live core). Start the lab and the phone as in the lab’s README, provision the subscriber, and read the counters with the engine you wrote. Do this before you change anything: it is the baseline that the change will be compared with.
cd labs/telecoms
docker compose up -d
scripts/subscriber.sh add 999700000000001 465B5CE8B199B49FAA5F0A2EE238A6BC E8ED289DEBA952E4283B54E88E6183CA 2340000000001
docker compose --profile phone up -d ue
sleep 30
scripts/metrics.sh > ~/ops/metrics-before.txt
python3 ~/ops/alarm.py metrics ~/ops/metrics-before.txt
docker compose exec ue nr-cli imsi-999700000000001 --exec "timers" | grep T3512With no phone registered, the recorded idle output is the four section headers and gnb 1 under the AMF, and the engine prints no alarms. With the phone registered, expect the AMF to show gnb 1 and one registration and one session in the counters, the engine to print no alarms, and the phone’s timer line in the form recorded in the lab: T3512: rem[506] int[540]. The rem value is a count down and changes with every read; int[540] is the periodic registration timer in seconds, from t3512 in core/amf.yaml. With one phone, the recorded counters (2026-11-13) read 1 everywhere they should: AMF ran_ue 1, amf_session 1 and fivegs_amffunction_rm_reginitsucc 1; SMF ues_active 1 and fivegs_smffunction_sm_sessionnbr{plmnid="99970",snssai="1"} 1; UPF fivegs_upffunction_upf_sessionnbr 1; PCF fivegs_pcffunction_pa_sessionnbr{plmnid="99970",snssai="1"} 1. The AMF, SMF and UPF session counts agree, so the engine prints no alarms.
6. Make one controlled change and roll it back (needs the live core). The change is to the periodic registration timer: t3512 in core/amf.yaml, from 540 s to 1800 s. Write the change record first. Then make the change, verify it as a customer would, and roll it back before the deadline you wrote.
cd labs/telecoms
cat > ~/ops/change-001.txt <<'EOF'
Change 001: AMF periodic registration timer (t3512) from 540 s to 1800 s
Why: practise the change procedure; no service reason
Risk: AMF restart. The lab cell does not reconnect by itself, so every phone
loses registration until the cell and the phone are restarted
Window: now (lab); in a real network, the agreed low-traffic window
Approver / executor: you / you (a real change has two people)
Verify: cell attached (NG Setup successful); phone registers; session opens;
curl through uesimtun0 returns the lab page; phone shows T3512 int[1800]
Rollback: copy ~/ops/amf.yaml.before back to core/amf.yaml; restart amf, gnb, ue
Deadline: if verification has not passed 10 minutes after the AMF restart, roll back
EOF
cp core/amf.yaml ~/ops/amf.yaml.before
date +%TOpen core/amf.yaml in an editor and change value: 540 under t3512: to value: 1800. Then check your change is only what you meant, apply it, and look at what happens to the cell:
diff ~/ops/amf.yaml.before core/amf.yaml
docker compose restart amf
sleep 20
docker compose ps amf
scripts/metrics.sh > ~/ops/metrics-after-amf.txt
python3 ~/ops/alarm.py metrics ~/ops/metrics-after-amf.txt
docker compose logs --no-log-prefix --tail 5 gnbThe diff is the single line you intended:
54c54
< value: 540
---
> value: 1800docker compose ps amf shows the AMF as Up: the process is running. The service is not. In the recorded run (2026-11-13) the AMF’s metrics block was empty, with no gnb line, and the engine said so:
CRITICAL NO-CELL the AMF reports no cell attached (or printed nothing at all): phones cannot register, whatever else looks healthyThe cell’s log ends with the association it lost:
[sctp] [warning] Unhandled SCTP notification received
[ngap] [error] Association terminated for AMF[2]
[ngap] [debug] Removing AMF context[2]UERANSIM 3.2.6’s gNB does not reconnect to a restarted AMF (the README’s quirk), so no phone can register until the cell is restarted. A process that is up and a service that is down: this is why the engine checks for the cell and not only for the process. Write down what you see and how long the AMF took to come up.
Finish the change the way a customer would use it:
docker compose restart gnb
sleep 10
docker compose logs --no-log-prefix gnb | grep "NG Setup"
docker compose restart ue
sleep 30
docker compose logs --no-log-prefix ue | grep -E "Registration is successful|TUN interface"
docker compose exec ue curl --interface uesimtun0 http://10.34.0.80/
docker compose exec ue nr-cli imsi-999700000000001 --exec "timers" | grep T3512
scripts/metrics.sh > ~/ops/metrics-after.txt
python3 ~/ops/alarm.py metrics ~/ops/metrics-after.txt
date +%TThe gNB log shows NG Setup procedure is successful again (the first start logged it after NG Setup Response received). The phone logs Initial Registration is successful and TUN interface[uesimtun0, 10.45.0.2] is up (the address may differ by one after a restart). curl prints Hello from the data network. Your packets came through the UPF. The timer line now reads int[1800] in place of int[540]; the recorded run showed T3512: rem[1783] int[1800]. If it still reads 540, the phone did not register against the new AMF, and the change is not verified. The counters restarted from zero with the AMF, so fivegs_amffunction_rm_reginitreq counts only the registrations since the restart: this is the counter reset the chapter described. Compare the two date lines with the 10-minute deadline in your record. The timer line and the registration lines were recorded on 2026-11-13; the Hello line and the NG Setup line are from the lab’s other recorded runs.
Now roll back, and verify the rollback as you verified the change:
cp ~/ops/amf.yaml.before core/amf.yaml
diff ~/ops/amf.yaml.before core/amf.yaml && echo "rolled back: file identical"
docker compose restart amf
sleep 20
docker compose restart gnb
sleep 10
docker compose restart ue
sleep 30
docker compose exec ue nr-cli imsi-999700000000001 --exec "timers" | grep T3512
docker compose exec ue curl --interface uesimtun0 http://10.34.0.80/rolled back: file identical, then the phone registers again, the timer line reads int[540] with its own rem count (recorded: T3512: rem[524] int[540]) and curl prints the lab page. A rollback is verified the same way as a change: a file that is back is not a service that is back.
Break the rule that saves you pages. In ~/ops/alarm.py change PROVISIONING = {"11", "91"} to PROVISIONING = set() and rerun step 2 on busy-hour and wrong-dnn. The information line for busy-hour becomes MAJOR REG-SUCCESS ... 90.0% (18/20) and the minor line for wrong-dnn becomes CRITICAL REGISTERED-NO-DATA: the core team is now paged for two phones nobody provisioned and for a phone asking for a data network the lab does not serve. That is the noise the classification removed. Restore the line, then argue the opposite risk: a real fault that produces cause 11 would be filed under provisioning and nobody would be paged. Add a guard to kpi_alarms that raises a major alarm when provisioning causes account for more than half of all registration attempts in a window, and say what window and what share you would defend. Then run the engine on fault-3, fault-4 and fault-5 and list what each rule says; do not diagnose them here. Which extra evidence would the runbook for each have to gather before the core team is woken?
Kunmi at Kolanut Mobile, in its launch year, gets a change notice from Lumora five days ahead: a software upgrade of the core's access function on Sunday between 01:00 and 04:00, with an expected interruption of about ten minutes. Kolanut's traders recharge heavily from 04:30 on market mornings, and Kolanut has no say in Lumora's change calendar. The notice gives no rollback plan and no word on verification. What does Kunmi send back?
- DOC Assessment of Rogers Networks for Resiliency and Reliability Following the 8 July 2022 Outage Xona Partners for the CRTC, 2023
A regulator-commissioned reading of a real change-triggered outage, including the finding that staff lacked access to the failed equipment's logs for about 14 hours. Read the executive summary and the findings on root cause and on access to network equipment; skip the redacted sections. Read: the executive summary and the root cause and equipment access findings.
- BOOK Managing Incidents, in Site Reliability Engineering Google SRE authors (ed. Betsy Beyer et al.), 2016
The incident roles and the habit of declaring early, from a team that runs very large systems. It is about software services, and the roles carry over to a NOC unchanged. Read the roles and the worked examples. Read: the sections on incident command roles and on the worked examples.
- BOOK Postmortem Culture: Learning from Failure, in Site Reliability Engineering Google SRE authors (ed. Betsy Beyer et al.), 2016
What a blameless review asks and how to decide in advance which incidents get one. Read the principles and the example structure; skip the tooling. Read: the sections on blameless postmortems and on when to write one.
- DOC RFC 3877: Alarm Management Information Base (MIB) S. Chisholm and D. Romascanu (IETF), 2004
The alarm fields (severity, raised and cleared times, state) that equipment reports, with their link to the ITU-T X.733 severity values. Read the overview and the severity definitions; skip the object tables. Read: the overview and the alarm model sections.
- DOC 3GPP TS 28.552: Management and orchestration; 5G performance measurements 3GPP
The standard's definitions of the registration and session counters that the lab's metrics follow in name. Read the measurements for the AMF and SMF and compare their wording with what the lab prints. Clause numbers change between releases. Read: the AMF and SMF measurement clauses.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.