6.2.3B Discoverer request procedure for restricted ProSe direct discovery model B

24.3343GPPProximity-services (ProSe) User Equipment (UE) to ProSe function protocol aspectsRelease 17Stage 3TS

6.2.3B.1 General

The purpose of the discoverer request procedure for restricted ProSe direct discovery model B is for the UE to obtain ProSe Query Code(s) and Discovery Response Filter(s) to be used for sending query and monitoring responses over the PC5 interface based on the information provided by the upper layer application, as defined in 3GPP TS 23.303 [2].

Before initiating the discoverer request procedure, the UE shall be authorised for restricted ProSe direct discovery model B discoverer operation in the registered PLMN or the local PLMN based on the service authorisation procedure as specified in clause 5.

NOTE: The notion of "local PLMN" does not apply for WLAN-based ProSe direct discovery. The UE can engage in WLAN-based ProSe direct discovery as announcing UE regardless of the serving PLMN or other PLMNs that provide E-UTRAN coverage in the UE location.

As the result of successful completion of this procedure, the UE obtains one or more ProSe Query Code(s) which can be included in a PC5_DISCOVERY message and passes the PC5_DISCOVERY message to the lower layers for transmission over the PC5 interface. The UE also obtains Discovery Response Filter(s) and apply it to the monitoring operation in PC5 interface to match potential responses for the sent query request for the target RPAUID.

6.2.3B.2 Discoverer request procedure initiation

Before initiating the discoverer request procedure, the user sets the permissions for the restricted discovery using application layer mechanisms. The application client in the UE retrieves the PDUID provisioned to the UE as part of the service authorisation procedure as specified in clause 5 and obtains an RPAUID associated with the UE’s PDUID from the ProSe Application Server. The UE may also obtain the target RPAUID(s) from the ProSe Application Server. This step is performed using mechanisms that are out of scope of the present specification.

If the UE is authorised to perform E-UTRA-based restricted ProSe direct discovery model B discoverer operation in the PLMN operating the radio resources signalled from the serving PLMN, or if the UE is authorised to perform WLAN-based restricted ProSe direct discovery model B discoverer operation it shall initiate a discoverer request procedure:

a) when the UE is triggered by an upper layer application to perform the query for one or more target RPAUIDs in Model B and the UE has no valid corresponding ProSe Query Code and Discovery Response Filter for those target RPAUIDs of the upper layer application;

b) when the validity timer T4013 assigned by the ProSe Function to a ProSe Query Codes and the corresponding Discovery Response Filter has expired and the request from upper layers to announce the RPAUID corresponding to that ProSe Response Code is still in place;

c) when the UE selects a new PLMN while announcing a ProSe Query Code or waiting for a ProSe Response Code and intends to announce the ProSe Query Code in the new PLMN, and the UE is authorised for restricted ProSe direct discovery model B discoverer operation in the new PLMN;

d) when, while querying for target RPAUID(s), the UE intends to switch the announcing PLMN to a different PLMN without performing PLMN selection, and the UE does not have a valid allocated ProSe Query Code for this new PLMN yet; or

e) when the UE needs to update a previously sent restricted ProSe direct discovery model B discoverer request.

When the UE selects a new PLMN while announcing a ProSe Query Code or waiting for a ProSe Response Code and the UE is not yet authorised for restricted ProSe direct discovery model B discoverer operation in the new PLMN, the UE shall initiate a discoverer request procedure only after the UE is authorised for restricted ProSe direct discovery model B discoverer operation in the new PLMN.

NOTE 1: To ensure service continuity if the UE needs to keep announcing in Model B a ProSe Query Code corresponding to the same RPAUID, the UE can initiate the discoverer request procedure before the validity timer T4013 assigned by the ProSe Function for a ProSe Query Code expires.

The UE initiates the discoverer request procedure by sending a DISCOVERY_REQUEST message with:

– a new transaction ID not used in any other direct discovery procedures in PC3 interface;

– the RPAUID set to the RPAUID received from upper layers;

– the Application Level Container set to contain the application-layer information, e.g., target RPAUID(s) to discover;

– the command set to "query";

