Downlink Traffic Scheduling with Contact Durations Awareness for Vehicular Infrastructures

The vehicular infrastructures or roadside units (RSUs) in vehicular delay tolerant networks (VDTNs) can be used as the gateways of the distributed sensor networks. The different classes of service (CoS) support are desired when more than one type of the sensed data are collected by the RSUs. In this paper, the CoS support traffic scheduling problem for the RSU in VDTNs is considered. By exploring the contact information between the vehicles and the RSU, the CoS traffic scheduling problem is formulated as a maximum weighted triple matching problem, where the traffic scheduling strategy is a timeslot-vehicle-traffic matched pair. A flow network based method is proposed to optimally solve the maximum weighted triple matching problem. Both the offline version and the online version of the traffic scheduling algorithm are developed. Extensive simulations are conducted and the simulation results show the effectiveness and efficiency of the proposed flow network based algorithms.


Introduction
Traffic scheduling in vehicular delay tolerant networks (VDTNs) [1][2][3] has been attracting increasing research interests recently.One type of the VDTNs is installed in the sparse or less populated remote areas, which includes a limited number of unconnected vehicular infrastructures or roadside units (RSUs) and the passing by vehicles.The unconnected RSUs (without backbone network connections) are served as the gateways of the distributed sensor networks.For example, the distributed sensor networks are deployed to monitor the environment or the wildlife [1][2][3][4][5][6] in the sparse or less populated area.Since the direct communication connections are sparse in the less populated area which may not be covered by the cellular networks, a feasible low cost solution is proposed by using the passing by vehicles [7] carrying the sensed data from the unconnected RSU to the destination RSUs.In other words, after the sensed data is collected by the gateways or the RSUs, the unconnected RSU opportunistically sends the data to the vehicles.Then the vehicles store, carry, and forward the data to the destination RSUs when they arrive at the destination RSUs, that is, in a direct delivery routing scheme.
In this paper, we aim at solving the different classes of service (CoS) support downlink traffic scheduling problem, where the traffic is delivered by the unconnected RSU to the passing by vehicles.Generally speaking, there are two aspects of causes which may make the downlink traffic scheduling problem much more difficult than that of the conventional networks, for example, the cellular networks or the WLAN, which are the diversity of the traffics and the diversity of the vehicles.
1.1.Diversity of the Traffics.It means that the traffics have different transmission requests and need different classes of service (CoS) support [8].Since the gateway or the RSU is much more expensive than the sensors, a limited number of RSUs will be deployed.And more than one type of the sensed data may be possibly collected by the RSU, waiting to be delivered to their respective destinations, for example, the wildlife tracking information [4], the agricultural information [5], and the environment information [6].Additionally, these different types of data may be classified into different categories according to their importance, such as the TTL (time to live), destinations, or QoS (quality of service).Since the direct delivery routing scheme is assumed, thus the more 2 International Journal of Distributed Sensor Networks of the much more important data is delivered to the passing by vehicles, the more gains will be obtained by the RSU.For example, in certain scenarios, the agriculture information is much more important than the environment information.More gains will be obtained by the RSU if it delivers more agriculture information to the vehicles.However, some vehicles may not drive to the destination RSU which collects the agriculture information, or the buffer capacity of the vehicles may be limited.Thus, another challenge arises, that is, the diversity of the vehicles.

Diversity of the Vehicles.
It means that the vehicles are different from each other, in terms of their trajectories, buffer capacities, speeds, arrival times, and so on.Firstly, each vehicle drives in a different trajectory and may only pass a subset of the destination RSUs; thus only a subset of traffics can be carried by it.Secondly, each vehicle has a limited buffer capacity; thus the RSU can not send more data to avoid the buffer overflow.Thirdly, the velocities and the arrival times of the vehicles are different, which result in the contact durations of the vehicles and the RSU being different.
The short contact duration between the passing by vehicles and the RSU is one of the unique characteristics of the VDTNs [10].Since the transmission range of the RSU is limited and the vehicles will not speed down to wait for the traffic downloading from the RSU, thus how to make a sufficient schedule during such a limited period becomes a significant problem.In addition, since the vehicles randomly arrive at the RSU, thus when there are more than one vehicle located in the transmission range, the problem with which order should the RSU deliver the data to the vehicles to maximize the total gains of the RSU is much more challenged.
To address these two challenges, in this paper we propose to explore the information of the contact durations between the vehicles and the RSU.The contact duration is defined as a time period, starting from the instant when the vehicle drives into the transmission area of the RSU and ending at the instant when the vehicle drives out of the transmission area of the RSU.During the contact duration, the RSU can use power control technology to transmit traffic to the passing by vehicles in a constant data rate [11][12][13].Thus, the contact duration can be slotted and during each timeslot one unit of traffic (or one bundle) can be assumed to be transmitted from the RSU to the vehicle.
The main contributions of this paper are threefold.(1) By exploring the contact durations of each vehicle, the proposed different CoS support downlink traffic scheduling problem is formulated as a maximum weighted triple matching problem.A schedule strategy of the RSU is a timeslot-vehicle-traffic (-V-) matched pair, which means that the RSU will transmit traffic  to vehicle V at the timeslot .(2) To compute the maximum weighted triple match of the triple matching graph, a flow network based algorithm is proposed.The online and the offline versions of the proposed algorithm are both developed.(3) Extensive simulations are conducted to evaluate the performance of the proposed algorithm.The simulation results are compared with the priority greedy based method, the FIFO based method, and the random based method, and the simulation results show the efficiency and the effectiveness of the proposed algorithm.
The rest of the paper is organized as follows.The availability analysis of the contact information is presented in Section 2. The related works are given in Section 3, and the differences between our work with the related works are also discussed.The system model is given in Section 4. A priority greedy based method is proposed in Section 5 firstly.Then, the flow network based traffic scheduling algorithm is developed.In Section 6, the online version of the proposed flow network based traffic scheduling algorithm is presented.Section 7 evaluates the performance of the proposed flow network based method through simulation, and Section 8 concludes this paper.

