4.7.4 GPRS detach procedure

24.0083GPPCore network protocolsMobile radio interface Layer 3 specificationRelease 18Stage 3TS

4.7.4.0 General

The GPRS detach procedure is used:

– to detach the IMSI for GPRS services only. Independent of the network operation mode, this procedure is used by all kind of GPRS MSs;

– as a combined GPRS detach procedure used by GPRS MSs operating in MS operation mode A or B to detach the IMSI for GPRS and non-GPRS services or for non-GPRS services only, if the network operates in network operation mode I and no circuit-switched transaction is ongoing;

– in the case of a network failure condition to indicate to the MS that a re-attach with successive activation of previously active PDP contexts shall be performed. In this case, the MS may also perform the procedures needed in order to activate any previously active multicast service(s); or

– to detach the IMSI or IMEI for emergency bearer services.

After completion of a GPRS detach procedure or combined GPRS detach procedure for GPRS and non-GPRS services the GMM context is released.

An eCall only mobile station that is not capable of eCall over IMS shall not perform any kind of GPRS detach procedure.

The GPRS detach procedure shall be invoked by the MS if the MS is switched off, the SIM/USIM card is removed from the MS or if the GPRS or non-GPRS capability of the MS is disabled. The procedure may be invoked by the network to detach the IMSI for GPRS services. The GPRS detach procedure causes the MS to be marked as inactive in the network for GPRS services, non-GPRS services or both services.

If the detach procedure is triggered due to SIM/USIM removal, the MS shall indicate "switch off" in the detach type IE.

If a detach is requested by the HLR for an MS that has a PDP context for emergency services, the SGSN shall not send a DETACH REQUEST message to the MS, and shall follow the procedure described in subclause 6.1.3.4.2 for an MS that has PDP contexts for emergency bearer services.

When upper layers indicates that emergency bearer services are no longer required, the MS if still attached for emergency bearer services, may perform a detach followed by a re-attach to regain normal services, if the MS is in or moves to a suitable cell.

In A/Gb mode, if the GPRS detach procedure is performed, the PDP contexts and the MBMS contexts, if any, are deactivated locally without peer to peer signalling between the SM and LLC entities in the MS and the network.

In Iu mode, if the GPRS detach procedure is performed, the PDP contexts and the MBMS contexts, if any, are deactivated locally without peer to peer signalling between the SM entities in the MS and the network.

If the MS supports S1 mode, the MS shall store the TIN in the non-volatile memory in the ME, as described in 3GPP TS 24.301 [120], annex C, for a subsequent attach procedure.

The MS is allowed to initiate the GPRS detach procedure even if the timer T3346 is running.

The network proceeds with the GPRS detach procedure even if NAS level mobility management congestion control is active.

4.7.4.1 MS initiated GPRS detach procedure

4.7.4.1.1 MS initiated GPRS detach procedure initiation

The GPRS detach procedure is initiated by the MS by sending a DETACH REQUEST message. The detach type information element may indicate "GPRS detach with switching off", "GPRS detach without switching off", "IMSI detach", "GPRS/IMSI detach with switching off" or "GPRS/IMSI detach without switching off".

If the MS has a valid P-TMSI, the MS shall include the P-TMSI in the DETACH REQUEST message. The MS shall also include a valid P-TMSI signature, if available.

If the MS is not switched off and the MS is in the state GMM_REGISTERED, timer T3321 shall be started after the DETACH REQUEST message has been sent. If the detach type information element value indicates "IMSI Detach" the MS shall enter GMM-REGISTERED.IMSI-DETACH_INITIATED, otherwise the MS shall enter the state GMM-DEREGISTERED-INITIATED. If the detach type information element value indicates "IMSI Detach" or "GPRS/IMSI Detach", state MM IMSI DETACH PENDING is entered. If the MS to be switched off is not a MS using any of the coverage classes of EC-GSM-IoT, the MS shall try for a period of 5 seconds to send the DETACH REQUEST message. If the MS to be switched off is a MS using any of the coverage classes of EC-GSM-IoT, that MS should try for at least a period of 10 seconds to send the DETACH REQUEST message. If the MS is able to send the DETACH REQUEST message during this time the MS may be switched off.

