R-MAC: Risk-Aware Dynamic MAC Protocol for Vehicular Cooperative Collision Avoidance System

The key for cooperative collision avoidance (CCA) systems is the real-time and reliable delivery of safety-related messages among vehicles, which include periodical beacons and risk-triggered warning messages. In this paper, we first design a risk-aware dynamic medium-access control (R-MAC) protocol tailored for vehicular CCA applications. In this protocol, each frame is divided into two parts: TDMA segment for transferring beacons and CSMA segment for delivering warning messages. Then, we propose a stochastic model to predict the average total number of potential collisions in a platoon of vehicles, which determines the size of CSMA segment in the R-MAC protocol meticulously. Monte Carlo simulations validate that our model is reliable and practical. The performance of the R-MAC protocol is verified through theoretical analysis and extensive simulations under different traffic scenes. Simulation results show that R-MAC outperforms the traditional IEEE 802.11p protocol in terms of packets delivery rate and transmission delay, as well as the Jain's fairness index of the medium access between beacons and warning messages.


Introduction
As a potential technology for intelligent transportation system, vehicular ad hoc network (VANET) has received considerable attention by academic communities and major car manufactures around the world.The Federal Communications Commission (FCC) has allocated a dedicated 75 MHz spectrum for vehicular applications in 1999 [1], and some important projects (e.g., Advanced Driver Assistance Systems (ADASE2) [2], CarTALK2000 [3]) have been launched subsequently.Through wireless vehicle-to-vehicle and vehicleto-roadside communications, VANET can provide various safety-related services.As a typical representation, cooperative collision avoidance (CCA) systems have greatly evolved in the past years [4,5], which helps to reduce the probability of vehicular collisions and the corresponding damage significantly.Within a CCA system, when a vehicle in the platoon encounters an obstacle or collision, a warning message will be broadcast backwards to the following vehicles.Upon receiving a warning message, the following drivers will promptly brake instead of reacting to the brake light ahead immediately in tradition, which saves a lot of time before the following drivers are aware of the accidents in the front [6].
In this paper, we study efficient and fair delivery of different messages in the considered scenario of CCA systems, where many vehicles form a platoon (or a chain) moving along the same road toward the same direction.Within this system, there are mainly two kinds of messages: beacons and warning messages.Beacons are disseminated among vehicles periodically to inform neighbors about their movement states, such as speed, acceleration, and direction.Warning messages are triggered by a specific vehicle which experiences a hazard or collisions and are propagated from the source to following vehicles as far as possible to inform them of the accidental situation.As a result, such messages have a higher priority [7] compared with beacons.One key for a CCA system is the real-time and reliable delivery of warning messages as well as beacons.In traditional CCA applications [4,5], some simple approaches are employed to deliver messages, which may lead to several problems in an emergent situation.First, message collisions are more likely to occur with the increasing number of vehicles in the platoon due to International Journal of Distributed Sensor Networks a large number of redundant warning messages pertaining to the same emergent event, which results in a serious messagedelivery latency and packets loss.Then, the overemphasis on the higher delivery priority of warning messages makes the beacons lose the chance of medium access, especially in the IEEE 802.11p protocol which is based CSMA/CA mechanism.In addition, vehicles will become blind to others without knowledge of their latest movement states, which, in turn, may cause more accidental collisions among the platoon.To overcome these shortcomings, we design a riskaware dynamic medium access control (R-MAC) protocol tailored for vehicular CCA systems, which makes a good tradeoff between efficient delivery and fairness of messages with different priorities.
To this end, our protocol is based on traditional TDMA mechanism, in which time is divided into periods called frames and each frame can be subdivided into tiny time slots uniformly.However, each frame in R-MAC includes two parts: CSMA segment for sending warning messages and TDMA segment for beacon transmission.In order to ensure the higher transfer priority of warning messages, we allocate slots to CSMA segment prior to TDMA segment in each frame.The number of slots reserved for CSMA segment is determined by the average total number of potential vehicle collisions among the platoon in the next few frames, which can be computed though a stochastic collision prediction model.After allocation for CSMA segment, the left slots fall into the TDMA segment.In this way, both efficiency and fairness of the medium access between the above two kinds of messages can be achieved in R-MAC.In addition, with the rapid spread of 3G and WIFI in recent years, the V2I communications has been feasible.In this paper, the prediction process of average total number of potential collisions operates on a roadside unit (RSU), such as 3G stations, WIFI hot spots.
The main contributions of the paper are listed below.
(1) Considering the efficiency and fairness of delivering beacons and warning messages on the medium access, we design a risk-aware dynamic (R-MAC) protocol tailored for vehicular CCA systems, which is based on a dynamic TDMA mechanism.
(2) Since the size of CSMA segment in each frame is determined by the average total number of potential collisions among the platoon in the next few frames, a stochastic collision prediction model is presented, which is based on minimum safety distance and a homogeneous Markov chain.
(3) Moreover, extensive simulations under various traffic loads show that R-MAC outperforms the traditional IEEE 802.11p protocol in terms of packet delivery rate and transmission delay, as well as the Jain's fairness index of the medium access between beacons and warning messages.
The remainder of this paper is organized as follows.In Section 2, we briefly review the related work on MAC protocols and vehicle collision models in VANET.Section 3 delineates the operation of the R-MAC protocol in detail.
In order to compute the average total number of potential collisions used in R-MAC, the derivation of a stochastic collisions prediction model is introduced in Section 4. The performance of R-MAC is evaluated in different setups in Section 5, which also provides an in-depth analysis of the simulation results.We conclude the paper in Section 6.

