The Performance Analysis of 802.11p with Cooperative Communication and Dynamic Contention Window

Road safety applications provided by the vehicular ad hoc networks demand less delay, high throughput, and reliable communication under highly dense traffic conditions. It becomes very challenging to design a network that suits the high mobility of vehicles and frequently changing network topology. In order to address the challenges in the network, this paper presents a new approach for dynamically adapting the contention window size (DYCW) based on vehicle density conditions. Along with that, cooperative relay vehicles are introduced for relaying the safety messages that failed to reach the destination. An analytical study of the proposed model is carried out, and the simulation results showed that using the DYCW mechanism enhances the system functioning by leading to higher throughput with stability in performance and decreases both the delay and the packet drop ratio (PDR) of the system.


Introduction
Vehicular ad hoc networks (VANETs) which form an integral component of intelligent transportation systems (ITSs) are experiencing rapid development in recent years. With the continuous development of ITS, VANETs have become an extensively researched field in recent years. Future ITS will enable vehicles to send and receive data about traffic jams, blind-spot warnings, emergency warnings for collision avoidance, and road safety situations to ensure efficient and safe travel [1]. VANET services provide vehicle safety, reduce road accidents, and enhance traffic efficiency. The major equipment used in the VANETs system can be classified into three parts namely: On-Board Units (OBUs), Road-Side Units (RSUs), and Global Positioning Systems (GPS). OBUs are located inside the vehicles, while RSUs are installed along the route to ensure vehicles with an internet connection. These RSUs must be installed in a strategic way so as to achieve broad coverage and help 1 3 in long-distance communications. Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure (V2I) are the two fundamental classes of communication architectures in VANET [2].
V2V communication helps the vehicles to easily achieve information and data sharing between themselves through the flexibility provided by the self-governing network. RSUs provide the necessary fixed infrastructure that ensures internet accessibility to vehicles. Safety applications require a fast broadcasting mechanism with a delay constraint of 100ms and a high degree of reliable communication [3,4]. According to the IEEE 802.11p protocol [5], VANETs use the Dedicated Short-Range Communications (DSRC) standard, which enhances both road safety and reliability of communication in the vehicular network. Hence for this purpose, the DSRC spectrum, at a particular frequency of 5.9 GHz and bandwidth (BW) of 75 MHz is set apart to be used for V2I and V2V communications. The whole bandwidth is further distributed into seven different frequency channels. One of them is CH178 which is also known as Control Channel (CCH). It is employed as an open/ public channel for the purpose of dissemination of safety messages on the road. The additional six channels function as Service Channels (SCHs) which are intended for non-safety message transmission utilized in the comfort driving applications [6].
Wireless Access in Vehicular Environments (WAVE) [2] is developed for ITS with additional functionalities that support networks in a vehicular environment. WAVE interacts with the wireless medium using an antenna and high transmission power, covering a transmission range varied from 300 to 1000 m. In RSU, the wireless interface uses the standard basic WAVE functionalities of MAC and PHY layers as defined in IEEE 802.11p protocol. This protocol utilizes Orthogonal Frequency-Division Multiplexing (OFDM) method on the physical layer, which is capable of achieving a bit rate of up to 27-Mb/s. The medium access control (MAC) layer provides fair sharing of the wireless medium and efficient broadcasting services. According to IEEE 802.11p, a vehicle employs either the Distributed Coordination Function (DCF) [7] or the Enhanced Distributed Channel Access (EDCA) [8] mechanism to access the medium. According to IEEE 802.11p MAC description [2], Contention Window (CW) is fixed initially and keeps changing with the failed transmission. Various techniques have been implemented to enhance the effectiveness and accuracy of broadcast services provided through the VANETs. However frequent variation in mobility among the vehicles and dynamic changes in the topology causes link breakage which leads to unstable communication. In such cases, Cooperative Communication (CC) can improve the system's throughput performance with the support of neighboring nodes [9], which mitigates the wireless channel impairment due to the mobility of the user. In addition, it utilizes unreserved time slots for the re-dissemination of data that were unable to reach the destination due to bad channel conditions. Unpredictable density and mobility of vehicles are the main impediments of VANETs that need to be considered. However if multiple neighboring vehicles choose the same CW size, the collision of packets may occur. Accepting a large-sized CW in a highly dense network environment can reduce the probability of packet collision. On the other hand, setting the CW size to a large value in sparse traffic conditions results in a longer time to transfer the safety message. To address this issue, an analytical model has been considered that broadcasts safety messages on the CCH in the 802.11p MAC in Vehicle Ad-hoc Networks (VANETs) using a dynamic contention window (DYCW) instead of a constant contention window (C-CW). The optimal size of CW is decided based on the vehicle density (N) to achieve the most reliable communication as explained in Algorithm 1.
Therefore, the motivation of this research is to provide a new mechanism that relies on both DYCW size and CC to enhance the stability and reliability of transmission by choosing an appropriate transmission mode with a relay vehicle in accordance with the channel condition. This proposed model based on CC with a DYCW for VANETs is the first work based on the broadcasting of safety messages. The results have been validated through simulation results.
Our contribution is as follows: 1. A rule-based model is presented to dynamically adjust the CW based on vehicle density (N), incorporating the use of CC to improve transmission reliability and stability. 2. Estimated both the average packet delay and the saturation throughput with the consideration of a DYCW and compare them with that of a fixed CW model. It gives suggestions on how to use the proposed algorithm in real-life scenarios. 3. The proposed method achieved reliable dissemination of safety packets while keeping the delay within 100 milliseconds. 4. Simulation results show that this proposed model outperforms other compared models and solve the trade-off between throughput and average packet delay using DYCW.
The remaining paper is structured as listed below: Sect. 2 provides a discussion of the saturated-based analytical model and a review of papers based on cooperative communication with C-CW. Section 3 discusses the DYCW rule-based model and safety message dissemination using both direct and cooperative transmission modes, along with an algorithm for the proposed model. Section 4 explains the proposed application of the 1-D Markov model under saturation conditions, considering erroneous channels, and provides an analytical examination. Section 5 presents simulation results for the proposed method. Finally, Sect. 6 details the conclusions and future work of the paper.