If the detach type information element value indicates "GPRS detach without switching off " and the MS is attached for GPRS and non-GPRS services and the network operates in network operation mode I, then if in the MS the timer T3212 is not already running, the timer T3212 shall be set to its initial value and restarted after the DETACH REQUEST message has been sent.

4.7.4.1.2 MS initiated GPRS detach procedure completion for GPRS services only

When the DETACH REQUEST message is received by the network, the network shall send a DETACH ACCEPT message to the MS, if the detach type IE value indicates that the detach request has not been sent due to switching off. If switching off was indicated, the procedure is completed when the network receives the DETACH REQUEST message. The network and the MS shall deactivate the PDP contexts, the MBMS contexts and deactivate the logical link(s), if any.

The MS is marked as inactive in the network for GPRS services; state GMM-DEREGISTERED is entered in the MS and the network.

In Iu mode, if the detach has been sent due to switching off, then the network shall release the resources in the lower layers for this MS (see 3GPP TS 25.331 [23c]).

NOTE: When the DETACH REQUEST message is received by the network, and if the detach type IE value indicates that the detach is not due to power off, the authentication and ciphering procedure as well as the identification procedure may be performed.

If the MS supports S1 mode and operates in MS operation mode A or B , the MS shall disable the E‑UTRA capability (see 3GPP TS 24.301 [120]).

4.7.4.1.3 MS initiated combined GPRS detach procedure completion

When the DETACH REQUEST message is received by the network, a DETACH ACCEPT message shall be sent to the MS, if the detach type IE value indicates that the detach request has not been sent due to switching off. Depending on the value of the detach type IE the following applies:

GPRS/IMSI detach:
The MS is marked as inactive in the network for GPRS and for non-GPRS services. The network and the MS shall deactivate the PDP contexts, the MBMS contexts and deactivate the logical link(s), if any. The States GMM-DEREGISTERED and MM NULL are entered in both the MS and the network.

In Iu mode, if the detach has been sent due to switching off, then the network shall release the resources in the lower layers for this MS (see 3GPP TS 25.331 [23c]).

IMSI detach:
The MS is marked as inactive in the network for non-GPRS services. State MM NULL is entered in the MS and the network.

4.7.4.1.4 Abnormal cases in the MS

The following abnormal cases can be identified:

a) T3321 time-out

On the first expiry of the timer, the MS shall retransmit the DETACH REQUEST message and shall reset and restart timer T3321. This retransmission is repeated four times, i.e. on the fifth expiry of timer T3321, the GPRS detach procedure shall be aborted, the MS shall change to state:

– MM-NULL if "IMSI detach" was requested;

– GMM-REGISTERED.NORMAL-SERVICE if "IMSI Detach" was requested;

– GMM-DEREGISTERED if "GPRS detach" was requested;

– GMM-DEREGISTERED and MM-NULL if "GPRS/IMSI" detach was requested.

b) Lower layer failure before reception of DETACH ACCEPT message

The detach procedure is aborted and the MS shall change to one of the following states, except in the following implementation option cases b.1, b.2 and b3:

– MM-NULL if "IMSI detach" was requested;

– GMM-REGISTERED.NORMAL-SERVICE if "IMSI Detach" was requested;

– GMM-DEREGISTERED if "GPRS detach" was requested;

– GMM-DEREGISTERED and MM-NULL if "IMSI/GPRS" detach was requested.

b.1) Release of PS signalling connection before the completion of the GPRS detach procedure

The release of the PS signalling connection before completion of the GPRS detach procedure shall result in the GPRS detach procedure being initiated again, if the following conditions apply:

i) The original GPRS detach procedure was initiated over an existing PS signalling connection; and

ii) No SECURITY MODE COMMAND message and no Non-Access Stratum (NAS) messages relating to the PS signalling connection (e.g. PS authentication procedure, see subclause 4.7.7) were received after the DETACH REQUEST message was transmitted.