Related Work
In recent years, various MAC protocols have been proposed to guarantee the real-time and reliable communications in VANET.These protocols are mainly based on two approaches: Carrier Sense Multiple Access (CSMA) and time division multiple access (TDMA).However, most of them cannot be applicable well to the vehicular scenarios with high mobility and fast changing topology.
The TDMA approach operates in a time slotted structure, where time slots are grouped into frames.Due to the collision-free nature of TDMA, it has been widely adopted and become the foundation of several TDMA based protocols [8,9] in vehicular network.R-ALOHA [10] is the earliest dynamic channel reservation scheme, which enables nodes to reserve a time slot for transmission in a fixed period.RR-ALOHA [11] and ADHOC-MAC [12] are completely distributed TDMA schemes, but both of them are based on the assumption that the network topology stays static.Simulation results show that the throughput reduction of ADHOC MAC protocol can reach up to 30% for an average vehicle speed of 50 km/h [13].Lam and Kumar designed a DCR protocol with the help of GPS in [14].However, his work is not suitable for heavy traffic situations.Omar et al. [15] proposed a TDMA-based MAC protocol for reliable broadcast in VANET.This scheme reduces transmission collisions caused by vehicle mobility, but it assumed that there were two transceivers on each vehicle, one used for control channel and the other for service channel.
In CSMA-like random schemes, the prime example is IEEE 802.11 [16], which is a simple, flexible, and contentionbased medium access control protocol.In the protocol, when a vehicle wants to transmit messages, it first listens to the desired channel.If the channel is free (not occupied by other vehicles), the vehicle is allowed to transmit.Otherwise, the vehicle has to defer its transmission to the next contention period.Although the approach is simple and flexible, the data delivery delay will increase significantly if the vehicles density is high, especially when an exponential back-off mechanism is employed to resolve the robust contention issues among different vehicles [16].In order to be delivered timely, warning (emergency) message is assigned a higher priority to contend for the wireless channel with a small contention window size in the IEEE 802.11 p EDCA [17].Although the small contention window size allows the warning message to be transmitted with a small delay, it introduces the unfairness between warning messages and beacons (with a lower priority than warning message) on the medium access and the delivery delay of beacons is increased greatly.Another limitation for CSMA schemes is that no RTS/CTS exchange is used, which results in a serious hidden terminal problem and reduces packets delivery rate.Consequently, the effectiveness of CCA applications decreases substantially.
However, to the best of our knowledge, little effort has been devoted to design risk-aware MAC protocol by exploiting reliable and practical vehicle collision models.Detailed models of vehicle motion and collision dynamics were given in [18,19], but they are completely based on deterministic equations for the occurrence of collisions, whereas in fact, randomness is always present introduced by high mobility and driver behavior.In [20], the authors explored the necessary conditions for chain collisions.However, it is assumed that all the vehicles have the same initial speeds and intervehicle distance.A more recent work [21] derived a stochastic model for the number of accidents in the platoon of vehicles equipped with a warning messages communication system.Nevertheless, all the parameters in the model were described by random variables, which cannot give a reliable collision prediction for the real-time traffic scenario.Thus, based on the analysis method in [21], we derive a more reliable and practical stochastic collision prediction model, which takes full advantage of the beacons and warning messages.
In this paper, by combing vehicle collisions model with TDMA-based mechanism, we design a risk-aware and dynamic MAC protocol for the considered CCA application.Besides the reliable and real-time delivery of messages, the fairness between beacons and warning messages on the wireless medium access are also achieved.

Details of Risk-Aware Dynamic MAC Protocol
This section mainly presents the detailed description of the dynamic and risk-aware MAC protocol, including the considered traffic scenario, specification of frame structure, and slots allocation algorithm for CSMA and TDMA segments.
The number of slots in the CSMA segment is determined by the average total number of potential collisions among the platoon and the corresponding computing method based on a stochastic collision prediction model is given in Section 4.

