5.3.3 Discovery Request

23.3033GPPProximity-based services (ProSe)Release 17Stage 2TS

5.3.3.1 General

The Discovery Request is sent by the "announcing UE" or "monitoring UE" in order to be authorised to access the discovery resources and perform ProSe Direct Discovery.

5.3.3.2 Announce request (non-roaming) – open discovery

Figure 5.3.3.2-1: Announce request procedure (non-roaming)

0. The UE is configured with the data structure of the ProSe Application IDs corresponding to HPLMN. This step is performed using mechanisms that are out of scope of 3GPP.

1. If the UE is authorised to announce in HPLMN, or if UE intends to make announcement using WLAN-based PC5 and is triggered to announce, it shall establish a secure connection with the ProSe Function and it shall send a Discovery Request (ProSe Application ID, UE Identity, announce command, Application ID, Discovery Entry ID, [Requested Timer], [Application Level Container], [PC5_tech]) message for announcing. The ProSe Application ID indicates what the UE is interested to announce. The UE Identity is set to e.g. IMSI. The Application ID represents a unique identifier of the UE application that has triggered the transmission of the Discovery Request message. The Discovery Entry ID indicates whether this is a new request. The Requested Timer is an optional parameter and indicates the length of validity timer associated with the ProSe Application Code that the UE expects to receive from the ProSe Function in step 3. When the Requested Timer is set to zero, procedures in clause 5.3.6A.1.3 shall be followed. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for announcements. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA. This request is always sent to the ProSe Function in HPLMN.

If application-controlled extension is used, the Discovery Request message also includes the Application Level Container. The Application Level Container contains the request and any relevant information for the ProSe Application Server to assign a (set of) ProSe Application Code Suffix(es).

If dynamic metadata is used, the Discovery Request message also includes the metadata to be uploaded to the ProSe Function. Moreover, when the UE updates the metadata for a valid ProSe Application Code, the command is set to "metadata _update" in the Discovery Request message.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and create a new context for this UE that contains the subscription parameters for this UE. The HSS provides the MSISDN of the UE. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function will create a new discovery entry in the UE’s context for this request, and will return the corresponding identifier in the Discovery Response message in step 3.

NOTE 1: Home ProSe Function can retain the previously camped PLMN ID and associated ProSe Application Code for an operator configurable time when informed by HSS of a PLMN change. When the configuration timer expires, the previously camped PLMN ID and associated ProSe Application Code can be removed from the UE context.

2.a If the UE indicated it desired application-controlled extension by the inclusion of the Application Level Container, the ProSe Function sends an Auth Request (ProSe Application ID, Request Type, Application Level Container, Allowed number of suffixes) to the ProSe Application Server. The Request Type is set to "open discovery with application-controlled extension /announce ". The Allowed Number of Suffixes indicates how many ProSe Restricted Code Suffixes the ProSe Application Server can assign for the UE. The ProSe Function locates the ProSe Application Server based on the Application ID.

2.b The ProSe Application Server returns an Auth Response (Response Type, ProSe Application Code Suffix pool) message. The ProSe Application Code Suffix pool contains the Suffix(es) allocated by the ProSe Application based on the inputs in step 2.a. The Response Type is set to "open discovery with application-controlled extension /announce ack".

NOTE 2: The length of the ProSe Restricted Code Suffix is chosen by the ProSe Application Server from a set of allowable lengths (e.g. 8 bits, 24 bits, 48 bits). This choice is per application, so that all UEs announcing ProSe application Codes assigned for ProSe Application IDs from that Application ID use the same Suffix length (which may be zero if no application-controlled extension is allowed for this Application).

NOTE 3: The ProSe Application Code Suffix pool needs to support the indication of a large number of or a range of ProSe Application Code Suffixes.

3. If the Discovery Request is authorised, then the ProSe Function shall check whether the UE is authorized to use the ProSe Application ID contained in the Discovery Request. If the UE is authorised to use that ProSe Application ID, then the ProSe Function shall respond with a Discovery Response (ProSe Application Code, validity timer, Discovery Entry ID, [PC5_tech]) message. The ProSe Application Code is provided by the ProSe Function and corresponds to the ProSe Application ID that was contained in the Discovery Request. The validity timer indicates for how long this ProSe Application Code is going to be valid; the ProSe Function takes into account the Requested Timer parameter, if provided by the UE, when allocating the validity timer. The UE will be authorised to announce this ProSe Application Code for the duration of validity timer and if it remains in the HPLMN. When the validity timer expires or the UE changes its registered PLMN the UE needs to request a new ProSe Application Code. The optional PC5_tech parameter indicates the PC5 radio technology(ies) that is/are authorized to be used for the assigned ProSe Application Code. When this parameter is omitted, the authorized PC5 radio technology is E-UTRA.

If dynamic metadata is used , the ProSe Function stores the metadata with the associated ProSe Application ID in the UE context, and allocates a corresponding Metadata Index to be included into the ProSe Application Code. Moreover, if the command is set to "metadata_update" in step 1, the ProSe Function only updates the Metadata Index portion of the ProSe Application Code, and keeps the rest unchanged.

If application-controlled extension is used, the ProSe Application Code is replaced by the ProSe Application Code Prefix, and the Discovery Response message also contains the ProSe Application Code Suffix pool.

NOTE 4: To avoid interrupting the discovery procedure, if the UE changes its registered PLMN but the validity timer of the Prose Application Code has not yet expired then the ProSe Function may allocate the same ProSe Application Code to the UE, with a validity timer set to the residual validity time of the validity timer not yet expired.

NOTE 5: The UE appends a ProSe Application Code Suffix from the ProSe Application Code Suffix pool to the ProSe Application Code Prefix to form a ProSe Application Code. When the ProSe Application Code Suffix pool contains multiple suffixes, the UE may use different suffixes from the ProSe Application Code Suffix pool to form different ProSe Application Codes to announce, without having to contact the ProSe Function as long as the ProSe Application Code Prefix is valid.

4. The UE may start announcing the provided ProSe Application Code in HPLMN, using the radio resources authorised and configured by E-UTRAN to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the validity timer associated with a ProSe Application Code expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the validity timer), then the ProSe Function removes the entry related to that ProSe Application Code from the UE context.

5.3.3.2A Announce Request (non-roaming) – restricted discovery

Figure 5.3.3.2A-1: Announce Request procedure for restricted discovery (non-roaming)

0. The user sets the permission for the restricted discovery using application layer mechanisms. In addition, the application client in the UE retrieves the PDUID and provides it to the ProSe Application Server. The ProSe Application Server allocates a RPAUID for that PDUID stores the binding between the PDUID and the RPAUID and returns the RPAUID to the application client in the UE. The UE may optionally provide metadata to be associated with the RPAUID, and the ProSe Application Server stores the metadata. The application client in the UE stores the binding between the PDUID and its own RPAUID. If the application client in the UE intends to use the ProSe service, it triggers the UE to perform the announce procedure, providing its own RPAUID obtained by the ProSe Application Server.

NOTE 1: The procedures in step 0 are out of scope of 3GPP. However, it is expected that the application client in the UE will be able to retrieve the PDUID from the underlying ProSe Protocol layer.

1. If the UE is authorized to announce in the serving PLMN, or if UE intends to make announcement using WLAN-based PC5 and is triggered by the application client to announce, it shall establish a secure connection with the ProSe Function in HPLMN and send a Discovery Request message (RPAUID, UE Identity, command=announce, Discovery Type, Application ID, Discovery Entry ID, Requested Discovery Timer, Application Level Container, Announcing Type, [PC5_tech]) for announcing. The RPAUID indicating what the UE is interested to announce was obtained in step 0. The UE Identity is set to IMSI. The Application ID represents a unique identifier of the UE application that has triggered the transmission of the Discovery Request message. The Discovery Type is set to "restricted discovery". The Discovery Entry ID indicates whether this is a new request. The Requested Discovery Timer is an optional parameter and indicates the length of validity timer associated with the ProSe Restricted Code that the UE expects to receive from the ProSe Function in step 4. When the Requested Discovery Timer is set to zero, the ProSe Function shall remove the discovery entry indicated by the Discovery Entry ID, and release the associated resources. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for announcements. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

