# SRv6-Based Edge Service Continuity in 5G Mobile Networks +
## 5 SRv6-Based Lossless Migration
### Migration Procedure
#### 5.1.2 Enhanced Mode with Unchanged gNB GTP-U Behavior  
To provide lossless migration in the interworking between GTP-U and SRv6, the gNB2 must set a BSID as the destination of the outer IPv6 header. This BSID identifies, within SR Endpoint2, a policy implementing the End.M.GTP6.D.Buffer behavior.  
Figure 10 shows the control plane procedure for path migration. Firstly, the MEO asks the SMF to trigger the SDN controller for SR Endpoint4 configuration. The latter requires  
Figure 8: Control plane in Enhanced Mode path migration with buffering.  
Figure 9: Data plane in Enhanced Mode path migration with buffering.  
a rule to forward the packets after the SRH decapsulation. Then, the policy to be applied by SR Endpoint2 is selected, and the correspondent IPv6 address and actions must be installed on SR Endpoint2, if not performed yet. After that, the MEO must configure gNB2 to insert the B:0:0:2:GB00:: address, which is the SR Endpoint2's BSID identifying an End.M.GTP6.D.Buffer policy. The determination of the BSID to be used is based on both the function along the path to be executed and the tunnel which the packet needs to traverse. This means that, in the scenario where multiple flows enter and exit the core network through the same nodes and use the same buffer instance, a single BSID can be exploited. Concurrently, the MEO must trigger the configuration of a backup path on SR Endpoint3; the latter, to redirect on-the-fly packets, must apply the H.Encaps.Red. It includes the SR Endpoint4's End SID in the segment list and it sets, as the outer IPv6 destination, the SR Endpoint2's End.Buffer SID. Once the container is restored on MEC Host2, a rule must be updated again to remove the buffering phase. At this point, the buffer is not required anymore, so the packets can be forwarded directly to the designed instance. The MEO, in this phase, can trigger all the following actions concurrently. Given the policy to be applied by SR Endpoint2, the MEO requires the SMF to activate the SDN controller for configuring the former on SR Endpoint2. That policy, identified by address B:0:0:2:G000:: consists of the application of End.M.GTP6.D behavior to tunnel the packet toward the destination through SR Endpoint4. The MEO also prompts the update of the GTP-U encapsulation rule on gNB2. gNB2 must insert B:0:0:2:G000:: as the outer IPv6 destination address. At the same time, the MEO triggers the SMF and the SDN controller to update the backup rule on SR Endpoint3. Moreover, the GTP-U rule on gNB1 can be removed. Finally, the MEO triggers the buffer flush.  
Figure 11 shows the data plane example for path migration during the downtime. It illustrates the UE sending a packet to its service instance, while the transfer is in progress. When gNB2 receives the packet, it encapsulates that packet in GTP-U, by setting B:0:0:2:GB00:2:: as the destination address. Once the packet reaches SR Endpoint2 with the latter End.M.GTP6.D.Buffer SID, the behavior is executed. Subsequently, the packet with the updated outer header is forwarded to SR Endpoint4. SR Endpoint4 applies the End behavior with the USD, removing the outer IPv6-SRv6 header. Then, it forwards the packet to the destination container.  
Figure 10: Control plane in Enhanced Mode with Unchanged gNB path migration with buffering.