Interference Aware Service Migration in Vehicular Fog Computing

Vehicular Fog Computing (VFC) is a promising technique to enable ultra low service latency by exploiting the computation and storage resources of both Roadside Units (RSUs) and Serving Vehicles (SVs) such as buses and trams with rich resources. To tackle with the mobility of vehicles, the services are usually migrated between RSUs and SVs, i.e., follow the vehicle, to maintain the benefits of VFC. However, making optimal service migration decisions in VFC is challenging due to the mobility of SVs and the interference between vehicles. In this paper, we investigate multi-vehicle service migration problem in VFC. We propose an efficient online algorithm, called FEE, to optimize the service migration for each vehicle in each time slot, where the latency in the current time slot, the expected latency in future time slots, and the interference among vehicles are minimized. The expected latency in future times slots is obtained by trajectory prediction based on hidden Markov model, and the interference is measured based on the server load. Finally, a series of simulations based on real-world mobility traces of Rome taxis are conducted to verify the superior performance of the proposed FEE algorithm as compared with the state-of-the-art solutions.

communication and computation resources such as buses and trams [7]. We refer this kind of vehicles as Serving Vehicles (SVs). Without otherwise specified, we use vehicle to refer to the rest of the other ordinary vehicles in the network [8]. VFC leverages SV mobility to enhance the service capacity as it increases the communication opportunities of vehicles, including the service range and resources utilization [9]. This is because that SVs play the role of communication hubs, where the near-located vehicles can be connected together and further connect to more access points [10]. With VFC, vehicles can request service from either RSUs or SVs with ultra-low latency.
To tackle with vehicle mobility, a proper service migration strategy is needed to achieve a balance between the migration cost and the service latency [13]. However, making optimal service migration decisions in VFC is challenging due to the following reasons [14]- [16]. First, the mobility of SVs affects the optimality of the service migration strategy. When a vehicle has a similar trajectory with a SV over a period of time, the real-time Vehicle-to-Vehicle (V2V) communications greatly decreases the service latency [11]. However, the service will be frequently migrated when the vehicle requests this service from a SV which just passing by and heading to a different direction, and even lead to the loss of service data [12]. Thus, the migration cost of vehicles may be misestimated, resulting in invalid migration [17]. Second, the performance of migration strategy greatly relies on the accuracy of the trajectory prediction of both the SVs and vehicles [18]. However, the existing prediction methods, e.g. Markov Decision Process (MDP), become intractable with large number of vehicles [19]. Third, the interference among different vehicles decreases the quality of experience (QoE). When the vehicles make migration decisions independently, they suffer from interference from each other as the resources of the edge servers are limited [20]. To the best of our knowledge, an efficient service migration strategy in VFC is still missing.
In this paper, we investigate multi-vehicle service migration in VFC, and develop an efficient solution to make optimal service migration decision for each vehicle. The main contributions of this paper are summarized as follows: • We formalize the service migration process in VFC networks as a mixed integer nonlinear programming MINP) program for minimizing the average service latency, where the QoE constraints and the mobility of SVs are taken into account. To our best knowledge, this is the first work that studies service migration with SVs in VFC networks.
• We propose an efficient online algorithm, called interFerence awarEe sErvice migration (FEE), to decouple the migration process between different vehicles, services and time slots, where the latency in the current time slot, the expected latency in future time slots, and the interference between vehicles are minimized. The expected latency in future times slots is obtained by trajectory prediction based on hidden Markov model, and the interference between vehicles is measured based on the server load. This makes our algorithm scalable to multi-vehicle networks with low time complexity.
• The effectiveness of the proposed FEE algorithm is verified by simulations on the basis of real-world taxi traces in Rome. The average service latency, and service deadline guarantee rate of FEE are compared with other four benchmarks. The simulation results demonstrate the superior performance of FEE with SVs mobility, especially with large vehicle numbers. The rest of this paper is organized as follows. Section II reviews related work. The system model considered in this paper is present in Section III. Section IV propose FEE algorithm, along with the complexity analysis. Section V shows the performance evaluation and discussion. Finally, the conclusion is drawn in Section VI.

