Artificial Intelligence & Data Science is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

GSM location management and HLR/VLR restoration

GSM location management keeps track of where a mobile is (HLR/VLR, LAI, IMSI/TMSI) and describes procedures and recovery steps when HLR or VLR fail so service and billing continue correctly.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Mobile networks must know where each subscriber is so calls, SMS and data can be routed and billing can be applied. Engineers use GSM location management and HLR/VLR restoration procedures when designing, operating or troubleshooting base network elements to ensure service continuity after failures.

Key ideas

Start from first principles and definitions: define each term before using it.

  • Subscriber Identity — the permanent identifier assigned to a SIM. In GSM this is the IMSI (International Mobile Subscriber Identity). Define it: a decimal number that uniquely identifies a subscriber. Use IMSI when authenticating and for HLR records.
  • Temporary Identity — to protect subscriber privacy on the radio interface, the network issues a TMSI (Temporary Mobile Subscriber Identity). It maps to an IMSI inside a VLR and is used on air interface paging and signalling instead of IMSI.
  • Location Area (LA) and Location Area Identity (LAI) — a group of base stations where the network treats the MS as “local” without requiring a location update when moving inside the LA. LAI = (MCC, MNC, LAC) where MCC = Mobile Country Code, MNC = Mobile Network Code, LAC = Location Area Code.
  • HLR (Home Location Register) — the central database for subscriber subscription data and their last known location (pointer to VLR/MSC). It stores static data (service profile, IMSI, MSISDN) and dynamic data (current VLR address, supplementary services status). State exactly: HLR holds a mapping IMSI -> VLR/MSC address (set to 'IMSI detached' or not reachable when the MS is not attached) and the subscription profile.
  • VLR (Visitor Location Register) — a database associated with an MSC that temporarily stores subscriber data while the subscriber is present in that MSC’s area. It maps IMSI <-> TMSI and keeps short-term data and location information (current LAI).
  • MSC (Mobile Switching Centre) — the switching node that routes voice/SMS; it works with the VLR for subscriber mobility.
  • BSS (Base Station Subsystem), BTS (Base Transceiver Station) and BSC (Base Station Controller) — the radio access components. The MSC/VLR connects to BSC/BTS for signalling and voice channels.

Core GSM location-management procedures (exact stepwise definitions and assumptions):

  1. Location Update (LU) — when a mobile moves into a new LA or powers on it performs a location update. Exact steps to draw in an exam diagram:

    • Draw five boxes left to right: MS, BTS, BSC, MSC/VLR, HLR.
    • Label arrows for signalling: "Location Updating Request" (MS -> MSC/VLR via BSS), "UpdateLocation (MAP)" (MSC/VLR -> HLR), "InsertSubscriberData" or response messages back. Include authentication and IMSI/TMSI exchange.
    • The MSC/VLR sends UpdateLocation to HLR with IMSI and new VLR address. HLR may send CancelLocation to the old VLR (if any), then sends InsertSubscriberData to the new VLR; after InsertSubscriberData is acknowledged, HLR returns UpdateLocationAck to the VLR.
    • The VLR stores profile and assigns TMSI to the MS. Assumptions: air interface security/authentication may be performed before storing profile (A3/A8 algorithms) but the core location protocol is MAP UpdateLocation. The MSC/VLR typically obtains authentication triplets from the HLR/AuC via MAP SendAuthenticationInfo. Periodic LUs (timer T3212) may also trigger updates.
  2. Paging — when a call or SMS arrives for a subscriber, the HLR is consulted (or the originating MSC uses stored VLR pointer) and paging messages are sent within the LA listed in the VLR to locate the MS.

  3. Cancel/Purge/Delete — when a subscriber moves to a new VLR or service is withdrawn, the HLR sends CancelLocation to the old VLR to remove the subscriber; conversely, when a VLR deletes a subscriber (e.g., timer expiry, detach), it informs the HLR with PurgeMS.

HLR/VLR restoration: define problem and goals.

  • Failure modes: crash of a single VLR, crash of MSC/VLR process, distributed VLR cluster fail, HLR crash or corruption. Goal: restore correct subscriber location pointers and subscriber profiles so calling/billing resume with no permanent loss of data.

General restoration principles (exact steps universities expect):

  • For a crashed VLR: when it restarts, it has lost transient TMSI-to-IMSI mappings. Two approaches:

    1. Forced location updates by MSs on next attach/power-on or when crossing LAs. The VLR can mark all TMSIs as unknown and, upon the next signalling from each MS, issue an Identity Request and/or reject with cause 'IMSI unknown in HLR' to force a normal LU; operators may also use BSSMAP RESET and rely on periodic LU (T3212). This is practical but disruptive.
    2. HLR-assisted restoration: the restarted VLR sends a MAP Reset toward the HLR to indicate VLR data loss; the HLR then re-sends InsertSubscriberData for subscribers whose HLR pointer still references that VLR. If the VLR persisted a list of IMSIs, it should initiate UpdateLocation (VLR->HLR) for each to repopulate both sides.
  • For a crashed HLR: HLR stores the definitive profile and location pointers. On crash the HLR must restore from backup and reconcile with VLRs. Typical restoration steps (state them exactly):

    1. Restore HLR database from the most recent persistent backup (file system snapshot or DB dump).
    2. Replay transaction logs from the last checkpoint to recover changes until the crash time (standard DB recovery). If logs are missing, HLR must obtain updates from VLRs.
    3. For each VLR that may hold subscribers, ask the VLRs (via O&M or by MAP Reset from the VLR side) to trigger normal UpdateLocation transactions toward the HLR as mobiles attach/perform periodic LU; the HLR will then send InsertSubscriberData and rebuild the IMSI -> VLR mapping. Alternatively, the HLR can send CancelLocation to VLRs to clear stale data and force mobiles to reattach; PurgeMS is sent by VLRs to HLR, not vice versa.
    4. Resolve inconsistencies: if two VLRs claim the same IMSI, HLR must apply a policy (last-update-wins or ask VLRs to purge or force LU). This must be documented and is operator-specific.