b.2) RR release in Iu mode (i.e. RRC connection release) with cause different than "Directed signalling connection re-establishment", for example, "Normal", or"User inactivity" (see 3GPP TS 25.331 [23c] and 3GPP TS 44.118 [111])

The GPRS detach procedure shall be initiated again, if the following conditions apply:

i) The original GPRS detach procedure was initiated over an exisiting RRC connection; and

ii) No SECURITY MODE COMMAND message and no Non-Access Stratum (NAS) messages relating to the PS signalling connection (e.g. PS authentication procedure, see subclause 4.7.7) were received after the DETACH REQUEST message was transmitted.

NOTE: The RRC connection release cause different than "Directed signalling connection re-establishment" that triggers the re-initiation of the GPRS detach procedure is implementation specific.

b.3) RR release in Iu mode (i.e. RRC connection release) with cause "Directed signalling connection re-establishment" (see 3GPP TS 25.331 [23c] and 3GPP TS 44.118 [111])

The routing area updating procedure shall be initiated followed by completion of the GPRS detach procedure if the following conditions apply:

i) The original GPRS detach procedure was not due to SIM removal; and

ii) The original GPRS detach procedure was not due to a rerun of the procedure due to "Directed signalling connection reestablishment".

c) Detach procedure collision

GPRS detach containing cause "power off":

– If the MS receives a DETACH REQUEST message before the MS initiated GPRS detach procedure has been completed, this message shall be ignored and the MS initiated GPRS detach procedure shall continue.

GPRS detach containing other causes than "power off":

– If the MS receives a DETACH REQUEST message before the MS initiated GPRS detach procedure has been completed, the MS shall treat the message as specified in subclause 4.7.4.2.2 with the following modifications:

– If the DETACH REQUEST message received by the MS contains detach type "re-attach required", and the MS initiated detach procedure is with detach type "GPRS detach" or "Combined GPRS/IMSI detach", the MS need not initiate the GPRS attach or combined GPRS attach procedure.

– If the DETACH REQUEST message received by the MS contains detach type "IMSI detach", and the MS initiated detach procedure is with detach type "IMSI detach", the MS in operation mode A or B in network operation mode I need not re-attach to non-GPRS services.

– If the DETACH REQUEST message received by the MS contains detach type "IMSI detach", and the MS initiated detach procedure is with detach type "GPRS detach" or "combined GPRS/IMSI detach", the MS shall progress both procedures. The MS in operation mode A or B in network operation mode I need not re-attach to non-GPRS services.

d) Detach and GMM common procedure collision

GPRS detach containing cause "power off":

– If the MS receives a message used in a GMM common procedure before the GPRS detach procedure has been completed, this message shall be ignored and the GPRS detach procedure shall continue.

GPRS detach containing other causes than "power off" and containing detach type "IMSI detach":

– If the MS receives a message used in a GMM common procedure before the GPRS detach procedure has been completed, both the GMM common procedure and the GPRS detach procedure shall continue.

GPRS detach containing other causes than "power off" and containing other detach types than "IMSI detach":

– If the MS receives a P-TMSI REALLOCATION COMMAND, a GMM STATUS, or a GMM INFORMATION message before the GPRS detach procedure has been completed, this message shall be ignored and the GPRS detach procedure shall continue.

– If the MS receives an AUTHENTICATION AND CIPHERING REQUEST or IDENTITY REQUEST message, before the GPRS detach procedure has been completed, the MS shall respond to it as described in subclauses 4.7.7 and 4.7.8 respectively.

e) Change of cell within the same RA (A/Gb mode only)

If a cell change occurs within the same RA before a DETACH ACCEPT message has been received, then the cell update procedure shall be performed before completion of the detach procedure.

f) Change of cell into a new routing area

If a cell change into a new routing area occurs before a DETACH ACCEPT message has been received, the GPRS detach procedure shall be aborted and re-initiated after successfully performing a routing area updating procedure. If the detach procedure is performed due to the removal of the SIM/USIM or the MS is to be switched off, the MS shall abort the detach procedure and enter the state GMM-DEREGISTERED.

g) Access barred because of access class control or EAB