II. RELATED WORK
Recently, different architectures of VFC have been proposed in the literature. Satyanarayanan [21] regards each vehicle as a fog node and chooses a coordinator for each area. Xiao and Zhu [5] select the commercial fleet as the fog node. Hou et al. [8] suggest slow moving vehicle or parked vehicle provide its residual resources. In this section, we briefly survey existing literature in service migration from the perspective of VFC networks [22], [23], service latency and trajectory prediction [24].
The major studies in VFC focus on satisfying the high-dynamic network topology caused by SVs. Liu et al. [23] use software-defined networking (SDN) technology to enhance the QoE of latency-sensitive service in a VFC-based networks. Zhang et al. [25] adaptively upload the tasks to the fog computing servers by directly uploading or relay transmission in VFC-enable vehicular ad hoc networks to minimize the average latency. Yan et al. [26] propose a centralized scheme to schedule forwarders to manage the service requests in SVs during its driving route, and thus achieve minimum transmission latency. Zhou et al. [27] use the multi-armed bandit theory to maintain the delay performances in the decision-making process, where the appearance time of SVs is taken into account. Yao et al. [6] propose a scheme to accommodate low latency requirement. This scheme caches service data at a set of vehicle nodes that may repeatedly visit the same hot spot. However, all above researches ignore the cost of service migration, as well as the different characteristics of services (e.g. latency-sensitive and computing-intensive) and SVs (e.g., velocity and type).
Many previous service migration strategies help to reduce the service latency [28]. Nadembeg et al. [14] selecting the optimal servers in terms of offered throughput and splitting user requested service into several portions, which the objective is minimizing the service latency. Ouyang et al. [12] introduce a scheme to reduce system costs over time in compliance with the time-varying resource situation. Zhang et al. [29] propose an online service migration method based on network efficiency optimization to maintain latency performance while optimizing energy efficiency. However, these works neglect the interference among users, which leads to QoE deterioration.
Meanwhile, to account for the mobility of vehicles, existing works balance routing latency and migration latency adaptively by predicting vehicle trajectory in the following time [30]. Assuming the user moves in a straight line, i.e., following a one-dimensional (1-D) mobility pattern, Ksentini et al. [31] propose a method to predict user trajectory by MDP model, and then decide the course of service migration. Plachy et al. [32] use low-level channel information to predict the user trajectory to choose a best communication path for migration, where the load of communication and computing resources of the target base station (BS) is taken into account. Considering the more realistic case, Wang et al. [24] make the service migration decision by predicting the user trajectory with a 2-D Markov Decision Process (MDP). However, it is extremely challenging to maintain the prediction accuracy of future information, such as user trajectory owing to the increasing number of users. Such observations motivate us to propose FEE algorithm, which is expected to VOLUME 8, 2020 utilize the HMM and specific interference detection function to optimize latency performance.

III. SYSTEM MODEL A. SYSTEM OVERVIEW
In this paper, we consider a VFC networks consisting of N 1 fixed position BSs and N 2 SVs, and V vehicles, which are geographically distributed over N a regular square area as shown in Fig. 1. Note that SVs usually follow some fixed routines (e.g., buses, delivery trucks, and garbage trucks) [26]. In the following, we use BS to denote both fixed position BSs and SVs, and let S n denote the storage capacity of BS n, n ∈ [1, N ], where N = N 1 + N 2 . There are M different vehicular services deployed in the BSs. Let λ m , γ m , D m and m denote the input data size, the computation intensity (i.e. CPU cycles/bit), the response deadline and the priority of service m, m ∈ [1, M ], respectively. Let f m,v , θ m,v denote the CPU cycle and storage requirements of a service request from vehicle v, v ∈ [1, V ] to service m, respectively. The vehicle around the N a areas connects to the BS with the largest received signal strength indicator. When the BS receives a service request from a vehicle, it will response to the request once this service is deployed locally, otherwise it will forward the request to another BS that has this service. We divide the total time into T time slots, where each time slot lasts for τ seconds. In time slot t, t ∈ [0, T − 1], vehicles generate service requests according to some stochastic statistics. Table. 1 summarizes the key parameter notations in our paper.

