# A Preemptive-Resume Priority MAC Protocol for Efficient BSM Transmission in UAV-Assisted VANETs
## 3 System Model
### The MAC Layer Communication Protocol
The packet scheduling is based on considerations of timeliness since the unmanned vehicle has a limited capacity to process messages within a given time period. Therefore, the protocol prioritizes the processing of data packets from vehicles in the high-speed section. Here is the specific priority order:  
* Packets from Buffer-A
* Packets from Buffer-B
* Packets from Buffer-C  
In this order, the Arbiter will allocate resources and schedule packet transmission accordingly. As shown in Figure 4, the queue currently contains one data packet with priority 2 and two data packets with priority 3. At this moment, when a data packet with priority 1 arrives, it interrupts the queue and is prioritized for processing. Figure 4: Max Priority Queue. Figure 3: Basic Structure Diagram of the MAC Layer Protocol. The following is a description of the protocol steps for the Preemptive-Resume Priority 802.11 CSMA/CA [48] with an arbiter in this article; the flowchart is shown in Figure 5.  
Step 1: Initialization  
Each node determines its own priority and sets reasonable initial contention window sizes, maximum backoff times, and an arbiter node to coordinate the priority transmission order between nodes and the preemptive interruption (including the buffer). Step 2: Contention Stage  
* When a node is ready to send data, it first sends requests to the Arbiter and carries its priority information. * The Arbiter sets different listening times for different priorities brought by each node (shorter for higher priority, and so on, defined as High Distributed inter-frame space (HDIFS), Middle Distributed inter-frame space (MDIFS), and Low Distributed inter-frame space (LDIFS)). If the channel is idle during the listening time, the contention channel stage is entered; otherwise, the backoff mechanism is triggered. Step 3: Backoff Mechanism  
This article employs the backoff mechanism of IEEE 802.11 standard DCF, which uses a binary exponential backoff method with a backoff time range of \((0,W_{j}-1)\). \(J\in(0,m)\) represents the current backoff stage, and \(W_{j}\) represents the corresponding contention window size. \(W_{j}=2^{j}W\) is equal to 2 to the power of \(J\), where \(m\) is the maximum backoff stage specified in the 802.11 standard, and \(W\) is the initial contention window size (as set in step 1). The backoff counter takes a value of \((0,W_{j})\) and decreases by one for every time slot when the channel is idle; otherwise, it remains unchanged. If a collision occurs (i.e., multiple nodes have the same priority or the Arbiter indicates preemption is allowed, causing these nodes to potentially send data simultaneously), the contention window of the colliding nodes doubles to reduce the collision probability. The node enters the contention phase when the backoff counter countdown ends; otherwise, it continues to wait and updates the counter. Step 4: Contention Channel  
After the backoff counter of a node reaches zero, the node sends another request to the Arbiter. The Arbiter evaluates the priority of the node and considers other ongoing transmissions to determine the next node for data transmission. If the current node has the  
Figure 5: Protocol Flowchart. highest priority or the Arbiter indicates that the node can preempt, the node immediately sends the data. Otherwise, the node continues to wait. Step 5: Data Transmission  
Nodes that obtain permission from the Arbiter start transmitting data. Other nodes temporarily stop sending data and continue to monitor the channel state upon detecting channel occupancy. Step 6: Channel Release  
Upon completion of data transmission, the node releases the channel and notifies the Arbiter that the channel is idle, allowing other nodes to contend for the channel. In summary, in this scenario, we need to consider the following aspects:  
Reasonable selection of UAV altitude and communication range. Considering the transmission time from vehicles to UAVs, calculate the MAC layer service time. The queuing time is calculated using the designed UAV MAC layer protocol.