– the UE identity set to the UE’s IMSI;

– the Application Identity set to the Application Identity of the upper layer application that requested the announcing;

– the Discovery Type set to "Restricted discovery";

– the Discovery Model set to "Model B";

– the Discovery Entry ID set to a 0 if the discoverer request is a new request, and set to the Discovery Entry ID received from the ProSe Function if the discoverer request is to update a previously sent discoverer request;

– optionally in case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation the Announcing PLMN ID set to the PLMN ID of the local PLMN operating the radio resources that the UE intends to use for transmitting the query for the target RPAUID(s); and

– optionally the PC5_tech set to the PC5 radio technology that the UE wishes to use. PC5_tech may include more than one PC5 radio technology.

NOTE 2: A UE can include one or multiple transactions in one DISCOVERY_REQUEST message for different discovering requests (e.g., for different applications), and receive corresponding <restricted-discoverer-response> element or <response-reject> element in a DISCOVERY_RESPONSE message for each respective transaction. In the following description of the discoverer request procedure, only one transaction is included.

Figure 6.2.3B.2.1 illustrates the interaction of the UE and the ProSe Function in the discoverer request procedure.

Figure 6.2.3B.2.1: Discoverer request procedure for restricted ProSe direct discovery model B

6.2.3B.3 Discoverer request procedure accepted by the ProSe Function

Upon receiving a DISCOVERY_REQUEST message, the ProSe Function shall check that the application corresponding to the Application Identity contained in the DISCOVERY_REQUEST message is authorised for restricted ProSe direct discovery model B discoverer operation. If the application is authorised for restricted ProSe direct discovery model B discoverer operation, the ProSe Function shall check whether there is an existing context for the UE.

If there is no associated UE context, the ProSe Function checks with the HSS whether the UE is authorised for restricted ProSe direct discovery model B discoverer operation as described in 3GPP TS 29.344 [3]. If the check indicates that the UE is authorised, the ProSe Function creates a UE context that contains the UE’s subscription parameters obtained from the HSS. The HSS also provides to the ProSe Function the PLMN ID of the PLMN in which the UE is currently registered.

If the UE context exists, the ProSe Function shall check whether the UE is authorized for restricted ProSe direct discovery model B discoveree operation in the currently registered PLMN or in case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation the local PLMN identified by the Announcing PLMN ID included in the DISCOVERY_REQUEST message.

If the UE is authorized and the Discovery Entry ID included in the DISCOVERY_REQUEST message is set to 0 then:

– the ProSe Function shall use the procedure described in 3GPP TS 29.343 [31] to pass the Application Level Container included in the DISCOVERY_REQUEST message to the ProSe Application Server and obtain a list of PDUID(s) corresponding to the authorised target RPAUID(s) from the ProSe Application Server;

– for each of the PDUIDs corresponding to an authorised target RPAUID:

– if the PLMN ID of the PDUID is not the same as that of the PLMN to which the ProSe Function belongs, then the ProSe Function executes the procedures defined in 3GPP TS 29.345 [5] to obtain the ProSe Query Code, the ProSe Response Code, the associated validity timer T4012, and optionally metadata associated with this target RPAUID. Otherwise, the ProSe Function shall locate the discoveree UE context and retrieve the corresponding ProSe Query Code and ProSe Response Code and the validity timer T4012, and optionally metadata associated with this RPAUID. Then, the ProSe Function in the HPLMN builds one or more Discovery Response Filter(s) based on the respective ProSe Response Code, and associate the Discovery Response Filter(s) and ProSe Query Code with a new validity timer T4013 based on the remaining value of T4012.

NOTE 1: If the ProSe Function cannot retrieve the corresponding discoveree UE context for a target RPAUID, e.g. the target RPAUID has not yet been requested to be discovered by Model B in a discoveree request procedure, or the discoveree UE context expires, the ProSe Function can skip the processing of this target RPAUID.

NOTE 2: The ProSe Function can choose the value of T4013 to be longer than the remaining value of T4012, so that the discoverer UE sends a new discoverer request for renewing the query-related information no earlier than the discoveree UE renewing its own ProSe Response Code with the ProSe Function.