Related Work based upon Markov Chain model
Bianchi in [7] analyzed the behavior of DCF and proposed a two-dimensional (2-D) Markov model under saturation condition (where every node has data to transmit at every instance of time). However, in [7], the author considered ideal channel conditions while ignoring the average delay to disseminate the packet. Malone et al. [10] further analyzed Bianchi's model to examine the IEEE 802.11 DCF mechanism using an analytical model under the unsaturation condition. The papers mentioned above analyzed the 2D Markov chain model, which is appropriate for non-critical data transmission. However, for transmitting safety messages, the preferable model is the 1-D Markov chain. Caixia Song [6] studied the EDCA-based analytical model under both saturated and unsaturated network conditions, taking into account various factors such as virtual collision, retry limit, channel error, and channel switch for both safety and non-safety services. It was based on the IEEE 1609.4 and IEEE 802.11p protocols, which require vehicles to alternate between disseminating safety messages on the CCH and non-safety messages on the SCHs. The traditional EDCA mechanism was used, with a focus on the lowest value of CW size (8,16), which can lead to an increased packet drop ratio in scenarios involving high mobility and heavy traffic.
Huixian Wang et al. [11] investigated the non-ideal clustering model with practical traffic, mobility, and channel condition using one dimensional (1-D) Markov chain model under unsaturation condition wherein they considered a constant contention window (C-CW) for all type of vehicle density. [12] proposes an Adaptive Distributive MAC (ADC-MAC) protocol on the basis of Markov chain modeling that chooses the most appropriate helper node and transmission mode for data dissemination considering both the position of relay node and the channel condition. To avoid the collision problem [12] article used the three-way handshaking method which is time-consuming and impacts the average packet delay performance. In [13], Cooperative Ad-Hoc Medium Access Control (CAH-MAC) protocol has been considered with Time Division Multiple Access (TDMA) dependent networks. CAH-MAC provides a backup strategy for point-to-point dissemination although it does not provide broadcast and multi-hop communication. The authors in recent articles [14,15]) utilized the CoC approach to enhance the system's performance by utilizing a Markov chain decision model. In [16], the authors proposed a time division multiple access-based scheme that efficiently utilizes channel bandwidth (BW) for safety message transmission, using a dynamic CW mechanism to improve throughput performance. Despite this, the system's throughput could be enhanced by implementing cooperative communication, as it currently exhibits relatively low performance.
In [17], the authors suggested that the CoC helps to improve the system efficiency.
In Cooperative Relay Broadcast (CRB) [18] they have proposed an optimal helper selection approach for relaying with channel prediction technique. Although here too discussion on delay performance is lacking. The evaluation of throughput and delay performance in [19] was conducted using a Markov chain model, however, it overlooked practical channel conditions that involve the absence of error or fading channels. In [20] author considered an analytical model which shows the idle time of each link using the Markov reward model. Various pre-emption methods [21] for routing focus on reducing delay. With the help of edge computing, real-time monitoring of the traffic is addressed in [22]. In [23] the authors present the broadcasting of safety messages using semi markov chainbased analytical model with the consideration of hidden terminal and unsaturated packet arrival rate.
For the broadcasting of safety messages, RECV-MAC [1] proposed only a mathematical model that is founded on a 1-D Markov chain model with a fixed size of CW but the paper has not considered an erroneous channel. The approach presented extends the [1] by incorporating dynamic CW and erroneous channels, which are common in real-life scenarios.
All the above-mentioned techniques are based on Constant Contention Window (C-CW) for both dense and sparse vehicular network scenarios [1,10,11,24,25]. It has been proposed an analytical Markov chain model which takes into consideration erroneous channels and adjustment of the size of CW according to the network vehicle density. It is also noted that multi-hop communication has been incorporated, considering Cooperative Communication, through the use of two control packets namely negative acknowledgment (NACK) and capable to cooperate (CTC). The proposed model helps us achieve efficient and reliable performance in both sparse and dense network conditions.