B. SERVICE PLACEMENT AND MIGRATION
We use a vector B t = {B t (v)|v = 1, 2, · · · , V } to denote the connected BSs of the vehicles in time slot t, where We use another vector b t,m = {b t,m (v)|v = 1, 2, · · · , V } to denote the serving nodes of the requests of vehicles to service Note that b t,m (v) indicates a service migration happens. Thus, the serving node in next time update by When multiple services are placed at BS n, the total storage requirements should not exceed its storage capacity, therefore we have where C. SERVICE LATENCY Service latency consists of transmission latency between the vehicle and the BS, computing latency and migration latency. The transmit rate between BS i and BS j in time slot t is where W , P and N 0 are the channel bandwidth, transmit power and noise power, respectively. h is a complex fading vector modeled as circularly symmetric complex Gaussian random variables [33]. d(i, j, t) is the distance between BS i and BS j in time slot t. Assuming vehicle v generates a request to service m at the beginning of time slot t, the request transmission latency is where C is a constant value to approximate the transmission time between vehicle v and BS B t (v).
The computation latency of vehicle v for service m is Service m may be migrated from The service migration latency in time slot t can be expressed as .
, service m is not migrated in time slot t, and thus we have l M t,m (v) = 0. In summary, the service latency of vehicle v to service m in time slot t can be expressed as

D. PROBLEM FORMULATION
Our goal is to minimize the long-term average latency by selecting the optimal migration strategy b t,m (v), which can be expressed as where constraint (13) ensures the request can be completed before its response deadline. The major challenge that impedes the derivation of the optimal solution is the lack of future information, e.g., the trajectories of SVs and vehicles, and the request distribution. Moreover, even if the future information is known, P1 is still a MINP problem that is proven to be NP-hard.

IV. ONLINE SERVICE MIGRATION ALGORITHM
In this section, we present FEE algorithm, which is an online online service migration decision approach, to solve P1. First, we introduce a trajectory prediction algorithm to predict the trajectory of both the SVs and the vehicles in the next time slots. Next, given the predicted trajectory, we obtain the expected service latency in the next time slots. To decouple the migration decisions in different time slots, in each time slot, we minimize the current service latency and the expected service latency in the next time slots by selecting the optimal migration decision. Finally, a specific interference prediction function is designed to avoid the interference among vehicles. Based on this, we can further convert the optimization problem in each time slot into a series of per-vehicle perservice sub-problems which can be solved.

A. PROBLEM TRANSFORMATION
In order to solve P1 online, service migration in each time slot must take into account the service latency in the future under this service migration. Thus, the migration which migrate service to the SVs that just passing can be avoided. Let L t,m (v) denote the service latency in next time slot under the service migration of vehicle v for service m in time slot t, called by long-term latency, which will be introduced in Section. IV-B. Based on this, the objective function of P1 is equivalent to minimize the service latency in current time slot and the long-term service latency, which is expressed as where α > 0 is the weighting parameter, a high value of α mean the service migration decision take more into account long-term latency. By eliminating the resource constraints in each BS, the migration decision of each vehicle and each service can be considered to be independent, i.e., the objective function of P2 can be divided into V × M sub-problems. However, the optimal solution of these sub-problems may be invalid for P2 if the resource constraints of the BSs are not satisfied. Thus, we define a interference indicator t,m (v) to represent the interference level of the service migration decision for vehicle v to service m in time slot t, which will be introduced in Section. IV-C.
Given the interference indicator, P2 can be converted into V × M smaller problems P3 with lower complexity.
where β > 0 is the weighting parameter of the interference indicator. The detail of our proposed FEE scheme is shown in Algorithm. 1. For each time slot and each vehicle, we firs generate the predicted trajectory and serving node sequence by TP algorithm and SNP algorithm, which are introduced in Section. IV-B (Lines 3-4). For each service, we calculate the long-term latency and interference indicator, and thus we can directly solve P3 to obtain the migration decision (Lines 5-10). Finally, we update the system state in next time slot according to our migration decisions (Line 11). As we greatly reduced the size of the state space, the overall complexity is reduced from O(V NM ) to O(VNM ) in each time slot t. Note that there is a small probability that the migration decisions obtained from P3 may be invalid if the resources VOLUME 8, 2020 Algorithm 1 FEE Algorithm Input: : Long-term Trajectory, α, β ω 1 , ω 2 , K , , B 0 , b 0,m Output: Migration Decision b t,m 1: for t = 1 to T do 2: for v = 1 to V do 3: Predict the trajectory of SVs and vehicles according to TP Algorithm; 4: Predict serving node sequence according to SNP Algorithm; 5: for m = 1 to M do 6: Obtain L t,m (v) according to (24); 7: Obtain t,m (v) according to (31); 8: Obtain b t,m by solving P3; 9: end for 10: end for 11: b t+1,m = b t,m ; 12: end for constraints are not satisfied. The probability can be reduced by choosing a proper β value, as shown in Section V.