If restricted Direct Discovery with application-controlled extension is used, the Discovery Request message also includes the Application Level Container. The Application Level Container contains the request and any relevant information (e.g. intent to use metadata indication in the suffix) for the ProSe Application Server to assign a (set of) ProSe Restricted Code Suffix(es). The Discovery Type is set to "restricted discovery with application-controlled extension".

Announcing type can be set to "on demand" to indicate the "on demand" announcing is requested by UE for the indicated application.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, step 2 to step 3 are skipped.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The HSS provides the MSISDN of the UE. The HSS also provides the serving PLMN ID of where the UE is registered. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function creates a new discovery entry in the UE’s context for this request, and returns the corresponding identifier in the Discovery Response message in step 4.

2.a Optionally, the ProSe Function sends an Auth Request (RPAUID, Request Type) to the ProSe Application Server. The ProSe Function locates the ProSe Application Server based on the Application ID. The Request Type is set to "restricted discovery/announce".

If restricted Direct Discovery with application-controlled extension is used, the Auth Request message also includes the Allowed Number of Suffixes. The Allowed Number of Suffixes indicates how many ProSe Restricted Code Suffixes the ProSe Application Server can assign for the UE. The Request Type is set to "restricted discovery with application-controlled extension /announce".

2.b The ProSe Application Server returns an Auth Response (PDUID(s), Response Type) message. The PDUID(s) corresponds to the RPAUID stored in the ProSe Application Server. The Response Type is set to "restricted discovery/announce ack".

If restricted Direct Discovery with application-controlled extension is used, the Auth Response message also includes the ProSe Restricted Code Suffix pool. The ProSe Restricted Code Suffix pool contains the Suffix(es) allocated by the ProSe Application based on the inputs in step 2.a. The Request Type is set to "restricted discovery with application-controlled extension /announce ack".

The ProSe Function verifies that at least one of the received PDUID(s) belongs to the requesting UE.

NOTE 2: Whether steps 2.a and 2.b are executed depends on ProSe Function configuration, or policy regarding the specific Application Server. For example, if the ProSe Function can already verify the ownership locally, it does not have to perform the two steps.

NOTE 3: The length of the ProSe Restricted Code Suffix is chosen by the ProSe Application Server from a set of allowable lengths (e.g. 8 bits, 24 bits, 48 bits). This choice is per application, so that all UEs announcing ProSe Restricted Codes assigned for Restricted ProSe Application User IDs from that Application ID use the same Suffix length (which may be zero if no application-controlled extension is allowed for this Application).

NOTE 4: The ProSe Restricted Code Suffix pool needs to support the indication of a large number of or a range of ProSe Restricted Code Suffixes.

3. The ProSe Function in HPLMN allocates a ProSe Restricted Code and the associated validity timer. The ProSe Restricted Code corresponds to the RPAUID that was contained in the Discovery Request from the UE. The validity timer shall indicate for how long this ProSe Restricted Code is going to be valid. The UE will be authorised to announce this ProSe Restricted Code for the duration of validity timer and if it remains in the same PLMN. The ProSe Function stores the RPAUID, the ProSe Restricted Code and the associated validity timer in the user context.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Function in the HPLMN allocates a ProSe Restricted Code Prefix (rather than a ProSe Restricted Code) based on the Application ID and/or the Restricted ProSe App User ID.

If restricted ProSe Direct Discovery with "on demand" announcing has been requested, the ProSe Function determines if "on demand" announcing is authorized and enabled based on the Application ID and operator’s policy. If "on demand" announcing is authorized and enabled, the ProSe Function stores the RPAUID, the ProSe Restricted Code with the associated validity timer and the Announcing Enabled indicator in the user context.

NOTE 5: It is up to the policy in the ProSe Function whether to allocate the same ProSe Restricted Code for a set of several RPAUIDs or different ProSe Restricted Codes for the different RPAUIDs.

4. The ProSe Function in HPLMN responds to the UE with a Discovery Response (ProSe Restricted Code, validity timer, Discovery Entry ID, [PC5_tech]) message.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix, and the Discovery Response message also contains the ProSe Restricted Code Suffix pool.

If the "on demand" announcing is authorized and enabled in step 3 and there is no ongoing monitoring request, the ProSe Function in HPLMN does not provide a ProSe Restricted Code to the UE and responds to the UE with a Discovery Response (validity timer, Announcing Enabled indicator, Discovery Entry ID) message.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, the validity timer in the Discovery Response message is set to zero.

The optional PC5_tech parameter indicates the PC5 radio technology(ies) that is/are authorized to be used for the assigned ProSe Application Code. When this parameter is omitted, the authorized PC5 radio technology is E-UTRA.

NOTE 6: The announcing UE may receive the same ProSe Restricted Code as a result of different Announce Request procedures.

NOTE 7: The UE appends a ProSe Restricted Code Suffix from the ProSe Restricted Code Suffix pool to the ProSe Restricted Code Prefix to form a ProSe Restricted Code. When the ProSe Restricted Code Suffix pool contains multiple suffixes, the UE may use different suffixes from the ProSe Restricted Code Suffix pool to form different ProSe Restricted Codes to announce, without having to contact the ProSe Function as long as the ProSe Restricted Code Prefix is valid.

5. The UE may start announcing the provided ProSe Restricted Code in the serving PLMN, using the radio resources authorised and configured by E-UTRAN to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the "on demand" announcing is used and ProSe Function does not provide a ProSe Restricted Code to the UE in step 4, the UE waits for an Announcing Alert Request message from the ProSe Function in HPLMN before starting to announce over the air (see clause 5.3.5.1).

NOTE  8: The ProSe Protocol layer in the UE may inform the application client that it has started announcing. This is out of scope of 3GPP.

If the validity timer associated with a ProSe Restricted Code expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the validity timer), then the ProSe Function removes the entry related to that ProSe Restricted Code from the UE context.

5.3.3.3 Announce request (roaming/inter-PLMN transmission) – open discovery

Figure 5.3.3.3-1: Announce request procedure (roaming/inter-PLMN transmission)

The UE is only allowed to announce in the carrier frequency signalled from serving PLMN. When inter-PLMN discovery transmission is supported, the carrier frequency may be operated by Local PLMN.

0. The UE is configured with the data structure of the ProSe Application IDs corresponding to HPLMN. This step is performed using mechanisms that are out of scope of 3GPP.

1. If the UE is authorised to announce in the PLMN operating the carrier frequency signalled from the serving PLMN (VPLMN or Local PLMN), or if UE intends to make announcement using WLAN-based PC5 and is triggered to announce, it shall establish a secure connection with the ProSe Function in HPLMN and it shall then send a Discovery Request (ProSe Application ID, UE Identity, announce command, Application ID, Discovery Entry ID, [Requested Timer], [metadata], [Announcing PLMN ID], [Application Level Container], [PC5_tech]) message for announcing. The ProSe Application ID indicates what the UE is interested to announce. The UE Identity is set to e.g. IMSI. The Application ID represents a unique identifier of the UE application that has triggered the transmission of the Discovery Request message. The Discovery Entry ID indicates whether this is a new request. The Requested Timer is an optional parameter and indicates the length of validity timer associated with the ProSe Application Code that the UE expects to receive from the ProSe Function in step 5. When the Requested Timer is set to zero, procedures in clause 5.3.6A.1.3 shall be followed. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for announcements. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA. This request is always sent by the UE to the ProSe Function in HPLMN.

If dynamic metadata is used, the Discovery Request message also includes the metadata to be uploaded to the ProSe Function. Moreover, when the UE updates the metadata for a valid ProSe Application Code, the command is set to "metadata_update" in the Discovery Request message.

