# Cross-Layer and Energy-Aware AODV Routing Protocol for Flying Ad-Hoc Networks
## 4 Materials and Methods
### Cooperative MAC Design for Cross-Layer Approach  
Cooperative MAC first interacts with a random-access mechanism utilizing CSMA/CA. The data collection tree and TDMA schedules are established during the setup phase. 1. Topology Discovery  
The base station uses a basic flood mechanism to start the building of the tree. Our approach is comparable to the PEQ routing protocol's hop tree configuration. The objective of topology discovery in our environment is not just to build a routing tree but also to identify neighbors and monitor tree modifications. The base station produces a message TOPOLOGY DISCOVERY, consisting of the hop_count, new_parent_id, and old_parent_id. This message is sent via a node to locate your future offspring as well as a reply to their parent and a notice to their predecessor if they wishes to change their parent. Every node reports its hop count in this phase to the base station, parent ID, children's list, and a one-hop neighbor list. 2. Assignment of TDMA Slot  
At this level, the nodes are switched and distributed so that there is no space for two nodes in a 2-hop neighborhood. Our TDMA slot allocation is performed using the downward method through which the slot allocation begins with a leaf node (node without children). Our aim was to develop a communication method to allow the message to flow from the base station to start the slot assignment from the leaf nodes. The other nodes will wait (except the base station) until all of their children report their scheduled activities before a single unicast slot, multiple unicast slots, and the diffusion slot are assigned for their children. The slot assignment phase ends when the base station receives messages from all of its descendants SCHEDULE_NOTIFICATION. By transmitting the initial SCHEDULE_NOTIFICATION message, the base station switches to TDMA. When the children get the message, they switch to TDMA and sync the activities through the slots. 3. Regional Time Synchronization  
Cooperative MAC manages local time synchronization through the FTSP root neighbor via parent-synchronization [22] children's transmission. This simple approach is sufficient for us since each child must have a clock identical to their parent to ensure that the parent obtains information from the child. A \(sender\_1D\), \(current\_slot\) is the SYNCHRONISATION message to synchronize new nodes, the \(highest\_slot\) to report TDMA frame length, and \(hop\_count\) to assist a new node in selecting its prospective parent. Urgency Queue  
Cooperative-MAC includes several queues to distinguish between high priority and low priority packets. The packet is sorted in a slack queue until the deadline expires and is listed in the packet's header. The slack is updated on each hop, reducing the delays in waiting and transmission. The fundamental principle is to transmit high-priority packets first until the high-priority queue is empty. If the queue is filled, we will most likely refuse the slack packet since the deadline is missed. We adjust the queue by maintaining the packet source fair, so the base station has an information balance between all nodes. When the reporting frequency rises, a node may have many of its data. If the node continually receives a packet from its queue head, it may transmit more of its data than its offspring. Prioritization of MAC  
The ER-MAC-frame consists of \(tS-duration\) free containment slots with \(tC-duration\), as illustrated in Figure 5. Except for the sync slot, sub-slots t0, t1, t2, and t3 are solely in contest emergency mode in each contest-free slot. Note that the \(tS-(t0+t1+t2+t3)\) is suitable for emergency mode and is sufficient for the sub-slot to include a MAC header (a source, a destination, and a flag). The transmitter occupies a slot in conventional mode from the beginning of the slot, and after transmitting, the packet sleeps. We have a dispute time after a frame so that more nodes may be inserted. Communication follows the schedules of the nodes during regular monitoring.