The Traffic Scenario.
Prior to the detailed description of the proposed protocol, it is essential to give an overview of the considered traffic scenario in which our R-MAC operates.As shown in Figure 1, each RSU and all vehicles under its coverage form a vehicular Ad hoc subnet, which is similar to the model proposed in our previous work [22].For sake of simplicity, we only consider a platoon of vehicles on highway, which travel along the same road towards the similar direction.However, with vehicles moving on roads at high speeds, the number of vehicles  and the corresponding vehicle density   in a particular subnet are always varying.In this paper, the vehicle density   is defined as the average number of vehicles per meter, which can be computed by where  refers to the coverage range of an RSU.As surrounding conditions of an RSU might affect its practical wireless transmission range, an RSU updates its current transmission range   in the following manner [16]: where  max and  indicate the maximum wireless transmission range of an RSU and the wireless channel fading conditions at the current position, respectively.If there are many high-rise buildings or the weather is rainy,  is set as a larger value, vice versa.GPS and sensors deployed on an RSU are used to obtain terrain and meteorological information so that the parameter  can be appropriately estimated.
For simplicity of illustration,  is set as 2  approximately.
In addition, we assume that every RSU can dynamically compute the corresponding vehicle density in its coverage by communications between the vehicles and RSU in a subnet.

R-MAC Frame
Structure.Now, we give the detailed specification of frame in R-MAC, which is a dynamic TDMA protocol.In R-MAC, we divide the time into periods called frames and then each of them is subdivided into tiny time slots uniformly.Every frame is divided into RSU segment and vehicle segment (see Figure 2).The RSU segment is reserved for RSU to disseminate control message and the latter is used for vehicles to transmit beacons and warning messages.In our protocol, the RSU segment always begins from the head of a frame and its size is a constant denoted by , which means that the length of the vehicle segment is also determined.
Based on the different priorities between beacons and warning messages, the vehicle segment is divided into two parts: CSMA segment which is responsible for transmitting warning message in emergency situations and TDMA segment which is in charge of delivering beacons.Without any loss of generality, we introduce  and  to indicate the corresponding size of CSMA and TDMA segment, respectively.Based on the above description, we define three sets  0 ,  1 , and  2 as (3), which refer to the slots falling into the RSU, CSMA, and TDMA segments, respectively: means the set of all slots in a whole frame.As illustrated in Figure 2,   indicates the yellow slots in RSU segment,   refers to the blue slots reserved for CSMA segment, and the white slots allocated to TDMA segment are denoted by   .It is worth noting that the corresponding slots of CSMA and TDMA segments are dynamic, which are determined by an RSU according to the real-time collisions situation in the platoon frame by frame.In order to describe the division of a frame into the above three sets intuitively, we introduce "slot  assignment map" denoted by a vector state, which marks a slot  as the following rules: where ID indicates the id of a particular vehicle, which is a positive integer between 1 and .With the control messages of an RSU, the slot assignment map is broadcast to vehicles every frame.
Then, we define the time duration parameters according to the US standards within IEEE.The update frequency is   = 10 Hz.Therefore, the total frame size is 100 ms.The slot time is given by where the packet size of message in VANET is  = 300 bytes, the data transmission rate is 6 Mbits/s, and the guard time  guard is 100 s between two adjacent slots [23].So a single slot reserved for a vehicle is 0.5 ms and the total number  of available slots in each frame can be given as In the following, we give more detailed specifications for RSU and vehicle segments, separately.

Specification of RSU Segment.
As shown in Figure 2, the number of slots reserved for an RSU is fixed and the size of set  0 is 20.Moreover, twenty consecutive slots at the beginning of a frame are allocated to an RSU, and the total time  rsu reaches up to 10 ms.According to slot assignment map, we set the variable State[] = 0, 1 ≤  ≤ 20.Similar to (5), the maximum packet size of an RSU control message can be given by where  is the size of the set  0 .Obviously, the size of an RSU control packet  control can reach up to 6 Mbytes which are enough to transmit the control message for a whole frame [23].In our R-MAC, the control message mainly consists of the slot allocation map in every frame.

Specification of Vehicle Segment.
In contrast to the RSU segment, the vehicle segment of a frame is further divided into CSMA segment and TDMA segment.For the TDMA segment, a vehicle with a chosen slot will send beacon which contains safety-related information to vehicles around it and the corresponding RSU.However, for the CSMA slots, only delivery of warning (emergency) messages is allowed to contend the medium access in CSMA mode.When a vehicle desires to send a warning message, it first listens to the channel and waits for the CSMA slots.If the medium is idle, the vehicle is allowed to transmit.If the medium is busy, the vehicle will defer its transmission to the next CSMA slot, which is different from the exponential back-off mechanism executed in IEEE 802.11MAC protocol [16].In order to ensure sufficient slots for vehicles to sending warning messages, the size of CSMA segment is set as the average total number of potential collisions among the platoon in the next several frames.In our protocol, TDMA and CSMA segments coexist in each frame dynamically, which helps to achieve the delivery fairness between beacons and warning messages.In the worst case, all the slots of a frame are allocated for CSMA segment to transmit the massive amounts of warning messages and no slots are left for beacons, in which our protocol operates as a traditional CSMA-based MAC protocol just like IEEE 802.11p.Indeed, once the case above appears, the traffic accident must be disastrous and the whole network has to be flooded by massive of emergency messages.However, the probability of this case is little and both of beacons and warning messages have corresponding slots reserved to be transmitted for most case.