If inter-PLMN ProSe discovery transmission is supported, and the serving PLMN signalled carrier frequency is not operated by HPLMN or VPLMN, the UE shall include the PLMN ID of that carrier frequency in the Announcing PLMN ID.

If application-controlled extension is used, the Discovery Request message also includes the Application Level Container. The Application Level Container contains the request and any relevant information for the ProSe Application Server to assign a (set of) ProSe Application Code Suffix(es).

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The HSS provides the MSISDN of the UE. The HSS also provides the VPLMN ID of where the UE is registered. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function will create a new discovery entry in the UE’s context for this request, and will return the corresponding identifier in the Discovery Response message in step 5.

NOTE 1: Home ProSe Function can retain the previously camped PLMN ID and associated ProSe Application Code for an operator configurable time when informed by HSS of a PLMN change. When the configuration timer expires, the previously camped PLMN ID and associated ProSe Application Code can be removed from the UE context.

2.a If the UE indicated it desired application-controlled extension by the inclusion of the Application Level Container, the ProSe Function sends an Auth Request (ProSe Application ID, Request Type, Application Level Container, Allowed number of suffixes) to the ProSe Application Server. The Request Type is set to "open discovery with application-controlled extension /announce ". The Allowed Number of Suffixes indicates how many ProSe Restricted Code Suffixes the ProSe Application Server can assign for the UE. The ProSe Function locates the ProSe Application Server based on the Application ID.

2.b The ProSe Application Server returns an Auth Response (Response Type, ProSe Application Code Suffix pool) message. The ProSe Application Code Suffix pool contains the Suffix(es) allocated by the ProSe Application based on the inputs in step 2.a. The Response Type is set to "open discovery with application-controlled extension /announce ack".

NOTE 2: The length of the ProSe Restricted Code Suffix is chosen by the ProSe Application Server from a set of allowable lengths (e.g. 8 bits, 24 bits, 48 bits). This choice is per application, so that all UEs announcing ProSe application Codes assigned for ProSe Application IDs from that Application ID use the same Suffix length (which may be zero if no application-controlled extension is allowed for this Application).

NOTE 3: The ProSe Application Code Suffix pool needs to support the indication of a large number of or a range of ProSe Application Code Suffixes.

3. If the Discovery Request is authorised, then the HPLMN ProSe Function shall check whether the UE is authorized to use the ProSe Application ID contained in the Discovery Request. If the UE is authorised to use that ProSe Application ID, then the HPLMN ProSe Function shall inform the ProSe Function in VPLMN or Local PLMN if Announcing PLMN ID is included in step 1 with the Announce Authorisation (ProSe Application ID, ProSe Application Code, UE Identity, validity timer, Discovery Entry ID, [metadata], [PC5_tech]) message. The ProSe Application ID corresponds to the request from the UE, whereas the ProSe Application Code indicates the assigned code for this request. The request also includes the UE identity information e.g. IMSI or MSISDN and validity timer in order to allow the ProSe Function in VPLMN or Local PLMN to perform charging. The validity timer indicates for how long this ProSe Application Code is going to be valid; the ProSe Function in the HPLMN takes into account the Requested Timer parameter, if provided by the UE, when allocating the validity timer. If the ProSe Function in VPLMN or Local PLMN receives the same Discovery Entry ID in a subsequent Announce Authorization message, it updates the announcing UE’s corresponding discovery entry replacing the existing ProSe Application Code and validity timer with the last received ones. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 4: The information provided in step 3 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

If dynamic metadata is used , the ProSe Function stores the metadata with the associated ProSe Application ID in the UE context, and allocates a corresponding Metadata Index to be included into the ProSe Application Code. Moreover, if the command is set to "metadata_update" in step 1, the ProSe Function only updates the Metadata Index portion of the ProSe Application Code, and keeps the rest unchanged. The metadata is also included in the Announce Authorisation message.

If application-controlled extension is used, the ProSe Function in the HPLMN allocates a ProSe Application Code Prefix (rather than a ProSe Application Code) based on the Application ID.

4. The ProSe Function in VPLMN or Local PLMN authorizes the UE to perform ProSe Direct Discovery announcing.

5. The ProSe Function in HPLMN shall respond to the UE with a Discovery Response (ProSe Application Code, validity timer, Discovery Entry ID, [PC5_tech]) message. ProSe Application Code is provided by the ProSe Function in HPLMN and corresponds to the ProSe Application ID that was contained in the Discovery Request from the UE. The validity timer shall indicate for how long this ProSe Application Code is going to be valid. The UE will be authorised to announce this ProSe Application Code for the duration of validity timer and if it remains in the same PLMN. The optional PC5_tech parameter indicates the PC5 radio technology(ies) that is/are authorized to be used for the assigned ProSe Application Code. When this parameter is omitted, the authorized PC5 radio technology is E-UTRA.

If application-controlled extension is used, the ProSe Application Code is replaced by the ProSe Application Code Prefix, and the Discovery Response message also contains the ProSe Application Code Suffix pool.

NOTE 5: To avoid interrupting the discovery procedure, if the UE changes PLMN but the validity timer of the Prose Application Code has not yet expired then the ProSe Function may allocate the same ProSe Application Code to the UE, with a validity timer set to the residual validity time of the validity timer not yet expired.

NOTE 6: The UE appends a ProSe Application Code Suffix from the ProSe Application Code Suffix pool to the ProSe Application Code Prefix to form a ProSe Application Code. When the ProSe Application Code Suffix pool contains multiple suffixes, the UE may use different suffixes from the ProSe Application Code Suffix pool to form different ProSe Application Codes to announce, without having to contact the ProSe Function as long as the ProSe Application Code Prefix is valid.

6. The UE may start announcing the provided ProSe Application Code in the VPLMN or Local PLMN, using the radio resources authorised and configured by E-UTRAN to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the validity timer associated with a ProSe Application Code expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the validity timer), then the ProSe Function removes the entry related to that ProSe Application Code from the UE context.

5.3.3.3A Announce Request (roaming/inter-PLMN transmission) – restricted discovery

Figure 5.3.3.3A-1: Announce Request procedure for restricted discovery (roaming)

The UE is only allowed to announce in the carrier frequency signalled from serving PLMN. When inter-PLMN discovery transmission is supported, the carrier frequency may be operated by Local PLMN.

0. The user sets the permission for the restricted discovery using application layer mechanisms. In addition, the application client in the UE retrieves the PDUID and provides it to the ProSe Application Server. The ProSe Application Server allocates a RPAUID for that PDUID, stores the binding between the PDUID and the RPAUID and returns the RPAUID to the application client in the UE. The UE may optionally provide metadata to be associated with the RPAUID, and the ProSe Application Server stores the metadata. The application client in the UE stores the binding between the PDUID and its own RPAUID. If the application client in the UE intends to use the ProSe service, it triggers the UE to perform the announce procedure, providing its own RPAUID obtained by the ProSe Application Server.

NOTE 1: The procedures in step 0 are out of scope of 3GPP. However, it is expected that the application client in the UE will be able to retrieve the PDUID from the underlying ProSe Protocol layer.

1. If the UE is authorized to announce in the PLMN operating the carrier frequency signalled by the serving PLMN, or if UE intends to make announcement using WLAN-based PC5 and is triggered by the application client to announce, it shall establish a secure connection with the ProSe Function in HPLMN and send a Discovery Request message (RPAUID, UE Identity, command=announce, Discovery Type, Application ID, Discovery Entry ID, Requested Discovery Timer, Application Level Container, Announcing Type, [Announcing PLMN ID], [PC5_tech]) for announcing. The RPAUID indicating what the UE is interested to announce was obtained in step 0. The UE Identity is set to IMSI. The Application ID represents a unique identifier of the UE application that has triggered the transmission of the Discovery Request message. The Discovery Type is set to "restricted discovery". The Discovery Entry ID indicates whether this is a new request. The Requested Discovery Timer is an optional parameter and indicates the length of validity timer associated with the ProSe Restricted Code that the UE expects to receive from the ProSe Function in step 6. When the Requested Discovery Timer is set to zero, the ProSe Function shall remove the discovery entry indicated by the Discovery Entry ID, and release the associated resources. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for announcements. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, step 2 to step 3 are skipped.