– the ProSe Function associates the ProSe Query Code and corresponding Discovery Response Filter(s), target RPAUID, and optionally metadata associated with the target RPAUID with a new discovery entry in the discoverer UE’s context; and

– the ProSe Function starts timer T4014 assigned for each ProSe Query Code and Discovery Response Filter(s) (of each target RPAUID) under this discovery entry of the discoverer UE context. For a given ProSe Query Code and the corresponding Discovery Response Filter(s), timer T4014 shall be longer than timer T4013. By default, the value of timer T4014 is 4 minutes greater than the value of timer T4013.

If the Discovery Entry ID included in the DISCOVERY_REQUEST message is not set to 0 and if there is an existing discovery entry for this Discovery Entry ID value in the UE’s context, the ProSe Function shall still process the above steps, but update the discovery entry instead of creating a new discovery entry.

If the Discovery Entry ID contained in the DISCOVERY_REQUEST message is not found in the UE context or there is no UE context in the ProSe Function, the ProSe Function shall behave as if the Discovery Entry ID included in the DISCOVERY_REQUEST message was set to 0, and the ProSe Function shall allocate a new non-zero Discovery Entry ID for this entry.

If a new UE context was created or an existing UE context was updated, the UE is currently roaming or the Announcing PLMN ID is included in the DISCOVERY_REQUEST message, the ProSe Function checks with the ProSe Function of the VPLMN or in case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation the local PLMN indicated by the Announcing PLMN ID whether the UE is authorised for restricted ProSe direct discovery model B discoverer operation as described in 3GPP TS 29.345 [5].

The ProSe Function shall then send a DISCOVERY_RESPONSE message containing a <restricted-discoverer-response> element with:

– the transaction ID set to the value of the transaction ID received in the DISCOVERY_REQUEST message from the UE;

– one or more Subquery Result information elements, each of which includes:

– a target RPAUID;

– the ProSe Query Code set to the ProSe Query Code for the target RPAUID;

– one or more the Discovery Response Filters IE which are set to include the Discovery Response Filter(s) used to match a potential ProSe Response Code responding to the ProSe Query Code.;

– a validity timer T4013 set to the T4013 timer value assigned by the ProSe Function to the ProSe Query Code and the Discovery Response Filter(s); and

– optionally, the metadata associated with the target RPAUID;

– the Restricted Security IE containing the security key(s) needed to be used with Discovery Response Filter(s) for restricted discovery monitoring;

– the Discovery Entry ID set to the ID of the discovery entry associated with this announce request in the UE context; and

– optionally the PC5_tech set to the one or more PC5 radio technologies that are authorized to be used for the assigned ProSe Query Code.

If T4014 expires, the ProSe Function shall remove the corresponding ProSe Query Code and ProSe Response Filter(s) from the discovery entry associated with the discoverer UE’s context.

6.2.3B.4 Discoverer request procedure completion by the UE

Upon receipt of the DISCOVERY_RESPONSE message, if the transaction ID contained in the <restricted-discoverer-response> element matches the value sent by the UE in a DISCOVERY_REQUEST message with the command set to "query" and the Discovery Model set to "Model B", the UE shall, process as follow:

– If the DISCOVERY_RESPONSE creates a new discovery entry, start the validity timer T4013 with the received value for the ProSe Query Code and the corresponding Discovery Response Filter(s) included for each SubQuery-Result information element received in the DISCOVERY_RESPONSE message and the PLMN ID of the intended announcing PLMN if included in the DISCOVERY_REQUEST message;

– If the DISCOVERY_RESPONSE updates an existing discovery entry, the UE shall

– stop the timer T4013 of any ProSe Query Code(s) and Discovery Response Filter(s) in this discovery entry which are no longer authorized by the ProSe Function, ask lower layers to stop announcing the ProSe Query Code(s) and monitoring ProSe Response Filter(s), and remove the ProSe Query Code(s) and Discovery Response Filter(s) from the existing discovery entry;

– restart the T4013 timer(s) for those remain eligible;

– start the T4013 timer(s) for any new ProSe Query Codes and their corresponding Discovery Response Filter(s); and

