A Reliable Broadcast Protocol in Vehicular Ad Hoc Networks

Periodical broadcasts of individual vehicle's safety information such as velocity and acceleration are critical in vehicular ad hoc networks (VANETs). However, current contention-based media access control (MAC) protocols cannot guarantee high performance in high density VANETs. In this paper, we propose a MAC protocol based on s-disjunct code to achieve reliable and real-time broadcasts via assigning a channel to each vehicle as the vehicle enters the network. Our protocol is adaptive as vehicles are required to adjust their communication ranges according to the network density in order to avert the interference among them. We conduct an extensive simulation study, and our results indicate that the proposed scheme can successfully achieve the requirements of the dedicated short range communication (DSRC) standard, that is, to broadcast safety information 10 times per second. Even at a high vehicle density, our scheme still guarantees that the success rates of both transmission and reception are greater than 95%, and the collision rates of access collision and merging collision are lower than 10 collisions/period.


Introduction
A vehicular ad hoc network (VANET) consists of a collection of vehicles communicating with each other or with road side units (RSUs) by wireless networking techniques. Each vehicle is equipped with an onboard unit (OBU) that includes a global position system (GPS) device. The major purpose of VANETs is to provide safety information such as collision avoidance and traffic jam prediction to vehicles in the network [1]. Other services such as entertainment and social networking can also be supported by VANETs. Because of the critical safety issues, the United States Federal Communication Commission has allocated 75 MHz spectrum from 5.850 GHz to 5.925 GHz to the dedicated shortrange communication (DSRC) standard, which is specifically designed for short-range to medium-range automotive communication use.
The DSRC standard divides the 75 MHz spectrum space into seven 10 MHz channels. The one in the middle is the control channel while the other six are service channels. Safety information is periodically broadcasted to neighboring vehicles through the control channel 10 times/second. But not the whole 100 ms period is used for safety information broadcasts: half of this period is used by the other six service channels. The safety information and control information altogether need to be sent out within 50 ms [2,3]. However, the MAC protocol of DSRC adopts the contention mechanism, which is called carrier sense multiple access with collision avoidance (CSMA/CA). This protocol performs well only when the node density is low. When the density increases, frequent transmission collisions occur due to the relatively limited time period and the contention-based mechanism. Based on real experiments, [4] has shown that there is a gray zone phenomenon for VANETs, which means that a good reception (package deliver rate (PDR) > 80%) is not always guaranteed.
Reliably broadcasting safety information to neighboring nodes is a big challenge, especially in the case of high node 2 International Journal of Distributed Sensor Networks density. Although a lot of previous work has focused on this problem, most of it marginally increase some aspects of the performance. As Section 2 describes, contention-based protocols aim at achieving a larger throughput and a lower transmission delay, while schedule-based protocols focus on improving transmission reliability. Nevertheless, neither of these two categories of solutions to date has addressed scalability problems at scenarios when node density in the network is high.
Motivated by this situation, we present a MAC protocol based on -disjunct code. In this protocol, each node is assigned a codeword locally and independently according to its current GPS location. Our proposed algorithm assigns a node a transmission channel according to its codeword. In order to adapt to high node density we propose a transmission range control algorithm based on the number of nodes in the communication range of a vehicle. The analysis and simulation results show that our protocol achieves considerable performance improvements, with the success rates of transmission and reception greater than 95%. The contributions of this paper are outlined as follows.
(1) We first propose a distributed codeword allocation algorithm, which assigns a codeword to each vehicle based on its current location.
(2) We then present a channel assignment algorithm based on -disjunct code. Theoretical analysis of this algorithm is provided to derive the probabilities of merging collision and access collision.
(3) We next design a transmission range control algorithm, which can dynamically adjust the coverage range of a vehicle to reduce interference.
(4) We finally conduct an extensive simulation study to verify the performance of our protocol. The results demonstrate high success rates in transmission and reception while keeping a low collision probability.
The rest of the paper is organized as follows. Section 2 summarizes the related work. Section 3 presents our system model and Section 4 details the three algorithms. Section 5 analyzes the performance of the channel allocation algorithm and Section 6 presents our simulation results. At last, Section 7 draws our conclusion.