Slot Allocation Algorithm for CSMA and TDMA (SACT).
In this section, we describe how to allocate slots for CSMA and TDMA segments.The whole slot allocation algorithm abbreviated as SACT includes three steps: slot allocation for CSMA, slot reservation for TDMA and slot allocation map broadcast.In consideration of the higher priority of delivering warning messages triggered by vehicle collisions, we allocate slots to CSMA segment prior to TDMA segment.For ease of description, we assume that each slot in a frame will be labeled with a number from 1 for the first slot to  for the last one consecutively, which is called the id of each slot.

Slot Allocation for CSMA.
The slot set of CAMS segment  1 is determined by the following two steps.(i) The RSU analyzes the risk of collision and computes the average total number of potential collision NUM acc among the vehicles under its coverage.The detailed computation for NUM acc will be given in Section 4, which is another important contribution of this paper.(ii) The RSU selects NUM acc appropriate slots from the vehicle segment for delivering warning messages in the mode of CSM A, whose ids are between  + 1 and .Obviously, there are ( NUM acc − ) selections for the set  1 .Since the generation of warning messages is random absolutely, it is hard to make the optimal selection for  1 .For simplicity, we assure that the ids of NUM acc slots are uniformly distributed between +1 and .Once NUM acc available slots are determined, all of them are marked as occupied by CSMA segment and pushed into the set  1 .Moreover, the slots are denoted by   , where the value of  is from 1 to  consecutively.According (4), we set the variable State[  ⋅ id] = −1, 1 ≤  ≤ .So the slot allocation map of CSMA segment is finished here.

Slot Allocation for TDMA.
Once the slot set  1 has been determined, the left slots in vehicle segment will be used for TDMA, all of which fall into the corresponding slot set  2 uniquely.For ease of description, the size of set  2 is denoted by .  indicates the slots in the set  2 , where 1 ≤  ≤ .Then, a RSU allocates a particular slot   to a vehicle in its coverage, (ii) In a case of an anomaly, in which a vehicle fails to send its beacons in the last consecutive three frames, the RSU will believe the vehicle has moved out of its coverage and no slots will be allocated to it in the next frame.According to these rules, RSU is able to complete the corresponding slot allocation map of TDMA segment.
In fact, the slot allocation procedure, including CSMA segment selection and TDMA slot allocation, is conducted on a particular RSU.Then, the RSU broadcasts the final slot allocation map to all vehicles moving under its coverage.Based on the above description, the integrated SACT algorithm is formally described in Algorithm 1.

Computation of the Size of CSMA Segment
As described in the SACT algorithm in Section 3, the corresponding size of CSMA segment in a frame is determined by the average total number of potential collisions NUM acc among the platoon in the following several frames, which is the focus of R-MAC.Therefore, in this section, we give a novel computation method of total average number of International Journal of Distributed Sensor Networks potential accidents among the platoon (CMAA) as follows.First, a stochastic collision prediction model is introduced to compute the parameter NUM acc in the platoon, and then the probability of collision between adjacent vehicles is derived, which is an input parameter in the prediction model.Moreover, extensive Monte Carlo simulations are conducted to verify the performance of the stochastic model in the end.

