User Location Information is optional in many GTPv2-C messages, but when it is present it is not a free-form blob. The first octet is a set of flags. Each flag that is set promises a fixed-length location field after it. If the Information Element is shorter than those flags announce, a decoder that only checks "the IE parsed" will silently drop the tail — or worse, read the next IE as if it were still ULI.
This article is about that length-versus-flags check, added to Mobile Core's session tracker in 1.19.4, and about the other GTPv2-C IEs the same pass now measures. An earlier article covers generating GTPv2-C captures without a live core. Keep any live replay on an authorized, isolated lab network. Never point these tools at a production or third-party system.
What TS 29.274 §8.21 actually requires
TS 29.274 §8.21 defines ULI (IE type 86) as a flags octet followed by the location identities the flags select. The lengths the Mobile Core analyser uses are:
| Field | Octets when the flag is set |
|---|---|
| CGI | 7 |
| SAI | 7 |
| RAI | 7 |
| TAI | 5 |
| ECGI | 7 |
| LAI | 5 |
| Macro eNodeB ID | 6 |
| Extended Macro eNodeB ID | 6 |
The analyser walks the flags in that order. If the remaining length runs out before a promised field ends, it raises a uli_truncated violation and names the missing part. A typical detail looks like this:
User Location Information (instance 0): 10 octets, flags 0x18 announce TAI+ECGI; missing ECGI (4 of 7 octets)
Flags 0x18 are TAI and ECGI. TAI needs 5 octets, ECGI needs 7, plus the flags octet is 13 octets in total. A 10-octet IE has room for TAI and only three octets of ECGI. The reference on the violation is TS 29.274 §8.21.
When the IE is complete, session details show the decoded location as uli, for example TAI 001-01 TAC 0x0001; ECGI 001-01 ECI 0x1234567 (in session_details and in the sessions JSON).
Other IEs shorter than their content
The same 1.19.4 pass reports ie_truncated for the other IEs the analyser reads, including inside a Bearer Context or a PDN Connection grouped IE:
- an F-TEID shorter than its IPv4/IPv6 flags (TS 29.274 §8.22);
- a PDN Address Allocation shorter than its PDN type (§8.14);
- an empty IMSI, Recovery or EPS Bearer ID;
- a Cause under 2 octets;
- an IE whose length runs past the end of the message or of its grouped IE (§8.2).
These are distinct kinds. A short ULI is uli_truncated; a short F-TEID or PAA is ie_truncated. Both carry a 3GPP clause in the ref field of the violations report.
Generate a truncated ULI on purpose
The edge-cases scenario includes optional-ie-truncated: the ULI is cut to its mandatory part so the flags no longer match the length. You can request that case alone, or all of the edge cases, from Tools > Scenario from sessions, from the CLI, or (Full Edition, with confirmation) from the MCP tool generate_scenario:
gtpcore run-scenario -scenario edge-cases -input s.json -output edge.pcap -set edge_cases=optional-ie-truncated
gtpcore sessions -input edge.pcap
Since 1.19.4 that edge case shows up as a real uli_truncated violation, not as a silent decode. scenario_catalog lists the toggle, the 3GPP clause, and where to see it (sessions_list, session_details, violations, ie_query). Search with search=ULI if you are driving the catalog from an assistant.
The browser Community edition can generate the same PCAP. GTP Sessions is not in the web UI, so download the file and analyse it on the desktop, or with gtpcore sessions.
A practical workflow
- Generate a compact LTE capture with
optional-ie-truncated, or open a capture you already have. - Run
gtpcore sessions -input FILE -json sessions.json -violations-csv violations.csv, or open Tools > GTP Sessions and look at Violation kinds. - Filter on
uli_truncatedorie_truncated. Read the detail: it should name the IE, the instance, the declared length, the flags or type, and the missing part. - Confirm the decoded
ulion sessions whose ULI was complete, so you know the good path as well as the failing one. - If you are testing your own decoder, compare its output with the sessions JSON rather than with a tool that stops at "ULI present".
Community Edition reports the first 100 sessions in detail; later sessions are counted but not expanded. That cap is the same in the CLI, the GUI and the MCP reading tools.
Editions
Mobile Core Generator has a Community Edition, free for non-commercial evaluation, learning and compact lab scenarios (up to 100 subscribers/sessions, with send-to-network capped at 1000 packets/s). The Full Edition is a one-time $89 license. It removes those limits and adds response matching (probe) and a conformance suite with HTML/JSON reports. The current release is 1.19.4. It runs on Windows 10/11 64-bit, and a Linux build is available upon request. Session tracking in Community reports the first 100 sessions in detail.
Explore Mobile Core Generator →
FAQ
Is a truncated ULI the same as a missing ULI?
No. A missing ULI is simply absent. uli_truncated means the IE is there, but it is shorter than the location fields its flags announce.
Will Wireshark already show this?
Wireshark decodes ULI and may mark a malformed IE, depending on version. The session tracker adds a per-session violation with a clause, a missing-field name, and a decoded uli on the complete cases, in the same report as the rest of the GTPv2/PFCP session.
Does this cover PFCP User Location?
No. The 1.19.4 length checks described here are for GTPv2-C IEs (TS 29.274). PFCP User ID and F-TEID allocation are a separate article.
Can Community Edition generate the edge case?
Yes, from the GUI or gtpcore run-scenario, within the 100 subscribers/sessions cap. Generating the same file through the MCP tool generate_scenario is a Full Edition writing tool and needs a confirmation step.