Related Work
Reliable broadcast has been extensively studied. The proposed approaches are either contention-based (such as CSMA/CA) or schedule-based (such as time division multiple address (TDMA) and frequency division multiple access (FDMA)).
Several contention-based approaches proposed for VANETs [5][6][7][8] focus on optimizing the channel contention mechanisms and channel parameters. Artimy et al. [7] have built a math model to simulate the relationship between vehicle density and velocity to estimate the vehicle density and proposed an algorithm to dynamically change the transmission range based on the estimated density. Rawat et al. [8] have proposed an approach that not only adjusts the transmission range according to node density but also tunes enhanced distributed channel access (EDCA) parameters to achieve a larger throughput and a lower transmission delay. However, these studies cannot completely solve the reliable broadcast problem, because they are still based on the contention mechanism, and suffer from serious contention problems when the node density is very high.
The main idea of schedule-based mechanisms is to avoid contention collisions of the nodes in the network by designing a schedule algorithm [9][10][11][12]. Farnoud and Valaee [9] have compared the positive orthogonal code-(POC-) based broadcast algorithm with the synchronous ppersistent retransmission (SPR) and the synchronous fixed retransmission (SFR) algorithms. For POC-based broadcast, nodes in the network repeatedly broadcast information to guarantee broadcast reliability; thus the protocol wastes a lot of network resource due to repetition. Choi et al. [10] have proposed the concept of location division multiple access (LDMA), in which a time period is divided into many slots and each time slot is assigned to a node located at a certain location. This approach can mitigate the broadcast storm problem but is not appropriate for periodically broadcasting control information.
Omar et al. [12] have presented an algorithm called VeMAC which is also based on TDMA. All the slots in VeMAC are divided into three sets (left, right, and infrastructure); and each node chooses a channel from its corresponding set to access. Additionally this approach uses the RTS/CTS mechanism to tackle the hidden terminal problem. The result demonstrates a good performance in success rate and collision rate. However, our simulation study indicates that when the node density is high, the performance clearly degrades. Because VANETs must operate in high densities, dense scenarios are an important area that should be considered when designing algorithms for better performance.
-disjunct code has been used for channel allocation in previous work [13,14]; but those algorithms fit stationary networks better than dynamic networks as every node in the network is assumed to have a code before joining in the network and the code will never change. This does not fit VANETs, where nodes are always moving. Motivated by the heuristics in [14], we develop algorithms in this paper that are applicable to VANET environments.
To address the problems in high density scenarios, we propose a protocol that is based on -disjunct code to assign channels and tunes transmission range according to node density. Our protocol incorporates both the schedule-based approach and the contention-based approach to achieve a better performance.

System Model
In this section, we introduce the underlying network model, assumptions, and the terminologies employed in this paper.

