On Fri, Jun 05, 2009 at 03:30:23PM +0200, Holger Freyther wrote:
On Friday 05 June 2009 16:53:47 Harald Welte wrote:
Wikipedia is certainly not the definitive anwer, but as you can see at http://en.wikipedia.org/wiki/IMSI_attach it claims that ATTACH is only performed at the initial switch-on. Later on, it does a regular Location Update.
Right, the spec agrees here (I stumbled across this today) and we need to fix the code. It is written in 04.08 Section 4.4.3 (IMSI Attach)
"The IMSI attach procedure is used only if the update status is UPDATED and if the stored Location Area Identification is the same as the one which is actually broadcasted on the BCCH of the current serving cell. Otherwise a normal location updating procedure (see sub-clause 4.4.1) is invoked independently of the ATT flag indication."
So I don't fully understand this yet, but it is a strong indication that wikipedia is right...
'update status' is the status as stored in the SIM. UPDATED means that the last Location Update was successful, and the SIM contains a valid LAI.
So IMSI ATTACH is only used if the SIM card is activated in the same LA that it was last active in.
If the SIM was registered to a different network or LA, or actually failed to register to a network (unsuccessful location update), then the status is NOT UPDATED and thus IMSI ATTACH should not be performed, but rather a regular Location Update
So IMSI ATTACH/DETACH really is about a SIM(IMSI) being activated/deactivated in a given LA. activation/deactivation typically is switching the phone on or off.
While moving between location areas [at least in the same network] there should be no IMSI ATTACH, as per the spec.