Contact Information Availability Analysis
Before exploring the information of the contact duration, we first analyse the availability of the contact information.
In [14], a layered architecture for the VDTNs is proposed where the bundle layer is placed below the network layer and above the data link layer.Particularly, the control plane functionalities and protocols are separated from the data plane.The former is responsible for connection setup for the data plane, by transmitting signalling control bundle out of band, while the latter is responsible for data bundle transmission, by aggregation and deaggregation the data bundles.These two are named as bundle signalling control (BSC) and bundle aggregation and deaggregation (BAD) in [14].Normally speaking, a low powered, long-range, low bandwidth control plane link connection is used by the BSC to exchange control messages out of band, and a high powered, short-range and high bandwidth link is used by the BAD to exchange data bundles.In other words, the radius of the BSC,  BSC , is much larger than that of the BAD,  BAD , as shown in Figure 1.
When a vehicle is approaching the RSU (driving into the BSC area), the control plane works first to set up the connection.The vehicle registers itself to the RSU with the information in terms of the trajectory or destinations, geographical location, speed, power, and storage capacity.After that, the RSU will compute and update its traffic scheduling strategy when the vehicle drives into the BAD area.At the instant when the vehicle drives into the BAD area, an updated downlink traffic scheduling strategy will be invoked and the traffic will be delivered to this new arrived vehicle.
The setting ( BSC >  BAD ) allocates a time duration for the new arrived vehicles to register and to negotiate with the RSU.At the same time, when the vehicle's information is obtained by the RSU a new traffic schedule strategy can be computed and broadcasted to the vehicles.For example, in [15] it is assumed that  BSC = 90 m and  BAD = 30 m, and the vehicles are assumed to be driving on the road with a constant speed, say, 50 km/h.Then the time duration in which the vehicle is located in the BSC area and out of the BAD area is 4.32 s.Assume the IEEE 802.11p [16] is used for the control plane, where the basic data rate is 3 Mbps, and the SIFS (short BAD: bundle aggeragation and deaggregation BSC: bundle signaling control inter-frame space) is 32 us at the 5.895 GHz.Therefore, the allocated time for registering and negotiating, 4.32 s, is long enough.
Reference [15] also justifies the feasibility and availability of the contact information.In [15], the node localization is explored through the exchange of the signalling information related to nodes' real-time location, current trajectory, velocity, and transmit range.A contact prediction algorithm is proposed to estimate the contact durations.With the predicted contact duration, a contact duration scheduling policy which always schedules the bundles which can be finished within the contact is proposed.The gains are demonstrated through simulation.
Reference [17] shows the effects of the density of the vehicles and the velocity of the vehicles on the number of the contact opportunities and on the length of the contact durations.The results show that the number of the contact opportunities grows as the vehicle velocity increases and as the density of the vehicles increases.The results also show that the length of the contact durations decreases as the velocity of the vehicles increases.
Both [15,17] are based on the layered architecture [14].However, we note that the proposed layered architecture in [14] is a general case for the VDTNs, which consists of three node types: terminal nodes, relay nodes, and mobile nodes.In this paper, only two types of nodes are considered, where the terminal nodes are corresponding to the RSUs and the mobile nodes are corresponding to the vehicles.And the route scheme is the direct delivery, where the vehicle receives traffic from the source RSU and directly forwards to the destination RSUs when they pass by them.In this paper, we mainly consider the downlink CoS support traffic scheduling problem with the objective of maximizing the total gains of the RSU.

Related Works
A recent survey on the VDTNs can be found in [2].Reference [3] details the layered architecture of VDTN, including the bundle aggregation and deaggregation mechanisms, network protocols, scheduling and dropping policies, fragmentation mechanisms, and the created testbed for VDTNs performance evaluation, demonstration, and validation.In the VDTNs, three classical routing schemes are mainly employed [3], that is, direct delivery, epidemic [18], and spray and wait [19].According to the employed routing schemes, the related works on traffic scheduling can be classified into two categories, that is, replicated copy based traffic scheduling and direct deliver based traffic scheduling.The replicated copy based traffic scheduling employs the epidemic or spray and wait routing schemes, and the direct deliver based traffic scheduling employs the direct delivery routing scheme.

Replicated
Copy Based Traffic Scheduling.The epidemic and the spray and wait routing schemes always deliver the replicated copies of the bundles to the contact nodes when a connection opportunity appears, in order to increase their deliver probability and decrease their delivery delay.However the replicate approach may cause contention for network resources, such as link bandwidth and storage, which will reduce the performance of the network.Thus an efficient scheduling and dropping policy is necessary to optimize the performance of the network.The scheduling policies address the problem with which order the bundles should send when two nodes contact.The dropping policies are used to decide which bundles should be dropped when the buffer is full.The existing literatures can be classified into two categories according to their objectives, that is, to improve the message delivery delay and delivery ratio and to support the different classes of service (CoS).

To Improve the Message Delivery Delay and Delivery
Ratio.The authors of [20] propose three scheduling policies, that is, FIFO (first in first out), random, and RL-DESC (remaining lifetime descending order), and three dropping policies, that is, head drop, random, and RL-ASC (remaining lifetime ascending order).Simulation results show that these policies based on the lifetime criteria decrease the average delivery delay and increase the delivery ratio.Reference [17] extends the works in [20], where the number of the replicated copies is considered to design the scheduling and dropping policies.In other words, when a contact opportunity appears or when the buffer is full, the bundles with less/more replicated copies are scheduled/dropped first.Reference [21] studies the impact of scheduling and dropping policies through a VDTNs testbed and concludes that the policies should consider the bundles' lifetime as a criterion to improve the network performance.

To Support the Different Classes of Service (CoS).
Reference [8] considers scheduling and dropping policies for traffic differentiation in VDTNs.An urban scenario is considered in reference [8], where the VDTNs support several asynchronous applications simultaneously.Each application generates different requirements traffic in terms of message delivery probability and message average delay, which motivates the traffic priority support of the scheduling and dropping policies.A method to specify the relative priority of messages is proposed, where the bulk messages have the lowest priority, and the normal messages are sent prior to the bulk ones, and the expedited messages have the higher priority.Three traffic differentiation scheduling policies are proposed, that is, priority greedy, round robin, and time threshold.Two dropping policies are proposed where the messages with the lowest propriety or the lowest remaining lifetime are dropped first.Reference [22] further extends the work in [8].Two different buffer management schemes and corresponding dropping policies are proposed.The first method is to store the bundles in a sharing buffer, and when the buffer is full the lowest priority bundles are dropped.The second method is to store the bundles in separate buffers according to the bundle's priority, and the bundles with the lowest lifetime are dropped when the buffer is full.A priority greedy scheduling policy is proposed with the sharing buffer management method.And a custom service time scheduling policy is proposed with the separated priority buffer management method.The performances are evaluated through simulations.

