Joint Optimization of Offloading and Resource Allocation for SDN-Enabled IoV

With the development of various vehicle applications, such as vehicle social networking, pattern recognition, and augmented reality, diverse and complex tasks have to be executed by the vehicle terminals. To extend the computing capability, the nearest roadside-unit (RSU) is used to o ﬄ oad the tasks. Nevertheless, for intensive tasks, excessive load not only leads to poor communication links but also results to ultrahigh latency and computational delay. To overcome these problems, this paper proposes a joint optimization approach on o ﬄ oading and resource allocation for Internet of Vehicles (IoV). Speci ﬁ cally, assuming particle tasks assigned for vehicles in the system model are o ﬄ oaded to RSUs and executed in parallel. Moreover, the software-de ﬁ ned networking (SDN) assisted routing and controlling protocol is introduced to divide the IoV system into two independent layers: data transmission layer and control layer. A joint approach optimized o ﬄ oading decision, o ﬄ oading ratio, and resource allocation (ODRR) is proposed to minimize system average delay, on the premise of satisfying the demand of the quality of service (QoS). By comparing with conventional o ﬄ oading strategies, the proposed approach is proved to be optimal and e ﬀ ective for SDN-enabled IoV.


Introduction
The Internet of Vehicles (IoV) is one of the most promising application for Internet of Things (IoT) technology. Currently, it is fuelled by advances in related technology and industries, such as the decline in sensor costs, the widespread wireless connections, the improvement of computing capabilities, the development of cloud computing, and wireless transmission and positioning. In IoV, large amounts of heterogeneous data (such as voice, program code, and video) need to be transmitted in various links, e.g., vehicles to vehicles, vehicles to roadside equipment, and vehicles to the cloud [1][2][3][4]. These requirements are challenging for cloud infrastructure and wireless access networks. Upgraded service such as ultralow latency, continuity of user experience, and high reliability have been proposed to highly promote the local services at the edge of the network close to the terminals. The basic idea of Mobile Edge Computing (MEC) is to migrate the cloud-computing platform to the edge of the mobile access network. The traditional cellular network is deeply integrated with Internet services, to reduce the end-to-end delay of mobile service delivery and improve the user experience. With the development of MEC, mobile devices with limited resources can implement various new applications by offloading computing tasks to the MEC server, such as autonomous driving, augmented reality, and image processing [5][6][7]. The MEC server is owned by the network operator and is directly implemented in cellular base stations (BSs) or local wireless access points (APs) as a general-purpose computing platform [8,9]. On the one hand, higher requirements on computing resources and storage capacity and capabilities consumption are put forward to carry the various vehicular applications. On the other hand, the computing power of in-vehicle devices is limited by the size and portability. Therefore, MEC with distributed computing capabilities, rich computing resources, and flexible wireless accessibility is promising for IoV. For instance, the selected part of the in-vehicle task can be offloaded to the appropriate MEC for parallel processing and feedback the execution result to the vehicle-mounted terminal through the neighboring BSs or APs.
Although the MEC server has richer resources than local equipment, excessive load has a great impact on the transmission link. Considering the transmission delay on the link [10], this is detrimental to delay-sensitive tasks. As the number of vehicles increases, and the communication environment becomes worse, resulting in high transmission delays. In addition, the heterogeneous nature of vehiclemounted tasks places higher requirements on the entire system. There are two types of separable task offloading: (1) One is a bit-type task, which can be arbitrarily divided into several independent parts [11,12], and these parts can be processed in parallel on different platforms. (2) The other is a code-oriented task, which is composed of various components [13,14]. There are dependencies between task components and need to be executed in an orderly or continuous manner. Therefore, a reliable computing offloading solution is needed to support low-latency, highly reliable IoV services.
The edge computing capabilities of nearby RSUs have been leveraged to meet the task-intensive requests and strict latency requirements, i.e., part or all of the divisible bit-type tasks with high delay requirements are selected to be offloaded to nearby RSUs; then, the computing delay can be greatly reduced by parallel computing. Nevertheless, the unified task intensity is not often, some RSUs may have to handle extra requests beyond their capabilities, while other RSUs are relatively idle. Benefiting from the softwaredefined network (SDN) architecture, SDN controllers with global information are able to coordinate edge computing resources [15,16]. Combined with the current global situation, the requested tasks are controlled and forwarded to the corresponding target nodes through the SDN controller, which can effectively integrate global resources.
A lot of research work has focused on task offloading in IoV [17][18][19][20], majorly considering one part of offloading strategy, offloading ratio or resource allocation, and lack of the utilization of SDN to efficiently solve the load balancing problem. In this paper, we jointly optimize the offloading strategy, offloading ratio, and resource allocation, in order to minimize the system delay of SDN enabled IoV. Moreover, the effects of different task complexity on transmission and execution are also considered. The main contributions of this paper are as follows: (i) A tasks-divisible system model with a softwaredefined network is proposed based on two-layer transmission (ii) A Particle Swarm Optimization-(PSO-) based heuristic approach for the overall optimization is proposed, which can effectively solve the offloading strategy problem of multiuser and multiobjective nodes. This approach works by decomposing the problem into three subproblems: (1) offloading decision of vehicles; (2) resource allocation by RSUs; and (3) offload ratio of vehicles. It greatly reduces the complexity of the problem and is very effective for solving the multivehicle and multimec offloading scenario (iii) The offloading decisions, local offloading ratios, and resource allocation (ODRR) are jointly optimized in a complete way, to maximize the system performance By comparing with the conventional offloading strategies, simulation results show the proposed ODRR approach achieves the best performance.