If restricted Direct Discovery with application-controlled extension is used, the Discovery Request message also includes the Application Level Container. The Application Level Container contains the request and any relevant information (e.g. intent to use metadata indication in the suffix) for the ProSe Application Server to assign a (set of) ProSe Restricted Code Suffix(es). The Discovery Type is set to "restricted discovery with application-controlled extension".

Announcing type can be set to "on demand" to indicate the "on demand" announcing is requested by UE for the indicated application.

If inter-PLMN ProSe discovery transmission is supported, and the serving PLMN signalled carrier frequency is not operated by HPLMN or VPLMN, the UE shall include the PLMN ID of that carrier frequency in the Announcing PLMN ID.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The HSS provides the MSISDN of the UE. The HSS also provides the serving PLMN ID of where the UE is registered. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function creates a new discovery entry in the UE’s context for this request, and returns the corresponding identifier in the Discovery Response message in step 6.

2.a Optionally, the ProSe Function sends an Auth Request (RPAUID, Request Type) to the ProSe Application Server. The ProSe Function locates the ProSe Application Server based on the Application ID. The Request Type is set to "restricted discovery/announce".

If restricted Direct Discovery with application-controlled extension is used, the Auth Request message also includes the Allowed Number of Suffixes. The Allowed Number of Suffixes indicates how many suffixes the ProSe Application Server can provide to the UE. The Request Type is set to "restricted discovery with application-controlled extension /announce".

2.b The ProSe Application Server returns an Auth Response (PDUID(s), Response Type) message. The PDUID(s) corresponds to the RPAUID stored in the ProSe Application Server. The Response Type is set to "restricted discovery/announce ack".

If restricted Direct Discovery with application-controlled extension is used, the Auth Response message also includes the ProSe Restricted Code Suffix pool. The ProSe Restricted Code Suffix pool contains the Suffix(es) allocated by the ProSe Application based on the inputs in step 2.a. The Response Type is set to "restricted discovery with application-controlled extension /announce ack".

The ProSe Function verifies that at least one of the received PDUID(s) belongs to the requesting UE.

NOTE 2: Whether steps 2.a and 2.b are executed depends on ProSe Function configuration, or policy regarding the specific Application Server. For example, if the ProSe Function can already verify the ownership locally, it does not have to perform the two steps.

NOTE 3: The length of the ProSe Restricted Code Suffix is chosen by the ProSe Application Server from a set of allowable lengths (e.g. 8 bits, 24 bits, 48 bits). This choice is per application, so that all UEs announcing ProSe Restricted Codes assigned for Restricted ProSe Application User IDs from that Application ID use the same Suffix length (which may be zero if no application-controlled extension is allowed for this Application).

NOTE 4: The ProSe Restricted Code Suffix pool needs to support the indication of a large number of or a range of ProSe Restricted Code Suffixes.

3. The ProSe Function in HPLMN allocates a ProSe Restricted Code and the associated validity timer. The ProSe Restricted Code corresponds to the RPAUID that was contained in the Discovery Request from the UE. The validity timer shall indicate for how long this ProSe Restricted Code is going to be valid. The UE will be authorised to announce this ProSe Restricted Code for the duration of validity timer and if it remains in the same PLMN. The ProSe Function stores the RPAUID, the ProSe Restricted Code and the associated validity timer in the user context.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Function in the HPLMN allocates a ProSe Restricted Code Prefix (rather than a ProSe Restricted Code) based on the Application ID and/or the Restricted ProSe App User ID.

If restricted ProSe Direct Discovery with "on demand" announcing has been requested, the ProSe Function determines if "on demand" announcing is authorized and enabled based on the Application ID and operator’s policy. If "on demand" announcing is authorized and enabled, the ProSe Function stores the RPAUID, the ProSe Restricted Code with the associated validity timer and the Announcing Enabled indicator in the user context.

NOTE 5: It is up to the policy in the ProSe Function whether to allocate the same ProSe Restricted Code for a set of several RPAUIDs or different ProSe Restricted Codes for the different RPAUIDs.

NOTE 6: If "on demand" announcing is authorized and enabled in step 3 and there is no ongoing monitoring request, steps 4 and 5 are not executed.

4. If the Discovery Request is authorized and verified, the HPLMN ProSe Function shall inform the ProSe Function in VPLMN or Local PLMN if Announcing PLMN ID is included in step 1 with the Announce Authorization (RPAUID, Application ID, validity timer, ProSe Restricted Code, UE Identity, Discovery Entry ID, [PC5_tech]) message. The RPAUID and Application ID correspond to the request from the UE, whereas the ProSe Restricted Code indicates the assigned code for this request. The request shall include the UE identity information e.g. IMSI or MSISDN and validity timer in order to allow the ProSe Function in VPLMN or Local PLMN to perform charging. The validity timer indicates for how long this ProSe Restricted Code is going to be valid. If the ProSe Function in VPLMN or Local PLMN receives the same Discovery Entry ID in a subsequent Announce Authorization message, it updates the announcing UE’s corresponding discovery entry replacing the existing ProSe Restricted Code and validity timer with the last received ones. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 7: The information provided in step 4 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix, and the Announce Authorization message also contains the ProSe Restricted Code Suffix pool.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, the ProSe Function in HPLMN shall inform the ProSe Function in VPLMN or Local PLMN with the validity timer set to zero. The ProSe Function removes the discovery entry indicated by the Discovery Entry ID, and releases the associated resources.

5. The ProSe Function in VPLMN or Local PLMN authorizes the UE to perform Restricted ProSe Discovery announcing.

6. The ProSe Function in HPLMN responds to the UE with a Discovery Response (ProSe Restricted Code, validity timer, Discovery Entry ID, [PC5_tech]) message.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix, and the Discovery Response message also contains the ProSe Restricted Code Suffix pool.

If the "on demand" announcing is authorized and enabled in step 3 and there is no ongoing monitoring request, the ProSe Function in HPLMN does not provide a ProSe Restricted Code to the UE and responds to the UE with a Discovery Response (validity timer, Announcing Enabled indicator, Discovery Entry ID) message.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, the validity timer in the Discovery Response message is set to zero.

The optional PC5_tech parameter indicates the PC5 radio technology(ies) that is/are authorized to be used for the assigned ProSe Restricted Code. When this parameter is omitted, the authorized PC5 radio technology is E-UTRA.

NOTE 8: The announcing UE may receive the same ProSe Restricted Code as a result of different Announce Request procedures.

NOTE 9: The UE appends a ProSe Restricted Code Suffix from the ProSe Restricted Code Suffix pool to the ProSe Restricted Code Prefix to form a ProSe Restricted Code. When the ProSe Restricted Code Suffix pool contains multiple suffixes, the UE may use different suffixes from the ProSe Restricted Code Suffix pool to form different ProSe Restricted Codes to announce, without having to contact the ProSe Function as long as the ProSe Restricted Code Prefix is valid.

7. The UE may start announcing the provided ProSe Restricted Code in the VPLMN or Local PLMN, using the radio resources authorised and configured by E-UTRAN to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the "on demand" announcing is used and ProSe Function does not provide a ProSe Restricted Code to the UE in step 6, the UE waits for an Announcing Alert Request message from the ProSe Function in HPLMN before starting to announce over the air (see clause 5.3.5.2).

NOTE 10: The ProSe Protocol layer in the UE may inform the application client that it has started announcing. This is out of scope of 3GPP.

If the validity timer associated with a ProSe Restricted Code expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the validity timer), then the ProSe Function removes the entry related to that ProSe Restricted Code from the UE context.