Direct Deliver Based Traffic Scheduling.
When the direct deliver routing scheme is employed, the RSU has two functionalities, that is, relaying the bundles to their destinations and meeting the requirements of the vehicles.According to these two functionalities, the related existing literatures can be classified into two categories, that is, bundle relaying and requirements satisfying.

Bundle Relaying.
In [23], the bundle delivery delay minimization problem is considered, where a Markov decision process framework is proposed, and the optimal traffic strategy is derived.Based on the optimal strategy, the source RSU should transfer the traffic to the vehicle with velocity larger than a threshold.Reference [24] also considers the delay minimization problem.The probability that the RSU should release its bundle to the passing by vehicles is predicted based on the vehicles' information.Then based on the probability the RSU determines when to deliver its bundles such that the bundle delivery delay can be minimized.
To jointly minimize the transmitting energy consumption and the traffic delay penalties, an optimal traffic scheduling strategy is derived in [25].The traffic scheduling problem is formulated as an optimal stopping problem.An optimal threshold based schedule strategy is derived, where when the penalty exceeds the derived threshold, the RSU is optimal to deliver its bundle to the passing by vehicles.
In [26], the mobile vehicle is considered as the constraint resource for the multiple source RSUs to communicate with their destination RSUs.Due to the contention for the limited network resource, that is, the vehicle, an optimal traffic strategy for the mobile vehicle is derived, whether or not to relay a specified RSUs' traffic.Furthermore, the optimal strategies for the source RSUs are derived, when the source RSUs operate in a cooperative game mode or in a noncooperative game mode, respectively.[27] is one of the earliest works which considers the traffic scheduling problem, the objective of which is improving the service ratio of the vehicles.A  ×  weight based traffic scheduling method is proposed first, where  is the deadline of the request and  is the size of the requested traffic.The basic idea is to schedule the small size data first and to schedule the earlier deadline data first.To further improve the service ratio, the common requested data with the minimum value of ( × )/ is scheduled and broadcasted first, where  is the number of the requested vehicles.

Requirements Satisfying. Reference
Reference [11] is another related work which considers how to minimize the RSU energy cost while meeting the vehicles request.By considering the exponential increase of the transmission power with the linear increase of the distance between the vehicle and the RSU, a heuristic strategy is proposed.The basic idea is to serve these vehicles first, which have the fastest speed and are nearest to the RSU.That scheme is motivated by the fact that if a fastest and nearest vehicle is served later more transmission power will be spent.Reference [12] further studies the energy efficient problem.Two cases of the energy efficient problem are discussed, that is, the packet-based case and the timeslot-based case.The packetbased schedule problem requests continuous downlink time to meet the vehicle's request, which is proved to be an NPcomplete problem.The timeslot-based problem is proposed to solve in a flow network scheme, where the optimal traffic schedule strategy is corresponding to a minimum cost flow of the flow network.
Reference [13] studies a jointly optimization problem, which aims to fairly serve the vehicles while minimizing the total energy cost.The proposed problem is a threestep optimization problem which is however proved to be optimally solved in a flow network method.The key is to assign the cost of the edges in the flow network with a square function.

Relationships with the Existing Literatures.
From the viewpoint of routing schemes, our work belongs to the direct delivery one.From the viewpoint of the functionality of the RSU in VDTNs, our work belongs to the bundle relaying one.However, to the best knowledge of the authors, the traffic scheduling problem to support different classes of the service (CoS) has not been considered in this scenario, let alone the diversity of the vehicles.However, the CoS and the diversity of the vehicles are so realistic and practical which make the traffic scheduling problem significant and challenged.Therefore, we propose to study this practical traffic scheduling problem for the source RSU.

System Model and Problem Formulation
In this paper, the vehicles are used as mobile relays of the RSUs and the direct delivery routing scheme is employed.In other words, when the vehicle receives bundles from the source RSU, it will store, carry, and forward these bundles to the destination RSUs when it arrives at the destinations; that is, no dropping policies are used by the vehicles.Each bundle can be sent by the RSU to one vehicle in one timeslot, and after that the bundle will be deleted from the buffer of the RSU.The buffers of the vehicles are shared by the variety of types of bundles.All types of bundles of the RSU are all delay tolerant and their lifetimes are considered to be long enough.In the following, we detail the system model used in this paper.

System Model.
Suppose there is an RSU  deployed along the highway road, which is used as a gateway of the underlay deployed distributed sensor networks.There are many types of the sensed data collected by the RSU, waiting for the passing by vehicles to be delivered to the destinations.According to the traffic differentiation mechanism, for example, proposed in [8,22], the sensed data in the source RSU  can be prioritized into  types.Let   (  ,   ), 1 ≤  ≤ , and denote the th type of sensed data, where   is the gains obtained by the RSU  when one bundle of   is delivered by the RSU  to a vehicle.And   is the total quantity of bundles of   .The set of sensed data stored in the RSU  can be written as Suppose there are totally  vehicles located in the BAD area of the RSU .These vehicles arrive at the RSU  in a random process, where the interarrival times of the vehicles are independent and identically exponentially distributed [28].Let { 1 ,  2 , . . .,   , . . .,   } denote the interarrival times of the consecutive vehicles at the RSU ; then they are i.i.d exponential random variables with parameter , where  = 1/[  ] and [⋅] is the expectation.Then, the arrival time of the th vehicle is   = ∑  =1   ; that is, the instant when vehicle V  enters into the BAD area is   .Let V  = (  ,   ,   ,   ) denote the properties of the th vehicle.  is the delivery capability of vehicle V  , a binary variable set with |  | = , and the th element of   is 1 if the vehicle can take the th type of data and is 0 otherwise.  is the constant speed, and   is the buffer capacity of V  .Then the set of vehicles can be written as Suppose the RSU  can use power control to transmit data bundles to the vehicles which are located in the BAD area.And, in each timeslot, only one data bundle will be transmitted from the RSU to the vehicles.Let  BSC and  BAD denote the BSC and BAD area transmission radius of the RSU , respectively, where  BSC >  BAD .Then contact information between vehicle V  and the RSU  can be denoted by   = [  ,   + (2 ×  BAD )/  ], where recall that   is the time instant when vehicle V  enters the BAD area and (  + (2 ×  BAD )/  ) is the time instant when vehicle V  drives out of the BAD area.
Let  denote the length of a timeslot; then vehicle V  's contact information can be slotted as Figure 2 gives an example of slotting the contact durations of vehicles V 1 , V 2 , and V 3 .Note that although these three vehicles enter the BAD area of the RSU at different time, part of the timeslots of them is overlapped; that is, denote the set of timeslot of the time duration where is the time length during which all of the  vehicles are located in the BAD area.
Next we formally formulate the CoS support downlink traffic scheduling problem.