– update the PLMN ID of the intended announcing PLMN for this discovery entry if included in the DISCOVERY_REQUEST message.

Otherwise the UE shall discard the DISCOVERY_RESPONSE message and shall not perform the procedures below.

For each ProSe Query Code in this discovery entry, the UE requests the lower layers to announce the ProSe Query Code in the PC5 interface, as specified in 3GPP TS 36.331 [12]. In case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation this shall be done only if the lower layers indicate that ProSe direct discovery is supported by the network. In case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation if the UE in EMM-IDLE mode has to request resources for ProSe direct discovery announcing as specified in 3GPP TS 36.331 [12], the UE shall perform a service request procedure or tracking area update procedure as specified in 3GPP TS 24.301 [11]. The UE shall obtain the UTC time for the next discovery transmission opportunity for ProSe direct discovery from the lower layers.

If a valid UTC time is obtained, the UE shall generate the UTC-based counter corresponding to this UTC time as specified in subclause 12.2.2.18. If the resulting UTC-based counter is within Max Offset of the time shown by the clock used for ProSe by the UE, the UE shall for each ProSe Query Code in this discovery entry, use the ProSe Query Code to construct a PC5_DISCOVERY message, according to the format defined in subclause 11.2.5.

The UE shall then apply one or more of the DUIK, DUSK or DUCK with the associated Encrypted Bitmask, whichever received in the Restricted Code Security Material parameter of the DISCOVERY_RESPONSE message, along with the UTC-based counter to the PC5_DISCOVERY message, to e.g. generate a MIC value, scramble the message contents or provide confidentiality protection, as specified in 3GPP TS 33.303 [6].

The UE then passes the resulting PC5_DISCOVERY message, along with the PLMN ID of the intended announcing PLMN stored for this discovery entry, to the lower layers for transmission and instruct the lower layers to start monitoring if:

– the UE is currently authorised to perform restricted ProSe direct discovery model B discoverer operation in the registered PLMN or in case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation the local PLMN operating the radio resources that the UE intends to use;

– the validity timer T4013 for the ProSe Query Code and corresponding ProSe Response Filter(s) has not expired; and

– a request from upper layers to query the target RPAUID in restricted discovery Model B, associated with both the ProSe Query Code, and the authorised Application Identity, is still in place.

During the discoverer operation, if one of the above conditions is no longer met, the UE may instruct the lower layers to stop the discoverer operation. When the UE stops discoverer operation, in case of E-UTRA-based restricted ProSe direct discovery model B discoverer operation if the lower layers indicate that the UE is required to send a discovery indication to the eNodeB and the UE is in EMM-CONNECTED mode, the UE shall trigger the corresponding procedure in lower layers as specified in 3GPP TS 36.331 [12].

The UE shall ensure that it keeps on passing PC5_DISCOVERY messages to the lower layers for transmission until the validity timer T4013 of the ProSe Query Code expires. How this is achieved is left up to UE implementation.

The UE may apply the received Discovery Response Filter(s) to its monitoring operation. Using the Discovery Response Filter may result in a match event for the target RPAUID the UE is querying for. There is match event when, for any of the masks in a Discovery Response Filter, the output of a bitwise AND operation between the ProSe Response Code contained in the received PC5_DISCOVERY message and the mask, matches the output of a bitwise AND operation between the mask and the code contained in the Discovery Response Filter.

When applying a Discovery Response Filter to a received PC5_DISCOVERY message for the bitwise AND operation, the UE shall use the DUSK, if received as part of the filter in the DISCOVERY_RESPONSE message, and the UTC-based counter generated during the monitoring operation, to unscramble the PC5_DISCOVERY message as described in 3GPP TS 33.303 [6]. Then, if a DUCK is included as part of the filter, the UE shall use the DUCK and the UTC-based counter to to decrypt the message-specific confidentiality protected portion identified by the Encrypted Bitmask, as described in 3GPP TS 33.303 [6];

NOTE: The UE can look for a match on the unencrypted bits first before applying DUCK, to minimise the amount of processing performed before finding a match.

