What is APN in telecom for 3G and 4G?
What is APN in telecom?
An operator needs to set up a gateway network node in its HPLMN to provide internet services to its subscribers. For a 3G network, it’s known as GGSN; for 4G, it’s PGW. Whenever a mobile subscriber needs to access the internet from any corner of the world, it must connect to the carrier’s gateway to set up a logical tunnel between the internet and the sim card.
APN is a string that represents the address of the gateway. It is similar to a website URL. An URL translates to the webserver and APN to the GGSN/PGW IP address. In this tutorial, we will learn about the format, subscription, configuration settings, and other details about the Access Point Name.
Similar to SMSC Number. The SMSC number is used for mobile-originated text. A SIM must provision APN settings to access the external Packet data network via GGSN in 3G. In the case of 4G, APN is the address of PGW.
How does a device know what APN to use?
Besides the GGSN, the GPRS network has an additional component(HLR) to enable data roaming. Before setting up a data connection, the SIM card does registration with the HLR and downloads the subscription profile.
When a subscriber roams, it attaches to the home network for services(voice, SMS, and data). For accessing data service, SGSN in the roaming network does the signaling with the HLR for GPRS registration. After getting GPRS access, it attaches to the GGSN and sets up a tunnel for the internet by using a GTP to create a PDP context.
Subscriber subscription and APN:
HLR provisions the list of APNs and QoS profiles for 3G subscribers. During the network attach procedure, SGSN downloads APN and QoS profiles for the subscriber.
In the case of 4G, HSS stores the APN profiles. Each SIM has an EPC profile that contains the APN name and quality of service. Subscriber attaches to the HSS via MME. During attachment, MME downloads the EPS-Subscribed QoS profile. There can be multiple APNs for a subscriber. HSS marks one of the APNs as default.
What is the APN format?
The format is a string type that may consist of alphabets, numbers, and other characters. The roaming network needs to do a DNS lookup to get the IP address of the GGSN/PGW before starting any signaling. The string may contain operator information, including MCC and MNC digits, or a plain string with no such information.
Here are a few examples of Apn names:
Internet – This name has no information about the serving mobile operator or company.
internet.co.uk – This name belongs to a UK-based mobile company.
Airtel.in
– This name belongs to the Indian mobile operator Airtel.
Internet.mnc234.mcc345.GPRS – This belongs to the mobile operator with MCC as 345 and MNC as 234. A mobile operator may have multiple MNCs within a country. Multiple MNCs lead to having multiple APNs by the same operator in the country.
How does an APN string encode inside the network protocol messages?
During the location update procedure, while attaching, HLR sends the APN to the roaming network as part of the subscription data. Over the wire, the APN string must convert to bytes in protocol format per the 3GPP specification.
Each character converts to its equivalent ASCII value. If APN contains dots(.), the first byte contains the length of the immediate string till the next dot (.). Following are a few examples of APN encoding with dots and without dots.
internet – 0x08, ASCII(i), ASCII(n), ASCII(t), ASCII(e), ASCII(r), ASCII(n), ASCII(e), ASCII(t)
internet.co.uk – 0x08, ASCII(i), ASCII(n), ASCII(t), ASCII (e), ASCII(r), ASCII(n), ASCII(e), ASCII(t), 0x02, ASCII(c),ASCII(o), 0x02, ASCII(u),ASCII(k)
How to configure APN settings?
The mobile operator configures the setting of the APN in the device during the attach procedure. Still, if data is not working, there are other options you may use to do settings manually. The following section will describe how to change APN settings on iPhone and Android devices.
How to change APN Settings on iPhone?
To set the manually following are the steps.
- Go to settings and click on cellular.
- Select the data network.
- Change your settings for APN parameters.
- After the change, return to the home screen, and the changes will be saved.
Apn settings in Android or what is my APN:
Go to settings -> Connections->Mobile Networks-> Access Point Names. Here one can edit or add a new APN.
What are MCC and MNC in the APN setting?
HLR sends a list of APNs in the subscription profile during camping on a network. The phone selects only one of them for data. Which one it will choose is determined by the data requirements. You do not need to worry.
But while selecting APN manually, you see that it has many settings. MCC and MNC are two of them. Until now, you may never have been worried about MCC and MNC in APN.
When mobile phones roam, they come under a PLMN, identified by the MCC and MNC pair. If the user sets the MCC and MNC values, the phone will allow getting data service in PLMN, which has configured MCC and MNC values only.
For example, if you carry a sim card from TMobile USA and roam in India. If you set the MCC and MNC of Airtel, The phone can use data only when the Airtel network is selected. Setting MCC and MNC in and by the mobile subscriber is not advisable.
More topics to read—>