# Mobility-Enabled Edge Server Selection for Multi-User Composite Services
## 2 Motivation Scenarios
### Multi-User Edge Server Selection with a Single Service  
In this scenario, we assume that there is a mobile path consisting of two path segments, AB and BC. Due to the limited coverage of the edge server, edge server \(s_{1}\) can only cover path segment AB. Edge server \(s_{2}\) can cover path segments AB and BC. Edge server \(s_{3}\) can only cover path segment BC. In the figure, different edge server's coverage areas are represented with different shaded areas. The data transmission rates of \(s_{1}\), \(s_{2}\), and \(s_{3}\) are 30 kb/s, 20 kb/s, and 10 kb/s, respectively, which are shown in Figure 1. In path segment AB, three mobile users would like to invoke different services (i.e., user \(u_{1}\) wants to invoke service \(T_{1}\), user \(u_{2}\) wants to invoke service \(T_{2}\), and user \(u_{3}\) wants to invoke service \(T_{3}\), respectively) as shown in Figure 1a. After a while, they reach path segment BC, as shown in Figure 1b. With user's moving, if the user connects to the other server with unfinished service, the service should also be migrated to the corresponding server. The three-layer framework for migrating running applications can be used to optimize the downtime, which divides the service running on the edge server into three layers, including the base layer, the application layer, and the instance layer [15]. The instance layer is the running state of an application, such as CPU, register, non-pageable memory, etc. [5]. When a service is migrated, it will check whether the destination edge server has the copy of the needed base layer and application layer to avoid unnecessary data transferring. A more detailed procedure about service migration can be found in [15]. Considering the limited resources of each edge server, each edge server can deploy a small number of services. For the ease of calculation, we assume that each edge server's capacity is set as four units of computing capacity, and the workload of each service is set as two units (which means that each edge server can accommodate two services). Detailed information about the three services is shown in Table 1, where the \(RR\), \(UDS\), \(DDS\), \(RT\), and \(SD\) columns show the Requested Resources, Upload Data Size, Download Data Size, the service Response Time, and the Service Downtime generated by service migration, respectively. Traditionally, because \(T_{1}\) and \(T_{2}\) have a larger upload data size compared with \(T_{3}\), it is intuitive that users \(u_{1}\) and \(u_{2}\) select edge server \(s_{1}\) to deploy the corresponding services, as shown in Figure 1a. At the same time, because the capacity of edge server \(s_{1}\) has been exhausted, user \(u_{3}\) will connect to edge server \(s_{2}\). Over time, three mobile users go into path segment BC and get the response data, as shown in Figure 1b. Since user \(u_{1}\) first goes into path segment BC and is outside the coverage of edge server \(s_{1}\), \(u_{1}\) will connect to the edge server \(s_{2}\), which has a larger data transmission rate compared with \(s_{3}\). Then, user \(u_{2}\) establishes a connection with edge server \(s_{3}\). Thus, the total waiting time of invoking three services is (120/30+300/20+10+2) + (120/30+800/10+10+2) + (40/20+300/20+10) = 154 s. However, if user \(u_{1}\) selects edge server \(s_{3}\), user \(u_{2}\) can connect to edge server \(s_{2}\). In this case, the total waiting time of the three services is (120/30+300/10+10+2) + (120/30+800/20+10+2) + (40/20+300/10) = 129 s, which means that less total waiting time is obtained and user experience is improved. The detailed total waiting time computation model is shown in Section 3. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Service** & **RR** & **UDS (kb)** & **DDS (kb)** & **RT (s)** & **SD (s)** \\ \hline T1 & 2 & 120 & 300 & 10 & 2 \\ T2 & 2 & 120 & 800 & 10 & 2 \\ T3 & 2 & 40 & 300 & 10 & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Detailed information of the mobile services.