5.3.3.4 Monitor request (non-roaming) – open discovery

Figure 5.3.3.4-1: Monitor request procedure (non-roaming)

0. The UE is configured with the data structure of the ProSe Application IDs corresponding to PLMNs the UE is authorised to monitor. This step is performed using mechanisms that are out of scope of 3GPP.

1. If the UE is authorised to monitor in at least one PLMN, or if UE intends to use WLAN-based PC5 for monitoring and is interested to monitor certain ProSe Application ID(s), it shall establish a secure connection with ProSe Function in the HPLMN to which it shall then send a Discovery Request (ProSe Application ID(s), UE Identity, monitor command, Application ID, Discovery Entry ID, [Requested Timer], [PC5_tech]) message for monitoring. The ProSe Application ID(s) indicate what the UE is interested to monitor and they consist a subset of the data structure of the PLMN. The UE Identity is set to e.g. IMSI. The Application ID represents a unique identifier of the application that has triggered the transmission of the Discovery Request message. The Discovery Entry ID indicates whether this is a new request. The Requested Timer is an optional parameter. When the Requested Timer is set to zero, procedures in clause 5.3.6A.1.3 shall be followed. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for monitoring. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA. This request is always sent to the ProSe Function in HPLMN.

If application-controlled extension is used, the Application Level Container is included; it contains information corresponding to the ProSe Application Code Suffix.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and create a new context for this UE that contains the subscription parameters for this UE. The HSS provides the MSISDN of the UE. The authorisation information also contains the PLMNs that this UE is allowed to perform discovery. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function will create a new discovery entry in the UE’s context for this request, and will return the corresponding identifier in the Discovery Response message in step 5.

2a. If the UE indicated that it desires application-controlled extension by the inclusion of the Application Level Container, the ProSe Function sends an Auth Request (ProSe Application ID, Request Type, Application Level Container) to the Application Server indicated by the Application ID. The Request Type is set to "open discovery with application controlled extension/monitor".

2b. The ProSe Application Server returns an Auth Response (Response Type, mask(s) for the ProSe Application Code Suffix(es) corresponding to ProSe Application ID). The Response Type is set to "open discovery with application-controlled extension /monitor ack".

If the Discovery Request is authorised, and the ProSe Application ID sent by the UE in step 1 indicates another Local PLMN then steps 3-6 are executed, otherwise (i.e. the ProSe Application ID indicates HPLMN) only steps 5-6 are executed:

3. When the ProSe Application ID has PLMN-specific scope then the ProSe Function in HPLMN shall contact if needed) other PLMNs that are indicated by the ProSe Application ID(s) sent by the UE, in order to resolve the corresponding ProSe Application ID Name(s) to ProSe Application Code(s) and/or a ProSe Application Mask. The request shall also include the UE identity information e.g. IMSI or MSISDN in order to allow the ProSe Function in Local PLMN to perform charging and the Discovery Entry ID. If the ProSe Function in other PLMN receives the same Discovery Entry ID in a subsequent Monitor Request message, it updates the monitoring UE’s corresponding discovery entry with the received corresponding parameters. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 1: The information provided in step 3 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

4. If the ProSe Function of the Local PLMN stores valid ProSe Application Code(s) corresponding to the requested ProSe Application ID Name(s) and the requested PC5 radio technology (as indicated in step 3), then the ProSe Function of the Local PLMN returns the related ProSe Application Code(s) and/or ProSe Application Mask(s) and the corresponding TTL for each.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for monitoring. When the parameter is omitted the intended PC5 radio technology is E-UTRA.

If application-controlled extension is used, the ProSe Application Code is replaced by the ProSe Application Code Prefix.

5. The ProSe Function in the HPLMN shall respond with a Discovery Response (Discovery Filter(s), Discovery Entry ID, [PC5_tech]) message. The TTL(s) in the Discovery Filter(s) indicates for how long the Discovery Filter(s) is going to be valid.

If application-controlled extension is used, the ProSe Application Code in the Discovery Filter is replaced by the ProSe Application Code Prefix. Besides the ProSe Application Code(s), the Discovery Filter may also contain the mask(s) for the ProSe Application Code Suffix, which is/are obtained in from ProSe Application Server in step 2b. The UE may add additional mask(s) and values for the Suffix part.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for the Discovery Filter(s). When the parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 2: The UE can randomize the request for assignment of new Discovery Filter in order to guard against a peak of Discovery Requests when the TTL expires.

NOTE 3: To allow a change of the announced ProSe Application Code without interrupting the discovery procedure, two Discovery Filters for the same ProSe Application ID can be provided to the UE (as the monitoring UE would have Discovery Filters for both the ProSe Application Code which is currently in use by the announcing UE as well as the ProSe Application Code which will replace the current one). Alternatively a ProSe Application Mask, which is able to match both ProSe Application Codes, can be provided.

NOTE 4: It is up to Stage 3 to specify the behaviour of ProSe Functions in HPLMN and/or Local PLMN when a valid ProSe Application Code is not available for the requested ProSe Application ID.

6. The UE may start monitoring using the Discovery Filter(s) in the radio resources that are authorized and configured by the PLMN(s) to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the TTL corresponding to a Discovery Filter expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the TTL), then the ProSe Function removes the entry related to that Discovery Filter from the UE context.

5.3.3.4A Monitor Request (non-roaming) – restricted discovery

Figure 5.3.3.4A-1: Monitor Request procedure for restricted discovery (non-roaming)

0. In this step, the application client in the UE retrieves its own PDUID and provides it to the ProSe Application Server. The ProSe Application Server allocates a Restricted ProSe Application User ID (RPAUID) for that PDUID, stores the binding between the PDUID and the RPAUID and returns the RPAUID to the application client in the UE. The application client in the UE stores the binding between the PDUID and its own RPAUID.

When the application client in the UE intends to discover the announcing UE of other users (e.g. friends in the application), it obtains the RPAUID of those users (Target RPAUID(s)) from the ProSe App Server and triggers the UE to perform the monitor procedure, providing its own RPAUID and the Target RPAUIDs. The Target RPAUIDs of the UEs to be monitored are passed in an Application Level Container.

NOTE 1: The procedures in step 0 are out of scope of 3GPP. However, it is expected that the application client in the UE will be able to retrieve the PDUID from the underlying ProSe Protocol layer.

1. If the UE is authorised to monitor in at least one PLMN, or if UE intends to use WLAN-based PC5 for monitoring and is triggered by the application client to monitor, it shall establish a secure connection with the ProSe Function in HPLMN and it shall send a Discovery Request message to get the Discovery Filter for monitoring (RPAUID, UE Identity, command=monitor, Discovery Type, Application ID, Application Level Container, Discovery Entry ID, Requested Discovery Timer, [PC5_tech]). The Application Level Container contains the Target RPAUIDs indicating what the UE is interested to monitor. The RPAUID indicates the identity the UE uses to obtain the permission to monitor. The UE Identity is set to IMSI. The Application ID represents a unique identifier of the application that has triggered the transmission of the Discovery Request message. Discovery Type is set to "restricted discovery". The Discovery Entry ID indicates whether this is a new request. The Requested Discovery Timer is an optional parameter. When the Requested Discovery Timer is set to zero, the ProSe Function shall delete the Discovery Filter(s) indicated by the Discovery Entry ID, and release the associated resources.

If restricted Direct Discovery with application-controlled extension is used, the Application Level Container may also include some information corresponding to the ProSe Restricted Code Suffix, e.g. group or user-specific information. The Discovery Type is set to "restricted discovery with application-controlled extension".

PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for monitoring. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, step 2 to step 9 are skipped.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The HSS provides also the PLMN ID where the UE is registered. The HSS provides the MSISDN of the UE. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function creates a new discovery entry in the UE’s context for this request, and returns the corresponding identifier in the Discovery Response message in step 10.