Proposed Protocol (DYCW-MAC)
The MAC layer of VANET that is IEEE 802.11p, uses the same broadcast mode of transmission as the IEEE 802.11 DCF protocol [11]. Before disseminating a new packet, the vehicle first monitors the medium/channel activity and checks whether the medium is free or not. If the medium is found to be free (idle) for a specified time interval, that is distributed interframe space (DIFS), the vehicle node disseminates the packet immediately. On the other hand, if the vehicle node senses the medium to be busy, it waits for the random back-off time ( T b ) prior to transmitting of the data packet over the channel. This process reduces the collision among the packets that are disseminated by various vehicle nodes. The back-off time counter can be defined as where, CW 0 is the size of the CW, and T slot is the period of the back-off time slot [11].
The proposed protocol is explained in this section. In emergency cases, broadcasting is the basic delivery mode of data transmission. In the traditional IEEE 802.11p, there is no acknowledge (ACK) for unsuccessful data transmission [11]. So after the broadcasting of safety messages, the sender can not identify the unsuccessful transmission caused due to the collision of packet or due to channel deficiencies.
In broadcasting mode, reliability is poor because it is not feasible for every vehicle to transmit an ACK control frame to the source vehicle, as it causes an ACK storm. Accordingly, there is no rebroadcasting for an unsuccessful dissemination [1]. Although safety messages are very important to convey to all other vehicles in an emergency situation, it is required to introduce new control packet negative acknowledgment (NACK) for an erroneous message or failed transmission. If any of the nodes within the broadcasting range does not receives packet after Short Inter-frame Space (SIFS) time-period, then the node broadcasts NACK to all other neighboring nodes. In a realistic network, due to mobility and channel error, the channel between the sender to receiver is not reliable and if the separation between two vehicle nodes is greater than the dissemination range of vehicles, it is not possible to communicate the message from sender to receiver. To enhance the reliability of the transmission of safety messages, it has been introduced CC [9], which is discussed in detail in Sect. 3.2.

