Follow a scenario
Each section below walks one procedure leg by leg, in the order the messages go.
Independent core network laboratory
Four networks with their own 4G and 5G cores, an IMS, borders between them and a software phone — real NAS, Diameter, GTPv2, PFCP, NGAP, SIP and HTTP/2 on every leg, written from the public specifications.
For engineers learning or working on the packet core, roaming and IMS: follow a scenario, open the console and run it, or read the specifications behind it.
An independent laboratory on test network codes (MCC 001) and the published test keys. Not a production network.
The lab in six stops · 5 minutes, narrated · captions available
Start here
Each section below walks one procedure leg by leg, in the order the messages go.
Switch a phone on, roam, call, and read every message the network exchanged.
Every procedure is built from a public 3GPP, IETF or ITU-T document, named below.
What you can check
Network functions talk in encoded NAS, Diameter, GTPv2, PFCP, NGAP, SIP and HTTP/2, not in shortcuts. A wrong byte fails the procedure.
Each message traces to a 3GPP technical specification or an RFC, clause by clause, listed on this page.
Each message of a run shows as a field tree beside its hex dump, and the whole run downloads as a capture file for a packet analyser.
Home, North, South and East each have their own nodes and borders. A roamer's traffic crosses Diameter edges, SEPPs and IMS border controllers.
TS 23.401 — 4G attach
The phone's USIM proves itself, the MME sets up NAS security, checks the handset with the equipment register and builds a data session through the gateways. Each leg is a real message in its own protocol.
NAS Attach Request with the IMSI, the UE's capabilities and a PDN connectivity request.
S6a Authentication-Information: the HSS computes MILENAGE vectors and KASME for the serving network.
EPS AKA: the USIM checks AUTN and its sequence number, answers RES; the MME compares it with XRES.
Security Mode Command under the new NAS keys. The phone answers, ciphered, with its IMEISV.
S13 ME Identity Check: the equipment register permits, tracks or prohibits the handset.
S6a Update-Location, then GTPv2 Create Session over S11 and S5: an address and a default bearer.
TS 23.501, TS 33.501 — 5G roaming
A home subscriber registers in a partner network. Every request between the two networks goes through their SEPPs over N32, and the data session is home-routed through both user planes.
The phone sends a SUCI: its identity encrypted to the home network's key (ECIES profile A).
North's AMF asks the home AUSF over N32: the SEPPs negotiate, then forward each HTTP/2 request.
5G AKA at home: the UDM de-conceals the SUCI, the AUSF confirms RES* and hands back the anchor key.
The home UDM may send a steering list, protected under the AUSF's key, that the phone checks before it trusts it.
A home-routed PDU session: V-SMF and H-SMF over N16, V-UPF and H-UPF over N9, each programmed in PFCP.
TS 23.228, TS 24.229 — IMS
The phone registers in IMS with its USIM, calls another lab phone, and the call is charged. Its audio gets a dedicated bearer, and a call to another network crosses both IMS borders.
SIP REGISTER with IMS AKA; the I-CSCF and S-CSCF ask the HSS over Cx.
INVITE through the S-CSCF; the callee's settings come from the HSS over Sh.
Online charging over Ro: minutes reserved at the answer, reported at the hang-up.
Rx to the PCRF, Gx to the PGW-C, Create Bearer to the MME: a QCI 1 bearer the phone accepts in NAS.
On NR the PCF tells the SMF instead: a 5QI 1 QoS flow through the AMF and the gNB, or EPS fallback to LTE.
Between networks the IBCFs hide topology, screen through the signalling firewall and relay media through the TrGW.
112 goes to the E-CSCF and the lab's answering point, with no registration or credit needed.
TS 32.240, TS 32.298 — Charging
The visited network records a roamer's sessions as it serves them, prices them and sends them home. The home network checks what it is charged, and the two settle.
The visited SGW-C and V-SMF report each roamer's session to their network's charging function, as ASN.1 charging records.
Closed records are gathered into record files (TS 32.297).
A day's records are priced under the partners' tariff and sent to the home network in a transfer file.
The home network checks each file, accepts it or returns it with a fault code, and watches near-real-time records for alarms.
A monthly statement per pair of networks: accepted charges each way and the balance.
TS 23.682, TS 24.301 — Devices
A device asks for power saving in its attach and the network grants what it allows. While it sleeps it hears nothing; the network knows when it will be reachable again.
PSM timers T3324 and T3412 extended, and an eDRX cycle, in the Attach Request.
The MME grants its own values in the Attach Accept and tracks the device's reachability.
LTE-M and NB-IoT attach with their own RAT types in S6a and GTPv2; NB-IoT carries no IMS voice.
A subscription can bar a radio: the HSS refuses it and the MME rejects the attach.
Instruments
Each action in the console leaves a flow: every message every node exchanged, in order.
One line per message, with source, destination and its decoded fields. Open a message and its bytes show as a field tree beside the hex dump; pick a field and its bytes light up. Diameter, GTPv2, PFCP, NAS for 4G and 5G, NGAP, SIP, DNS and HTTP/2 are decoded.
A whole flow downloads as a pcapng file with each message on its real transport and addresses, ready to open in Wireshark. Protected NAS comes with the plaintext the lab deciphered beside it.
A map of the four networks: their nodes, realms and addresses, and the interfaces between them.
Try it
Phones, lines, calls, messages, roaming, borders and every flow are in one console. Accounts are given on request, with access per section.
A software phone with a software USIM: switch on over LTE, 5G or Wi-Fi, in any network, on LTE-M or NB-IoT, with power saving.
Subscribers in the home HSS: identities, numbers, roaming settings and the radios a line may use.
Calls over LTE, 5G and Wi-Fi between lab phones, emergency calls, and SMS.
Partners, the SEPPs and N32, steering of roaming, and what each network accepts from the other.
Diameter edge, IMS border with topology hiding, signalling firewall, and interconnect DNS.
Every message of one action, in order, with a field tree and hex dump, and a capture file to download.
What is running
Grouped by where they sit in the network. Each one is a separate service; the phone and its USIM are software too.
The device side, in software: a handset, its USIM and the base station it registers through.
A software handset with a software USIM: attach, register, roam, call, text, sleep.
The 5G base station, speaking NGAP to the AMF and carrying the phone's NAS inside it.
Each network's EPC, with the home HSS and the equipment register behind it.
Attach, NAS security, the equipment check, power saving and dedicated bearers.
The 4G gateways: sessions, addresses, bearers, and S8 to a roamer's home network.
Subscriptions and keys: MILENAGE vectors for 4G, 5G and IMS, roaming settings, the radios a line may use.
Handset lists checked at every attach: permitted, tracked or prohibited.
The service-based core: network functions that find each other in the NRF and talk HTTP/2.
Registration, SUCI, 5G AKA and NAS security; serves roamers in North.
SMS over NAS for phones on 5G, on SGd to the SMS centre.
PDU sessions and their user-plane rules, home-routed for roamers over N16 and N9.
5G authentication, SUCI de-concealment and subscription data, behind the home SEPP.
Service registry and access tokens for every network function.
Policy for sessions, and the PCRF that gives a call's audio its own bearer.
Online charging of data and minutes.
Voice and text on top of the packet core.
P-, I-, S- and E-CSCF and the application server: registration, calls, services, emergency calls.
Text messages between lab phones: over IMS, or over NAS through the MME or the SMSF.
What a roamer's traffic crosses, and what decides where it may go.
The 5G border: every request between two networks goes over N32.
Routes S6a and S9 between the 4G networks.
IBCF and TrGW: topology hiding, interconnection agreements and media relay between IMS networks.
Screens Diameter and SIP arriving at the borders, and raises alarms.
The root and each network's names: S-NAPTR gateway selection and ENUM.
Which partner a roamer should prefer, sent to the phone protected.
Roamers' charging records, priced, exchanged and settled between partners.
How you see inside all of it.
Phones, lines, calls, roaming, borders, and every flow with its bytes.
Every message of every action, in order, with its octets for a capture file.
Provenance
Each node was written from the published specification. Nothing derives from a proprietary or third-party implementation.
About
The core network is usually something you read about or operate, rarely something you can take apart. This laboratory is a core you can switch on, roam in and break, built on personal time from public documents.
A procedure is not understood until something you wrote makes the other side answer. Everything here exists because reading the specification was not enough.
Next step
Questions on the packet core, roaming and IMS are welcome, as are requests for an account.
or write to aminbakhtvar62@gmail.com