3. The ProSe Function sends an Auth Request (RPAUID, Request Type, Application Level Container) to the Application Server indicated by the Application ID. The Request Type is set to "restricted discovery/monitor".

If restricted Direct Discovery with application-controlled extension is used, the Request Type is set to "restricted discovery with application-controlled extension".

4. If, based on the permission setting, the RPAUID is allowed to discover at least one of the Target RPAUID(s) contained in the Application Level Container, the ProSe Application Server returns an Auth Response (PDUID, Response Type, N sets of Target PDUID – Target RPAUID – Metadata Indicator, Application Level Container). The Response Type is set to "restricted discovery/monitor ack". Each Target PDUID is returned with the corresponding Target RPAUID(s) that the RPAUID is allowed to discover. The ProSe Function verifies that the returned PDUID belongs to the requesting UE. The Application Level Container includes the successful authenticated Target RPAUID(s).

The Metadata Indicator is optional and signals whether there is metadata associated with the RPAUID, and if so, whether update to the metadata is allowed.

NOTE 2: If metadata update is allowed, the ProSe Function needs to contact the ProSe Application Server in every Match Report procedure if the UE desires the latest metadata.

If restricted Direct Discovery with application-controlled extension is used, the Response Type is set to "Restricted discovery with application-controlled extension /monitor ack". The Auth Response may also include the mask(s) for the ProSe Restricted Code Suffix(es) corresponding to each of the Target Restricted ProSe App User ID(s).

Step 5 is executed only when the PLMN ID in the Target ProSe Disc UE ID indicates the HPLMN.

5. If the PLMN ID in the Target PDUID indicates the HPLMN and at least one of received pair of Target PDUID – Target RPAUID corresponds to a valid ProSe Restricted Code including a valid PC5 radio technology match as indicated via the PC5_tech parameter in step 1, the ProSe Function in the HPLMN retrieves the ProSe Restricted Code corresponding to that Target PDUID, Application ID and Target RPAUID. The Prose Function in the HPLMN stores, in the context of the announcing UE, the PDUID of the monitoring UE.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix.

If the Announcing Enabled indicator is stored in the UE context, the ProSe Function of HPLMN shall trigger the Announcing Alert procedure (see clause 5.3.5) to notify the announcing UE to perform announcing.

Steps 6-9 are executed only when the PLMN ID in the Target ProSe Disc UE ID indicates a different PLMN.

6. If the PLMN ID in the Target PDUID indicates a PLMN different from the HPLMN, the ProSe Function in the HPLMN contacts the ProSe Function in that PLMN to retrieve the corresponding ProSe Restricted Code with a Monitor Request (RPAUID, UE Identity, Target PDUID, Application ID, Target RPAUID, Discovery Entry ID, [PC5_tech]) message. The request shall include the UE identity information e.g. IMSI or MSISDN in order to allow the ProSe Function in that PLMN to perform charging. If the ProSe Function in other PLMN receives the same Discovery Entry ID in a subsequent Monitor Request message, it updates the monitoring UE’s corresponding discovery entry with the received corresponding parameters. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 3: The information provided in step 6 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

7. If the pair of Target PDUID – Target RPAUID received from the HPLMN ProSe Function corresponds to a valid ProSe Restricted Code including a valid PC5 radio technology match as indicated via the PC5_tech parameter in step 6, the ProSe Function in the other PLMN retrieves the ProSe Restricted Code corresponding to that Target PDUID, Application ID and Target RPAUID.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix.

If the Announcing Enabled indicator is stored in the UE context at the ProSe Function in the other PLMN (announcing UE’s HPLMN), then the ProSe Function in the other PLMN shall trigger the Announcing Alert procedure (see clause 5.3.5) to notify the announcing UE to perform announcing.

8.a Optionally, the ProSe Function in the other PLMN sends an Auth Request (RPAUID , Request Type, Target RPAUID) to the Application Server indicated by the Application ID. The Request Type is set to "restricted discovery/permission".

8.b If, based on the permission setting, the RPAUID is allowed to discover the Target RPAUID, the ProSe Application Server acknowledges the Auth Request with an Auth Response (Target PDUID, Response Type). The Response Type is set to "restricted discovery/permission ack". The ProSe Function in the other PLMN verifies that the returned Target PDUID corresponds to the UE to be monitored.

NOTE 4: Whether steps 8.a and 8.b are executed depends on ProSe Function configuration, or policy regarding the specific Application Server. For example, if the ProSe Function can verify the permission locally, or the HPLMN is trusted by the other PLMNs for permission control, these steps are not needed.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix.

9. The ProSe Function in the other PLMN returns to the ProSe Function in the HPLMN the ProSe Restricted Code and the corresponding residual validity timer with a Monitor Response (ProSe Restricted Code, validity timer, [PC5_tech]) message. The Prose Function in the other PLMN also stores, in the context of the announcing UE, the PDUID of the monitoring UE.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for monitoring. When the parameter is omitted the intended PC5 radio technology is E-UTRA.

10. For each pair of Target PDUID – Target RPAUID returned by the application server in step 4, if the ProSe Function in the HPLMN has retrieved a valid ProSe Restricted Code, it builds the binding between ProSe Restricted Code with validity timer, Application ID, Target RPAUID, Metadata Indicator and Target PDUID and stores it into the discovery entry in the user context of the monitoring UE. Based on the ProSe Restricted Code and the associated validity timer the ProSe Function in the HPLMN allocates a Discovery Filter with the corresponding TTL.

The ProSe Function in the HPLMN returns a Discovery Response (Discovery Filter(s), Metadata Indicator, Discovery Entry ID, Application Level Container, [PC5_tech]) message to the UE. The Discovery Filter includes the ProSe Restricted Code to be monitored and the TTL that indicates for how long the related ProSe Restricted Code in the Discovery Filter is valid after it is received. If configured by the operator, the Target RPAUID(s) and metadata corresponding to the ProSe Restricted Code(s) may be included in the Discovery Response message. The ProSe Function stores in the user context all the parameters passed to the UE.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix. Besides the ProSe Restricted Code(s), the Discovery Filter may also contain the mask(s) for the ProSe Restricted Code Suffix, which is/are obtained in from ProSe Application Server in step 4. The UE may add additional mask(s) and values for the Suffix part.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, the TTL in the Discovery Response message is set to zero.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for the Discovery Filter(s). When the parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 5: When the Target RPAUID, corresponding to the ProSe Restricted Code in the Discovery Filter, is included in the Discovery Response message, then the Match Report procedure may be skipped.

NOTE 6: The ProSe Restricted Code in different Discovery Filters may be the same, for example, when the monitoring user is a friend of the announcing user in more than one application, for which the announcing user was allocated the same ProSe Restricted Code.

11. The UE obtains the corresponding radio resources that are authorized and configured by the PLMN(s) to be used for ProSe as defined in RAN specifications or uses WLAN, or both and starts to monitor using the Discovery Filter. The UE provides the Application Level Container, which contains the successful authenticated Target RPAUID(s), to the application client.

NOTE 7: The ProSe Protocol layer in the UE may inform the application client that it has started monitoring.

If the TTL corresponding to a Discovery Filter expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the TTL), then the ProSe Function removes the entry related to that Discovery Filter from the UE context.

5.3.3.5 Monitor request (roaming) – open discovery

Figure 5.3.3.5-1: Monitor request procedure (roaming)

0. The UE is configured with the data structure of the ProSe Application IDs corresponding to PLMNs the UE is authorised to monitor. This step is performed using mechanisms out of scope of 3GPP.