Rule-Based Model for CW Adjustment
In order to reduce packet collision during transmission and improve the stability of the system, it has been introduced a rule-based adjustment of CW. Algorithm 1, outlines the working of our CW adjustment process with vehicle density. The fixing of the back-off time counter is set to a randomly generated integer taken from the interval of [0-CW], where CW stands for existing contention window size. The randomly generated integer is taken to be uniformly distributed over the given interval. As per the IEEE 802.11p standard, CW size can vary from 16 to 1024 [2]. Packet collision in the network occurs when multiple neighboring vehicles in the dissemination range with respect to one another select the identical back-off time counter. As the number of transmitting vehicles rise the frequency of the collision also rises. Hence for this reason, selecting a relatively larger CW size when the number of neighboring transmitting vehicles is higher and choosing a smaller CW size during a low-traffic environment is desirable. Consequently, the sender vehicle will adjust the size of CW based on our predetermined model. Based on the analysis of the simulation results of the proposed model, it has been determined that optimal CW sizes have been established for different vehicle density environments, taking into consideration the trade-off between throughput performance and average packet delay.
In the case of VANETs, the sender node periodically gets the information of neighboring vehicles via the hello packet exchanged between the vehicles [26]. By gathering these periodic hello packets broadcast by the surrounding vehicles, a vehicle can detect location and mobility patterns of the neighboring vehicles. Accordingly, as per the collected data, each vehicle updates its CoopTable [27] dynamically in each time frame, as it is impossible to predetermined the data in case of mobile network. Depending on the N, CW 0 will be adjusted in the MAC layer of WAVE architecture which is based on 802.11p. For a specific N, the appropriate size of CW 0 is selected for effective broadcast.

Mode of Transmission
The procedure to disseminate the safety message using CC is given in Algorithm 2. This model considered a network that contains N vehicles moving along a road section with road length as R l =1000 m and road width as R w =15 m. The network includes an origin vehicle ( O v ), a destination vehicle ( D v ), and some potential relay node or helper node ( R v ) which provide CC. To optimize the dissemination of safety messages in different situations, two scenarios were proposed. One is a direct mode of transmission (DT) and another is a cooperative mode of transmission (CT) as shown in Fig. 1 CT: To reinforce CC, another new control packet capable to cooperate (CTC) is introduced to provide help in the dissemination of safety messages. When the channel quality between the source and the destination is unreliable and any of the neighboring vehicles of the source node has a comparatively good channel condition with respect to the destination node, a cooperative node can be used to convey the message to the destination node. In CC, It has been considered that the D v is able to sense medium and know that a message has been broadcast and that it failed to receive the packet [13].
To ensure the reliability of broadcasting of safety message O v waits for NACK before the timeout of successful transmission T suc . In the case O v does not receive any NACK, then a successful transmission has occurred. But if sender node receives a NACK ( Ov NACK ) from any of its neighbouring node, it means there is a failed transmission due to collision of packet or because of a hidden terminal problem [28]. After sensing the medium when D v recognizes failed transmission, D v broadcast NACK to its own neighboring vehicles ( S D ) in order to inform the O v . Broadcast NACK is received by the subset of neighbouring vehicle of both O v and D v , say S OD , which in turn will transmit the CTC to O v to inform about the failed transmission. CTC contains data such as -NACK-ID, sender address, a destination address, packet ID, relay's address and relay's SNR. After the CTC is received by O v , it selects an optimal helper relay based on SNR to re-transmit the message to D v using CC.
In this case, the sender node detects the failed transmission via CTC even though it does not receive NACK directly from the receiver node. Thus the use of CTC control packet significantly improves the reliability of the transmission. Hence the stability and reliability of the safety messages transmission is increased by the use of DYCW and control packets such as NACK and CTC that support CC and ensure successful transmission through the channel.

Performance Analysis of DYCW-MAC protocol
The focus of this article is to analyze the performance of the system under saturation conditions. For that purpose, the Markov chain analytical model is used, where the sequence of possible events is probabilistically dependent on the previously attained states.