Related Work
The offloading strategy has been a hot research topic for IoV, and various offloading models have been proposed in different application scenarios. Considering the standby time of mobile devices and the latency sensitivity of tasks, most work in edge computing or fog computing focuses on the optimization of energy consumption or latency. Therefore, we survey the related work according to the optimization goals, as shown in Table 1.

Optimizing the Energy Consumption.
For mobile users, processing various application tasks consumes a lot of energy, so improving the standby time of the device has always been a concern. Some work is devoted to reducing local computing power consumption to improve standby time. The energy cost of task calculation and file transmission has been studied in [21]. Combining the multiaccess characteristics of 5G heterogeneous networks, jointly optimizing offloading and wireless resource allocation to minimum energy consumption within delay constraints. A multiuser MEC system with wireless power supply has been modeled in [22], in order to solve a practical scenario that requires delay limit and reduces the total energy consumption of the AP, jointly optimizing the energy transmission beamforming of the access point, the frequency of the central processing unit, the number of bits offloaded by users, and the time allocation among users. [23] has proposed an energy-optimal dynamic computation offloading scheme algorithm to minimize system energy consumption under energy overhead and other resource constraints.

2.2.
Optimizing the Delay of the System. For latency-sensitive tasks, researchers are devoted to reducing system latency and improving user experience by optimizing local computing resources and edge node resources. [10] aim to minimize the maximum delay among users by joint optimization of offloading decision, computing resource allocation and resource block and power. [17] investigate the calculation rate maximization problem in the MEC wireless power supply system enabled by UAV, which is subject to the energy harvesting causal constraints and the UAV speed constraints. A new device-to-device multiassistant MEC system that requests local users to nearby auxiliary devices for collaborative computing has been designed in [18]. By optimizing task allocation and resource allocation to minimize the execution delay, a collaborative method has been 2 Wireless Communications and Mobile Computing proposed in [20] for parallel computing and transmission of virtual reality. The task is divided into two subtasks and offloaded to the MEC server and the vehicle side in order to shorten the completion time of the virtual reality application. Moreover, an offloading scheme has been proposed with efficient privacy protection based on fog-assisted computing and solved by a joint optimization algorithm to minimize the completion delay in [24].