Problem Formulation.
Based on the system model, a traffic scheduling strategy for the RSU  can be represented as a timeslots-vehicles-traffic (  -V  -  ) triple match.The physical meaning is that the RSU  can send the traffic   to vehicle V  at timeslot   .This motivates us to define a triple matching graph to formulate the proposed problem.
Define G 3 = {V 3 , E 3 } as a triple matching graph, as shown in Figure 3. V 3 = ∪∪ is the node set, composed of the timeslot set , the vehicle set , and the traffic set .
Recall that the objective of the proposed traffic scheduling problem is to maximize the total gains of the RSU .The weight of the edge ℎ(⋅, ⋅) is employed to translate the proposed problem to a maximum weighted triple matching problem.It concerns how to assign weight to the edges of G 3 such that the sum of the weighted edge is maximized.If the weight ℎ(⋅, ⋅) > 0 then these two nodes of that edge are said to be matched with each other.For each edge of (  , V  ) ∈ E  , define ℎ(  , V  ) as the weight of (  , V  ), which is a boolean variable.In other words, for each edge of (  , V  ) ∈ E  , the weight ℎ(  , V  ) can only be assigned to be 1 or 0. The physical meaning of ℎ(  , V  ) is whether or not to transmit bundle to vehicle V  at timeslot   .And ℎ(  , V  ) = 1 means transmit, while ℎ(  , V  ) = 0 means not to transmit.For each edge of (V  ,   ) ∈ E 3 , define ℎ(V  ,   ) as the weight of (V  ,   ), which is an integer variable; that is, ℎ(V  ,   ) ≥ 0. The physical meaning of ℎ(V  ,   ) is to transmit how many   bundles to the vehicle V  .Therefore, the proposed traffic scheduling problem can be formulated as a maximum weighted triple matching problem; that is, The objective of the maximum weighted triple matching problem is to maximize the total weighted gains of the RSU .As indicated in the objective in (6), only the weight ℎ(V  ,   ) of (V  ,   ) contributes to the total gains of the RSU.The physical meanings of the four constraints are illustrated as follows.The first constraint in (7) means that any timeslot   can be assigned to at most one vehicle.The second constraint in (8) means that the total number of bundles that each vehicle carries should be less than the capacity of the vehicle.The third constraint in (9) means that the total number of bundles that all of the vehicles carry should be less than the total amount of the traffic.The fourth constraint in (10) means that the total number of timeslots assigned to each vehicle, should be larger than the number of bundles that vehicle carries.
A feasible solution of the maximum weighted triple matching problem is a feasible traffic schedule strategy.For example, for any triple matching pair (  , V  ,   ), if ℎ(  , V  ) > 0 and ℎ(V  ,   ) > 0, then it means that the RSU  can transfer traffic   to V  at timeslot   .In Figure 3, a triple matching pair ( 2 , V 1 ,  2 ) is shown to be denoted by the grey lines, and it means that the strategy for timeslot  2 is to transmit one bundle of  2 to vehicle V 1 .
An optimal solution of the formulated maximum weighted triple matching problem is called a maximum weighted triple matching, which maximizes the total gains of the source RSU.However, it is not easy to derive from the formulated problem as shown in ( 6)-( 10) directly.Thus, in the next section, we present a flow network based method to optimally solve the formulated problem.

Flow Network Based Traffic Scheduling
In this section, we firstly propose a priority greedy based method to solve the maximum weighted triple matching problem, which will be used in the simulation to compare the performance with our flow network based traffic scheduling algorithm.Next, we detail the flow network based method.

A Priority Greedy Based Method.
To maximize the total gains of the RSU , an intuitive method is to deliver the highest priority bundles as many as possible to the passing by vehicles, to obtain as many gains as possible.In other words, at each timeslot   , the RSU  will greedily transmit the highest priority bundle in its buffer to a selected vehicle which can carry that type of bundle.This motivates us to design a priority greedy based method to solve the maximum weighted triple matching problem.
Suppose that at timeslot   the RSU  can communicate with   = {V 1 , V 2 , . . ., V  , . . ., V   }, 1 ≤  ≤   .The largest benefit  can obtain is to transmit one bundle of   to V  , where V  ∈   .Thus  will greedily transmit one unit of   to V  at slot   .When there exists more than one pair of (V  ,   ), which deserves the same gain for , then  will randomly select one pair of them to perform the transmission.Finally,  will execute above method from one timeslot to another, until there are no vehicles or there are no traffics.In other words, at each timeslot   ,  will always select the maximum benefit pair (V  ,   ) and then transmit.
The priority greedy based method locally maximizes the benefit of  at each transmission slot   .However, it may not be globally optimal, that is, over the total transmission slots  = { 1 ,  2 , . . .,   }.An example, which compares the priority greedy based method to the optimal method, is presented in Section 5.4.Thus, the optimal traffic scheduling strategy for the maximum weighted triple matching problem is expected to be derived.

Flow Network Based Method.
In this paper we propose to optimally solve the maximum weighted triple matching problem by using a flow network based method.
Flow network is a mathematical tool of graph theory [29], used to solve the problem of how to efficiently carry things from the source to the sink through routes between them.In specific, a flow over the routes in the flow network can be imagined as a water flow over the water pipes in a water network [10].Let G  = {V, E} denote the flow network graph, where V is the node set and E is the edge set.As the physical meaning of the flow implies, there are three attributes for each edge (, V) ∈ E, which are the flow (, V), the capacity (, V), and the cost (, V).The amount of flow (, V) is the amount of things passing through (, V), and the capacity (, V) is the maximum flow that (, V) can bear.If there is one unit of flow passing through (, V), then it will cost the network (, V).Generally, the minimum cost maximum flow of the flow network G  is deserved, the physical meaning of which is how to carry the most/maximum things with the least/minimum cost.Classical flow network algorithms, such as the push-relabel algorithms [9], can be resorted to optimally compute the minimum cost maximum flow of the flow network graph G  .
Next we detail how to transform a maximum weighted triple matching problem to a minimum cost maximum flow problem.The flow network graph G  is constructed based on the triple matching graph G 3 , as shown in Figure 4.The pseudocode of flow network based traffic scheduling algorithm in given in Algorithm 1.In the following, when we say   , V  ,   , we refer to any node in , , and , respectively.The details of Algorithm 1 are as follows.