System Assumption
The following are the assumptions taken to ensure that the analytical model presented complies with the IEEE 802.11p protocol: 1. It is assumed that all vehicles have an OBU and an Application Unit (AU) for data processing, and GPS to identify the location of surrounding vehicles, including themselves. Additionally, all vehicles are assumed to be moving with a constant velocity and have a coverage range of 300 m. 2. All considered vehicles can accomplish a CSMA/CA back-off mechanism accurately. 3. The network is considered to be in saturation condition, which means all the associated nodes always have a packet to transmit.
4. The two control packets introduced in the proposed model, namely NACK and CTC, are always received successfully at the node. 5. The channel is considered to be error-prone. The channel noise distribution is assumed to be white, that is the channel bit error is independent of each other and uniformly distributed. 6. A HELLO packet is a special type of packet that is periodically exchanged between the nodes to establish and validate network proximity relationships and discern parameters such as local density, distance, and direction of the surrounding vehicles. 7. Every node maintains a cooperative table; which stores information about the neighboring vehicles and assists the node to make relaying judgments.
The focus area is the periodic dissemination of safety messages through the CCH. In this model, it is assumed that the generation rate of a packet is deterministic. The vehicles are assumed to be moving along the road in accordance with Poisson process [11] with arrival rate . The probability of N vehicles available within the considered length of road segment l is written as P(N, l) in (2)

Modeling Safety Message Dissemination in Saturated Networks Using a 1-D Markov Chain
For safety messages dissemination, one-dimensional (1-D) Markov chain model is used for the periodic broadcast in VANET [1]. Let the stochastic process of back-off time counter for every vehicles at time t be expressed by b(t) given as b(t) ∈ 0, CW 0 − 1 . Considering the back-off counter value in markov state is B c ∈ CW 0 − 1 . It is to be noted that, in this markov model post back-off feature is not included [10]. Let q a and p busy be the probability of arrival packet and channel busy, correspondingly. The effective single-step transition probability as demonstrated in [1], can be defined through (3) to (5).
At the outset, a node first senses the channel for inactivity before initiating packet transmission. When the medium is idle, the back-off counter B c is decreased by 1 with the probability ( 1 − p busy ) shown as (3). If the B c value is zero then the B c is chosen evenly from the range [0, CW 0 − 1] with the probability q a shown as (4). The B c is frozen when the channel is found to be busy shown as (5).
In DYCW-MAC protocol, CW 0 is not fixed. It changes with the N. The subsequent solution can be achieved from the steady-state Markov chain model [11].
Hence, the stationary distribution can be written as (6).
b 0 can be obtained by employing the normalization condition given as (7) From the markov chain model b B c can be written in terms of b 0 as (8) Let transmission probability( p tr ) of a packet transmitted by a vehicle in a random slot time be written as (9) P col is used to indicate the probability of collision when the remaining (N − 1) vehicles transmit a packet simultaneously across the channel as (10) If one or more vehicle nodes among N transmits a message within the range of R, that channel is treated as a busy channel. It is denoted by p busy where N vehicles contend for the channel, which can be shown as (11) p suc is the probability of successful dissemination of safety message when a packet has successfully reached the destination vehicle. This can be given as (12) where C cond shows the condition of the channel. It can be either better or worse state designed to be a two-state Markov model [1]. A cooperative decision can be possible if one extra node will be present along with the O v and S v in the transmission range. This decision is taken by the O v with cooperative decision probability which can be written as (13) where p R is given in equation (23) In the case where the packet is successfully disseminated to the destination either through DT or CT mode after an unsuccessful transmission, p suc−CT can be written as (14) Let P err be the error probability [29] of failed transmission due to dissemination error where p ber1 and p ber2 are the bit error probabilities of control frame NACK and data frame respectively.
where L P , L D and L M are lengths of the physical header, the packet size, and the MAC header respectively. It has been considered constant error probability which is 3.0 * 10 −1 for 512 bytes of packet length [25]. One of the most commonly used traffic models, following a Poisson process with a fixed packet arrival rate a , is taken into consideration. The packet arrival probability in a time slot is q a = 1 − e − a E(T) , where E(T) is the average expected time of a vehicle, which is appropriate to describe the condition of Markov Model [25] with the definite time spend in every state. The values of E dt (T) (as expressed (16)) and E ct (T) (as expressed (17)) can be calculated by taking into account the duration and probability of various slot types.
where T slot is the duration of empty slot time. T suc−dt and T suc−ct are the duration for the successful transmission in case of direct and cooperative modes respectively. T err is the transmission time where an erroneous packet is received and T col is the average period for transmission with collision [11]. For the proposed protocol T suc−dt , T suc−ct and T col for the safety message can be defined as (18), (19) and (20).
The variables L p and L h refer to the length of the data and header sections in the PHY and MAC layers, respectively. L c is the length of the cooperation frame header and T d is the propagation delay. MAC header and data are both disseminated at data rate R d while both control packets, NACK and CTC, are disseminated at basic data rate R c as mentioned in Table 1. By using this, the numerical results of the throughput performance, average packet delay, and packet delivery ratio of the DYCW-MAC protocol with cooperative communication can be obtained.