Basic Framework.
We consider a vehicular ad hoc network with | | vehicles (also called nodes). Each vehicle is assumed to be equipped with a GPS receiver or be able to obtain its location information from any technique International Journal of Distributed Sensor Networks 3 [15]. Based on the DSRC standard, the band width of the control channel is 10 MHz, which can be divided into orthogonal (nonoverlapping) subchannels: 1 , 2 , . . . , . We assume each node is equipped with radio interfaces for data reception and one additional interface for data transmission. This is a practical assumption due to the low cost of radios nowadays. Each radio can access any subchannel and the footprint of the radio is a disk resulted from the equipped omnidirectional antenna.
Safety information is sent every 100 milliseconds in the control channel, required by the DSRC standard. The 100 milliseconds are shared by both safety information and nonsafety information. Although the problem of time allocation to safety information has been discussed in [16], there is not a fixed subinterval value. It is advised to change according to the node density and the reliability requirement. But the node density is always changing, and it is hard to coordinate the subintervals of all the nodes in the network to the same value. So it is necessary to set a fixed subinterval value to all the nodes in the network. Currently, the standard [17] fixes the default value of safety information broadcast subinterval as 50 milliseconds. So we take the default value as the safety information broadcast subinterval in this paper. However, it can be changed in some other scenarios. Each subchannel of the control channel can be shared by multiple nodes in time domain, which means that 50 ms can be partitioned into multiple time slots and these slots can be accessed by different nodes without collision. A virtual channel is defined to be a time slot in a subchannel which is part of the control channel in VANETs. If the number of slots in every 50 ms is and the number of subchannels is , the number of virtual channels is = × . For simplicity, we call a "virtual channel" a "channel" in the rest of the paper.
For each node, the virtual channels are partitioned into primary channels and secondary channels. A node is linked with a binary column vector called a channel codeword, which is used to mark primary channels and secondary channels: "1" represents a primary channel and "0" represents a secondary channel. For example, a node with the vector ⃗ = (1, 1, 1, 0, 0, 0, 0, 0, 0, 0) indicates that channels 1 , 2 , and 3 are its primary channels and channels 4 , 5 , 6 , 7 , 8 , 9 , and 10 are its secondary channels. Nodes prefer primary channels to secondary channels and in general the number of primary channels is smaller than that of the secondary channels for any node.
In our study, the network can be modeled by a directed graph ( , , C), where represents network nodes, represents directed links among nodes, and C is an × | | matrix with each column being a channel codeword associated with a node in . For a node ∈ , we use N( ) to denote 's interferers whose communication coverage areas overlap with that of .
( * ) We define the column weight as and the row weight as Based on the characteristic of -disjunct code, [14] derived the following important property. Property 1. Given -disjunct code X, let be any designated codeword in X and let be any subset of no more than columns not including . There exists at least one index , such that the th element in is "1" and the th element of any codeword in is "0." This property motivates us to build a mapping between the code C in the network ( , , C) and -disjunct code X. In other words, we can use × -disjunct code X as the channel code, where represents the number of channels 4 International Journal of Distributed Sensor Networks and stands for the number of available codewords. Any column of code X is an available codeword assigned to a node in network . Note that 1/0 still stands for a primary or secondary channel of node ; column weight means the number of primary channels that node has and row weight means the number of nodes in using channel as a primary channel. In the following of this paper, we use -disjunct code X as a code matrix C.

