Section: 6.3.6.4.2 Stand-alone N3IWF selection
Content: If the UE is attached to 5GC via an N3IWF that is located in the same country as the country in which the UE is currently located and the AMF has previously indicated support for emergency services over non-3GPP access as defined in clause 5.16.4.1, the UE reuses the existing N3IWF connection for emergency services. Otherwise, the UE terminates any existing N3IWF connection and continues as follows: If the UE is equipped with a UICC: - The UE determines whether it is located in the home country or a visited country; - If the UE is located in the home country, then the UE selects the Home PLMN for emergency services and selects an N3IWF based on the procedure defined in clause 6.3.6.2. - If the UE is located in a visited country, the UE performs a DNS query using the Visited Country Emergency N3IWF FQDN, as specified in TS 23.003[ Numbering, addressing and identification ]  [19] to determine which PLMNs in the visited country support emergency services in non-3GPP access via N3IWF; and: - If the DNS response contains one or more records, the UE selects a PLMN that supports emergency services in non-3GPP access via N3IWF. Each record in the DNS response shall contain the identity of a PLMN in the visited country supporting emergency services in non-3GPP access via N3IWF. - The UE shall consider these PLMNs based on their priorities in the Non-3GPP Access Node Selection Information (if available). If the UE cannot select a PLMN in the Non-3GPP Access Node Selection Information or if non-3GPP Access Node Selection Information is not available, the UE shall attempt to select any PLMN in the list of PLMNs returned in the DNS response. - Once the UE has selected a PLMN the UE shall select an N3IWF for the selected PLMN as follows: - If non-3GPP Access Node Selection Information is available for the selected PLMN the UE constructs the Tracking Area Identity based N3IWF FQDN or the Operator Identifier based N3IWF FQDN as indicated in the non-3GPP Access Node Selection Information for the selected PLMN. - If non-3GPP Access Node Selection Information is not available for the selected PLMN the UE constructs the Operator Identifier based N3IWF FQDN for the selected PLMN. - If the DNS response does not contain any record, or if the DNS response contains one or more records but the UE fails to select a PLMN that supports emergency services in non-3GPP access, or if the Emergency Registration procedure has failed for all PLMNs supporting emergency services in non-3GPP access, the UE notifies the user that an emergency session cannot be established. If the UE is not equipped with a UICC, the UE shall perform the emergency N3IWF selection procedure above as if always in a visited country and without using the Non-3GPP Access Node Selection Information, i.e. the UE may construct the Operator Identifier based N3IWF FQDN format based on a PLMN ID obtained via implementation specific means. When an N3IWF has been selected, the UE initiates an Emergency Registration. If the Emergency Registration fails, the UE shall select another PLMN supporting emergency services in non-3GPP access.