Saturation Throughput Analysis
The computation of maximum achievable throughput S max , which is described as the ratio of average packet information disseminated over an average period of a time slot. This can be expressed as (21) E dt (T) = (1 − p busy )T slot + p busy p suc T suc−dt (1 − p err ) + p busy (1 − p suc )T col + p busy p suc−dt p err T err (17) E ct (T) = (1 − p busy )T slot + p busy p suc−ct T suc−ct (1 − p err ) + p busy (1 − p suc−ct )T col + p busy p suc−ct p err T err (18) therefore, throughput for cooperative and direct transmission can be given as (22) and (24) p R is the probability of not getting any relay vehicle between the source and the destination vehicle, in the case of cooperative communication, when the source vehicle wants to disseminate safety message to the destination vehicle. p R can be defined as (23) here R v is the availability of the relays. Excluding the source vehicle and the destination vehicle, the possible number of relays can be in the range of 0 to (N − 2).   (27) and (28)

Analysis of the Packet drop
If two nodes disseminate the packet at the same point in time or because of the hidden node problems, the collision can occur which can lead to a dropped packet. p drop is the probability that a packet is dropped at a receiver and can be stated as (29) Final drop probability of a packet (meaning a packet is dropped at the receiver) is indicated as p drop . Using this, the average number of packets dropped in successful dissemination can be stated as (30) E[T drop ] for both the case of DT and CT, is the mean time period to drop a packet, which can be given by (31) and (32) E[X drop ] represents the length of time during which a packet is dropped because its transmission was unsuccessful. This value can be calculated using (33).