Stochastic Collision Prediction Model.
Prior to a detailed description of the envisioned stochastic collision prediction model, we point out a number of assumptions regarding the considered traffic scenario in this paper, which are listed as follows.
(i) The distance between two neighboring vehicles, named intervehicle space, is a random variable.Moreover, it is an exponentially distributed random variable with parameter , which represents the density of vehicles on the road and equals to   computed by (1).
(ii) Each vehicle is capable of estimating its motion state accurately, including velocity, regular acceleration.
The first assumption is based on the fact that interspace calculated by real-time coordinates on map benefit from GPS and GIS is not accurate and reliable, because the positioning precision of GPS hardly meets the need of the considered scenario.In the worse case, a vehicle is evolving into more critical areas; there may be certain undesired problems in the availability of GPS in certain scenarios where GPS signals may not be detected (e.g., such as inside tunnels and underground parking).Moreover, it has been shown that exponential distribution describes well the intervehicles space when traffic densities are small [24].In addition, it is easy to get accurate velocity and acceleration of a vehicle, via adequately deployed sensor monitoring the motion state of a vehicle in real-time.
The collision scenario considered in our paper is a platoon (or a chain) of  vehicles traveling along the same road toward the same direction.As a vehicle   among the vehicle platoon collides with an obstacle or the preceding vehicle on the road, at time  0 = 0, it immediately sends a warning message to the following vehicle   ,  ∈  + 1, . . ., .Upon receiving the warning message, all the following vehicles start to brake at the maximum deceleration.That is, after a time lapse  res .Let us remark here that the time lapse  res is mainly determined by the reception delay of the warning message generated by the communication system and the reaction time of the driver, denoted by   and   , which will be used again is next section.Each warned driver will decelerate immediately, even if the preceding vehicle has not started to decelerate (see Figure 3).For simplicity, we assume every vehicle has the same maximum deceleration  max .
Within this model, the accidental vehicle   ,  ∈ 1, . . ., , may collide with an obstacle and stop suddenly, which only increases the likelihood of a crash for the following vehicles behind the accident spot.Moreover, the final outcome (collision or stop successfully) of a following vehicle depends on the outcome of the preceding vehicles.
Therefore, the collision model is based on the construction of the probability graph depicted in Figure 4, the length of which is  −  + 1 [21].We consider an initial state in which no vehicle has collided.Once the danger of collision has been detected at vehicle   , the first vehicle in the following chain  +1 (immediately after the accidental one) may collide or stop successfully.Similarly, for each vehicle behind  +1 , there are two possible cases: collision with its preceding vehicle or successful stop.As a result, at the right-most of the probability graph, there are  −  + 1 possible final outcomes which represent the number of collided vehicles between 0 and  − .And  , represents the state with  collided vehicles and  successfully stopped vehicles (see Figure 4).
The transition probability between two nodes in the graph is the corresponding collision probability between adjacent vehicles in the chain   ,  ∈  + 1, . . .,  (or the complementary: 1 −   ), which will be used in the model.The detailed computation method is described in Section 4.2.Next, we should note that every path in the graph from the left source node  0,0 to the right-most nodes leads to a possible outcome involving all the following vehicles behind   .The probability of the particular path is determined by all the transition probabilities of nodes which belong to the whole path.Noting that there are multiple paths which may lead to the same final outcome (different paths may end at the same node) referring to a right-most node in the probability graph, the probability of a final outcome is the sum of the resulting probabilities of all possible paths ending at it.
To compute the probabilities of the final outcomes, we can construct a Markov chain whose state diagram is based on the previously discussed probability graph.If the following accidental collisions are caused by the vehicle   , there are ( −  + 1)( −  + 2)/2 vertices in the probability graph.And a homogeneous Markov chain can be established with a state set  = ( 0,0 ,  1,0 ,  0,1 , . ..,  −,0 ,  −−1,1 ,  −−2,2 , . . .,  1,−−1 ,  0,− ), whose size equals to ( −  + 1)( −  + 2)/2.In addition, the transition matrix P of the corresponding Markov chain is a square matrix of dimension (−+1)(−  + 2)/2.It's worth noting that there are at most two other states to reach each state in the state set , which ensures the matrix P is sparse.For ease description, a brief example is illustrated in Figure 5, where only two vehicles  −1 and   follow with the leading accidental vehicle  −2 .
Then, we compute the probabilities of paths which start from state node  0,0 to each of the  −  + 1 final states by computing P − .In fact, the final outcome probabilities are the last  −  + 1 entries of the first row of the matrix P − .Let ∑  be the probability sum of all the paths reaching the final outcome states with  collided vehicles in the following vehicles behind   , namely, state  ,−− .Therefore, ∑  equals to the (( −  + 1)( −  + 2)/2) − th entry of the first row in matrix P − , which can be given as follows: ∈ 1, . . ., .
International Journal of Distributed Sensor Networks  Vehicle chain: Then, the average total number of collisions caused by a particular accidental vehicle   in the chain is obtained by the weighted sum as (10): In order to facilitate statistics, we assume that each vehicle in the platoon has the same probability 1/ to be the accidental vehicle.In other words, for the vehicle   , the parameter  is a uniformly distributed variable between 1 and .Therefore, from the perspective of a RSU in the CCA system as described in Section 3, the average total potential collisions NUM acc in the whole platoon can be computed by (11) as follows:

Compution of the Adjacent Vehicles Collison Probability.
In this section, we come to the problem of computing the collision probabilities   ,  ∈  + 1, . . .,  for adjacent vehicles, which is an important variable used in our stochastic collision prediction model.To the end and for ease of description, we first explore the movement features of vehicles especially when braking, and then a novel method based on minimum safety distance (MSD) is introduced, which takes into full account of different movement states of adjacent vehicles, to compute collision probabilities   .
Based on the analysis of the vehicular moving procedure for vehicle in [20,25], a complete braking procedure is divided into three different stages where acceleration  of a vehicle varies along with time as shown in Figure 6.As mentioned above in the collision prediction model, we still let   denote the accidental vehicle which encounters an obstacle and stops suddenly in the platoon. res indicates the braking response time from the instant   sends warning messages to the instant when the following drivers are aware of the collision ahead.In fact, it is mainly determined by the reception delay of the emergency message generated by the communication system and the reaction time of the driver, denoted by   and   , respectively.To consider a worse communication system and without loss of generality, we set   as 0.1 ms, which is the maximum delay for warning messages that vehicular communication standards specify [26].Generally, the average reaction time of drivers is set as   = 0.9 s [6].As shown in Figure 6, the value of deceleration speed is still rising during the process  ris , which is about 0.1-0.2s and is overlooked for easy of calculation.During the period of  bra , a vehicle keep its maximum deceleration  max until collision with the preceding vehicle occurs or stops successfully.Here, for simplicity, we assume that all the following vehicles behind the accidental vehicle   has the same braking response time  res =   +   = 0.1 + 0.9 = 1 s, which is the sum of reception delay of warning messages   and the reaction time of drivers   .During the period of  res , we assume that a particular vehicle   still keeps its original movement state.After  res , its speed will linearly decrease due to the braking operation with the maximum deceleration speed.Then, V 0, and   denote the initial velocity and acceleration of a vehicle   during the period of  res , respectively.From [4], the movement state during time (0,  res ) can be expressed as After the period  res , the vehicle speed is linearly decreasing with the maximum deceleration  max as following: In order to compute the collision probabilities   , we introduce a Minimum Safety Distance (MSD) model for the vehicles in a platoon.Based on this model, an RSU can compute the accurate minimum safety distance MSD  for each vehicle   in the platoon according to the current movement state, which mainly includes velocity V  and acceleration   .We let   denote the distance between a particular vehicle   and its preceding vehicle  −1 in the platoon, which is an exponentially distributed random variable with parameter  as mentioned in assumption (i).It is obvious that if intervehicle distance   is greater than or equals to corresponding minimum safety distance MSD  , the vehicle   can stops successfully without collision with its preceding vehicle  −1 .Otherwise, there will be a collision between vehicle   and  −1 .So for any vehicle   ,  + 1 ≤  ≤ , the collision probability   will be computed as follows: Based on the aforementioned analysis, we give the MSD computation model as Definition 1.
Definition 1. Minimum safety distance in our work is defined as the needed minimum distance between two adjacent vehicles to avoid collision based on V2V communications, both of which receive a warning message and start to brake hard at the same time.
For simplicity, we assume that all the vehicles have the same mechanical brake performance with a common maximum deceleration value  max .However, the velocity and regular acceleration of vehicles before the time are different with each other, denoted by V  and   , respectively.Without loss of generality, we select a particular vehicle   and its preceding vehicle  −1 to describe the minimum safety distance MSD  (see Figure 7), both of which receive the same warning messages from the front of the platoon at the same time. 0 indicates the instant a warning message is triggered by a accidental vehicle   in the front of the platoon and sent backwards, while  1 denotes the instant when collision between   and  −1 has been successfully avoided.The displacements of   and  −1 are denoted by   and  −1 during the period between  0 and  1 , respectively. 0 refers to the permitted minimum distance between   and  −1 at  1 [4], which can be set an appropriate constant according to different safety requirements in CCA systems.Based on the above analysis, the MSD for vehicle   is given as follows: According to the different movement states, we further divide the computation of MSD into three cases as follows.In case 1, the vehicle   follows the accidental vehicle   immediately, where  equals to  + 1.Whereas in case 2,  doesn't equal to  + 1 and the velocity of   is greater than that of  −1 before the time  bra .In contrast to case 2,  doesn't equal to  + 1 either while the velocity of   is less than or equals to that of  −1 .Here, we continue to adopt the notations as above: let V 0,−1 and V 0, indicate the initial speed of  −1 and   , while  −1 and   denote the corresponding acceleration/deceleration during the period of  res , respectively.

Corollary 2. If the vehicle 𝑉 𝑗 follows the accidental vehicle 𝑉
where the signal function signal() is defined as follows: Proof.Noting that the accidental vehicle   encounters an obstacle and stops immediately, its displacement is overlooked (  = 0).Obviously, the MSD of  +1 is the displacement  +1 of the vehicle  +1 before it stops successfully without collision with its preceding vehicle   .Based on the description of braking procedure, there are two parts generally: the reaction time of braking operation and the linearly decreasing stage.During the period of braking reaction stage, the   keeps its initial velocity and acceleration/deceleration speed.If V 0, +   ⋅  res > 0, the distance of  +1 traveling during (0,  res ) is: The displacement of the vehicle  +1 during the period of  bra until it stops safely is So the total displacement  +1 for  +1 is International Journal of Distributed Sensor Networks Else if V 0, +   ⋅ res < 0, it means that vehicle  +1 has stopped regularly before the stage of linearly decreasing stage.Then the total distance for  +1 to stop successfully is In conclusion, with ( 20), ( 21) and ( 15), we obtain (16).
Corollary 3. If the vehicle   doesn't follow the accidental vehicle   immediately and the velocity of   is greater than that of  −1 before linearly decreasing procedure, the MSD for   can be given by (22): Proof.Based on the assumption that   and  −1 have the same maximum braking deceleration  max , the distance between   and  −1 becomes smaller and smaller if the velocity of   is greater than that of  −1 before linearly decreasing stage.Two vehicles are safe only when both of them have stopped without collision.Obviously, the displacement for vehicle   to stop safely is Similar to   , the displacement  −1 of  −1 is So, with ( 23), (24), and ( 15), ( 22) is derived.
Corollary 4. In this situation, the velocity of   is less than or equal to that of  −1 before linearly decreasing procedure, the MSD for   is expressed as follow: Proof.In contrary to case 2, the distance between   and its preceding vehicle  −1 is always increasing until both of them have stopped one after another.So in this situation, it's always safe for the two consecutive vehicles.We set the minimum safety distance MSD  as the initial permitted minimum distance  0 .Carlo simulation and compare the simulation results with that of CMAA algorithm.In the simulation, the initial speed V  and regular acceleration   of vehicles before emergency brake are uniformly distributed variables from [15,32] m/s and [4,8] m/s 2 .The maximum deceleration value  max is set as 8 m/s 2 .The above parameters are the same with that listed in Table 1.However, for simplicity, the number of vehicles in the platoon is  = 40,  res =   +   = 0.1 + 0.9 = 1 s and the minimum distance between vehicles  0 = 1.3 m, which has been described in Section 4.2.Without loss of generality, all the Monte Carlo simulations have been performed many times per simulation point.Two dotted lines in Figure 8 denote the 95% confidence intervals of the simulation results.Figure 8 shows that the mean error between the results of our model and the Monte Carlo simulation does not exceed 6%.So the stochastic collision model is correct and reliable.