Construction of G 𝑓 .
To construct the flow network graph G  based on the triple matching graph G 3 , a virtual source node  and a virtual sink node  are firstly added.Then, additional edges are added in order to enable the flows to be injected into and flowed out of the flow network graph G  .In other words, for each   ∈  and for each   ∈ , an edge (,   ) and an edge (  , ) are added.Secondly, to formulate the finiteness of the traffic capacity of vehicle V  , that is,   , we make a copy of V  , that is, V   .An edge (V  , V   ) is added, and the finiteness of   is assigned as the capacity of edge (V  , V   ).Note that the constraints in ( 7)- (10) have not all been indicated in G  , like the quantity of the traffics and the weight of the edges.In the flow network G  , these constraints can be assigned as the attributes of the edges.

Edge Attributes Assignment.
In the flow network graph G  , the physical meaning of the flow of the edges is the number of the data bundles.For example, the flow (V   ,   ) over the edge (V   ,   ) means that the vehicle V  takes (V   ,   ) data bundles of   .The capacity of the edges defines the upper bound of the flows over the edges.The cost of the edges defines the value of cost when the flow over the edge is 1.Recall that the objective of the proposed problem is to maximize the total gains of the RSU.Thus, in order to apply the conventional push-relabel algorithms [9], we assign the cost of the edges as the minus gains.The details are illustrated as follows.
First of all, the initial flow of all edges is set as 0.Then, for each edge (,   ), the flow capacity is set as (,   ) = 1, and the cost is set as (,   ) = 0.For each edge (  , V  ) the flow capacity is set as (  , V  ) = 1, and the cost is set as (  , V  ) = 0.For each edge (V  , V   ), the flow capacity is set as (V  , V   ) =   , and the cost is set as (V  , V   ) = 0. Recall that   is the buffer capacity of vehicle V  .For each edge (V   ,   ), the flow capacity is set as (V   ,   ) = ∞, and the cost is set as (V   ,   ) = 0.For each edge (  , ), the flow capacity is set as (  , ) =   , and the cost is set as (  , ) = −  , where   is the amount of traffic   , and   is the gain obtained by the RSU  when one bundle of   is delivered to a vehicle.
Next, the conventional push-relabel algorithms in [9] are applied on G  , to compute the minimum cost maximum flow.

Converting Flow to Traffic Scheduling Strategy.
Finally, we present the details of how to convert a minimum flow to a traffic scheduling strategy.
Firstly, the timeslots allocated to each vehicle are determined with the information of the minimum cost maximum flow.For each edge (  , V  ) ∈ E  , if (  , V  ) = 1 then the timeslot   is allocated to vehicle V  .Thus all of the timeslots which are allocated to vehicle V  can be found by checking all of the edges (  , V  ) ∈ E  .Let   denote the set of timeslots allocated to vehicle V  .
Then the traffics to be delivered to each vehicle are determined.For each edge (V   ,   ) ∈ E    , if (V   ,   ) > 0 then (V   ,   ) bundles of   will be delivered to vehicle V  .Thus all of the traffics which will be delivered to vehicle V  can be found by checking all of the edges (V   ,   ) ∈ E    .Let   denote the set of traffics to be delivered to vehicle V  .

Discussion and Remarks.
The equivalence of a minimum cost maximum flow with an optimal solution of the maximum weighted triple matching problem can be resulted from the properties of the flow.A flow in G  is a real-valued function  : V  × V  →  that satisfies the following three properties [9].

Input:
The set of vehicles , the set of traffics  and the set of timeslots  Output: The traffic scheduling strategy U (1) Construct the triple matching graph G 3 = {V 3 , E 3 }, where V 3 =  ∪  ∪  and  16) Apply the Push-relabel Algorithms in [9] on the flow network graph G  to compute the minimum cost maximum flow.( 17) Convert the minimum cost maximum flow to the traffic scheduling strategy U. (i) Capacity constraint: for all , V ∈ V  , we require (, V) ≤ (, V).
(iii) Flow conservation: for all  ∈ V  − {, }, we require Therefore, with the capacity constraint property of the flow, the constraints in ( 7)-( 9) are perfectly mapped to the flow network.With the properties of the skew symmetry and the flow conservation, the constraint ( 10) is perfectly mapped to the flow network, where the total number of timeslots assigned to vehicle V  will always equal the number of bundles to be delivered to vehicle V  .
Since the computed minimum cost maximum flow maximizes the total number of the flows and minimizes the total cost simultaneously, thus the total gains of the RSU can be maximized (recall that the minus gain is mapped as the cost of the flow).Therefore, from Algorithm 1, it is clear that the minimum cost maximum flow of the constructed flow network graph is exactly the optimal solution of the maximum weighted triple matching problem.Therefore the maximum triple matching problem is transformed as a minimum cost maximum flow problem.
We remark that the optimal traffic scheduling strategy for the maximum weighted triple matching problem may not be only one.Since there may exist more than one minimum cost maximum flow of G  , the optimal traffic scheduling strategy may be more than one.It can also be learned from another way.In the maximum weighted triple matching problem, since the first matching is only concerned about how much transmission slots are assigned to each vehicle and the second matching is only concerned about how much traffic are assigned to each vehicle, not the form of these matchings, thus even for the same amount matching there may exist several types.