1. If the UE is authorised to monitor in at least one PLMN, or if UE intends to use WLAN-based PC5 for monitoring and is interested to monitor certain ProSe Application ID(s), it shall establish a secure connection with the ProSe Function in HPLMN and it shall send a Discovery Request (ProSe Application ID(s), UE Identity, monitor command, Application ID, Discovery Entry ID, [Requested Timer], [PC5_tech]) message for monitoring. The ProSe Application ID(s) indicate what the UE is interested to monitor and they consist of a subset of the data structure of the PLMN. The UE Identity is set to e.g. IMSI. The Application ID represents a unique identifier of the application that has triggered the transmission of the Discovery Request message. The Discovery Entry ID indicates whether this is a new request. The Requested Timer is an optional parameter. When the Requested Timer is set to zero, procedures in clause 5.3.6A.1.3 shall be followed. PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for monitoring. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA. This request is always sent to the ProSe Function in HPLMN.

If application-controlled extension is used, the Application Level Container is included; it contains information corresponding to the ProSe Application Code Suffix.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The authorisation information also contains the PLMNs that this UE is allowed to perform discovery. The HSS provides also the VPLMN ID where the UE is registered. The HSS provides the MSISDN of the UE. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function will create a new discovery entry in the UE’s context for this request, and will return the corresponding identifier in the Discovery Response message in step 5.

2a. If the UE indicated that it desires application-controlled extension by the inclusion of the Application Level Container, the ProSe Function sends an Auth Request (ProSe Application ID, Request Type, Application Level Container) to the Application Server indicated by the Application ID. The Request Type is set to "open discovery with application controlled extension/monitor".

2b. The ProSe Application Server returns an Auth Response (Response Type, mask(s) for the ProSe Application Code Suffix(es) corresponding to ProSe Application ID). The Response Type is set to "open discovery with application-controlled extension /monitor ack".

If the Discovery Request is authorised, and the ProSe Application ID sent by the UE in step 1 indicates another PLMN and not the HPLMN, then steps 3-6 are executed, otherwise (i.e. the ProSe Application ID indicates HPLMN) only steps 5-6 are executed:

3. When the ProSe Application ID has PLMN-specific scope then the ProSe Function in HPLMN shall contact (if needed) other PLMNs that are indicated by the ProSe Application ID(s) sent by the UE, in order to resolve the corresponding ProSe Application ID Name(s) to ProSe Application Code(s) and/or a ProSe Application Mask. The request shall also include the UE identity information e.g. IMSI or MSISDN, in order to allow the ProSe Function in Local/Visited PLMN to perform charging and the Discovery Entry ID. If the ProSe Function in other PLMN receives the same Discovery Entry ID in a subsequent Monitor Request message, it updates the monitoring UE’s corresponding discovery entry with the received corresponding parameters. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 1: The information provided in step 3 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

4. If the ProSe Function of the other PLMN stores valid ProSe Application Code(s) corresponding to the requested ProSe Application ID Name(s) and the requested PC5 radio technology (as indicated in step 3), then the ProSe Function of the VPLMN/Local PLMN returns the related ProSe Application Code(s) and/or ProSe Application Mask(s) and the corresponding TTL for each. Based on the UE context in the ProSe Function of the VPLMN/Local PLMN, it also includes the PLMN ID of the PLMN that the "announcing UE" is registered (if roaming) for the ProSe Function in HPLMN of the monitoring UE to store in the associated UE context.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for monitoring. When the parameter is omitted the intended PC5 radio technology is E-UTRA.

If application-controlled extension is used, the ProSe Application Code is replaced by the ProSe Application Code Prefix.

5. The ProSe Function in the HPLMN responds with a Discovery Response (Discovery Filter(s), Discovery Entry ID, [PC5_tech]) message. The TTL(s) in the Discovery Filter(s) indicate for how long the Discovery Filter(s) are going to be valid.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for the Discovery Filter(s). When the parameter is omitted the intended PC5 radio technology is E-UTRA.

If application-controlled extension is used, the ProSe Application Code in the Discovery Filter is replaced by the ProSe Application Code Prefix. Besides the ProSe Application Code(s), the Discovery Filter may also contain the mask(s) for the ProSe Application Code Suffix, which is/are obtained in from ProSe Application Server in step 2b. The UE may add additional mask(s) and values for the Suffix part.

NOTE 2: The UE can randomize the request for assignment of new Discovery Filter in order to guard against a peak of Discovery Requests when the TTL expires.

NOTE 3: To allow a change of the announced ProSe Application Code without interrupting the discovery procedure, two Discovery Filters for the same ProSe Application ID can be provided to the UE (as the monitoring UE would have Discovery Filters for both the ProSe Application Code which is currently in use by the announcing UE as well as the ProSe Application Code which will replace the current one). Alternatively a ProSe Application Mask, which is able to match both ProSe Application Codes, can be provided.

NOTE 4: It is up to Stage 3 to specify the behaviour of ProSe Functions in HPLMN and/or Local PLMN when a valid ProSe Application Code is not available for the requested ProSe Application ID.

6. The UE may start monitoring using the Discovery Filter(s) in the radio resources that are authorized and configured by the PLMN(s) to be used for ProSe as defined in RAN specifications or using WLAN, or both.

If the TTL corresponding to a Discovery Filter expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the TTL), then the ProSe Function removes the entry related to that Discovery Filter from the UE context.

5.3.3.5A Monitor Request (roaming) – restricted discovery

Figure 5.3.3.5A-1: Monitor Request procedure for restricted discovery (roaming)

0. In this step, the application client in the UE retrieves its own PDUID and provides it to the ProSe Application Server. The ProSe Application Server allocates a Restricted ProSe Application User ID (RPAUID) for that PDUID, stores the binding between the PDUID and the RPAUID and returns the RPAUID to the application client in the UE. The application client in the UE stores the binding between the PDUID and its own RPAUID.

When the application client in the UE intends to discover the announcing UE of other users (e.g. friends in the application), it obtains the RPAUID of those users (Target RPAUIDs) from the ProSe App Server and triggers the UE to perform the monitor procedure, providing its own RPAUID and the Target RPAUIDs. The Target RPAUIDs of the UEs to be monitored are passed in an Application Level Container.

NOTE 1: The procedures in step 0 are out of scope of 3GPP. However, it is expected that the application client in the UE will be able to retrieve the PDUID from the underlying ProSe Protocol layer.

1. If the UE is authorised to monitor in at least one PLMN, or if UE intends to use WLAN-based PC5 for monitoring and is triggered by the application client to monitor, it shall establish a secure connection with the ProSe Function in HPLMN and it shall send a Discovery Request message to get the Discovery Filter for monitoring (RPAUID, UE Identity, command=monitor, Discovery Type, Application ID, Application Level Container, Discovery Entry ID, Requested Discovery Timer, [PC5_tech]). The Application Level Container contains the Target RPAUIDs indicating what the UE is interested to monitor. The RPAUID indicates the identity the UE uses to obtain the permission to monitor. The UE Identity is set to IMSI. The Application ID represents a unique identifier of the application that has triggered the transmission of the Discovery Request message. Discovery Type is set to "restricted discovery". The Discovery Entry ID indicates whether this is a new request. The Requested Discovery Timer is an optional parameter. When the Requested Discovery Timer is set to zero, the ProSe Function shall delete the Discovery Filter(s) indicated by the Discovery Entry ID, and release the associated resources.

If restricted Direct Discovery with application-controlled extension is used, the Application Level Container may also include some information corresponding to the ProSe Restricted Code Suffix, e.g. group or user-specific information. The Discovery Type is set to "restricted discovery with application-controlled extension".

PC5_tech is an optional parameter that indicates the PC5 radio technology (e.g. E-UTRA, WLAN) that UE wishes to use for monitoring. PC5_tech may include more than one PC5 radio technology. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, step 2 to step 9 are skipped.

2. The ProSe Function checks for the authorization of the application represented by the Application ID. If there is no associated UE context, the ProSe Function shall check with HSS the authorisation for discovery and, if necessary, create a new context for this UE that contains the subscription parameters for this UE. The HSS provides also the PLMN ID where the UE is registered. The HSS provides the MSISDN of the UE. When the Discovery Entry ID in the Discovery Request message does not contain a valid value for this UE, the ProSe Function creates a new discovery entry in the UE’s context for this request, and returns the corresponding identifier in the Discovery Response message in step 10.