B. EXPECTED LATENCY PREDICTION BASED ON HIDDEN MARKOV MODEL
The process of predicting future delay is mainly divided into two steps. The first step is to predict the trajectory of SVs and vehicles, and the second step is to predict the serving nodes sequence to calculate the long-term latency.

1) TRAJECTORY PREDICTION
We collect the historical trajectories of each vehicle to predict its current trajectory. A set of H historical trajectories of a vehicle is shown in Table 2 H ] is one trajectory. The elements of G h are positions sequentially obtained from the GPS receiver when the vehicle moves along a certain route. p h indicates the probability that the vehicle follows G h , which can be calculated by where n h and N H are the number of occurrences of trajectory G h , and the total number of trajectories collected. Once a latest trajectory is obtained, we add it to the historical trajectory table and update the probabilities accordingly. Two

Algorithm 2 Trajectory Prediction (TP) Algorithm
Input: (g 1 * , g 2 * , · · · , g t * ), , l 0 Output: (g t+1 * , g t+2 * , · · · , g t+ * ) 1: for h = 1 To H do 2: Obtain l h according to (17); 3: end for 4: Obtain the candidate trajectory G h * according to (18) trajectories, G i and G j , are regarded as the same if l i = l j and l i l=1 g l i , g l j ≤ , where is a threshold obtained empirically. Given the historical trajectory table and the current trajectory (g 1 * , g 2 * , · · · , g t * ), we use trajectory prediction (TP) algorithm to predict the future trajectory, which works as follows.
• First, we find the matching length of each trajectories in the historical trajectory table. Let l h denote the matching length of G h , we have where 1 ≤l h ≤ l h . Note that if (17) can not be satisfied, we set l h = 0.
• Next, we choose the candidate trajectory as where l 0 is the minimum matching length, and • Finally, the sub-trajectory (g¯l h * +1 h * , g¯l h * +2 h * , · · · , g¯l h * + h * ) of G h * is regarded as the predicted trajectory (g t+1 * , g t+2 * , · · · , g t+ * ) in the next time slots. The TP algorithm is summarized in Algorithm 2.