An Example for Comparison.
Figure 5 shows a comparison example between the priority greedy based method and the flow network based method.
Firstly, Figure 5(a) presents the original triple matching problem.In the original triple matching graph, there are 3 vehicles, 10 timeslots, and 3 kinds of traffic.The vehicles' delivery capability for each type of data are given as  1 = {1, 1, 0},  2 = {0, 1, 1}, and  3 = {1, 0, 1}.The buffer capacity of the vehicles is given as  1 =  2 =  3 = 10.The slotted contact duration of V 1 is  1 = { 1 , . . .,  6 }, and the slotted contact duration of V 2 is  2 = { 3 , . . .,  6 }, and the slotted contact duration of V 3 is  3 = { 6 , . . .,  10 }.The total timeslot set is given as The traffic set is given as Note that there exists overlaps among the slotted contact durations.That is, from timeslots  3 to  6 both V 1 and V 2  (5,5),  2 (4, 9),  3 (4, 10)}.In the priority greedy based method, the total gains obtained by the RSU  are 82, and the total bundle of the transmitted traffic is 10.In the flow network based method, the total gains obtained by the RSU  are 86, and the total unit of the transferred traffic is 10. can communicate with , and from timeslots  6 to  7 both V 2 and V 3 can communicate with .During these overlapped timeslots, how to make the traffic scheduling is different between the priority greedy based method and the network flow based method.This is the most basic reason which causes differences of the priority greedy based method and the flow network based method.
Then, Figure 5(b) presents the traffic schedule strategy derived by the priority greedy based method.For the priority greedy based method, at each slot the RSU  will always transmit the traffic which values the most to the vehicle.Thus, at  1 and  2 ,  delivers 2 bundles of  2 to V 1 .From  3 to  6 ,  delivers 4 bundles of  3 to V 2 ; at  7 ,  delivers 1 bundle of  2 to V 2 since  3 has been delivered over.From  8 to  10 ,  delivers 3 bundles of  1 to V 3 .The total gains obtained by the RSU  are 82, and the total delivered bundles are 10.
Finally, Figure 5(c) presents the traffic schedule strategy derived by the flow network based method.By computing the minimum cost maximum flow of the flow network, the traffic scheduling strategy is given as follows.From  1 to  2 ,  delivers 2 bundles of  1 to V 1 .From  3 to  6 ,  delivers 4 bundles of  2 to V 2 .From  7 to  10 ,  delivers 4 bundles of  3 to V 3 .The total gains obtained by the RSU  are 86, and the total delivered bundles are 10.
In summary, these two strategies both deliver 10 bundles of traffic to the vehicles.However, with the priority greedy based method, the RSU  obtains 82 gains, but, with the flow network based method, the RSU  obtains 86 gains, more than the priority greedy one.
The gains of the flow network based method come from the fact that all of the information are explored, in terms of the timeslots (contact information), the vehicles (the bundle delivery capability and the buffer capacity), and the traffics (the quantity of the bundles and the gains of each type of bundle).However, the priority greedy based method only explores the traffic information.

Complexity Analysis.
The complexity of the priority greedy based method and the proposed flow network based method is analysed as follows.
Firstly the complexity of the priority greedy based method is analysed.The core step of this method is to find the maximum valued vehicles-traffic (V  -  ) pair in each timeslot.However, in the worst case there are at most  pairs, and the computational complexity of finding the largest one is given as O().Recall that there are  timeslots in total; thus in the worst case the complexity of the priority greedy based method is O().
Next, the complexity of the flow network based method is analysed.The computational complexity of the flow network base method depends on the computational complexity of the push-relabel algorithm.The computation complexity of push-relabel algorithm is O(|V| 2 |E|), where |V| is the total number of the nodes and |E| is the total number of the edges of the flow network graph.In our constructed flow network graph G  , there are |V| =  + 2 +  + 2 nodes and there are |E| =  +  +  +  +  edges in the worst case.Thus the complexity of the proposed flow network based method is O(max{ 3 ,  3 ,  3 )}.
Normally, the number of vehicles  and the types of traffic  are finite numbers, and thus the computation complexity depends on , that is, the total number of the timeslots (which is inverse to the length of the timeslot ).In this case, the computation complexity of the priority greedy based method is O() while the proposed flow network based method is O( 3 ).Recall that  is the total number of slots in period [ 1 ,  1 + ]; thus the complexity analysis implies that to reduce the computation complexity of the problem the total number of timeslots should be limited.

Online Traffic Scheduling
In both Sections 4 and 5, the complete information of the  vehicles (including the information of the contact durations) and the information of the traffics  are known by the RSU.This can be referred to as the offline version of the proposed traffic scheduling problem.However, in the real environment the vehicles arrive randomly one by one, which is unknown and can not be predicted by the RSU.Therefore, it is necessary to design the online traffic scheduling strategy for the RSU.

International Journal of Distributed Sensor Networks
In this section, the online version of the traffic scheduling algorithm is given.The basic idea of the online version of the traffic scheduling algorithm is also applying Algorithm 1 with the following modifications.
At the time instant  1 = 0 (or the timeslot  1 = 0), when the first vehicle V 1 enters the  BAD transmission range of the RSU, a traffic scheduling strategy is computed with Algorithm 1 for vehicle V 1 .The node set is defined as   = {V 1 }, and the timeslot set is defined as   = { 1 ,  2 , . . .,    }, where   = ⌊2 BAD / 1 ⌋.And the traffic set of the RSU is that the traffic currently stored in the RSU is denoted by   .The other details are the same as shown in Algorithm 1.
Suppose that, at the time instant   (or the timeslot   ), a new arriving vehicle V  , 1 ≤  ≤  enters the BAD area of the RSU, which has finished the registering and negotiating processes with the RSU before   .At timeslot   , suppose there also exist   , 0 ≤   ≤  − 1 vehicles in the BAD area of the RSU, which are being served by the RSU.No matter whether the existing traffic scheduling strategy is finished or not at timeslot   , a new traffic scheduling strategy will be computed with Algorithm 1.The node set is defined as   = {V −  , V −  +1 , . . ., V  }.Let  +  , 1 ≤   ≤  − 1 be the timeslot when the last vehicle in   leaves the BAD area of the RSU; note that the last vehicle may not be V  due to different velocities of the vehicles.Then the timeslot set can be defined as   = {  ,  +1 , . . .,  +  }.The other details are done as the same as shown in Algorithm 1.At timeslot   , the RSU updates itself to the new traffic scheduling strategy.The online version will continue running until there are no arriving vehicles.