Main Idea.
We focus on channel assignment to mitigate interference among channels and maximize the network capability by using -disjunct code. Given that every node has a copy of the codeword matrix X, a node picks up a codeword from X according to its current location and ID (e.g., vehicle's plate). At Section 4.1, we propose an algorithm to assign codewords to nodes randomly. Then each node chooses an available channel based on its channel codeword and the current channel status, as shown in Section 4.1. Each node maintains two tables: the one-hop neighbor table and the two-hop neighbor table, which contains the one-hop and two-hop neighborhood information, respectively. Note that due to the distinct transmission ranges of the nodes, the one-hop neighbor set of node includes those nodes sending messages successfully to . The information consists of node IDs, their codeword indexes, and their current transmission channels. The onehop neighbor table and the codewords of the nodes are broadcasted with safety information every time. On the contrary, the two-hop neighbor table shall be updated once a node receives its neighbors' one-hop neighbor tables. When a collision happens, the colliding nodes release their current channels and choose new channels based on their codewords.
At last, an algorithm is proposed at Section 4.3. Nodes adjust transmission ranges to control the number of nodes in their coverage ranges. In the next section, we describe the three algorithms in detail.

-Disjunct Code Based MAC Protocol
This section introduces the codeword distribution algorithm and shows how to link -disjunct code to the channel allocation algorithm. A communication range control algorithm is finally proposed to reduce the interference among neighboring nodes.

Codeword Distribution.
Let ( , , X) be a vehicular adhoc network with | | nodes and let X be -disjunct code for the network. Every codeword in X has an index and we use X( ) to denote the th codeword in X. Any node in this network has a copy of the code X.
Each node chooses a codeword from X when it comes into the network and the codeword is changed with its location. Each node only needs to know its current GPS location based on which to determine the codeword to use. Thus the algorithm is distributed.
A large city area is divided into a number of small grids with the size of several hundred square meters. Although GPS location information is usually with an error of several meters, a node can still locate itself to a grid accurately. The codeword set X is divided into subsets that do not intersect. Let (1 ≤ ≤ ) be the th subset. For ∀ , , 1 ≤ , ≤ , and ̸ = , we have ∩ = 0. Each grid is assigned a codeword subset . Any node in the grid chooses one codeword from . Next, we introduce how to map grids to subsets and present the algorithm for a node to choose a codeword from a subset .

Segment Generation.
We divide a large area (such as a city or a state) to a number of small grids with length , as illustrated in Figure 1(a). Additionally, we divide subsets to a 2-dimensional array with rows and columns, where 2 ≤ , as shown in Figure 1(b). Each element denoted by in stands for a subset of codewords and the codeword number in each subset is / 2 . Next, we show how to map a 2D grid to a 2D array, as shown in Figure 1(c).
Let 0 ∘ longitude (namely meridian) and 0 ∘ latitude (namely equator) be reference lines. Given a node's GPS location (latitude, longitude), its distance to the equator is where means the radius of the meridian. Its distance to the meridian is where is the radius of the equator. The number of segments from the equator to this node is where ⌈ ⌉ is the minimum integer that is not smaller than . This means the node is at the (index )th grid with the equator as reference. Similarly, the number of segments from the meridian to this node is Then the corresponding subset in array is chosen according to (index ) and (index ). Intuitively, we should do a modulo operation on index or index :

Codeword Selection.
Once a node has already known codeword subset to choose, it does a hash operation on its plate number and the output of the hash operation is the index of the codeword in subset. The output domain of the hash function is at the range of [0, / 2 ] and the hash function performs randomly. Each node may find a proper index with the smallest probability of collisions. Based on the rules, the best case is that any two codewords used in the area of ( ) 2 are different at any time instance. But there is still a collision probability. Take 8-bit Pearson hash function as an example; we can get the average number of collisions when there are (1∼100) nodes to choose codewords simultaneously. The function input is any 5-digit decimal number generated randomly and this number is considered as a plate number. Its output is a decimal number ranging from 0 to 255 as the index in a codeword subset. Figure 2 reports the number of collisions averaged over 100 runs when two or three nodes with different plate numbers hashed to the same value. One can see that when the number of nodes is less than 60, there exists no more than 4 pairs of collisions. When the number of nodes is more than 60, there are more collisions for both two vehicles and three vehicles. The average number of collisions for three vehicles is less than 1 sometimes, which means that collisions for three vehicles do not happen usually. Since each node has several primary channels to choose, two nodes may avoid choosing the same primary channel, even though their plate numbers are hashed to the same value; thus code collisions do not affect our algorithm too much.

Channel Allocation Algorithm.
In this section, we present the channel allocation algorithm shown in Algorithm 1 for broadcast. Each node in has a codeword X( ), according to the description in the last section. Let N( ) be the onehop and two-hop neighbors of and their codewords are denoted by X(N( )). Node at a time instance only takes one codeword and it knows the codewords and transmission channels of N( ). Denote the channels currently occupied by N( ) by CH( ). Let CH c ( ) be its currently used channel and let CH( ) be the channel assigned to node to be used in the next time period.
Intuitively, should choose those channels not being used by any of its interferers. At the beginning, should choose a channel that is secondary to N( ) from its primary channel set. If such a channel can not be found, choose a primary Input: Codewords X( ), X(N( )), CH( ), CH c ( ) Output: CH( ), the channel assigned to .
(2) If CH 1 = 0, compute the set of channels CH 2 which are primary to node and currently not being used by N( ). If CH 2 ̸ = 0, check whether CH c ( ) ∈ CH 2 holds. If so, assign CH c ( ) to CH( ); otherwise, randomly choose one from CH 2 to allocate to .
(3) If CH 2 = 0, calculate the set CH 3 in its own primary channels, in order to get the channel with the least row weight of X(N( )). Then if CH c ( ) ∈ CH 3 , assign CH c ( ) to CH( ); if not, randomly assign one channel of CH 3 to .

Remark 3.
First, a node prefers its primary channels to its secondary channels. Second, after a node obtains the nonempty channel set (CH 1 , CH 2 , or CH 3 ), it first checks whether its currently used channel is in the set. If yes, its currently used channel should be allocated to instead of randomly choosing a new channel from the set.

Communication Range Control.
Each road may have different vehicle densities due to nodes' mobility. When the density is considerably high, the capacity of control channel is not adequate for a large amount of vehicles to access. At such a high density, a node only needs to transmit its information to the nodes close to itself. At this subsection, we propose an algorithm to control the transmission range of each node with a purpose of reusing the network space and decreasing the interference. The idea of dynamic transmission range control was first proposed by [7], which is based on vehicle's stop time to estimate density and tune transmission range. In our algorithm, we use a more direct and lighter algorithm to achieve the objective. First, we define node density as = Current Number of Nodes Maximum Number of Nodes .
In order to estimate the current number of nodes in a designated area, each node should count the nodes in its vicinity International Journal of Distributed Sensor Networks 7 within the minimum transmission range min according to the information received from its neighbors. The maximum number of nodes can be estimated as follows. Assume that the safety driving distance between two consecutive cars is known (it is got from observations and statics) and given the minimum transmission range, the maximum number of nodes within this range can be computed as min * / ( is the number of lanes obtained from the local digital map). Then Therefore, the transmission range is calculated by the following equation: where (i) TR is the calculated transmission range, (ii) max is the maximum transmission range, (iii) is the ratio of the number of nodes to the maximum number of nodes that can be accommodated within the minimum transmission range area.
In our algorithm the minimum transmission range min is defined in order to guarantee network connection. If the transmission range computed from (11) is smaller than min , the computed one should be dropped and min should be chosen.

Performance Analysis
Based on the channel allocation algorithm proposed in Section 4, one can see that there are two cases which may cause collisions, as studied in [12]. First, when a node moves from one part of the network to another part, its currently used channel may conflict with other nodes' channels. These nodes are going to be its neighbors, and this case is called merging collision as shown in Figure 3(a): node is going into the two-hop area of and they do not know each other's current channel; therefore may use the same channel as , which may result in a merging collision. The other one is that when two nodes are already within the communication range of each other, they may access the same time slot simultaneously. This is called access collision, illustrated in Figure 3(b): nodes and are in each other's two-hop range, and they may access the same channel at the same time, causing the access collision.
In this section, we first derive the probability distribution of channel allocation and then analyze the probabilities of access collisions and merging collisions.

Probability Distribution of Channel Allocation.
In this subsection, we derive the probability of a node choosing a channel from CH 1 , CH 2 , and CH 3 , denoted as (CH 1 ), (CH 2 ), and (CH 3 ). N( ) is 's complete interferer set and X(N( )) is different from X( ). We start with the following theorem. Proof. According to the characteristic of -disjunct matrix, if |N( )| ≤ , there is always a row in which X( ) is "1" but all the others are "0." So X( ) can not be covered by the BoolSum (X(N( ))) and such a channel can always be found in this condition. Proof. If the number of 's neighbors is less than the column weight of X( ), there is at least one of the primary channels not being used by N( ). Thus, (CH 1 ) + (CH 2 ) = 1 and (CH 3 ) = 0.
Next we will give the probability upper bound of (CH 1 ), when |N( )| > . Let |N( )| be , and let be the total number of codewords in X, namely, |X|. Let stand for the th row weight of all the codewords. The probability that the th row of BoolSum(X(N( ))) is value "0" is On the contrary, the probability of the th row of BoolSum(X(N( ))) being "1" is which means that there is at least one "1" in row for N( ). For a code X with rows, there are ( ) distinct patterns to choose rows from X. Let ( | ) (1 ≤ ≤ ( )) denote the th pattern of choosing rows from X. The rows chosen are denoted by row 1 , row 2 , . . . , row and the others are row +1 , . . . , row . In the th pattern, the probability that these rows of BoolSum(X(N( ))) are all value "1" is denoted as (all one| | ): The probability of X( ) being covered by BoolSum (X(N( ))) under the condition that BoolSum(X(N( ))) has "1" is As ranges from max to , the probability that X( ) is covered by BoolSum(X(N( ))) is where max is the maximum column weight of codeword in X(N( )). If X( ) is not covered by BoolSum(X(N( ))), CH 1 ̸ = 0. The probability that can choose a channel from CH 1 is If X( ) is covered by BoolSum(X(N( ))), but all the primary channels of is used by X(N( )), its probability is The probability of CH 2 ̸ = 0 is At last, the probability that node chooses a channel from CH 3 is

Probability of Collisions.
If a node comes into a new part of the network with |N( )| nodes in 's two-hop vicinity, the channel used by may conflict with channels used by N( ). Let denote |N( )| and assume that is using its primary channel. According to our algorithm, there will be channels currently being used by N( ). If there is a merging collision, 's primary channels must overlap with the channels used by N( ) and the number of overlapping channels ranges from 1 to min{ , }. The probability that there are overlapping channels is The merging collision occurs when chooses a channel from one of the overlapping channels to transmit. Therefore the probability of merging collision is Next we compute the probability of access collisions. A node may select a channel used by another node. Due to the feature of -disjunct code, the number of overlapping channels ranges from 1 to − 1 (assume the column weights of all the codewords of its neighbors are the same here, denoted by ); therefore, the probability is This probability is very small, and levels off to zero. When there are neighbors who are updating channels at the same time, the collision probability of node is Take a 96 × 364 2-disjunct code with column weight 3 as an example. Figure 4(a) shows the probabilities that node chooses a channel from CH 1 , CH 2 , and CH 3 , respectively, with the change of the number of neighbors. When the number of interferers is smaller than , (CH 1 ) is 1. While |N( )| increases, (CH 1 ) decreases and (CH 2 ) and (CH 3 ) increase. Figure 4(b) describes the probabilities of merging collisions and access collisions. We find that the probability of merging collision is increasing linearly, because when the number of node 's interferers grows, the overlapping probability increases. Therefore, it chooses an overlapping channel with a larger probability. The collision probability is small when the number of neighbors is very small. In practice, every node should try to use its current channel unless the computed channel set forces it to change. Most of time, a node's channel should not change frequently, and the number of nodes that change channels simultaneously is thus small. In conclusion, when N( ) is smaller than some threshold, it maintains a high probability of choosing a channel from CH 1 and CH 2 and thus results in a low collision probability.

Simulation Scenario and Parameters.
We simulate our protocol in two scenarios by Matlab. One is a two-way road scenario with each direction having two lanes. The other is a city grid layout consisting of three horizontal and three vertical roads with each direction having only one lane, shown as in Figures 5(a) and 5(b).
The parameter settings are reported in Table 1. For both scenarios, we validate our protocol on different densities. The highway road is divided into 7 segments with a length of 150 m. Each segment has its own related codeword set consisting of 256 codewords. The city grid is divided into 9 segments with a dimension of 150 m × 150 m. Each segment has a codeword set of 256 codewords too. Each vehicle is generated randomly and travels at an average speed with a small fluctuation. In the highway scenario, when a vehicle reaches one end of the highway road, it reenters the road from the other end, in order to keep the same number of vehicles on the road during the simulation time. To prevent the merging collision when a vehicle reenters the road, we assume that a vehicle at a distance to one end can communicate with vehicles within the distance ( − ) to the other end ( is the communication range and < ). In the city grid scenario, any vehicle at the intersection randomly chooses a direction to travel, and it can communicate with other vehicles within its communication range of each direction. However, a node Simulation time 120 s 120 s not at the intersection area of a street can only communicate with nodes within its transmission range of the same street, due to building obstacles. Following the DSRC standard, safety information is sent through the control channel and its frequency band is 10 MHz. The 10 MHz channel is divided into 48 subchannels. Several modulation techniques and coding rates are suggested by the standard. However, previous work and industry experiments show that QPSK with 1/2 coding rate and 6 Mbps data rate perform better overall, and this is the default value in the current industry practice; thus such settings are adopted in our simulation study. The maximum transmission range is 150 m for both scenarios, and the minimum transmission range is set to 50 m.
The maximum size of a safety message should not exceed 200 B according to the industry suggestion. In this paper we set the packet size to be 300 B to incorporate future applications with large message requirements. Transferring a 300 B message in a subchannel costs 19.2 ms. During the 50 ms transmission time, only 2 messages can be transmitted; and thus 50 ms can be divided into 2 slots. Therefore the number of virtual subchannels in a period is 48 × 2 = 96.
We construct a 96 × 2304 -disjunct code, which is assigned to 7 segments with each having 256 codewords in the highway scenario and to 9 segments with each having 256 codewords in the city grid scenario. From the previous test, we observe that 256 codewords are adequate for the nodes in a 150 m length road or a 150 m × 150 m area because such an area or road segment can accommodate at most 50∼ 60 vehicles in practice. Our simulation time is set to 120 s. At the beginning of the simulation, each node is stationary until it gets its own channel. Then all the nodes start to move and timing starts. We divide 1 s into 10 periods and each vehicle sends one packet at each period. The wireless channels are ideal and the only reason of transmission failure is channel collision. We also implement VeMac [12] ( = 0 and = infinite) in the same road topologies and compare their performance with that of our design.
Some metrics for evaluating the network performance are defined as follows.
(a) Success rate of Tx is the average ratio of successful transmissions to the total transmissions per period.
Here a successful transmission is achieved when a node is transmitting at channel c; no other node in its two-hop neighborhood using the same channel c is transmitting.
(b) Success rate of Rx is the average ratio of successfully received packets to the total packets per period. The total packets include the successfully received packets and the dropped packets due to channel collisions for all nodes in the network. In Figure 6(b), -disjunct has the largest merging collision rate all the time. VeMac ( = infinite) has the lowest merging collision rate as a node can only use its own slot set of its driving direction in this protocol. When a merging collision occurs, -disjunct protocol can use neighboring code information to choose a channel, so that the probability of access collisions is low. But if a merging collision occurs in VeMac, more access collisions may happen, due to its characteristic of randomly choosing channels. -disjunct produces excellent results in terms of access collisions which drive the low total collision results. The total collision rate affects the success rate of Rx and Tx.   As shown in Figures 7(a) and 7(b), with the increase of the number of nodes in the network, the success rates for all protocols are decreasing, and 200 is an inflection point for this scenario. Under this threshold, the Tx success rate of -disjunct is a little lower than the other two, with the Rx success rate almost the same. However, if the number of nodes is larger than 200, the Tx success rate and the Rx success rate of -disjunct protocol are still kept higher than 95%, with the others dropped to as low as 81% and 72%. In terms of Rx and Tx success rates, we think that the Rx success rate is more significant than the Tx success rate. Therefore, -disjunct protocol shows better scalability and performance in high node density case. In addition, the success rates ofdisjunct do not differ from those of the others too much when the vehicle density is low, which can be acceptable. Figures 8(a) and 8(b), one can see that our -disjunct protocol has lower merging collision rate and access collision rate than VeMac protocols ( = 0 and = infinite). That is because nodes near junctions are tending to generate merging collisions when they meet nodes using the same slot set or switch to another street with the same slot set. But this is not the case in the highway scenario as there is no intersection. A higher merging collision rate causes a higher access collision rate, for instance, as high as 350 collisions/period and 400 collisions/period, especially in the high node density case. However, the access collision rate is kept lower than 10 collisions/period for -disjunct protocol. Therefore counting both the access collisions and the merging collisions, our -disjunct protocol suffers less collisions than the other two protocols.

City Grid Scenario. From both
Figures 9(a) and 9(b) describe the Tx success rate and Rx success rate for the three protocols in the city grid scenario. The inflection point is about 350 vehicles. With the number of vehicles less than 350, the Tx success rates of the two VeMac protocols are slightly larger than that of -disjunct and the Tx success rates for all the protocols are above 95%, while the Rx success rates are almost the same. But when the number of vehicles grows, the Tx and Rx success rates of -disjunct are both kept above 95%. On the contrary, the ones for the VeMac protocols fall down quickly, reaching 75%. Therefore, for both scenarios, -disjunct protocol performs well and the Rx success rate can be higher than 95%, even at the high vehicle density case. When the density is very high, it is hard to achieve the 95% PDR, but it can still outperform current protocols, such as VeMAC. This is a high improvement.

Conclusion
In this paper, we present an algorithm based on -disjunct code to allocate communication channels to nodes in a VANET. A distributed code assignment algorithm is proposed in order for each node to get the corresponding codeword. We also design a communication range control algorithm to dynamically change the transmission range based on the node density of the network. Theoretical analysis and simulation results show that our protocol can achieve a very high transmission and reception rate at a low collision rate. In the future, we will consider the more practical scenario to validate the performance when communication channels might be affected by other factors (e.g., noise, fading and shadowing).