3. The ProSe Function sends an Auth Request (RPAUID, Request Type, Application Level Container) to the Application Server indicated by the Application ID. The Request Type is set to "restricted discovery/monitor".

If restricted Direct Discovery with application-controlled extension is used, the Request Type is set to "restricted discovery with application-controlled extension".

4. If, based on the permission setting, the RPAUID is allowed to discover at least one of the Target RPAUID(s) contained in the Application Level Container, the ProSe Application Server returns an Auth Response (PDUID, Response Type, N sets of Target PDUID – Target RPAUID – Metadata Indicator, Application Level Container). The Response Type is set to "restricted discovery/monitor ack". Each Target PDUID is returned with the corresponding Target RPAUID(s) that the RPAUID is allowed to discover. The ProSe Function verifies that the returned PDUID belongs to the requesting UE. The Application Level Container includes the successful authenticated Target RPAUID(s).

The Metadata Indicator is optional and signals whether there is metadata associated with the RPAUID, and if so, whether update to the metadata is allowed.

NOTE 2: If metadata update is allowed, the ProSe Function needs to contact the ProSe Application Server in every Match Report procedure if the UE desires the latest metadata.

If restricted Direct Discovery with application-controlled extension is used, the Response Type is set to "Restricted discovery with application-controlled extension /monitor ack". The Auth Response may also include the mask(s) for the ProSe Restricted Code Suffix(es) corresponding to each of the Target Restricted ProSe App User ID(s).

Step 5 is executed only when the PLMN ID in the Target ProSe Disc UE ID indicates the HPLMN.

5. If the PLMN ID in the Target PDUID indicates the HPLMN and at least one of received pair of Target PDUID – Target RPAUID corresponds to a valid ProSe Restricted Code including a valid PC5 radio technology match as indicated via the PC5_tech parameter in step 1, the ProSe Function in the HPLMN retrieves the ProSe Restricted Code corresponding to that Target PDUID, Application ID and Target RPAUID. The Prose Function in the HPLMN stores, in the context of the announcing UE, the PDUID of the monitoring UE and the allocated validity timer.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix.

If the Announcing Enabled indicator is stored in the UE context, the ProSe Function of HPLMN shall trigger the Announcing Alert procedure (see clause 5.3.5) to notify the announcing UE to perform announcing.

Steps 6-9 are executed only when the PLMN ID in the Target ProSe Disc UE ID indicates a different PLMN.

6. If the PLMN ID in the Target ProSe Disc UE ID indicates a PLMN different from the HPLMN, the ProSe Function in the HPLMN contacts the ProSe Function in that PLMN to retrieve the corresponding ProSe Restricted Code with a Monitor Request (RPAUID, UE Identity, Target PDUID, Application ID, Target RPAUID, Discovery Entry ID, [PC5_tech]) message. The request shall include the UE identity information e.g. IMSI or MSISDN in order to allow the ProSe Function in that PLMN to perform charging. If the ProSe Function in other PLMN receives the same Discovery Entry ID in a subsequent Monitor Request message, it updates the monitoring UE’s corresponding discovery entry with the received corresponding parameters. The request may also include the PC5_tech parameter if it was provided by the UE in step 1. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 3: The information provided in step 3 that is related to charging is used only when the requested PC5 radio technology includes E-UTRA.

7. If the pair of Target PDUID – Target RPAUID received from the HPLMN ProSe Function corresponds to a valid ProSe Restricted Code including a valid PC5 radio technology match as indicated via the PC5_tech parameter in step 6, the ProSe Function in the other PLMN retrieves the ProSe Restricted Code corresponding to that Target PDUID, Application ID and Target RPAUID.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix.

If the Announcing Enabled indicator is stored in the UE context, the ProSe Function of HPLMN shall trigger the Announcing Alert procedure (see clause 5.3.5) to notify the announcing UE to perform announcing.

8.a Optionally, the ProSe Function in the other PLMN sends an Auth Request (RPAUID , Request Type, Target RPAUID) to the Application Server indicated by the Application ID. The Request Type is set to "restricted discovery/permission".

8.b If, based on the permission setting, the RPAUID is allowed to discover the Target RPAUID, the ProSe Application Server acknowledges the Auth Request with an Auth Response (Target PDUID, Response Type). The Response Type is set to "restricted discovery/permission ack". The ProSe Function in the other PLMN verifies that the returned Target PDUID corresponds to the UE to be monitored.

If the Requested Discovery Timer is included in step 1 and the value is set to zero, the TTL in the Discovery Response message is set to zero.

NOTE 4: Whether steps 8.a and 8.b are executed depends on ProSe Function configuration, or policy regarding the specific Application Server. For example, if the ProSe Function can verify the permission locally, or the HPLMN is trusted by the other PLMNs for permission control, these steps are not needed.

9. The ProSe Function in the other PLMN returns to the ProSe Function in the HPLMN the ProSe Restricted Code and the corresponding residual validity timer with a Monitor Response (ProSe Restricted Code, validity timer) message. The Prose Function in the other PLMN also stores, in the context of the announcing UE, the PDUID of the monitoring UE and the allocated validity timer. The response may also include the PC5_tech parameter if it was provided by the HPLMN ProSe Function in step 7. When this parameter is omitted the intended PC5 radio technology is E-UTRA.

10. For each pair of Target PDUID – Target RPAUID returned by the application server in step 4, if the ProSe Function in the HPLMN has retrieved a valid ProSe Restricted Code, it builds the binding between ProSe Restricted Code with validity timer, Application ID, Target RPAUID, Metadata Indicator and Target PDUID and stores it into the discovery entry in the user context of the monitoring UE. Based on the ProSe Restricted Code and the associated validity timer the ProSe Function in the HPLMN allocates a Discovery Filter with the corresponding TTL.

The ProSe Function in the HPLMN returns a Discovery Response (Discovery Filter(s), Metadata Indicator, Discovery Entry ID, Application Level Container, [PC5_tech]) message to the UE. The Discovery Filter includes the ProSe Restricted Code to be monitored and the TTL that indicates for how long the related ProSe Restricted Code in the Discovery Filter is valid after it is received. If configured by the operator, the Target RPAUID(s) and metadata corresponding to the ProSe Restricted Code(s) may be included in the Discovery Response message. The ProSe Function stores in the user context all the parameters passed to the UE.

If restricted Direct Discovery with application-controlled extension is used, the ProSe Restricted Code is replaced by the ProSe Restricted Code Prefix. Besides the ProSe Restricted Code(s), the Discovery Filter may also contain the mask(s) for the ProSe Restricted Code Suffix, which is/are obtained in from ProSe Application Server in step 4. The UE may add additional mask(s) and values for the Suffix part.

The optional PC5_tech parameter indicates the PC5 radio technology that may be used for the Discovery Filter(s). When the parameter is omitted the intended PC5 radio technology is E-UTRA.

NOTE 5: When the Target RPAUID, corresponding to the ProSe Restricted Code in the Discovery Filter, is included in the Discovery Response message, then the Match Report procedure may be skipped.

NOTE 6: The ProSe Restricted Code in different Discovery Filters may be the same, for example, when the monitoring user is a friend of the announcing user in more than one application, for which the announcing user was allocated the same ProSe Restricted Code.

11. The UE obtains the corresponding radio resources that are authorized and configured by the PLMN(s) to be used for ProSe as defined in RAN specifications or uses WLAN, or both and starts to monitor using the Discovery Filter. The UE provides the Application Level Container, which contains the successful authenticated Target RPAUID(s), to the application client.

NOTE 7: The ProSe Protocol layer in the UE may inform the application client that it has started monitoring.

If the TTL corresponding to a Discovery Filter expires (because the UE has not refreshed the corresponding Discovery Request within the duration of the TTL), then the ProSe Function removes the entry related to that Discovery Filter from the UE context.