The signalling procedure for GPRS detach shall not be started. The MS starts the signalling procedure as soon as possible and if still necessary, i.e. when the barred state is removed or because of a cell change, or performs a local detach immediately or after an implementation dependent time.

h) Detach and paging for non-GRPS services procedure collision

If the MS receives a paging for non-GPRS services before the MS initiated combined GPRS detach procedure with detach type "IMSI detach" or "GPRS/IMSI detach" has been completed, then the paging for non-GPRS services shall be ignored and the MS initiated combined GPRS detach procedure shall continue.

Figure 4.7.4/1 3GPP TS 24.008: MS initiated GPRS detach procedure

For the cases b and f:

– Timer T3321 shall be stopped if still running.

4.7.4.1.5 Abnormal cases on the network side

The following abnormal cases can be identified:

a) Detach request received in a CSG cell for which the MS has no valid CSG subscription

If the MS initiates a detach procedure in a CSG cell the CSG ID of which is not valid for the MS and the detach procedure is not due to "switch off", the network shall proceed as follows:

– if the detach type is "IMSI detach" and the MS has a PDN connection for emergency bearer services active, the SGSN shall send a DETACH ACCEPT message and deactivate all non-emergency PDP contexts, if any, by initiating a PDP context deactivation procedure;

– otherwise, the network shall initiate the detach procedure. The network shall send a DETACH REQUEST message including the GMM cause value #25 "not authorized for this CSG".

4.7.4.2 Network initiated GPRS detach procedure

4.7.4.2.1 Network initiated GPRS detach procedure initiation

The network initiates the GPRS detach procedure by sending a DETACH REQUEST message to the MS. The DETACH REQUEST message shall include a detach type IE. In addition, the network may include a cause IE to specify the reason for the detach request. The network shall start timer T3322. If the detach type IE indicates "re-attach required", or "re-attach not required" and the cause code is not #2 "IMSI unknown in HLR", the network shall deactivate the PDP contexts, the MBMS contexts and deactivate the logical link(s), if any, and shall change to state GMM-DEREGISTERED-INITIATED.

4.7.4.2.2 Network initiated GPRS detach procedure completion by the MS

When receiving the DETACH REQUEST message and the detach type indicates "re-attach required", the MS shall deactivate the PDP context(s), the MBMS context(s) and deactivate the logical link(s), if any. The MS shall stop the timer T3346, if it is running. The MS shall also stop timer(s) T3396, if it is running. The MS shall send a DETACH ACCEPT message to the network and shall enter the state GMM-DEREGISTERED. The MS shall, after the completion of the GPRS detach procedure, initiate a GPRS attach procedure. The MS should also activate PDP context(s) that were originally activated by the MS to replace any previously MS activated PDP context(s). The MS should also perform the procedures needed in order to activate any previously active multicast service(s).

NOTE 1: When the detach type indicates "re-attach required", user interaction is necessary in some cases when the MS cannot re-activate the PDP/MBMS context(s) automatically.

A GPRS MS operating in MS operation mode A or B in network operation mode I, which receives an DETACH REQUEST message with detach type indicating "re-attach required" or "re-attach not required" and no cause code, is only detached for GPRS services in the network.

When receiving the DETACH REQUEST message and the detach type IE indicates "IMSI detach", the MS shall not deactivate the PDP/MBMS contexts. The MS shall set the MM update status to U2 NOT UPDATED. An MS in operation mode A or B in network operation mode I may send a DETACH ACCEPT message to the network, and shall re-attach to non-GPRS service by performing the combined routing area updating procedure according to subclause 4.7.5.2, sending a ROUTING AREA UPDATE REQUEST message with Update type IE indicating "combined RA/LA updating with IMSI attach". An MS in operation mode A that is in an ongoing circuit-switched transaction shall initiate the combined routing area updating after the circuit-switched transaction has been released. An MS in operation mode C, or in MS operation mode A or B in network operation mode II, shall send a DETACH ACCEPT message to the network.

If the detach type IE indicates "IMSI detach", or "re-attach required" then the MS shall ignore the cause code if received.

