What is the HLR lookup and VLR lookup – Lookup for MCC MNC?
The HLR lookup means, to sends a request with a mobile number to the serving HLR, to get the subscriber details.
The lookup returns the status, roaming, and mobile operator information. The roaming details include the roaming network identifiers (MCC, MNC), status can be Active or Inactive and operator information is IMSI.
A mobile number is the sequence of digits of an MSISDN or Mobile Station International Subscriber Directory Number.
The successful result of a mobile number lookup has static information (IMSI) and dynamic information (visiting MSC). We can use IMSI and MSISDN together, to drive number portability (MNP) status.
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, as the MSC number has a country code and an Area code or the location.
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 Controller, 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 a 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 parameters:
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/gateway. The originator 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 the destination, the MSISDN lookup is performed in the database, if a subscriber is configured and mobile phone is active/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.
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 a 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 costs. 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 a 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 a landline number has no use. HLR lookup provides information if a number belongs to a 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. Sometimes 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 kilometers 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.
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 too 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.
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.
What is MCC MNC lookup?
In the above, we have mentioned that the outcome of a lookup. From the result, MCC and MNC can be derived. Service providers use this information for number portability. For example, if a number has been ported. The service provider will use MCC and MNC to get the currently serving HLR global title.
Another option to get the serving HLR is the MNP database. The mobile operators connect to the portability ( MNP DB) database and get theHLR global title from a mobile number. The MCC and MNC lookup is useful for a service user who does not have access to the MNP DB.