Severity-Based Prioritized Processing of Packets with Application in VANETs

To fully realize the potential of vehicular networks, several obstacles and challenges need to be addressed. Chief among the obstacles are strict QoS requirements of applications and differentiated service requirements in different situations. Although DSRC and WAVE have been adopted as the de facto standards, they do not address all the problems and there is room for improvements. In this study, we propose a generic prioritization and resource management algorithm that can be used to prioritize processing of received packets in vehicular networks. We formulate the generic severity-based prioritized packet processing problem as Penalized Multiple Knapsack Problem (PMKP) and prove that it is an NP-Hard problem. We thus develop a real-time heuristic that utilizes a relaxed version of the formulation. The relaxed formulation executes in polynomial time and guarantees a minimum delay per severity-level while respecting the processing rate constraint. To measure the performance of the proposed heuristic, real traffic data is used in a small-scale experiment. The proposed heuristic is tested against the PMKP solution and results show a small degradation of up to 4 percent in profit for the heuristic compared to the PMKP solution. Also, the proposed heuristic is tested against a non-prioritized processing algorithm that works using first come first served policy. Results show that the proposed heuristic gains 9 to 67 percent more profit than the non-prioritized processing algorithm in moderate and high congestion scenarios.


D EDICATED short-range communications (DSRC) and
Wireless Access in Vehicular Communications (WAVE) have become the de-facto vehicular communications technologies in VANETs. IEEE 802.11p and IEEE P1609 form the bases of the WAVE protocol as shown in Fig. 1 [1]. To address the unique challenges in VANETs (i.e., dynamic topology, short communication periods and application requirements), WAVE uses multi-channel operations to increase channel utilization, and differentiated service categories to provide Quality of Service (QoS). To provide multi-channel operations, WAVE utilizes the IEEE 1609.4 standard, which defines six Service Channels (SCH) and one Control Channel (CCH) for use in VANETs [2]. These channels have different frequencies, maximum transmission power and applications. The CCH for instance is used for transmitting safety and control data in order to insure fast and prioritized delivery of time critical data. Furthermore, to provide differentiated services, WAVE relies on IEEE 802.11p, which uses Enhanced Distributed Channel Access (EDCA) at the Medium Access Control (MAC) layer to provide differentiated QoS. The IEEE 802.11p EDCA specifies four different Access Categories (ACs): AC_VO (Voice or AC3), AC_VI (Video or AC2), AC_BE (Best effort or AC1) and AC_BK (Background or AC0), each of which has a different priority for accessing the communication medium [2], [3], [4]. This categorization offers low latency communications and differentiated services for applications. An overall schematic of multi-channel access and ACs assignment is shown in Fig. 2. We have to emphasize that the IEEE 802.11p scheme for prioritization only applies to applications during data transmission and does not affect the processing of data after its receipt. For more details on WAVE, please refer to [1], [5], [6].
The use of multi-channel access and data prioritization via ACs, as detailed in the EDCA standard, only guarantees prioritized access to the communications medium for broadcasting and sending data. However, this may not necessarily lead to improved system level performance, because each vehicle in the network has to process the received data based on its own context, not the transmitting vehicle's context. Assume the scenario shown in Fig. 3, where five different vehicles are involved. If vehicles B and C collide, then both vehicles would try to inform their neighbors by sending data using the highest priority AC. This flow of data is very important for vehicle "A", but not as important for vehicles "D" and "E". In such a scenario, vehicle "A" must prioritize the processing of packets that it receives from vehicle "B" (and/or vehicle "C"). On the other hand, vehicles "D" and "E" do not necessarily benefit from processing the high priority safety application data flow(s) from vehicles "B" and/or "C" ahead of other flows with lower ACs, since the accident does not have impact on their mobility. In such scenarios, it is hence imperative that each vehicle processes the received data flows, not just based on their ACs, but also based on the flows impacts on the vehicles' mobility.
Prioritization of received data and management of computation resources are important tasks because autonomous and semi-autonomous vehicles have to process data from a wide range of sensors (e.g., LIDAR, GPS, compass, radar, infrared cameras) at any given moment, which in turn puts more computation overhead over the on-board computational resources. Beyond processing raw sensor data, the on-board computational resources must execute complex algorithms to perform proximity understanding and vehicle control.
Another example to illustrate the importance of the proper prioritization of received data flows is the security performance of basic safety messages (BSMs). To verify and sign BSMs, the standard recommends using the Elliptic Curve Digital Signature Algorithm (ECDSA). However, using ECDSA increases the processing overhead [7] and degrades the performance that could result in the loss of safety critical BSMs. This can become problematic especially in environments with higher density of vehicles. To solve this issue, the authors of [8] propose re-prioritizing signature verification of received BSMs based on location proximity of the sender's vehicle, such that nearby vehicles are assigned higher priority. This example demonstrates the importance of prioritized processing of data flows on the receiver's side in order to increase the overall performance of the system.
From the discussion of the two previous scenarios, it is evident that achieving ideal performance in VANETs depends, not only on efficient algorithms and techniques for sending data, but also on a better prioritization of packets on the receiver side. This prioritization must be done according to a certain severity metric that corresponds to the nature of the application. The proposed algorithm prioritizes the processing of received data based on their impact on safety of a given vehicle.

