← Home ・ Blog

How Carriers Assign Numbers to SIM Cards (HLR/VLR Basics)

Updated:

Phone numbers don’t live “inside” your SIM. They live in a carrier’s databases. This article walks through the life of a number?from national allocation to the exact records in the HLR/HSS (home database) and VLR/MME/AMF (visited/serving node) that make your device reachable for calls and SMS across 2G/3G/4G/5G. Want to confirm what number your device is actually presenting? Try the quick check on our homepage: send an SMS to our gateway and we’ll show the sender MSISDN on the web.

Identifiers 101: ICCID, IMSI, MSISDN?Different Keys, Different Jobs

Three identifiers matter most:

The SIM may include an optional EFmsisdn file, but many operators leave it empty or outdated. Operationally, the binding of “this IMSI uses that MSISDN” is held in the HLR/HSS/UDM, not on the plastic.

From Numbering Plans to Your Line: Allocation → Assignment

Regulators assign E.164 number ranges to operators. Operators subdivide them into internal pools (e.g., postpaid, prepaid, M2M, VIP, quarantine) with policies for cool-off and recycling. When you activate:

  1. The operator selects an available MSISDN from its pool subject to rate plan and geography.
  2. That MSISDN is associated with your subscriber record (IMSI, services, barrings) in the HLR/HSS/UDM.
  3. Optional: write the number into EFmsisdn (not required and often skipped).

In eSIM, SM-DP+ delivers the profile (ICCID/IMSI/keys) to the device. Number assignment remains a core-network operation.

What the HLR/HSS/UDM Actually Stores

At minimum:

In LTE/5G, the HLR evolves into HSS (Diameter) and then UDM (Service-Based Architecture), but the role?“source of truth” for your subscription?remains.

VLR/MME/AMF: Where You Are Right Now

When your device powers on and registers, the network creates a temporary context in a serving node:

The HLR/HSS/UDM updates this pointer during Location Update/Attach/Registration. That pointer is exactly how the network knows where to route a call or SMS.

Attach/Registration Flow (Condensed, 2G→5G)

  1. UE selects a PLMN and sends an Attach/Registration request with its IMSI or a temporary ID (TMSI/GUTI/5G-GUTI).
  2. The serving node (MSC/VLR, MME, or AMF) requests authentication vectors from HLR/HSS/AUSF.
  3. Upon success, HLR/HSS/UDM performs Insert Subscriber Data to the serving node and records the UE’s current location.
  4. Data bearers are set up (PDP/EPS PDU/5G PDU). IMS registration (for VoLTE/VoNR/SMSoIP) occurs via P-CSCF/S-CSCF.

Incoming Calls: How the Network Finds You

A call hits the operator’s gateway (GMSC or IMS I-BCF). The gateway asks the HLR/HSS for routing:

If you’ve roamed, the HLR still knows your current MSC/VLR or IMS registration and returns a route there.

Incoming SMS: SRI-SM, SGs, or IP-SM-GW

SMSC queries HLR/HSS with SendRoutingInfoForSM. Depending on access:

This indirection is why SMS may still arrive when you’re camped on LTE-only or VoWiFi.

MNP (Porting): Keeping the Number, Moving the Home

With Mobile Number Portability, your MSISDN moves to a new operator. The industry uses “All Call Query” or onward-routing databases so that calls/SMS resolve the current HLR/HSS owning your number. Internally, the new operator creates a subscriber record and points the MNP database to it. Old SIM/IMSI authentication no longer works.

MVNO vs MNO: Who Owns the Databases?

In both models, assignment is a database operation; SIM files are just credentials.

Edge Cases Power Users Notice

Practical Checks & Self-Diagnostics

On many networks you can:

Glossary

References (Standards & Specs)

Related Reading

  1. What Is MSISDN? The Hidden Number Behind Your SIM
  2. How to Check Your SIM Card Number (ICCID, IMSI, MSISDN)
  3. The Science of SMS Routing: Why Some Messages Take 30 Seconds
  4. Why Your Phone Sometimes Shows “Unknown Number”

Related: What Is MSISDN?

Also see our main homepage for the SMS number check tool.

About This Service

This site offers a simple verification tool: you send a one-time code by SMS to a number we provide, and we display?on this website?the phone number that sent it. That helps confirm the MSISDN bound to your SIM/eSIM, which is invaluable when devices or carriers hide it in settings.