2) SERVING NODE PREDICTION
In this part, we estimate the long-term service latency in the next time slots by predicting the serving nodes, where the HMM technique is utilized.
For each vehicle, by replacing the GPS position in predicted trajectory with the corresponding area index, we can obtain a observation sequence O with length . We take the serving node as the state of the vehicle, then we can use HMM to obtain the serving node sequence with length . We introduce a 5-tuple < π, N , N a , A t , B t > to denote the HMM that describe the service migration process.
• Initial State π : π is N -dimension vector, which denotes the probability distribution of the initial state. Each element π (n), n ∈ [1, N ] is the probability of the vehicle request service from BS n.
• Observation Set N a : The state set N a includes all possible area n a vehicle may locate, i.e. N a = {1, 2, · · · , N a }. N ] is the transition probability that service is migrated from BS i to BS j in time slot t. Due to the mobility of SVs, the state transition probability varies between different time slots. More specifically, if the distance between BS i and BS j decreases in time slot t, A t (i, j) will increase, and vise versa. Thus, we update A t (i, j) as . (20) is the probability that service is served by serving node j when the vehicle is located in area i in time slot t. Similar to (20), B t (i, j) is update as where thed(i, j, t) denote the distance between area i and BS j in time slot t. Let δ t (n) denote the maximum probability that the serving node is n in the time slot t , t ∈ [t, t + ] given the observing sequence, which can be obtained as Let ψ t (n) denote the corresponding serving node in previous time slot, which can be obtained as where ψ t (n) = n means the service migrates from BS n to BS n in time slot t . We use a serving node prediction (SNP) algorithm utilizing the HMM model to predict the top-K serving nodes in the next time slots, where the details are shown in Algorithm 3. The SNP algorithm works as follows. First, we initialize δ 1 (n) and ψ 1 (n) (Lines 1-2). Second, we update δ and ψ with the time slot t increases (Lines 3-8). Next, to find the top-K probability serving node sequence, we record the kth highest probability δ (n) in time slot t + (Lines 10), and obtain the corresponding serving node sequence by recalling ψ t (Lines 11 -14). As the value of δ (n) has been recorded, we replace it with the sub-optimal value according to (22), where the n = Q k ( ), and further update the value of ψ (Q k ( )) (Lines 15).

C. INTERFERENCE INDICATOR
In this subsection, we propose a interference indicator based on the load in each BS. At the beginning of each slot, the following is performed: • With the vehicles move, the load in each BS n is constantly changing. The storage load of each BS n in time slot t is • BSs confirm the identities of its associated vehicles. The number of vehicles which migrate service m from BS n to another BS (compared to the beginning of the previous time slot) is The number of vehicles which migrate service m to BS n (compared to the beginning of the previous time slot) is  The number of vehicles which currently request service m from BS n is • BSs update the probability that services m migrate to BS n by Pr I |n, m = ω 1 Pr I |n, m +ω 2 π I t (n, m) π t (n, m) , (29) and update the probability that services m migrate from BS n to another BS by where ω 1 and ω 2 is the weight parameter (ω 1 + ω 2 = 1).
• To avoid the interference among vehicles, the services are willing to migrate from the BS with high load to the BS with low load. Therefore, the interference indicator is defined as In this section, we evaluate the performance of FEE algorithm with simulations. We simulate an VFC system with 9 fixed BSs and 4 SVs deployed on a regular cellular network, which is divided into 625 geographical parts. The communication radius of BSs is 350m, while 150m for SVs. The vehicle trajectories are collected from the real-world Rome taxi traces obtained in 2014 [34]. Seven typical vehicular services, i.e., emergency stop (ES), collision risk (CR), accident report (AR), parking (PA), traffic control (TC), platoon(PL), and face detection (FD), are deployed on the serving nodes. The parameters of the services are listed in Table 3 [20], [35], [36]. We set W , P, and N 0 to 10 MHz, 0.5 W and 10 −15 , respectively [11]. We compare FEE with four benchmarks.
• Always-migrate scheme (AM): The service is always migrated to the BS that is nearest to the vehicle.
• Never-migrate scheme (NM): The service is deployed in the original BS and never migrate to other BS. • Dynamic Markov Decision Process (DMDP) [24]: This is a single-user service migration algorithm, where the trajectory is predicted using MDP, and the optimal service migration decision is made to minimize the overall cost.
• Partial dynamic optimization algorithm (PDOA) [36]: Each vehicle selects a fraction of the services according to the priority queue, and only migrates these services to reduce the negative effect of trajectory prediction error. Fig. 2 illustrates the accuracy of TP algorithm with different l 0 values. The predicted trajectory is defined as accurate if it can be regarded as same with the real trajectory. It can be observed that the accuracy increases with the growth of l 0 . This is because a larger l 0 value indicates the candidate trajectory chosen by TP algorithm has a higher similarity with the current vehicle trajectory. It is also shown that when l 0 is larger than 18, the accuracy becomes stable, which is around 95%.