Contributions
In this paper, we aim to design a real-time algorithm to opportunistically prioritize the processing of data flows based on a generic severity notion, such that the benefit to the overall system is maximized. Severity can thus be defined according to the application, as a metric (e.g., vehicle speed, direction, position) that underline the importance of the flow for the overall benefit of the system. The proposed algorithm models flow prioritization by classifying them according to their severity into multiple queues with different priority and capacity levels. For this proposed approach, we derive an upper bound on the delay of service for the flows classified in each queue using network calculus. We then formulate the problem of maximizing the severity of the admitted flows into the queue system as a penalized multiple knapsack problem with a service delay constraint on each of the queues. Being an NP-hard problem, we propose a real-time heuristic that divides the problem into sub-problems, each finding the optimal admission of flows into each of the queues such that the total severity of the admitted flows is maximized. Finally, both the optimal and heuristic solutions are tested using real traffic data and compared to un-prioritized first come first serve approaches.

Examples of Applications
The potential applications of our proposed algorithm can be numerous depending on the application's definition of flow severity. In the simplest form, flow severity can be defined as a QoS requirement that needs to be fulfilled. The dynamic topology of VANETs imposes strict QoS requirements on applications, especially the safety applications [9]. If severity is defined as application's QoS requirement, then the algorithm would strive to assign flows to queues such that flows with the most strict QoS requirements get higher priority. If severity is defined as the sending vehicle's proximity, then the algorithm would strive to provide prioritized service to flows that belong to the closest vehicles. In all these use cases, our algorithm acts as an admission control system, whereby it assesses the processing resources and   incoming flows and strives to service the most severe flows first in order to achieve the best performance for the overall system.
Another important use of our proposed severity-based prioritization algorithm is to provide adaptive security in VANETs. To provide security in VANETs, WAVE relies on cryptographic solutions [6]. In order to have better security, it is important that more robust cryptographic solutions are used. However, using more robust cryptographic solutions leads to increased computations, increased cryptographic loss [7], and can have severe impact on the achieved QoS of applications [7], [10], [11]. To overcome this problem, adaptive security measures can be used, where a vehicle can determine the robustness of the cryptographic solution it uses for each flow based on the load and performance of the overall system. In such scenarios, our algorithm can classify four different cryptographic solutions ranked from the most (i.e., requires more computations) to the least robust, and determine which cryptographic solution would result in the best performance based on the flow, application QoS requirements, and performance of the overall system.
In conclusion, we are proposing an algorithm that can be adopted to support any application benefiting from intelligent prioritized processing of requests. In the rest of this paper, we focus on prioritized packet processing in VANETs.

Organization
The remainder of the paper is organized as follows: The related literature is reviewed in Section 2. The proposed prioritization model and system parameters are described in Section 3. In Section 4, we derive the delay upper bounds for the service of each of the queues. Section 5 shows the formulation of the problem in terms of the penalized knapsack problem, while Section 6 provides a heuristic solution. In Section 6.4, we provide the upper bound delay proof. Section 7 describes our experiments and results while conclusions are drawn in Section 8.

