5

When a new SIM (never used) is inserted in a new smartphone (never used), smartphone seems to set a right APN without any manual settings. Is there a global table (inside smartphone) with associations APN <-> network operator?

Note: Querying new SIM cards with AT commands seems they have preferred network operators, but no APN saved in memory.

aldo85ita
  • 496
  • 2
  • 8
  • 19

3 Answers3

3

I can comment on the SIM side and confirm that APN settings are not held within the SIM. And yes in terms of network operators there is a file called EF_PLMN which holds the Mobile Country Code (MCC) and Mobile Network Code (MNC) to allow a device to connect to the correct network faster.

On the point of APN, it is my understanding that devices have internal (memory) APN listings for major operators in that territory. When an operator orders a device they ensure that "their" APN is correct. Yes a big issue is incorrect APNs for operators within the device and that is the reason network operators need to send APN settings when they detect a SIM in a new Device.

I do not have information on how to query this internal APN listing as it may be part of the Firmware.

QuickPrototype
  • 833
  • 7
  • 18
  • About the first point: ok, preferred PLMN list can be inside EF_PLMN file, but it can be obtained from network if you use EF_OPLMNwACT policy (please correct me if I'm wrong). About the second point: what do you mean with "When an operator orders a device"? and how can network operator know that a new SIM has been inserted and send APN settings? – aldo85ita Feb 11 '17 at 09:44
  • EF_OPLMNwACT is not obtained from the network. it is set by the network operator when they order the SIM. it allows an operator (Vodaphone, Orange etc.) to set the preferred roaming networks including which access technology to use (2G,3G,4G). – QuickPrototype Feb 11 '17 at 14:48
  • When a large operator (Vodaphone, Orange etc) orders some phones like Samsung, Nokia, Apple etc. They first test a single device and ensure that the APN is correct. – QuickPrototype Feb 11 '17 at 14:49
  • When you connect to a network your devices identifier "IMEI" is sent with some of the signalling (This is how devices can be blacklisted). If the operator detects a change in IMEI it knows that the SIM is now in a new phone. – QuickPrototype Feb 11 '17 at 14:51
  • QuickPrototype, I understand what you mean and I thankyou for all informations. But, related to my first question, "Is there a global table (inside smartphone) with associations APN <-> network operator?", do you know any open source project with this table available? – aldo85ita Feb 26 '17 at 09:33
1

Having been through the approval's procedure for a big USA mobile network operator (MNO), part of the approval's process involved automatically selecting the correct default APN when the modem connects to the network. This can be overridden for special cases, for example if the user needs to use an MNO supplied VPN which requires a special APN.

While I do not know if this is the same for every case, all phones go through an approval process, and if it is a phone approved by the MNO then it is quite likely the MNO will insist that at least a default APN is loaded if none has been supplied by the user. The network that the SIM allows the phone to connect to can be read from the modem without an APN being supplied, so it is quite easy to use this to look up a default APN from list. As phone companies really do not want to change their software for each MNO, maintaining a list makes it easier for the phone manufacturer, the MNO and the end user.

andrew g
  • 11
  • 1
1

For Android, the mobile devices pull the The MCC (Mobile Country One) and the MNC (Mobile Network code) from the SIM card, and maybe other values.

Then, it configures the APN based on an internal SQlite database created by Android based on XML files that contain APN settings in the following format:

<apn carrier="CarrierXYZ"
  mcc="123"
  mnc="123"
  apn="carrierxyz"
  type="default,supl,mms,ims,cbs"
  mmsc="http://mms.carrierxyz.com"
  mmsproxy="0.0.0.0"
  mmsport="80"
  bearer_bitmask="4|5|6|7|8|12"

/>

https://android.googlesource.com/device/sample/+/master/etc/apns-full-conf.xml https://source.android.com/devices/tech/config/update

user14219984
  • 86
  • 1
  • 4