Optimizing Both System Delay and Energy Consumption.
The user experience and the standby time of the device have been optimized together by the weight parameter, i.e., when the power is low, the weight of the energy consumption is set larger; when the power is sufficient, a larger delay weight is set. [19] consider a multicell wireless network that supports MEC, which assists mobile users perform computationally intensive tasks through task offloading. A heuristic algorithm is proposed to combine task offloading and resource allocation to maximize system utility, which is measured by the weighted sum of task completion time and energy consumption reduction. The system latency has been minimized with energy consumption constraints by jointly optimizing offloading decisions, local computing power, and fog node computing resources in [25]. The cloudlet overload risk has been alleviated by offloading user tasks to vehicle nodes, and a heuristic algorithm has been proposed to balance energy and delay to minimize system overhead in [26]. In order to solve the problem of high power consumption and delay sensitivity of portable devices, a reinforce-ment learning scheme has been proposed in [27] to search for optimal available resource nodes to minimize delay and energy consumption. In addition, the fog computing and cloud computing have been discussed in [24][25][26][27]. Since cloud servers are located in areas far away from cities, there is a large transmission delay, and tasks that are not sensitive to delay are offloaded to the cloud for computing, while intensive and delay-sensitive tasks are computed locally or offloaded to the fog to improve system performance.
In this paper, we mainly focus on delay-sensitive and task-intensive scenarios, considering that the computing resources of edge nodes and the number of tasks received in each period are limited. In order to prevent some edge computing nodes from being overloaded and some edge nodes relatively idle, we use the SDN-enabled IoV to control the task offloading decision-making by monitoring the global situation, which effectively improves the utilization of resources and reduce system latency.

