hlr lookup

What is the HLR lookup – VLR lookup – MCC MNC lookup? 

An HLR lookup of a mobile number returns the status, roaming and mobile operator details. The roaming information includes the roaming network identifier, and operator information is derived from IMSI.

The mobile number is the digits of an MSISDN or Mobile Station International Subscriber Directory Number.

The result of successful mobile number lookup has static information (IMSI) and dynamic information (visiting MSC). We can use IMSI  and MSISDN, to provide number portability (MNP) information. If IMSI and MSISDN belong to the same mobile operator, the number is not ported else it is ported.

Visiting MSC provides the approx location of a subscriber. Roaming information has a visiting country code and mobile operator code.

Network Elements for HLR lookup:

BTS (2G): Base Transceiver Station is equipment or node in the GSM network, having an antenna for wireless connection with the mobile devices. BTS is the first node contacted when a mobile phone switched on. A cell is an area covered by a BTS. A BTS may cover multiple cells.

BSC(2G):  Base Station Controler, controls the BTS and allocates the radio resources for a Mobile device. The handovers between cells are controlled by a BSC. The connection between BTS and BSC is a wired connection. A single BSC controls multiple BTS.

MSC in Telecom: Mobile Switching Center,  is the node that connects a wireless network to the rest of the PSTN. It holds the location, does billing and does handovers between BSCs. An MSC implements roaming/ messaging and the call control protocol.

VLR: Visitor Location Register, is the database in the roaming network. Which is mostly co-located with an MSC. It maintains location and other services in the roaming network. When a subscriber moves to other VLR, HLR removes the subscriber information from the previous VLR, by sending cancel location.

HLR: Home Location Register, is the database in-home (HPLMN) network of a mobile operator which controls the subscription of a mobile sim card. When a person gets a new sim card, the card is provisioned in HLR. The primary key for a subscriber in the database is IMSI and MSISDN. The dynamic information is updated in HLR, when a sim card moves from one location to another or on device switched on. The home network gets updates for visiting VLR/MSC. If a subscriber is allowed to roam, HLR sends subscriber data to VLR.

RNC(3G): Radio Network controller, is a node between MSC and access antenna. RNC node standardized in the 3G  network.

NodeB: NodeB is in 3G. It has similar functionalities as BTS in the 2G network.

HLR lookup result:

When HLR returns success in the result of an HLR lookup query for an MSISDN, the result contains the following. 

  • IMSI of subscriber
  • Visiting MSC
  • MCC and MNC of roaming network.
  • Subscriber Status (Success/Failure).
  • Number Portability Information Can be derived by looking at IMSI and MSISDN.
  • Name of the mobile operator the current number belongs to.

When the result is a failure:

  • Subscriber has not configured for SMS Teleservice.
  • Subscriber is not attached.
  • Query Timeout.
  • SMS service is barred.
  • Protocol Level errors or provider errors.

Mobile Number Portability:

Mobile number portability is the process of changing mobile operator without changing the mobile number. In many places (e.g. India) there are roaming charges with in-country as well. So when someone locates from one place to another within the same country can do MNP within the same operator just to avoid roaming charges.  A new sim card is issued by the new mobile operator, SMS for number portability request is sent to the original mobile operator. This process generally takes 2 to 3 days. The old sim card gets deactivated, and new ones get active.

Every country has an MNP database (DB). The DB is accessible to all mobile operators. When an application initiates the HLR lookup query, the MNP DB lookup is performed to get the serving HLR for the MSISDN.

Call Flow for phone number lookup :

The ss7/sigtran is the communication protocol between  HLR and an HLR lookup node or a lookup gateway. The lookup node initiates a GMS MAP 09.02 operation (SRI-SM) towards the HLR. The map operation has MSISDN as a key parameter. When SRI-SM reaches to the HLR, the MSISDN lookup is performed in the database, if a subscriber is configured and mobile phone is active or attached, IMSI and MSC number sends back to the lookup node in SRI-SM Response. The lookup node may be connected to all operators (according to coverage) directly or via an aggregator for ss7/sigtran connections. The node in the ss7 network is identified by global title (digits ) and point code. Both are allocated by standard GSM bodies. Every mobile operator is given a range of global title and IMSI range.

hlr lookup call flow
HLR lookup call flow

Mobile phone attached procedure:

When a mobile phone switches on it does the following procedures to access the mobile network.

  • Authentication, the mobile device sends SendAuthenticationInformation operation over the SS7  network from VLR to HLR. If a subscriber is configured on HLR. The authentication information response is sent to VLR. The key is the IMSI in the authentication request.
  • Update Location,  After successful authentication, VLR sends the update location operation over SS7. Update location has IMSI, VLR and MSC as key parameters. HLR sends the subscription data (TeleService, GPRS data, Call Forwarding, Call Barring.  etc.) to the VLR for providing allowed services to the mobile user. After a successful location update, HLR updates the roaming VLR and MSC numbers in the local database. The roaming MSC number is sent back to the lookup node, in the HLR lookup response.

