Project: trace one subscriber's morning through the network
Turn one recorded capture into a timeline of procedures, functions, states and seconds, and explain it in a paragraph a customer-care lead can use
This project is the last chapter of module 1. You use everything in it: the parts of a mobile network, the SIM and its authentication, the three services, the generations, and who owns what. The input is one recording, traces/morning.pcapng. The output is one file, morning.md, with a timeline and a paragraph Lekan can read to Damola.
The story laid over the trace
Damola’s phone is switched on at 06:30. He checks the day’s prices on a web page. The screen goes dark and the network releases the phone to idle. Something wakes it a few seconds later and he checks the page again. At the end of the morning the phone is switched off.
The trace is a lab recording of exactly that order of events, made with the lab’s simulated phone, cell and 5G core. Three things about it are not the story, and you say so in your write-up:
- The clock. “06:30” is a label. The capture’s own time is seconds from its start, and the gaps (the idle period is about five seconds) are the pauses in the script that recorded it, not a live network’s behaviour. The first signalling message is at 8.935 s; treat that as 06:30:00 if you want clock times.
- The release. The script told the cell to release the phone (
ue-release 1). A live network does it itself after a period without traffic, which is a setting the operator chooses. - The wake-up. The phone sends the Service request itself. No message arrives from outside and nobody pages the phone. You will check that in the trace. A real wake-up by a call, a text or a downlink packet starts with a paging message from the network. The lab has no calls or texts (Open5GS has no IMS and no SMS function), so the trace cannot show one.
The network is the lab’s test network, code 999/70, not Lumora’s. The story gives the lab’s functions a real owner so that you can answer the ownership question. Kolanut and Lumora are the chapter’s cast; the lab is nameless.
What you build
One file, morning.md, with four parts.
- A timeline table: one row per procedure. Columns: procedure, start and end (seconds from the capture’s start), duration, functions that took part, the phone’s RM and CM state at the end, and who runs those functions.
- A state strip: the RM and CM states from switch-on to switch-off, in one line each.
- An ownership note: for each function in the table, Lumora or Kolanut at Tier 1, and at Tier 2.
- One paragraph for Lekan: at most 120 words, no acronyms he has not been given, saying what “the network” did and what he should tell Damola.
The facts you need are in the trace. The rules for the write-up:
- Every number in the table is read from the capture with a command in the lab, not guessed.
- Every state is one of four: RM-DEREGISTERED, RM-REGISTERED, CM-IDLE, CM-CONNECTED. RM (registration management) is whether the network has the phone on its books. CM (connection management) is whether a signalling connection to the AMF exists at this moment. The phone is RM-REGISTERED and CM-IDLE while it sleeps: known, but not connected. These are defined in 3GPP TS 23.501, clause 5.3.
- Say which steps you could not see (the radio link between the phone and the cell is a UDP stand-in, so you see its messages but not radio behaviour).
Who owns what
The licence tiers come from the Nigerian Communications Commission (NCC) framework for virtual operators. A Tier 1 operator (Services Virtual Operator) has its own brand, sales and distribution, and may run an SMSC, but has no switching or intelligent network and no control of numberingas of 2026-11. A Tier 2 operator (Simple Facilities Virtual Operator) adds the right to own and issue its SIM and to own and operate its equipment register, home location register, authentication centre and home subscriber server, but has no core switching or interconnect and relies on the host’s number rangesas of 2026-11. No virtual operator owns spectrumas of 2026-11, so the cell is never Kolanut’s at any tier. The framework dates from 2022, and the NCC published revised business rules for virtual operators in May 2026as of 2026-11, so check the current text before relying on any tier boundary.
The framework names the 2G to 4G boxes: the HLR, HSS and authentication centre. The lab is 5G, so you map them yourself, using what you learned in the generations chapter: the HLR and HSS become the UDM and UDR, and the authentication centre becomes the AUSF together with the UDM’s key handling. That mapping is this course’s reading of the framework, not the framework’s wording. Where the mapping matters (a Tier 2 operator’s own 5G core), the licence is the authority, and Kolanut would confirm it with the NCC before relying on it.
Where the clock comes from
The ladder script prints every message with its time in seconds from the start of the capture. A procedure is a run of messages with a start and an end, and you decide where to cut. Use these cuts, which are the ones the self-check uses:
| Procedure | Starts at | Ends at |
|---|---|---|
| Registration | the Registration request | the Registration accept sent to the cell |
| Data session | the PDU session establishment request | the last PFCP Session Modification Response of that procedure |
| Release to idle | the UEContextReleaseRequest | the UEContextReleaseComplete |
| Service request | the Service request | the Service accept sent to the cell |
| Deregistration | the Deregistration request | the final UEContextReleaseComplete |
Some procedures run into each other: the phone sends its PDU session request in the same network packet as Registration complete (two NGAP messages, one frame), so the data session begins there. A good write-up says so rather than hiding the overlap.
Steps 1 to 7 use only the recorded trace and work on any machine with Docker, including one without SCTP. Step 8 needs the live core. All commands run from labs/telecoms. The first time you run scripts/ladder.sh Docker pulls the nicolaka/netshoot:v0.13 image.
1. Read the whole morning once.
scripts/ladder.sh traces/morning.pcapng | tee ladder.txt | wc -l
head -8 ladder.txt67 lines, then the first eight, starting with the Registration request:
8.935 gNB -> AMF NGAP/NAS-5GS InitialUEMessage, Registration request
8.987 AMF -> AUSF* HTTP2 POST /nausf-auth/v1/ue-authentications
9.039 AUSF -> UDM* HTTP2 POST /nudm-ueau/v1/suci-0-999-70-0000-0-0-0000000001/security-information/generate-auth-data
9.123 UDM -> UDR* HTTP2 GET /nudr-dr/v1/subscription-data/imsi-999700000000001/authentication-data/authentication-subscription
9.302 AMF -> gNB NGAP/NAS-5GS DownlinkNASTransport, Authentication request
9.324 gNB -> AMF NGAP/NAS-5GS UplinkNASTransport, Authentication response
9.340 AUSF -> UDM* HTTP2 POST /nudm-ueau/v1/imsi-999700000000001/auth-events
9.458 AMF -> gNB NGAP/NAS-5GS DownlinkNASTransport, Security mode commandThe first column is seconds from the start of the capture. A * after a function means the request travelled via the SCP, the proxy that every function-to-function request in this lab goes through, so the SCP is in every SBI row and you leave it out of the “functions that took part” column. The gaps you can see already: 9.039 to 9.302 is the authentication vector being fetched (three functions in a row), not the phone thinking.
2. Cut the capture into five procedures. Print only the rows that mark the edges.
scripts/ladder.sh traces/morning.pcapng --filter 'nas-5gs.mm.message_type == 0x41 || nas-5gs.mm.message_type == 0x42 || nas-5gs.mm.message_type == 0x4c || nas-5gs.mm.message_type == 0x4e || nas-5gs.mm.message_type == 0x45 || ngap.procedureCode == 41 || ngap.procedureCode == 42'The edges, with times that do not vary between runs of the same trace:
8.935 gNB -> AMF NGAP/NAS-5GS InitialUEMessage, Registration request
9.474 gNB -> AMF NGAP/NAS-5GS/NAS-5GS UplinkNASTransport, Security mode complete, Registration request
9.784 AMF -> gNB NGAP/NAS-5GS InitialContextSetupRequest, Registration accept
31.039 gNB -> AMF NGAP UEContextReleaseRequest
31.080 AMF -> gNB NGAP UEContextReleaseCommand
31.086 gNB -> AMF NGAP UEContextReleaseComplete
36.027 gNB -> AMF NGAP/NAS-5GS/NAS-5GS InitialUEMessage, Service request, Service request
36.052 AMF -> gNB NGAP/NAS-5GS InitialContextSetupRequest, Service accept
46.628 gNB -> AMF NGAP/NAS-5GS UplinkNASTransport, Deregistration request (UE originating)
46.886 AMF -> gNB NGAP UEContextReleaseCommand
46.890 gNB -> AMF NGAP UEContextReleaseCompleteColumn spacing is wider in the real output. The row at 9.474 is not a second registration: the phone repeats its Registration request inside the Security mode complete, as the standard requires, so ignore it. The Service request shows twice because the message is carried both outside and inside the NAS container; it is one message. Registration, release, service and deregistration are now bounded. The data session starts inside the Registration complete at 9.996 and ends at 10.425; step 3 finds that edge.
3. Find the data session’s edges. Print every message between 9.9 s and 10.5 s.
awk '$1 >= 9.9 && $1 <= 10.5' ladder.txtUplinkNASTransport, Registration complete, UplinkNASTransport, UL NAS transport, PDU session establishment request). Then the SMF asks the UDM and the PCF, and the PCF asks the UDR and the BSF; the SMF and UPF exchange PFCP Session Establishment Request and Response at 10.283 and 10.316; the SMF sends the PDU session establishment accept via the AMF (10.358 to the cell); and the last row of the procedure is PFCP Session Modification Response at 10.425, when the UPF has the cell’s tunnel address and the phone can send data.4. Compute the durations. Take each procedure’s start and end from steps 2 and 3 and subtract. Write them into your table, then check with this one-liner, which reads the same times from ladder.txt:
awk '$1==8.935||$1==9.784||$1==9.996||$1==10.425||$1==31.039||$1==31.086||$1==36.027||$1==36.052||$1==46.628||$1==46.890 {print $1, $5, $6}' ladder.txt5. Name the functions in each procedure. Count the SBI requests and list the functions in each window.
for w in "8 9.99 registration" "9.99 10.5 data-session" "31 32 release" "36 37 service-request" "46 47 deregistration"; do
set -- $w
echo "== $3"
awk -v a=$1 -v b=$2 '$1>=a && $1<b && /(GET|POST|PATCH|DELETE) \/n/ {n++} END {print n+0, "SBI requests"}' ladder.txt
awk -v a=$1 -v b=$2 '$1>=a && $1<b {x=$2; y=$4; gsub(/\*/,"",y); if(x!="phone")print x; print y}' ladder.txt | sort -u | tr '\n' ' '; echo
done== registration
12 SBI requests
AMF AUSF PCF UDM UDR gNB
== data-session
8 SBI requests
AMF BSF PCF SMF UDM UDR UPF gNB
== release
1 SBI requests
AMF SMF UPF gNB
== service-request
2 SBI requests
AMF SMF UPF gNB
== deregistration
10 SBI requests
AMF AUSF BSF PCF SMF UDM UDR UPF gNBThe registration window ends at 9.99 s, so Registration complete is left to the data session. Every request also goes through the SCP, which you leave out. The release and the service request are short and touch four functions; registration and deregistration touch the subscriber data. That is the difference between telling the network who you are and telling it you are back.
6. Read the phone’s state from the trace. The state is not a field in any message, so you infer it from the messages and confirm two of them with tshark. First, the phone’s identity after registration, and then the Service request.
docker run --rm -v "$PWD/traces:/t:ro" nicolaka/netshoot:v0.13 \
tshark -r /t/morning.pcapng -o nas-5gs.null_decipher:TRUE -d tcp.port==7777,http2 \
-Y 'nas-5gs.mm.message_type == 0x42 || nas-5gs.mm.message_type == 0x4c' -V 2>/dev/null \
| grep -E "Message type|5G-TMSI|Service type|RRCEstablishmentCause" | sort -uThe Registration accept hands the phone a 5G-GUTI (a temporary identity) whose 5G-TMSI is 3221226893 (0xc000058d); the Service request carries the same 5G-TMSI, with Service type: Data (1) and an RRC establishment cause of mo-Data (mobile originated data). The same temporary identity before and after idle is how the AMF recognises the phone without asking for the SIM identity again. The TMSI changes from one recording to the next; in your own live run it will be different. The grep prints those lines and a few neighbours, indented, in sorted order rather than time order.
Now confirm there was no paging:
scripts/ladder.sh traces/morning.pcapng --filter 'ngap.procedureCode == 24' | wc -l0: no Paging message in the capture. Write that into your write-up as the reason the return from idle is a phone-initiated Service request.
From these messages you can fill the state strip. RM-DEREGISTERED and CM-IDLE before 8.935; CM-CONNECTED from the first NGAP message, RM-REGISTERED from the Registration accept at 9.784; CM-IDLE (still RM-REGISTERED) from 31.086; CM-CONNECTED again from the Service accept at 36.052; RM-DEREGISTERED and CM-IDLE after 46.890. The live phone reports the same names, for example rm-state: RM-REGISTERED and cm-state: CM-CONNECTED from nr-cli, in step 8.
7. Fill in ownership, then write morning.md. Use the rules above. A minimal skeleton to copy:
# Damola's morning, trace of 999/70 lab network
| Procedure | Start-end (s) | Duration | Functions | RM/CM after | Run by (Tier 1) | Run by (Tier 2) |
|---|---|---|---|---|---|---|
| Registration | 8.935-9.784 | 0.849 s | gNB, AMF, AUSF, UDM, UDR, PCF | RM-REGISTERED, CM-CONNECTED | Lumora | ... |
| ... | | | | | | |
States: RM ... / CM ...
For Lekan: (at most 120 words)The one-paragraph explanation says, in this order: the phone proved who it was (authentication) and was given a data session in about a second and a half; the network then let it sleep and woke it again in a fraction of a second when the phone had data to send; every step ran on Lumora’s functions; and what Kolanut could and could not see. Use words such as “the network checked the SIM” and “the phone went to sleep”, not “5G-AKA” or “UEContextRelease”.
morning.md whose table matches the self-check. The Tier 1 column reads Lumora for every row: a Tier 1 operator has no switching or intelligent network and no control of numberingas of 2026-11, and no virtual operator owns the cell. In the Tier 2 column, the functions that do subscriber data and authentication (UDM, UDR and AUSF) read Kolanut; the AMF, SMF, UPF, PCF, BSF and the cell stay Lumora’s, because a Tier 2 operator has no core switching or interconnectas of 2026-11. Your paragraph names a procedure, a number and an owner.8. Optional, with the live core: record your own morning. This needs a kernel with SCTP. Start the lab and give it the subscriber, then repeat the script that made the reference trace, with your own capture name.
docker compose up -d ; sleep 30
scripts/subscriber.sh add 999700000000001 465B5CE8B199B49FAA5F0A2EE238A6BC E8ED289DEBA952E4283B54E88E6183CA 2340000000001
scripts/capture.sh start mine
docker compose --profile phone up -d ue ; sleep 12
docker compose exec -T ue curl -s --interface uesimtun0 http://10.34.0.80/
sleep 3
G=$(docker compose exec -T gnb nr-cli -d | head -1)
docker compose exec -T gnb nr-cli "$G" --exec "ue-release 1"
sleep 8
docker compose exec -T ue curl -s --interface uesimtun0 http://10.34.0.80/
sleep 3
docker compose exec -T ue nr-cli imsi-999700000000001 --exec "deregister switch-off"
sleep 4
scripts/capture.sh stop
scripts/ladder.sh captures/mine.pcapng | head -3curl prints Hello from the data network. Your packets came through the UPF. The ladder has the same shape as the reference trace: the same procedures in the same order, with the same functions. Your times differ: the capture’s zero is whenever you pressed start, and each procedure takes a different time on your machine. The reference runs were 0.6 s (the attach-and-browse trace), 0.849 s (morning) and about 0.75 s (the phone’s own log in the lab’s recorded run: 01:10:21.093 to 01:10:21.838) from Registration request to Registration accept, so expect the same order of magnitude. The TMSI, the NF instance identifiers and the ping times are different every run. While the phone is attached, docker compose exec ue nr-cli imsi-999700000000001 --exec status shows rm-state: RM-REGISTERED and cm-state: CM-CONNECTED. Run it again after the release and look for cm-state to change to the idle value while rm-state stays RM-REGISTERED. Redo steps 2 to 7 on your own capture.Self-check
Compare your table with these values from traces/morning.pcapng, taken from the ladder. Allow 0.001 s for rounding; a live recording will differ.
| Procedure | Start | End | Duration | Functions (SCP not counted) | SBI requests | RM / CM after |
|---|---|---|---|---|---|---|
| Registration | 8.935 | 9.784 | 0.849 s | gNB, AMF, AUSF, UDM, UDR, PCF | 12 | RM-REGISTERED / CM-CONNECTED |
| Data session | 9.996 | 10.425 | 0.429 s | gNB, AMF, SMF, UDM, UDR, PCF, BSF, UPF | 8 | RM-REGISTERED / CM-CONNECTED |
| Release to idle | 31.039 | 31.086 | 0.047 s | gNB, AMF, SMF, UPF | 1 | RM-REGISTERED / CM-IDLE |
| Service request | 36.027 | 36.052 | 0.025 s | gNB, AMF, SMF, UPF | 2 | RM-REGISTERED / CM-CONNECTED |
| Deregistration | 46.628 | 46.890 | 0.262 s | gNB, AMF, SMF, UPF, AUSF, UDM, UDR, PCF, BSF | 10 | RM-DEREGISTERED / CM-IDLE |
Other numbers to check: switch-on to a working data session, 1.490 s; time spent idle, 4.941 s (31.086 to 36.027); first page from the internet side, GET at 23.734 and 200 OK at 23.755 (0.021 s); second page, GET at 41.343 and 200 OK at 41.347 (0.004 s). The data session’s PDU session establishment accept gives the phone 10.45.0.2, a session limit (AMBR) of 100,000 Kbps down and 50,000 Kbps up, and 5QI 9. The Service accept at 36.052 is 25 ms after the request: the phone’s data session already existed, so the network only had to reconnect it. Compare it with registration’s 0.849 s: coming back from idle skips authentication and the subscriber-data lookups.
Break it: move Kolanut up a tier and recount. In your ownership column, change every UDM, UDR and AUSF cell from Lumora to Kolanut (Tier 2) and count how many of the registration’s 12 SBI requests are now served by a function Kolanut runs. The answer is 11 of 12: only the AMF’s policy request to the PCF is Lumora’s. The claim in your paragraph that “every step ran on Lumora’s functions” is now false for Tier 2, and so is the habit of sending every slow-registration ticket to the host. Rewrite the paragraph for a Tier 2 Lekan. Then check what the trace cannot tell you: the cell’s radio is Lumora’s at every tier, so a dropped call on a weak signal stays Lumora’s problem, however far up Kolanut moves.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.