Performance Evaluation
In this paper, we aim at developing the CoS support traffic scheduling algorithms.Particularly, the direct delivery routing scheme is employed, and the vehicle registering and negotiating processes are omitted.Therefore, a customized C++ simulator is developed to evaluate the performance of the proposed flow network based algorithm.
Note that as forementioned in the related work, this paper is the first work to address the proposed traffic scheduling problem in the open literature.And thus, in our simulator, the flow network based method, the priority greedy based method, the FIFO (first-in first-out) based scheduling method, the random-max based scheduling method, and the bi-random based scheduling method are implemented.They are labelled as "FlowNet, " "PritGred, " "FifoMax, " "RndMax, " and "BiRnd" in short, respectively.The basic ideas of the FIFO based method (FifoMax), the random-max based method (RndMax), and the bi-random based method (BiRnd) are illustrated as follows.
(i) FifoMax.The basic idea is that the RSU delivers the bundles to the first arriving vehicle in a priority first ordering, until the buffer of that vehicle is full or the bundles in the RSU are empty.
(ii) RndMax.The basic idea is that at each timeslot the RSU randomly selects a vehicle (if any).Then the bundle is delivered in a priority first ordering.
(iii) BiRnd.The basic idea is that at each timeslot the RSU randomly selects a vehicle (if any).Then a bundle (if any) which that vehicle can carry is randomly selected.Finally, the selected bundle is delivered to the selected vehicle.
Note that these three methods are usually used as benchmarks in the existing literatures, and in this paper we compare the simulation results of the proposed algorithms with them.
Next, we initially analyse the relevance relationship between the simulation parameters, based on which we set the parameters in our simulation.We analyse the relevance relationships between the parameters from the aspects of conditions of overlapped contact durations and conditions of RSU buffer overflow avoidance.Particularly, we analyse the conditions of RSU's buffer overflow avoidance from two aspects, that is, the viewpoint of the timeslot and the viewpoint of the vehicle.

Relevance Relationship Analysis between Parameters
7.1.1.Conditions of Overlapped Contact Durations, That Is, >/2  .Recall that 1/ is the expectation of the interarrival time between two consecutive vehicles,  is the constant speed of the vehicles, and  BAD is the transmission radius of the BAD area of the RSU.
Note that when the vehicles' arrival density  is very low where there may exist only one vehicle located in the BAD transmission area of the RSU, then the optimal traffic scheduling strategy is to deliver the bundles in a priority first ordering.Therefore, in this case, the FlowNet, PritGred, FifoMax, and RndMax methods all can achieve the optimal performance.However, when the vehicles' arrival density is not very low, there may exist overlaps among the contact durations of the vehicles.In this case, how will our proposed algorithms perform needs to be evaluated.
Then, in the following we derive the conditions when the contact duration may be overlapped.Note that the interarrival time between two consecutive vehicles is i.i.d.exponential random variables, and in average the interarrival time is 1/, and the length of the contact duration is (2 ×  BAD )/.Then if the length of the contact duration is less than the interarrival time, the contact durations of the vehicles will be overlapped in average.Therefore, if 1/ < (2 ×  BAD )/, that is,  > /2 BAD , the contact durations between two consecutive vehicles will be overlapped in average.This means that the RSU has more than one selection of vehicles to transmit bundles.Therefore, in the following simulation settings, we will set From the viewpoint of the timeslot, since in one timeslot only one bundle can be delivered from the RSU to the vehicles, therefore when the interarrival time between the bundles is less than , then the buffer of the RSU will be overflowed.In other words, if 1/ ∑  =1   < , then the buffer of the RSU will be overflowed.Therefore, to avoid the RSU's buffer overflow we will set From the viewpoint of the vehicle, if the number of the arrived bundles during the contact duration V  is larger than   , then the bundles will be stored in the buffer of the RSU which also will make the buffer of the RSU overflowed.The number of bundles arriving during the contact duration of V  is (2 BAD /) × ∑  =1   in average, where recall 2 BAD / is the length of the contact duration and ∑  =1   is the density of the bundles.Therefore, to avoid the RSU's buffer overflow we will set Therefore, with some mathematical manipulations on ( 13) and ( 15), we have By combining ( 16) with (14), then the relevance relationships between the simulation parameters can be represented as Figure 6 shows the relevance relationship of the simulation parameters given in (17).Since  BAD and  are constant which are determined by the maximum transmission power of the RSU, the length of the bundle packet, and the transmission rate, we investigate the performance of the proposed algorithm mainly by changing the values of ∑  =1   , , and .From Figure 6, it can be seen that, to evaluate the performance of the proposed algorithm, three intervals should be investigated, that is, changing ∑  =1   in (1/,   /2 BAD ), changing  in (∑  =1   ,   ), and changing  in (  /2 BAD , ∞).

Performance Metrics.
The most interesting performance metrics are the number of total obtained gains and the number of total transmitted bundles.
Recall that the objective of the proposed problem is to maximize the total obtained gains of the RSU, as shown in (6).It can be seen that it depends on   and ℎ(V  ,   ).In other words, it not only depends on the gains of the th type of bundles, but also depends on the total number of the th bundles carried by the vehicles.The former one, { 1 , . . .,   , . . .,   }, usually is assigned as the input of the traffic scheduling algorithms, for example, the input of the proposed algorithm including  as shown in Algorithm 1.The latter one is determined by the traffic scheduling algorithms and will be evaluated through extensive simulations.
Therefore, the metric of the number of total obtained gains can be defined as And the metric of the number of total transmitted bundles can be defined as 7.3.Computer Simulations.In the following, we will evaluate the impacts of the arrival density of the th type bundles   , the density of vehicles , and the speed of the vehicles  on the number of total obtained gains and the number of total transmitted bundles.The simulation parameters are set as follows.The length of a timeslot  is assumed to be constant and  = 0.05 s.The radius of the BAD area of the RSU  BAD is assumed to be constant and  BAD = 100 m.The speed of the vehicles  is assumed constant and uniformly distributed in [0.8, 1.2], and the average value is set as  = 30 m/s.The buffer capacity of each vehicle   is assumed to be constant and uniformly distributed in [0.8  , 1.2  ], and the average value is set as   = 200.The vehicles arrive at the RSU in a Poisson process with density , and the classical value of  is set as  = 0.175.All of the  types of traffic are assumed arriving at the RSU in a Poisson process with the same density   , and the classical value of   is set as   = 8.Assume  = 5 and each type of the traffics can be carried by any vehicle with a probability of 0.5; that is, for each vehicle   = {0.5 0.5 0.5 0.5 0.5}.The gains of each type of traffic are assumed to be constant and are set as  1 = 20,  2 = 18,  3 = 16,  4 = 14,  5 = 12.
We note that the values of   and   may directly impact the value of the total number of the gains obtained by the RSU, that is, ∑  =1 ∑  =1   ℎ(V  ,   ).However, it does not affect the performance comparisons among the traffic scheduling algorithms.Therefore, we set both   and   as constants.
Based on the relevant relationship analysis of the simulation parameters, we evaluate the behaviour of the traffic scheduling algorithms in terms of by changing  from 20  to 40 with a step of 2, by changing  from 0.125 to 0.225 with a step of 0.01, and by changing   from 4 to 12 with a step of 1.When one parameter is changed, the others are set as the classical values.And, for each setting of parameters, 30 network scenarios are generated and the average value is taken as the simulation result.The confidence interval of the simulation results is given with confidence level of 95%.The simulation results are validated through experiments.

