## 3 System Model
### Intra-Cluster Communication Session  
After the clusters are formed, communication takes place within each cluster during communication sessions. In each session, the contention time for the handshake mechanism is divided into mini slots within which the nodes indicate their intention to transmit data. The nodes contend for the medium using CSMA/CA employed by IEEE 802.11 MAC protocol, through RTS packet transmission to the CH. During the Schedule period the CH uses the source nodes' information on the received RTS packets from the SNs, and prepares slot reservations based on an adaptive cross-layer schedule. The cross-layer schedule uses the remaining energy and the amount of data traffic on each SN to decide which nodes should be scheduled first. The nodes with the least energy to packets ratio, calculated from the RTS packet information, are scheduled earliest. If the destination intended for the source packets is not available or dead, the node will not be scheduled but will drop such packets. Once the schedule is done, the CH broadcasts the schedule to all nodes within the cluster. After the schedule announcement, data communication takes place, according to the schedule. Scheduled nodes transmit at their scheduled time, and when a node completes transmission, it goes to sleep until next session. The nodes that are not scheduled sleep until the next session begins. Every node follows a transmission frame, subdivided into time slots as shown in Figure 4a. The time slots are decided based on the amount of communication required for each packet and the bandwidth utilization depending on whether a message is a unicast or a broadcast message. The session communication is outlined in Algorithm 2. ```




The node is then allocated the particular slot. The schedule then reduces the job array for the node by 1 and updates the energy level. If the packet to energy ratio is same for some nodes, the schedule will prioritize the node that was scheduled in previous slot. The process is repeated while there are still available slots to schedule and there are jobs in the job array as illustrated by Algorithm 3. ```
CH checks available slots, Whileavailable_slots > 0 do  Store the transmission request in job array,  Store the energy level in resources array,  CH calculates \(\varphi_{i}\) for SNs based on packets and energy level,  Determine SNs with maximum \(\varphi_{i}\), IfSN's \(\varphi_{i}=\)maximumthen  Schedule SN for next available slots for its data transmission, ElseifSNs have same value of \(\varphi_{i}\)then  Check SN scheduled in the previous slot and schedule it for the next available slot, Endif  update SN energy level,  update SN packets,  update available slots, Endwhile
```
**Algorithm 3** Scheduling Algorithm

### Cooperative Inter-Cluster Communication

The inter-cluster communication adopts the basic model for cooperative communication implemented in [15], with an extension of using more than one relay node in this work. The communication involves proactive cooperative communication between cluster heads (CH), the base station (BS) and possible relay cluster heads (RCH) and is illustrated by Figure 5. The relay selection cost is the function of CQI, remaining energy level and the distance away from the BS. The communication is in two phases, direct and cooperative transmission phase. Figure 5: Cooperative Communication. #### 3.4.1 Direct Transmission

A CH that has data to send to the BS indicates its request for transmission by sending an RTS packet to the BS. The BS calculates the CQI and attaches its value on the CTS packet to the CH. CH uses CQI and distance to decide the transmission phase. If CQI indicates that the channel is good direct transmission takes place, if the channel is fair and the communication distance is below the separation distance threshold also direct transmission is implemented. A CH then transmits its data packets to the BS.