# Cloud-Enabled Deployment of 5G Core Network with Analytics Features
## 4 The Testbed
### Slicing Configuration
Contrary to our expectations, this did not resolve the problem; the AMF continued to issue _Nsmf_PDUSession_CreateSM-Context_ requests for UE1 PDU session establishment to the invalid SMF2. ### Proposed Solution

In this section, we propose an effective solution to address the problem outlined in Section 5.1. We conducted experiments with procedures related to UE-triggered service requests and NF deregistration. Based on these experiments, our solution enables slicing in cloud-enabled and virtualization-based 5G deployments. The procedure is as follows:

1. Ensure that NFs have registered on the NRF, with the exclusion of SMF2. 2. Trigger a registration with the establishment of the PDU session for the UE1. 3. Verify that the PDU session has been anchored in UPF1 and that the NF is capable of tunneling UE traffic to an outbound DN. 4. Utilize the UERANSIM-provided CLI or UE1 and trigger the UE-initiated PDU session request. 5. Invoke the NF deregister procedure of SMF1 by stopping its process on vm_5 GC-CP VM. 6. Call the SMF2 executable and trigger UE2 registration. 7. Verify that PDU Session for UE2 has been anchored in the correct slice. 8. Deploy SMF1 NF. 9. Verify that PDU Session for UE1 has been reestablished (i.e., AMF issued the request to SMF1 instead of SMF2), avoiding the crash scenario. As a result of the proposed procedure, the UE1 _Nsmf_PDUSession_CreateSM-Context_ Request was successfully issued to SMF1, which subsequently registered the PDU session in the PCF. This confirms a positive workflow for the PDU session establishment procedure. Additionally, the correct UPF was selected for the DN requested by UE1 (see Table 4). An N4 link was established between SMF1 and UPF1, meeting the requirements for establishing a slice-aware session. UE1 was assigned an IP address of 10.45.0.2/16, which is reflected in a tunnel interface created on the 5 GAN VM. Below, we present indicators of successful execution of the _UE-triggered PDU Session establishment_ for UE1:

* Connection setup and tunnel interface creation (_uesintun0_), observed in the console of UE1. * PDU resource setup for UE1, observed in the console of gNB. * Connected status of UE1, observed with the use of UERANSIM CLI. * A successful data transmission over the 5 GCN user plane to a remote site: agh.edu.pl. * GTP-U packets transmitting user data (i.e., the ICMP Ping data), observed in a log file of UPF1. In the next step, the PDU session for UE1 was released using the UERANSIM CLI. The 5 GCN responded appropriately, and the result of the PDU session release can be observed in the AMF log file. Following this, both the SMF2 and UE2 executables were initiated on their respective VMs. At the same time, the SMF1 process on the 5 GCN CP platform was stopped to trigger the NF deregistration procedure. The request for a PDU service from UE2 was successfully handled. Since the AMF session cache had been cleared of the SMF1 entry upon being notified of its deregistration by the NRF, the internal SMF selection process has returned the only one SMF present in the network: SMF2. The PDU session has been successfully established by UE2 in the requested slice. The gNB forwards a resource reservation for the UE2 PDU session to the AMF. The AMF confirms that the data session is available to SMF via the [_/nsmf-pdussession/v1/sm-contexts/l/modify_] resource. A data service has been provided positively, which has been verified with the use of the UE2 UERANSIM console. The UE2 has been assigned a 10.46.0.2/16 IP address from the SMF2/UPF2 pool for the requested DN (ims). Having completed another step in the resolution scenario, the SMF1 instance was recalled, making it available for reestablishing the PDU session for UE1. UE1 was successfully registered on the 5G network and established a data session in the slice [SST: 1, SD: 0x000001]. After reestablishing the PDU session, UE1 regained access to the remote site.