Performance Evaluation
In this section, we describe the simulation results to demonstrate the efficiency of the proposed R-MAC protocol.In our simulation, we implement our R-MAC protocol on the NS-2 simulator and evaluate its performance fairly against the IEEE 802.11p, which is the standardized MAC protocol for VANET.The objective is two-fold: (1) evaluate the fairness of the medium access between beacons and warning message and (2) compare the performance of R-MAC and IEEE 802.11p on the packet loss rate and transmission delay.

Simulation Settings.
The R-MAC protocol is implemented on the network simulator (NS-2.33).In order to conform to the realistic traffic scenario, a 1000 m × 300 m rectangle road network with a straight 4-lane highway is created, where a 3G station is introduced to act as a RSU.Different traffic loads of the road are considered by setting various vehicle numbers.All the traffic scenario and vehicle mobility patters are generated from the VanetMobiSim engine [27].For each traffic loads, the simulation are conducted ten times to take the average result.
During our simulation, each vehicle broadcasts a beacon packet of 300 bytes every 100 ms.When a vehicle encounters an obstacle or collision with its preceding vehicle, a packet of 300 bytes is sent immediately backwards to simulate a warning message.For simplicity, we assume that a collision will happen when the intervehicle space is less than the permitted minimum distance  0 , which is set as 1.3 m.The initial velocities and regular accelerations of vehicles are uniformly distributed variables from [15,32] m/s and [4, 8] m/s 2 , which are selected randomly but constant in a simulation case.Detailed parameters are listed in Table 1.

Evaluation Metrics.
The performance of the R-MAC protocol is evaluated in terms of average packet delivery rate, delay and fairness.The particular evaluation metrics are defined as follows.

Packet Delivery Rate.
Packet delivery rate is defined as the rate of the total number of data packets transmitted successfully to the total number of data packets sent from source vehicles to the destination vehicles in the whole simulation.

Delay Metric.
In our simulations, we just consider the delay caused in the MAC layer, which is defined as the total time elapsed since the message's (beacon or warning) generation till it accesses the medium and is sent out successfully by a vehicle.And we count the average delays of beacons and warning messages together.

Fairness of the Medium Access.
In order to quantitatively evaluate the fairness of the medium access between beacons and warning messages, we adopt the Jain's fairness index in [28].Prior to the particular definition of Jain's fairness index in this paper, we first introduce the medium utilization for both beacons and warning messages, denoted by   and   , respectively.The medium utilization of beacons is defined as the rate of all the slots reserved for beacons to the total number of beacons.And the medium utilization of warning messages   is similar to   .Without loss of generality, let   denote the number of slotsassigned to a vehicle for beacon transmission and   denote the number of all the beacons to be broadcasted in the simulation.So   can be expressed as Similarly, the medium utilization of warning messages   can be computed by Based on the above description, the Jain's fairness index is defined as (  +   ) 2 /2 ⋅ ( 2  +  2  ) [17].It indicates how well the medium utilizations are distributed between beacons and warning messages.If Jain's fairness index equals to 0.5, it means that the warning messages preempt all the resource of the medium access.While Jain's fairness index is 1, the beacons and warning messages share the medium access fairly.are counted together.We vary the number of vehicles from 20 to 160 with an interval of 20 to simulate various traffic loads.