If a DUIK is received as part of the filter, the UE shall use the DUIK and the UTC-based counter to verify the MIC field in the unscrambled PC5_DISCOVERY message. If a MIC Check Indicator parameter is included instead, the UE shall use the match report procedure described in subclause 6.2.4B to trigger checking of the MIC of the PC5_DISCOVERY message containing the ProSe Response Code by the ProSe Function.

The UE may notify the upper layer application about the match event of restricted ProSe direct discovery Model B with the corresponding target RPAUID and metadata, if the RPAUID and meta-data are included in the Subquery Result element in the DISCOVERY_RESPONSE message.

6.2.3B.5 Discoverer request procedure not accepted by the ProSe Function

If the DISCOVERY_REQUEST message cannot be accepted by the ProSe Function, the ProSe Function sends a DISCOVERY_RESPONSE message containing a <response-reject> element to the UE including an appropriate PC3 Control Protocol cause value.

If the application corresponding to the Application Identity contained in the DISCOVERY_REQUEST message is not authorised for restricted ProSe direct discovery Model B discoverer operation, the ProSe Function shall send the DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #1 "Invalid application".

If the RPAUID contained in the DISCOVERY_REQUEST message is unknown to the ProSe Function or ProSe Application Server, the ProSe Function shall send a DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #9 "Unknown RPAUID".

If the RPAUID contained in the DISCOVERY_REQUEST message does not match the stored RPAUID for the requested Discovery Entry ID, the ProSe Function shall send a DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #10 "Unknown or Invalid Discovery Entry ID".

If the UE is not authorised for restricted ProSe direct discovery model B discoverer operation, the ProSe Function shall send the DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #3 "UE authorisation failure".

If the RPAUID contained in the DISCOVERY_REQUEST message is not associated with a PDUID belonging to the requesting UE, the ProSe Function shall send a DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #3 "UE authorisation Failure".

If the ProSe Function fails to retrieve any valid target PDUIDs from ProSe Application Server based on the Application Level Container contained in the DISCOVERY_REQUEST message, the ProSe Function shall send a DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #11 "Invalid discovery target".

If the ProSe Function fails to retrieve any valid discoveree UE contexts for the valid target RPAUIDs contained in the Application Level Container contained in the DISCOVERY_REQUEST message, the ProSe Function shall send a DISCOVERY_RESPONSE message containing a <response-reject> element with PC3 Control Protocol cause value #11 "Invalid discovery target".

6.2.3B.6 Abnormal cases

6.2.3B.6.1 Abnormal cases in the UE

The following abnormal cases can be identified:

a) Indication from the transport layer of transmission failure of DISCOVERY_REQUEST message (e.g. after TCP retransmission timeout)

The UE shall close the existing secure connection to the ProSe Function, establish a new secure connection and then restart the discoverer request procedure.

b) No response from the ProSe Function after the DISCOVERY_REQUEST message has been successfully delivered (e.g., TCP ACK has been received for the DISCOVERY_REQUEST message)

The UE shall retransmit the DISCOVERY_REQUEST message.

NOTE: The timer to trigger retransmission and the maximum number of allowed retransmissions are UE implementation specific.

c) Indication from upper layers that the request to discover the target RPAUID(s) is no longer in place after sending the DISCOVERY_REQUEST message, but before the discoverer request procedure is completed

The UE shall acknowledge the DISCOVERY_RESPONSE message received from the ProSe Function but discard its contents and then abort the procedure.

d) Change of PLMN

If a PLMN change occurs before the discoverer request procedure is completed, the procedure shall be aborted. If the UE is authorized to perform restricted ProSe direct discovery discoverer operation Model B in the new PLMN, the procedure shall be restarted once the UE is registered on the new PLMN.

6.2.3B.6.2 Abnormal cases in the ProSe Function

The following abnormal cases can be identified:

a) Indication from the lower layer of transmission failure of DISCOVERY_RESPONSE message

After receiving an indication from lower layer that the DISCOVERY_RESPONSE message has not been successfully acknowledged (e.g. TCP ACK is not received), the ProSe Function shall abort the procedure, and stop any associated timer(s) T4014, if running.