C. IMPACT OF DIFFERENT VEHICLE NUMBER
The average latency with different number of vehicles are shown in Fig. 3(a). As can be seen from Fig. 3(a), when the number of vehicles increases from 100 to 1000, the average latency with NM is the highest. This is reasonable as the services never migrate to follow the vehicles. On the other hand, the lowest average latency is achieved by AM when the vehicle number below 600, since the services are always successfully migrated to the nearest BSs to follow the vehicles. However, as the number of vehicles exceeds 600, the average latency with AM increases exponentially. This is because the servers run out of resources with too many vehicles, and the interference among the vehicles begins to affect the performance. The average service latency with PDOA is quite close to that with AM, whose rising tendency is lower than AM due to PDOA only migrate a fraction of services. It is found that the average latency with FEE is is slightly larger than AM and DMDP when the number of vehicles is smaller than 600. However, as the number of vehicles exceeds 600, the lowest average latency can be achieved with FEE. This is because the interference among the vehicles is taken into account in the optimization problem formulated. This indicates that FEE is suitable for VFC networks. The deadline guarantee rate of the four methods is depicted in Fig. 3(b). As an important performance metric, the deadline guarantee rate indicates the percentage of request that get response before its deadline. It can be observed that the deadline guarantee rate of NM is the lowest due to the long transmission path. When the vehicle number is less than 700, the deadline guarantee rate with AM, DMDP,PDOA and FEE are quite close to each other. However, the deadline guarantee rate with AM, DMDP and PDOA reduce rapidly when the user number exceeds 500. The deadline guarantee rate with FEE is the highest with large user numbers, e.g., it is approximately 95% with 1000 users. The results in Fig. 3(b) are consistent with that in Fig. 3(a).

Note
= 0 means FEE only consider the latency in the current time slot. The average latency of FEE is higher than DMDP and AM when = 0, however, the average latency of FEE becomes the lowest among the 5 methods after exceeds 1. This indicates by taking the long-term service latency in the following time slots into account, better service migration decisions can be made with FEE. It can also be observed from the figure that the average latency of FEE becomes stable if exceeds 4. Therefore, a trade-off between the average service latency and the computation complexity can be achieved by selecting a proper value.
E. IMPACT OF PARAMETERS α AND β Fig. 5 shows the average latency of FEE with different α and β values, where the number of vehicles is 800. As can be seen from the figure, if we fix β, the average latency decreases as α increase from 0.1 to 100. This is because by taking the long-term service latency in the next time slots into account helps to make a better migration decision. However, when α exceeds 100 which means we put more emphasis on the long-term service latency, the average latency slightly increases. Similarly, if we fix α, the average latency decreases as β increases from 0.1 to 50. This is because by taking the interference among vehicles into consideration, better service migration decisions can be obtained. However, the average latency increases if β exceed 50, where more conservative service migration decisions might be made to avoid the potential interference. It is found that with α = 100 and β = 50, the lowest average latency can be achieved. Fig. 6 shows the impact of the velocity of SVs on the average latency, where the number of vehicle is 800. There is a tendency that the average latency of the 5 methods increase as the velocity of SVs increase, as the high mobility of SVs brings great challenge to the service migration decisions. The average latency with NM is the highest, however, it is less sensitive to the mobility of SVs as the services never migrates. On the contrary, the average latency with AM and DMDP are much lower, but they are more sensitive to the mobility of SVs. The average latency of AM, DMDP and PDOA increases exponentially when the velocity of SVs exceeds 35 Km/h. The average latency with FEE decreases when the velocity of SVs is less than 30 km/h, since the low mobility of SVs reduces the service migration opportunities. Even the latency with FEE also increase with the velocity of SVs exceeds 30 km/h, the lowest average latency can be achieved with FEE.

VI. CONCLUSION
In this paper, we investigate the service migration problem in VFC networks consists of fixed position BSs, moving SVs and vehicles. We formulate the service migration process as a MINP optimization problem to minimize the average latency, where the mobility of SVs and the interference among the vehicles are taken into account. An online algorithm, FEE, is proposed to solve the MINP problem based on HMM technique and a interference detection function. The simulations results based on the real world taxi trajectory in Rome demonstrated that the proposed solution can reduce the average latency by up to 7.6% and improve the deadline guarantee rate by up to 8.0%, as compared with the state-ofthe-art solutions.