Simulation
As the number of vehicles increases, more packet collisions will occur, which leads to the decrease of the average packets delivery rate.Figure 9 shows that the average packet delivery of 802.11p experiences an abrupt fall from 75% to 60%.While in our R-MAC protocol, the average packets delivery rate is kept above 85% before the number of vehicles reaches 100.Even in a heavy traffic scenario where the number of vehicles is up to 160, the average packet delivery rate is still around 75%, which guarantees the Qos in safety-related applications greatly.
The second experiment mainly observes the performance of the R-MAC protocol on the average delay of the medium access.Similar with the first experiment, we count the delay of beacons and warning messages together.Figure 10 shows that the average delay of the medium access increases with the increase of the vehicle number.In addition, the delay gap between R-MAC and 802.11p becomes larger and larger (better) with the increase of the vehicle number, which verifies a good performance of average delay in our R-MAC.Nevertheless, as seen from Figure 10, R-MAC and 802.11p reach nearly the same delay performance (reaching up to 115 ms) when the number of vehicles increases to 140.Obviously, neither the R-MAC nor 802.11p protocol can work well in the heavy traffic situations.So, we will study the traffic overload tolerant R-MAC in the future.
In the third set of experiments, we mainly investigate the performance of R-MAC on the medium utilizations between beacons and warning messages.Various traffic loads are configured the same as the first experiment.As seen from Figure 11, when the number of vehicles on the road is small (less than 40), the medium utilizations of warning messages approach 100% in both R-MAC and 802.11p.That is because there are few warning messages generated when the traffic is light, and there are enough slots and chance for them to be transmitted.With the increase of vehicles, particularly from 60, the medium utilizations of warning messages and beacons decrease dramatically in 802.11p, which is caused by the more and more collisions among messages.However, even in a heavy traffic (number of vehicles more than 140), Figure 11 shows that the medium utilizations of beacons and warning messages are greater than 82% and 40% in our R-MAC, respectively.In order to demonstrate the fairness of the medium access between beacons and warning messages, the final experiment is conducted with the same settings as the third one.The Jain's fairness index is computed and plotted in Figure 12.As shown in Figure 12, the Jain's fairness index decreases dramatically with the increase of vehicles in 802.11p, which is caused by inherent attribute of contest in CSMA and different priorities of messages.When the number of vehicles reaches up to 140, the Jain's fairness index in 802.11p even drops to 0.65, which almost indicates the worst case.However, the Jain's fairness index in R-MAC always floats between 0.9 and 1.0, which International Journal of Distributed Sensor Networks means that a good fairness between beacons and warning messages is achieved.Compared with 802.11p, our proposed R-MAC protocol can improve the Jain's fairness index by about 39% even in heavy traffic scenarios.

Conclusions
This paper has studied the dynamic MAC protocol problem to satisfy real-time and reliable delivery of messages while achieving the fairness of the medium access between different kinds of messages in cooperative collision avoidance (CCA) systems.We have designed a risk-aware dynamic medium-access control (R-MAC) protocol for this problem.
In order to ensure the accuracy of risk-aware in R-MAC, a stochastic prediction model of the average total number of potential collisions in the platoon is presented.Extensive Monte Carlo simulations verify that our model is reliable and practical enough.Efficiency and fairness of R-MAC are verified by simulations against the standardized MAC 802.11p protocol of VANET.The simulation results show that R-MAC can improve the Jain's fairness index by about 39% compared with 802.11p.Even in heavy traffic scenarios, the packet delivery rate is still above 80% in R-MAC and the average delay is reduced significantly, which meets the communication requirements in CCA systems adequately in general scenarios.From the simulations, we have found that the transmission delay is relatively lager in overload traffic scenario.As a future work, we will study the traffic overload tolerant R-MAC protocol for CCA applications.

Figure 4 :
Figure 4: Probability graph defined in the collision model.

Figure 5 :Figure 6 :
Figure 5: Probability graph and corresponding transition matrix for scenario where the collision is caused by vehicle  −2 .
Model.Based on the above detailed description in Sections 4.1 and 4.2, the integrated computation method of the total average number of potential accidents in the platoon (CMAA) is formally described in Algorithm 2. In order to verify the effectiveness of stochastic collision prediction model, we conduct a Monte

Figure 8 :
Figure 8: Average total number of collisions in the platoon versus average intervehicle distance.
Results.The first set of experiment mainly investigates the performance of R-MAC on the average packets delivery rate, where beacons and warning messages International Journal of Distributed Sensor Networks

Figure 9 :
Figure 9: The packets delivery versus number of vehicles.

Figure 10 :Figure 11 :
Figure 10: Average delay of the medium access versus number of vehicles.

Figure 12 :
Figure 12: Jain's fairness index versus number of vehicles.

Slot Allocation for CSMA
Compute the average total number NUM acc of potential collisions among the vehicles platoon by Algorithm 2; Select NUM acc integers from [ + 1, ] uniformly.Push the slots whose id equals to the above selected NUM acc integers into set  1 , denoted by  1 ,  2 , . . .,   ,  = NUM acc ; For  = 1 to  State[  ⋅ id] = −1 Step 2: Slot Reservation for TDMA  2 =  −  0 −  1 ,  2 = ⌀, For each vehicle in the coverage of a RSU If the RSU received a beacon in the last three Frame Then select a slot  from set  2 randomly, remove  from  2 and add it to  2 , State[ ⋅ id] = vehicle.ID; Else remove the vehicle from the vehicle list under its coverage;

Step 3: Broadcasting the slot allocation map
The RSU broadcast the vector State[], 1 ≤  ≤  to all the vehicles Algorithm 1: Formal description of the SACT Algorithm.asthefollowing steps.(i)If there are beacons received from a vehicle in the last frame, the RSU will select a available slot  randomly from set  2 for the vehicle and attach the vehicle ID to it, namely, State[ ⋅ id] = vehicle ⋅ ID, which marks  as occupied by a particular vehicle.Moreover, once   has been occupied by a vehicle, it will be removed from  2 to the set  2 .Obviously, the sizes of the two sets meet the following equation:     2     +       2      = .

Table 1 :
Parameters used in simulations.