RELATED WORK
WAVE QoS, service prioritization, and performance improvements are studied extensively in the literature. Generally, the studies and solutions offered can be divided into two broad groups: (1) studies that offer solutions from the sender's point of view and (2) studies that tackle the issue from the receiver's point of view. In the first group, the offered solutions range from spectrum sharing in order to prioritize safety message delivery [12], [13], [14], [15], [16] to MAC layer enhancements and admission control techniques in order to improve QoS and channel access [17], [18], [19], [20], [21], [22], [23], [24], [25]. Furthermore, there have been studies [26], [27], [28] that use vehicle's contextual information (i.e., vehicle's position) in order to ensure effective utilization of resources and provide prioritized services. The major difference between our work and these studies is that we tackle the issue from the receiver's point of view. We consider a receiver's perspective (as opposed to the sender's perspective) to achieve prioritized processing at the receiver (as opposed to prioritized transmission from the sender). Our algorithm deals with data that is received by a vehicle with the objective of opportunistically prioritize the processing of the received data for the overall benefit of the VANET.
While there have been numerous studies to improve QoS, service prioritization, and performance of WAVE from the sender's perspective, in the second group, there have not been many studies that address these issues on the receiver's side. The few studies that have been conducted in this area focus on security performance. Verification of time-sensitive BSMs in order to decrease cryptographic loss, by prioritizing the verification of BSMs based on the physical position of the sender, has been studied in [8], [29]. The authors of [30] have proposed to reduce the verification time of messages at the receiver side in dense areas by assigning different priority levels to nearby vehicles based on their physical parameters after verifying those vehicles. Our study in this paper extends these special cases in the aforementioned sources to a more general prioritized processing of the received packets in VANETs, as a function of a generic severity metric, in order to maximize the overall profit to the system while respecting its QoS constraints. The generic severity metric can be defined based on the application, such as physical proximity of vehicles as in [30] or more complex settings as in [28]. Therefore, our proposed solutions can apply to a variety of prioritized packet processing applications by properly defining its corresponding severity metric.

Prioritization Model
In this paper, we propose a real-time algorithm that allows vehicles in VANETs to intelligently prioritize the processing of the received packets based on their severity. Upon receipt of data flows, each flow is assigned a severity-level and passed on to the next phase for flow policing. This policing prevents flooding attacks as it regulates each flow via a token bucket filter to a predefined processing rate. The last phase is assigning the flows to one of N queues based on both the flow's severity and the capacity of the queue. These queues have different priority levels and capacities, such that "Queue N" has the highest priority and smallest capacity, while "Queue 1" has the lowest priority and the largest capacity. The size of each queue is determined by the computational load and delay requirements of it's assigned flows, and it dictates the maximum delay that will be incurred by the flows assigned to that queue. While assigning flows to queues, the algorithm strives to assign the highest severity flows to the highest priority queue to ensure their fast processing. The other flows are passed to their corresponding queues according to their severity levels. Once the capacity of a queue is reached, the algorithm proceeds to place the next batch of unassigned flows of the same severity to the subsequent lower priority queue. This process continues until all flows are assigned to queues or queues are all filled. If some flows are left out after all the queues were filled, the algorithm discards these remaining flows as these cannot be serviced in a timely manner. Although it's possible that some flows are discarded, our algorithm makes sure to serve the highest severity flows first while guaranteeing performance bounds for the accepted flows. The process of assigning flows to queues happens in snapshots. During every snapshot, which is done every Dt, the algorithm takes the available flows and assigns them to queues. The frequency of generating flow snapshots and the addition and removal of the flows to the snapshots are not handled in our algorithm. Rather, it assumes the availability of the snapshots and focuses on prioritizing flows available during each snapshot.

System Parameters
The system model and parameters is shown in Fig. 4. Assuming a VANET with V vehicles, where one vehicle V r 2 V receives packets of length L (measured in bytes), sent from a set of sending vehicles V s ¼ V n V r within its communications range. V r receives all these packets via its On Board Unit (OBU), which has a channel reception rate R b (measured in Mbps) and maximum burst length B (measured in packets). Let R be the rate in packets per second of the OBU (i.e., R ¼ R b L ). The received packets are then passed to the marking queue of the marking processor, which is assumed to be the On-Board Unit (OBU) processor. The marking processor assigns to each incoming packet a priority (severity) level based on the receiving vehicles perspective. The marking service requires simple computations (e.g., marking the packets based on the type of application, relative position, speed and direction of the sending vehicle); thus, induces a very small and almost negligible processing delay. The marking processor uses the packets' source MAC address in order to demultiplex the incoming packets into a set of flows F (i.e., a flow is defined between a source-destination pair of vehicles). The marking process applied to the scenario shown in Fig. 3, would be as follows: When vehicles B and C collide, they transmit data about collision to their surrounding vehicles. Since vehicle A is affected by this collision, when it receives data about the collision, based on its context severity, its marking processor will mark the received data about the collision with highest severity category and processes it accordingly. But since the collision doesn't affect vehicles D and E, when they receive this data, their marking processors would mark it with a lower severity level (severity level 2, 3, or 4 based on the defined context severity). Let S i be the serverity level of the packets in flow i, i 2 f1; . . . ; jF jg. We assume M severity levels. Packets are assigned to flows in order to enforce per-flow policing, which is an important measure in order to protect the system from flow-based unfair exploitation (e.g., flooding attacks). The policing phase limits the per-flow rate and burstiness based on the severity level.
Flow i, i 2 f1; . . . ; jF jg, with severity level S i has a maximum rate and burstiness of ðr i max ; s i max Þ. Regardless of the traffic from neighboring vehicles, all flows are thus forced to respect the per-severity limits such that flows violating the limits are dropped. Finally, the last phase is the processing phase where flows are assigned to N queues. "Queue N" has the highest priority and the least capacity, which is appropriate for serving high severity flows. On the other end, "Queue 1" has the lowest priority and highest capacity. Although, "Queue N" may best serve flows of high severity, but this queue may admit flows of low severity depending on the available flows in order to maximize the utilization of system resources. Processor k, k 2 f1; . . . ; Ng, has a fixed processing rate of C k and queue k, k 2 f1; . . . ; Ng, has a guaranteed maximum delay of d qk . Additionally, the total delay induced by processing all accepted flows admitted to queue k must be less than or at most equal to the guaranteed maximum delay d qk as explained later in Equation (9). The objective is to serve the maximum number of requests while providing the highest quality of service and maintaining guaranteed delay bounds in all queues.

DELAY UPPER-BOUNDS
Since the OBUs are the sources of data and as long as the maximum transfer rate is known, the output of the ith transmitting OBU can be upper bounded, using network calculus tools, by an affine arrival curve (A i ) that is defined as [31] Consequently, the ith sending OBU has burstiness B i and rate R i . The sum of burstiness of all OBU flows equals the received burstiness at the destination OBU as shown in the following equation: Also, the sum of the rates of all OBU flows equals the received rate at the destination OBU as shown in the following equation: Thus, the input to each receiving OBU D i is upper bounded by an affine arrival curve Since the input to the marking process is bounded by (2) and the marking service rate is C m , then the delay for the marking phase d m is The output of the marking phase D m i consists of jF j flows that is upper bounded by which can be reduced to the following form: The policing process of the ith flow D p i is expressed by the following bound: where f j i is a flag that is set to 1 to indicate that the ith flow belongs to severity level j; zero otherwise. Since there exists M severity levels and each flow is assigned to only one of them, we have the following constraint on these flags: The Ã operator in (4) represents the min-plus convolution operator, which is an infimum operation over the addition of the bursitness and the service. Consequently, Equation (4) can be rewritten as which is equivalent to Since we are looking for the upper bound, we can assume the maximum traffic-per-flow. In other words, only the maximum burstiness and rate per severity are selected from Equation (5). Thus, the output of the policing process is upper-bounded by Each flow i is assigned to one of the N prioritization queues of the system. The flag g k i is used to indicated these assignments, such that g k i is set to 1 to indicate that the ith flow is assigned to Queue k; otherwise it's set to zero. So, for any flow i we have The delay during the processing phase d r k is per-queue, so the upper-bound on the delay for Queue k is computed using all flows that are processed by Queue k as The total delay per-queue d t k is the sum of the marking delay and the processing delay as shown below: Note that "Queue N" has the highest priority and can handle high severity flows faster than the other queues

PROBLEM FORMULATION
As was mentioned earlier, our objective is to serve the maximum number of flows (i.e., vehicles) prioritized based on their severity while at the same time striving to provide the highest quality of service. However, these two goals might not always be in harmony. If we try to provide the highest quality of service (e.g., using the most robust cryptographic solution), it may result in some flows not being serviced within the required delay constraint. So, we have to find a balance between the quality of service that can be provided and the number of flows that can be serviced with priorities based on their severities. Thus, we formulate this problem as a Penalized Multiple Knapsack Problem (PMKP) with the goal of maximizing the profit (i.e., the total severity of the admitted flows). The next sections introduce the formulation of the problem of maximizing the profit of the system in terms of the total sum of severities of admitted flows, while fulfilling their corresponding delay constraints. In Section C, we show that the problem is NP-Hard.

Derivation of the Delay Constraints
Each queue has a delay d q k , and accepted flows must satisfy the condition that the total processing delay of accepted flows in Queue k must be less than the delay of that queue. This can be written mathematically as which states that the total delay-per-queue d t k must not exceed the kth queue delay d q k . The above inequality can be reduced to the following form:

PMKP Formulation
Before presenting the formulation, we define c as the penalty term that represents the highest severity among the dropped flows and order the set F based on severity in a non-increasing order.
The problem can thus be expressed as a PMKP as follows: s.t.
Constraint (11) indicates that the penalty term is the highest severity among the dropped flows. The idea is to deduct a penalty from the overall profit for every dropped flow. The second constraint (12) ensures that the total delay of each queue does not exceed the guaranteed queue delay. The third constraint in (13) specifies that every flow i cannot be assigned to more than one queue. However, it is possible that flow i is not assigned to any of the queues; meaning it is dropped. The last constraint in (14) indicates that this optimization problem is an integer linear programming problem, where assignment of flows to queues can be either zero or one (i.e., no fractional assignment of flows to queues).

Proof of NP-Hardness
The problem discussed in this paper is a PMKP and is NP À Hard in the weak sense. To prove it, we only need to show that this problem is actually a Multiple Knapsack Problem ðMKP Þ. In fact, MKP is a special case of the PMKP when the penalty term c is known.

HEURISTIC SOLUTION
To devise a real-time heuristic, we divide the overall problem into N sub-problems, where each problem k 2 N finds the optimal flows that fit in Queue k capacity such that the total profit (i.e., admitted severity) of the system is maximized. To ensure the maximum system profit and the best quality of service for the received flows, the sub-problems are solved starting from Queue N down to Queue 1. The solution of the sub-problems is inspired by the work of Ceselli and Righini [32]. Before presenting the algorithm, we define F k as the set of input flows to Queue k, i.e., flows available to be admitted in Queue k. This set F k of input flows to Queue k includes all the unassigned flows after solving the flow assignment problems to the higher priority queues (i.e., F k includes all flows from the original set F except those selected by the higher priority Queues fk þ 1; . . . ; Ng). For example, the input set of flows F NÀ1 excludes flows selected by Queue N from input set F N . Furthermore, we define X k , (with jX k j ¼ jF k j) as the vector of flow selection flags from F k , where a value of 1 in the ith flag X k ½i indicates that the ith flow is selected for admission in Queue k, while 0 means that the ith flow is not selected by Queue k. Consequently, the set of input flows to Queue k can be mathematically expressed as where F N is the set of input flows to Queue N, which is initialized to all F . The proposed heuristic algorithm proceeds as follows: For k ¼ N down to 1, do the following steps: Order the set of input flows F k for Queue k based on their severity. Find the initial flow selection vector X k for admission to Queue k using the lower bound solution (See Section 6.1). Let Z k be the sum of the severity of admitted flows in Queue k given the lower bound solution.
Iteratively find better flow admission solutions for Queue k using the upper bound solution (See Section 6.2). If any flow admission solution e X k with the sum-severity e Z k > Z k , let Z k ¼ e Z k and X k ¼ e X k . X k contains the optimal flow admission solution for Queue k having the maximum severity level Z k , while respecting the flow constraints. In the next sections, we will explain how the lower and upper bound solutions are obtained. The pseudo-code in Algorithm 1 details the steps of the entire process.

Lower Bound Solution
The input flows are admitted to Queue k in descending order of flow severity. Such flows are added until the flow with index l, for which its addition will exceeds the capacity C k of Queue k (as illustrated in Fig. 5). Thus, the range of flows f1; . . . ; l À 1g can be admitted and processed by Queue k without violating the capacity constraint, and without penalty since no flow is dropped from this range of flows. This implies that the elements X k ½j will have one values for j 2 f1; . . . ; l À 1g and zero otherwise. We will refer to flow f k l as the initial leading flow, which represents the flow with the highest severity among the dropped flows in the range fl; . . . ; jF k jg. Consequently, the lower bound solution Z k is initialized by adding the severity of those flows on the left side of flow l as shown in the following equation: This initial solution is a feasible solution. Next, we define L k as the set of possible leading flows for Queue k. The set L k is initialized with all the flows to the left side of the leading flow f k l (i.e., f k i , 8i 2 f1; . . . l À 1g) as illustrated in Fig. 5. Each leading flow is used to find an upper bound solution to the sub-problem.

Upper Bound Solution
In this part, we solve jL k j Relaxed Penalized Knapsack Problems ðRPKP Þ and compare their solutions with the lower bound solution to find the solution with the maximum profit. The following formulation represents the problem of finding the upper bound solution for Queue k's flow selection problem s.t.
The upper bound solutions are computed using the following jL k j iterative steps for every leading flow i 2 L k in descending order of severity (as detailed in the pseudocode of Algorithm 1): While l ! 1 do: Set the penalty term c k ¼ S l ; i.e., set it to the severity of the leading flow.
Mark the leading flow l as dropped and all flows to its left as selected. This is basically equivalent to eleminating the current leading flow from F k in the current iteration of the upper bound solution. Marking is represented by constraints (19) and (20). Solve the problem as an RPKP with the penalty c k ¼ S l . Fix the fractional results of RPKP to 1 and 0 s using the proposed fixing heuristic (See Section 6.3). Compute the corresponding upper bound solution e X k and its sum-severity e Z k as the severity of flows with If the current upper bound solution has a greater sum-severity than Z k , update the solution X k ¼ e X k and its sum-severity Select the new current leading flow l from the set L k to be the one just to the left of the previous leading flow. In other words, set l l À 1. The core philosophy of this solution is to eliminate one of the selected flows or the initial leading flow from the lower bound solution at a time, starting from the lowest severity among them and on. This opens room for selecting flows on the right of the current leading flow of each iteration, as long as this will maximize the profit of Queue k (i.e., the sumseverity of its final admitted flows). To do this, the problem is solved as an RPKP . Now since the penalty term c k is known to be the severity of the leading flow, then the problem is reduced to an RKP . However, solving the problem using the relaxed version might result in a fractional solution. Thus, we use the proposed heuristic in Section 6 for fixing the relaxed solution to get a feasible integer solution.

Algorithm 1. Severity-Based Prioritized Processing Heuristic
Sort F k in descending order based on severity Find the minimum l such that flows 1; . . .

Fixing Upper Bound Solution
The solution produced by solving the relaxed problems (i.e., RPKP ) in each of the jL k j iterations of the upper bound solution results in values between 0 and 1. Such values do not constitute a feasible solution as they do not indicate which flows are assigned to Queue k. To resolve this problem, we propose an algorithm for rounding the fractional values to integer values.
The algorithm iteratively searches for a flow with strictly fractional value (i.e., between 0 and 1 neither including 0 nor 1) starting from the left side of the set e X k and fixes it to 1 (i.e., select that flow). However, the RPKP solution is optimal and rounding a value to 1 means accepting more portion of that flow. Consequently, this may result in more delays, which could violate the delay constraint. Thus, the next step is to search for a set of flows with strictly fractional values starting from the right side of the set e X k and fix them to 0 (i.e., drop these flows) in order to regain the balance and satisfy the delay constraint. The pseudo-code in Algorithm 1 details these steps, where D t is the total delay for selected flows (X k ½i ¼ 1; 8i) and D max k is the maximum delay for Queue k.

Upper Bound Solution Proof
First, we define the term KP ðlÞ to denote the optimal value of the binary knapsack with flows indices in the range ð1; . . . ; l À 1Þ as selected for Queue k. The binary knapsack problem is defined in the following formulation: Taking flow l as the leading flow, we define the term KP l which is the optimal value of the binary KP with with flows indices in the range ð1; . . . ; l À 1Þ as selected for Queue k and flow l as the flow with the highest severity among all dropped flows. The definition is expressed below: s.t.
Note that KP l is a special case of KP ðlÞ when the lth flow is eliminated from the optimization problem. Next, we define the term PKP l as the optimal value of the binary PKP with penelty of subtracting the severity of the lth flow as the leading flow as shown below: Finally, we use RKP l to denote the relaxed knapsack probelm after eliminiating the lth flow (i.e., the leading flow), which is defined as follows: Ordering the set of input flows F k based on severity in a non-increasing order results in the following inequalities: KP ðlÞ 5 KP l (24) The following represents the computation of the upper bound solutions for all possible leading flows Where the flows in the range f1; . . . ; lg represent the list of leading flows as explained previously.  The core of the proposed heuristic (cf. Algorithm 1) is based on this proposition.

EXPERIMENTAL RESULTS
In this section, we apply our proposed severity-based service prioritization scheme to VANETs. We first describe the VANET traffic data used in our experiments, experiment settings and environment. Furthermore, we will also discuss achieved results.

VANET Traffic Characterization
As explained earlier, our proposed heuristic works on any metric defined to serve as the severity. For our experiments, we define the severity to represent the type of application generating the VANET data. Data of safety applications (e.g., BSMs) are marked to have higher severity than data of infotainment applications (e.g., video streaming, congestion warning). Furthermore, we use the Bologna Ring-way dataset [33] to incorporate real vehicle mobility in our VANET simulations.
For all safety applications, the data rate is set to 10 packets per second as recommended by the standard for safety periodic messages (i.e., BSMs) [34]. Moreover, the burstiness and rate values for infotainment applications were acquired experimentally. In these experiments, a computer is setup as a VLC [35] server that streams videos over a Motorola Vehicle Mounted Modem or OBU acting as a deviceto-device (D2D) communications medium. Another computer with VLC software acts as a client. While the VLC client is receiving the video stream, the network traffic is analyzed using WireShark [36] to determine the rate and burstiness of the traffic. It should be noted that two different types of videos, each with two different video encodings, were used for our experiments. The maximum rate of infotainment applications was set to the maximum rate of the WAVE protocol suite, while the burstiness value from our previous experiment was used as the average burstiness of infotainment applications. The results of the experiments are shown in Table 1.
To measure the performance of the proposed heuristic, we conducted two experiments. In the first experiment, we compared the results from the PMKP formulation in (10) against our proposed heuristic. In the second experiment, we compared our results against a baseline non-prioritized processor that operates using first come first serve (FCFS).
To conduct the experiments, we simulate the system model shown in Fig. 4 using a marking processor with a capacity (rate) of 9,000 packets per second. The capacity of the marking processor is set to a large value that induces minimum delay during the marking service. The policing processor configuration is shown in Table 2, which specifies for each severity level the maximum rate in packets per second and maximum burst size in packets.
The PMKP and our proposed heuristic use four queues with the configurations shown in Table 3, where the capacity is reported in packets per second and the guaranteed delay is reported in seconds. Severity level 1 is for safety messages while severity levels 2-4 are for infotainment messages. The baseline non-prioritized processor uses one queue without guaranteed delay (i.e., non-prioritized processing).
To evaluate the performance of the proposed heuristic against the baseline non-prioritized processor, we set the capacity of the baseline queue to equal the combined capacity of the four queues. Such configuration is more advantageous to the baseline no-prioritized processing algorithm as it will have one large queue with a rate that equals the rate of the four queues of the proposed prioritized processing algorithm. To validate the results, we run two other tests and set the baseline queue capacity to 50 percent of the combined capacity of the four queues in one experiment, and 150 percent of the combined capacity of the four queues in the other.
Obtaining the simulation data and result of the two experiments are discussed next.

Simulation Settings
In order to test the proposed heuristic, the Bologna Ringway dataset was used to generate a basis of test data. The Bologna Ring-way dataset results were analyzed and a snapshot of the data was taken every 200 milliseconds. The snapshots provided us with an accurate number of flows for each vehicle during the simulation. It was revealed that a vehicle can have no more than 50 flows at a given time and most of the vehicles have 10 flows at some point during   the simulation. Equipped with this data, we generated five data sets with 10, 20, 30, 40 and 50 flows. To simulate real-world traffic for each of these data sets, we further generated different percentages of safety-to-infotainment application data. Safety applications have the highest severity level, while infotainment and non-safety applications have three different severity levels. For each data set, five different combinations of safety-to-infotainment messages, which are 20-80 percent, 40-60 percent, 50-50 percent, 60-40 percent, and 80-20 percent were generated. The first two scenarios of 10 and 20 flows represent a light congestion case. A moderate congestion case is presented in the third scenario with 30 flows. To test high congestion traffic scenarios, the fourth and fifth scenarios with 40 and 50 flows are used. The number of flows in these scenarios represent the number of vehicles that a certain vehicle is receiving data from.

Comparison Study: Proposed Heuristic versus PMKP
In this experiment, we executed the PMKP optimization and run the proposed heuristic on the 25 datasets. The testing results are shown in Fig. 6. As Fig. 6a indicates, the PMKP has a small gap of up to 4 percent in profit gain over the proposed heuristic. As for number of accepted flows, the PMKP and the proposed heuristic have similar results with the PMKP having more flows in some cases as illustrated in Fig. 6b. The PMKP achieves a better delay compared to the proposed heuristic, as clearly illustrated in Fig. 6c.
In this small-scale experiment that involves a high congestion scenario, the maximum number of flows is set to 50. This value can be higher in real-life traffic congestion scenarios. However, when raising the number of flows over 40, the optimal PMKP requires more processing time, unlike the proposed heuristic, which makes it useless in solving this real-time problem. This is due to the combinatorial nature of embedded integer linear programming in PMKP. Thus, this experiment demonstrates that the proposed heuristic performs almost at the same level as that of the PMKP in terms of profit and quality of service. This is the case when the number of sending vehicles is between 10 and 50. Our proposed heuristic outperforms the PMKP in terms of its execution time in all cases especially when the number of sending vehicles is over 40.

Comparison Study: Proposed Heuristic versus Non-Prioritized Processing
To compare the performance of the four queues when the proposed heuristic is employed with that of the single queue non-prioritized processing approach, we conduct three experiments. In these experiments, we set the baseline non-prioritized processor queue capacity to 50, 100, and 150 percent of the combined capacity of the four queues of the proposed heuristic, respectively. Experimenting with these various capacities aims to give more confidence to our claims on the superiority of our proposed prioritized processing heuristic. One way to compare the proposed approach with the non-prioritized approach is to sum the severity of the accepted flows for each approach and compare the two results. However, in this paper we gave more advantage to the non-prioritized approach (i.e., baseline) over the proposed approach for the sake of fairness. Thus, in the proposed approach, the cumulative severity is the sum of severity of accepted flows. However, for the non-prioritized approach, the cumulative severity is the sum of the severity of all accepted flows multiplied by a factor based on the the total delay as shown below: if d t 5 0:3; cumulative severity Á 2 if 0:2 4 d t < 0:3; cumulative severity Á 3 if 0:1 4 d t < 0:2; cumulative severity Á 4 if d t < 0:1: where d t is the total delay. Basically, the profit of the baseline non-prioritized approach is multiplied by the equivalent queue number k of the proposed heuristic that offer an equivalent delay. Profit-wise, the proposed heuristic outperforms the baseline non-prioritized processing approach in moderate and high congestion scenarios as shown in Fig. 7. When the capacity of the baseline non-prioritized processor queue is increased to 150 percent, the proposed heuristic still collects more profit than the baseline non-prioritized processing approach, as shown in Fig. 7c. Furthermore, Fig. 7a, illustrates the superior performance of the proposed heuristic when the baseline non-prioritized processing queue capacity is reduced by half.
The non-prioritized processor accepts almost the same or sometimes more flows compared to the proposed heuristic as indicated in Fig. 8. However, the extra flows processed by the baseline non-prioritized approach can be ignored, since the proposed heuristic still gets more profit.
To measure the quality of service, the worst case delay is observed, which is the maximum delay for every queue be it prioritized or non-prioritized. Fig. 9 shows that all four queues of the proposed heuristic guarantee a delay level for all flows based on their severity. This delay level never exceeds the required QoS limit. Contrary to our approach, the non-prioritized approach provides no delay guarantees, which results in high severity flows suffering long processing delays. In other words, all flows regardless of their severity levels encounter similar processing delays when the baseline non-prioritized approach is used. Conversely, our proposed prioritized processing heuristic fulfills its promise of processing flows based on their severity level and processing them within the QoS and time requirements.

FUTURE DIRECTIONS AND CONCLUSION
In this paper, we presented a generic real-time heuristic that provides differentiated services based on a given set of flows and their corresponding severity metric. Furthermore, we demonstrated that the proposed heuristic can be used to offer differentiated services and improve QoS in VANETs. The proposed heuristic intelligently prioritizes the processing of flows in VANETs based on their corresponding severity metric. The problems is formulated as a PMKP, which is proved to be NP-Hard. Due to the complexity of the PMKP, a polynomial time algorithm based on a relaxed version of the PMKP formulation is proposed to perform the desired prioritization in real-time. The proposed heuristic is tested against the PMKP solution and a baseline non-prioritized processing approach. Results obtained through simulations with real traffic data demonstrated a minor difference in performance between the proposed heuristic and the PMKP. On the other hand, the proposed heuristic surpasses the baseline non-prioritized approach by 9 to 67 percent more profit in moderate and high congestion scenarios. As the results suggest, differentiated services are not required when the system has resources to satisfy all the requests, but rather when the system is under higher loads. In such scenarios, results show that our proposed prioritized processing heuristic is superior and provides better performance. In our future research, we plan to pursue applications of our proposed approach beyond VANETs. Specifically, we plan to explore the potential use of our approach in support of Industrial IoT applications (IIoT) with real-time QoS constraints below 10 ms.
Ala Al-Fuqaha (S'00-M'04-SM'09) received the PhD degree in computer engineering and networking from the University of Missouri-Kansas City, Kansas City, Missouri, in 2004. His research interests include the use of machine learning in general and deep learning in particular in support of the data-driven and self-driven management of large-scale deployments of IoT and smart city infrastructure and services, wireless vehicular networks (VANETs), cooperation and spectrum access etiquette in cognitive radio networks, and management and planning of software defined networks (SDN). He serves on the editorial boards and technical program committees of multiple international journals and conferences. He is a senior member of the IEEE and an ABET Program Evaluator (PEV). He is a senior member of the Institute of Electrical and Electronics Engineers (IEEE), with more than 50 publications in IEEE refereed journals and conferences. His research interests lie in the board disciplines of computer networking and communication engineering, with strong emphasis on the areas of network coding, device-to-device communications, internet of things (IoT) and its applications, cloud storage networks, femtocaching and fog networking, management of dense cellular networks, and indoor positioning. He is also interested in using diverse mathematical tools in modeling, optimizing, and smartening the operation of various engineering systems, such as transportation networks, power grids, charging of plug-in electric vehicles, and e-health services.