System Model
In this section, the system transmission model, execution model, and optimization problem formulation are presented. As shown in Figure 1, we assume a vehicular network system is composed of N vehicles and M RSUs. Each RSU is equipped with a MEC server, which has the computing ability to process offloading tasks. Generally, the MEC can be a physical device or a virtual machine provided by the operator. Taking into account the complexity of the Zhang et al. [21] Multiple Multiple ---Minimize the total energy consumption of the system with delay constraints. Wang et al. [22] Single Multiple --Yes Minimize the total energy consumption Zhou et al. [17] Single Multiple --Yes Maximize the calculation rate.
Xing et al. [18] Multiple Single ---Minimize the total delay of the system with energy constraints.
Tran and Pompili [19] Multiple Multiple --Yes Minimize the total energy consumption and the delay of the system. Zhou et al. [20] Single Multiple -Yes Yes Minimize the maximal task completion time.
Chen et al. [23] Multiple Multiple -Yes -Minimize the total energy consumption of the system with delay and energy consumption constraints.
Chen et al. [ 3 Wireless Communications and Mobile Computing vehicular network, this system is a software-defined IoV that supports edge computing and the configuration of edge computing nodes. The edge nodes are coordinated and controlled by the software-defined network (SDN), which aims to reduce system delay and improve overall performance. As a coordinator, SDN divides the IoV system into two independent layers through software definition and virtualization technology: the data layer and the control layer. The edge nodes uniformly obey SDN scheduling and follow the OpenFlow protocol [28]. These edge nodes transmit and process information according to SDN control instructions. The control and processing are separated by the network entities, to effectively integrate resources and improve utilization. The edge computing node equipped on RSU connects the edge node cluster and the SDN controller through broadband connection. The physical communication on the control layer is independent of the physical communication channel on the data layer. The data layer is composed of an OpenFlow-based SDN controller and network nodes, refers to [29,30]. The SDN controller broadcast global status, including Channel Status Information (CSI), available resources, and task priority. When SDN receives the vehicle's offloading request, it looks for the best solution (including offloading decision and resource allocation) at the control layer and then sends control instructions. The data layer performs data transmission according to the received control layer. Each vehicle generates a task in a period of time, taking the heterogeneity of vehicle tasks into account (data volume, delay sensitivity, and difference in computational complexity). In the case of real-time tasks require minimal delay and/or have a large amount of data, local offloading cannot meet the requirements. Otherwise, tasks are not sensitive to delay response and can be processed locally. If all of them are executed locally or offloaded to the RSUs, it can cause timeout failure, waste of local resources, and a very poor communication environment due to interference. Therefore, different offloading strategies need to be set for different task types. Let V = f1, 2, ⋯, Ng and R = f1, 2, ⋯, Mg represent the set of vehicles and the set of RSUs, respectively. For ease of reference, the key symbols used in this article are summarized in Table 2. 3.1. Communication Model. We assume that each vehicle terminal n∈V has an executed task at a time and denoted as V n . Each task has three parameters, hd n , c n , t max n i, in which d n defines the size of the input data of the task V n of the vehicle terminal n (usually in bits), and c n defines the computing resources required by the task of the terminal n, which refer to CPU cycles. Parameters d n and c n can be obtained from task analysis. t max n is the maximum allowable delay for task transmission execution, i.e., if t max n is exceeded by the time of result received, and the task is failed by timeout. Since the vehicles receive the offloading decision, the tasks are not allowed to be interrupted before the execution is completed. Typically, the speed of cars on conventional road is 5 to 16 meters per second; thus, we assume the radio channel is not radical varying to interrupt the execution of the tasks, due to the severe fading. When the vehicle generates a task, it sends an offloading request to the nearby RSU first; then, the RSU routes the request command to the SDN controller. SDN synthesizes the current global information and provides the optimal offloading decision. Finally, the decision plan is sent to the targeted node through the control layer.

Wireless Communications and Mobile Computing
We introduce a binary variable of task offloading selection C m n . If C m n =1, it defines that the RSU m is selected by vehicle n to perform task offloading. On the contrary, C m n =0 means the vehicle n do not select the RSU m. Therefore, the constraint of C m n is defined as Equation (1) means that each vehicle can offload tasks to a unique RSU for execution. We define the coordinates of the RSUs set in two-dimensional plane as fðX 1 , Y 1 Þ, ðX 2 , Y 2 Þ, ⋯, ðX M , Y M Þg, the coordinates of the vehicle n are defined as ðx n , y n Þ, and the coordinates of nearest RSU s are denoted by ðX s , Y s Þ. Then the distance between the vehicle n and the nearest RSU s is given by The transmission rates of vehicle n to routing RSU s channel and routing RSU s to target RSU m channel are described as [31] where B RV and B RR represent the bandwidth allocations of vehicle n to routing RSU s channel and routing RSU s to target RSU m, respectively. σ 2 represents additive white Gaussian noise of the channel. h s n represents the transmission power from routing RSU s to vehicle n. h 0 is the complex Gaussian channel coefficient [31] following the complex normal distribution CN (0,1). ℵ is the path loss index.
We introduce b n to represent the local execution ratio of the vehicle; thus, ð1 − b n Þ denotes the offload ratio. Since the execution result is usually relatively small, the delay from targeted node to the routing node and the delay from the targeted node can be ignored. We define the binary parameter ζ m n , where ζ m n is 1 means the vehicle needs to be routed to the targeted node, otherwise, vice versa. Assuming the routing node is RSU s, based on the above formulas, the transmission time for the uploading ð1 − b n Þd n data from vehicle to the targeted RSU m is divided into two parts: (1) the delay of uploading from the vehicle to the routing node and (2) the delay of uploading from the routing node to the targeted node, which are expressed as Considering that the routing node can be the candidate of targeted node, the uploading time T m,up n is defined as 3.2. Computing Model. In this section, we introduce the computing model of the vehicle. Considering the parallel offloading mode, the computing model is mainly divided into two parts: (1) the local computing model and (2) RSU computing model. The input data size of task V t generated by vehicle n.

B RV
The bandwidth of vehicle to RSU channel.

B RR
The bandwidth of RSU to RSU.

T n
The delay of vehicle n completing task. h 0 The complex Gaussian channel coefficient.
x i The position of particle.
x n , y n ð Þ The coordinates of vehicle.
The distance of vehicle and RSU.
The additive white Gaussian noise of the channel.  (7) and (8), and the execution time of vehicle n on RSU m is defined by Equation (9).
f m T m,comp Assuming there exist M RSUs in the network, then the execution time for vehicle n is defined as For vehicle n, the task is divided into two subtasks, which are processed in parallel by local unit and by edge RSU node. The task completion time is accordingly divided into two parts: local processing time and edge RSU node processing time. The edge RSU node processing also results transmission delay T m,up n and execution delay T m,comp n . Therefore, the time for completing task generated by vehicle n is determined by the maximum delay, which is defined by 3.3. Problem Formulation. For delay-sensitive applications, delay is a problem that must be considered. Therefore, it is vital to formulate the most suitable offloading strategy based on the global status. For intensive tasks, meeting the performance requirements of the vehicle and making full use of effective resources are of importance. In addition, considering the transmission and execution delay caused by offloading, the system delay is defined by Equation (12). Therefore, offloading decision-making and resource allocation must be jointly optimized to improve system performance. The goal is to provide all vehicle optimized offloading strategies χ, computing resource allocation F, and offloading ratio B, aiming to reduce average delay. Finally, the optimization problem is described as follows: ζ m n ∈ 0, 1 f g, ∀n ∈ V ,∀m ∈ R: ð13f Þ The above constraints are explained as follows: constraint (13a) is to ensure that the total delay of the task does not exceed the maximum allowable delay; constraints (13b) and (13d) mean that each vehicle can only transmit the task to only one RSU, and the offloading decision is a binary variable; constraint (13c) is the offloading ratio constraint, which is a decimal between 0 and 1; and to ensure that the resources allocated by the RSU to the vehicle does not exceed its own capacity, the constraint (13e) must be met. Finally, there is a binary constraint, which represents whether the vehicle to the targeted RSU needs to be routed.

Problem Solving
The fact that the offloading decision is a binary variable brings problem P1 as a mixed integer programming problem, which is nonconvex NP-hard. In order to reduce the complexity of the problem, we divide the problem into three subproblems, i.e., offloading decisions of various vehicles, proportional distribution of tasks performed locally, and different resource allocation for vehicles by RSUs.

Offloading Strategy Making and Load
Balance. Given the local computing ratio B and resource allocation F, problem P1 is transformed into P1:1 as follows: Obviously, P1:1 is still an NP-hard problem. For such problems, heuristic algorithm is a rational solution. The Particle Swarm Optimization algorithm (PSO) originated from the study of bird predation behavior is a evolutionary heuristic algorithm, which has efficient global search capabilities. It has achieved great success in image processing and neural network training. Hence, we propose a offloading decision-making algorithm based on PSO. The basic idea of PSO is to find the optimal solution through collaboration and information sharing between individuals in the group. In the paper, particles have only two attributes: speed and position. Speed represents the speed of movement, and position represents the direction of particles. Each particle searches for the optimal solution separately in the search space and records the current individual extreme value, then sharing the individual extreme value with other particles. All particles in the particle swarm adjust their speed and position according to the current individual extreme value they find and the current global optimal solution shared by others. Therefore, through iteration, the particles of the entire population eventually converge to the optimal solution.
According to the speed update formula proposed by Clerc and Kennedy [32], we introduced a compression factor x. The update formula for speed and position is presented as where i = 1, 2, ⋯Nc max:, Nc max is the number of particles. w is the coefficient of inertia. The larger w, the stronger the global optimization ability, and the weaker the local optimization ability. c 1 , c 2 are the learning factors, V i ðIÞ is the velocity of particle i at the I − th iteration, and X i ðIÞ is the current position of particle i at the I − t h iteration. V max denotes the maximum velocity. The compression factor ρ is given by where φ = c 1 + c 2 . The compression factor guarantees the convergence of the particles and prevents the explosion of velocity. The specific process of the improved PSO algorithm is described in Algorithm 1. The f itness function refers to Equation (12).

Resource Allocation
Substituting formulas (4), (5), and (6) into P1:2, and performing equivalent transformation, the overall optimization problem is changed to the following form: As P1:3 shows, T n is not differentiable subject to f m n . Substituting formulas (5), (6), and (9) into P1:3, then the T n is approximated as P1:4 is a convex optimization problem, with linear constraints (13e) and convex inequality constraints (23a). Therefore, we use Lagrangian duality theory to solve this problem. The Lagrangian function of P1:4 is given by The Lagrange dual function is then given by Then, the dual problem of P1:4 is max D λ, θ ð Þ s:t:λ n , θ m ≥ 0: As the Lagrange function is differentiable, the gradients of the Lagrange multipliers can be obtained by The Lagrange multiplier iterative formula is as follows by using gradient descent.

Offloading Radio Allocation.
Given χ and F, the P1:4 problem can be transformed into a linear programming

Input:
Offloading decison: C m n : Output: Routing information: ζ m n : 1: Initialize the location of the vehicles.

Input:
The input parameters of particle swarm: c 1 , c 2 , w, r 1 , r 2 , Mcmax, Ncmax: Output: Gbest, ⊝Gbest 1: For j = 1 ; j < = Mcmax ; j + + do 2: For each i ∈ ½1, Ncmax do 3: Initialize the velocity position of particles V i ð0Þ, X i ð0Þ 4: End for 5: In Algorithm 2, we obtain ζ m n then record the current position and fitness as particle's individual extreme option and value Pbest, ⊝Pbest. 6: Record the smallest fitness and the corresponding position as ⊝Gbest, Gbest. 7: While the number of iteration steps is not 0 do 8: Update the velocity V i ðjÞ of particles i using Equation (16) Update the position X i ðjÞ of i using Equation (17) Evaluate fitness of particle i using Equation (14) 10: If f itnessðX i ðjÞÞ < ⊝Pbest then 11: Based on the above formula, ∂W /∂b n as a constant and the minimum value can be obtained at the boundary. According to the constraints (13c) and (23a), b n can be obtained.
Taken together, we propose an approach combining the whole process of offloading strategy, offloading ratio, and resource allocation control (ODRR), as described in Algorithm 4.

Numerical Results
In this section, simulation configurations and results are presented and analyzed to verify the effectiveness of the proposed algorithm.

Simulation
Configurations. The scenario in this paper is as follows: the system consists of 3 RSUs and N vehicles ðN = 10,20,30 ⋯ Þ, which carry tasks with random parameters, different data volumes, computing resources, and allow-able delays. Assuming that the computing resources of 3 RSUs are ½15G, 15G, 15G, the local resources of the vehicle are 1G. Vehicles' task data volume, computing complexity, and maximum allowable delay are random ð100KB, 300KBÞ, random ð1000, 9000Þ, random ð1s, 2sÞ. Referring to [31,33,34], communication parameter settings are shown in Table 3. The settings of the parameters in Algorithm 1 are as follows: the number of particles is 100, the maximum number of iterations is 50, the learning factors c 1 and c 2 are both equal to 2, because the learning factors are parameters for adjusting the step size. If the setting is too large, the particle moves fast and fly over the optimal point. If set small, the optimization speed will be slow. Larger inertia weight has stronger global search ability and slower convergence speed. In order to avoid falling into the local optimal solution and have a faster convergence speed, it is most appropriate to set ω to 0.9. In order to verify the effectiveness  The learning factors c 1 , c 2 2 The inertia weight ω 0.9 9 Wireless Communications and Mobile Computing of the proposed offloading strategy on the proposed Internet of Vehicles architecture, we compare it with other offloading strategies.
(i) Offload-Whole-to-RSUs: offload the whole task to edge nodes including access node and remote nodes (ii) Execute-Locally: the vehicle terminal directly executes the task locally (iii) Offload-proportion-by-ODRR: joint optimization of offloading decision, local calculation ratio, and resource allocation (ODRR) is based on the proposed algorithm (iv) Offload-proportion-by-SA: offload proportion of task to RSUs using simulated annealing algorithm (SA).

Simulation Results.
In this section, we present the performance of the proposed ODRR algorithm and compare with other conventional offloading strategies. Figure 2 plots the average execution time of vehicles as the number of connected vehicles increases. It can be seen that the performance of the proposed ODDR partial offloading algorithm is the best and can keep the average calculation delay to a minimum, and the partial offloading SA algorithm is behind it. When the number of vehicles is less than 35, the effect of offloading whole to RSUs is better than executing locally. Because RSUs have more computing resources than the vehicles, the computing capability of RSU is dozens of times that of executing locally. Therefore, computing performance of executing locally is worse than offloading whole to RSUs. But when the number exceeds the limit, the situation becomes different. On the one hand, this is because the resources of RSUs are limited. When the number of offloading vehicles exceeds a certain number, the load capacity of RSUs is exceeded, resulting in great performance decrease. On the other hand, more vehicles means a worse communication environment, which leads to more communication delays. Compared with the other three conventional strategies, the latency of the proposed ODRR algorithm is always the smallest, as the number of vehicles increases. Compared with the Offload-Whole-to-RSUs scheme, the ODRR can be reduced by 42.7% in the best case, and 17.5% in the worst case; compared with the Execute-Locally scheme, the ODRR can be reduced by 52.6% in the best case, and 24% in the worst case; compared with Offload -proportion-by-SA scheme, the highest can be reduced by 16.7%, and the lowest by 7.8%. It can be concluded that compared with other two conventional strategies, ODRR can reduce the delay by up to nearly half. Compared to the Offload -proportion-by-SA scheme, the reduction is also up to 10%. Figure 3 plots the impact of different executing complexities (ϕ = c n /d n ) on system delay. The number of connected vehicles is set to 30, and it is found that the average delay of the four offloading strategies increases linearly with the increase of task complexity. The performance of the ODRR algorithm given in this paper is obviously the best compared with other strategies. The partial offloading by SA algorithm is the second, the whole offloading to RSUs is the third, and executing locally has the worst performance. The higher the task complexity, the more CPU resources are needed to process each byte of data. The local computing resources are much smaller than RSUs, so executing locally gets the highest latency. However, offloading whole to RSUs causes uneven distribution and local resource waste. The partial offloading ODRR algorithm takes into account both resource allocation and offloading ratio, which greatly improves  Offload-whole-to-RSUs Offload-proportion-by-SA Figure 4: The average delay of the cases with different execution input data size. 11 Wireless Communications and Mobile Computing system performance. Compared with the Offload-Whole-to-RSUs scheme, the ODRR can be reduced ranging from 14% to 29%; compared with the Execute-Locally scheme, the ODRR can be reduced ranging from 14% to 49.7%, and when the computational complexity is greater, the reduction effect is better. Compared with the Offload-proportion-by-SA scheme, the reduction is between 7% and 9%.
When N = 30, ϕ = 2000, Figure 4 shows the change of average delay with the amount of input data increasing. The average execution delay of the vehicles increases linearly with the size of the input data increasing. The proposed ODRR algorithm obtains the minimum delay, after the SA algorithm, whole offloading to RSUs is the third, and only executing locally is final. The larger the input data, the more transmission delay is caused. The algorithm proposed in this paper jointly optimizes the offloading ratio, offloading decision-making, and resource allocation, thus greatly improving the system performance. With the larger amount of input data, the ODRR proposed in this paper has a better effect on reducing the delay. Compared with Execute-Locally scheme, the reduction is between 36.6% and 47.5%. Compared with Offload-Whole-to-RSUs scheme, it can reduce the delay by 30.4% to 42%; compared with the Offload-proportion-by-SA scheme, the decline rate is nearly 10%.

Conclusion
In this paper, we propose a multiuser and multi-RSU system architecture based on SDN-enabled IoV. The loads of RSUs are effectively balanced by using the characteristics of SDN. In order to reduce the delay of task offloading in IoV, a joint approach is proposed to optimize the offloading ratio, offloading decision-making, and resource allocation. Compared with the conventional work that executing locally, the system performance increases 36:6% − 47:5%. Compared with the decision by fully offloading to RSUs, the performance increases 30:4% − 42%; compared with the offloading strategy by SA, the performance increases about 10%. The simulation results have greatly proved that the joint optimization approach proposed in this paper is more effective than conventional strategies in dealing with the delay problem of multiuser and multi-RSU system and can effectively solve the multidimensional problem. Although greatly improving system performance, there is still room for improvement. For instance, the possibility of task failure caused by transmission link or edge node failure has not considered in this work. Therefore, the reinforcement learning-based approach is of interest to solve the optimization goal considering the failure retransmission mechanism of the task.

Data Availability
No data were used to support this study.

Conflicts of Interest
The authors declare that they have no conflicts of interest.