If the MS is attached for GPRS and non-GPRS services and the network operates in network operation mode I, then if in the MS the timer T3212 is not already running, the timer T3212 shall be set to its initial value and restarted if:

– the detach type IE indicates "re-attach required"; or

– the detach type IE indicates "re-attach not required" and no cause code is included.

When receiving the DETACH REQUEST message and the detach type IE indicates "re-attach not required" and no cause code, or "re-attach not required" and the cause code is not #2 "IMSI unknown in HLR", the MS shall deactivate the PDP contexts, the MBMS contexts and deactivate the logical link(s), if any. The MS shall then send a DETACH ACCEPT message to the network and shall change state to GMM-DEREGISTERED.

If the detach type IE indicates "re-attach not required" and no cause code is included,

– the MS shall set the GPRS update status to GU2 NOT UPDATED, delete the GMM parameters P-TMSI, P-TMSI signature, RAI, and GPRS ciphering key sequence number, and start timer T3302. If the MS is operating in MS operation mode C, it may enter the state GMM-DEREGISTERED.PLMN-SEARCH in order to perform a PLMN selection according to 3GPP TS 23.122 [6]; otherwise the MS shall enter the state GMM-DEREGISTERED.ATTEMPTING-TO-ATTACH; and

– if S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list and KSI, as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the no EMM cause included and with detach type set to "re-attach not required".

If the detach type IE indicates "re-attach not required" and a cause code is included, then, depending on the received cause code, the MS shall act as follows:

# 2 (IMSI unknown in HLR);

The MS shall set the update status to U3 ROAMING NOT ALLOWED and shall delete any TMSI, LAI and ciphering key sequence number. The new MM state is MM IDLE. The SIM/USIM shall be considered as invalid for non-GPRS services until switching off or the SIM/USIM is removed. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for non-GPRS services", then the MS shall set this counter to MS implementation-specific maximum value.

A GPRS MS operating in MS operation mode A or B in network operation mode I, is still IMSI attached for GPRS services in the network.

# 3 (Illegal MS);

# 6 (Illegal ME);

The MS shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to subclause 4.1.3.2) and shall delete any P-TMSI, P-TMSI signature, RAI and GPRS ciphering key sequence number. The MS shall delete the list of equivalent PLMNs. The new GMM state is GMM-DEREGISTERED.NO-IMSI. The SIM/USIM shall be considered as invalid for GPRS services until switching off or the SIM/USIM is removed. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for GPRS services", then the MS shall set this counter to MS implementation-specific maximum value.

A GPRS MS operating in MS operation mode A or B shall in addition set the update status to U3 ROAMING NOT ALLOWED, shall delete any TMSI, LAI and ciphering key sequence number. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall abort the RR connection, unless an emergency call is ongoing. The SIM/USIM shall be considered as invalid also for non-GPRS services until switching off or the SIM/USIM is removed. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for non-GPRS services", then the MS shall set this counter to MS implementation-specific maximum value.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list and KSI as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

NOTE 2: The possibility to configure an MS so that the radio transceiver for a specific radio access technology is not active, although it is implemented in the MS, is out of scope of the present specification.

# 7 (GPRS services not allowed);

The MS shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to subclause 4.1.3.2) and shall delete any P-TMSI, P-TMSI signature, RAI and GPRS ciphering key sequence number. The SIM/USIM shall be considered as invalid for GPRS services until switching off or the SIM/USIM is removed. The new state is GMM-DEREGISTERED. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for GPRS services", then the MS shall set this counter to MS implementation-specific maximum value.

A GPRS MS operating in MS operation mode A or B which is already IMSI attached for CS services is still IMSI attached for CS services in the network.

A GPRS MS operating in MS operation mode A or B in network operation mode I shall then proceed with the appropriate MM specific procedure.

NOTE 3: Optionally the MS starts the timer T3340 as described in subclause 4.7.1.9.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list and KSI as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 8 (GPRS services and non-GPRS services not allowed);

The MS shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to subclause 4.1.3.2) and shall delete any P-TMSI, P-TMSI signature, RAI and GPRS ciphering key sequence number. The MS shall delete the list of equivalent PLMNs. The new GMM state is GMM-DEREGISTERED.NO-IMSI.