Simulation Result and Analysis of DYCW-MAC protocol
This section reviews the simulated results of the DYCW-MAC protocol and compares its performance with that of the fixed-size CW based protocol [1], modeling and clustering and traditional model [11]. The key performance parameters of the suggested protocol have been numerically evaluated using simulation analysis using Monte Carlo simulation in MATLAB 2021. b version. A broad section of a road with a width of 15 m and a length of 1000 m was considered. A S v is placed at the end of the road at a predefined location where the generated message is to be transmitted. The whole road is then divided into predefined 10 zones (each of width 7.5 m and length 200 m) for further analysis. In the simulation, a range of vehicle densities (i.e., the number of vehicles/nodes on the road strip varies from 1 to 100) has been considered, and for each considered number of nodes, 70 iterations have been carried out. When the message successfully reaches the sink node, the transmission is considered successful and parameters namely average packet delay, throughput, and packet drop ratio are calculated and stored. The following results were obtained by taking into consideration the parameters [1,11,24] that are given in Table 1.
In the original RECV-MAC model [1], the authors have not considered erroneous channel but this paper introduced error [24] P err = 3.0 × 10 −1 in the analytical model of RECV-MAC. In the proposed model, the parameter p R has a major impact on the system throughput (see eq. 23). Performance analysis of the periodic broadcast with different p R and CW 0 is provided in Figs. 2, 3, 4 and 5. It can be observed that high values of p R i.e p R ≥ 0.7 turns out to be the worst-case as it leads to fewer chances of getting relay in this condition. p R = 0.5 is considered to be the normal case, while p R ≤ 0.4 is considered to be the bestcase scenario, resulting in higher throughput due to the increased chances of a relay node conveying a message from source to destination. In VANETs, timely and accurate reception of safety messages is of utmost importance, making a lower value of p R desirable. Figure 2 displays the evolving behavior of saturated throughput as a function of the N in the network for distinct values of p R with the CW 0 = 32 . The graph demonstrates that for less number of vehicles (up to 20) the throughput performance is good. However, as N increases, throughput starts to decrease due to higher probability of packet collision. The less value of p R means that there are a higher number of relays present in the network to convey messages between the source vehicle and the destination vehicles and Figure 2 reveals that as the relay density decreases (increasing p R ) the throughput of the network reduces significantly. This shows that the use of the helper node assists in maximizing the throughput and service range of the VANETs.  It can be observed that as the CW 0 size increases collision probability decreases for a smaller value of p R . Observation can be made that in the case of CW 0 = 128 , the saturation throughput performance tends to saturate with increasing value of N while the case of CW 0 = 64 shows that the throughput performance decreases rapidly with the growing N, because of the increased packet collision.
Observing the case of CW 0 = 512 in Fig. 5, two vital conclusions can be obtained. First, the use of larger values of CW 0 for lower N in the network results in reduced throughput performance. This is because the average packet delay increases with the back-off time counter leading to less throughput. A larger value of CW 0 , in the case of a dense vehicular network, results in higher throughput due to a decrease in packet collision probability. A larger CW 0 size can aid in reducing packet collision because a longer back-off time reduces both the packet loss and the probability of selecting a similar back-off time by the remaining vehicle nodes that have a packet to broadcast. Another conclusion that can be drawn is that for smaller CW 0 size, throughput declines as the N in the network increases. Whereas for larger CW 0 size, throughput attains a saturation point after the network reaches a certain number of vehicles, and further addition of vehicles in the system has no effect on the throughput value. Besides noting that the high throughput is achievable for the low value of the N. Notice that in Fig. 5, for a low value of p R , the throughput manifests a linear behavior.
For a lower number of vehicles (low network density), our dynamic contention window model mimics the fixed CW 0 = 64 system in terms of network throughput and beats the performance of higher-sized CW systems. Similarly for higher network densities, in terms of network throughput performance, the DYCW model mirrors the performance of CW 0 =512 while it significantly outperforms the lower-sized CW systems. This shows us that our model by dynamically adjusting the CW size is able to provide the best of both worlds i.e. by offering a smaller CW size in case of a low vehicle density network and by ensuring a larger CW size in case of dense network conditions. Figure 6 demonstrates the throughput performance with respect to N for different values of p R for the DYCW model, where the CW 0 is adjusted based on rules given in Algorithm 1.
The results show that the proposed DYCW strategy is superior to the fixed CW in the case of broadcasting safety messages for all densities. For lower vehicle densities, a lower value of CW is set, and vice-versa for higher network densities. It can be observed that the proposed model exhibits improvement by providing higher saturation throughput performance and less average packet delay than the fixed CW strategy in both sparse and dense vehicular environments.
Various research papers have carried out throughput performance analysis of existing cooperative MAC mechanisms under similar network conditions. In a few of the selected papers namely [30,31] maximum throughput achieved is close to 3.4 and 5 Mbps respectively. All of the above-mentioned papers have considered the constant size of the CW for all types of N. Our proposed protocol with DYCW size achieves a maximum throughput of around 21.51 Mbps without the consideration of the erroneous channel and 14.39 Mbps with the erroneous channel as shown in Table 2. The most important thing to note is that the throughput performance is not decreasing with an increase in N.
In our case, maximum throughput is quite less sensitive to the increase in N whereas in the above-discussed papers throughput performance degrades as the N increases. In the mentioned papers namely [13,18] performance analysis of average packet delay is not discussed. The delay requirement of safety message is not met in [32,33]. Whereas the proposed protocol satisfies the delay constraint of 100ms for the safety messages.  In RECV-MAC with fixed CW, the throughput performance decreases rapidly with the high N whereas in DYCW-MAC the vehicle does not enable the dissemination process until the medium becomes idle for transmission. It is observed that when the N increases, the chances of collision occurs more frequently, respectively vehicle requires  a large CW size resulting in decreases in the number of packet collision, while in sparse N, the smaller size of CW accesses the channel efficiently. At every time instant before the transmission of any packet, the vehicle checks the status of N via the hello packet and sets the size of CW according to the Algorithm-1 discussed earlier. From Fig. 7, it can be observed that the DYCW-MAC protocol experienced a relatively larger throughput performance with an increase in N. The main advantage of the DYCW-MAC protocol is to improve the stability and reachability of the system. As illustrated in Fig. 7, the DYCW-MAC protocol experienced a relatively better throughput performance. Table 2 shows the numerical results of all the discussed models. Figure 8 compares the proposed model, DYCW-MAC, with other considered models in terms of throughput performance as N changes. The figure clearly shows that the proposed model outperforms all other considered models. Both the analytical and simulation results of the proposed model are compared. This scheme with DYCW provides stable throughput performance compared to the individual CW = 128 with varying vehicular density environments. In the RECV-MAC, the CW is fixed for all N and the throughput decreases with an increase in N, whereas in the proposed model, the CW 0 is adjusted with N so that the throughput performance remains nearly constant from 20 to 100. Figure 9 shows the average delay versus N with different CW 0 . When CW 0 is 512, a larger back-off time counter results in fewer collisions and reduced packet loss, leading to a decrease in the packet dropping rate. It can also be observed that the average packet delay increases as the number of vehicles increases for a given CW 0 . Figure 10 compares the average packet delay (APD) performance between RECV-MAC [1] and other proposed models that consider erroneous channels and DYCW. The graph shows that RECV-MAC with error consideration of DYCW-MAC outperforms other protocols, validating that DYCW-MAC can select the most suitable size of CW 0 and relay vehicle for data dissemination based on N and the channel quality between the Fig. 8 Comparison of throughput performance with N for the considered models source and destination vehicle. It can also be seen from Fig. 10 that the delay performance of DYCW-MAC with error with increasing N is the least. This happens because DYCW-MAC adjusts the size of CW 0 according to N which reduces the chances of packet collision leading to the packet reaching the destination more efficiently. Whereas  in the case where fixed CW 0 is set to a lower value and where N is high, more packet collision occurs. Because of packet collision, the source has to retransmit the packet after the receiving NACK packet and this increases the time duration for the packet to reach the destination successfully.   Figure 11 compares the DYCW-MAC model with other models (RECV-MAC and traditional MAC in [1] and [11]). The figure shows that the proposed model outperforms all the considered models. Figure 12 illustrates the packet dropping rate versus the N. The results are obtained with different CW 0 sizes of 16, 32, 64, 128, and 256. The figure shows that when CW 0 = 16 , the packet collision increases as N increases, thus a larger CW 0 size reduces packet collisions by providing a longer back-off time. As CW 0 increases from 16 to 32, the packet dropping rate decreases from 0.99 to 0.96, and from 0.96 to 0.63 when CW 0 = 64 . An improvement in the size of CW 0 results in a significant decrease in the packet drop ratio with respect to N. If the number of vehicles is raised to 100 and the CW 0 size is increased from 16 to 256, it results in a reduction of 81% in the Packet Delivery Ratio (PDR).

Conclusions and Future Work
A cooperative MAC protocol for VANETs based on 802.11p, with DYCW, was analyzed using a mathematical model and simulation. Additionally, It introduces an algorithm that facilitates the dissemination of safety messages during emergency scenarios while optimizing the CW size based on variable density. By varying the CW size, the study assesses the correlation between throughput, average packet delay (APD), and packet delivery ratio. The protocol enables the transmission of safety messages with an average packet delay of 100ms or less. The results reveal that the protocol's stability and reliability are improved when the CW size is dynamically adjusted based on network vehicle density. The DYCW-MAC protocol outperforms the RECV-MAC protocol, with and without erroneous channel considerations. In the future, studies will focus on investigating how a fading channel affects the unsaturation model, as well as implementing an artificial neural network algorithm that can automatically adjust the size of CW.
Funding The author declares that no funds, grants, or other support were received during the preparation of this manuscript.

Data availability
The data sets generated during the current study are not publicly available due to laboratory regulations.