Benefits from lookup:

  • Least Cost Routing:  As a result of lookup, the bulk SMS service provider gets the location information (visiting country and visiting network). A low-cost route or network connection provider can be chosen for sending SMS to the mobile subscriber.
  • Marketing database cleanup:  While sending SMS to a mobile, the subscriber may be not present permanently. To send this subscriber message, again and again, incur a cost, and there is no outcome for a business. HLR lookup service provides status code for a subscriber if the lookup fails. If an error is a permanent failure (e.g. Unknown Subscriber), the database can be cleaned for this subscriber.
  • Billed the correct mobile operator, from the lookup result, the mobile number portability information can be obtained. A lookup service provider can send CDRs for billing to the correct mobile operator.
  • Save cost by using a more cleaned, accurate mobile number database. A lookup service use can save cost. There are organizations, e.g. Colleges or Universities, do very regular messaging to thousands of alumni members. Lookup services clean the database for inactive numbers. The lookup saves thousands of dollars.
  • Real-Time Information, HLR Lookup, provides real-time information for a roaming subscriber, this enables the service user to plan advertisements according to the roaming places.
  • Used by VoIP providers, A VoIP provider, e.g. Skype, can make a lookup before terminating call to the roaming device. The information collected can be used to set up a low-cost call route.
  • Get if a number is mobile or landline. There are different formats for landline and mobile numbers in some countries. But in many, the format is the same. By just looking at digits can not say if a number is mobile or landline. Sending a text to landline number has no use. HLR lookup provides information if a number belongs to mobile or landline.

Location-based content marketing, These days, content marketing is vital and effective. Advertisers want to reach people who are close to the business premises. HLR lookup returns the current location of a mobile user. Content provider uses location information to advertise product effectively.   

HLR Lookup service provider:

Companies are providing HLR lookup services.  The lookup service can be access via API or from a Web interface. The service provider exposes HLR lookup APIs. The lookup service runs on a web domain or public IP. A service user can access a lookup server over the internet.  To initiate a  lookup API from software to the service platform. First, an account on the server should be created for a service user.

The service platform checks the details of a user, using the HLR lookup API, if a user is allowed to use the service, the provider does an HLR lookup on the ss7 network, and sends the result back to the service user.  Some times an SDK is provided to the user for easy to develop lookup service applications.

Cell Id lookup:

The SMS service user always tries to get more and more accurate location for a mobile phone. A simple HLR lookup provides the information for the roaming country and roaming area. The roaming area might be 20 kilometres wide. Which gives some idea for promoting location-based contents, but still not so useful when content marketing is based on just nearby location. E.g. sending restaurant information which is just 500 meters away from a mobile user. For that, a new parameter called cell id might be helpful.

Cell Id lookup maybe provides an additional parameter in the HLR lookup result. Cell id gives more accurate location information. On receiving cell id lookup, HLR has to perform a cell id get operation with the VLR.  VLR returns the LAC (location area code) and Cell (ID) along with MCC and MNC. The service provider can drive approx location coordinates from cell id and other parameters.

Cell Id lookup call flow:

SS7 MAP level,  the lookup nodes send the ATI or Any Time Interrogation  GSM MAP 09:02 operation to the HLR. HLR sends the PSI or Provide subscriber Info, to the VLR. On success, the VLR sends the cell id in the response of PSI, the cell id information, is relayed to the lookup node in ATI response.

What is IMSI Lookup?

IMSI lookup is the process of getting IMSI using a mobile number. IMSI provides full information about the mobile operator and subscriber.  The next step for a lookup service provider should have access to the MCC and MNC database.  One can offer IMSI lookup service by using an HLR lookup service and access to the MCC and MNC database.

HLR lookup service selection:

Once you have decided that you need the lookup service.  There are many HLR lookup services providers, whom to choose? The following are the parameters that help you to decide to choose a service provider.

Coverage :

The most important thing is the coverage. E.g. if you want to provide your services to the Indian mobile users. But an HLR lookup provider does not have coverage in India, then do not choose this vendor.

Now have coverage in India, next check if all mobile operators are covered within India, if no then check for other service providers.

Delivery Report :

The delivery report is very important for the end-user. Check if the service provider conveys the correct error code in the lookup APIs response.  This helps you to design your business logic more accurately.

Sigtran and HLR lookup:

Sigtran is ss7 signalling over IP. Before the Sigtran, there was only ss7 link (E1 /T1)  were available for HLR lookup. Links were deployed by the MNO to connect its infrastructure or premises. A service provider needs to put the box at the mobile network operator (MNO) premises for the service. This causes us to deploy at least one box for each MNO.   Cause to much expense and results in costly service.  With Sigtran, a service provider can set its HLR lookup box in his office and can connect to multiple MNOs from the same box.  This reduces the time and money.  Sigtran uses SCTP protocol over IP.

VLR Lookup:

At the start, we have discussed what is VLR in telecom.  Here we will discuss the VLR lookup.  VLR lookup returns the roaming information.  The roaming information is useful for routing ss7 signalling in an optimization way. There are VLR lookup providers for the service. There are APIs that take input as MSISDN and return VLR information.


MCC MNC lookup:

In the above, we have mentioned that the HLR lookup returns the IMSI and roaming information.  From the result, MCC and MNC can be derived.  Service providers use Mcc Mnc lookup for number portability. For example, if a number has been ported. The service provider will use MCC and MNC to send the message to the correct HLR.  In the case of MNP MCC MNC lookup can also be performed from an MNP database.


1 thought on “hlr lookup”

Leave a Comment