The MS shall set the update status to U3 ROAMING NOT ALLOWED, shall delete any TMSI, LAI and ciphering key sequence number. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall abort the RR connection, unless an emergency call is ongoing. The SIM/USIM shall be considered as invalid for GPRS and non-GPRS services until switching off or the SIM/USIM is removed. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for GPRS services", then the MS shall set this counter to MS implementation-specific maximum value. If the message has been successfully integrity checked by the lower layers and the MS maintains a counter for "SIM/USIM considered invalid for non-GPRS services", then the MS shall set this counter to MS implementation-specific maximum value.

NOTE 4: Optionally the MS starts the timer T3340 as described in subclause 4.7.1.9.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list and KSI as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 11 (PLMN not allowed);

The MS shall delete any RAI or LAI, P-TMSI, P-TMSI signature and GPRS ciphering key sequence number, shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to subclause 4.1.3.2) and shall reset the GPRS attach attempt counter. The MS shall delete the list of equivalent PLMNs. The new GMM state is GMM-DEREGISTERED.

The MS shall store the PLMN identity in the "forbidden PLMN list" and if the MS is configured to use timer T3245 (see 3GPP TS 24.368 [135] or 3GPP TS 31.102 [112]) then the MS shall start timer T3245 and proceed as described in subclause 4.1.1.6. If the message has been successfully integrity checked by the lower layers and the MS maintains a PLMN-specific attempt counter for that PLMN, then the MS shall set this counter to the MS implementation-specific maximum value.

The MS shall start timer T3340 as described in subclause 4.7.1.9.

If no RR connection exists, the MS shall perform the following additional actions immediately. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall perform these actions when the RR connection is subsequently released:

– A GPRS MS operating in MS operation mode A or B shall set the update status to U3 ROAMING NOT ALLOWED and shall delete any TMSI, LAI and ciphering key sequence number. The new MM state is MM IDLE.

– The MS shall perform a PLMN selection according to 3GPP TS 23.122 [14].

An MS in GAN mode shall request a PLMN list in GAN (see 3GPP TS 44.318 [76b]) prior to perform a PLMN selection from this list according to 3GPP TS 23.122 [14].

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 12 (Location area not allowed);

The MS shall delete any RAI, P-TMSI, P-TMSI signature GPRS ciphering key sequence number, shall set the GPRS update status to GU3 ROAMING NOT ALLOWED(and shall store it according to clause 4.1.3.2) and shall reset the GPRS attach attempt counter. The state is changed to GMM-DEREGISTERED.LIMITED-SERVICE.

The MS shall store the LAI in the list of "forbidden location areas for regional provision of service".

The MS shall start timer T3340 as described in subclause 4.7.1.9.

If no RR connection exists, the MS shall perform the following additional actions immediately. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall perform these actions when the RR connection is subsequently released:

– If the MS is IMSI attached, the MS shall set the update status to U3 ROAMING NOT ALLOWED, shall delete any TMSI, LAI and ciphering key sequence number and shall reset the location update attempt counter. The new MM state is MM IDLE.

– The MS shall perform a cell selection according to 3GPP TS 43.022 [82] and 3GPP TS 25.304 [98].

NOTE 5: The cell selection procedure is not applicable for an MS in GAN mode.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 13 (Roaming not allowed in this location area);

The MS shall delete any RAI, P-TMSI, P-TMSI signature and GPRS ciphering key sequence number, shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to clause 4.1.3.2) and shall reset the GPRS attach attempt counter. The MS shall delete the list of equivalent PLMNs. The state is changed to GMM-DEREGISTERED.LIMITED-SERVICE or optionally to GMM-DEREGISTERED.PLMN-SEARCH.

The MS shall store the LAI in the list of "forbidden location areas for roaming".

The MS shall start timer T3340 as described in subclause 4.7.1.9.

If no RR connection exists, the MS shall perform the following additional actions immediately. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall perform these actions when the RR connection is subsequently released:

– If the MS is IMSI attached, the MS shall set the update status to U3 ROAMING NOT ALLOWED, shall delete any TMSI, LAI and ciphering key sequence number and shall reset the location update attempt counter. The new MM state is MM IDLE.

– The MS shall perform a PLMN selection according to 3GPP TS 23.122 [14].

An MS in GAN mode shall request a PLMN list in GAN (see 3GPP TS 44.318 [76b]) prior to perform a PLMN selection from this list according to 3GPP TS 23.122 [14].

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 14 (GPRS services not allowed in this PLMN);

The MS shall delete any RAI, P-TMSI, P-TMSI signature, and GPRS ciphering key sequence number stored, shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and shall store it according to subclause 4.1.3.2), shall reset the GPRS attach attempt counter and shall change to state GMM-DEREGISTERED.

The MS shall store the PLMN identity in the "forbidden PLMNs for GPRS service" list and if the MS is configured to use timer T3245 (see 3GPP TS 24.368 [135] or 3GPP TS 31.102 [112]) then the MS shall start timer T3245 and proceed as described in subclause 4.1.1.6. If the message has been successfully integrity checked by the lower layers and the MS maintains a PLMN-specific PS-attempt counter for that PLMN, then the MS shall set this counter to the MS implementation-specific maximum value.

A GPRS MS operating in MS operation mode C shall delete the list of equivalent PLMNs and perform a PLMN selection according to 3GPP TS 23.122 [14].

A GPRS MS operating in MS operation mode A or B which is already IMSI attached for CS services is still IMSI attached for CS services in the network.

A GPRS MS operating in MS operation mode A or B in network operation mode I shall then proceed with the appropriate MM specific procedure.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state, EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 15 (No Suitable Cells In Location Area);

The MS shall delete any RAI, P-TMSI, P-TMSI signature and GPRS ciphering key sequence number, shall set the GPRS update status to GU3 ROAMING NOT ALLOWED(and shall store it according to clause 4.1.3.2) and shall reset the GPRS attach attempt counter. The state is changed to GMM-DEREGISTERED.LIMITED-SERVICE.

The MS shall store the LAI in the list of "forbidden location areas for roaming".

The MS shall start timer T3340 as described in subclause 4.7.1.9.

If no RR connection exists, the MS shall perform the following additional actions immediately. If the MS is operating in MS operation mode A and an RR connection exists, the MS shall perform these actions when the RR connection is subsequently released:

– If the MS is IMSI attached, the MS shall set the update status to U3 ROAMING NOT ALLOWED, shall delete any TMSI, LAI and ciphering key sequence number and shall reset the location update attempt counter. The new MM state is MM IDLE.

– The MS shall search for a suitable cell in another location area or a tracking area according to 3GPP TS 43.022 [82] and 3GPP TS 25.304 [98] or 3GPP TS 36.304 [121].

NOTE 6: The cell selection procedure is not applicable for an MS in GAN mode.

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state and EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

# 25 (Not authorized for this CSG)

The MS shall set the GPRS update status to GU3 ROAMING NOT ALLOWED (and store it according to subclause 4.1.3.2) and shall reset the GPRS attach attempt counter. The state is changed to GMM-DEREGISTERED.LIMITED-SERVICE.

If the cell where the MS has received the DETACH REQUEST message is a CSG cell and the CSG ID and associated PLMN identity of the cell are contained in the Allowed CSG list stored in the MS, the MS shall remove the CSG ID and associated PLMN identity from the Allowed CSG list.

If the cell where the MS has received the DETACH REQUEST message is a CSG cell and the CSG ID and associated PLMN identity of the cell are contained in the Operator CSG list, the MS shall proceed as specified in 3GPP TS 23.122 [14] subclause 3.1A.

The MS shall start timer T3340 as described in subclause 4.7.1.9.

If the MS is IMSI attached for non-GPRS services, the MS shall set the update status to U3 ROAMING NOT ALLOWED and shall reset the location update attempt counter. The new MM state is MM IDLE.

The MS shall search for a suitable cell according to 3GPP TS 43.022 [82] and 3GPP TS 25.304 [98].