Diagrams to draw for restoration: draw a central HLR box and multiple VLR boxes; show arrows labelled "InsertSubscriberData", "UpdateLocation", "CancelLocation/PurgeMS", and indicate backup/restore file on HLR. Label which messages rebuild which parts of the HLR table.

Assumptions and limitations: exact message names and order depend on vendor. HLR–VLR MAP operations used are typically UpdateLocation, CancelLocation (HLR->VLR), PurgeMS (VLR->HLR), InsertSubscriberData, SendAuthenticationInfo, and Reset (to indicate database loss; directions vendor/phase dependent). Authentication and billing records (CDRs) are separate from location records and must be synchronized by operator procedures.

Formulas

M_update = N_subscribers × m — where M_update is the number of MAP UpdateLocation messages required to repopulate a VLR or HLR after restart; N_subscribers is number of affected subscribers (unitless), m is the count of UpdateLocation messages per subscriber: 2 if you count request+result as two messages, or 1 if you count one MAP transaction; this is independent of InsertSubscriberData. Applies when each subscriber triggers one location update.

T_downtime_recover ≈ T_restore_backup + T_replay_logs + (N_vlr × T_per_vlr_reconcile) — approximate recovery time, where T_restore_backup is time to reload database (s), T_replay_logs is log replay time (s), N_vlr is number of VLRs to reconcile (unitless), T_per_vlr_reconcile is average time to reconcile per VLR (s). Units: seconds. This is an engineering estimate, not a strict law.

S_signalling = N_calls × p_page — signalling load from paging where N_calls is number of incoming calls for affected subscribers and p_page is average number of paging messages per call (unitless). Used to assess extra signalling during mass reattaches.

Worked examples

Example 1 — Signalling count after VLR restart (numerical): Given: VLR served N = 10,000 subscribers. When VLR restarts, operator requires each subscriber to perform a LU which sends one UpdateLocation to HLR and HLR replies with one response. So m = 2 MAP messages per subscriber (UpdateLocation + UpdateLocationAck). Steps:

  1. Formula: M_update = N × m.
  2. Substitute: M_update = 10000 × 2.
  3. Compute: M_update = 20000 MAP messages total. Answer: 20000 MAP messages.

Example 2 — Message sequence for a normal location update (trace): Situation: MS moves into new LA and performs LU. Trace steps to write in answer:

  1. MS -> BTS/BSC: Location Updating Request (include IMSI or TMSI and LAI)
  2. BSC -> MSC/VLR: Forward request
  3. MSC/VLR -> HLR: UpdateLocation (MAP) with IMSI and new VLR address
  4. HLR updates pointer, sends InsertSubscriberData to the new VLR and, after it is acknowledged, returns UpdateLocationAck to the VLR
  5. MSC/VLR stores profile, assigns new TMSI, and sends Location Updating Accept/Complete back to MS via BSS. (Write arrows on diagram and label each message and content: include TMSI, IMSI, LAI.)

Example 3 — HLR crash recovery (algorithmic model answer): Question: Describe how operator restores HLR after crash to resume call routing. Model answer (stepwise):

  1. Mount last consistent HLR backup and restore database files.
  2. Replay transaction logs to reach state at crash time; if logs incomplete, proceed to step 3.
  3. Query each MSC/VLR via MAP InsertSubscriberData or send explicit queries: "which IMSIs do you serve?" VLRs respond with lists.
  4. For each IMSI answer, HLR sets VLR pointer and requests current subscriber profile from VLR (to populate dynamic fields).
  5. HLR resolves conflicts if multiple VLRs claim the same IMSI (policy: choose latest timestamp or force purge on others).
  6. Once mapping rebuilt, HLR resumes routing. Notify billing and OSS systems and run consistency checks.

Common mistakes

  • Ignoring authentication: LU involves authentication steps (A3/A8) but students sometimes omit them or claim they are optional.
  • Assuming HLR updates automatically after crash without explicit reconciliation: in practice operator action or MAP messages are needed.
  • Counting messages wrongly: forgetting replies, or double-counting paging messages across multiple LAs.

For your exam

Typical question types:

  • Definitions: Define HLR, VLR, LAI, IMSI, TMSI and state their roles.
  • Short notes: Describe UpdateLocation and Paging procedures with a signalling diagram.
  • Derivations: Show how to compute signalling load for a mass reattach and give formulas; explain recovery time estimate.
  • Long answers: Explain HLR crash recovery step-by-step and the MAP messages used.
  • Diagrams: Draw HLR, multiple VLRs, MSC, BSC, BTS and label UpdateLocation, InsertSubscriberData, CancelLocation. Full-marks answers include precise definitions, a correct ordered list of messages, a neat labelled diagram, assumptions stated (e.g., whether TMSI persisted), and operator actions for restoration.

Quick check

  1. What does the HLR store that the VLR does not?
  2. Name two MAP messages used when a VLR restarts to repopulate HLR.
  3. If 5,000 subscribers each send one UpdateLocation and receive one reply, how many MAP messages are exchanged?
    Answers: HLR stores permanent subscription profiles and IMSI -> VLR pointer; MAP messages: UpdateLocation and Reset (also CancelLocation from HLR to old VLR; PurgeMS from VLR to HLR); 10000 messages (5000×2).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?