7.3.1.
Impacts of   .Firstly, the impacts of   are evaluated and given in Figures 7 and 8. From Figure 7, it can be seen that with the increase of   the total number of the transmitted bundles firstly increases and then almost remains the same when   > 8.This is mainly due to that when   > 8 almost all of the timeslots are exploited by each traffic scheduling algorithm.Recall that  = 0.05 and   = {0.5 0.5 0.5 0.5 0.5}; thus when   = 8, we have 1/ = 0.5 ∑ 5 =1   = 20, and when   > 8, we have 1/ < 0.5 ∑ 5 =1   , which is the condition of RSU buffer overflow avoidance, as shown in (14).Among all of the traffic scheduling algorithms, FlowNet outperforms the others.The key behind this is that when computing the traffic scheduling strategies FlowNet takes all of the information of the vehicles and the traffics into account.However, the other ones, like the PritGred, FifoMax, and RndMax, do not consider all of the information, only explore the traffic information at a different level.Among all of the traffic scheduling algorithms, RndMax is the worst one.
However, as shown in Figure 8 BiRnd becomes the worst one instead of RndMax.This is because RndMax always delivers the bundles to randomly selected vehicles in a priority first ordering, and thus the obtained gains are larger.Among all of the traffic scheduling algorithms, FlowNet outperforms the others, and PritGred is the second best one.The density of the vehicles () FlowNet outperforms BiRnd from at least 9.8% to at most 20.9% and, in average 18.4%, and outperforms PritGred from at least 2.3% to at most 3.1% and in average 2.5%.

Impacts of 𝜇.
Secondly, the impacts of  on the performance metrics are evaluated and given in Figures 9 and 10.
From Figure 9, it can be seen that with the increase of  the total number of transmitted bundles increases.This is mainly because with the increase of , more vehicles arrive at the RSU.Therefore, the number of the contact durations  increases and thus the total number of transmitted bundles increases.Among all of the traffic scheduling algorithms, FlowNet outperforms the others as expected and RndMax is the worst one.The other three algorithms are almost the same.
However, from Figure 10 it can be seen that BiRnd is the worst one instead of RndMax.This is mainly due to the fact that RndMax can support traffic differentiation and thus obtains more gains since it always delivers the bundles to randomly selected vehicles in a priority first ordering.Among all of the traffic scheduling algorithms, FlowNet outperforms the others as expected.And the second best one is shown as the PritGred.This is mainly because at each timeslot PritGred always delivers the most gained bundles.In other words, PritGred has the second best CoS support capability among the other four (except for FlowNet).FlowNet outperforms BiRnd by almost 19.5% in average and outperforms PriGred by almost 2.5% in average.

Impacts of 𝑠.
Finally, the impacts of  on the performance metrics are evaluated and given in Figures 11 and  12. From Figure 11, it can be seen that, with the increase of , the total number of transmitted bundles decreases.This is because with the increase of  the length of the contact durations decreases.Thus, less bundles can be taken by the vehicles.Among all of the traffic scheduling algorithms, FlowNet outperforms the others and RndMax is also the worst one.The other three algorithms are almost the same.
Similar to the behaviour of changing , BiRnd obtains the least gains instead of RndMax as shown in Figure 12.Among all of the traffic scheduling algorithms, FlowNet outperforms the others and PritGred is the second best one.FlowNet outperforms BiRnd by almost 19.4% in average and outperforms PritGred by almost 2.6% in average.The speed of the vehicles (s)  The speed of the vehicles (s)

Conclusion
In the sparse or unpopulated area, one type of VDTNs including the vehicular infrastructures or roadside units (RSUs) and mobile vehicles is deployed.The unconnected RSUs of the VDTNs are used as the gateways of the distributed sensor networks, and the mobile vehicles are used as the mobile relays of the data.The sensed data are collected by the RSU and delivered to the passing by vehicles.Then the vehicles store, carry, and forward them to the destinations.In general, more than one type of the sensed data are collected by the RSU, and different classes of service (CoS) support are desired.
In this paper, we consider the CoS traffic scheduling problem for the RSU, with the objective of maximizing the total obtained gains.The availability of the contact information between the vehicles and the RSU is analysed.By exploring the contact durations, the proposed problem is formulated as a maximum weighted triple matching problem and is optimally solved with a flow network based method.Both the offline version and the online version of the proposed algorithms are developed.Extensive simulations are conducted to evaluate the performance of the proposed algorithms.Simulation results show the efficiency and effectiveness of the proposed algorithms.
In the future, the analytical results of the proposed traffic scheduling problem can be derived to deeply understand the behaviour of the CoS traffic scheduling strategy.And the fairness issue for the different CoS traffic scheduling will be considered.

Figure 1 :
Figure 1: An example of the source RSU and the passing by vehicles in VDTN.

Figure 4 :
Figure 4: The constructed flow network graph.

Algorithm 1 :
Flow network based traffic scheduling.

Figure 6 :
Figure 6: Relationship of the simulation parameters.

Figure 7 :
Figure 7: Relationship of the simulation parameters.

3
The density of the bundles ( m ) ×106

Figure 8 :
Figure 8: Relationship of the simulation parameters.

Figure 9 :
Figure 9: Relationship of the simulation parameters.

Figure 10 :
Figure 10: Relationship of the simulation parameters.

Figure 11 :
Figure 11: Relationship of the simulation parameters.

Figure 12 :
Figure 12: Relationship of the simulation parameters.