If S1 mode is supported in the MS, the MS shall handle the EMM parameters EMM state and EPS update status, GUTI, last visited registered TAI, TAI list, KSI and attach attempt counter as specified in 3GPP TS 24.301 [120] for the case when a DETACH REQUEST is received with the EMM cause with the same value and with detach type set to "re-attach not required".

NOTE 7: CSG is applicable only for UMTS.

Other cause values shall not impact the update status. Further actions of the MS are implementation dependent.

4.7.4.2.3 Network initiated GPRS detach procedure completion by the network

The network shall, upon receipt of the DETACH ACCEPT message, stop timer T3322. If the detach type IE included in the DETACH REQUEST message indicates "IMSI detach", or "re-attach not required" and the cause code is #2 "IMSI unknown in HLR", the network shall not change the current GMM state; otherwise the network shall change state to GMM-DEREGISTERED.

4.7.4.2.4 Abnormal cases on the network side

The following abnormal cases can be identified:

a) T3322 time-out

On the first expiry of the timer, the network shall retransmit the DETACH REQUEST message and shall start timer T3322. This retransmission is repeated four times, i.e. on the fifth expiry of timer T3322, the GPRS detach procedure shall be aborted. If the detach type indicates "IMSI detach", or "re-attach not required" and the cause code is #2 "IMSI unknown in HLR", the network shall not change the current GMM state; otherwise the network shall change state to GMM-DEREGISTERED.

b) Low layer failure

The GPRS detach procedure is aborted. If the detach type indicates "IMSI detach", or "re-attach not required" and the cause code is #2 "IMSI unknown in HLR", the network shall not change the current GMM state; otherwise the network shall change state to GMM-DEREGISTERED.

c) GPRS detach procedure collision

If the network receives a DETACH REQUEST message with "switching off" indicated, before the network initiated GPRS detach procedure has been completed, both procedures shall be considered completed.

If the network receives a DETACH REQUEST message without "switching off" indicated, before the network initiated GPRS detach procedure has been completed, the network shall send a DETACH ACCEPT message to the MS.

d) GPRS detach and GPRS attach procedure collision

If the network receives an ATTACH REQUEST message before the network initiated GPRS detach procedure with type of detach ‘re-attach not required’ has been completed, the network shall ignore the ATTACH REQUEST message. If the detach type IE value, sent in the DETACH REQUEST message, indicates "re-attach required" the detach procedure is aborted and the GPRS attach procedure shall be progressed after the PDP contexts and MBMS contexts, if any, have been deleted. If the detach type IE value, sent in the DETACH REQUEST message, indicates "IMSI detach" the detach procedure is aborted and the GPRS attach procedure shall be progressed.

e) GPRS detach and routing area updating procedure collision

GPRS detach containing detach type "re-attach required" or "re-attach not required":

If the network receives a ROUTING AREA UPDATE REQUEST message before the network initiated GPRS detach procedure has been completed, the detach procedure shall be progressed, i.e. the ROUTING AREA UPDATE REQUEST message shall be ignored. If the DETACH REQUEST message contains detach type "re-attach not required" and GMM cause #2 "IMSI unknown in HLR", the network will follow the procedure as described below for the detach type "IMSI detach".

GPRS detach containing detach type "IMSI detach":

If the network receives a ROUTING AREA UPDATE REQUEST message before the network initiated GPRS detach procedure has been completed, the network shall abort the detach procedure, shall stop T3322 and shall progress the routing area update procedure.

f) GPRS detach and service request procedure collision

GPRS detach containing detach type "re-attach required" or "re-attach not required":

If the network receives a SERVICE REQUEST message before the network initiated GPRS detach procedure has been completed, the network shall progress the detach procedure. If the GPRS Detach Request message contains detach type "re-attach not required" and GMM cause #2 "IMSI unknown in HLR", the network will follow the procedure as described below for the detach type "IMSI detach".

GPRS detach containing detach type "IMSI detach":

If the network receives a SERVICE REQUEST message before the network initiated GPRS detach procedure has been completed, the network shall progress both procedures.

Figure 4.7.4/2 3GPP TS 24.008: Network initiated GPRS detach procedure